fixed cactus handling in blueprint, fix #1597

This commit is contained in:
SpaceToad 2014-04-18 19:51:07 +02:00
parent f4d1107066
commit b8ec7635da
2 changed files with 37 additions and 2 deletions

View file

@ -66,6 +66,7 @@ import buildcraft.builders.filler.pattern.PatternHorizon;
import buildcraft.builders.filler.pattern.PatternPyramid;
import buildcraft.builders.filler.pattern.PatternStairs;
import buildcraft.builders.schematics.SchematicBed;
import buildcraft.builders.schematics.SchematicCactus;
import buildcraft.builders.schematics.SchematicCustomStack;
import buildcraft.builders.schematics.SchematicDirt;
import buildcraft.builders.schematics.SchematicDoor;
@ -171,6 +172,8 @@ public class BuildCraftBuilders extends BuildCraftMod {
SchematicRegistry.registerSchematicBlock(Blocks.dirt, SchematicDirt.class);
SchematicRegistry.registerSchematicBlock(Blocks.grass, SchematicDirt.class);
SchematicRegistry.registerSchematicBlock(Blocks.cactus, SchematicCactus.class);
SchematicRegistry.registerSchematicBlock(Blocks.farmland, SchematicFarmland.class);
SchematicRegistry.registerSchematicBlock(Blocks.wheat, SchematicSeeds.class, Items.wheat_seeds);
SchematicRegistry.registerSchematicBlock(Blocks.pumpkin_stem, SchematicSeeds.class, Items.pumpkin_seeds);
@ -229,8 +232,6 @@ public class BuildCraftBuilders extends BuildCraftMod {
SchematicRegistry.registerSchematicBlock(Blocks.lava, SchematicFluid.class, new ItemStack(Items.lava_bucket));
SchematicRegistry.registerSchematicBlock(Blocks.flowing_lava, SchematicFluid.class, new ItemStack(Items.lava_bucket));
SchematicRegistry.registerSchematicBlock(Blocks.rail, SchematicIgnoreMeta.class);
SchematicRegistry.registerSchematicBlock(Blocks.detector_rail, SchematicIgnoreMeta.class);
SchematicRegistry.registerSchematicBlock(Blocks.glass_pane, SchematicIgnoreMeta.class);
SchematicRegistry.registerSchematicBlock(Blocks.piston, SchematicPiston.class);

View file

@ -0,0 +1,34 @@
/**
* Copyright (c) 2011-2014, 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 SchematicCactus extends SchematicBlock {
@Override
public void addRequirements(IBuilderContext context, LinkedList<ItemStack> requirements) {
requirements.add(new ItemStack(Blocks.cactus));
}
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList <ItemStack> stacks) {
context.world().setBlock(x, y, z, Blocks.cactus, 0, 3);
}
@Override
public boolean isAlreadyBuilt(IBuilderContext context, int x, int y, int z) {
return context.world().getBlock(x, y, z) == Blocks.cactus;
}
}