diff --git a/src/main/java/com/lothrazar/cyclic/block/beaconpotion/BlockPotion.java b/src/main/java/com/lothrazar/cyclic/block/beaconpotion/BlockPotion.java index b17b16e0a..780a3503b 100644 --- a/src/main/java/com/lothrazar/cyclic/block/beaconpotion/BlockPotion.java +++ b/src/main/java/com/lothrazar/cyclic/block/beaconpotion/BlockPotion.java @@ -46,7 +46,7 @@ public boolean hasTileEntity(BlockState state) { @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { - return new TilePotion(); + return new TilePotionBeacon(); } @Override diff --git a/src/main/java/com/lothrazar/cyclic/block/beaconpotion/ContainerPotion.java b/src/main/java/com/lothrazar/cyclic/block/beaconpotion/ContainerPotion.java index a800785e0..321361bae 100644 --- a/src/main/java/com/lothrazar/cyclic/block/beaconpotion/ContainerPotion.java +++ b/src/main/java/com/lothrazar/cyclic/block/beaconpotion/ContainerPotion.java @@ -13,11 +13,11 @@ public class ContainerPotion extends ContainerBase { - TilePotion tile; + TilePotionBeacon tile; public ContainerPotion(int windowId, World world, BlockPos pos, PlayerInventory playerInventory, PlayerEntity player) { super(ContainerScreenRegistry.BEACON, windowId); - tile = (TilePotion) world.getTileEntity(pos); + tile = (TilePotionBeacon) world.getTileEntity(pos); this.playerEntity = player; this.playerInventory = playerInventory; tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).ifPresent(h -> { @@ -25,7 +25,7 @@ public ContainerPotion(int windowId, World world, BlockPos pos, PlayerInventory addSlot(new SlotItemHandler(h, 0, 9, 35)); }); layoutPlayerInventorySlots(8, 84); - this.trackAllIntFields(tile, TilePotion.Fields.values().length); + this.trackAllIntFields(tile, TilePotionBeacon.Fields.values().length); trackEnergy(tile); } diff --git a/src/main/java/com/lothrazar/cyclic/block/beaconpotion/ScreenPotion.java b/src/main/java/com/lothrazar/cyclic/block/beaconpotion/ScreenPotion.java index b1ef24db8..714f71e41 100644 --- a/src/main/java/com/lothrazar/cyclic/block/beaconpotion/ScreenPotion.java +++ b/src/main/java/com/lothrazar/cyclic/block/beaconpotion/ScreenPotion.java @@ -20,7 +20,7 @@ public class ScreenPotion extends ScreenBase { public ScreenPotion(ContainerPotion screenContainer, PlayerInventory inv, ITextComponent titleIn) { super(screenContainer, inv, titleIn); - energy = new EnergyBar(this, TilePotion.MAX); + energy = new EnergyBar(this, TilePotionBeacon.MAX); } @Override @@ -29,13 +29,13 @@ public void init() { int x, y; energy.guiLeft = guiLeft; energy.guiTop = guiTop; - energy.visible = TilePotion.POWERCONF.get() > 0; + energy.visible = TilePotionBeacon.POWERCONF.get() > 0; x = guiLeft + 6; y = guiTop + 6; - btnRedstone = addButton(new ButtonMachineField(x, y, TilePotion.Fields.REDSTONE.ordinal(), container.tile.getPos())); + btnRedstone = addButton(new ButtonMachineField(x, y, TilePotionBeacon.Fields.REDSTONE.ordinal(), container.tile.getPos())); y += 51; btnEntity = addButton(new ButtonMachine(x, y, 60, 20, "", (p) -> { - int f = TilePotion.Fields.ENTITYTYPE.ordinal(); + int f = TilePotionBeacon.Fields.ENTITYTYPE.ordinal(); PacketRegistry.INSTANCE.sendToServer(new PacketTileData(f, container.tile.getField(f) + 1, container.tile.getPos())); })); diff --git a/src/main/java/com/lothrazar/cyclic/block/beaconpotion/TilePotion.java b/src/main/java/com/lothrazar/cyclic/block/beaconpotion/TilePotionBeacon.java similarity index 98% rename from src/main/java/com/lothrazar/cyclic/block/beaconpotion/TilePotion.java rename to src/main/java/com/lothrazar/cyclic/block/beaconpotion/TilePotionBeacon.java index fb6dcdbf6..e4801569a 100644 --- a/src/main/java/com/lothrazar/cyclic/block/beaconpotion/TilePotion.java +++ b/src/main/java/com/lothrazar/cyclic/block/beaconpotion/TilePotionBeacon.java @@ -30,7 +30,7 @@ import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; -public class TilePotion extends TileEntityBase implements INamedContainerProvider, ITickableTileEntity { +public class TilePotionBeacon extends TileEntityBase implements INamedContainerProvider, ITickableTileEntity { static enum Fields { TIMER, REDSTONE, RANGE, ENTITYTYPE; @@ -60,7 +60,7 @@ public boolean isItemValid(int slot, ItemStack stack) { }; private LazyOptional inventoryCap = LazyOptional.of(() -> inventory); - public TilePotion() { + public TilePotionBeacon() { super(TileRegistry.beacon); timer = 0; } diff --git a/src/main/java/com/lothrazar/cyclic/block/collectitem/RenderItemCollect.java b/src/main/java/com/lothrazar/cyclic/block/collectitem/RenderItemCollect.java index e6f521d8f..393e0e7cc 100644 --- a/src/main/java/com/lothrazar/cyclic/block/collectitem/RenderItemCollect.java +++ b/src/main/java/com/lothrazar/cyclic/block/collectitem/RenderItemCollect.java @@ -20,7 +20,7 @@ public RenderItemCollect(TileEntityRendererDispatcher d) { public void render(TileItemCollector te, float v, MatrixStack matrix, IRenderTypeBuffer ibuffer, int partialTicks, int destroyStage) { int previewType = te.getField(TileItemCollector.Fields.RENDER.ordinal()); if (PreviewOutlineType.SHADOW.ordinal() == previewType) { - UtilRender.renderOutline(te.getPos(), te.getShape(), matrix, 0.7F, ClientConfigCyclic.getColor(te)); + UtilRender.renderOutline(te.getPos(), te.getShapeHollow(), matrix, 0.7F, ClientConfigCyclic.getColor(te)); } else if (PreviewOutlineType.WIREFRAME.ordinal() == previewType) { for (BlockPos crd : te.getShapeHollow()) { diff --git a/src/main/java/com/lothrazar/cyclic/block/collectitem/ScreenItemCollector.java b/src/main/java/com/lothrazar/cyclic/block/collectitem/ScreenItemCollector.java index b9788c1f9..5a651affd 100644 --- a/src/main/java/com/lothrazar/cyclic/block/collectitem/ScreenItemCollector.java +++ b/src/main/java/com/lothrazar/cyclic/block/collectitem/ScreenItemCollector.java @@ -51,7 +51,7 @@ public void init() { x = guiLeft + 34; f = TileItemCollector.Fields.HEIGHT.ordinal(); heightslider = this.addButton(new GuiSliderInteger(x, y, w, h, TileItemCollector.Fields.HEIGHT.ordinal(), container.tile.getPos(), - 0, TileItemCollector.MAX_HEIGHT, container.tile.getField(f))); + 1, TileItemCollector.MAX_HEIGHT, container.tile.getField(f))); heightslider.setTooltip("buildertype.height.tooltip"); //then size f = TileItemCollector.Fields.SIZE.ordinal(); diff --git a/src/main/java/com/lothrazar/cyclic/block/collectitem/TileItemCollector.java b/src/main/java/com/lothrazar/cyclic/block/collectitem/TileItemCollector.java index 2c9a5365f..eb01a8472 100644 --- a/src/main/java/com/lothrazar/cyclic/block/collectitem/TileItemCollector.java +++ b/src/main/java/com/lothrazar/cyclic/block/collectitem/TileItemCollector.java @@ -144,15 +144,11 @@ private int heightWithDirection() { } public List getShapeHollow() { - return getShape(); - } - - public List getShape() { BlockPos center = getFacingShapeCenter(radius); List shape = UtilShape.squareHorizontalHollow(center, radius); int heightWithDirection = heightWithDirection(); - if (heightWithDirection != 0) { - shape = UtilShape.repeatShapeByHeight(shape, heightWithDirection); + if (heightWithDirection > 1) { + shape = UtilShape.repeatShapeByHeight(shape, heightWithDirection - 1); } return shape; } @@ -161,15 +157,22 @@ private AxisAlignedBB getRange() { BlockPos center = getFacingShapeCenter(radius); int heightWithDirection = heightWithDirection(); int yMin = center.getY(); - int yMax = center.getY() + heightWithDirection; - //for some reason - if (!directionIsUp) { - // when aiming down, we dont have the offset to get [current block] without this - yMin++; + int yMax = center.getY(); + if (heightWithDirection < 0) { + yMin += heightWithDirection; } + else { + yMax += heightWithDirection; + } + //for some reason + // if (!directionIsUp && !this.getBlockStateVertical()) { + // // when aiming down, we dont have the offset to get [current block] without this + // yMin++; + // } AxisAlignedBB aabb = new AxisAlignedBB( center.getX() - radius, yMin, center.getZ() - radius, center.getX() + radius + 1, yMax, center.getZ() + radius + 1); + // System.out.println(aabb); return aabb; } diff --git a/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java b/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java index 636518f1c..1f135f788 100644 --- a/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java +++ b/src/main/java/com/lothrazar/cyclic/config/ConfigRegistry.java @@ -7,7 +7,7 @@ import com.lothrazar.cyclic.block.anvilmagma.TileAnvilMagma; import com.lothrazar.cyclic.block.anvilvoid.TileAnvilVoid; import com.lothrazar.cyclic.block.battery.TileBattery; -import com.lothrazar.cyclic.block.beaconpotion.TilePotion; +import com.lothrazar.cyclic.block.beaconpotion.TilePotionBeacon; import com.lothrazar.cyclic.block.cable.energy.TileCableEnergy; import com.lothrazar.cyclic.block.cable.fluid.TileCableFluid; import com.lothrazar.cyclic.block.collectfluid.TileFluidCollect; @@ -292,14 +292,14 @@ private static void initConfig() { TileDropper.POWERCONF = CFG.comment("Power per use dropper").defineInRange("dropper", 50, 0, 64000); TileForester.POWERCONF = CFG.comment("Power per use forester").defineInRange("forester", 50, 0, 64000); TileHarvester.POWERCONF = CFG.comment("Power per use harvester").defineInRange("harvester", 250, 0, 64000); - TilePotion.POWERCONF = CFG.comment("Power per tick beacon").defineInRange("beacon", 10, 0, 64000); + TilePotionBeacon.POWERCONF = CFG.comment("Power per tick beacon").defineInRange("beacon", 10, 0, 64000); TileMiner.POWERCONF = CFG.comment("Power per use miner").defineInRange("miner", 10, 0, 64000); TileUncraft.POWERCONF = CFG.comment("Power per use uncraft").defineInRange("uncraft", 1000, 0, 64000); TileFluidCollect.POWERCONF = CFG.comment("Power per use collector_fluid").defineInRange("collector_fluid", 500, 0, 64000); TilePeatFarm.POWERCONF = CFG.comment("Power per use peat_farm").defineInRange("peat_farm", 500, 0, 64000); TileCrafter.POWERCONF = CFG.comment("Power per use crafter").defineInRange("crafter", 500, 0, 64000); TileStructure.POWERCONF = CFG.comment("Power per tick while in use").defineInRange("structure", 10, 0, 64000); - TilePotion.POWERCONF = CFG.comment("Power per tick while in use").defineInRange("beacon", 0, 0, 64000); + TilePotionBeacon.POWERCONF = CFG.comment("Power per tick while in use").defineInRange("beacon", 0, 0, 64000); CFG.pop(); //cost CFG.pop(); //energy CFG.comment(WALL, "Fluid cost for various machines", WALL) diff --git a/src/main/java/com/lothrazar/cyclic/registry/TileRegistry.java b/src/main/java/com/lothrazar/cyclic/registry/TileRegistry.java index c569dcd02..3e61a0fac 100644 --- a/src/main/java/com/lothrazar/cyclic/registry/TileRegistry.java +++ b/src/main/java/com/lothrazar/cyclic/registry/TileRegistry.java @@ -5,7 +5,7 @@ import com.lothrazar.cyclic.block.anvilmagma.TileAnvilMagma; import com.lothrazar.cyclic.block.anvilvoid.TileAnvilVoid; import com.lothrazar.cyclic.block.battery.TileBattery; -import com.lothrazar.cyclic.block.beaconpotion.TilePotion; +import com.lothrazar.cyclic.block.beaconpotion.TilePotionBeacon; import com.lothrazar.cyclic.block.bedrock.UnbreakablePoweredTile; import com.lothrazar.cyclic.block.breaker.TileBreaker; import com.lothrazar.cyclic.block.cable.energy.TileCableEnergy; @@ -128,7 +128,7 @@ public static void onTileEntityRegistry(final RegistryEvent.Register placer_fluid; @ObjectHolder(ModCyclic.MODID + ":beacon") - public static TileEntityType beacon; + public static TileEntityType beacon; @ObjectHolder(ModCyclic.MODID + ":battery_infinite") public static TileEntityType battery_infinite; @ObjectHolder(ModCyclic.MODID + ":item_infinite")