Roof models improved. Conditional recipe tag dependency handling fixed (issue #120).

This commit is contained in:
stfwi 2020-08-24 15:41:55 +02:00
parent 3ac2f301de
commit 45fed1f374
40 changed files with 400 additions and 343 deletions

View file

@ -333,19 +333,19 @@ public class ModContent
public static final DecorBlock.DirectedWaterLoggable INSET_LIGHT_IRON = (DecorBlock.DirectedWaterLoggable)(new DecorBlock.DirectedWaterLoggable(
DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT|DecorBlock.CFG_AI_PASSABLE,
Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL).func_235838_a_((state)->15).notSolid(),
Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL).setLightLevel((state)->15).notSolid(),
Auxiliaries.getPixeledAABB(5.2,5.2,0, 10.8,10.8,0.3)
)).setRegistryName(new ResourceLocation(ModEngineersDecor.MODID, "iron_inset_light"));
public static final DecorBlock.DirectedWaterLoggable FLOOR_EDGE_LIGHT_IRON = (DecorBlock.DirectedWaterLoggable)(new DecorBlock.DirectedWaterLoggable(
DecorBlock.CFG_CUTOUT|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE,
Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL).func_235838_a_((state)->15).notSolid(),
Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL).setLightLevel((state)->15).notSolid(),
Auxiliaries.getPixeledAABB(5,0,0, 11,2,0.5)
)).setRegistryName(new ResourceLocation(ModEngineersDecor.MODID, "iron_floor_edge_light"));
public static final DecorBlock.DirectedWaterLoggable CEILING_EDGE_LIGHT_IRON = (DecorBlock.DirectedWaterLoggable)(new DecorBlock.DirectedWaterLoggable(
DecorBlock.CFG_CUTOUT|DecorBlock.CFG_LOOK_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE,
Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL).func_235838_a_((state)->15).notSolid(),
Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL).setLightLevel((state)->15).notSolid(),
new AxisAlignedBB[]{
Auxiliaries.getPixeledAABB( 0,15.5,0, 16,16,2.0),
Auxiliaries.getPixeledAABB( 0,14.0,0, 16,16,0.5),
@ -356,7 +356,7 @@ public class ModContent
public static final DecorBlock.DirectedWaterLoggable BULB_LIGHT_IRON = (DecorBlock.DirectedWaterLoggable)(new DecorBlock.DirectedWaterLoggable(
DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_OPPOSITE_PLACEMENT|DecorBlock.CFG_AI_PASSABLE,
Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL).func_235838_a_((state)->15).notSolid(),
Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL).setLightLevel((state)->15).notSolid(),
new AxisAlignedBB[]{
Auxiliaries.getPixeledAABB(6.5,6.5,1, 9.5,9.5,4),
Auxiliaries.getPixeledAABB(6.0,6.0,0, 10.0,10.0,1.0)
@ -445,7 +445,7 @@ public class ModContent
public static final DecorBlock.DirectedWaterLoggable SIGN_MODLOGO = (DecorBlock.DirectedWaterLoggable)(new DecorBlock.DirectedWaterLoggable(
DecorBlock.CFG_CUTOUT|DecorBlock.CFG_FACING_PLACEMENT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_AI_PASSABLE,
Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(1f, 1000f).sound(SoundType.WOOD).func_235838_a_((state)->1).notSolid(),
Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(1f, 1000f).sound(SoundType.WOOD).setLightLevel((state)->1).notSolid(),
Auxiliaries.getPixeledAABB(0,0,15.6, 16,16,16.0)
)).setRegistryName(new ResourceLocation(ModEngineersDecor.MODID, "sign_decor"));

View file

@ -191,8 +191,8 @@ public class EdBreaker
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt); }
@Override
public CompoundNBT write(CompoundNBT nbt)

View file

@ -136,7 +136,7 @@ public class EdChair
boolean on_top_of_block_position = true;
boolean use_next_negative_y_position = false;
EntityChair chair = new EntityChair(world);
BlockPos chair_pos = chair.func_233580_cy_();
BlockPos chair_pos = chair.getPosition();
chair.chair_pos = pos;
chair.t_sit = 5;
chair.prevPosX = chair_pos.getX();

View file

