From 0a110eb76152014cc1bb3f084f1d30abf24e621d Mon Sep 17 00:00:00 2001 From: Aroma1997 Date: Sun, 11 Sep 2016 22:27:27 +0200 Subject: [PATCH 1/2] Fix #1414 greenhouse climate blocks crash (#1418) --- .../forestry/api/core/ICamouflageHandler.java | 15 +- .../{core/tiles => api/core}/ILocatable.java | 42 ++-- .../api/core/climate/IClimateSource.java | 13 +- .../CamouflageHandlerArbDoor.java | 14 +- .../core/CamouflageHandlerDefault.java | 11 +- .../forestry/core/CamouflageHandlerDoor.java | 15 +- .../core/climate/ClimateEventHandler.java | 13 +- .../forestry/core/climate/ClimateManager.java | 46 ++--- .../forestry/core/gui/IGuiHandlerTile.java | 4 +- .../MultiblockControllerForestry.java | 4 +- .../MultiblockTileEntityForestry.java | 4 +- .../core/network/packets/PacketGuiUpdate.java | 3 +- .../forestry/core/tiles/ILiquidTankTile.java | 2 + .../forestry/core/tiles/TileForestry.java | 5 + .../multiblock/FakeGreenhouseController.java | 32 ++- .../multiblock/GreenhouseController.java | 184 +++++++++--------- .../greenhouse/tiles/TileGreenhouseHatch.java | 99 +++++----- 17 files changed, 252 insertions(+), 254 deletions(-) rename src/main/java/forestry/{core/tiles => api/core}/ILocatable.java (94%) 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/api/core/climate/IClimateSource.java b/src/main/java/forestry/api/core/climate/IClimateSource.java index 73047b065..579e799fe 100644 --- a/src/main/java/forestry/api/core/climate/IClimateSource.java +++ b/src/main/java/forestry/api/core/climate/IClimateSource.java @@ -5,27 +5,22 @@ ******************************************************************************/ package forestry.api.core.climate; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; +import forestry.api.core.ILocatable; /** * A climate source is used to change the climate in a region. */ -public interface IClimateSource { - +public interface IClimateSource extends ILocatable { + /** * @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. */ int getTicksForChange(IClimateRegion region); - - World getWorld(); - - BlockPos getPos(); } diff --git a/src/main/java/forestry/arboriculture/CamouflageHandlerArbDoor.java b/src/main/java/forestry/arboriculture/CamouflageHandlerArbDoor.java index cdb149d71..835092520 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 5e59ee172..1760ffc86 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; @@ -34,8 +35,8 @@ public class CamouflageHandlerDefault implements ICamouflageItemHandler { } Block block = Block.getBlockFromItem(stack.getItem()); IBlockState stateFromMeta = block.getStateFromMeta(stack.getItemDamage()); - - return stateFromMeta.isOpaqueCube() && !block.hasTileEntity(stateFromMeta) && block.isNormalCube(stateFromMeta, camouflageHandler.getWorld(), camouflageHandler.getCoordinates()); + + return stateFromMeta.isOpaqueCube() && !block.hasTileEntity(stateFromMeta) && block.isNormalCube(stateFromMeta, camouflageHandler.getWorldObj(), camouflageHandler.getCoordinates()); } @Override @@ -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 7363cda40..f385f08de 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 2666d6dca..9d17831a8 100644 --- a/src/main/java/forestry/core/climate/ClimateEventHandler.java +++ b/src/main/java/forestry/core/climate/ClimateEventHandler.java @@ -1,27 +1,26 @@ package forestry.core.climate; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import forestry.api.core.ForestryAPI; -import forestry.api.core.climate.IClimateManager; import forestry.api.core.climate.IClimateRegion; import forestry.api.core.climate.IClimateSource; + import net.minecraft.util.math.BlockPos; -import net.minecraftforge.event.world.WorldEvent; + 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()); @@ -41,7 +40,7 @@ public class ClimateEventHandler { Map> sources = ForestryAPI.climateManager.getSources(); if(sources != null && sources.containsKey(dim)){ for(IClimateSource source : sources.get(dim).values()){ - IClimateRegion region = ForestryAPI.climateManager.getRegionForPos(event.world, source.getPos()); + IClimateRegion region = ForestryAPI.climateManager.getRegionForPos(event.world, source.getCoordinates()); if(region != null){ if(ticks % source.getTicksForChange(region) == 0){ source.changeClimate(ticks, region); @@ -52,5 +51,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 117f10e49..50b126f47 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,19 +22,23 @@ import forestry.api.core.climate.IClimateRegion; import forestry.api.core.climate.IClimateSource; 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; protected Map> sources; - + private final Object regionsMutex; - + public ClimateManager() { regions = new HashMap<>(); sources = new HashMap<>(); regionsMutex = new Object(); } - + @Override public void addRegion(IClimateRegion region) { if(region == null){ @@ -60,7 +60,7 @@ public class ClimateManager implements IClimateManager{ } } } - + @Override public void removeRegion(IClimateRegion region) { if(region == null){ @@ -77,36 +77,36 @@ public class ClimateManager implements IClimateManager{ } } } - + @Override public void removeSource(IClimateSource source) { - Integer dimensionID = Integer.valueOf(source.getWorld().provider.getDimension()); + Integer dimensionID = Integer.valueOf(source.getWorldObj().provider.getDimension()); if(!sources.containsKey(dimensionID)){ sources.put(dimensionID, new HashMap<>()); } - if(sources.get(dimensionID).keySet().contains(source.getPos())){ - sources.get(dimensionID).remove(source.getPos(), source); + if(sources.get(dimensionID).keySet().contains(source.getCoordinates())){ + sources.get(dimensionID).remove(source.getCoordinates(), source); } } - + @Override public void addSource(IClimateSource source) { - Integer dimensionID = Integer.valueOf(source.getWorld().provider.getDimension()); + Integer dimensionID = Integer.valueOf(source.getWorldObj().provider.getDimension()); if(!sources.containsKey(dimensionID)){ sources.put(dimensionID, new HashMap<>()); } - if(sources.get(dimensionID).get(source.getPos()) == null){ - sources.get(dimensionID).put(source.getPos(), source); + if(sources.get(dimensionID).get(source.getCoordinates()) == null){ + sources.get(dimensionID).put(source.getCoordinates(), source); } } - + @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(); } @@ -120,19 +120,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()); @@ -149,12 +149,12 @@ public class ClimateManager implements IClimateManager{ } return null; } - + @Override public Map> getSources() { return sources; } - + @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/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/greenhouse/multiblock/FakeGreenhouseController.java b/src/main/java/forestry/greenhouse/multiblock/FakeGreenhouseController.java index b7c8f9d34..0f96b6b01 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.core.climate.IClimateRegion; import forestry.api.greenhouse.EnumGreenhouseEventType; import forestry.api.greenhouse.IGreenhouseLogic; @@ -30,12 +28,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() { @@ -47,7 +48,7 @@ public class FakeGreenhouseController extends FakeMultiblockController implement public ITankManager getTankManager() { return FakeTankManager.instance; } - + @Override public EnergyManager getEnergyManager() { return null; @@ -57,7 +58,7 @@ public class FakeGreenhouseController extends FakeMultiblockController implement public ItemStack getCamouflageBlock(String type) { return null; } - + @Override public ItemStack getDefaultCamouflageBlock(String type) { return null; @@ -65,9 +66,9 @@ public class FakeGreenhouseController extends FakeMultiblockController implement @Override public void setCamouflageBlock(String type, ItemStack camouflageBlock) { - + } - + @Override public boolean canHandleType(String type) { return false; @@ -77,7 +78,7 @@ public class FakeGreenhouseController extends FakeMultiblockController implement public BlockPos getCoordinates() { return null; } - + @Override public List getLogics() { return Collections.emptyList(); @@ -86,7 +87,7 @@ public class FakeGreenhouseController extends FakeMultiblockController implement @Override public void onChange(EnumGreenhouseEventType type, Object event) { } - + @Override public Set getInternalBlocks() { return Collections.emptySet(); @@ -96,7 +97,7 @@ public class FakeGreenhouseController extends FakeMultiblockController implement public String getUnlocalizedType() { return "for.multiblock.greenhouse.type"; } - + @Override public IClimateRegion getRegion() { return null; @@ -110,9 +111,4 @@ public class FakeGreenhouseController extends FakeMultiblockController implement public Set getListenerComponents() { return Collections.emptySet(); } - - @Override - public World getWorld() { - return null; - } } diff --git a/src/main/java/forestry/greenhouse/multiblock/GreenhouseController.java b/src/main/java/forestry/greenhouse/multiblock/GreenhouseController.java index e9ab98c11..0da2f87ce 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.core.CamouflageManager; import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; @@ -51,8 +42,8 @@ import forestry.api.multiblock.IGreenhouseComponent; import forestry.api.multiblock.IGreenhouseComponent.ButterflyHatch; 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; @@ -77,38 +68,50 @@ import forestry.greenhouse.inventory.InventoryGreenhouse; import forestry.greenhouse.network.packets.PacketCamouflageUpdate; 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<>(); private final Set listenerComponents = new HashSet<>(); private final Set activeComponents = new HashSet<>(); private final List logics = new ArrayList<>(); - + private final TankManager tankManager; private final StandardTank resourceTank; 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() { @@ -120,13 +123,13 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im public EnumHumidity getHumidity() { return EnumHumidity.getFromValue(getExactHumidity()); } - + @Override public float getExactTemperature() { - int dimensionID = worldObj.provider.getDimension(); + int dimensionID = worldObj.provider.getDimension(); float temperature = 0.0F; int positions = 0; - + for(IInternalBlock internalBlock : internalBlocks){ IClimatePosition position = region.getPositions().get(internalBlock.getPos()); if(position != null){ @@ -142,7 +145,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im int dimensionID = worldObj.provider.getDimension(); float humidity = 0.0F; int positions = 0; - + for(IInternalBlock internalBlock : internalBlocks){ IClimatePosition position = region.getPositions().get(internalBlock.getPos()); if(position != null){ @@ -163,59 +166,59 @@ 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"); region = new ClimateRoom(this, nbtTag); } } - + @Override public void formatDescriptionPacket(NBTTagCompound data) { writeToNBT(data); @@ -225,12 +228,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 { @@ -260,12 +263,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) { @@ -283,7 +286,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im default: return; } - + if(!ItemStackUtil.isIdenticalItem(camouflageBlock, oldCamouflageBlock)){ switch (type) { case CamouflageManager.DEFAULT: @@ -298,7 +301,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im default: return; } - + if (worldObj != null) { if (worldObj.isRemote) { Proxies.net.sendToServer(new PacketCamouflageUpdate(this, type, true)); @@ -312,11 +315,11 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im } } } - + MinecraftForge.EVENT_BUS.post(new CamouflageChangeEvent(this, null, this, type)); } } - + @Override public ItemStack getCamouflageBlock(String type) { switch (type) { @@ -330,7 +333,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im return null; } } - + @Override public ItemStack getDefaultCamouflageBlock(String type) { switch (type) { @@ -344,7 +347,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im return null; } } - + /* GREENHOUSE */ @Override public void onChange(EnumGreenhouseEventType type, Object event) { @@ -352,7 +355,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im logic.onEvent(type, event); } } - + /* GREENHOUSE LOGICS */ private void createLogics() { logics.clear(); @@ -363,7 +366,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im } } } - + private IGreenhouseLogic createLogic(Class logicClass) { try { return logicClass.getConstructor(IGreenhouseController.class).newInstance(this); @@ -373,24 +376,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() { @@ -400,12 +403,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<>(); @@ -440,11 +443,11 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im ForestryAPI.climateManager.addRegion(region); } } - + @Override protected void onMachineDisassembled() { super.onMachineDisassembled(); - + internalBlocks.clear(); logics.clear(); } @@ -501,36 +504,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(); @@ -553,14 +556,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++) { @@ -573,7 +576,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; @@ -589,7 +592,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im extremes++; sides++; } - + if (x == maximumCoord.getX()) { extremes++; sides++; @@ -598,11 +601,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 @@ -625,7 +628,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)) { @@ -638,7 +641,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im } } internalBlocks.clear(); - + if (isNextRoof) { Stack blocksToCheck = new Stack<>(); IInternalBlock internalBlock = createInternalBlock(new InternalBlock(getMinimumCoord().add(1, 1, 1))); @@ -678,25 +681,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")); @@ -705,7 +708,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); @@ -717,21 +720,21 @@ 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; } - + public static ButterflyHatch getGreenhouseButterflyHatch(World world, BlockPos pos) { if (GreenhouseManager.greenhouseHelper.getGreenhouseController(world, pos) == null) { return null; @@ -747,14 +750,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 { } @@ -763,17 +766,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 223062e68..0e853ad30 100644 --- a/src/main/java/forestry/greenhouse/tiles/TileGreenhouseHatch.java +++ b/src/main/java/forestry/greenhouse/tiles/TileGreenhouseHatch.java @@ -10,26 +10,17 @@ ******************************************************************************/ 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 cofh.api.energy.IEnergyConnection; +import cofh.api.energy.IEnergyHandler; +import cofh.api.energy.IEnergyProvider; +import cofh.api.energy.IEnergyReceiver; 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,12 +30,13 @@ 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; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamableGui; +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 +46,42 @@ import forestry.greenhouse.blocks.BlockGreenhouseType; import forestry.greenhouse.multiblock.MultiblockLogicGreenhouse; import forestry.greenhouse.network.packets.PacketCamouflageUpdate; -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 +96,11 @@ public class TileGreenhouseHatch extends MultiblockTileEntityBase T getCapability(@Nonnull Capability capability, @Nonnull EnumFacing facing) { @@ -314,7 +314,7 @@ public class TileGreenhouseHatch extends MultiblockTileEntityBase capability, @Nonnull EnumFacing facing) { if(getOutwardsTile() != null){ @@ -369,6 +369,11 @@ public class TileGreenhouseHatch extends MultiblockTileEntityBase Date: Sun, 11 Sep 2016 22:23:38 -0700 Subject: [PATCH 2/2] Remove access-related hints and the power-required hint --- lang | 2 +- src/main/resources/config/forestry/hints.properties | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lang b/lang index 4c93562cb..237feca91 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit 4c93562cb9043939503ad357ef90309ffa2e1013 +Subproject commit 237feca912248c063f9ec0c22e41446291ae0126 diff --git a/src/main/resources/config/forestry/hints.properties b/src/main/resources/config/forestry/hints.properties index deb239b37..881a096be 100755 --- a/src/main/resources/config/forestry/hints.properties +++ b/src/main/resources/config/forestry/hints.properties @@ -1,13 +1,13 @@ -apiary=accesspipe;nopowerrequired;beebiomes;beebreeding;beejubilance;beeflowers;flowerjungle;flowernether;apiaristsuit;honeyfood; +apiary=nopowerrequired;beebiomes;beebreeding;beejubilance;beeflowers;flowerjungle;flowernether;apiaristsuit;honeyfood; bee.house=nopowerrequired;beebiomes;beebreeding;beejubilance;beeflowers;flowerjungle;flowernether;apiaristsuit;honeyfood; beealyzer=beebiomes;beebreeding;beejubilance;beeflowers;flowerjungle;flowernether; escritoire=beebiomes;beebreeding;beejubilance;beeflowers; farm=farmland;gearbox;valve;fertilizer;hatch;circuitboard;manualfarms;farmgui; flutterlyzer= -generator=accesscontrol;accessrules;accesspipe;energyunit;pipette;generatorfuels; +generator=energyunit;pipette;generatorfuels; habitat.locator=habitatlocatoruse; -moistener=nopowerrequired;accesscontrol;accessrules;accesspipe;pipette;moistenerproducts; -naturalist.chest=accesscontrol;accessrules;accesspipe; +moistener=nopowerrequired;pipette;moistenerproducts; +naturalist.chest= raintank=powerraintank; soldering.iron=circuitboard; treealyzer= @@ -18,7 +18,7 @@ mailbox=postage; philatelist=postage; trade.station=postage; -powered.machine=powerrequired;accesscontrol;accessrules;accesspipe; +powered.machine= analyzer=pipette;flowerjungle;flowernether;apiaristsuit;honeyfood; bottler=pipette; carpenter=pipette;crating; @@ -28,7 +28,7 @@ fermenter=pipette;shortmead; squeezer=pipette; still=pipette; -engine=accesscontrol;accessrules;accesspipe;energyunit;energybuffer; +engine=energyunit;energybuffer; engine.bronze=pipette;enginebronzefuels;enginebronzeheatloss;enginebronzeoutput;enginebronzewaste engine.copper=forcedcooldown;cooldownloss;enginecopperfuels;usesofash;enginecopperwaste;manualpeat;peatharvest engine.tin=forcedcooldown;cooldownloss;enginetinbatteries;enginetinchoke;