diff --git a/lang b/lang index 7a992aeb2..237feca91 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit 7a992aeb27f3425858ce2510727400dafe0238c3 +Subproject commit 237feca912248c063f9ec0c22e41446291ae0126 diff --git a/src/main/java/forestry/api/climate/IClimateControlProvider.java b/src/main/java/forestry/api/climate/IClimateControlProvider.java index 67d279d21..72144cfa4 100644 --- a/src/main/java/forestry/api/climate/IClimateControlProvider.java +++ b/src/main/java/forestry/api/climate/IClimateControlProvider.java @@ -5,15 +5,10 @@ ******************************************************************************/ package forestry.api.climate; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; +import forestry.api.core.ILocatable; -public interface IClimateControlProvider { +public interface IClimateControlProvider extends ILocatable { IClimateControl getClimateControl(); - World getWorld(); - - BlockPos getCoordinates(); - } diff --git a/src/main/java/forestry/api/climate/IClimateSource.java b/src/main/java/forestry/api/climate/IClimateSource.java index 7ee863ac7..05592af34 100644 --- a/src/main/java/forestry/api/climate/IClimateSource.java +++ b/src/main/java/forestry/api/climate/IClimateSource.java @@ -9,13 +9,13 @@ package forestry.api.climate; * A climate source is used to change the climate in a region. */ public interface IClimateSource { - + /** * @param tickCount The current tick count. * @param region The climate region, in that the source stands. */ void changeClimate(int tickCount, IClimateRegion region); - + /** * @return The ticks that are required for one change. */ diff --git a/src/main/java/forestry/api/climate/IClimateSourceProvider.java b/src/main/java/forestry/api/climate/IClimateSourceProvider.java index 799abe02a..f4c9cc985 100644 --- a/src/main/java/forestry/api/climate/IClimateSourceProvider.java +++ b/src/main/java/forestry/api/climate/IClimateSourceProvider.java @@ -5,15 +5,9 @@ ******************************************************************************/ package forestry.api.climate; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; +import forestry.api.core.ILocatable; -public interface IClimateSourceProvider { +public interface IClimateSourceProvider extends ILocatable { IClimateSource getClimateSource(); - - World getWorld(); - - BlockPos getCoordinates(); - } diff --git a/src/main/java/forestry/api/core/ICamouflageHandler.java b/src/main/java/forestry/api/core/ICamouflageHandler.java index 01eda38df..8fbd786d0 100644 --- a/src/main/java/forestry/api/core/ICamouflageHandler.java +++ b/src/main/java/forestry/api/core/ICamouflageHandler.java @@ -6,21 +6,19 @@ package forestry.api.core; import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -public interface ICamouflageHandler{ +public interface ICamouflageHandler extends ILocatable { /** * @return The item of the block that is the camouflage of this handler for the type. */ ItemStack getCamouflageBlock(String type); - + /** * @return The default camouflage block item for the type. */ ItemStack getDefaultCamouflageBlock(String type); - + /** * @return True if the handler can handle this type of camouflage. */ @@ -30,11 +28,4 @@ public interface ICamouflageHandler{ * Set the camouflage block item for the type. */ void setCamouflageBlock(String type, ItemStack camouflageBlock); - - /** - * @return The coordinates of the handler as a BlockPos. - */ - BlockPos getCoordinates(); - - World getWorld(); } diff --git a/src/main/java/forestry/core/tiles/ILocatable.java b/src/main/java/forestry/api/core/ILocatable.java similarity index 94% rename from src/main/java/forestry/core/tiles/ILocatable.java rename to src/main/java/forestry/api/core/ILocatable.java index 66aeb2817..5bc76aa9c 100644 --- a/src/main/java/forestry/core/tiles/ILocatable.java +++ b/src/main/java/forestry/api/core/ILocatable.java @@ -1,21 +1,21 @@ -/******************************************************************************* - * Copyright (c) 2011-2014 SirSengir. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Lesser Public License v3 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/lgpl-3.0.txt - * - * Various Contributors including, but not limited to: - * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges - ******************************************************************************/ -package forestry.core.tiles; - -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -public interface ILocatable { - BlockPos getCoordinates(); - - /** Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12 */ - World getWorldObj(); -} +/******************************************************************************* + * Copyright (c) 2011-2014 SirSengir. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Various Contributors including, but not limited to: + * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges + ******************************************************************************/ +package forestry.api.core; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public interface ILocatable { + BlockPos getCoordinates(); + + /** Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12 */ + World getWorldObj(); +} diff --git a/src/main/java/forestry/arboriculture/CamouflageHandlerArbDoor.java b/src/main/java/forestry/arboriculture/CamouflageHandlerArbDoor.java index b3324de22..2472490e0 100644 --- a/src/main/java/forestry/arboriculture/CamouflageHandlerArbDoor.java +++ b/src/main/java/forestry/arboriculture/CamouflageHandlerArbDoor.java @@ -15,6 +15,8 @@ import forestry.api.core.ICamouflageHandler; import forestry.api.core.ICamouflageItemHandler; import forestry.api.core.ICamouflagedTile; import forestry.arboriculture.items.ItemBlockWoodDoor; +import org.apache.commons.lang3.tuple.Pair; + import net.minecraft.block.BlockDoor; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; @@ -23,9 +25,9 @@ import net.minecraft.client.renderer.block.model.IBakedModel; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import org.apache.commons.lang3.tuple.Pair; public class CamouflageHandlerArbDoor implements ICamouflageItemHandler { @@ -56,22 +58,22 @@ public class CamouflageHandlerArbDoor implements ICamouflageItemHandler { if(camouflageHandler == null || stack == null || stack.getItem() == null || stack.stackSize <= 0 || !(stack.getItem() instanceof ItemBlockWoodDoor)){ return null; } - World world = camouflageHandler.getWorld(); + World world = camouflageHandler.getWorldObj(); BlockPos pos = camouflageTile.getCoordinates(); IBlockState blockState = world.getBlockState(pos); IBlockState currentState = blockState.getActualState(world, pos); - + ItemBlockWoodDoor itemDoor = (ItemBlockWoodDoor) stack.getItem(); - + IBlockState doorState = itemDoor.block.getDefaultState() .withProperty(BlockDoor.FACING, currentState.getValue(BlockDoor.FACING)) .withProperty(BlockDoor.HINGE, currentState.getValue(BlockDoor.HINGE)) .withProperty(BlockDoor.OPEN, currentState.getValue(BlockDoor.OPEN)) .withProperty(BlockDoor.POWERED, currentState.getValue(BlockDoor.POWERED)) .withProperty(BlockDoor.HALF, currentState.getValue(BlockDoor.HALF)); - + BlockModelShapes modelShapes = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes(); - + return Pair.of(doorState, modelShapes.getModelForState(doorState)); } diff --git a/src/main/java/forestry/core/CamouflageHandlerDefault.java b/src/main/java/forestry/core/CamouflageHandlerDefault.java index 296e3fb69..b1698d2df 100644 --- a/src/main/java/forestry/core/CamouflageHandlerDefault.java +++ b/src/main/java/forestry/core/CamouflageHandlerDefault.java @@ -10,18 +10,19 @@ ******************************************************************************/ package forestry.core; -import org.apache.commons.lang3.tuple.Pair; - import forestry.api.core.CamouflageManager; import forestry.api.core.ICamouflageHandler; import forestry.api.core.ICamouflageItemHandler; import forestry.api.core.ICamouflagedTile; +import org.apache.commons.lang3.tuple.Pair; + import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BlockModelShapes; import net.minecraft.client.renderer.block.model.IBakedModel; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -57,7 +58,7 @@ public class CamouflageHandlerDefault implements ICamouflageItemHandler { BlockModelShapes modelShapes = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes(); Block block = Block.getBlockFromItem(stack.getItem()); IBlockState state = block.getStateFromMeta(stack.getItemDamage()); - + return Pair.of(state, modelShapes.getModelForState(state)); } diff --git a/src/main/java/forestry/core/CamouflageHandlerDoor.java b/src/main/java/forestry/core/CamouflageHandlerDoor.java index 310964641..bdef863cc 100644 --- a/src/main/java/forestry/core/CamouflageHandlerDoor.java +++ b/src/main/java/forestry/core/CamouflageHandlerDoor.java @@ -10,12 +10,12 @@ ******************************************************************************/ package forestry.core; -import org.apache.commons.lang3.tuple.Pair; - import forestry.api.core.CamouflageManager; import forestry.api.core.ICamouflageHandler; import forestry.api.core.ICamouflageItemHandler; import forestry.api.core.ICamouflagedTile; +import org.apache.commons.lang3.tuple.Pair; + import net.minecraft.block.Block; import net.minecraft.block.BlockDoor; import net.minecraft.block.state.IBlockState; @@ -26,6 +26,7 @@ import net.minecraft.item.ItemDoor; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; + import net.minecraftforge.fml.common.ObfuscationReflectionHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -59,23 +60,23 @@ public class CamouflageHandlerDoor implements ICamouflageItemHandler { if(camouflageHandler == null || stack == null || stack.getItem() == null || stack.stackSize <= 0 || !(stack.getItem() instanceof ItemDoor)){ return null; } - World world = camouflageHandler.getWorld(); + World world = camouflageHandler.getWorldObj(); BlockPos pos = camouflageTile.getCoordinates(); IBlockState blockState = world.getBlockState(pos); IBlockState currentState = blockState.getActualState(world, pos); - + ItemDoor itemDoor = (ItemDoor) stack.getItem(); Block doorBlock = ObfuscationReflectionHelper.getPrivateValue(ItemDoor.class, itemDoor, 0); - + IBlockState doorState = doorBlock.getDefaultState() .withProperty(BlockDoor.FACING, currentState.getValue(BlockDoor.FACING)) .withProperty(BlockDoor.HINGE, currentState.getValue(BlockDoor.HINGE)) .withProperty(BlockDoor.OPEN, currentState.getValue(BlockDoor.OPEN)) .withProperty(BlockDoor.POWERED, currentState.getValue(BlockDoor.POWERED)) .withProperty(BlockDoor.HALF, currentState.getValue(BlockDoor.HALF)); - + BlockModelShapes modelShapes = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes(); - + return Pair.of(doorState, modelShapes.getModelForState(doorState)); } diff --git a/src/main/java/forestry/core/climate/ClimateEventHandler.java b/src/main/java/forestry/core/climate/ClimateEventHandler.java index 9baca466e..c8886a7e7 100644 --- a/src/main/java/forestry/core/climate/ClimateEventHandler.java +++ b/src/main/java/forestry/core/climate/ClimateEventHandler.java @@ -16,17 +16,18 @@ import java.util.Map; import forestry.api.climate.IClimateRegion; import forestry.api.core.ForestryAPI; + import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; public class ClimateEventHandler { Map serverTicks; - + public ClimateEventHandler() { serverTicks = new HashMap<>(); } - + @SubscribeEvent public void onWorldTick(TickEvent.WorldTickEvent event) { Integer dim = Integer.valueOf(event.world.provider.getDimension()); @@ -44,5 +45,5 @@ public class ClimateEventHandler { serverTicks.put(dim, ticks+1); } } - + } diff --git a/src/main/java/forestry/core/climate/ClimateManager.java b/src/main/java/forestry/core/climate/ClimateManager.java index 47faf3b1a..55ea3b1d1 100644 --- a/src/main/java/forestry/core/climate/ClimateManager.java +++ b/src/main/java/forestry/core/climate/ClimateManager.java @@ -10,10 +10,6 @@ ******************************************************************************/ package forestry.core.climate; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraft.world.biome.Biome; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -26,17 +22,20 @@ import forestry.api.climate.IClimateRegion; import forestry.api.climate.IClimateSourceProvider; import forestry.core.DefaultClimateProvider; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + public class ClimateManager implements IClimateManager{ protected Map> regions; - private final Object regionsMutex; - + public ClimateManager() { regions = new HashMap<>(); regionsMutex = new Object(); } - + @Override public void addRegion(IClimateRegion region) { if(region == null){ @@ -58,7 +57,7 @@ public class ClimateManager implements IClimateManager{ } } } - + @Override public void removeRegion(IClimateRegion region) { if(region == null){ @@ -75,18 +74,18 @@ public class ClimateManager implements IClimateManager{ } } } - + @Override public void removeSource(IClimateSourceProvider source) { if(source == null){ return; } synchronized (regionsMutex) { - Integer dimensionID = Integer.valueOf(source.getWorld().provider.getDimension()); + Integer dimensionID = Integer.valueOf(source.getWorldObj().provider.getDimension()); if(!regions.containsKey(dimensionID)){ regions.put(dimensionID, new ArrayList<>()); } - IClimateRegion region = getRegionForPos(source.getWorld(), source.getCoordinates()); + IClimateRegion region = getRegionForPos(source.getWorldObj(), source.getCoordinates()); if(region != null){ if(!region.getSources().contains(source.getClimateSource())){ region.removeSource(source.getClimateSource()); @@ -94,18 +93,18 @@ public class ClimateManager implements IClimateManager{ } } } - + @Override public void addSource(IClimateSourceProvider source) { if(source == null){ return; } synchronized (regionsMutex) { - Integer dimensionID = Integer.valueOf(source.getWorld().provider.getDimension()); + Integer dimensionID = Integer.valueOf(source.getWorldObj().provider.getDimension()); if(!regions.containsKey(dimensionID)){ regions.put(dimensionID, new ArrayList<>()); } - IClimateRegion region = getRegionForPos(source.getWorld(), source.getCoordinates()); + IClimateRegion region = getRegionForPos(source.getWorldObj(), source.getCoordinates()); if(region != null){ if(!region.getSources().contains(source.getClimateSource())){ region.addSource(source.getClimateSource()); @@ -113,14 +112,14 @@ public class ClimateManager implements IClimateManager{ } } } - + @Override public float getTemperature(World world, BlockPos pos) { Biome biome = world.getBiome(pos); IClimateRegion region = getRegionForPos(world, pos); if(region!= null){ IClimatePosition position = region.getPositions().get(pos); - + if(position != null){ return position.getTemperature(); } @@ -134,19 +133,19 @@ public class ClimateManager implements IClimateManager{ IClimateRegion region = getRegionForPos(world, pos); if(region!= null){ IClimatePosition position = region.getPositions().get(pos); - + if(position != null){ return position.getHumidity(); } } return biome.getRainfall(); } - + @Override public Map> getRegions() { return regions; } - + @Override public IClimateRegion getRegionForPos(World world, BlockPos pos){ Integer dimensionID = Integer.valueOf(world.provider.getDimension()); @@ -163,7 +162,7 @@ public class ClimateManager implements IClimateManager{ } return null; } - + @Override public IClimateProvider getDefaultClimate(World world, BlockPos pos) { return new DefaultClimateProvider(world, pos); diff --git a/src/main/java/forestry/core/gui/IGuiHandlerTile.java b/src/main/java/forestry/core/gui/IGuiHandlerTile.java index 21319613f..3032c696e 100644 --- a/src/main/java/forestry/core/gui/IGuiHandlerTile.java +++ b/src/main/java/forestry/core/gui/IGuiHandlerTile.java @@ -10,9 +10,9 @@ ******************************************************************************/ package forestry.core.gui; -import net.minecraft.entity.player.EntityPlayer; +import forestry.api.core.ILocatable; -import forestry.core.tiles.ILocatable; +import net.minecraft.entity.player.EntityPlayer; public interface IGuiHandlerTile extends IGuiHandlerForestry, ILocatable { Object getGui(EntityPlayer player, int data); diff --git a/src/main/java/forestry/core/inventory/ItemInventoryCamouflageSprayCan.java b/src/main/java/forestry/core/inventory/ItemInventoryCamouflageSprayCan.java index 171b33f6b..f0d68b4ad 100644 --- a/src/main/java/forestry/core/inventory/ItemInventoryCamouflageSprayCan.java +++ b/src/main/java/forestry/core/inventory/ItemInventoryCamouflageSprayCan.java @@ -49,8 +49,7 @@ public class ItemInventoryCamouflageSprayCan extends ItemInventory implements IC } @Override - public World getWorld() { + public World getWorldObj() { return null; } - } diff --git a/src/main/java/forestry/core/multiblock/MultiblockControllerForestry.java b/src/main/java/forestry/core/multiblock/MultiblockControllerForestry.java index 5d0e723a4..42c67eeb7 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockControllerForestry.java +++ b/src/main/java/forestry/core/multiblock/MultiblockControllerForestry.java @@ -12,6 +12,8 @@ package forestry.core.multiblock; import javax.annotation.Nonnull; +import forestry.api.core.ILocatable; + import com.google.common.collect.HashMultiset; import com.google.common.collect.Multiset; import com.mojang.authlib.GameProfile; @@ -24,7 +26,7 @@ import forestry.core.inventory.IInventoryAdapter; import forestry.core.owner.IOwnerHandler; import forestry.core.owner.IOwnedTile; import forestry.core.owner.OwnerHandler; -import forestry.core.tiles.ILocatable; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; diff --git a/src/main/java/forestry/core/multiblock/MultiblockTileEntityForestry.java b/src/main/java/forestry/core/multiblock/MultiblockTileEntityForestry.java index 150cee2f0..6212767c6 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockTileEntityForestry.java +++ b/src/main/java/forestry/core/multiblock/MultiblockTileEntityForestry.java @@ -13,6 +13,8 @@ package forestry.core.multiblock; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import forestry.api.core.ILocatable; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -22,7 +24,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.world.World; import com.mojang.authlib.GameProfile; - import forestry.api.multiblock.IMultiblockLogic; import forestry.api.multiblock.MultiblockTileEntityBase; import forestry.core.config.Constants; @@ -31,7 +32,6 @@ import forestry.core.gui.IGuiHandlerTile; import forestry.core.inventory.FakeInventoryAdapter; import forestry.core.inventory.IInventoryAdapter; import forestry.core.tiles.IFilterSlotDelegate; -import forestry.core.tiles.ILocatable; import forestry.core.utils.PlayerUtil; public abstract class MultiblockTileEntityForestry extends MultiblockTileEntityBase implements ISidedInventory, IFilterSlotDelegate, ILocatable, IGuiHandlerTile { diff --git a/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java b/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java index c959dbdd2..2f360aa3a 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java @@ -12,6 +12,8 @@ package forestry.core.network.packets; import java.io.IOException; +import forestry.api.core.ILocatable; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; @@ -21,7 +23,6 @@ import forestry.core.network.IForestryPacketClient; import forestry.core.network.IStreamableGui; import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; -import forestry.core.tiles.ILocatable; public class PacketGuiUpdate extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/core/tiles/ILiquidTankTile.java b/src/main/java/forestry/core/tiles/ILiquidTankTile.java index 8b2f03e3b..2ef83cb65 100644 --- a/src/main/java/forestry/core/tiles/ILiquidTankTile.java +++ b/src/main/java/forestry/core/tiles/ILiquidTankTile.java @@ -12,6 +12,8 @@ package forestry.core.tiles; import javax.annotation.Nonnull; +import forestry.api.core.ILocatable; + import net.minecraft.util.EnumFacing; import net.minecraftforge.fluids.Fluid; diff --git a/src/main/java/forestry/core/tiles/TileForestry.java b/src/main/java/forestry/core/tiles/TileForestry.java index 1a620a5a0..107fb2ad4 100644 --- a/src/main/java/forestry/core/tiles/TileForestry.java +++ b/src/main/java/forestry/core/tiles/TileForestry.java @@ -12,6 +12,9 @@ package forestry.core.tiles; import javax.annotation.Nonnull; import javax.annotation.Nullable; + +import forestry.api.core.ILocatable; + import java.io.IOException; import java.util.Random; @@ -27,6 +30,7 @@ import forestry.core.network.IStreamable; import forestry.core.network.packets.PacketTileStream; import forestry.core.proxy.Proxies; import forestry.core.utils.NBTUtilForestry; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -40,6 +44,7 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.wrapper.SidedInvWrapper; diff --git a/src/main/java/forestry/core/utils/OreDictUtil.java b/src/main/java/forestry/core/utils/OreDictUtil.java index aef6f33bf..ad12c00a9 100644 --- a/src/main/java/forestry/core/utils/OreDictUtil.java +++ b/src/main/java/forestry/core/utils/OreDictUtil.java @@ -1,7 +1,5 @@ package forestry.core.utils; -import net.minecraftforge.oredict.OreDictionary; - public class OreDictUtil { public static final String ORE_COPPER = "oreCopper"; public static final String ORE_TIN = "oreTin"; diff --git a/src/main/java/forestry/greenhouse/PluginGreenhouse.java b/src/main/java/forestry/greenhouse/PluginGreenhouse.java index b991230ce..91a6c9537 100644 --- a/src/main/java/forestry/greenhouse/PluginGreenhouse.java +++ b/src/main/java/forestry/greenhouse/PluginGreenhouse.java @@ -12,17 +12,14 @@ package forestry.greenhouse; import net.minecraft.block.Block; import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.registry.GameRegistry; import forestry.api.core.ForestryAPI; import forestry.api.greenhouse.GreenhouseManager; -import forestry.api.recipes.RecipeManagers; import forestry.core.PluginCore; import forestry.core.config.Constants; -import forestry.core.fluids.Fluids; import forestry.core.items.EnumElectronTube; import forestry.core.recipes.RecipeUtil; import forestry.core.utils.OreDictUtil; diff --git a/src/main/java/forestry/greenhouse/blocks/BlockGreenhouse.java b/src/main/java/forestry/greenhouse/blocks/BlockGreenhouse.java index 529e8c9d5..b9bfdaf84 100644 --- a/src/main/java/forestry/greenhouse/blocks/BlockGreenhouse.java +++ b/src/main/java/forestry/greenhouse/blocks/BlockGreenhouse.java @@ -73,7 +73,6 @@ import forestry.core.tiles.IActivatable; import forestry.core.utils.CamouflageUtil; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.Log; -import forestry.greenhouse.tiles.TileGreenhouse; import forestry.greenhouse.tiles.TileGreenhouseClimateControl; import forestry.greenhouse.tiles.TileGreenhouseControl; import forestry.greenhouse.tiles.TileGreenhouseDoor; diff --git a/src/main/java/forestry/greenhouse/multiblock/FakeGreenhouseController.java b/src/main/java/forestry/greenhouse/multiblock/FakeGreenhouseController.java index 6f9589ac2..b335445c2 100644 --- a/src/main/java/forestry/greenhouse/multiblock/FakeGreenhouseController.java +++ b/src/main/java/forestry/greenhouse/multiblock/FakeGreenhouseController.java @@ -10,14 +10,12 @@ ******************************************************************************/ package forestry.greenhouse.multiblock; -import javax.annotation.Nonnull; import java.util.Collections; import java.util.List; import java.util.Set; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; +import javax.annotation.Nonnull; + import forestry.api.climate.IClimateControl; import forestry.api.climate.IClimateRegion; import forestry.api.greenhouse.EnumGreenhouseEventType; @@ -32,12 +30,15 @@ import forestry.core.inventory.IInventoryAdapter; import forestry.core.multiblock.FakeMultiblockController; import forestry.energy.EnergyManager; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; + public class FakeGreenhouseController extends FakeMultiblockController implements IGreenhouseControllerInternal { public static final FakeGreenhouseController instance = new FakeGreenhouseController(); - + private FakeGreenhouseController() { } - + @Nonnull @Override public IInventoryAdapter getInternalInventory() { @@ -49,7 +50,7 @@ public class FakeGreenhouseController extends FakeMultiblockController implement public ITankManager getTankManager() { return FakeTankManager.instance; } - + @Override public EnergyManager getEnergyManager() { return null; @@ -59,7 +60,7 @@ public class FakeGreenhouseController extends FakeMultiblockController implement public ItemStack getCamouflageBlock(String type) { return null; } - + @Override public ItemStack getDefaultCamouflageBlock(String type) { return null; @@ -67,9 +68,9 @@ public class FakeGreenhouseController extends FakeMultiblockController implement @Override public void setCamouflageBlock(String type, ItemStack camouflageBlock) { - + } - + @Override public boolean canHandleType(String type) { return false; @@ -79,7 +80,7 @@ public class FakeGreenhouseController extends FakeMultiblockController implement public BlockPos getCoordinates() { return null; } - + @Override public List getLogics() { return Collections.emptyList(); @@ -88,7 +89,7 @@ public class FakeGreenhouseController extends FakeMultiblockController implement @Override public void onChange(EnumGreenhouseEventType type, Object event) { } - + @Override public Set getInternalBlocks() { return Collections.emptySet(); @@ -98,7 +99,7 @@ public class FakeGreenhouseController extends FakeMultiblockController implement public String getUnlocalizedType() { return "for.multiblock.greenhouse.type"; } - + @Override public IClimateRegion getRegion() { return null; @@ -113,11 +114,6 @@ public class FakeGreenhouseController extends FakeMultiblockController implement return Collections.emptySet(); } - @Override - public World getWorld() { - return null; - } - @Override public boolean canWork() { return false; diff --git a/src/main/java/forestry/greenhouse/multiblock/GreenhouseController.java b/src/main/java/forestry/greenhouse/multiblock/GreenhouseController.java index d0398d38a..55d45a73b 100644 --- a/src/main/java/forestry/greenhouse/multiblock/GreenhouseController.java +++ b/src/main/java/forestry/greenhouse/multiblock/GreenhouseController.java @@ -10,7 +10,6 @@ ******************************************************************************/ package forestry.greenhouse.multiblock; -import javax.annotation.Nonnull; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; @@ -21,16 +20,8 @@ import java.util.Map; import java.util.Set; import java.util.Stack; -import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fluids.FluidRegistry; +import javax.annotation.Nonnull; + import forestry.api.climate.IClimateControl; import forestry.api.climate.IClimatePosition; import forestry.api.climate.IClimateRegion; @@ -54,8 +45,8 @@ import forestry.api.multiblock.IGreenhouseComponent.ClimateControl; import forestry.api.multiblock.IGreenhouseComponent.Climatiser; import forestry.api.multiblock.IGreenhouseController; import forestry.api.multiblock.IMultiblockComponent; -import forestry.core.climate.ClimateRoom; import forestry.core.climate.ClimatePosition; +import forestry.core.climate.ClimateRoom; import forestry.core.config.Constants; import forestry.core.fluids.TankManager; import forestry.core.fluids.tanks.FilteredTank; @@ -81,6 +72,18 @@ import forestry.greenhouse.blocks.BlockGreenhouseType; import forestry.greenhouse.inventory.InventoryGreenhouse; import forestry.greenhouse.tiles.TileGreenhouseSprinkler; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fluids.FluidRegistry; + public class GreenhouseController extends RectangularMultiblockControllerBase implements IGreenhouseControllerInternal, ILiquidTankTile { private final Set internalBlocks = new HashSet<>(); @@ -96,26 +99,26 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im private final EnergyManager energyManager; private final InventoryGreenhouse inventory; private final boolean needRenderUpdate = false; - + //Camouflage blocks private ItemStack camouflagePlainBlock; private ItemStack camouflageGlassBlock; private ItemStack camouflageDoorBlock; private ClimateRoom region; - + public GreenhouseController(World world) { super(world, GreenhouseMultiblockSizeLimits.instance); - + this.resourceTank = new FilteredTank(Constants.PROCESSOR_TANK_CAPACITY).setFilters(FluidRegistry.WATER); this.tankManager = new TankManager(this, resourceTank); this.energyManager = new EnergyManager(200, 100000); this.inventory = new InventoryGreenhouse(this); - + camouflagePlainBlock = getDefaultCamouflageBlock(CamouflageManager.DEFAULT); camouflageGlassBlock = getDefaultCamouflageBlock(CamouflageManager.GLASS); camouflageDoorBlock = getDefaultCamouflageBlock(CamouflageManager.DOOR); } - + /* CLIMATE */ @Override public EnumTemperature getTemperature() { @@ -127,7 +130,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im public EnumHumidity getHumidity() { return EnumHumidity.getFromValue(getExactHumidity()); } - + @Override public float getExactTemperature() { if(region == null){ @@ -154,53 +157,53 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im BlockPos coord = getReferenceCoord(); return new BlockPos(coord); } - + /* SAVING & LOADING */ @Override public NBTTagCompound writeToNBT(NBTTagCompound data) { data = super.writeToNBT(data); - + tankManager.writeToNBT(data); energyManager.writeToNBT(data); inventory.writeToNBT(data); - + CamouflageUtil.writeCamouflageBlockToNBT(data, this, CamouflageManager.DEFAULT); CamouflageUtil.writeCamouflageBlockToNBT(data, this, CamouflageManager.GLASS); CamouflageUtil.writeCamouflageBlockToNBT(data, this, CamouflageManager.DOOR); - + for (IGreenhouseLogic logic : getLogics()) { NBTTagCompound nbtTag = new NBTTagCompound(); logic.writeToNBT(nbtTag); data.setTag("logic" + logic.getName(), nbtTag); } - + if(region != null){ data.setTag("Region", region.writeToNBT(new NBTTagCompound())); } return data; } - + @Override public void readFromNBT(NBTTagCompound data) { super.readFromNBT(data); - + tankManager.readFromNBT(data); energyManager.readFromNBT(data); inventory.readFromNBT(data); - + CamouflageUtil.readCamouflageBlockFromNBT(data, this, CamouflageManager.DEFAULT); CamouflageUtil.readCamouflageBlockFromNBT(data, this, CamouflageManager.GLASS); CamouflageUtil.readCamouflageBlockFromNBT(data, this, CamouflageManager.DOOR); - + if (logics.isEmpty()) { createLogics(); } - + for (IGreenhouseLogic logic : getLogics()) { logic.readFromNBT(data.getCompoundTag("logic" + logic.getName())); } - + if(data.hasKey("Region")){ NBTTagCompound nbtTag = data.getCompoundTag("Region"); if(region != null){ @@ -210,7 +213,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im } } } - + @Override public void formatDescriptionPacket(NBTTagCompound data) { writeToNBT(data); @@ -220,12 +223,12 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im public void decodeDescriptionPacket(NBTTagCompound data) { readFromNBT(data); } - + @Override protected void onAttachedPartWithMultiblockData(IMultiblockComponent part, NBTTagCompound data) { readFromNBT(data); } - + /* GUI DATA */ @Override public void writeGuiData(DataOutputStreamForestry data) throws IOException { @@ -255,12 +258,12 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im region.readData(data); } } - + @Override public boolean canHandleType(String type) { return type.equals(CamouflageManager.DEFAULT) || type.equals(CamouflageManager.GLASS) || type.equals(CamouflageManager.DOOR); } - + /* CAMOUFLAGE */ @Override public void setCamouflageBlock(String type, ItemStack camouflageBlock) { @@ -278,7 +281,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im default: return; } - + if(!ItemStackUtil.isIdenticalItem(camouflageBlock, oldCamouflageBlock)){ switch (type) { case CamouflageManager.DEFAULT: @@ -297,11 +300,10 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im if (worldObj != null && worldObj.isRemote) { Proxies.net.sendToServer(new PacketCamouflageSelectServer(this, type, CamouflageSelectionType.MULTIBLOCK)); } - MinecraftForge.EVENT_BUS.post(new CamouflageChangeEvent(this, null, this, type)); } } - + @Override public ItemStack getCamouflageBlock(String type) { switch (type) { @@ -315,7 +317,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im return null; } } - + @Override public ItemStack getDefaultCamouflageBlock(String type) { switch (type) { @@ -329,7 +331,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im return null; } } - + /* GREENHOUSE */ @Override public void onChange(EnumGreenhouseEventType type, Object event) { @@ -337,7 +339,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im logic.onEvent(type, event); } } - + /* GREENHOUSE LOGICS */ private void createLogics() { logics.clear(); @@ -348,7 +350,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im } } } - + private IGreenhouseLogic createLogic(Class logicClass) { try { return logicClass.getConstructor(IGreenhouseController.class).newInstance(this); @@ -358,24 +360,24 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im return null; } } - + @Override public List getLogics() { return logics; } - + /* MANAGERS */ @Nonnull @Override public TankManager getTankManager() { return tankManager; } - + @Override public EnergyManager getEnergyManager() { return energyManager; } - + @Nonnull @Override public IInventoryAdapter getInternalInventory() { @@ -385,12 +387,12 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im return FakeInventoryAdapter.instance(); } } - + /* CONTROLLER */ @Override protected void onMachineAssembled() { super.onMachineAssembled(); - + createLogics(); if(region != null){ Map internalPositions = new HashMap<>(); @@ -429,11 +431,11 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im } } } - + @Override protected void onMachineDisassembled() { super.onMachineDisassembled(); - + internalBlocks.clear(); logics.clear(); @@ -495,36 +497,36 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im if (updateOnInterval(20)) { inventory.drainCan(tankManager); } - + for (IGreenhouseLogic logic : logics) { logic.work(); } - + for (IGreenhouseComponent.Active activeComponent : activeComponents) { activeComponent.updateServer(tickCount); } return false; } - + @Override protected void isMachineWhole() throws MultiblockValidationException { int minX = getSizeLimits().getMinimumXSize(); int minY = getSizeLimits().getMinimumYSize(); int minZ = getSizeLimits().getMinimumZSize(); - + if (connectedParts.size() < getSizeLimits().getMinimumNumberOfBlocksForAssembledMachine()) { throw new MultiblockValidationException(Translator.translateToLocalFormatted("for.multiblock.error.small", minX, minY, minZ)); } - + BlockPos maximumCoord = getMaximumCoord(); BlockPos minimumCoord = getMinimumCoord(); - + // Quickly check for exceeded dimensions int deltaX = maximumCoord.getX() - minimumCoord.getX() + 1; int deltaY = maximumCoord.getY() - minimumCoord.getY() + 1; int deltaZ = maximumCoord.getZ() - minimumCoord.getZ() + 1; - + int maxX = getSizeLimits().getMaximumXSize(); int maxY = getSizeLimits().getMaximumYSize(); int maxZ = getSizeLimits().getMaximumZSize(); @@ -547,14 +549,14 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im if (deltaZ < minZ) { throw new MultiblockValidationException(Translator.translateToLocalFormatted("for.multiblock.error.small.z", minZ)); } - + // Now we run a simple check on each block within that volume. // Any block deviating = NO DEAL SIR TileEntity te; IMultiblockComponent part; boolean isNextRoof = false; Class myClass = this.getClass(); - + for (int y = minimumCoord.getY(); y <= maximumCoord.getY() && !isNextRoof; y++) { for (int x = minimumCoord.getX(); x <= maximumCoord.getX(); x++) { for (int z = minimumCoord.getZ(); z <= maximumCoord.getZ(); z++) { @@ -567,7 +569,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im // This is permitted so that we can incorporate certain non-multiblock parts inside interiors part = null; } - + // Validate block type against both part-level and material-level validators. int extremes = 0; int sides = 0; @@ -583,7 +585,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im extremes++; sides++; } - + if (x == maximumCoord.getX()) { extremes++; sides++; @@ -592,11 +594,11 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im extremes++; sides++; } - - + + if (extremes >= 1) { // Side - + int exteriorLevel = y - minimumCoord.getY(); if (part != null) { // Ensure this part should actually be allowed within a cube of this controller's type @@ -619,7 +621,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im isBlockGoodForInterior(this.worldObj, pos); } } - + BlockPos posUp = pos.up(2); TileEntity tileUp = worldObj.getTileEntity(posUp); if (sides >= 1 && !(tileUp instanceof IGreenhouseComponent)) { @@ -632,7 +634,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im } } internalBlocks.clear(); - + if (isNextRoof) { checkInternalBlocks(); } @@ -693,25 +695,25 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im internalBlocks.add(blockToCheck); BlockPos posRoot = blockToCheck.getPos(); - + isBlockGoodForInterior(worldObj, posRoot); for (IInternalBlockFace faceToCheck : blockToCheck.getFaces()) { CheckInternalBlockFaceEvent checkEvent = new CheckInternalBlockFaceEvent(this, blockToCheck, faceToCheck); MinecraftForge.EVENT_BUS.post(checkEvent); - + if (!faceToCheck.isTested()) { EnumFacing face = faceToCheck.getFace(); BlockPos posFacing = posRoot.offset(face); - + BlockPos minPos = getMinimumCoord(); BlockPos maxPos = getMaximumCoord(); - + if (minPos.getX() > posFacing.getX() || minPos.getY() > posFacing.getY() || minPos.getZ() > posFacing.getZ() || maxPos.getX() < posFacing.getX() || maxPos.getY() < posFacing.getY() || maxPos.getZ() < posFacing.getZ()) { throw new MultiblockValidationException(Translator.translateToLocalFormatted("for.multiblock.greenhouse.error.space.closed")); } - + TileEntity tileFace = worldObj.getTileEntity(posFacing); - + if (tileFace instanceof IGreenhouseComponent) { if (((IGreenhouseComponent) tileFace).getMultiblockLogic().getController() != this) { throw new MultiblockValidationException(Translator.translateToLocalFormatted("for.multiblock.error.not.connected.part")); @@ -720,7 +722,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im } } else { IInternalBlock internalBlock = createInternalBlock(new InternalBlock(posFacing, face.getOpposite(), blockToCheck)); - + // Check is the internal block in the list if (internalBlocks.contains(internalBlock)) { faceToCheck.setTested(true); @@ -732,16 +734,16 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im } return newBlocksToCheck; } - + private IInternalBlock createInternalBlock(IInternalBlock internalBlock) { CreateInternalBlockEvent createEvent = new CreateInternalBlockEvent(this, internalBlock); - + MinecraftForge.EVENT_BUS.post(createEvent); - + return createEvent.internalBlock; - + } - + @Override public Set getInternalBlocks() { return internalBlocks; @@ -762,14 +764,14 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im @Override protected void isGoodForExteriorLevel(IMultiblockComponent part, int level) throws MultiblockValidationException { - + } @Override protected void isGoodForInterior(IMultiblockComponent part) throws MultiblockValidationException { - + } - + @Override protected void isBlockGoodForInterior(World world, BlockPos pos) throws MultiblockValidationException { } @@ -778,17 +780,12 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im public IClimateRegion getRegion() { return region; } - + @Override public void clearRegion() { region = null; } - - @Override - public World getWorld() { - return worldObj; - } - + @Override public Set getListenerComponents() { return listenerComponents; diff --git a/src/main/java/forestry/greenhouse/tiles/TileGreenhouseHatch.java b/src/main/java/forestry/greenhouse/tiles/TileGreenhouseHatch.java index 6003c2d6d..cc85266d4 100644 --- a/src/main/java/forestry/greenhouse/tiles/TileGreenhouseHatch.java +++ b/src/main/java/forestry/greenhouse/tiles/TileGreenhouseHatch.java @@ -10,26 +10,13 @@ ******************************************************************************/ package forestry.greenhouse.tiles; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - import java.io.IOException; import java.util.List; -import forestry.core.owner.IOwnerHandler; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import com.mojang.authlib.GameProfile; - -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.fluids.capability.CapabilityFluidHandler; -import net.minecraftforge.items.CapabilityItemHandler; -import net.minecraftforge.items.IItemHandler; import forestry.api.core.CamouflageManager; import forestry.api.core.ICamouflageHandler; import forestry.api.core.ICamouflagedTile; @@ -39,7 +26,6 @@ import forestry.api.greenhouse.GreenhouseEvents.CamouflageChangeEvent; import forestry.api.multiblock.IGreenhouseComponent; import forestry.api.multiblock.IMultiblockController; import forestry.api.multiblock.MultiblockTileEntityBase; -import forestry.core.owner.IOwnedTile; import forestry.core.config.Config; import forestry.core.gui.IHintSource; import forestry.core.network.DataInputStreamForestry; @@ -47,6 +33,8 @@ import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamableGui; import forestry.core.network.packets.CamouflageSelectionType; import forestry.core.network.packets.PacketCamouflageSelectServer; +import forestry.core.owner.IOwnedTile; +import forestry.core.owner.IOwnerHandler; import forestry.core.proxy.Proxies; import forestry.core.tiles.TileUtil; import forestry.core.utils.ItemStackUtil; @@ -54,34 +42,48 @@ import forestry.core.utils.PlayerUtil; import forestry.greenhouse.blocks.BlockGreenhouse; import forestry.greenhouse.blocks.BlockGreenhouseType; import forestry.greenhouse.multiblock.MultiblockLogicGreenhouse; + import cofh.api.energy.IEnergyConnection; import cofh.api.energy.IEnergyHandler; import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyReceiver; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; + public class TileGreenhouseHatch extends MultiblockTileEntityBase implements IGreenhouseComponent, IStreamableGui, IHintSource, IErrorLogicSource, IOwnedTile, ICamouflageHandler, ICamouflagedTile, IEnergyProvider, IEnergyReceiver { EnumFacing outwards; private ItemStack camouflageBlock; - + @Nullable private GameProfile owner; - + public TileGreenhouseHatch() { super(new MultiblockLogicGreenhouse()); outwards = null; camouflageBlock = null; } - + public EnumFacing getOutwardsDir() { return outwards; } - + @Override public void onMachineAssembled(IMultiblockController multiblockController, BlockPos minCoord, BlockPos maxCoord) { worldObj.notifyBlockOfStateChange(getPos(), worldObj.getBlockState(pos).getBlock()); markDirty(); - + recalculateOutwardsDirection(minCoord, maxCoord); } @@ -96,11 +98,11 @@ public class TileGreenhouseHatch extends MultiblockTileEntityBase T getCapability(@Nonnull Capability capability, @Nonnull EnumFacing facing) { @@ -311,7 +313,7 @@ public class TileGreenhouseHatch extends MultiblockTileEntityBase capability, @Nonnull EnumFacing facing) { if(getOutwardsTile() != null){ @@ -366,6 +368,11 @@ public class TileGreenhouseHatch extends MultiblockTileEntityBase