diff --git a/build.gradle b/build.gradle index dfd4413d..cc042630 100755 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ apply plugin: 'forge' // adds the forge dependency apply plugin: 'maven' // for uploading to a maven repo apply plugin: 'checkstyle' -version = "7.1.8" +version = "7.1.9" group= "com.mod-buildcraft" archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension] diff --git a/buildcraft_resources/changelog/7.1.9 b/buildcraft_resources/changelog/7.1.9 index 4fecef58..e6ee5fbf 100644 --- a/buildcraft_resources/changelog/7.1.9 +++ b/buildcraft_resources/changelog/7.1.9 @@ -10,4 +10,5 @@ Bugs fixed: * Builder anti-hack system bug (asie) * Fluids in builder GUI not rendering correctly (for real this time!) (asie) * Hollow facades using wrongly calculated ambient occlusion (asie) +* Leaves and saplings having issues when built (asie) * Random crashes with integrated server tile entity lookup (asie) diff --git a/buildcraft_resources/versions.txt b/buildcraft_resources/versions.txt index f6bec104..7c6688a1 100755 --- a/buildcraft_resources/versions.txt +++ b/buildcraft_resources/versions.txt @@ -1,3 +1,3 @@ 1.6.4:BuildCraft:4.2.2 1.7.2:BuildCraft:6.0.16 -1.7.10:BuildCraft:7.1.8 +1.7.10:BuildCraft:7.1.9 diff --git a/common/buildcraft/BuildCraftBuilders.java b/common/buildcraft/BuildCraftBuilders.java index 9568b74d..b6950e37 100644 --- a/common/buildcraft/BuildCraftBuilders.java +++ b/common/buildcraft/BuildCraftBuilders.java @@ -109,7 +109,7 @@ import buildcraft.builders.schematics.SchematicGlassPane; import buildcraft.builders.schematics.SchematicGravel; import buildcraft.builders.schematics.SchematicHanging; import buildcraft.builders.schematics.SchematicJukebox; -import buildcraft.builders.schematics.SchematicLeaves; +import buildcraft.builders.schematics.SchematicMetadataMask; import buildcraft.builders.schematics.SchematicMinecart; import buildcraft.builders.schematics.SchematicPiston; import buildcraft.builders.schematics.SchematicPortal; @@ -405,8 +405,9 @@ public class BuildCraftBuilders extends BuildCraftMod { schemes.registerSchematicBlock(Blocks.lit_redstone_ore, SchematicStone.class); schemes.registerSchematicBlock(Blocks.emerald_ore, SchematicStone.class); - schemes.registerSchematicBlock(Blocks.leaves, SchematicLeaves.class); - schemes.registerSchematicBlock(Blocks.leaves2, SchematicLeaves.class); + schemes.registerSchematicBlock(Blocks.leaves, SchematicMetadataMask.class, 3); + schemes.registerSchematicBlock(Blocks.leaves2, SchematicMetadataMask.class, 3); + schemes.registerSchematicBlock(Blocks.sapling, SchematicMetadataMask.class, 7); schemes.registerSchematicBlock(Blocks.monster_egg, SchematicSilverfish.class); diff --git a/common/buildcraft/BuildCraftCore.java b/common/buildcraft/BuildCraftCore.java index a5087531..d456fec4 100644 --- a/common/buildcraft/BuildCraftCore.java +++ b/common/buildcraft/BuildCraftCore.java @@ -92,9 +92,9 @@ import buildcraft.core.TickHandlerCore; import buildcraft.core.TileEngineWood; import buildcraft.core.TilePathMarker; import buildcraft.core.Version; +import buildcraft.core.blueprints.BuildingSlotMapIterator; import buildcraft.core.blueprints.SchematicHelper; import buildcraft.core.blueprints.SchematicRegistry; -import buildcraft.core.blueprints.BuildingSlotMapIterator; import buildcraft.core.builders.patterns.FillerPattern; import buildcraft.core.builders.patterns.FillerRegistry; import buildcraft.core.builders.patterns.PatternBox; diff --git a/common/buildcraft/builders/TileBuilder.java b/common/buildcraft/builders/TileBuilder.java index 36c1d6cd..6aae1e6a 100644 --- a/common/buildcraft/builders/TileBuilder.java +++ b/common/buildcraft/builders/TileBuilder.java @@ -664,8 +664,11 @@ public class TileBuilder extends TileAbstractBuilder implements IHasWork, IFluid } } - private Packet getItemRequirementsPacket(final List items) { - if (items != null) { + private Packet getItemRequirementsPacket(List itemsIn) { + if (itemsIn != null) { + final List items = new ArrayList(); + items.addAll(itemsIn); + return new PacketCommand(this, "setItemRequirements", new CommandWriter() { public void write(ByteBuf data) { data.writeMedium(items.size()); diff --git a/common/buildcraft/builders/gui/GuiBuilder.java b/common/buildcraft/builders/gui/GuiBuilder.java index 9e6843b1..16dc06cd 100644 --- a/common/buildcraft/builders/gui/GuiBuilder.java +++ b/common/buildcraft/builders/gui/GuiBuilder.java @@ -16,7 +16,6 @@ import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.inventory.IInventory; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; @@ -30,7 +29,6 @@ import buildcraft.core.lib.gui.AdvancedSlot; import buildcraft.core.lib.gui.GuiAdvancedInterface; import buildcraft.core.lib.network.command.CommandWriter; import buildcraft.core.lib.network.command.PacketCommand; -import buildcraft.core.lib.render.FluidRenderer; import buildcraft.core.lib.utils.StringUtils; public class GuiBuilder extends GuiAdvancedInterface { diff --git a/common/buildcraft/builders/schematics/SchematicLeaves.java b/common/buildcraft/builders/schematics/SchematicLeaves.java deleted file mode 100755 index 2c414832..00000000 --- a/common/buildcraft/builders/schematics/SchematicLeaves.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team - * http://www.mod-buildcraft.com - *

