diff --git a/src/main/java/forestry/core/config/Constants.java b/src/main/java/forestry/core/config/Constants.java index 2847e9305..5c12f0a75 100644 --- a/src/main/java/forestry/core/config/Constants.java +++ b/src/main/java/forestry/core/config/Constants.java @@ -22,7 +22,7 @@ public class Constants implements IForestryConstants { public static final String MOD_ID = "forestry"; public static final String URL = "http://forestry.sengir.net/"; - public static final String VERSION = "5.0.0.0";//"@VERSION@" + public static final String VERSION = "@VERSION@"; public static final String BUILD_NUMBER = "@BUILD_NUMBER@"; public static final String RF_MOD_ID = "CoFHAPI|energy"; diff --git a/src/main/java/forestry/core/gui/GuiIdRegistry.java b/src/main/java/forestry/core/gui/GuiIdRegistry.java index 7409acce7..7e23d69ef 100644 --- a/src/main/java/forestry/core/gui/GuiIdRegistry.java +++ b/src/main/java/forestry/core/gui/GuiIdRegistry.java @@ -46,11 +46,7 @@ import forestry.factory.tiles.TileStill; import forestry.factory.tiles.TileWorktable; import forestry.farming.tiles.TileFarm; import forestry.greenhouse.items.ItemCamouflageSprayCan; -import forestry.greenhouse.tiles.TileDehumidifier; -import forestry.greenhouse.tiles.TileFan; import forestry.greenhouse.tiles.TileGreenhouse; -import forestry.greenhouse.tiles.TileHeater; -import forestry.greenhouse.tiles.TileHumidifier; import forestry.greenhouse.tiles.TileHygroregulator; import forestry.mail.items.ItemCatalogue; import forestry.mail.items.ItemLetter; @@ -91,10 +87,6 @@ public class GuiIdRegistry { TileFarm.class, TileGreenhouse.class, - TileHeater.class, - TileFan.class, - TileHumidifier.class, - TileDehumidifier.class, TileHygroregulator.class, TileEngineBiogas.class, diff --git a/src/main/java/forestry/greenhouse/PluginGreenhouse.java b/src/main/java/forestry/greenhouse/PluginGreenhouse.java index 3c21e3748..fb66b209d 100644 --- a/src/main/java/forestry/greenhouse/PluginGreenhouse.java +++ b/src/main/java/forestry/greenhouse/PluginGreenhouse.java @@ -61,15 +61,10 @@ import forestry.greenhouse.multiblock.blocks.ChunkEvents; import forestry.greenhouse.multiblock.blocks.world.GreenhouseBlockManager; import forestry.greenhouse.network.PacketRegistryGreenhouse; import forestry.greenhouse.proxy.ProxyGreenhouse; -import forestry.greenhouse.tiles.TileDehumidifier; -import forestry.greenhouse.tiles.TileFan; import forestry.greenhouse.tiles.TileGreenhouseControl; import forestry.greenhouse.tiles.TileGreenhouseGearbox; import forestry.greenhouse.tiles.TileGreenhousePlain; -import forestry.greenhouse.tiles.TileGreenhouseScreen; import forestry.greenhouse.tiles.TileGreenhouseWindow; -import forestry.greenhouse.tiles.TileHeater; -import forestry.greenhouse.tiles.TileHumidifier; import forestry.greenhouse.tiles.TileHygroregulator; import forestry.plugins.BlankForestryPlugin; import forestry.plugins.ForestryPlugin; @@ -135,15 +130,10 @@ public class PluginGreenhouse extends BlankForestryPlugin { IGreenhouseHelper helper = GreenhouseManager.helper; GameRegistry.registerTileEntity(TileGreenhousePlain.class, "forestry.GreenhousePlain"); - GameRegistry.registerTileEntity(TileFan.class, "forestry.GreenhouseFan"); - GameRegistry.registerTileEntity(TileHeater.class, "forestry.GreenhouseHeater"); - GameRegistry.registerTileEntity(TileDehumidifier.class, "forestry.GreenhouseDryer"); - GameRegistry.registerTileEntity(TileHumidifier.class, "forestry.GreenhouseSprinkler"); GameRegistry.registerTileEntity(TileHygroregulator.class, "forestry.ClimateSourceHygroregulator"); GameRegistry.registerTileEntity(TileGreenhouseGearbox.class, "forestry.GreenhouseGearbox"); GameRegistry.registerTileEntity(TileGreenhouseControl.class, "forestry.GreenhouseController"); GameRegistry.registerTileEntity(TileGreenhouseWindow.class, "forestry.ClimateSourceWindow"); - GameRegistry.registerTileEntity(TileGreenhouseScreen.class, "forestry.GreenhouseScreen"); helper.registerWindowGlass("glass", new ItemStack(Blocks.GLASS), "blocks/glass"); for (EnumDyeColor dye : EnumDyeColor.values()) { diff --git a/src/main/java/forestry/greenhouse/api/climate/IClimateSourceOwner.java b/src/main/java/forestry/greenhouse/api/climate/IClimateSourceOwner.java index 04e267c4b..e85ec2e17 100644 --- a/src/main/java/forestry/greenhouse/api/climate/IClimateSourceOwner.java +++ b/src/main/java/forestry/greenhouse/api/climate/IClimateSourceOwner.java @@ -5,20 +5,12 @@ ******************************************************************************/ package forestry.greenhouse.api.climate; -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - import forestry.api.circuits.ICircuit; import forestry.api.core.ILocatable; public interface IClimateSourceOwner extends ILocatable { IClimateSource getClimateSource(); - @SideOnly(Side.CLIENT) - ItemStack getItemStack(); - boolean isActive(); /** diff --git a/src/main/java/forestry/greenhouse/blocks/BlockClimatiser.java b/src/main/java/forestry/greenhouse/blocks/BlockClimatiser.java index 13854ae7c..4343135a3 100644 --- a/src/main/java/forestry/greenhouse/blocks/BlockClimatiser.java +++ b/src/main/java/forestry/greenhouse/blocks/BlockClimatiser.java @@ -68,10 +68,7 @@ import forestry.core.utils.ItemTooltipUtil; import forestry.core.utils.Translator; import forestry.greenhouse.PluginGreenhouse; import forestry.greenhouse.models.ModelCamouflaged; -import forestry.greenhouse.tiles.TileDehumidifier; -import forestry.greenhouse.tiles.TileFan; -import forestry.greenhouse.tiles.TileHeater; -import forestry.greenhouse.tiles.TileHumidifier; +import forestry.greenhouse.tiles.TileClimatiser; import forestry.greenhouse.tiles.TileHygroregulator; public class BlockClimatiser extends Block implements IBlockWithMeta, ISpriteRegister, IItemModelRegister, IColoredBlock, IBlockCamouflaged, ITileEntityProvider { @@ -186,15 +183,15 @@ public class BlockClimatiser extends Block implements IBlockWithMeta, ISpriteReg BlockClimatiserType type = BlockClimatiserType.VALUES[meta]; switch (type) { case DEHUMIDIFIER: - return new TileDehumidifier(); + return new TileClimatiser(TileClimatiser.DEHUMIDIFIER); case HUMIDIFIER: - return new TileHumidifier(); + return new TileClimatiser(TileClimatiser.HUMIDIFIER); case HYGRO: return new TileHygroregulator(); case FAN: - return new TileFan(); + return new TileClimatiser(TileClimatiser.FAN); case HEATER: - return new TileHeater(); + return new TileClimatiser(TileClimatiser.HEATER); } return null; } diff --git a/src/main/java/forestry/greenhouse/blocks/BlockGreenhouse.java b/src/main/java/forestry/greenhouse/blocks/BlockGreenhouse.java index 83fb5dfac..9045ec5fa 100755 --- a/src/main/java/forestry/greenhouse/blocks/BlockGreenhouse.java +++ b/src/main/java/forestry/greenhouse/blocks/BlockGreenhouse.java @@ -79,7 +79,6 @@ import forestry.greenhouse.multiblock.IGreenhouseControllerInternal; import forestry.greenhouse.tiles.TileGreenhouseControl; import forestry.greenhouse.tiles.TileGreenhouseGearbox; import forestry.greenhouse.tiles.TileGreenhousePlain; -import forestry.greenhouse.tiles.TileGreenhouseScreen; public class BlockGreenhouse extends BlockStructure implements ISpriteRegister, IBlockWithMeta, IColoredBlock, IBlockCamouflaged { public static final PropertyEnum TYPE = PropertyEnum.create("type", BlockGreenhouseType.class); @@ -230,8 +229,6 @@ public class BlockGreenhouse extends BlockStructure implements ISpriteRegister, return new TileGreenhouseGearbox(); case CONTROL: return new TileGreenhouseControl(); - case SCREEN: - return new TileGreenhouseScreen(); default: return new TileGreenhousePlain(); } diff --git a/src/main/java/forestry/greenhouse/tiles/TileClimatiser.java b/src/main/java/forestry/greenhouse/tiles/TileClimatiser.java index 88b5d120a..d2e209b86 100644 --- a/src/main/java/forestry/greenhouse/tiles/TileClimatiser.java +++ b/src/main/java/forestry/greenhouse/tiles/TileClimatiser.java @@ -26,7 +26,6 @@ import forestry.api.circuits.ChipsetManager; import forestry.api.circuits.CircuitSocketType; import forestry.api.circuits.ICircuitBoard; import forestry.api.circuits.ICircuitSocketType; -import forestry.api.climate.ClimateType; import forestry.api.core.ICamouflageHandler; import forestry.api.core.ICamouflagedTile; import forestry.apiculture.network.packets.PacketActiveUpdate; @@ -50,15 +49,24 @@ import forestry.greenhouse.gui.GuiClimatiser; import forestry.greenhouse.multiblock.GreenhouseController; import forestry.greenhouse.network.packets.PacketCamouflageSelectionServer; -public abstract class TileClimatiser extends TileForestry implements IActivatable, IStreamableGui, IClimateSourceOwner, ICamouflagedTile, ICamouflageHandler, ISocketable { +public class TileClimatiser extends TileForestry implements IActivatable, IStreamableGui, IClimateSourceOwner, ICamouflagedTile, ICamouflageHandler, ISocketable { + + public static final ClimatiserDefinition HEATER = new ClimatiserDefinition(0.075F, 5F, ClimateSourceType.TEMPERATURE); + public static final ClimatiserDefinition FAN = new ClimatiserDefinition(-0.075F, 5F, ClimateSourceType.TEMPERATURE); + public static final ClimatiserDefinition HUMIDIFIER = new ClimatiserDefinition(0.075F, 5F, ClimateSourceType.HUMIDITY); + public static final ClimatiserDefinition DEHUMIDIFIER = new ClimatiserDefinition(-0.075F, 5F, ClimateSourceType.HUMIDITY); private final InventoryAdapter sockets = new InventoryAdapter(1, "sockets"); private final ClimateSource source; private ItemStack camouflageBlock; private boolean active; - protected TileClimatiser(float change, float range, ClimateType type) { - this(new ClimateSourceClimatiser(type == ClimateType.HUMIDITY ? ClimateSourceType.HUMIDITY : ClimateSourceType.TEMPERATURE, change, range)); + public TileClimatiser(ClimatiserDefinition definition) { + this(definition.change, definition.range, definition.type); + } + + protected TileClimatiser(float change, float range, ClimateSourceType type) { + this(new ClimateSourceClimatiser(type, change, range)); } protected TileClimatiser(ClimateSource source) { @@ -262,4 +270,15 @@ public abstract class TileClimatiser extends TileForestry implements IActivatabl public ICircuitSocketType getSocketType() { return CircuitSocketType.GREENHOUSE_CLIMATISER; } + + public static class ClimatiserDefinition { + float change, range; + ClimateSourceType type; + + public ClimatiserDefinition(float change, float range, ClimateSourceType type) { + this.change = change; + this.range = range; + this.type = type; + } + } } diff --git a/src/main/java/forestry/greenhouse/tiles/TileDehumidifier.java b/src/main/java/forestry/greenhouse/tiles/TileDehumidifier.java deleted file mode 100644 index 6d1c46021..000000000 --- a/src/main/java/forestry/greenhouse/tiles/TileDehumidifier.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * 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.greenhouse.tiles; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import forestry.api.climate.ClimateType; -import forestry.greenhouse.PluginGreenhouse; -import forestry.greenhouse.blocks.BlockClimatiserType; - -public class TileDehumidifier extends TileClimatiser { - - public TileDehumidifier() { - super(-0.075F, 5F, ClimateType.HUMIDITY); - } - - @Override - @SideOnly(Side.CLIENT) - public ItemStack getItemStack() { - return new ItemStack(PluginGreenhouse.getBlocks().climatiserBlock, 1, BlockClimatiserType.DEHUMIDIFIER.ordinal()); - } - -} diff --git a/src/main/java/forestry/greenhouse/tiles/TileFan.java b/src/main/java/forestry/greenhouse/tiles/TileFan.java deleted file mode 100644 index 2c08e4f5e..000000000 --- a/src/main/java/forestry/greenhouse/tiles/TileFan.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * 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.greenhouse.tiles; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import forestry.api.climate.ClimateType; -import forestry.greenhouse.PluginGreenhouse; -import forestry.greenhouse.blocks.BlockClimatiserType; - -public class TileFan extends TileClimatiser { - - public TileFan() { - super(-0.075F, 5F, ClimateType.TEMPERATURE); - } - - @Override - @SideOnly(Side.CLIENT) - public ItemStack getItemStack() { - return new ItemStack(PluginGreenhouse.getBlocks().climatiserBlock, 1, BlockClimatiserType.FAN.ordinal()); - } - -} diff --git a/src/main/java/forestry/greenhouse/tiles/TileGreenhouseScreen.java b/src/main/java/forestry/greenhouse/tiles/TileGreenhouseScreen.java deleted file mode 100644 index 32c947cec..000000000 --- a/src/main/java/forestry/greenhouse/tiles/TileGreenhouseScreen.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * 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.greenhouse.tiles; - -public class TileGreenhouseScreen extends TileGreenhouse { - - public TileGreenhouseScreen() { - } -} diff --git a/src/main/java/forestry/greenhouse/tiles/TileGreenhouseWindow.java b/src/main/java/forestry/greenhouse/tiles/TileGreenhouseWindow.java index 3aaf797fc..a6fb3d018 100644 --- a/src/main/java/forestry/greenhouse/tiles/TileGreenhouseWindow.java +++ b/src/main/java/forestry/greenhouse/tiles/TileGreenhouseWindow.java @@ -13,16 +13,12 @@ package forestry.greenhouse.tiles; import javax.annotation.Nullable; import net.minecraft.block.state.IBlockState; -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.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - import forestry.apiculture.network.packets.PacketActiveUpdate; import forestry.core.tiles.IActivatable; import forestry.core.utils.NetworkUtil; @@ -49,12 +45,6 @@ public class TileGreenhouseWindow extends TileEntity implements IActivatable, IC return source; } - @Override - @SideOnly(Side.CLIENT) - public ItemStack getItemStack() { - return ((BlockGreenhouseWindow) getBlockType()).getItem(glass); - } - @Override public boolean isCircuitable() { return false; diff --git a/src/main/java/forestry/greenhouse/tiles/TileHeater.java b/src/main/java/forestry/greenhouse/tiles/TileHeater.java deleted file mode 100644 index 41037bab1..000000000 --- a/src/main/java/forestry/greenhouse/tiles/TileHeater.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * 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.greenhouse.tiles; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import forestry.api.climate.ClimateType; -import forestry.greenhouse.PluginGreenhouse; -import forestry.greenhouse.blocks.BlockClimatiserType; - -public class TileHeater extends TileClimatiser { - - public TileHeater() { - super(0.075F, 5F, ClimateType.TEMPERATURE); - } - - @Override - @SideOnly(Side.CLIENT) - public ItemStack getItemStack() { - return new ItemStack(PluginGreenhouse.getBlocks().climatiserBlock, 1, BlockClimatiserType.HEATER.ordinal()); - } - -} diff --git a/src/main/java/forestry/greenhouse/tiles/TileHumidifier.java b/src/main/java/forestry/greenhouse/tiles/TileHumidifier.java deleted file mode 100644 index 507cb0c07..000000000 --- a/src/main/java/forestry/greenhouse/tiles/TileHumidifier.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * 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.greenhouse.tiles; - -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import forestry.api.climate.ClimateType; -import forestry.greenhouse.PluginGreenhouse; -import forestry.greenhouse.blocks.BlockClimatiserType; - -public class TileHumidifier extends TileClimatiser { - - public TileHumidifier() { - super(0.075F, 5F, ClimateType.HUMIDITY); - } - - @Override - @SideOnly(Side.CLIENT) - public ItemStack getItemStack() { - return new ItemStack(PluginGreenhouse.getBlocks().climatiserBlock, 1, BlockClimatiserType.HUMIDIFIER.ordinal()); - } - -} diff --git a/src/main/java/forestry/greenhouse/tiles/TileHygroregulator.java b/src/main/java/forestry/greenhouse/tiles/TileHygroregulator.java index 285e6c64c..92a420d3d 100644 --- a/src/main/java/forestry/greenhouse/tiles/TileHygroregulator.java +++ b/src/main/java/forestry/greenhouse/tiles/TileHygroregulator.java @@ -15,7 +15,6 @@ import javax.annotation.Nullable; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; @@ -35,8 +34,6 @@ import forestry.core.fluids.Fluids; import forestry.core.fluids.TankManager; import forestry.core.recipes.HygroregulatorRecipe; import forestry.core.tiles.ILiquidTankTile; -import forestry.greenhouse.PluginGreenhouse; -import forestry.greenhouse.blocks.BlockClimatiserType; import forestry.greenhouse.climate.ClimateSourceHygroregulator; import forestry.greenhouse.gui.ContainerHygroregulator; import forestry.greenhouse.gui.GuiHygroregulator; @@ -151,10 +148,4 @@ public class TileHygroregulator extends TileClimatiser implements ILiquidTankTil return recipes; } - @Override - @SideOnly(Side.CLIENT) - public ItemStack getItemStack() { - return new ItemStack(PluginGreenhouse.getBlocks().climatiserBlock, 1, BlockClimatiserType.HYGRO.ordinal()); - } - }