Compare commits

...
12 Commits
27 changed files with 193 additions and 102 deletions

No files matched your search

+2 -2
View File
@@ -1,9 +1,9 @@
mcversion=1.9.4
forgeversion=12.17.0.1940
forgeversion=12.17.0.1944
mcp_mappings=snapshot_20160525
jei_version=3.4.0.+
version_major=5
version_minor=0
version_patch=4
version_patch=5
+1 -1
View File
@@ -49,7 +49,7 @@ import forestry.plugins.PluginManager;
name = "Forestry",
version = Constants.VERSION,
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
dependencies = "required-after:Forge@[12.17.0.1932,);"
dependencies = "required-after:Forge@[12.17.0.1941,);"
+ "after:Buildcraft|Core@[7.2,);"
+ "after:BuildCraft|Energy@[7.2,);"
+ "after:ExtrabiomesXL;"
@@ -6,7 +6,7 @@
package forestry.api.greenhouse;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
@@ -22,7 +22,7 @@ public interface IGreenhouseState {
float getExactHumidity();
List<IInternalBlock> getInternalBlocks();
Set<IInternalBlock> getInternalBlocks();
Collection<IMultiblockComponent> getGreenhouseComponents();
@@ -92,6 +92,7 @@ import forestry.apiculture.multiblock.TileAlvearyStabiliser;
import forestry.apiculture.multiblock.TileAlvearySwarmer;
import forestry.apiculture.network.PacketRegistryApiculture;
import forestry.apiculture.proxy.ProxyApiculture;
import forestry.apiculture.proxy.ProxyApicultureClient;
import forestry.apiculture.tiles.TileCandle;
import forestry.apiculture.tiles.TileHive;
import forestry.apiculture.worldgen.HiveDecorator;
@@ -127,7 +128,6 @@ public class PluginApiculture extends BlankForestryPlugin {
public static ProxyApiculture proxy;
private static final String CONFIG_CATEGORY = "apiculture";
public static String beekeepingMode = "NORMAL";
public static TextureAtlasSprite beeSprite;
private static float secondPrincessChance = 0;
public static final int ticksPerBeeWorkCycle = 550;
public static boolean fancyRenderedBees = false;
@@ -848,7 +848,7 @@ public class PluginApiculture extends BlankForestryPlugin {
for (int i = 0; i < ParticleSnow.sprites.length; i++) {
ParticleSnow.sprites[i] = event.getMap().registerSprite(new ResourceLocation("forestry:entity/particles/snow." + (i + 1)));
}
beeSprite = event.getMap().registerSprite(new ResourceLocation("forestry:entity/particles/swarm_bee"));
ProxyApicultureClient.beeSprite = event.getMap().registerSprite(new ResourceLocation("forestry:entity/particles/swarm_bee"));
}
private static class EndFlowerAcceptableRule implements IFlowerAcceptableRule {
@@ -33,12 +33,8 @@ public enum BlockTypeApicultureTesr implements IBlockTypeTesr {
@Nonnull
private final IMachinePropertiesTesr<?> machineProperties;
<T extends TileForestry> BlockTypeApicultureTesr(@Nonnull Class<T> teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer<? super T> renderer, @Nullable AxisAlignedBB boundingBox) {
if (boundingBox != null) {
this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, boundingBox, Constants.MOD_ID + ":blocks/" + name + ".0");
} else {
this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, Constants.MOD_ID + ":blocks/" + name + ".0");
}
<T extends TileForestry> BlockTypeApicultureTesr(@Nonnull Class<T> teClass, @Nonnull String name, @Nullable TileEntitySpecialRenderer<? super T> renderer, AxisAlignedBB boundingBox) {
this.machineProperties = new MachinePropertiesTesr<>(teClass, name, renderer, boundingBox, Constants.MOD_ID + ":blocks/" + name + ".0");
}
@Nonnull
@@ -12,20 +12,19 @@ package forestry.apiculture.entities;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import forestry.apiculture.PluginApiculture;
import forestry.apiculture.proxy.ProxyApicultureClient;
public class ParticleBeeExplore extends Particle {
private final Vec3d origin;
public ParticleBeeExplore(World world, Vec3d origin, BlockPos destination, int color) {
super(world, origin.xCoord, origin.yCoord, origin.zCoord, 0.0D, 0.0D, 0.0D);
setParticleTexture(PluginApiculture.beeSprite);
setParticleTexture(ProxyApicultureClient.beeSprite);
this.origin = origin;
this.motionX = (destination.getX() + 0.5 - this.posX) * 0.015;
@@ -17,7 +17,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import forestry.apiculture.PluginApiculture;
import forestry.apiculture.proxy.ProxyApicultureClient;
public class ParticleBeeRoundTrip extends Particle {
private final Vec3d origin;
@@ -25,7 +25,7 @@ public class ParticleBeeRoundTrip extends Particle {
public ParticleBeeRoundTrip(World world, Vec3d origin, BlockPos destination, int color) {
super(world, origin.xCoord, origin.yCoord, origin.zCoord, 0.0D, 0.0D, 0.0D);
setParticleTexture(PluginApiculture.beeSprite);
setParticleTexture(ProxyApicultureClient.beeSprite);
this.origin = origin;
this.destination = destination;
@@ -13,11 +13,10 @@ package forestry.apiculture.entities;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import forestry.apiculture.PluginApiculture;
import forestry.apiculture.proxy.ProxyApicultureClient;
public class ParticleBeeTargetEntity extends Particle {
private final Vec3d origin;
@@ -25,7 +24,7 @@ public class ParticleBeeTargetEntity extends Particle {
public ParticleBeeTargetEntity(World world, Vec3d origin, Entity entity, int color) {
super(world, origin.xCoord, origin.yCoord, origin.zCoord, 0.0D, 0.0D, 0.0D);
setParticleTexture(PluginApiculture.beeSprite);
setParticleTexture(ProxyApicultureClient.beeSprite);
this.origin = origin;
this.entity = entity;
@@ -10,8 +10,12 @@
******************************************************************************/
package forestry.apiculture.proxy;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
public class ProxyApicultureClient extends ProxyApiculture {
public static TextureAtlasSprite beeSprite;
@Override
public void initializeRendering() {
// TODO: remove unused bee entity model completely
@@ -231,8 +231,7 @@ public class TileHive extends TileEntity implements ITickable, IHiveTile, IActiv
if (damage > 0) {
// Entities are not attacked if they wear a full set of apiarist's armor.
int count = BeeManager.armorApiaristHelper.wearsItems(entity, damageSourceBeeHive.damageType, true);
damage -= damage / 4.0f * count;
if (damage > 0) {
if (entity.worldObj.rand.nextInt(4) >= count) {
entity.attackEntityFrom(damageSourceBeeHive, damage);
}
}
@@ -16,6 +16,7 @@ import java.util.Collections;
import java.util.Random;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -40,7 +41,7 @@ public class BlockArbDoor extends BlockDoor implements IWoodTyped, IItemModelReg
private final EnumForestryWoodType woodType;
public BlockArbDoor(EnumForestryWoodType woodType) {
super(MaterialArbWood.ARB_WOOD);
super(Material.WOOD);
this.woodType = woodType;
setHarvestLevel("axe", 0);
@@ -73,14 +73,16 @@ public class ItemBlockPile<B extends Block> extends ItemBlockForestry<Block> {
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) {
boolean placed = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState);
if(block == PluginArboriculture.blocks.piles.get(EnumPileType.WOOD)){
if (block.hasTileEntity(newState)) {
if (stack.hasTagCompound()) {
TilePile tile = TileUtil.getTile(world, pos, TilePile.class);
if (tile != null) {
tile.readFromNBT(stack.getTagCompound());
tile.setPos(pos);
tile.markDirty();
if (placed) {
if (block == PluginArboriculture.blocks.piles.get(EnumPileType.WOOD)) {
if (block.hasTileEntity(newState)) {
if (stack.hasTagCompound()) {
TilePile tile = TileUtil.getTile(world, pos, TilePile.class);
if (tile != null) {
tile.readFromNBT(stack.getTagCompound());
tile.setPos(pos);
tile.markDirty();
}
}
}
}
@@ -92,14 +92,14 @@ public class ModelLeaves extends ModelBlockDefault<BlockForestryLeaves> {
TextureAtlasSprite leafSprite = map.getAtlasSprite(leafSpriteLocation.toString());
// Render the plain leaf block.
baker.addBlockModel(block, Block.FULL_BLOCK_AABB, pos, leafSprite, 0);
baker.addBlockModel(block, Block.FULL_BLOCK_AABB, null, leafSprite, 0);
// Render overlay for fruit leaves.
ResourceLocation fruitSpriteLocation = tile.getFruitSprite();
if (fruitSpriteLocation != null) {
TextureAtlasSprite fruitSprite = map.getAtlasSprite(fruitSpriteLocation.toString());
baker.addBlockModel(block, Block.FULL_BLOCK_AABB, pos, fruitSprite, 1);
baker.addBlockModel(block, Block.FULL_BLOCK_AABB, null, fruitSprite, 1);
}
// Set the particle sprite
@@ -124,6 +124,14 @@ public class BlockBase<P extends Enum<P> & IBlockType & IStringSerializable> ext
return definition.getBoundingBox(pos, blockState);
}
@Nonnull
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos) {
IMachineProperties definition = getDefinition();
return definition.getBoundingBox(pos, state).offset(pos);
}
@Override
public RayTraceResult collisionRayTrace(IBlockState blockState, World worldIn, BlockPos pos, Vec3d start, Vec3d end) {
IMachineProperties definition = getDefinition();
@@ -58,18 +58,20 @@ public class ItemBlockForestry<B extends Block> extends ItemBlock {
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) {
boolean placed = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState);
if (block.hasTileEntity(newState)) {
if (stack.getItem() instanceof ItemBlockNBT && stack.hasTagCompound()) {
TileForestry tile = TileUtil.getTile(world, pos, TileForestry.class);
if (tile != null) {
tile.readFromNBT(stack.getTagCompound());
tile.setPos(pos);
if (placed) {
if (block.hasTileEntity(newState)) {
if (stack.getItem() instanceof ItemBlockNBT && stack.hasTagCompound()) {
TileForestry tile = TileUtil.getTile(world, pos, TileForestry.class);
if (tile != null) {
tile.readFromNBT(stack.getTagCompound());
tile.setPos(pos);
}
}
}
}
if (block instanceof BlockBase) {
((BlockBase) block).rotateAfterPlacement(player, world, pos, side);
if (block instanceof BlockBase) {
((BlockBase) block).rotateAfterPlacement(player, world, pos, side);
}
}
return placed;
@@ -100,7 +100,7 @@ public final class VectUtil {
do {
pos = nextPos();
}
while (pos != null && (pos.getX() > maxPos.getX() || pos.getZ() > maxPos.getZ() || pos.getX() < minPos.getX() || pos.getZ() < minPos.getZ()));
while (pos != null && (pos.getX() > maxPos.getX() || pos.getY() > maxPos.getY() || pos.getZ() > maxPos.getZ() || pos.getX() < minPos.getX() || pos.getY() < minPos.getY() || pos.getZ() < minPos.getZ()));
return pos;
}
@@ -12,7 +12,7 @@ package forestry.greenhouse;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
@@ -45,8 +45,8 @@ public class FakeGreenhouseState implements IGreenhouseState {
}
@Override
public List<IInternalBlock> getInternalBlocks() {
return Collections.emptyList();
public Set<IInternalBlock> getInternalBlocks() {
return Collections.emptySet();
}
@Override
@@ -19,6 +19,7 @@ import forestry.api.greenhouse.IInternalBlock;
import forestry.core.multiblock.IMultiblockControllerInternal;
import forestry.core.multiblock.MultiblockRegistry;
import forestry.greenhouse.multiblock.IGreenhouseControllerInternal;
import forestry.greenhouse.multiblock.InternalBlockCheck;
public class GreenhouseHelper implements IGreenhouseHelper {
@@ -28,7 +29,7 @@ public class GreenhouseHelper implements IGreenhouseHelper {
for (IMultiblockControllerInternal controllerInternal : MultiblockRegistry.getControllersFromWorld(world)) {
if (controllerInternal instanceof IGreenhouseControllerInternal) {
if (controllerInternal.isAssembled()) {
if (isPosiotionInGreenhouse((IGreenhouseControllerInternal) controllerInternal, pos)) {
if (isPositionInGreenhouse((IGreenhouseControllerInternal) controllerInternal, pos)) {
return ((IGreenhouseControllerInternal) controllerInternal).createState();
}
}
@@ -38,13 +39,9 @@ public class GreenhouseHelper implements IGreenhouseHelper {
return null;
}
private static boolean isPosiotionInGreenhouse(IGreenhouseControllerInternal controller, BlockPos pos) {
for (IInternalBlock internalBlock : controller.getInternalBlocks()) {
if (internalBlock.getPos().equals(pos)) {
return true;
}
}
return false;
private static boolean isPositionInGreenhouse(IGreenhouseControllerInternal controller, BlockPos pos) {
IInternalBlock checkBlock = new InternalBlockCheck(pos);
return controller.getInternalBlocks().contains(checkBlock);
}
}
@@ -11,7 +11,7 @@
package forestry.greenhouse;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
@@ -24,10 +24,10 @@ public final class GreenhouseState implements IGreenhouseState {
private final float humidity;
private final float temperature;
private final List<IInternalBlock> internalBlocks;
private final Set<IInternalBlock> internalBlocks;
private final Collection<IMultiblockComponent> greenhouseComponents;
public GreenhouseState(float humidity, float temperature, List<IInternalBlock> internalBlocks, Collection<IMultiblockComponent> greenhouseComponents) {
public GreenhouseState(float humidity, float temperature, Set<IInternalBlock> internalBlocks, Collection<IMultiblockComponent> greenhouseComponents) {
this.humidity = humidity;
this.temperature = temperature;
this.internalBlocks = internalBlocks;
@@ -59,7 +59,7 @@ public final class GreenhouseState implements IGreenhouseState {
}
@Override
public List<IInternalBlock> getInternalBlocks() {
public Set<IInternalBlock> getInternalBlocks() {
return internalBlocks;
}
@@ -13,6 +13,7 @@ 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;
@@ -97,8 +98,8 @@ public class FakeGreenhouseController extends FakeMultiblockController implement
}
@Override
public List<IInternalBlock> getInternalBlocks() {
return Collections.emptyList();
public Set<IInternalBlock> getInternalBlocks() {
return Collections.emptySet();
}
@Override
@@ -64,6 +64,7 @@ import forestry.core.network.DataOutputStreamForestry;
import forestry.core.proxy.Proxies;
import forestry.core.tiles.ILiquidTankTile;
import forestry.core.utils.CamouflageUtil;
import forestry.core.utils.ItemStackUtil;
import forestry.core.utils.Log;
import forestry.core.utils.Translator;
import forestry.energy.EnergyManager;
@@ -76,7 +77,7 @@ import forestry.greenhouse.tiles.TileGreenhouseSprinkler;
public class GreenhouseController extends RectangularMultiblockControllerBase implements IGreenhouseControllerInternal, ILiquidTankTile {
private final List<IInternalBlock> internalBlocks = new ArrayList<>();
private final Set<IInternalBlock> internalBlocks = new HashSet<>();
private final Set<IGreenhouseComponent.Listener> listenerComponents = new HashSet<>();
private final Set<IGreenhouseComponent.Climatiser> climatiserComponents = new HashSet<>();
private final Set<IGreenhouseComponent.Active> activeComponents = new HashSet<>();
@@ -288,35 +289,52 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im
/* CAMOUFLAGE */
@Override
public void setCamouflageBlock(EnumCamouflageType type, ItemStack camouflageBlock) {
ItemStack oldCamouflageBlock;
switch (type) {
case DEFAULT:
camouflagePlainBlock = camouflageBlock;
break;
case GLASS:
camouflageGlassBlock = camouflageBlock;
break;
case DOOR:
camouflageDoorBlock = camouflageBlock;
break;
default:
return;
case DEFAULT:
oldCamouflageBlock = camouflagePlainBlock;
break;
case GLASS:
oldCamouflageBlock = camouflageGlassBlock;
break;
case DOOR:
oldCamouflageBlock = camouflageDoorBlock;
break;
default:
return;
}
if (worldObj != null) {
if (worldObj.isRemote) {
for (IMultiblockComponent comp : connectedParts) {
if (comp instanceof ICamouflagedTile) {
ICamouflagedTile camBlock = (ICamouflagedTile) comp;
if (camBlock.getCamouflageType() == type) {
worldObj.markBlockRangeForRenderUpdate(camBlock.getCoordinates(), camBlock.getCoordinates());
if(!ItemStackUtil.isIdenticalItem(camouflageBlock, oldCamouflageBlock)){
switch (type) {
case DEFAULT:
camouflagePlainBlock = camouflageBlock;
break;
case GLASS:
camouflageGlassBlock = camouflageBlock;
break;
case DOOR:
camouflageDoorBlock = camouflageBlock;
break;
default:
return;
}
if (worldObj != null) {
if (worldObj.isRemote) {
for (IMultiblockComponent comp : connectedParts) {
if (comp instanceof ICamouflagedTile) {
ICamouflagedTile camBlock = (ICamouflagedTile) comp;
if (camBlock.getCamouflageType() == type) {
worldObj.markBlockRangeForRenderUpdate(camBlock.getCoordinates(), camBlock.getCoordinates());
}
}
}
Proxies.net.sendToServer(new PacketCamouflageUpdate(this, type, true));
}
Proxies.net.sendToServer(new PacketCamouflageUpdate(this, type, true));
}
MinecraftForge.EVENT_BUS.post(new CamouflageChangeEvent(createState(), null, this, type));
}
MinecraftForge.EVENT_BUS.post(new CamouflageChangeEvent(createState(), null, this, type));
}
@Override
@@ -726,7 +744,7 @@ public class GreenhouseController extends RectangularMultiblockControllerBase im
}
@Override
public List<IInternalBlock> getInternalBlocks() {
public Set<IInternalBlock> getInternalBlocks() {
return internalBlocks;
}
@@ -12,7 +12,7 @@ package forestry.greenhouse.multiblock;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Set;
import forestry.api.greenhouse.IGreenhouseState;
import forestry.api.greenhouse.IInternalBlock;
@@ -53,7 +53,7 @@ public interface IGreenhouseControllerInternal extends IGreenhouseController, IM
IGreenhouseState createState();
/**
* @return A list with all internal block's of the greenhouse.
* @return All internal blocks of the greenhouse.
*/
List<IInternalBlock> getInternalBlocks();
Set<IInternalBlock> getInternalBlocks();
}
@@ -74,4 +74,9 @@ public class InternalBlock implements IInternalBlock {
IInternalBlock internalBlock = (IInternalBlock) obj;
return internalBlock.getPos().equals(getPos());
}
@Override
public int hashCode() {
return pos.hashCode();
}
}
@@ -0,0 +1,54 @@
package forestry.greenhouse.multiblock;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Collections;
import net.minecraft.util.math.BlockPos;
import forestry.api.greenhouse.IInternalBlock;
import forestry.api.greenhouse.IInternalBlockFace;
/**
* Used to check if a blockPos is in a collection of IInternalBlock
*/
public class InternalBlockCheck implements IInternalBlock {
private final BlockPos pos;
public InternalBlockCheck(BlockPos pos) {
this.pos = pos;
}
@Nonnull
@Override
public BlockPos getPos() {
return pos;
}
@Nullable
@Override
public IInternalBlock getRoot() {
return null;
}
@Nonnull
@Override
public Collection<IInternalBlockFace> getFaces() {
return Collections.emptyList();
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof IInternalBlock)) {
return false;
}
IInternalBlock internalBlock = (IInternalBlock) obj;
return internalBlock.getPos().equals(getPos());
}
@Override
public int hashCode() {
return pos.hashCode();
}
}
@@ -41,6 +41,7 @@ import forestry.core.network.DataOutputStreamForestry;
import forestry.core.network.IStreamableGui;
import forestry.core.proxy.Proxies;
import forestry.core.tiles.ITitled;
import forestry.core.utils.ItemStackUtil;
import forestry.greenhouse.blocks.BlockGreenhouse;
import forestry.greenhouse.blocks.BlockGreenhouseType;
import forestry.greenhouse.gui.ContainerGreenhouse;
@@ -93,15 +94,17 @@ public abstract class TileGreenhouse extends MultiblockTileEntityForestry<Multib
@Override
public void setCamouflageBlock(EnumCamouflageType type, ItemStack camouflageBlock) {
this.camouflageBlock = camouflageBlock;
if (worldObj != null) {
if (worldObj.isRemote) {
worldObj.markBlockRangeForRenderUpdate(getPos(), getPos());
Proxies.net.sendToServer(new PacketCamouflageUpdate(this, type));
if(!ItemStackUtil.isIdenticalItem(camouflageBlock, this.camouflageBlock)){
this.camouflageBlock = camouflageBlock;
if (worldObj != null) {
if (worldObj.isRemote) {
worldObj.markBlockRangeForRenderUpdate(getPos(), getPos());
Proxies.net.sendToServer(new PacketCamouflageUpdate(this, type));
}
}
MinecraftForge.EVENT_BUS.post(new CamouflageChangeEvent(getMultiblockLogic().getController().createState(), this, this, type));
}
MinecraftForge.EVENT_BUS.post(new CamouflageChangeEvent(getMultiblockLogic().getController().createState(), this, this, type));
}
@Override
@@ -42,7 +42,7 @@ public class TileGreenhouseControl extends TileGreenhouse implements IGreenhouse
@Override
public <G extends IGreenhouseController & IGreenhouseHousing> boolean canWork(G greenhouse, boolean canWork) {
return canWork && hasRedstoneSignal();
return canWork && !hasRedstoneSignal();
}
private boolean hasRedstoneSignal() {
@@ -47,6 +47,7 @@ import forestry.core.config.Config;
import forestry.core.gui.IHintSource;
import forestry.core.proxy.Proxies;
import forestry.core.tiles.TileUtil;
import forestry.core.utils.ItemStackUtil;
import forestry.core.utils.PlayerUtil;
import forestry.greenhouse.blocks.BlockGreenhouse;
import forestry.greenhouse.blocks.BlockGreenhouseType;
@@ -140,15 +141,17 @@ public class TileGreenhouseHatch extends MultiblockTileEntityBase<MultiblockLogi
/* CONSTRUCTION MATERIAL */
@Override
public void setCamouflageBlock(EnumCamouflageType type, ItemStack camouflageBlock) {
this.camouflageBlock = camouflageBlock;
if (worldObj != null) {
if (worldObj.isRemote) {
worldObj.markBlockRangeForRenderUpdate(getPos(), getPos());
Proxies.net.sendToServer(new PacketCamouflageUpdate(this, type));
if(!ItemStackUtil.isIdenticalItem(camouflageBlock, this.camouflageBlock)){
this.camouflageBlock = camouflageBlock;
if (worldObj != null) {
if (worldObj.isRemote) {
worldObj.markBlockRangeForRenderUpdate(getPos(), getPos());
Proxies.net.sendToServer(new PacketCamouflageUpdate(this, type));
}
}
MinecraftForge.EVENT_BUS.post(new CamouflageChangeEvent(getMultiblockLogic().getController().createState(), this, this, type));
}
MinecraftForge.EVENT_BUS.post(new CamouflageChangeEvent(getMultiblockLogic().getController().createState(), this, this, type));
}
@Override