- * BuildCraft is distributed under the terms of the Minecraft Mod Public - * License 1.0, or MMPL. Please check the contents of the license located in - * http://www.mod-buildcraft.com/MMPL-1.0.txt - */ -package buildcraft.builders.schematics; - -import java.util.LinkedList; - -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; - -import buildcraft.api.blueprints.IBuilderContext; -import buildcraft.api.blueprints.SchematicBlock; - -public class SchematicLeaves extends SchematicBlock { - @Override - public boolean isAlreadyBuilt(IBuilderContext context, int x, int y, int z) { - return block == context.world().getBlock(x, y, z) && (meta & 3) == (context.world().getBlockMetadata(x, y, z) & 3); - } -} diff --git a/common/buildcraft/builders/schematics/SchematicMetadataMask.java b/common/buildcraft/builders/schematics/SchematicMetadataMask.java new file mode 100755 index 00000000..eab6099b --- /dev/null +++ b/common/buildcraft/builders/schematics/SchematicMetadataMask.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team + * http://www.mod-buildcraft.com + *

+ * BuildCraft is distributed under the terms of the Minecraft Mod Public + * License 1.0, or MMPL. Please check the contents of the license located in + * http://www.mod-buildcraft.com/MMPL-1.0.txt + */ +package buildcraft.builders.schematics; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import buildcraft.api.blueprints.IBuilderContext; +import buildcraft.api.blueprints.MappingRegistry; +import buildcraft.api.blueprints.SchematicBlock; + +public class SchematicMetadataMask extends SchematicBlock { + private final int mask; + + public SchematicMetadataMask(int mask) { + this.mask = mask; + } + + @Override + public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) { + super.initializeFromObjectAt(context, x, y, z); + meta &= mask; + } + + @Override + public void readSchematicFromNBT(NBTTagCompound nbt, MappingRegistry registry) { + super.readSchematicFromNBT(nbt, registry); + meta &= mask; + } + + @Override + public void storeRequirements(IBuilderContext context, int x, int y, int z) { + if (block != null) { + storedRequirements = new ItemStack[1]; + storedRequirements[0] = new ItemStack(block, 1, meta & mask); + } + } + + @Override + public boolean isAlreadyBuilt(IBuilderContext context, int x, int y, int z) { + return block == context.world().getBlock(x, y, z) && (meta & mask) == (context.world().getBlockMetadata(x, y, z) & mask); + } +} diff --git a/common/buildcraft/core/blueprints/BuildingSlotMapIterator.java b/common/buildcraft/core/blueprints/BuildingSlotMapIterator.java index 9ca1d2d8..f70820d1 100755 --- a/common/buildcraft/core/blueprints/BuildingSlotMapIterator.java +++ b/common/buildcraft/core/blueprints/BuildingSlotMapIterator.java @@ -18,7 +18,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.WorldSettings; import buildcraft.core.builders.BuilderItemMetaPair; -import buildcraft.core.builders.BuildingSlot; import buildcraft.core.builders.BuildingSlotBlock; import buildcraft.core.builders.TileAbstractBuilder; import buildcraft.core.lib.fluids.Tank; diff --git a/common/buildcraft/core/builders/BuildingSlotBlock.java b/common/buildcraft/core/builders/BuildingSlotBlock.java index 4fdb9a17..5741eaab 100755 --- a/common/buildcraft/core/builders/BuildingSlotBlock.java +++ b/common/buildcraft/core/builders/BuildingSlotBlock.java @@ -26,7 +26,6 @@ import buildcraft.api.blueprints.BuildingPermission; import buildcraft.api.blueprints.IBuilderContext; import buildcraft.api.blueprints.MappingNotFoundException; import buildcraft.api.blueprints.MappingRegistry; -import buildcraft.api.blueprints.Schematic; import buildcraft.api.blueprints.SchematicBlock; import buildcraft.api.blueprints.SchematicBlockBase; import buildcraft.api.blueprints.SchematicFactory; diff --git a/common/buildcraft/core/lib/render/FluidRenderer.java b/common/buildcraft/core/lib/render/FluidRenderer.java index f4bbde39..cf2469e0 100644 --- a/common/buildcraft/core/lib/render/FluidRenderer.java +++ b/common/buildcraft/core/lib/render/FluidRenderer.java @@ -18,7 +18,6 @@ import net.minecraft.client.renderer.GLAllocation; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.init.Blocks; import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fluids.Fluid; diff --git a/common/buildcraft/energy/gui/GuiCombustionEngine.java b/common/buildcraft/energy/gui/GuiCombustionEngine.java index b3a087d1..9af71335 100644 --- a/common/buildcraft/energy/gui/GuiCombustionEngine.java +++ b/common/buildcraft/energy/gui/GuiCombustionEngine.java @@ -12,14 +12,10 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import buildcraft.BuildCraftCore; -import buildcraft.core.lib.fluids.Tank; import buildcraft.core.lib.utils.StringUtils; import buildcraft.energy.TileEngineIron;