@ -188,8 +188,8 @@ public class EdCraftingTable
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt); }
@Override
public CompoundNBT write(CompoundNBT nbt)
@ -214,7 +214,7 @@ public class EdCraftingTable
@Override
public void handleUpdateTag(BlockState state, CompoundNBT tag) // on client
{ func_230337_a_/*read*/(state, tag); }
{ read(state, tag); }
@OnlyIn(Dist.CLIENT)
public double getMaxRenderDistanceSquared()
@ -280,7 +280,7 @@ public class EdCraftingTable
@Override
public boolean isUsableByPlayer(PlayerEntity player)
{ return getPos().distanceSq(player.func_233580_cy_()) < 36; }
{ return getPos().distanceSq(player.getPosition()) < 36; }
@Override
public void openInventory(PlayerEntity player)
@ -1086,17 +1086,16 @@ public class EdCraftingTable
}
@Override
public void func_231160_c_/*init*/()
public void init()
{
super.func_231160_c_();
super.init();
final int x0=guiLeft, y0=guiTop;
buttons.clear();
if(with_assist) {
// func_230480_a_() === addButton(), now more addWidget()
buttons.add(func_230480_a_(new ImageButton(x0+158,y0+30, 12,12, 194,44, 12, BACKGROUND, (bt)->action(CraftingTableContainer.BUTTON_NEXT))));
buttons.add(func_230480_a_(new ImageButton(x0+158,y0+16, 12,12, 180,30, 12, BACKGROUND, (bt)->action(CraftingTableContainer.BUTTON_PREV))));
buttons.add(func_230480_a_(new ImageButton(x0+158,y0+44, 12,12, 194,8, 12, BACKGROUND, (bt)->action(CraftingTableContainer.BUTTON_CLEAR_GRID))));
buttons.add(func_230480_a_(new ImageButton(x0+116,y0+10, 20,10, 183,95, 12, BACKGROUND, (bt)->action(CraftingTableContainer.BUTTON_NEXT_COLLISION_RECIPE))));
buttons.add(addButton(new ImageButton(x0+158,y0+30, 12,12, 194,44, 12, BACKGROUND, (bt)->action(CraftingTableContainer.BUTTON_NEXT))));
buttons.add(addButton(new ImageButton(x0+158,y0+16, 12,12, 180,30, 12, BACKGROUND, (bt)->action(CraftingTableContainer.BUTTON_PREV))));
buttons.add(addButton(new ImageButton(x0+158,y0+44, 12,12, 194,8, 12, BACKGROUND, (bt)->action(CraftingTableContainer.BUTTON_CLEAR_GRID))));
buttons.add(addButton(new ImageButton(x0+116,y0+10, 20,10, 183,95, 12, BACKGROUND, (bt)->action(CraftingTableContainer.BUTTON_NEXT_COLLISION_RECIPE))));
}
{
List<TipRange> tooltips = new ArrayList<>();
@ -1104,31 +1103,31 @@ public class EdCraftingTable
String[] translation_keys = { "next", "prev", "clear", "nextcollisionrecipe", "fromstorage", "tostorage", "fromplayer", "toplayer" };
for(int i=0; (i<buttons.size()) && (i<translation_keys.length); ++i) {
Button bt = buttons.get(i);
tooltips.add(new TipRange(bt.field_230690_l_/*x*/,bt.field_230691_m_/*y*/, bt.func_230998_h_/*getWidth*/(), bt.func_238483_d_/*getHeight*/(), Auxiliaries.localizable(prefix+translation_keys[i])));
tooltips.add(new TipRange(bt.x,bt.y, bt.getWidth(), bt.getWidth_CLASH/*getHeight*/(), Auxiliaries.localizable(prefix+translation_keys[i])));
}
tooltip.init(tooltips);
}
}
@Override
public void func_230430_a_/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
public void render(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
{
if(with_assist) {
boolean is_collision = getContainer().has_recipe_collision();
buttons.get(3).field_230693_o_/*visible*/ = is_collision;
buttons.get(3).field_230694_p_/*active*/ = is_collision;
buttons.get(3).visible = is_collision;
buttons.get(3).active = is_collision;
}
func_230446_a_/*renderBackground*/(mx);
super.func_230430_a_(mx, mouseX, mouseY, partialTicks);
renderBackground(mx);
super.render(mx, mouseX, mouseY, partialTicks);
if(!tooltip.render(mx,this, mouseX, mouseY)) func_230459_a_/*renderHoveredToolTip*/(mx, mouseX, mouseY);
}
@Override
protected void func_230459_a_(MatrixStack mx, int mouseX, int mouseY)
protected void func_230459_a_/*renderHoveredToolTip*/(MatrixStack mx, int mouseX, int mouseY)
{
if((!player.inventory.getItemStack().isEmpty()) || (getSlotUnderMouse() == null)) return;
final Slot slot = getSlotUnderMouse();
if(!slot.getStack().isEmpty()) { func_230457_a_/*renderTooltip*/(mx, slot.getStack(), mouseX, mouseY); return; }
if(!slot.getStack().isEmpty()) { renderTooltip(mx, slot.getStack(), mouseX, mouseY); return; }
if(with_assist) {
int hist_index = -1;
if(slot instanceof CraftingResultSlot) {
@ -1139,22 +1138,22 @@ public class EdCraftingTable
if((hist_index < 0) || (hist_index >= history_slot_tooltip.length)) return;
if(!history_slot_tooltip[hist_index]) return;
ItemStack hist_stack = getContainer().history().current().get(hist_index);
if(!hist_stack.isEmpty()) func_230457_a_/*renderTooltip*/(mx, hist_stack, mouseX, mouseY);
if(!hist_stack.isEmpty()) renderTooltip(mx, hist_stack, mouseX, mouseY);
}
}
@Override
protected void func_230451_b_(MatrixStack mx, int x, int y)
protected void drawGuiContainerForegroundLayer(MatrixStack mx, int x, int y)
{}
@Override
@SuppressWarnings("deprecation")
protected void func_230450_a_/*drawGuiContainerBackgroundLayer*/(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
protected void drawGuiContainerBackgroundLayer(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
{
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
getMinecraft().getTextureManager().bindTexture(BACKGROUND);
final int x0=guiLeft, y0=guiTop;
func_238474_b_(mx, x0, y0, 0, 0, xSize, ySize);
blit(mx, x0, y0, 0, 0, xSize, ySize);
if(with_assist) {
for(int i=0; i<history_slot_tooltip.length; ++i) history_slot_tooltip[i] = false;
final List<ItemStack> crafting_template = getContainer().history().current();
@ -1192,8 +1191,8 @@ public class EdCraftingTable
@SuppressWarnings("deprecation")
protected void draw_template_item_at(MatrixStack mx, ItemStack stack, int x0, int y0, int x, int y)
{
ItemRenderer ir = this.field_230707_j_;
final int main_zl = func_230927_p_/*getBlitOffset*/();
ItemRenderer ir = this.itemRenderer;
final int main_zl = getBlitOffset();
final float zl = ir.zLevel;
ir.zLevel = -80;
RenderSystem.enableRescaleNormal();
@ -1205,13 +1204,13 @@ public class EdCraftingTable
RenderSystem.defaultAlphaFunc();
RenderSystem.enableBlend();
ir.zLevel = zl;
func_230926_e_/*setBlitOffset*/(100);
setBlitOffset(100);
RenderSystem.colorMask(true, true, true, true);
RenderSystem.color4f(0.7f, 0.7f, 0.7f, 0.8f);
getMinecraft().getTextureManager().bindTexture(BACKGROUND);
func_238474_b_(mx, x0+x, y0+y, x, y, 16, 16);
blit(mx, x0+x, y0+y, x, y, 16, 16);
RenderSystem.color4f(1f, 1f, 1f, 1f);
func_230926_e_/*setBlitOffset*/(main_zl);
setBlitOffset(main_zl);
}
protected void action(String message)
@ -1269,13 +1268,13 @@ public class EdCraftingTable
}
@Override
public boolean func_231043_a_/*mouseScrolled*/(double mouseX, double mouseY, double wheel_inc)
public boolean mouseScrolled(double mouseX, double mouseY, double wheel_inc)
{
tooltip.resetTimer();
final Slot resultSlot = this.getSlotUnderMouse();
if((!with_crafting_slot_mouse_scrolling) || (!(resultSlot instanceof CraftingResultSlot))) {
return this.getEventListenerForPos(mouseX, mouseY).filter((evl) -> {
return evl.func_231043_a_/*mouseScrolled*/(mouseX, mouseY, wheel_inc);
return evl.mouseScrolled(mouseX, mouseY, wheel_inc);
}).isPresent();
}
int count = resultSlot.getStack().getCount();

View file

@ -322,8 +322,8 @@ public class EdDropper
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt, false); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt, false); }
@Override
public CompoundNBT write(CompoundNBT nbt)
@ -401,7 +401,7 @@ public class EdDropper
@Override
public boolean isUsableByPlayer(PlayerEntity player)
{ return getPos().distanceSq(player.func_233580_cy_()) < 36; }
{ return getPos().distanceSq(player.getPosition()) < 36; }
@Override
public void openInventory(PlayerEntity player)
@ -672,6 +672,14 @@ public class EdDropper
drop_slot_index_ = next_slot(drop_slot_index_);
ItemStack ds = stacks_.get(ic);
if((!ds.isEmpty()) && (ds.getCount() >= drop_count_)) {
{
boolean skip_stack = false;
for(int ci = 0; (ci<CTRL_SLOTS_SIZE)&&(!skip_stack); ++ci) {
final ItemStack cmp_stack = stacks_.get(CTRL_SLOTS_FIRST+ci);
if(Inventories.areItemStacksIdentical(ds, cmp_stack)) skip_stack = true;
}
if(skip_stack) continue;
}
drop_stacks[0] = ds.split(drop_count_);
stacks_.set(ic, ds);
break;
@ -852,9 +860,9 @@ public class EdDropper
{ super(container, player_inventory, title); this.player_ = player_inventory.player; }
@Override
public void func_231160_c_/*init*/()
public void init()
{
super.func_231160_c_();
super.init();
{
final String prefix = ModContent.FACTORY_DROPPER.getTranslationKey() + ".tooltips.";
final int x0 = getGuiLeft(), y0 = getGuiTop();
@ -872,25 +880,25 @@ public class EdDropper
}
@Override
public void func_230430_a_/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
public void render(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
{
func_230446_a_/*renderBackground*/(mx);
super.func_230430_a_(mx, mouseX, mouseY, partialTicks);
if(!tooltip_.render(mx, this, mouseX, mouseY)) func_230459_a_/*renderHoveredToolTip*/(mx, mouseX, mouseY);
renderBackground/*renderBackground*/(mx);
super.render(mx, mouseX, mouseY, partialTicks);
if(!tooltip_.render(mx, this, mouseX, mouseY)) func_230459_a_/*func_230459_a_*/(mx, mouseX, mouseY);
}
@Override
protected void func_230451_b_(MatrixStack mx, int x, int y)
protected void drawGuiContainerForegroundLayer(MatrixStack mx, int x, int y)
{}
@Override
public boolean func_231044_a_/*mouseClicked*/(double mouseX, double mouseY, int mouseButton)
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton)
{
tooltip_.resetTimer();
DropperContainer container = (DropperContainer)getContainer();
int mx = (int)(mouseX - getGuiLeft() + .5), my = (int)(mouseY - getGuiTop() + .5);
if((!isPointInRegion(114, 1, 61, 79, mouseX, mouseY))) {
return super.func_231044_a_(mouseX, mouseY, mouseButton);
return super.mouseClicked(mouseX, mouseY, mouseButton);
} else if(isPointInRegion(130, 10, 12, 25, mouseX, mouseY)) {
int force_percent = 100 - MathHelper.clamp(((my-10)*100)/25, 0, 100);
container.onGuiAction("drop_speed", force_percent);
@ -938,13 +946,13 @@ public class EdDropper
@Override
@SuppressWarnings("deprecation")
protected void func_230450_a_/*drawGuiContainerBackgroundLayer*/(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
protected void drawGuiContainerBackgroundLayer(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
{
RenderSystem.enableBlend();
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
getMinecraft().getTextureManager().bindTexture(new ResourceLocation(ModEngineersDecor.MODID, "textures/gui/factory_dropper_gui.png"));
final int x0=getGuiLeft(), y0=getGuiTop(), w=getXSize(), h=getYSize();
func_238474_b_(mx, x0, y0, 0, 0, w, h);
blit(mx, x0, y0, 0, 0, w, h);
DropperContainer container = (DropperContainer)getContainer();
// active drop slot
{
@ -952,14 +960,14 @@ public class EdDropper
if((drop_slot_index < 0) || (drop_slot_index >= 16)) drop_slot_index = 0;
int x = (x0+9+((drop_slot_index % 6) * 18));
int y = (y0+5+((drop_slot_index / 6) * 17));
func_238474_b_(mx, x, y, 180, 45, 18, 18);
blit(mx, x, y, 180, 45, 18, 18);
}
// filter LEDs
{
for(int i=0; i<3; ++i) {
int xt = 180 + (6 * container.field(12+i)), yt = 38;
int x = x0 + 31 + (i * 36), y = y0 + 65;
func_238474_b_(mx, x, y, xt, yt, 6, 6);
blit(mx, x, y, xt, yt, 6, 6);
}
}
// force adjustment
@ -967,31 +975,31 @@ public class EdDropper
int hy = 2 + (((100-container.field(0)) * 21) / 100);
int x = x0+135, y = y0+12, xt = 181;
int yt = 4 + (23-hy);
func_238474_b_(mx, x, y, xt, yt, 3, hy);
blit(mx, x, y, xt, yt, 3, hy);
}
// angle adjustment
{
int x = x0 + 157 - 3 + ((container.field(1) * 12) / 100);
int y = y0 + 22 - 3 - ((container.field(2) * 12) / 100);
func_238474_b_(mx, x, y, 180, 30, 7, 7);
blit(mx, x, y, 180, 30, 7, 7);
}
// drop count
{
int x = x0 + 134 - 2 + (container.field(4));
int y = y0 + 45;
func_238474_b_(mx, x, y, 190, 31, 5, 5);
blit(mx, x, y, 190, 31, 5, 5);
}
// drop period
{
int px = (int)Math.round(((33.0 * container.field(6)) / 100) + 1);
int x = x0 + 134 - 2 + MathHelper.clamp(px, 0, 33);
int y = y0 + 56;
func_238474_b_(mx, x, y, 190, 31, 5, 5);
blit(mx, x, y, 190, 31, 5, 5);
}
// redstone input
{
if(container.field(11) != 0) {
func_238474_b_(mx, x0+114, y0+51, 189, 18, 9, 9);
blit(mx, x0+114, y0+51, 189, 18, 9, 9);
}
}
// trigger logic
@ -999,14 +1007,14 @@ public class EdDropper
int filter_gate_offset = ((container.field(5) & DropperTileEntity.DROPLOGIC_FILTER_ANDGATE) != 0) ? 11 : 0;
int extern_gate_offset = ((container.field(5) & DropperTileEntity.DROPLOGIC_EXTERN_ANDGATE) != 0) ? 11 : 0;
int pulse_mode_offset = ((container.field(5) & DropperTileEntity.DROPLOGIC_CONTINUOUS ) != 0) ? 10 : 0;
func_238474_b_(mx, x0+132, y0+66, 179+filter_gate_offset, 66, 9, 9);
func_238474_b_(mx, x0+148, y0+66, 179+extern_gate_offset, 66, 9, 9);
func_238474_b_(mx, x0+162, y0+66, 200+pulse_mode_offset, 66, 9, 9);
blit(mx, x0+132, y0+66, 179+filter_gate_offset, 66, 9, 9);
blit(mx, x0+148, y0+66, 179+extern_gate_offset, 66, 9, 9);
blit(mx, x0+162, y0+66, 200+pulse_mode_offset, 66, 9, 9);
}
// drop timer running indicator
{
if((container.field(9) > DropperTileEntity.DROP_PERIOD_OFFSET) && ((System.currentTimeMillis() % 1000) < 500)) {
func_238474_b_(mx, x0+149, y0+51, 201, 39, 3, 3);
blit(mx, x0+149, y0+51, 201, 39, 3, 3);
}
}
RenderSystem.disableBlend();

View file

@ -225,8 +225,8 @@ public class EdElectricalFurnace
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt); }
@Override
public CompoundNBT write(CompoundNBT nbt)
@ -792,9 +792,9 @@ public class EdElectricalFurnace
{ super(container, player_inventory, title); this.player_ = player_inventory.player; }
@Override
public void func_231160_c_/*init*/()
public void init()
{
super.func_231160_c_();
super.init();
{
final String prefix = ModContent.SMALL_ELECTRICAL_FURNACE.getTranslationKey() + ".tooltips.";
final int x0 = getGuiLeft(), y0 = getGuiTop();
@ -807,52 +807,52 @@ public class EdElectricalFurnace
}
@Override
public void func_230430_a_/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
public void render/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
{
func_230446_a_/*renderBackground*/(mx);
super.func_230430_a_(mx, mouseX, mouseY, partialTicks);
if(!tooltip_.render(mx, this, mouseX, mouseY)) func_230459_a_/*renderHoveredToolTip*/(mx, mouseX, mouseY);
renderBackground/*renderBackground*/(mx);
super.render(mx, mouseX, mouseY, partialTicks);
if(!tooltip_.render(mx, this, mouseX, mouseY)) func_230459_a_/*func_230459_a_*/(mx, mouseX, mouseY);
}
@Override
protected void func_230451_b_(MatrixStack mx, int x, int y)
protected void drawGuiContainerForegroundLayer(MatrixStack mx, int x, int y)
{}
@Override
@SuppressWarnings("deprecation")
protected void func_230450_a_/*drawGuiContainerBackgroundLayer*/(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
protected void drawGuiContainerBackgroundLayer(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
{
RenderSystem.enableBlend();
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
getMinecraft().getTextureManager().bindTexture(new ResourceLocation(ModEngineersDecor.MODID, "textures/gui/small_electrical_furnace_gui.png"));
final int x0=guiLeft, y0=guiTop, w=xSize, h=ySize;
func_238474_b_(mx, x0, y0, 0, 0, w, h);
blit(mx, x0, y0, 0, 0, w, h);
if(getContainer().field(6)!=0) {
final int hi = 13;
final int k = heat_px(hi);
func_238474_b_(mx, x0+62, y0+55+hi-k, 177, hi-k, 13, k);
blit(mx, x0+62, y0+55+hi-k, 177, hi-k, 13, k);
}
func_238474_b_(mx, x0+79, y0+30, 176, 15, 1+progress_px(17), 15);
blit(mx, x0+79, y0+30, 176, 15, 1+progress_px(17), 15);
int we = energy_px(32, 8);
if(we>0) func_238474_b_(mx, x0+90, y0+54, 185, 30, we, 13);
if(we>0) blit(mx, x0+90, y0+54, 185, 30, we, 13);
switch(getContainer().field(4)) {
case 0: func_238474_b_(mx, x0+144, y0+57, 180, 57, 6, 9); break;
case 1: func_238474_b_(mx, x0+142, y0+58, 190, 58, 9, 6); break;
case 2: func_238474_b_(mx, x0+144, y0+56, 200, 57, 6, 9); break;
case 3: func_238474_b_(mx, x0+143, y0+58, 210, 58, 9, 6); break;
case 0: blit(mx, x0+144, y0+57, 180, 57, 6, 9); break;
case 1: blit(mx, x0+142, y0+58, 190, 58, 9, 6); break;
case 2: blit(mx, x0+144, y0+56, 200, 57, 6, 9); break;
case 3: blit(mx, x0+143, y0+58, 210, 58, 9, 6); break;
default: break;
}
RenderSystem.disableBlend();
}
@Override
public boolean func_231044_a_/*mouseClicked*/(double mouseX, double mouseY, int mouseButton)
public boolean mouseClicked/*mouseClicked*/(double mouseX, double mouseY, int mouseButton)
{
tooltip_.resetTimer();
ElectricalFurnaceContainer container = (ElectricalFurnaceContainer)getContainer();
int mx = (int)(mouseX - getGuiLeft() + .5), my = (int)(mouseY - getGuiTop() + .5);
if((!isPointInRegion(136, 48, 28, 28, mouseX, mouseY))) {
return super.func_231044_a_(mouseX, mouseY, mouseButton);
return super.mouseClicked(mouseX, mouseY, mouseButton);
} else if(isPointInRegion(144, 64, 6, 10, mouseX, mouseY)) {
container.onGuiAction("speed", 0);
} else if(isPointInRegion(134, 58, 10, 6, mouseX, mouseY)) {

View file

@ -282,8 +282,8 @@ public class EdFluidBarrel
}
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt); }
@Override
public CompoundNBT write(CompoundNBT nbt)

View file

@ -200,8 +200,8 @@ public class EdFluidFunnel
// TileEntity -----------------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt); }
@Override
public CompoundNBT write(CompoundNBT nbt)

View file

@ -313,8 +313,8 @@ public class EdFurnace
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt); }
@Override
public CompoundNBT write(CompoundNBT nbt)
@ -398,7 +398,7 @@ public class EdFurnace
@Override
public boolean isUsableByPlayer(PlayerEntity player)
{ return getPos().distanceSq(player.func_233580_cy_()) < 36; }
{ return getPos().distanceSq(player.getPosition()) < 36; }
@Override
public void openInventory(PlayerEntity player)
@ -815,7 +815,7 @@ public class EdFurnace
while(xp > 0) {
int k = ExperienceOrbEntity.getXPSplit(xp);
xp -= k;
player_.world.addEntity((new ExperienceOrbEntity(player_.world, player_.func_233580_cy_().getX(), player_.func_233580_cy_().getY()+0.5, player_.func_233580_cy_().getZ()+0.5, k)));
player_.world.addEntity((new ExperienceOrbEntity(player_.world, player_.getPosition().getX(), player_.getPosition().getY()+0.5, player_.getPosition().getZ()+0.5, k)));
}
}
removeCount = 0;
@ -985,35 +985,35 @@ public class EdFurnace
{ super(container, player_inventory, title); this.player_ = player_inventory.player; }
@Override
public void func_231160_c_/*init*/()
{ super.func_231160_c_(); }
public void init()
{ super.init(); }
@Override
public void func_230430_a_/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
public void render(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
{
func_230446_a_/*renderBackground*/(mx);
super.func_230430_a_(mx, mouseX, mouseY, partialTicks);
func_230459_a_/*renderHoveredToolTip*/(mx, mouseX, mouseY);
renderBackground/*renderBackground*/(mx);
super.render(mx, mouseX, mouseY, partialTicks);
func_230459_a_/*func_230459_a_*/(mx, mouseX, mouseY);
}
@Override
protected void func_230451_b_(MatrixStack mx, int x, int y)
protected void drawGuiContainerForegroundLayer(MatrixStack mx, int x, int y)
{}
@Override
@SuppressWarnings("deprecation")
protected void func_230450_a_/*drawGuiContainerBackgroundLayer*/(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
protected void drawGuiContainerBackgroundLayer(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
{
RenderSystem.enableBlend();
RenderSystem.color3f(1.0F, 1.0F, 1.0F);
getMinecraft().getTextureManager().bindTexture(new ResourceLocation(ModEngineersDecor.MODID, "textures/gui/small_lab_furnace_gui.png"));
final int x0=guiLeft, y0=guiTop, w=xSize, h=ySize;
func_238474_b_(mx, x0, y0, 0, 0, w, h);
blit(mx, x0, y0, 0, 0, w, h);
if(getContainer().field(4) != 0) {
final int k = flame_px(13);
func_238474_b_(mx, x0+59, y0+36+12-k, 176, 12-k, 14, k+1);
blit(mx, x0+59, y0+36+12-k, 176, 12-k, 14, k+1);
}
func_238474_b_(mx, x0+79, y0+36, 176, 15, 1+progress_px(17), 15);
blit(mx, x0+79, y0+36, 176, 15, 1+progress_px(17), 15);
RenderSystem.disableBlend();
}

View file

@ -291,8 +291,8 @@ public class EdHopper
// TileEntity --------------------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt, false); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt, false); }
@Override
public CompoundNBT write(CompoundNBT nbt)
@ -370,7 +370,7 @@ public class EdHopper
@Override
public boolean isUsableByPlayer(PlayerEntity player)
{ return getPos().distanceSq(player.func_233580_cy_()) < 36; }
{ return getPos().distanceSq(player.getPosition()) < 36; }
@Override
public void openInventory(PlayerEntity player)
@ -597,7 +597,7 @@ public class EdHopper
int n_collected = 0;
for(ItemEntity ie:items) {
boolean is_direct_collection_tange = ie.getDistanceSq(rpos)<0.7;
if(!is_direct_collection_tange && (ie.cannotPickup() || (!ie.func_233570_aj_()/*onGround*/))) continue;
if(!is_direct_collection_tange && (ie.cannotPickup() || (!ie.isOnGround()))) continue;
ItemStack stack = ie.getItem();
int n_accepted = try_insert_into_hopper(stack);
if(n_accepted <= 0) continue;
@ -844,9 +844,9 @@ public class EdHopper
{ super(container, player_inventory, title); this.player_ = player_inventory.player; }
@Override
public void func_231160_c_/*init*/()
public void init()
{
super.func_231160_c_();
super.init();
{
final String prefix = ModContent.FACTORY_HOPPER.getTranslationKey() + ".tooltips.";
final int x0 = getGuiLeft(), y0 = getGuiTop();
@ -863,15 +863,15 @@ public class EdHopper
}
@Override
public void func_230430_a_/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
public void render(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
{
func_230446_a_/*renderBackground*/(mx);
super.func_230430_a_(mx, mouseX, mouseY, partialTicks);
if(!tooltip_.render(mx, this, mouseX, mouseY)) func_230459_a_/*renderHoveredToolTip*/(mx, mouseX, mouseY);
renderBackground(mx);
super.render(mx, mouseX, mouseY, partialTicks);
if(!tooltip_.render(mx, this, mouseX, mouseY)) func_230459_a_/*func_230459_a_*/(mx, mouseX, mouseY);
}
@Override
protected void func_230451_b_(MatrixStack mx, int x, int y)
protected void drawGuiContainerForegroundLayer(MatrixStack mx, int x, int y)
{}
@Override
@ -888,13 +888,13 @@ public class EdHopper
}
@Override
public boolean func_231044_a_/*mouseClicked*/(double mouseX, double mouseY, int mouseButton)
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton)
{
tooltip_.resetTimer();
HopperContainer container = (HopperContainer)getContainer();
int mx = (int)(mouseX - getGuiLeft() + .5), my = (int)(mouseY - getGuiTop() + .5);
if((!isPointInRegion(126, 1, 49, 60, mouseX, mouseY))) {
return super.func_231044_a_(mouseX, mouseY, mouseButton);
return super.mouseClicked(mouseX, mouseY, mouseButton);
} else if(isPointInRegion(128, 9, 44, 10, mouseX, mouseY)) {
int range = (mx-133);
if(range < -1) {
@ -939,13 +939,13 @@ public class EdHopper
@Override
@SuppressWarnings("deprecation")
protected void func_230450_a_/*drawGuiContainerBackgroundLayer*/(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
protected void drawGuiContainerBackgroundLayer(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
{
RenderSystem.enableBlend();
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
getMinecraft().getTextureManager().bindTexture(new ResourceLocation(ModEngineersDecor.MODID, "textures/gui/factory_hopper_gui.png"));
final int x0=getGuiLeft(), y0=getGuiTop(), w=getXSize(), h=getYSize();
func_238474_b_(mx, x0, y0, 0, 0, w, h);
blit(mx, x0, y0, 0, 0, w, h);
HopperContainer container = (HopperContainer)getContainer();
// active slot
{
@ -953,7 +953,7 @@ public class EdHopper
if((slot_index < 0) || (slot_index >= HopperTileEntity.NUM_OF_SLOTS)) slot_index = 0;
int x = (x0+10+((slot_index % 6) * 18));
int y = (y0+8+((slot_index / 6) * 17));
func_238474_b_(mx, x, y, 200, 8, 18, 18);
blit(mx, x, y, 200, 8, 18, 18);
}
// collection range
{
@ -961,38 +961,38 @@ public class EdHopper
int px = lut[MathHelper.clamp(container.field(0), 0, HopperTileEntity.MAX_COLLECTION_RANGE)];
int x = x0 + px - 2;
int y = y0 + 14;
func_238474_b_(mx, x, y, 179, 40, 5, 5);
blit(mx, x, y, 179, 40, 5, 5);
}
// transfer period
{
int px = (int)Math.round(((33.5 * container.field(3)) / 100) + 1);
int x = x0 + 132 - 2 + MathHelper.clamp(px, 0, 34);
int y = y0 + 27;
func_238474_b_(mx, x, y, 179, 40, 5, 5);
blit(mx, x, y, 179, 40, 5, 5);
}
// transfer count
{
int x = x0 + 133 - 2 + (container.field(1));
int y = y0 + 40;
func_238474_b_(mx, x, y, 179, 40, 5, 5);
blit(mx, x, y, 179, 40, 5, 5);
}
// redstone input
{
if(container.field(5) != 0) {
func_238474_b_(mx, x0+133, y0+49, 217, 49, 9, 9);
blit(mx, x0+133, y0+49, 217, 49, 9, 9);
}
}
// trigger logic
{
int inverter_offset = ((container.field(2) & HopperTileEntity.LOGIC_INVERTED) != 0) ? 11 : 0;
func_238474_b_(mx, x0+145, y0+49, 177+inverter_offset, 49, 9, 9);
blit(mx, x0+145, y0+49, 177+inverter_offset, 49, 9, 9);
int pulse_mode_offset = ((container.field(2) & HopperTileEntity.LOGIC_CONTINUOUS ) != 0) ? 9 : 0;
func_238474_b_(mx, x0+159, y0+49, 199+pulse_mode_offset, 49, 9, 9);
blit(mx, x0+159, y0+49, 199+pulse_mode_offset, 49, 9, 9);
}
// delay timer running indicator
{
if((container.field(4) > HopperTileEntity.PERIOD_OFFSET) && ((System.currentTimeMillis() % 1000) < 500)) {
func_238474_b_(mx, x0+148, y0+22, 187, 22, 3, 3);
blit(mx, x0+148, y0+22, 187, 22, 3, 3);
}
}
RenderSystem.disableBlend();

View file

@ -249,8 +249,8 @@ public class EdLabeledCrate
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt); }
@Override
public CompoundNBT write(CompoundNBT nbt)
@ -282,7 +282,7 @@ public class EdLabeledCrate
@Override
public void handleUpdateTag(BlockState state, CompoundNBT tag) // on client
{ func_230337_a_/*read*/(state, tag); }
{ read(state, tag); }
@OnlyIn(Dist.CLIENT)
public double getMaxRenderDistanceSquared()
@ -357,7 +357,7 @@ public class EdLabeledCrate
@Override
public boolean isUsableByPlayer(PlayerEntity player)
{ return getPos().distanceSq(player.func_233580_cy_()) < 36; }
{ return getPos().distanceSq(player.getPosition()) < 36; }
@Override
public void openInventory(PlayerEntity player)
@ -720,29 +720,29 @@ public class EdLabeledCrate
}
@Override
public void func_231160_c_/*init*/()
{ super.func_231160_c_(); }
public void init()
{ super.init(); }
@Override
public void func_230430_a_/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
public void render/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
{
func_230446_a_/*renderBackground*/(mx);
super.func_230430_a_(mx, mouseX, mouseY, partialTicks);
func_230459_a_/*renderHoveredToolTip*/(mx, mouseX, mouseY);
renderBackground/*renderBackground*/(mx);
super.render(mx, mouseX, mouseY, partialTicks);
func_230459_a_/*func_230459_a_*/(mx, mouseX, mouseY);
}
@Override
protected void func_230451_b_(MatrixStack mx, int x, int y)
protected void drawGuiContainerForegroundLayer(MatrixStack mx, int x, int y)
{}
@Override
@SuppressWarnings("deprecation")
protected void func_230450_a_/*drawGuiContainerBackgroundLayer*/(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
protected void drawGuiContainerBackgroundLayer(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
{
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
getMinecraft().getTextureManager().bindTexture(new ResourceLocation(ModEngineersDecor.MODID, "textures/gui/labeled_crate_gui.png"));
final int x0=guiLeft, y0=this.guiTop, w=xSize, h=ySize;
func_238474_b_(mx, x0, y0, 0, 0, w, h);
blit(mx, x0, y0, 0, 0, w, h);
}
//------------------------------------------------------------------------------------------------------------------
@ -768,9 +768,9 @@ public class EdLabeledCrate
}
@Override
public boolean func_231043_a_/*mouseScrolled*/(double mouseX, double mouseY, double wheel_inc)
public boolean mouseScrolled(double mouseX, double mouseY, double wheel_inc)
{
if(!with_gui_mouse_handling) return super.func_231043_a_/*mouseScrolled*/(mouseX, mouseY, wheel_inc);
if(!with_gui_mouse_handling) return super.mouseScrolled(mouseX, mouseY, wheel_inc);
final Slot slot = getSlotUnderMouse();
if(!slot.getHasStack()) return true;
final int count = slot.getStack().getCount();

View file

@ -85,10 +85,10 @@ public class EdLadderBlock extends LadderBlock implements IDecorBlock
// Player update event, forwarded from the main mod instance.
public static void onPlayerUpdateEvent(final PlayerEntity player)
{
if((without_speed_boost_) || (player.func_233570_aj_()/*onGround*/) || (!player.isOnLadder()) || (player.isSteppingCarefully()) || (player.isSpectator())) return;
if((without_speed_boost_) || (player.isOnGround()) || (!player.isOnLadder()) || (player.isSteppingCarefully()) || (player.isSpectator())) return;
double lvy = player.getLookVec().y;
if(Math.abs(lvy) < 0.94) return;
final BlockPos pos = player.func_233580_cy_();
final BlockPos pos = player.getPosition();
final BlockState state = player.world.getBlockState(pos);
if(!(state.getBlock() instanceof EdLadderBlock)) return;
player.fallDistance = 0;

View file

@ -256,8 +256,8 @@ public class EdMilker
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt, false); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt, false); }
@Override
public CompoundNBT write(CompoundNBT nbt)
@ -401,7 +401,7 @@ public class EdMilker
{
if((tracked_cow_ == null) && (fluid_level() >= MAX_MILKING_TANK_LEVEL)) return false; // nothing to do
final Direction facing = world.getBlockState(getPos()).get(MilkerBlock.HORIZONTAL_FACING).getOpposite();
final Vector3d target_pos = Vector3d.func_237489_a_(getPos().offset(facing)).add(0.5,0,0.5);
final Vector3d target_pos = Vector3d.copy(getPos().offset(facing)).add(0.5,0,0.5);
CowEntity cow = null;
{
AxisAlignedBB aabb = new AxisAlignedBB(pos.offset(facing, 3)).grow(4, 2, 4);
@ -439,23 +439,23 @@ public class EdMilker
BlockPos p = getPos().offset(facing,2);
log("Idle: Shove off");
blocker.setNoAI(false);
SingleMoveGoal.startFor(blocker, p, 2, 1.0, (goal, world, pos)->(pos.distanceSq(goal.getCreature().func_233580_cy_())>100));
SingleMoveGoal.startFor(blocker, p, 2, 1.0, (goal, world, pos)->(pos.distanceSq(goal.getCreature().getPosition())>100));
}
return false;
}
if(cow.getLeashed() || cow.isChild() || cow.isInLove() || (!cow.func_233570_aj_()/*onGround*/) || cow.isBeingRidden() || cow.isSprinting()) return false;
if(cow.getLeashed() || cow.isChild() || cow.isInLove() || (!cow.isOnGround()) || cow.isBeingRidden() || cow.isSprinting()) return false;
tracked_cows_.put(cow.getEntityId(), cow.getEntityWorld().getGameTime());
tracked_cow_ = cow.getUniqueID();
state_ = MilkingState.PICKED;
state_timeout_ = 200;
tracked_cow_original_position_ = cow.func_233580_cy_();
tracked_cow_original_position_ = cow.getPosition();
log("Idle: Picked cow " + tracked_cow_);
return false;
}
case PICKED: {
SingleMoveGoal.startFor(
cow, target_pos, 2, 1.0,
(goal, world, pos)->(pos.distanceSq(goal.getCreature().func_233580_cy_())>100),
(goal, world, pos)->(pos.distanceSq(goal.getCreature().getPosition())>100),
(goal, world, pos)->{
log("move: position reached");
goal.getCreature().setLocationAndAngles(goal.getTargetPosition().getX(), goal.getTargetPosition().getY(), goal.getTargetPosition().getZ(), facing.getHorizontalAngle(), 0);
@ -505,7 +505,7 @@ public class EdMilker
}
case LEAVING: {
BlockPos p = (tracked_cow_original_position_ != null) ? (tracked_cow_original_position_) : getPos().offset(facing,2).offset(facing.rotateYCCW());
SingleMoveGoal.startFor(cow, p, 2, 1.0, (goal, world, pos)->(pos.distanceSq(goal.getCreature().func_233580_cy_())>100));
SingleMoveGoal.startFor(cow, p, 2, 1.0, (goal, world, pos)->(pos.distanceSq(goal.getCreature().getPosition())>100));
state_timeout_ = 600;
state_timer_ = 500;
tick_timer_ = TICK_INTERVAL;

View file

@ -332,8 +332,8 @@ public class EdMineralSmelter
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt); }
@Override
public CompoundNBT write(CompoundNBT nbt)

View file

@ -261,8 +261,8 @@ public class EdPlacer
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt, false); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt, false); }
@Override
public CompoundNBT write(CompoundNBT nbt)
@ -341,7 +341,7 @@ public class EdPlacer
@Override
public boolean isUsableByPlayer(PlayerEntity player)
{ return getPos().distanceSq(player.func_233580_cy_()) < 36; }
{ return getPos().distanceSq(player.getPosition()) < 36; }
@Override
public void openInventory(PlayerEntity player)
@ -712,9 +712,9 @@ public class EdPlacer
{ super(container, player_inventory, title); this.player_ = player_inventory.player; }
@Override
public void func_231160_c_/*init*/()
public void init()
{
super.func_231160_c_();
super.init();
{
final String prefix = ModContent.FACTORY_PLACER.getTranslationKey() + ".tooltips.";
final int x0 = getGuiLeft(), y0 = getGuiTop();
@ -727,25 +727,25 @@ public class EdPlacer
}
@Override
public void func_230430_a_/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
public void render/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
{
func_230446_a_/*renderBackground*/(mx);
super.func_230430_a_(mx, mouseX, mouseY, partialTicks);
if(!tooltip_.render(mx, this, mouseX, mouseY)) func_230459_a_/*renderHoveredToolTip*/(mx, mouseX, mouseY);
renderBackground/*renderBackground*/(mx);
super.render(mx, mouseX, mouseY, partialTicks);
if(!tooltip_.render(mx, this, mouseX, mouseY)) func_230459_a_/*func_230459_a_*/(mx, mouseX, mouseY);
}
@Override
protected void func_230451_b_(MatrixStack mx, int x, int y)
protected void drawGuiContainerForegroundLayer(MatrixStack mx, int x, int y)
{}
@Override
public boolean func_231044_a_/*mouseClicked*/(double mouseX, double mouseY, int mouseButton)
public boolean mouseClicked/*mouseClicked*/(double mouseX, double mouseY, int mouseButton)
{
tooltip_.resetTimer();
PlacerContainer container = (PlacerContainer)getContainer();
int mx = (int)(mouseX - getGuiLeft() + .5), my = (int)(mouseY - getGuiTop() + .5);
if((!isPointInRegion(126, 1, 49, 60, mouseX, mouseY))) {
return super.func_231044_a_(mouseX, mouseY, mouseButton);
return super.mouseClicked(mouseX, mouseY, mouseButton);
} else if(isPointInRegion(133, 49, 9, 9, mouseX, mouseY)) {
container.onGuiAction("manual_trigger", 1);
} else if(isPointInRegion(145, 49, 9, 9, mouseX, mouseY)) {
@ -758,13 +758,13 @@ public class EdPlacer
@Override
@SuppressWarnings("deprecation")
protected void func_230450_a_/*drawGuiContainerBackgroundLayer*/(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
protected void drawGuiContainerBackgroundLayer/*drawGuiContainerBackgroundLayer*/(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
{
RenderSystem.enableBlend();
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.getMinecraft().getTextureManager().bindTexture(new ResourceLocation(ModEngineersDecor.MODID, "textures/gui/factory_placer_gui.png"));
final int x0=getGuiLeft(), y0=getGuiTop(), w=getXSize(), h=getYSize();
func_238474_b_(mx, x0, y0, 0, 0, w, h);
blit(mx, x0, y0, 0, 0, w, h);
PlacerContainer container = (PlacerContainer)getContainer();
// active slot
{
@ -772,20 +772,20 @@ public class EdPlacer
if((slot_index < 0) || (slot_index >= PlacerTileEntity.NUM_OF_SLOTS)) slot_index = 0;
int x = (x0+10+((slot_index % 6) * 18));
int y = (y0+8+((slot_index / 6) * 17));
func_238474_b_(mx, x, y, 200, 8, 18, 18);
blit(mx, x, y, 200, 8, 18, 18);
}
// redstone input
{
if(container.field(1) != 0) {
func_238474_b_(mx, x0+133, y0+49, 217, 49, 9, 9);
blit(mx, x0+133, y0+49, 217, 49, 9, 9);
}
}
// trigger logic
{
int inverter_offset = ((container.field(0) & PlacerTileEntity.LOGIC_INVERTED) != 0) ? 11 : 0;
func_238474_b_(mx, x0+145, y0+49, 177+inverter_offset, 49, 9, 9);
blit(mx, x0+145, y0+49, 177+inverter_offset, 49, 9, 9);
int pulse_mode_offset = ((container.field(0) & PlacerTileEntity.LOGIC_CONTINUOUS ) != 0) ? 9 : 0;
func_238474_b_(mx, x0+159, y0+49, 199+pulse_mode_offset, 49, 9, 9);
blit(mx, x0+159, y0+49, 199+pulse_mode_offset, 49, 9, 9);
}
RenderSystem.disableBlend();
}

View file

@ -166,8 +166,8 @@ public class EdSolarPanel
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt, false); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt, false); }
@Override
public CompoundNBT write(CompoundNBT nbt)

View file

@ -200,9 +200,9 @@ public class EdTestBlock
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
public void read(BlockState state, CompoundNBT nbt)
{
super.func_230337_a_(state, nbt);
super.read(state, nbt);
if(nbt.contains("passive_tank")) passive_tank_ = FluidStack.loadFluidStackFromNBT(nbt.getCompound("passive_tank"));
if(nbt.contains("passive_drain")) passive_drain_fluidstack_ = FluidStack.loadFluidStackFromNBT(nbt.getCompound("passive_drain"));
if(nbt.contains("active")) active_fill_fluidstack_ = FluidStack.loadFluidStackFromNBT(nbt.getCompound("active"));

View file

@ -151,8 +151,8 @@ public class EdTreeCutter
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt); }
@Override
public CompoundNBT write(CompoundNBT nbt)

View file

@ -237,8 +237,8 @@ public class EdWasteIncinerator
// TileEntity ------------------------------------------------------------------------------
@Override
public void func_230337_a_(BlockState state, CompoundNBT nbt)
{ super.func_230337_a_(state, nbt); readnbt(nbt); }
public void read(BlockState state, CompoundNBT nbt)
{ super.read(state, nbt); readnbt(nbt); }
@Override
public CompoundNBT write(CompoundNBT nbt)
@ -316,7 +316,7 @@ public class EdWasteIncinerator
@Override
public boolean isUsableByPlayer(PlayerEntity player)
{ return getPos().distanceSq(player.func_233580_cy_()) < 36; }
{ return getPos().distanceSq(player.getPosition()) < 36; }
@Override
public void openInventory(PlayerEntity player)
@ -695,30 +695,30 @@ public class EdWasteIncinerator
{ super(container, player_inventory, title); this.player_ = player_inventory.player; }
@Override
public void func_231160_c_/*init*/()
{ super.func_231160_c_(); }
public void init()
{ super.init(); }
@Override
public void func_230430_a_/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
public void render(MatrixStack mx, int mouseX, int mouseY, float partialTicks)
{
func_230446_a_/*renderBackground*/(mx);
super.func_230430_a_(mx, mouseX, mouseY, partialTicks);
func_230459_a_/*renderHoveredToolTip*/(mx, mouseX, mouseY);
renderBackground/*renderBackground*/(mx);
super.render(mx, mouseX, mouseY, partialTicks);
func_230459_a_/*func_230459_a_*/(mx, mouseX, mouseY);
}
@Override
protected void func_230451_b_(MatrixStack mx, int x, int y)
protected void drawGuiContainerForegroundLayer(MatrixStack mx, int x, int y)
{}
@Override
@SuppressWarnings("deprecation")
protected void func_230450_a_/*drawGuiContainerBackgroundLayer*/(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
protected void drawGuiContainerBackgroundLayer(MatrixStack mx, float partialTicks, int mouseX, int mouseY)
{
RenderSystem.enableBlend();
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
getMinecraft().getTextureManager().bindTexture(new ResourceLocation(ModEngineersDecor.MODID, "textures/gui/small_waste_incinerator_gui.png"));
final int x0=guiLeft, y0=this.guiTop, w=xSize, h=ySize;
func_238474_b_(mx, x0, y0, 0, 0, w, h);
blit(mx, x0, y0, 0, 0, w, h);
RenderSystem.disableBlend();
}
}

View file

@ -42,10 +42,10 @@ import java.util.*;
public class StandardFenceBlock extends WallBlock implements StandardBlocks.IStandardBlock
{
public static final BooleanProperty UP = BlockStateProperties.UP;
public static final EnumProperty<WallHeight> WALL_EAST = BlockStateProperties.field_235908_S_;
public static final EnumProperty<WallHeight> WALL_NORTH = BlockStateProperties.field_235909_T_;
public static final EnumProperty<WallHeight> WALL_SOUTH = BlockStateProperties.field_235910_U_;
public static final EnumProperty<WallHeight> WALL_WEST = BlockStateProperties.field_235911_V_;
public static final EnumProperty<WallHeight> WALL_EAST = BlockStateProperties.WALL_HEIGHT_EAST;
public static final EnumProperty<WallHeight> WALL_NORTH = BlockStateProperties.WALL_HEIGHT_NORTH;
public static final EnumProperty<WallHeight> WALL_SOUTH = BlockStateProperties.WALL_HEIGHT_SOUTH;
public static final EnumProperty<WallHeight> WALL_WEST = BlockStateProperties.WALL_HEIGHT_WEST;
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
private final Map<BlockState, VoxelShape> shape_voxels;
private final Map<BlockState, VoxelShape> collision_shape_voxels;

View file

@ -44,10 +44,10 @@ import java.util.Map;
public class VariantWallBlock extends WallBlock implements StandardBlocks.IStandardBlock
{
public static final BooleanProperty UP = BlockStateProperties.UP;
public static final EnumProperty<WallHeight> WALL_EAST = BlockStateProperties.field_235908_S_;
public static final EnumProperty<WallHeight> WALL_NORTH = BlockStateProperties.field_235909_T_;
public static final EnumProperty<WallHeight> WALL_SOUTH = BlockStateProperties.field_235910_U_;
public static final EnumProperty<WallHeight> WALL_WEST = BlockStateProperties.field_235911_V_;
public static final EnumProperty<WallHeight> WALL_EAST = BlockStateProperties.WALL_HEIGHT_EAST;
public static final EnumProperty<WallHeight> WALL_NORTH = BlockStateProperties.WALL_HEIGHT_NORTH;
public static final EnumProperty<WallHeight> WALL_SOUTH = BlockStateProperties.WALL_HEIGHT_SOUTH;
public static final EnumProperty<WallHeight> WALL_WEST = BlockStateProperties.WALL_HEIGHT_WEST;
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public static final IntegerProperty TEXTURE_VARIANT = IntegerProperty.create("tvariant", 0, 7);
private final Map<BlockState, VoxelShape> shape_voxels;

View file

@ -116,7 +116,7 @@ public class Auxiliaries
public static TranslationTextComponent localizable(String modtrkey, @Nullable TextFormatting color, Object... args)
{
TranslationTextComponent tr = new TranslationTextComponent((modtrkey.startsWith("block.") || (modtrkey.startsWith("item."))) ? (modtrkey) : (modid+"."+modtrkey), args);
if(color!=null) tr.func_240701_a_(color);
if(color!=null) tr.mergeStyle(color);
return tr;
}
@ -130,7 +130,7 @@ public class Auxiliaries
public static String localize(String translationKey, Object... args)
{
TranslationTextComponent tr = new TranslationTextComponent(translationKey, args);
tr.func_240701_a_(TextFormatting.RESET);
tr.mergeStyle(TextFormatting.RESET);
final String ft = tr.getString();
if(ft.contains("${")) {
// Non-recursive, non-argument lang file entry cross referencing.

View file

@ -270,7 +270,7 @@ public class Networking
{ data_ = new TranslationTextComponent("[unset]"); }
public OverlayTextMessage(final ITextComponent tct, int delay)
{ data_ = (ITextComponent)tct.func_230532_e_(); delay_ = delay; }
{ data_ = (ITextComponent)tct.deepCopy(); delay_ = delay; }
public static OverlayTextMessage parse(final PacketBuffer buf)
{

View file

@ -10,7 +10,9 @@ package wile.engineersdecor.libmc.detail;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.tags.ITag;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagCollectionManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.JSONUtils;
import net.minecraftforge.common.crafting.conditions.ICondition;
@ -24,6 +26,7 @@ import org.apache.logging.log4j.Logger;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.Predicate;
@ -95,6 +98,7 @@ public class OptionalRecipeCondition implements ICondition
if(without_recipes) return false;
if((experimental) && (!with_experimental)) return false;
final IForgeRegistry<Item> item_registry = ForgeRegistries.ITEMS;
final Map<ResourceLocation, ITag<Item>> item_tags = TagCollectionManager.func_242178_a().func_241836_b().func_241833_a(); // ItemTags.getCollection().getTagMap() not set yet
if(result != null) {
boolean item_registered = item_registry.containsKey(result);
if(!item_registered) return false; // required result not registered
@ -108,8 +112,8 @@ public class OptionalRecipeCondition implements ICondition
}
if(!all_required_tags.isEmpty()) {
for(ResourceLocation rl:all_required_tags) {
if(!ItemTags.getCollection().func_241833_a()/*getTagMap()*/.containsKey(rl)) return false;
if(ItemTags.getCollection().func_241833_a()/*getTagMap()*/.get(rl).func_230236_b_().isEmpty()) return false;
if(!item_tags.containsKey(rl)) return false;
if(item_tags.get(rl).getAllElements().isEmpty()) return false;
}
}
if(!any_missing.isEmpty()) {
@ -120,8 +124,8 @@ public class OptionalRecipeCondition implements ICondition
}
if(!any_missing_tags.isEmpty()) {
for(ResourceLocation rl:any_missing_tags) {
if(!ItemTags.getCollection().func_241833_a()/*getTagMap()*/.containsKey(rl)) return true;
if(ItemTags.getCollection().func_241833_a()/*getTagMap()*/.get(rl).func_230236_b_().isEmpty()) return true;
if(!item_tags.containsKey(rl)) return true;
if(item_tags.get(rl).getAllElements().isEmpty()) return true;
}
return false;
}

View file

@ -99,12 +99,12 @@ public class Overlay
final int cy = (int)(win.getScaledHeight() * overlay_y_);
final int w = fr.getStringWidth(txt);
final int h = fr.FONT_HEIGHT;
func_238468_a_(mxs,cx-(w/2)-3, cy-2, cx+(w/2)+2, cy+h+2, 0xaa333333, 0xaa444444);
func_238465_a_(mxs,cx-(w/2)-3, cx+(w/2)+2, cy-2, 0xaa333333);
func_238465_a_(mxs,cx-(w/2)-3, cx+(w/2)+2, cy+h+2, 0xaa333333);
func_238473_b_(mxs,cx-(w/2)-3, cy-2, cy+h+2, 0xaa333333);
func_238473_b_(mxs,cx+(w/2)+2, cy-2, cy+h+2, 0xaa333333);
func_238471_a_(mxs, fr, txt, cx , cy+1, 0x00ffaa00); // drawCenteredString
fillGradient(mxs, cx-(w/2)-3, cy-2, cx+(w/2)+2, cy+h+2, 0xaa333333, 0xaa444444);
hLine(mxs, cx-(w/2)-3, cx+(w/2)+2, cy-2, 0xaa333333);
hLine(mxs, cx-(w/2)-3, cx+(w/2)+2, cy+h+2, 0xaa333333);
vLine(mxs, cx-(w/2)-3, cy-2, cy+h+2, 0xaa333333);
vLine(mxs, cx+(w/2)+2, cy-2, cy+h+2, 0xaa333333);
drawCenteredString(mxs, fr, txt, cx , cy+1, 0x00ffaa00);
} finally {
; // fr.setBidiFlag(was_unicode);
}

View file

@ -92,7 +92,7 @@ public class TooltipDisplay
String text = tip.text.getString();
if(!text.isEmpty() && (!text.startsWith("block."))) {
try {
gui.func_243308_b(mx, Collections.singletonList(tip.text), x, y);
gui.renderTooltip(mx, tip.text, x, y); //gui.func_243308_b(mx, Collections.singletonList(tip.text), x, y);
} catch(Exception ex) {
had_render_exception = true;
Auxiliaries.logError("Tooltip rendering disabled due to exception: '" + ex.getMessage() + "'");