diff --git a/dependencies.gradle b/dependencies.gradle index bd3d5512..d56cf932 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -7,7 +7,7 @@ dependencies { compileOnly("org.projectlombok:lombok:1.18.24") annotationProcessor("org.projectlombok:lombok:1.18.24") - shadeCompile("com.github.GTNewHorizons:CTMLib:1.4.4:dev") + shadowImplementation("com.github.GTNewHorizons:CTMLib:1.4.4:dev") compileOnly("com.github.GTNewHorizons:waila:1.5.19:dev") { transitive = false diff --git a/gradle.properties b/gradle.properties index 3bb5c436..f1602784 100644 --- a/gradle.properties +++ b/gradle.properties @@ -57,7 +57,7 @@ containsMixinsAndOrCoreModOnly = false # If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your # responsibility check the licence and request permission for distribution, if required. -usesShadowedDependencies = false +usesShadowedDependencies = true # Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older # projects. New projects should not use this parameter. diff --git a/src/main/java/com/cricketcraft/chisel/api/ChiselAPIProps.java b/src/main/java/com/cricketcraft/chisel/api/ChiselAPIProps.java index ec0c8524..7af4b31e 100644 --- a/src/main/java/com/cricketcraft/chisel/api/ChiselAPIProps.java +++ b/src/main/java/com/cricketcraft/chisel/api/ChiselAPIProps.java @@ -2,6 +2,6 @@ package com.cricketcraft.chisel.api; public class ChiselAPIProps { - public static final String VERSION = "0.1.1"; - public static String MOD_ID = null; // Set by Chisel + public static final String VERSION = "0.1.1"; + public static String MOD_ID = null; // Set by Chisel } diff --git a/src/main/java/com/cricketcraft/chisel/api/ChiselTabs.java b/src/main/java/com/cricketcraft/chisel/api/ChiselTabs.java index 03def63d..0cec8078 100644 --- a/src/main/java/com/cricketcraft/chisel/api/ChiselTabs.java +++ b/src/main/java/com/cricketcraft/chisel/api/ChiselTabs.java @@ -3,64 +3,63 @@ package com.cricketcraft.chisel.api; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ChiselTabs { - public static class CustomCreativeTab extends CreativeTabs { + public static class CustomCreativeTab extends CreativeTabs { - private boolean search; + private boolean search; - private ItemStack stack; + private ItemStack stack; - public CustomCreativeTab(String label, boolean searchbar) { - super(label); - this.search = searchbar; - } + public CustomCreativeTab(String label, boolean searchbar) { + super(label); + this.search = searchbar; + } - @Override - public Item getTabIconItem() { - return stack.getItem(); - } + @Override + public Item getTabIconItem() { + return stack.getItem(); + } - public void setTabIconItemStack(ItemStack stack) { - this.stack = stack; - } + public void setTabIconItemStack(ItemStack stack) { + this.stack = stack; + } - @Override - public ItemStack getIconItemStack() { - return stack; - } + @Override + public ItemStack getIconItemStack() { + return stack; + } - @Override - @SideOnly(Side.CLIENT) - public String getBackgroundImageName() { + @Override + @SideOnly(Side.CLIENT) + public String getBackgroundImageName() { - return search ? "item_search.png" : super.getBackgroundImageName(); - } + return search ? "item_search.png" : super.getBackgroundImageName(); + } - @Override - public int getSearchbarWidth() { + @Override + public int getSearchbarWidth() { - return 89; - } + return 89; + } - @Override - public boolean hasSearchBar() { + @Override + public boolean hasSearchBar() { - return search; - } - } - - - public static final CustomCreativeTab tabChisel = new CustomCreativeTab("tabChisel", false); - public static final CustomCreativeTab tabStoneChiselBlocks = new CustomCreativeTab("tabStoneChiselBlocks", true); - public static final CustomCreativeTab tabWoodChiselBlocks = new CustomCreativeTab("tabWoodChiselBlocks", true); - public static final CustomCreativeTab tabMetalChiselBlocks = new CustomCreativeTab("tabMetalChiselBlocks", true); - public static final CustomCreativeTab tabOtherChiselBlocks = new CustomCreativeTab("tabOtherChiselBlocks", true); - public static final CustomCreativeTab tabModdedChiselBlocks = new CustomCreativeTab("tabModdedChiselBlocks", true); - public static final CustomCreativeTab tabStairChiselBlocks = new CustomCreativeTab("tabStairChiselBlocks", true); + return search; + } + } + public static final CustomCreativeTab tabChisel = new CustomCreativeTab("tabChisel", false); + public static final CustomCreativeTab tabStoneChiselBlocks = new CustomCreativeTab("tabStoneChiselBlocks", true); + public static final CustomCreativeTab tabWoodChiselBlocks = new CustomCreativeTab("tabWoodChiselBlocks", true); + public static final CustomCreativeTab tabMetalChiselBlocks = new CustomCreativeTab("tabMetalChiselBlocks", true); + public static final CustomCreativeTab tabOtherChiselBlocks = new CustomCreativeTab("tabOtherChiselBlocks", true); + public static final CustomCreativeTab tabModdedChiselBlocks = new CustomCreativeTab("tabModdedChiselBlocks", true); + public static final CustomCreativeTab tabStairChiselBlocks = new CustomCreativeTab("tabStairChiselBlocks", true); } diff --git a/src/main/java/com/cricketcraft/chisel/api/FMPIMC.java b/src/main/java/com/cricketcraft/chisel/api/FMPIMC.java index 03f99c2c..ee68b93d 100644 --- a/src/main/java/com/cricketcraft/chisel/api/FMPIMC.java +++ b/src/main/java/com/cricketcraft/chisel/api/FMPIMC.java @@ -2,21 +2,22 @@ package com.cricketcraft.chisel.api; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.event.FMLInterModComms; public class FMPIMC { - public static void registerFMP(Block block) { - registerFMP(block, 0, 15); - } + public static void registerFMP(Block block) { + registerFMP(block, 0, 15); + } - public static void registerFMP(Block block, int minMeta, int maxMeta) { - for (int c = minMeta; c <= maxMeta; c++) { - registerFMP(block, c); - } - } + public static void registerFMP(Block block, int minMeta, int maxMeta) { + for (int c = minMeta; c <= maxMeta; c++) { + registerFMP(block, c); + } + } - public static void registerFMP(Block block, int meta) { - FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(block, 1, meta)); - } + public static void registerFMP(Block block, int meta) { + FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(block, 1, meta)); + } } diff --git a/src/main/java/com/cricketcraft/chisel/api/IAdvancedChisel.java b/src/main/java/com/cricketcraft/chisel/api/IAdvancedChisel.java index c6832c0a..9f27dce9 100644 --- a/src/main/java/com/cricketcraft/chisel/api/IAdvancedChisel.java +++ b/src/main/java/com/cricketcraft/chisel/api/IAdvancedChisel.java @@ -9,25 +9,21 @@ import com.cricketcraft.chisel.api.carving.IChiselMode; */ public interface IAdvancedChisel { - /** - * Gets the next mode the button in the GUI should switch to given the current mode. - * - * @param stack - * The {@link ItemStack} representing the chisel - * @param current - * The {@link IChiselMode} that is currently active - * @return The next {@link IChiselMode} in the loop - */ - public IChiselMode getNextMode(ItemStack stack, IChiselMode current); + /** + * Gets the next mode the button in the GUI should switch to given the current mode. + * + * @param stack The {@link ItemStack} representing the chisel + * @param current The {@link IChiselMode} that is currently active + * @return The next {@link IChiselMode} in the loop + */ + public IChiselMode getNextMode(ItemStack stack, IChiselMode current); - /** - * Gets an {@link IChiselMode} instance from a String name - * - * @param chisel - * The {@link ItemStack} representing the chisel - * @param name - * The name of the {@link IChiselMode mode} - * @return An {@link IChiselMode} that has the name {@code name} - */ - public IChiselMode getMode(ItemStack chisel, String name); + /** + * Gets an {@link IChiselMode} instance from a String name + * + * @param chisel The {@link ItemStack} representing the chisel + * @param name The name of the {@link IChiselMode mode} + * @return An {@link IChiselMode} that has the name {@code name} + */ + public IChiselMode getMode(ItemStack chisel, String name); } diff --git a/src/main/java/com/cricketcraft/chisel/api/ICarvable.java b/src/main/java/com/cricketcraft/chisel/api/ICarvable.java index 2e098431..05651daa 100644 --- a/src/main/java/com/cricketcraft/chisel/api/ICarvable.java +++ b/src/main/java/com/cricketcraft/chisel/api/ICarvable.java @@ -1,44 +1,42 @@ package com.cricketcraft.chisel.api; +import net.minecraft.world.IBlockAccess; + import team.chisel.ctmlib.ICTMBlock; import team.chisel.ctmlib.ISubmapManager; -import net.minecraft.world.IBlockAccess; import com.cricketcraft.chisel.api.carving.CarvableHelper; import com.cricketcraft.chisel.api.carving.IVariationInfo; /** - * To be implemented on blocks that can be chiseled and need advanced metadata to variation mapping. Currently not very usable without internal classes. + * To be implemented on blocks that can be chiseled and need advanced metadata to variation mapping. Currently not very + * usable without internal classes. */ public interface ICarvable extends ICTMBlock { - /** - * Gets a {@link ISubmapManager} from this block, based on metadata. - *

- * Typically you can refer this method to {@link CarvableHelper#getVariation(int)} but this method is provided for more complex metadata handling. - * - * @param metadata - * The metadata of the block - * @param world - * {@link IBlockAccess} object, usually a world. Use of {@link IBlockAccess} Is necessary due to this method's use in rendering. - * @param x - * X coord of the block - * @param y - * Y coord of the block - * @param z - * Z coord of the block - * @param metadata - * The metadata of the block - * @return The {@link ISubmapManager} that represents this block in the world. - */ - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata); + /** + * Gets a {@link ISubmapManager} from this block, based on metadata. + *

+ * Typically you can refer this method to {@link CarvableHelper#getVariation(int)} but this method is provided for + * more complex metadata handling. + * + * @param metadata The metadata of the block + * @param world {@link IBlockAccess} object, usually a world. Use of {@link IBlockAccess} Is necessary due to + * this method's use in rendering. + * @param x X coord of the block + * @param y Y coord of the block + * @param z Z coord of the block + * @param metadata The metadata of the block + * @return The {@link ISubmapManager} that represents this block in the world. + */ + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata); - /** - * Gets the {@link ISubmapManager} for this block when it is in item form. - * - * @return A {@link ISubmapManager} - */ - @Override - public IVariationInfo getManager(int meta); + /** + * Gets the {@link ISubmapManager} for this block when it is in item form. + * + * @return A {@link ISubmapManager} + */ + @Override + public IVariationInfo getManager(int meta); } diff --git a/src/main/java/com/cricketcraft/chisel/api/IChiselItem.java b/src/main/java/com/cricketcraft/chisel/api/IChiselItem.java index 43812d82..fa91a412 100644 --- a/src/main/java/com/cricketcraft/chisel/api/IChiselItem.java +++ b/src/main/java/com/cricketcraft/chisel/api/IChiselItem.java @@ -12,74 +12,60 @@ import com.cricketcraft.chisel.api.carving.ICarvingVariation; */ public interface IChiselItem { - /** - * Checks whether the chisel can have its GUI opened - * - * @param world - * {@link World} object - * @param player - * The player holding the chisel. It can always be assumed that the player's current item will be this. - * @param chisel - * The {@link ItemStack} representing your chisel - * @return True if the GUI should open. False otherwise. - */ - boolean canOpenGui(World world, EntityPlayer player, ItemStack chisel); + /** + * Checks whether the chisel can have its GUI opened + * + * @param world {@link World} object + * @param player The player holding the chisel. It can always be assumed that the player's current item will be + * this. + * @param chisel The {@link ItemStack} representing your chisel + * @return True if the GUI should open. False otherwise. + */ + boolean canOpenGui(World world, EntityPlayer player, ItemStack chisel); - /** - * Called when an item is chiseled using this chisel - * - * @param world - * {@link World} object - * @param chisel - * The {@link ItemStack} representing the chisel - * @param target - * The {@link ICarvingVariation} representing the target item - * @return True if the chisel should be damaged. False otherwise. - */ - boolean onChisel(World world, ItemStack chisel, ICarvingVariation target); + /** + * Called when an item is chiseled using this chisel + * + * @param world {@link World} object + * @param chisel The {@link ItemStack} representing the chisel + * @param target The {@link ICarvingVariation} representing the target item + * @return True if the chisel should be damaged. False otherwise. + */ + boolean onChisel(World world, ItemStack chisel, ICarvingVariation target); - /** - * Called to check if this {@link ItemStack} can be chiseled in this chisel. If not, there will be no possible variants displayed in the GUI. - *

- * It is not necessary to take into account whether this item has any variants, this method will only be called after that check. - * - * @param world - * {@link World} object - * @param chisel - * The {@link ItemStack} representing the chisel - * @param target - * The {@link ICarvingVariation} representing the target item - * @return True if the current target can be chiseled into anything. False otherwise. - */ - boolean canChisel(World world, ItemStack chisel, ICarvingVariation target); + /** + * Called to check if this {@link ItemStack} can be chiseled in this chisel. If not, there will be no possible + * variants displayed in the GUI. + *

+ * It is not necessary to take into account whether this item has any variants, this method will only be + * called after that check. + * + * @param world {@link World} object + * @param chisel The {@link ItemStack} representing the chisel + * @param target The {@link ICarvingVariation} representing the target item + * @return True if the current target can be chiseled into anything. False otherwise. + */ + boolean canChisel(World world, ItemStack chisel, ICarvingVariation target); - /** - * Allows you to control if your item can chisel this block in the world. - * - * @param world - * World object - * @param player - * {@link EntityPlayer The player} holding the chisel. - * @param x - * X coord of the block being chiseled - * @param y - * Y coord of the block being chiseled - * @param z - * Z coord of the block being chiseled - * @param block - * The {@link Block} being chiseled - * @param metadata - * The blocks' metadata - * @return True if the chiseling should take place. False otherwise. - */ - boolean canChiselBlock(World world, EntityPlayer player, int x, int y, int z, Block block, int metadata); + /** + * Allows you to control if your item can chisel this block in the world. + * + * @param world World object + * @param player {@link EntityPlayer The player} holding the chisel. + * @param x X coord of the block being chiseled + * @param y Y coord of the block being chiseled + * @param z Z coord of the block being chiseled + * @param block The {@link Block} being chiseled + * @param metadata The blocks' metadata + * @return True if the chiseling should take place. False otherwise. + */ + boolean canChiselBlock(World world, EntityPlayer player, int x, int y, int z, Block block, int metadata); - /** - * Allows you to control if your item has chiseling modes. - * - * @param chisel - * The {@link ItemStack} representing the chisel. - * @return True if the chisel supports modes. False otherwise. - */ - boolean hasModes(ItemStack chisel); + /** + * Allows you to control if your item has chiseling modes. + * + * @param chisel The {@link ItemStack} representing the chisel. + * @return True if the chisel supports modes. False otherwise. + */ + boolean hasModes(ItemStack chisel); } diff --git a/src/main/java/com/cricketcraft/chisel/api/IConnectable.java b/src/main/java/com/cricketcraft/chisel/api/IConnectable.java index 583ada35..c0c97874 100644 --- a/src/main/java/com/cricketcraft/chisel/api/IConnectable.java +++ b/src/main/java/com/cricketcraft/chisel/api/IConnectable.java @@ -7,20 +7,16 @@ import net.minecraft.world.IBlockAccess; */ public interface IConnectable { - /** - * Determines whether other CTM blocks can connect to this one. - * - * @param world - * @param x - * The X position of the block that is connecting to this one. NOT the position of your block. - * @param y - * The Y position of the block that is connecting to this one. NOT the position of your block. - * @param z - * The Z position of the block that is connecting to this one. NOT the position of your block. - * @param side - * The side being drawn. - * @return True if a block can connect to this one from the given direction. False otherwise. - */ - boolean canConnectCTM(IBlockAccess world, int x, int y, int z, int side); + /** + * Determines whether other CTM blocks can connect to this one. + * + * @param world + * @param x The X position of the block that is connecting to this one. NOT the position of your block. + * @param y The Y position of the block that is connecting to this one. NOT the position of your block. + * @param z The Z position of the block that is connecting to this one. NOT the position of your block. + * @param side The side being drawn. + * @return True if a block can connect to this one from the given direction. False otherwise. + */ + boolean canConnectCTM(IBlockAccess world, int x, int y, int z, int side); } diff --git a/src/main/java/com/cricketcraft/chisel/api/IFacade.java b/src/main/java/com/cricketcraft/chisel/api/IFacade.java index 3a4af772..2def154f 100644 --- a/src/main/java/com/cricketcraft/chisel/api/IFacade.java +++ b/src/main/java/com/cricketcraft/chisel/api/IFacade.java @@ -9,41 +9,31 @@ import net.minecraft.world.World; */ public interface IFacade { - /** - * Gets the block this facade is acting as. - * - * @param world - * {@link World} - * @param x - * X coord of your block - * @param y - * Y coord of your block - * @param z - * Z coord of your block - * @param side - * The side being rendered, NOT the side being connected from. - *

- * This value can be -1 if no side is specified. Please handle this appropriately. - * @return The block inside of your facade block. - */ - Block getFacade(IBlockAccess world, int x, int y, int z, int side); + /** + * Gets the block this facade is acting as. + * + * @param world {@link World} + * @param x X coord of your block + * @param y Y coord of your block + * @param z Z coord of your block + * @param side The side being rendered, NOT the side being connected from. + *

+ * This value can be -1 if no side is specified. Please handle this appropriately. + * @return The block inside of your facade block. + */ + Block getFacade(IBlockAccess world, int x, int y, int z, int side); - /** - * Gets the metadata of the block that this facade is acting as. - * - * @param world - * {@link World} - * @param x - * X coord of your block - * @param y - * Y coord of your block - * @param z - * Z coord of your block - * @param side - * The side being rendered, NOT the side being connected from. - *

- * This value can be -1 if no side is specified. Please handle this appropriately. - * @return The metadata of your facade block. - */ - int getFacadeMetadata(IBlockAccess world, int x, int y, int z, int side); -} \ No newline at end of file + /** + * Gets the metadata of the block that this facade is acting as. + * + * @param world {@link World} + * @param x X coord of your block + * @param y Y coord of your block + * @param z Z coord of your block + * @param side The side being rendered, NOT the side being connected from. + *

+ * This value can be -1 if no side is specified. Please handle this appropriately. + * @return The metadata of your facade block. + */ + int getFacadeMetadata(IBlockAccess world, int x, int y, int z, int side); +} diff --git a/src/main/java/com/cricketcraft/chisel/api/IMC.java b/src/main/java/com/cricketcraft/chisel/api/IMC.java index 17cf57fe..00d0d958 100644 --- a/src/main/java/com/cricketcraft/chisel/api/IMC.java +++ b/src/main/java/com/cricketcraft/chisel/api/IMC.java @@ -1,64 +1,69 @@ package com.cricketcraft.chisel.api; /** - * Use the enum constants (using {@link #key} or calling {@link #toString()}) in this class as keys for IMC messages sent to chisel + * Use the enum constants (using {@link #key} or calling {@link #toString()}) in this class as keys for IMC messages + * sent to chisel *

* It is also acceptable to copy the Strings in this class to avoid referencing this API. */ public enum IMC { - /** - * Adds a variation to a group. - * - * Use this to add a variation to a group. String syntax: - *

- * groupname|blockname|meta - *

- * An example would be {@code "mygroup|minecraft:dirt|1"} and this will add the vanilla dirt block with metadata 1 to the "mygroup" group, creating that group if need be. - */ - ADD_VARIATION("variation:add"), + /** + * Adds a variation to a group. + * + * Use this to add a variation to a group. String syntax: + *

+ * groupname|blockname|meta + *

+ * An example would be {@code "mygroup|minecraft:dirt|1"} and this will add the vanilla dirt block with metadata 1 + * to the "mygroup" group, creating that group if need be. + */ + ADD_VARIATION("variation:add"), - /** - * Removes a variation from a group. - * - * Use this to remove a variation from a group. String syntax: - *

- * groupname|blockname|meta - *

- * An example would be {@code "mygroup|minecraft:dirt|1"} and this will add the vanilla dirt block with metadata 1 to the "mygroup" group, creating that group if need be. - */ - REMOVE_VARIATION("variation:remove"), + /** + * Removes a variation from a group. + * + * Use this to remove a variation from a group. String syntax: + *

+ * groupname|blockname|meta + *

+ * An example would be {@code "mygroup|minecraft:dirt|1"} and this will add the vanilla dirt block with metadata 1 + * to the "mygroup" group, creating that group if need be. + */ + REMOVE_VARIATION("variation:remove"), - /** - * Registers an oredict name to a group. This can be used to automatically add all blocks with this oredict name to a group. String syntax: - *

- * groupname|oredictname - *

- * An example would be {@code "mygroup|plankWood"} which will add all blocks registered in the oredict as "plankWood" to your group called "mygroup". - */ - REGISTER_GROUP_ORE("group:ore"); + /** + * Registers an oredict name to a group. This can be used to automatically add all blocks with this oredict name to + * a group. String syntax: + *

+ * groupname|oredictname + *

+ * An example would be {@code "mygroup|plankWood"} which will add all blocks registered in the oredict as + * "plankWood" to your group called "mygroup". + */ + REGISTER_GROUP_ORE("group:ore"); - /** - * The IMC message key for this message type. - */ - public final String key; + /** + * The IMC message key for this message type. + */ + public final String key; - IMC(String key) { - this.key = key; - } + IMC(String key) { + this.key = key; + } - @Override - public String toString() { - return key; - } + @Override + public String toString() { + return key; + } - /** - * The modid of Chisel so you can easily send IMC to this mod. - */ - @Deprecated - public static final String CHISEL_MODID = "chisel"; + /** + * The modid of Chisel so you can easily send IMC to this mod. + */ + @Deprecated + public static final String CHISEL_MODID = "chisel"; - public static final String getModid() { - return ChiselAPIProps.MOD_ID; - } + public static final String getModid() { + return ChiselAPIProps.MOD_ID; + } } diff --git a/src/main/java/com/cricketcraft/chisel/api/Statistics.java b/src/main/java/com/cricketcraft/chisel/api/Statistics.java index 64e8c6b7..c17318ce 100644 --- a/src/main/java/com/cricketcraft/chisel/api/Statistics.java +++ b/src/main/java/com/cricketcraft/chisel/api/Statistics.java @@ -6,10 +6,12 @@ import net.minecraft.util.ChatComponentTranslation; public class Statistics { - public static StatBase blocksChiseled = (new StatBasic("stat.blockChiseled", new ChatComponentTranslation("stat.blockChiseled", new Object[0]))); + public static StatBase blocksChiseled = (new StatBasic( + "stat.blockChiseled", + new ChatComponentTranslation("stat.blockChiseled", new Object[0]))); - public static void init() { - blocksChiseled.initIndependentStat(); - blocksChiseled.registerStat(); - } + public static void init() { + blocksChiseled.initIndependentStat(); + blocksChiseled.registerStat(); + } } diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/CarvableHelper.java b/src/main/java/com/cricketcraft/chisel/api/carving/CarvableHelper.java index 1b70022d..8324da5c 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/CarvableHelper.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/CarvableHelper.java @@ -14,6 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.oredict.OreDictionary; + import team.chisel.ctmlib.ISubmapManager; import com.cricketcraft.chisel.api.ChiselAPIProps; @@ -27,197 +28,197 @@ import cpw.mods.fml.relauncher.SideOnly; public class CarvableHelper { - public static Class itemCarvableClass = null; + public static Class itemCarvableClass = null; - private Block theBlock; + private Block theBlock; - public ArrayList infoList = new ArrayList(); - IVariationInfo[] infoMap = new IVariationInfo[16]; - public boolean forbidChiseling = false; + public ArrayList infoList = new ArrayList(); + IVariationInfo[] infoMap = new IVariationInfo[16]; + public boolean forbidChiseling = false; - public CarvableHelper(Block block) { - this.theBlock = block; - } + public CarvableHelper(Block block) { + this.theBlock = block; + } - public void addVariation(String description, int metadata, ISubmapManager manager) { - addVariation(description, metadata, null, manager); - } + public void addVariation(String description, int metadata, ISubmapManager manager) { + addVariation(description, metadata, null, manager); + } - public void addVariation(String description, int metadata, Block bb) { - addVariation(description, metadata, null, bb, 0, ChiselAPIProps.MOD_ID); - } + public void addVariation(String description, int metadata, Block bb) { + addVariation(description, metadata, null, bb, 0, ChiselAPIProps.MOD_ID); + } - public void addVariation(String description, int metadata, Block bb, int blockMeta) { - addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID); - } + public void addVariation(String description, int metadata, Block bb, int blockMeta) { + addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID); + } - public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material) { - addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID); - } + public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material) { + addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID); + } - public void addVariation(String description, int metadata, String texture) { - addVariation(description, metadata, texture, (ISubmapManager) null); - } + public void addVariation(String description, int metadata, String texture) { + addVariation(description, metadata, texture, (ISubmapManager) null); + } - public void addVariation(String description, int metadata, String texture, ISubmapManager manager) { - addVariation(description, metadata, texture, null, 0, ChiselAPIProps.MOD_ID, manager, metadata); - } + public void addVariation(String description, int metadata, String texture, ISubmapManager manager) { + addVariation(description, metadata, texture, null, 0, ChiselAPIProps.MOD_ID, manager, metadata); + } - public void addVariation(String description, int metadata, Block bb, String modid) { - addVariation(description, metadata, null, bb, 0, modid); - } + public void addVariation(String description, int metadata, Block bb, String modid) { + addVariation(description, metadata, null, bb, 0, modid); + } - public void addVariation(String description, int metadata, Block bb, int blockMeta, String modid) { - addVariation(description, metadata, null, bb, blockMeta, modid); - } + public void addVariation(String description, int metadata, Block bb, int blockMeta, String modid) { + addVariation(description, metadata, null, bb, blockMeta, modid); + } - public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material, String modid) { - addVariation(description, metadata, null, bb, blockMeta, modid); - } + public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material, + String modid) { + addVariation(description, metadata, null, bb, blockMeta, modid); + } - public void addVariation(String description, int metadata, String texture, String modid) { - addVariation(description, metadata, texture, null, 0, modid); - } + public void addVariation(String description, int metadata, String texture, String modid) { + addVariation(description, metadata, texture, null, 0, modid); + } - public void addVariation(String description, int metadata, String texture, Block block, int blockMeta, String modid) { - addVariation(description, metadata, texture, block, blockMeta, modid, null, metadata); - } + public void addVariation(String description, int metadata, String texture, Block block, int blockMeta, + String modid) { + addVariation(description, metadata, texture, block, blockMeta, modid, null, metadata); + } - public void addVariation(String description, int metadata, String texture, int order) { - addVariation(description, metadata, texture, null, 0, ChiselAPIProps.MOD_ID, (ISubmapManager) null, order); - } + public void addVariation(String description, int metadata, String texture, int order) { + addVariation(description, metadata, texture, null, 0, ChiselAPIProps.MOD_ID, (ISubmapManager) null, order); + } - public void addVariation(String description, int metadata, String texture, Block block, int blockMeta, String modid, ISubmapManager customManager, int order) { + public void addVariation(String description, int metadata, String texture, Block block, int blockMeta, String modid, + ISubmapManager customManager, int order) { - if (infoList.size() >= 16) - return; + if (infoList.size() >= 16) return; - IVariationInfo info = FMLCommonHandler.instance().getSide().isClient() ? getClientInfo(modid, texture, description, metadata, block, blockMeta, customManager, order) : getServerInfo(modid, - texture, description, metadata, block, blockMeta, customManager, order); + IVariationInfo info = FMLCommonHandler.instance().getSide().isClient() + ? getClientInfo(modid, texture, description, metadata, block, blockMeta, customManager, order) + : getServerInfo(modid, texture, description, metadata, block, blockMeta, customManager, order); - infoList.add(info); - infoMap[metadata] = info; - } + infoList.add(info); + infoMap[metadata] = info; + } - private IVariationInfo getClientInfo(String modid, String texture, String description, int metadata, Block block, int blockMeta, ISubmapManager customManager, int order) { - ICarvingVariation var = CarvingUtils.getDefaultVariationFor(getBlock(), metadata, order); - TextureType type = TextureType.getTypeFor(this, modid, texture); - if (type == TextureType.CUSTOM && customManager == null && block == null) { - throw new IllegalArgumentException(String.format("Could not find texture %s, and no custom texture manager was provided.", texture)); - } + private IVariationInfo getClientInfo(String modid, String texture, String description, int metadata, Block block, + int blockMeta, ISubmapManager customManager, int order) { + ICarvingVariation var = CarvingUtils.getDefaultVariationFor(getBlock(), metadata, order); + TextureType type = TextureType.getTypeFor(this, modid, texture); + if (type == TextureType.CUSTOM && customManager == null && block == null) { + throw new IllegalArgumentException( + String.format("Could not find texture %s, and no custom texture manager was provided.", texture)); + } - ISubmapManager manager; - if (customManager != null) { - manager = customManager; - } else if (block != null) { - manager = type.createManagerFor(var, block, blockMeta); - } else { - manager = type.createManagerFor(var, texture); - } - return new VariationInfoBase(var, description, manager, type); - } + ISubmapManager manager; + if (customManager != null) { + manager = customManager; + } else if (block != null) { + manager = type.createManagerFor(var, block, blockMeta); + } else { + manager = type.createManagerFor(var, texture); + } + return new VariationInfoBase(var, description, manager, type); + } - private IVariationInfo getServerInfo(String modid, String texture, String description, int metadata, Block block, int blockMeta, ISubmapManager customManager, int order) { - ICarvingVariation var = CarvingUtils.getDefaultVariationFor(getBlock(), metadata, order); - return new VariationInfoBase(var, description, null); - } + private IVariationInfo getServerInfo(String modid, String texture, String description, int metadata, Block block, + int blockMeta, ISubmapManager customManager, int order) { + ICarvingVariation var = CarvingUtils.getDefaultVariationFor(getBlock(), metadata, order); + return new VariationInfoBase(var, description, null); + } - public IVariationInfo getVariation(int metadata) { - if (metadata < 0 || metadata > 15) - metadata = 0; + public IVariationInfo getVariation(int metadata) { + if (metadata < 0 || metadata > 15) metadata = 0; - IVariationInfo info = infoMap[metadata]; - if (info == null) - return null; + IVariationInfo info = infoMap[metadata]; + if (info == null) return null; - return info; - } + return info; + } - public IIcon getIcon(int side, int metadata) { - if (metadata < 0 || metadata > 15) - metadata = 0; + public IIcon getIcon(int side, int metadata) { + if (metadata < 0 || metadata > 15) metadata = 0; - IVariationInfo info = infoMap[metadata]; - if (info == null) - return getMissingIcon(); + IVariationInfo info = infoMap[metadata]; + if (info == null) return getMissingIcon(); - return info.getIcon(side, metadata); - } + return info.getIcon(side, metadata); + } - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - int metadata = world.getBlockMetadata(x, y, z); + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + int metadata = world.getBlockMetadata(x, y, z); - if (metadata < 0 || metadata > 15) - metadata = 0; + if (metadata < 0 || metadata > 15) metadata = 0; - IVariationInfo info = infoMap[metadata]; - if (info == null) - return getMissingIcon(); + IVariationInfo info = infoMap[metadata]; + if (info == null) return getMissingIcon(); - return info.getIcon(world, x, y, z, side); - } + return info.getIcon(world, x, y, z, side); + } - public void registerAll(Block block, String name) { - registerAll(block, name, itemCarvableClass); - } + public void registerAll(Block block, String name) { + registerAll(block, name, itemCarvableClass); + } - public void registerBlock(Block block, String name) { - registerBlock(block, name, itemCarvableClass); - } + public void registerBlock(Block block, String name) { + registerBlock(block, name, itemCarvableClass); + } - void registerBlock(Block block, String name, Class cl) { - block.setBlockName("chisel." + name); - GameRegistry.registerBlock(block, cl, name); - } + void registerBlock(Block block, String name, Class cl) { + block.setBlockName("chisel." + name); + GameRegistry.registerBlock(block, cl, name); + } - public void registerAll(Block block, String name, Class cl) { - registerBlock(block, name, cl); - registerVariations(name); - } + public void registerAll(Block block, String name, Class cl) { + registerBlock(block, name, cl); + registerVariations(name); + } - public void registerVariations(String name) { - for (IVariationInfo info : infoList) { - registerVariation(name, info); - } - } + public void registerVariations(String name) { + for (IVariationInfo info : infoList) { + registerVariation(name, info); + } + } - public void registerVariation(String name, IVariationInfo info) { + public void registerVariation(String name, IVariationInfo info) { - Block block = info.getVariation().getBlock(); + Block block = info.getVariation().getBlock(); - if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) { - FMPIMC.registerFMP(block, info.getVariation().getBlockMeta()); - } + if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) { + FMPIMC.registerFMP(block, info.getVariation().getBlockMeta()); + } - if (forbidChiseling) - return; + if (forbidChiseling) return; - CarvingUtils.getChiselRegistry().addVariation(name, info.getVariation()); - } + CarvingUtils.getChiselRegistry().addVariation(name, info.getVariation()); + } - @SideOnly(Side.CLIENT) - public void registerBlockIcons(String modName, Block block, IIconRegister register) { - for (IVariationInfo info : infoList) { - info.registerIcons(modName, block, register); - } - } + @SideOnly(Side.CLIENT) + public void registerBlockIcons(String modName, Block block, IIconRegister register) { + for (IVariationInfo info : infoList) { + info.registerIcons(modName, block, register); + } + } - public void registerSubBlocks(Block block, CreativeTabs tabs, List list) { - for (IVariationInfo info : infoList) { - list.add(new ItemStack(block, 1, info.getVariation().getItemMeta())); - } - } + public void registerSubBlocks(Block block, CreativeTabs tabs, List list) { + for (IVariationInfo info : infoList) { + list.add(new ItemStack(block, 1, info.getVariation().getItemMeta())); + } + } - public void registerOre(String ore) { - OreDictionary.registerOre(ore, getBlock()); - } + public void registerOre(String ore) { + OreDictionary.registerOre(ore, getBlock()); + } - @SideOnly(Side.CLIENT) - public IIcon getMissingIcon() { - return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); - } - - public Block getBlock() { - return theBlock; - } + @SideOnly(Side.CLIENT) + public IIcon getMissingIcon() { + return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)) + .getAtlasSprite("missingno"); + } + + public Block getBlock() { + return theBlock; + } } diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/CarvingUtils.java b/src/main/java/com/cricketcraft/chisel/api/carving/CarvingUtils.java index ad6be70a..2b56c02d 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/CarvingUtils.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/CarvingUtils.java @@ -11,166 +11,163 @@ import com.google.common.collect.Lists; public class CarvingUtils { - /** - * A simple way to compare two {@link ICarvingVariation} objects based on the {@link ICarvingVariation#getOrder() getOrder()} method. - * - * @param v1 - * The first {@link ICarvingVariation variation}. - * @param v2 - * The second {@link ICarvingVariation variation}. - * @return A positive integer if the first's order is greater, a negative integer if the second's is greater, and 0 if they are equal. - */ - public static int compare(ICarvingVariation v1, ICarvingVariation v2) { - return v1.getOrder() - v2.getOrder(); - } + /** + * A simple way to compare two {@link ICarvingVariation} objects based on the {@link ICarvingVariation#getOrder() + * getOrder()} method. + * + * @param v1 The first {@link ICarvingVariation variation}. + * @param v2 The second {@link ICarvingVariation variation}. + * @return A positive integer if the first's order is greater, a negative integer if the second's is greater, and 0 + * if they are equal. + */ + public static int compare(ICarvingVariation v1, ICarvingVariation v2) { + return v1.getOrder() - v2.getOrder(); + } - /** - * Gets an {@link ItemStack} representing the passed {@link ICarvingVariation}. - * - * @param variation - * An {@link ICarvingVariation} - * @return An {@link ItemStack} - */ - public static ItemStack getStack(ICarvingVariation variation) { - return new ItemStack(variation.getBlock(), 1, variation.getItemMeta()); - } + /** + * Gets an {@link ItemStack} representing the passed {@link ICarvingVariation}. + * + * @param variation An {@link ICarvingVariation} + * @return An {@link ItemStack} + */ + public static ItemStack getStack(ICarvingVariation variation) { + return new ItemStack(variation.getBlock(), 1, variation.getItemMeta()); + } - public static ICarvingRegistry chisel; + public static ICarvingRegistry chisel; - /** - * @return The instance of the chisel carving registry from the chisel mod. - *

- * If chisel is not installed this will return null. - */ - public static ICarvingRegistry getChiselRegistry() { - return chisel; - } + /** + * @return The instance of the chisel carving registry from the chisel mod. + *

+ * If chisel is not installed this will return null. + */ + public static ICarvingRegistry getChiselRegistry() { + return chisel; + } - /** - * Creates a standard {@link ICarvingVariation} for the given data. Use this if you do not need any custom behavior in your own variation. - * - * @param block - * The block of the variation - * @param metadata - * The metadata of both the block and item - * @param order - * The sorting order. - * @return A standard {@link ICarvingVariation} instance. - */ - public static ICarvingVariation getDefaultVariationFor(Block block, int metadata, int order) { - return new SimpleCarvingVariation(block, metadata, order); - } + /** + * Creates a standard {@link ICarvingVariation} for the given data. Use this if you do not need any custom behavior + * in your own variation. + * + * @param block The block of the variation + * @param metadata The metadata of both the block and item + * @param order The sorting order. + * @return A standard {@link ICarvingVariation} instance. + */ + public static ICarvingVariation getDefaultVariationFor(Block block, int metadata, int order) { + return new SimpleCarvingVariation(block, metadata, order); + } - /** - * Creates a standard {@link ICarvingGroup} for the given name. Use this if you do not need any custom behavior in your own group. - * - * @param name - * The name of the group. - * @return A standard {@link ICarvingGroup} instance. - */ - public static ICarvingGroup getDefaultGroupFor(String name) { - return new SimpleCarvingGroup(name); - } + /** + * Creates a standard {@link ICarvingGroup} for the given name. Use this if you do not need any custom behavior in + * your own group. + * + * @param name The name of the group. + * @return A standard {@link ICarvingGroup} instance. + */ + public static ICarvingGroup getDefaultGroupFor(String name) { + return new SimpleCarvingGroup(name); + } - public static class SimpleCarvingVariation implements ICarvingVariation { + public static class SimpleCarvingVariation implements ICarvingVariation { - private int order; - private Block block; - private int meta; - private int damage; + private int order; + private Block block; + private int meta; + private int damage; - public SimpleCarvingVariation(Block block, int metadata, int order) { - this.order = order; - this.block = block; - this.meta = metadata; - this.damage = metadata; - } + public SimpleCarvingVariation(Block block, int metadata, int order) { + this.order = order; + this.block = block; + this.meta = metadata; + this.damage = metadata; + } - @Override - public Block getBlock() { - return block; - } + @Override + public Block getBlock() { + return block; + } - @Override - public int getBlockMeta() { - return meta; - } + @Override + public int getBlockMeta() { + return meta; + } - @Override - public int getItemMeta() { - return damage; - } + @Override + public int getItemMeta() { + return damage; + } - @Override - public int getOrder() { - return order; - } - } + @Override + public int getOrder() { + return order; + } + } - public static class SimpleCarvingGroup implements ICarvingGroup { + public static class SimpleCarvingGroup implements ICarvingGroup { - private String name; - private String sound; - private String oreName; + private String name; + private String sound; + private String oreName; - private List variations = Lists.newArrayList(); + private List variations = Lists.newArrayList(); - public SimpleCarvingGroup(String name) { - this.name = name; - } + public SimpleCarvingGroup(String name) { + this.name = name; + } - @Override - public List getVariations() { - return Lists.newArrayList(variations); - } + @Override + public List getVariations() { + return Lists.newArrayList(variations); + } - @Override - public void addVariation(ICarvingVariation variation) { - variations.add(variation); - Collections.sort(variations, new Comparator() { + @Override + public void addVariation(ICarvingVariation variation) { + variations.add(variation); + Collections.sort(variations, new Comparator() { - @Override - public int compare(ICarvingVariation o1, ICarvingVariation o2) { - return CarvingUtils.compare(o1, o2); - } - }); - } + @Override + public int compare(ICarvingVariation o1, ICarvingVariation o2) { + return CarvingUtils.compare(o1, o2); + } + }); + } - @Override - public boolean removeVariation(ICarvingVariation variation) { - ICarvingVariation toRemove = null; - for (ICarvingVariation v : variations) { - if (v.getBlock() == variation.getBlock() && v.getBlockMeta() == variation.getBlockMeta()) { - toRemove = v; - } - } - return toRemove == null ? false : variations.remove(toRemove); - } + @Override + public boolean removeVariation(ICarvingVariation variation) { + ICarvingVariation toRemove = null; + for (ICarvingVariation v : variations) { + if (v.getBlock() == variation.getBlock() && v.getBlockMeta() == variation.getBlockMeta()) { + toRemove = v; + } + } + return toRemove == null ? false : variations.remove(toRemove); + } - @Override - public String getName() { - return name; - } + @Override + public String getName() { + return name; + } - @Override - public String getSound() { - return sound; - } + @Override + public String getSound() { + return sound; + } - @Override - public void setSound(String sound) { - this.sound = sound; - } + @Override + public void setSound(String sound) { + this.sound = sound; + } - @Override - public String getOreName() { - return oreName; - } + @Override + public String getOreName() { + return oreName; + } - @Override - public void setOreName(String oreName) { - this.oreName = oreName; - } - } + @Override + public void setOreName(String oreName) { + this.oreName = oreName; + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingGroup.java b/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingGroup.java index ffe97843..0df6b455 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingGroup.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingGroup.java @@ -5,70 +5,69 @@ import java.util.List; /** * Represents a group of chiselable blocks. *

- * This is an object that contains a collection of {@link ICarvingVariation} objects, and keeps them sorted. You may sort them in any way (or not at all), and {@link ICarvingVariation#getOrder()} will - * likely be of use to do so. + * This is an object that contains a collection of {@link ICarvingVariation} objects, and keeps them sorted. You may + * sort them in any way (or not at all), and {@link ICarvingVariation#getOrder()} will likely be of use to do so. *

* It also defines what sound and oredict name the group as a whole has. */ public interface ICarvingGroup { - /** - * The name of this group. Used for internal identification. - * - * @return A string name for the group - */ - String getName(); + /** + * The name of this group. Used for internal identification. + * + * @return A string name for the group + */ + String getName(); - /** - * Can return null. If null, fallback sound will be used (the standard chisel sound). - * - * @return The string resource path of the sound to use for chiseling items in this group - */ - String getSound(); + /** + * Can return null. If null, fallback sound will be used (the standard chisel sound). + * + * @return The string resource path of the sound to use for chiseling items in this group + */ + String getSound(); - /** - * Sets the sound of this group - * - * @param sound - * A string resource path for the sound this group makes when chiseled - */ - void setSound(String sound); + /** + * Sets the sound of this group + * + * @param sound A string resource path for the sound this group makes when chiseled + */ + void setSound(String sound); - /** - * The oredict name to match to this group. All items with this oredict name will be assumed to be part of this group. - * - * @return An ore dictionary name - */ - String getOreName(); + /** + * The oredict name to match to this group. All items with this oredict name will be assumed to be part of this + * group. + * + * @return An ore dictionary name + */ + String getOreName(); - /** - * Sets the oredict name for this group. - * - * @param oreName - * The String oredict name to be associated with this group. - */ - void setOreName(String oreName); + /** + * Sets the oredict name for this group. + * + * @param oreName The String oredict name to be associated with this group. + */ + void setOreName(String oreName); - /** - * Gets all carving variations associated with this group. - * - * @return A {@link List} of {@link ICarvingVariation}s - */ - List getVariations(); + /** + * Gets all carving variations associated with this group. + * + * @return A {@link List} of {@link ICarvingVariation}s + */ + List getVariations(); - /** - * Adds a variation to this group. Do not call this from external code, as it will fail to remove the inverse lookup from the registry. - * - * @param variation - * An {@link ICarvingVariation} to add to this group - */ - void addVariation(ICarvingVariation variation); + /** + * Adds a variation to this group. Do not call this from external code, as it will fail to remove the inverse lookup + * from the registry. + * + * @param variation An {@link ICarvingVariation} to add to this group + */ + void addVariation(ICarvingVariation variation); - /** - * Removes a variation to this group. Do not call this from external code, as it will fail to remove the inverse lookup from the registry. - * - * @param variation - * An {@link ICarvingVariation} to add to this group - */ - boolean removeVariation(ICarvingVariation variation); + /** + * Removes a variation to this group. Do not call this from external code, as it will fail to remove the inverse + * lookup from the registry. + * + * @param variation An {@link ICarvingVariation} to add to this group + */ + boolean removeVariation(ICarvingVariation variation); } diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingRegistry.java b/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingRegistry.java index 1987f378..9ab7fd07 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingRegistry.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingRegistry.java @@ -14,191 +14,168 @@ import net.minecraft.world.World; */ public interface ICarvingRegistry { - /* Getters */ + /* Getters */ - /** - * Finds the group the block/meta pair belongs to in the registry. - * - * @param block - * The block of the variation - * @param meta - * The metadata of the variation - * @return The {@link ICarvingGroup} that the block/meta pair belongs to - */ - ICarvingGroup getGroup(Block block, int meta); + /** + * Finds the group the block/meta pair belongs to in the registry. + * + * @param block The block of the variation + * @param meta The metadata of the variation + * @return The {@link ICarvingGroup} that the block/meta pair belongs to + */ + ICarvingGroup getGroup(Block block, int meta); - /** - * Gets an {@link ICarvingGroup} by its name. - * - * @param name - * The name of the group - * @return An {@link ICarvingGroup} - */ - ICarvingGroup getGroup(String name); + /** + * Gets an {@link ICarvingGroup} by its name. + * + * @param name The name of the group + * @return An {@link ICarvingGroup} + */ + ICarvingGroup getGroup(String name); - /** - * Gets the {@link ICarvingVariation} instance represented by this block/meta pair. - * - * @param block - * The block of the variatoin - * @param meta - * The metadata of the variation - * @return The {@link ICarvingVariation} containing this block/meta pair - */ - ICarvingVariation getVariation(Block block, int meta); + /** + * Gets the {@link ICarvingVariation} instance represented by this block/meta pair. + * + * @param block The block of the variatoin + * @param meta The metadata of the variation + * @return The {@link ICarvingVariation} containing this block/meta pair + */ + ICarvingVariation getVariation(Block block, int meta); - /** - * Gets the list of {@link ICarvingVariation}s from the group that contains this block/meta pair. - * - * @param block - * The block of the variation - * @param meta - * The metadata of the variation - * @return All of the {@link ICarvingVariation}s in the group that contains this block/meta pair - */ - List getGroupVariations(Block block, int meta); + /** + * Gets the list of {@link ICarvingVariation}s from the group that contains this block/meta pair. + * + * @param block The block of the variation + * @param meta The metadata of the variation + * @return All of the {@link ICarvingVariation}s in the group that contains this block/meta pair + */ + List getGroupVariations(Block block, int meta); - /** - * Gets the oredict name for the group that contains this block/meta pair. - * - * @param block - * The block of the variation - * @param meta - * The metadata of the variation - * @return A string oredict name for the group - */ - String getOreName(Block block, int meta); + /** + * Gets the oredict name for the group that contains this block/meta pair. + * + * @param block The block of the variation + * @param meta The metadata of the variation + * @return A string oredict name for the group + */ + String getOreName(Block block, int meta); - /** - * Gets the possible output items for this {@link ItemStack}. To be used for machines/GUIs that chisel items. - * - * @param chiseled - * The {@link ItemStack} being chiseled - * @return A list of stacks that can be chiseled from the passed {@link ItemStack stack} - */ - List getItemsForChiseling(ItemStack chiseled); + /** + * Gets the possible output items for this {@link ItemStack}. To be used for machines/GUIs that chisel items. + * + * @param chiseled The {@link ItemStack} being chiseled + * @return A list of stacks that can be chiseled from the passed {@link ItemStack stack} + */ + List getItemsForChiseling(ItemStack chiseled); - /** - * Gets the sound resource string for the group represented by this block/meta pair. - * - * @param block - * The block of the variation - * @param metadata - * The metadata of the variation - * @return The string resource for the sound that can be used in {@link World#playSound(double, double, double, String, float, float, boolean)} and other methods. - */ - public String getVariationSound(Block block, int metadata); + /** + * Gets the sound resource string for the group represented by this block/meta pair. + * + * @param block The block of the variation + * @param metadata The metadata of the variation + * @return The string resource for the sound that can be used in + * {@link World#playSound(double, double, double, String, float, float, boolean)} and other methods. + */ + public String getVariationSound(Block block, int metadata); - /** - * Gets the sound resource string for the group represented by this item/meta pair. - *

- * Mostly a convenience for calling {@link #getVariationSound(Block, int)} with {@link Block#getBlockFromItem(Item)}. - * - * @param item - * The item of the variation - * @param metadata - * The metadata of the variation - * @return The string resource for the sound that can be used in {@link World#playSound(double, double, double, String, float, float, boolean)} and other methods. - */ - public String getVariationSound(Item item, int metadata); + /** + * Gets the sound resource string for the group represented by this item/meta pair. + *

+ * Mostly a convenience for calling {@link #getVariationSound(Block, int)} with + * {@link Block#getBlockFromItem(Item)}. + * + * @param item The item of the variation + * @param metadata The metadata of the variation + * @return The string resource for the sound that can be used in + * {@link World#playSound(double, double, double, String, float, float, boolean)} and other methods. + */ + public String getVariationSound(Item item, int metadata); - /** - * @return A list of all registered group names, sorted alphabetically. - */ - List getSortedGroupNames(); + /** + * @return A list of all registered group names, sorted alphabetically. + */ + List getSortedGroupNames(); - /* Setters */ + /* Setters */ - /** - * Adds a variation to the registry. - * - * @param groupName - * The name of the group to add to. - * @param block - * The block of the variation - * @param metadata - * The metadata of the variation - * @param order - * The order of the variation in the list of all variations in the group. Higher numbers are sorted at the end. - */ - void addVariation(String groupName, Block block, int metadata, int order); + /** + * Adds a variation to the registry. + * + * @param groupName The name of the group to add to. + * @param block The block of the variation + * @param metadata The metadata of the variation + * @param order The order of the variation in the list of all variations in the group. Higher numbers are sorted + * at the end. + */ + void addVariation(String groupName, Block block, int metadata, int order); - /** - * Adds a variation to the registry. - * - * @param groupName - * The name of the group to add to - * @param variation - * The {@link ICarvingVariation} to add - */ - void addVariation(String groupName, ICarvingVariation variation); + /** + * Adds a variation to the registry. + * + * @param groupName The name of the group to add to + * @param variation The {@link ICarvingVariation} to add + */ + void addVariation(String groupName, ICarvingVariation variation); - /** - * Adds a group to the registry. - * - * @param group - * The {@link ICarvingGroup} to add. - */ - void addGroup(ICarvingGroup group); + /** + * Adds a group to the registry. + * + * @param group The {@link ICarvingGroup} to add. + */ + void addGroup(ICarvingGroup group); - /** - * Removes a group from the registry. - *

- * This in effect removes all variations associated with the group, though they are not explicitly removed from the object. If you maintain a reference to the {@link ICarvingGroup} that is - * removed, it will still contain its variations. - * - * @param groupName - * The name of the group to remove. - * @return The {@link ICarvingGroup} that was removed. - */ - ICarvingGroup removeGroup(String groupName); + /** + * Removes a group from the registry. + *

+ * This in effect removes all variations associated with the group, though they are not explicitly removed from the + * object. If you maintain a reference to the {@link ICarvingGroup} that is removed, it will still contain its + * variations. + * + * @param groupName The name of the group to remove. + * @return The {@link ICarvingGroup} that was removed. + */ + ICarvingGroup removeGroup(String groupName); - /** - * Removes a varaition with the passed {@link Block} and metadata from the registry. If this variation is registered with mutiple groups, it will remove it from all of them. - * - * @param block - * The {@link Block} of the {@link ICarvingVariation variation} - * @param metadata - * The metadata of the {@link ICarvingVariation variation} - * @return The ICarvingVariation that was removed. Null if nothing was removed. - */ - ICarvingVariation removeVariation(Block block, int metadata); + /** + * Removes a varaition with the passed {@link Block} and metadata from the registry. If this variation is registered + * with mutiple groups, it will remove it from all of them. + * + * @param block The {@link Block} of the {@link ICarvingVariation variation} + * @param metadata The metadata of the {@link ICarvingVariation variation} + * @return The ICarvingVariation that was removed. Null if nothing was removed. + */ + ICarvingVariation removeVariation(Block block, int metadata); - /** - * Removes a varaition with the passed {@link Block} and metadata from the registry, but only from the specified {@link ICarvingGroup} name. - * - * @param block - * The {@link Block} of the {@link ICarvingVariation variation} - * @param metadata - * The metadata of the {@link ICarvingVariation variation} - * @param group - * The name of the group that the variation should be removed from - * @return The ICarvingVariation that was removed. Null if nothing was removed. - */ - ICarvingVariation removeVariation(Block block, int metadata, String group); + /** + * Removes a varaition with the passed {@link Block} and metadata from the registry, but only from the specified + * {@link ICarvingGroup} name. + * + * @param block The {@link Block} of the {@link ICarvingVariation variation} + * @param metadata The metadata of the {@link ICarvingVariation variation} + * @param group The name of the group that the variation should be removed from + * @return The ICarvingVariation that was removed. Null if nothing was removed. + */ + ICarvingVariation removeVariation(Block block, int metadata, String group); - /** - * Registers a group to an oredict name. - *

- * Doing this means that all blocks that are registered to this oredict name will act as if they are a part of this group. - * - * @param groupName - * The name of the group - * @param oreName - * The oredict name - */ - void registerOre(String groupName, String oreName); + /** + * Registers a group to an oredict name. + *

+ * Doing this means that all blocks that are registered to this oredict name will act as if they are a part of this + * group. + * + * @param groupName The name of the group + * @param oreName The oredict name + */ + void registerOre(String groupName, String oreName); - /** - * Sets the sound resource for a group. - *

- * This is the sound that is used when a block from this group is chiseled.
- * Does not need to be explicitly set. - * - * @param name - * The name of the group - * @param sound - * The resource string for the sound - */ - void setVariationSound(String name, String sound); + /** + * Sets the sound resource for a group. + *

+ * This is the sound that is used when a block from this group is chiseled.
+ * Does not need to be explicitly set. + * + * @param name The name of the group + * @param sound The resource string for the sound + */ + void setVariationSound(String name, String sound); } diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingVariation.java b/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingVariation.java index 02825674..9eefba87 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingVariation.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/ICarvingVariation.java @@ -8,31 +8,31 @@ import net.minecraft.item.Item; */ public interface ICarvingVariation { - /** - * The base block of this variation. - * - * @return A {@link Block} that is the base of this variation - */ - Block getBlock(); + /** + * The base block of this variation. + * + * @return A {@link Block} that is the base of this variation + */ + Block getBlock(); - /** - * The metadata of this variation - * - * @return An int representing the metadata of this variation's {@link Block} in the world. - */ - int getBlockMeta(); + /** + * The metadata of this variation + * + * @return An int representing the metadata of this variation's {@link Block} in the world. + */ + int getBlockMeta(); - /** - * The item metadata of this variation - * - * @return An int representing the metadata of this variations's {@link Item}. - */ - int getItemMeta(); + /** + * The item metadata of this variation + * + * @return An int representing the metadata of this variations's {@link Item}. + */ + int getItemMeta(); - /** - * The "order" of this variation. Represents its position in the list of variations held by a group. - * - * @return An integer to represent the position of this variation in the list of all variations in the group - */ - int getOrder(); + /** + * The "order" of this variation. Represents its position in the list of variations held by a group. + * + * @return An integer to represent the position of this variation in the list of all variations in the group + */ + int getOrder(); } diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/IChiselMode.java b/src/main/java/com/cricketcraft/chisel/api/carving/IChiselMode.java index 1fa58eee..71e15a18 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/IChiselMode.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/IChiselMode.java @@ -6,15 +6,17 @@ import net.minecraftforge.common.util.ForgeDirection; public interface IChiselMode { - /** - * NOTE: This method is responsible for increasing the "Blocks Chiseled" statistic found in the Statistics class. - */ - void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, ICarvingVariation variation); + /** + * NOTE: This method is responsible for increasing the "Blocks Chiseled" statistic found in the Statistics class. + */ + void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, + ICarvingVariation variation); - /** - * Implemented implicitly by enums. If your IChiselMode is not an enum constant, this needs to be implemented explicitly. - * - * @return The name of the mode. - */ - String name(); + /** + * Implemented implicitly by enums. If your IChiselMode is not an enum constant, this needs to be implemented + * explicitly. + * + * @return The name of the mode. + */ + String name(); } diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/IVariationInfo.java b/src/main/java/com/cricketcraft/chisel/api/carving/IVariationInfo.java index a8cf97de..03c4c3cb 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/IVariationInfo.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/IVariationInfo.java @@ -6,9 +6,9 @@ import com.cricketcraft.chisel.api.rendering.TextureType; public interface IVariationInfo extends ISubmapManager { - ICarvingVariation getVariation(); + ICarvingVariation getVariation(); - String getDescription(); + String getDescription(); - TextureType getType(); + TextureType getType(); } diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/VariationInfoBase.java b/src/main/java/com/cricketcraft/chisel/api/carving/VariationInfoBase.java index 73986596..adaa5071 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/VariationInfoBase.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/VariationInfoBase.java @@ -1,6 +1,5 @@ package com.cricketcraft.chisel.api.carving; -import team.chisel.ctmlib.ISubmapManager; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.texture.IIconRegister; @@ -9,70 +8,72 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; +import team.chisel.ctmlib.ISubmapManager; + import com.cricketcraft.chisel.api.rendering.TextureType; public class VariationInfoBase implements IVariationInfo { - private ICarvingVariation variation; - private String unlocDesc; - private ISubmapManager manager; - private TextureType type; + private ICarvingVariation variation; + private String unlocDesc; + private ISubmapManager manager; + private TextureType type; - public VariationInfoBase(ICarvingVariation variation, String unlocDesc, ISubmapManager manager) { - this(variation, unlocDesc, manager, TextureType.CUSTOM); - } + public VariationInfoBase(ICarvingVariation variation, String unlocDesc, ISubmapManager manager) { + this(variation, unlocDesc, manager, TextureType.CUSTOM); + } - public VariationInfoBase(ICarvingVariation variation, String unlocDesc, ISubmapManager manager, TextureType type) { - this.variation = variation; - this.unlocDesc = unlocDesc; - this.manager = manager; - this.type = type; - } + public VariationInfoBase(ICarvingVariation variation, String unlocDesc, ISubmapManager manager, TextureType type) { + this.variation = variation; + this.unlocDesc = unlocDesc; + this.manager = manager; + this.type = type; + } - @Override - public ICarvingVariation getVariation() { - return variation; - } + @Override + public ICarvingVariation getVariation() { + return variation; + } - @Override - public String getDescription() { - return StatCollector.translateToLocal(unlocDesc); - } + @Override + public String getDescription() { + return StatCollector.translateToLocal(unlocDesc); + } - @Override - public TextureType getType() { - return type; - } + @Override + public TextureType getType() { + return type; + } - // ISubmapManager delegation + // ISubmapManager delegation - @Override - public IIcon getIcon(int side, int meta) { - return manager.getIcon(side, meta); - } + @Override + public IIcon getIcon(int side, int meta) { + return manager.getIcon(side, meta); + } - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - return manager.getIcon(world, x, y, z, side); - } + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return manager.getIcon(world, x, y, z, side); + } - @Override - public void registerIcons(String modName, Block block, IIconRegister register) { - manager.registerIcons(modName, block, register); - } + @Override + public void registerIcons(String modName, Block block, IIconRegister register) { + manager.registerIcons(modName, block, register); + } - @Override - public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { - return manager.createRenderContext(rendererOld, block, world); - } + @Override + public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { + return manager.createRenderContext(rendererOld, block, world); + } - @Override - public void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { - manager.preRenderSide(renderer, world, x, y, z, side); - } + @Override + public void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { + manager.preRenderSide(renderer, world, x, y, z, side); + } - @Override - public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { - manager.postRenderSide(renderer, world, x, y, z, side); - } + @Override + public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { + manager.postRenderSide(renderer, world, x, y, z, side); + } } diff --git a/src/main/java/com/cricketcraft/chisel/api/carving/package-info.java b/src/main/java/com/cricketcraft/chisel/api/carving/package-info.java index 4276c3bd..177c7f2c 100644 --- a/src/main/java/com/cricketcraft/chisel/api/carving/package-info.java +++ b/src/main/java/com/cricketcraft/chisel/api/carving/package-info.java @@ -2,6 +2,4 @@ package com.cricketcraft.chisel.api.carving; import com.cricketcraft.chisel.api.ChiselAPIProps; - import cpw.mods.fml.common.API; - diff --git a/src/main/java/com/cricketcraft/chisel/api/package-info.java b/src/main/java/com/cricketcraft/chisel/api/package-info.java index d152194e..01aad719 100644 --- a/src/main/java/com/cricketcraft/chisel/api/package-info.java +++ b/src/main/java/com/cricketcraft/chisel/api/package-info.java @@ -2,4 +2,3 @@ package com.cricketcraft.chisel.api; import cpw.mods.fml.common.API; - diff --git a/src/main/java/com/cricketcraft/chisel/api/rendering/ClientUtils.java b/src/main/java/com/cricketcraft/chisel/api/rendering/ClientUtils.java index 071182be..52401db0 100644 --- a/src/main/java/com/cricketcraft/chisel/api/rendering/ClientUtils.java +++ b/src/main/java/com/cricketcraft/chisel/api/rendering/ClientUtils.java @@ -2,6 +2,6 @@ package com.cricketcraft.chisel.api.rendering; public class ClientUtils { - public static int renderCTMId; + public static int renderCTMId; } diff --git a/src/main/java/com/cricketcraft/chisel/api/rendering/TextureType.java b/src/main/java/com/cricketcraft/chisel/api/rendering/TextureType.java index e0966488..b2211e70 100644 --- a/src/main/java/com/cricketcraft/chisel/api/rendering/TextureType.java +++ b/src/main/java/com/cricketcraft/chisel/api/rendering/TextureType.java @@ -33,7 +33,7 @@ import cpw.mods.fml.relauncher.SideOnly; @SuppressWarnings("unchecked") public enum TextureType { - // @formatter:off + // @formatter:off TOPBOTSIDE("top", "bottom", "side"){ @Override protected Object registerIcons(ICarvingVariation variation, String modName, String texturePath, IIconRegister register) { diff --git a/src/main/java/com/cricketcraft/chisel/api/rendering/package-info.java b/src/main/java/com/cricketcraft/chisel/api/rendering/package-info.java index 72861b94..0993cb88 100644 --- a/src/main/java/com/cricketcraft/chisel/api/rendering/package-info.java +++ b/src/main/java/com/cricketcraft/chisel/api/rendering/package-info.java @@ -2,6 +2,4 @@ package com.cricketcraft.chisel.api.rendering; import com.cricketcraft.chisel.api.ChiselAPIProps; - import cpw.mods.fml.common.API; - diff --git a/src/main/java/team/chisel/BlockNameConversion.java b/src/main/java/team/chisel/BlockNameConversion.java index fd543ba8..a6a4a80f 100644 --- a/src/main/java/team/chisel/BlockNameConversion.java +++ b/src/main/java/team/chisel/BlockNameConversion.java @@ -2,107 +2,110 @@ package team.chisel; import java.util.HashMap; -import team.chisel.utils.General; import net.minecraft.block.Block; import net.minecraft.item.Item; + +import team.chisel.utils.General; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.registry.GameRegistry; public class BlockNameConversion { - static final private HashMap namingConversion = new HashMap(); + static final private HashMap namingConversion = new HashMap(); - public static class NameConversions { + public static class NameConversions { - public final static int MAX = 5; + public final static int MAX = 5; - protected static String conversion(String oldname, int step) { - oldname = General.cleanTags(oldname); - String newname = null; - switch (step) { - case 0: // lookup list - return namingConversion.get(oldname); - case 1: // remove Chisel: - if (oldname.startsWith("Chisel:")) { - newname = oldname.replaceAll("(?i)" + "Chisel:", ""); - } - return newname; - case 2: // rename "marbleSlab" -> "marble_slab", "redstone" -> - // "redstone_block" - newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase(); + protected static String conversion(String oldname, int step) { + oldname = General.cleanTags(oldname); + String newname = null; + switch (step) { + case 0: // lookup list + return namingConversion.get(oldname); + case 1: // remove Chisel: + if (oldname.startsWith("Chisel:")) { + newname = oldname.replaceAll("(?i)" + "Chisel:", ""); + } + return newname; + case 2: // rename "marbleSlab" -> "marble_slab", "redstone" -> + // "redstone_block" + newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase(); - if (newname.startsWith("block_")) { - newname = newname.replaceFirst("block_([a-z_]+)", "$1_block"); - } else if (newname.startsWith("snakestone_")) { - newname = newname.replaceFirst("snakestone_([a-z_]+)", "$1_snakestone"); - } - return newname; - case 3: // rename "wood-dark-oak" -> "dark_oak_planks" - newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase().replace('-', '_'); - if (newname.contains("wood_")) { - newname = newname.replaceFirst("wood_([a-z_]+)", "$1_planks"); - } - return newname; - case (MAX - 1): // ALWAYS last: rename "blockYxx" -> "yxx" (e.g. - // "dirt" -> "dirt"). - // This can be dangerous in cases like "carpet" (a block) -> - // "carpet" (NO block) - return oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase().replaceFirst("block_", ""); - default: - throw new IndexOutOfBoundsException("conversion got invalid parameter step=" + step); - } - } - } + if (newname.startsWith("block_")) { + newname = newname.replaceFirst("block_([a-z_]+)", "$1_block"); + } else if (newname.startsWith("snakestone_")) { + newname = newname.replaceFirst("snakestone_([a-z_]+)", "$1_snakestone"); + } + return newname; + case 3: // rename "wood-dark-oak" -> "dark_oak_planks" + newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase().replace('-', '_'); + if (newname.contains("wood_")) { + newname = newname.replaceFirst("wood_([a-z_]+)", "$1_planks"); + } + return newname; + case (MAX - 1): // ALWAYS last: rename "blockYxx" -> "yxx" (e.g. + // "dirt" -> "dirt"). + // This can be dangerous in cases like "carpet" (a block) -> + // "carpet" (NO block) + return oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase().replaceFirst("block_", ""); + default: + throw new IndexOutOfBoundsException("conversion got invalid parameter step=" + step); + } + } + } - static public void init() { - namingConversion.put("blockCobble", "cobblestone"); - namingConversion.put("iron", "iron_block"); - namingConversion.put("gold", "gold_block"); - namingConversion.put("diamond", "diamond_block"); - namingConversion.put("lightstone", "glowstone"); - namingConversion.put("lapis", "lapis_block"); - namingConversion.put("emerald", "emerald_block"); - namingConversion.put("hellrock", "netherrack"); - namingConversion.put("stoneMoss", "mossy_cobblestone"); - namingConversion.put("stoneBrick", "stonebrick"); - namingConversion.put("fenceIron", "iron_bars"); - namingConversion.put("fantasy", "fantasyblock"); - namingConversion.put("carpetFloor", "carpet"); - namingConversion.put("temple", "templeblock"); - namingConversion.put("templeMossy", "mossy_templeblock"); - namingConversion.put("factory", "factoryblock"); - namingConversion.put("laboratory", "laboratoryblock"); - // "LightGray" is unfortunately converted to "light_gray" - namingConversion.put("stainedGlassLightGray", "stained_glass_lightgray"); - namingConversion.put("stainedGlassPaneLightGray", "stained_glass_pane_lightgray"); - namingConversion.put("blockTemple", "templeblock"); - namingConversion.put("stoneBrick", "stonebricksmooth"); - namingConversion.put("blockTempleMossy", "mossy_templeblock"); - namingConversion.put("blockFactory", "factoryblock"); - namingConversion.put("blockFft", "fantasyblock"); - namingConversion.put("blockCarpetFloor", "carpet"); - namingConversion.put("blockLaboratory", "laboratoryblock"); - } + static public void init() { + namingConversion.put("blockCobble", "cobblestone"); + namingConversion.put("iron", "iron_block"); + namingConversion.put("gold", "gold_block"); + namingConversion.put("diamond", "diamond_block"); + namingConversion.put("lightstone", "glowstone"); + namingConversion.put("lapis", "lapis_block"); + namingConversion.put("emerald", "emerald_block"); + namingConversion.put("hellrock", "netherrack"); + namingConversion.put("stoneMoss", "mossy_cobblestone"); + namingConversion.put("stoneBrick", "stonebrick"); + namingConversion.put("fenceIron", "iron_bars"); + namingConversion.put("fantasy", "fantasyblock"); + namingConversion.put("carpetFloor", "carpet"); + namingConversion.put("temple", "templeblock"); + namingConversion.put("templeMossy", "mossy_templeblock"); + namingConversion.put("factory", "factoryblock"); + namingConversion.put("laboratory", "laboratoryblock"); + // "LightGray" is unfortunately converted to "light_gray" + namingConversion.put("stainedGlassLightGray", "stained_glass_lightgray"); + namingConversion.put("stainedGlassPaneLightGray", "stained_glass_pane_lightgray"); + namingConversion.put("blockTemple", "templeblock"); + namingConversion.put("stoneBrick", "stonebricksmooth"); + namingConversion.put("blockTempleMossy", "mossy_templeblock"); + namingConversion.put("blockFactory", "factoryblock"); + namingConversion.put("blockFft", "fantasyblock"); + namingConversion.put("blockCarpetFloor", "carpet"); + namingConversion.put("blockLaboratory", "laboratoryblock"); + } - public static Item findItem(String oldname) { - FMLLog.getLogger().trace("[Chisel 2] findItem() START " + oldname); - Item item = null; - for (int i = 0; i < NameConversions.MAX && item == null; i++) { - FMLLog.getLogger().trace("[Chisel 2] findItem() Checking for " + NameConversions.conversion(oldname, i)); - item = GameRegistry.findItem(Chisel.MOD_ID, NameConversions.conversion(oldname, i)); - } + public static Item findItem(String oldname) { + FMLLog.getLogger().trace("[Chisel 2] findItem() START " + oldname); + Item item = null; + for (int i = 0; i < NameConversions.MAX && item == null; i++) { + FMLLog.getLogger() + .trace("[Chisel 2] findItem() Checking for " + NameConversions.conversion(oldname, i)); + item = GameRegistry.findItem(Chisel.MOD_ID, NameConversions.conversion(oldname, i)); + } - return item; - } + return item; + } - public static Block findBlock(String oldname) { - FMLLog.getLogger().trace("[Chisel 2] findBlock() START: " + oldname); - Block block = null; - for (int i = 0; i < NameConversions.MAX && block == null; i++) { - FMLLog.getLogger().trace("[Chisel 2] findBlock() Checking for " + NameConversions.conversion(oldname, i)); - block = GameRegistry.findBlock(Chisel.MOD_ID, NameConversions.conversion(oldname, i)); - } + public static Block findBlock(String oldname) { + FMLLog.getLogger().trace("[Chisel 2] findBlock() START: " + oldname); + Block block = null; + for (int i = 0; i < NameConversions.MAX && block == null; i++) { + FMLLog.getLogger() + .trace("[Chisel 2] findBlock() Checking for " + NameConversions.conversion(oldname, i)); + block = GameRegistry.findBlock(Chisel.MOD_ID, NameConversions.conversion(oldname, i)); + } - return block; - } -} \ No newline at end of file + return block; + } +} diff --git a/src/main/java/team/chisel/Chisel.java b/src/main/java/team/chisel/Chisel.java index 7ffd0921..a9bfd787 100644 --- a/src/main/java/team/chisel/Chisel.java +++ b/src/main/java/team/chisel/Chisel.java @@ -53,149 +53,159 @@ import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry.Type; -@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = Chisel.VERSION, guiFactory = "team.chisel.client.gui.GuiFactory", dependencies = "after:EE3;after:ForgeMultipart;after:Thaumcraft;after:appliedenergistics2;after:Railcraft;after:AWWayofTime;after:TwilightForest") +@Mod( + modid = Chisel.MOD_ID, + name = Chisel.MOD_NAME, + version = Chisel.VERSION, + guiFactory = "team.chisel.client.gui.GuiFactory", + dependencies = "after:EE3;after:ForgeMultipart;after:Thaumcraft;after:appliedenergistics2;after:Railcraft;after:AWWayofTime;after:TwilightForest") public class Chisel { - public static final String MOD_ID = "chisel"; - public static final BlockCarvable.SoundType soundTempleFootstep = new BlockCarvable.SoundType("dig.stone", MOD_ID + ":step.templeblock", 1.0f, 1.0f); - public static final String MOD_NAME = "Chisel"; - public static final String VERSION = "GRADLETOKEN_VERSION"; - public static final BlockCarvable.SoundType soundHolystoneFootstep = new BlockCarvable.SoundType("holystone", 1.0f, 1.0f); - public static final BlockCarvable.SoundType soundMetalFootstep = new BlockCarvable.SoundType("metal", 1.0f, 1.0f); - public static boolean multipartLoaded = false; - public static boolean gtnhLoaded = false; - public static int renderEldritchId; - public static int renderAutoChiselId; - public static int renderGlowId; - public static int renderLayeredId; - public static int roadLineId; + public static final String MOD_ID = "chisel"; + public static final BlockCarvable.SoundType soundTempleFootstep = new BlockCarvable.SoundType( + "dig.stone", + MOD_ID + ":step.templeblock", + 1.0f, + 1.0f); + public static final String MOD_NAME = "Chisel"; + public static final String VERSION = "GRADLETOKEN_VERSION"; + public static final BlockCarvable.SoundType soundHolystoneFootstep = new BlockCarvable.SoundType( + "holystone", + 1.0f, + 1.0f); + public static final BlockCarvable.SoundType soundMetalFootstep = new BlockCarvable.SoundType("metal", 1.0f, 1.0f); + public static boolean multipartLoaded = false; + public static boolean gtnhLoaded = false; + public static int renderEldritchId; + public static int renderAutoChiselId; + public static int renderGlowId; + public static int renderLayeredId; + public static int roadLineId; - public static final Logger logger = LogManager.getLogger(MOD_NAME); + public static final Logger logger = LogManager.getLogger(MOD_NAME); - @Instance(MOD_ID) - public static Chisel instance; + @Instance(MOD_ID) + public static Chisel instance; - public Chisel() { - ChiselAPIProps.MOD_ID = MOD_ID; - CarvableHelper.itemCarvableClass = ItemCarvable.class; - Carving.construct(); - } + public Chisel() { + ChiselAPIProps.MOD_ID = MOD_ID; + CarvableHelper.itemCarvableClass = ItemCarvable.class; + Carving.construct(); + } - @SidedProxy(clientSide = "team.chisel.proxy.ClientProxy", serverSide = "team.chisel.proxy.CommonProxy") - public static CommonProxy proxy; + @SidedProxy(clientSide = "team.chisel.proxy.ClientProxy", serverSide = "team.chisel.proxy.CommonProxy") + public static CommonProxy proxy; - @EventHandler - public void missingMapping(FMLMissingMappingsEvent event) { - BlockNameConversion.init(); + @EventHandler + public void missingMapping(FMLMissingMappingsEvent event) { + BlockNameConversion.init(); - for (MissingMapping m : event.get()) { - // This bug was introduced along with Chisel 1.5.2, and was fixed in - // 1.5.3. - // Ice Stairs were called null.0-7 instead of other names, and - // Marble/Limestone stairs did not exist. - // This fixes the bug. - if (m.name.startsWith("null.") && m.name.length() == 6 && m.type == Type.BLOCK) { - m.warn();// (Action.WARN); - } + for (MissingMapping m : event.get()) { + // This bug was introduced along with Chisel 1.5.2, and was fixed in + // 1.5.3. + // Ice Stairs were called null.0-7 instead of other names, and + // Marble/Limestone stairs did not exist. + // This fixes the bug. + if (m.name.startsWith("null.") && m.name.length() == 6 && m.type == Type.BLOCK) { + m.warn();// (Action.WARN); + } - // Fix mapping of snakestoneSand, snakestoneStone, limestoneStairs, - // marbleStairs when loading an old (1.5.4) save - else if (m.type == Type.BLOCK) { - final Block block = BlockNameConversion.findBlock(m.name); + // Fix mapping of snakestoneSand, snakestoneStone, limestoneStairs, + // marbleStairs when loading an old (1.5.4) save + else if (m.type == Type.BLOCK) { + final Block block = BlockNameConversion.findBlock(m.name); - if (block != null) { - m.remap(block); - FMLLog.getLogger().info("Remapping block " + m.name + " to " + General.getName(block)); - } else - FMLLog.getLogger().warn("Block " + m.name + " could not get remapped."); - } else if (m.type == Type.ITEM) { - final Item item = BlockNameConversion.findItem(m.name); + if (block != null) { + m.remap(block); + FMLLog.getLogger().info("Remapping block " + m.name + " to " + General.getName(block)); + } else FMLLog.getLogger().warn("Block " + m.name + " could not get remapped."); + } else if (m.type == Type.ITEM) { + final Item item = BlockNameConversion.findItem(m.name); - if (item != null) { - m.remap(item); - FMLLog.getLogger().info("Remapping item " + m.name + " to " + General.getName(item)); + if (item != null) { + m.remap(item); + FMLLog.getLogger().info("Remapping item " + m.name + " to " + General.getName(item)); - } else - FMLLog.getLogger().warn("Item " + m.name + " could not get remapped."); - } - } - } + } else FMLLog.getLogger().warn("Item " + m.name + " could not get remapped."); + } + } + } - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - FMLCommonHandler.instance().registerCrashCallable(new ChiselCrashCallable()); - - File configFile = event.getSuggestedConfigurationFile(); - Configurations.configExists = configFile.exists(); - Configurations.config = new Configuration(configFile); - Configurations.config.load(); - Configurations.refreshConfig(); + @EventHandler + public void preInit(FMLPreInitializationEvent event) { + FMLCommonHandler.instance().registerCrashCallable(new ChiselCrashCallable()); + + File configFile = event.getSuggestedConfigurationFile(); + Configurations.configExists = configFile.exists(); + Configurations.config = new Configuration(configFile); + Configurations.config.load(); + Configurations.refreshConfig(); if (Loader.isModLoaded("dreamcraft")) { gtnhLoaded = true; } - TabsInit.preInit(); - Features.preInit(); - Statistics.init(); - PacketHandler.init(); - ChiselController.INSTANCE.preInit(); - if (Loader.isModLoaded("ForgeMultipart")) { - new FMPCompat().init(); - } - proxy.preInit(); - } + TabsInit.preInit(); + Features.preInit(); + Statistics.init(); + PacketHandler.init(); + ChiselController.INSTANCE.preInit(); + if (Loader.isModLoaded("ForgeMultipart")) { + new FMPCompat().init(); + } + proxy.preInit(); + } - @EventHandler - public void init(FMLInitializationEvent event) { - Features.init(); + @EventHandler + public void init(FMLInitializationEvent event) { + Features.init(); - NetworkRegistry.INSTANCE.registerGuiHandler(this, new ChiselGuiHandler()); + NetworkRegistry.INSTANCE.registerGuiHandler(this, new ChiselGuiHandler()); - addWorldgen(Features.MARBLE, ChiselBlocks.marble, Configurations.marbleAmount); - addWorldgen(Features.LIMESTONE, ChiselBlocks.limestone, Configurations.limestoneAmount); - addWorldgen(Features.ANDESITE, ChiselBlocks.andesite, Configurations.andesiteAmount, 40, 100, 0.5); - addWorldgen(Features.GRANITE, ChiselBlocks.granite, Configurations.graniteAmount, 40, 100, 0.5); - addWorldgen(Features.DIORITE, ChiselBlocks.diorite, Configurations.dioriteAmount, 40, 100, 0.5); - GameRegistry.registerWorldGenerator(GeneratorChisel.INSTANCE, 1000); + addWorldgen(Features.MARBLE, ChiselBlocks.marble, Configurations.marbleAmount); + addWorldgen(Features.LIMESTONE, ChiselBlocks.limestone, Configurations.limestoneAmount); + addWorldgen(Features.ANDESITE, ChiselBlocks.andesite, Configurations.andesiteAmount, 40, 100, 0.5); + addWorldgen(Features.GRANITE, ChiselBlocks.granite, Configurations.graniteAmount, 40, 100, 0.5); + addWorldgen(Features.DIORITE, ChiselBlocks.diorite, Configurations.dioriteAmount, 40, 100, 0.5); + GameRegistry.registerWorldGenerator(GeneratorChisel.INSTANCE, 1000); - EntityRegistry.registerModEntity(EntityChiselSnowman.class, "snowman", 0, this, 80, 1, true); + EntityRegistry.registerModEntity(EntityChiselSnowman.class, "snowman", 0, this, 80, 1, true); - proxy.init(); - MinecraftForge.EVENT_BUS.register(this); - FMLCommonHandler.instance().bus().register(instance); + proxy.init(); + MinecraftForge.EVENT_BUS.register(this); + FMLCommonHandler.instance().bus().register(instance); - FMLInterModComms.sendMessage("Waila", "register", "team.chisel.compat.WailaCompat.register"); - } + FMLInterModComms.sendMessage("Waila", "register", "team.chisel.compat.WailaCompat.register"); + } - private void addWorldgen(Features feature, Block block, double... data) { - if (feature.enabled()) { - if (data.length == 1) { - GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0]); - } else if (data.length > 1 && data.length < 4) { - GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0], (int) data[1], (int) data[2]); - } else if (data.length == 4) { - GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0], (int) data[1], (int) data[2], data[3]); - } - } - } + private void addWorldgen(Features feature, Block block, double... data) { + if (feature.enabled()) { + if (data.length == 1) { + GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0]); + } else if (data.length > 1 && data.length < 4) { + GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0], (int) data[1], (int) data[2]); + } else if (data.length == 4) { + GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0], (int) data[1], (int) data[2], data[3]); + } + } + } - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - TabsInit.postInit(); - Compatibility.init(event); - } + @EventHandler + public void postInit(FMLPostInitializationEvent event) { + TabsInit.postInit(); + Compatibility.init(event); + } - @EventHandler - public void onIMC(IMCEvent event) { - for (IMCMessage msg : event.getMessages()) { - IMCHandler.INSTANCE.handleMessage(msg); - } - } + @EventHandler + public void onIMC(IMCEvent event) { + for (IMCMessage msg : event.getMessages()) { + IMCHandler.INSTANCE.handleMessage(msg); + } + } - @SubscribeEvent - public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) { - if (event.modID.equals("chisel")) { - Configurations.refreshConfig(); - } - } + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) { + if (event.modID.equals("chisel")) { + Configurations.refreshConfig(); + } + } } diff --git a/src/main/java/team/chisel/ChiselCrashCallable.java b/src/main/java/team/chisel/ChiselCrashCallable.java index 510dd2ef..805d9e26 100644 --- a/src/main/java/team/chisel/ChiselCrashCallable.java +++ b/src/main/java/team/chisel/ChiselCrashCallable.java @@ -4,14 +4,14 @@ import cpw.mods.fml.common.ICrashCallable; public class ChiselCrashCallable implements ICrashCallable { - @Override - public String call() throws Exception { - return "Errors like \"[FML]: Unable to lookup ...\" are NOT the cause of this crash. " - + "You can safely ignore these errors. And update forge while you're at it."; - } + @Override + public String call() throws Exception { + return "Errors like \"[FML]: Unable to lookup ...\" are NOT the cause of this crash. " + + "You can safely ignore these errors. And update forge while you're at it."; + } - @Override - public String getLabel() { - return Chisel.MOD_NAME; - } + @Override + public String getLabel() { + return Chisel.MOD_NAME; + } } diff --git a/src/main/java/team/chisel/Features.java b/src/main/java/team/chisel/Features.java index f5d2bc86..b5c39a30 100644 --- a/src/main/java/team/chisel/Features.java +++ b/src/main/java/team/chisel/Features.java @@ -1,7 +1,24 @@ package team.chisel; +import static team.chisel.init.ChiselBlocks.*; +import static team.chisel.utils.General.*; + import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; + import team.chisel.block.*; import team.chisel.carving.Carving; import team.chisel.client.render.SubmapManagerAntiblock; @@ -18,7 +35,6 @@ import team.chisel.entity.EntityCloudInABottle; import team.chisel.entity.EntitySmashingRock; import team.chisel.init.ChiselBlocks; import team.chisel.init.ChiselItems; -import com.cricketcraft.chisel.api.ChiselTabs; import team.chisel.item.ItemBallOMoss; import team.chisel.item.ItemBlockPresent; import team.chisel.item.ItemCarvable; @@ -28,3085 +44,3911 @@ import team.chisel.item.ItemCloudInABottle; import team.chisel.item.ItemSmashingRock; import team.chisel.item.ItemUpgrade; import team.chisel.item.chisel.ItemChisel; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemDye; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; +import com.cricketcraft.chisel.api.ChiselTabs; import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.CarvingUtils.SimpleCarvingGroup; import com.cricketcraft.chisel.api.carving.ICarvingVariation; import com.cricketcraft.chisel.api.carving.IVariationInfo; -import com.cricketcraft.chisel.api.carving.CarvingUtils.SimpleCarvingGroup; import com.cricketcraft.chisel.api.rendering.TextureType; import com.google.common.collect.Lists; -import static team.chisel.init.ChiselBlocks.*; -import static team.chisel.utils.General.*; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; public enum Features { - AE_CERTUS_QUARTZ("appliedenergistics2") { - - private Block blockCheck; - private boolean blockChecked; - - @Override - void addBlocks() { - Carving.chisel.addVariation("AECertusQuartz", GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartz"), 0, 0); - Carving.chisel.addVariation("AECertusQuartz", GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartzPillar"), 0, 1); - Carving.chisel.addVariation("AECertusQuartz", GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartzChiseled"), 0, 2); - Carving.chisel.registerOre("AECertusQuartz", "AECertusQuartz"); - } - - @Override - public boolean enabled() { - if (!blockChecked) { - blockCheck = GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartz"); - blockChecked = true; - } - return super.enabled() && blockCheck != null; - } - }, - - AE_SKY_STONE("appliedenergistics2") { - - @Override - void addBlocks() { - Carving.chisel.addVariation("AESkyStone", GameRegistry.findBlock("appliedenergistics2", "tile.BlockSkyStone"), 1, 0); - Carving.chisel.addVariation("AESkyStone", GameRegistry.findBlock("appliedenergistics2", "tile.BlockSkyStone"), 2, 1); - Carving.chisel.addVariation("AESkyStone", GameRegistry.findBlock("appliedenergistics2", "tile.BlockSkyStone"), 3, 2); - Carving.chisel.registerOre("AESkyStone", "AESkyStone"); - } - }, - - ALUMINUM { - - @Override - void addBlocks() { - BlockCarvable aluminum = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) - .setResistance(10F); - aluminum.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/aluminum/caution", 20); - aluminum.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/aluminum/crate", 21); - aluminum.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/aluminum/thermal", 22); - aluminum.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/aluminum/adv", 23); - aluminum.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/aluminum/egregious", 24); - aluminum.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/aluminum/bolted", 25); - aluminum.carverHelper.registerAll(aluminum, "aluminumblock"); - Carving.chisel.registerOre("aluminumblock", "blockAluminum"); - - CarvableStairsMaker aluminumStairs = new CarvableStairsMaker(aluminum); - - aluminumStairs.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/aluminum/caution"); - aluminumStairs.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/aluminum/crate"); - aluminumStairs.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/aluminum/thermal"); - aluminumStairs.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/aluminum/adv"); - aluminumStairs.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/aluminum/egregious"); - aluminumStairs.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/aluminum/bolted"); - aluminumStairs.create("aluminum_stairs", ChiselBlocks.aluminumStairs); - Carving.chisel.registerOre("aluminum_stairs", "aluminum_stairs"); - } - }, - - AMBER("Thaumcraft") { - - @Override - void addBlocks() { - BlockCarvable amber = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("amber", GameRegistry.findBlock("Thaumcraft", "blockCosmeticOpaque"), 0, 0); - Carving.chisel.addVariation("amber", GameRegistry.findBlock("Thaumcraft", "blockCosmeticOpaque"), 1, 1); - amber.carverHelper.registerAll(amber, "amber"); - Carving.chisel.registerOre("amber", "amber"); - } - }, - - ANDESITE { - - @Override - void addBlocks() { - BlockCarvable andesite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); - andesite.carverHelper.addVariation(Configurations.imTooGoodForDescriptions ? "" : "tile.andesite.0.desc", 0, "andesite/andesite"); - andesite.carverHelper.addVariation("tile.andesite.1.desc", 1, "andesite/andesitePolished"); - andesite.carverHelper.addVariation("tile.andesite.2.desc", 2, "andesite/andesitePillar"); - andesite.carverHelper.addVariation("tile.andesite.3.desc", 3, "andesite/andesiteLBrick"); - andesite.carverHelper.addVariation("tile.andesite.4.desc", 4, "andesite/andesiteOrnate"); - andesite.carverHelper.addVariation("tile.andesite.5.desc", 5, "andesite/andesitePrism"); - andesite.carverHelper.addVariation("tile.andesite.6.desc", 6, "andesite/andesiteTiles"); - andesite.carverHelper.registerAll(andesite, "andesite"); - andesite.carverHelper.registerOre("blockAndesite"); - andesite.carverHelper.registerOre("stoneAndesite"); - } - - @Override - void addRecipes() { - if (DIORITE.enabled()) { - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(andesite, 2), diorite, "cobblestone")); - } - } - }, - - ANTIBLOCK { - - @Override - void addBlocks() { - BlockCarvable antiBlock = (BlockCarvable) new BlockCarvableAntiBlock().setCreativeTab(ChiselTabs.tabOtherChiselBlocks); - - if (!Configurations.allowChiselCrossColors) { - antiBlock.carverHelper.forbidChiseling = true; - } - - for (int i = 0; i < 16; i++) { - antiBlock.carverHelper.addVariation("tile.antiBlock." + ItemDye.field_150921_b[i] + ".desc", i, new SubmapManagerAntiblock(ItemDye.field_150921_b[i])); - } - - antiBlock.carverHelper.registerAll(antiBlock, "antiBlock"); - OreDictionary.registerOre("antiBlock", antiBlock); - } - - @Override - void addRecipes() { - if (meta == 0) { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.antiBlock, 8, 15), "SSS", "SGS", "SSS", 'S', "stone", 'G', "dustGlowstone")); - } - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.antiBlock, 8, meta), "BBB", "BdB", "BBB", 'd', dyeOres[meta], 'B', new ItemStack(ChiselBlocks.antiBlock, 1, - OreDictionary.WILDCARD_VALUE))); - } - - @Override - boolean needsMetaRecipes() { - return true; - } - }, - - ARCANE("Thaumcraft") { - - @Override - void addBlocks() { - BlockCarvable arcane = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("arcane", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 6, -5); - // Carving.chisel.addVariation("arcane", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 7, -4); - arcane.carverHelper.addVariation("tile.arcane.0.desc", 0, "arcane/moonEngrave"); - arcane.carverHelper.addVariation("tile.arcane.1.desc", 1, "arcane/moonGlowAnim"); - arcane.carverHelper.addVariation("tile.arcane.2.desc", 2, "arcane/arcaneTile"); - arcane.carverHelper.addVariation("tile.arcane.3.desc", 3, "arcane/runes"); - arcane.carverHelper.addVariation("tile.arcane.4.desc", 4, "arcane/runesGlow"); - arcane.carverHelper.addVariation("tile.arcane.5.desc", 5, "arcane/bigBrick"); - arcane.carverHelper.addVariation("tile.arcane.6.desc", 6, "arcane/conduitGlowAnim"); - arcane.carverHelper.addVariation("tile.arcane.7.desc", 7, "arcane/BorderBrain"); - arcane.carverHelper.addVariation("tile.arcane.8.desc", 8, "arcane/ArcaneBorder"); - arcane.carverHelper.addVariation("tile.arcane.9.desc", 9, "arcane/arcaneMatrix"); - arcane.carverHelper.addVariation("tile.arcane.10.desc", 10, "arcane/thaumcraftLogo"); - arcane.carverHelper.addVariation("tile.arcane.11.desc", 11, "arcane/arcaneCrackAnim"); - arcane.carverHelper.registerAll(arcane, "arcane"); - Carving.chisel.registerOre("arcane", "arcane"); - } - }, - - AUTO_CHISEL { - - @Override - void addBlocks() { - Block autoChisel = new BlockAutoChisel().setBlockTextureName(Chisel.MOD_ID + ":autoChisel/autoChisel").setCreativeTab(ChiselTabs.tabChisel).setBlockName("chisel.autoChisel"); - GameRegistry.registerBlock(autoChisel, "autoChisel"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.autoChisel, 1), new Object[] { "XXX", " Y ", "YYY", Character.valueOf('X'), Blocks.stone_slab, - Character.valueOf('Y'), "ingotIron" })); - } - }, - - AUTO_CHISEL_UPGRADES(AUTO_CHISEL) { - - @Override - void addItems() { - ItemUpgrade upgrade = (ItemUpgrade) new ItemUpgrade("upgrade").setCreativeTab(ChiselTabs.tabChisel); - GameRegistry.registerItem(upgrade, "upgrade"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.upgrade, 1, 0), new Object[] { "IEI", "EUE", "RRR", 'I', "ingotIron", 'E', Items.emerald, 'R', Items.redstone, 'U', - Items.sugar })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.upgrade, 1, 1), new Object[] { "IEI", "EUE", "RRR", 'I', "ingotIron", 'E', Items.emerald, 'R', Items.redstone, 'U', - Blocks.hopper })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.upgrade, 1, 2), new Object[] { "IEI", "EUE", "RRR", 'I', "ingotIron", 'E', Items.emerald, 'R', Items.redstone, 'U', - Blocks.crafting_table })); - } - }, - - BALL_OF_MOSS { - - @Override - void addItems() { - ItemBallOMoss ballomoss = (ItemBallOMoss) new ItemBallOMoss().setTextureName("Chisel:ballomoss").setCreativeTab(ChiselTabs.tabChisel); - EntityRegistry.registerModEntity(EntityBallOMoss.class, "BallOMoss", 2, Chisel.instance, 40, 1, true); - GameRegistry.registerItem(ballomoss, "ballomoss"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselItems.ballomoss, 1), "XYX", "YXY", "XYX", 'X', Blocks.vine, 'Y', Items.stick); - } - }, - - BEACON { - - @Override - void addBlocks() { - BlockCarvableBeacon beacon = (BlockCarvableBeacon) new BlockCarvableBeacon().setCreativeTab(ChiselTabs.tabOtherChiselBlocks); - Carving.chisel.addVariation("beacon", Blocks.beacon, 0, 0); - for (int meta = 0; meta < 16; meta++) { - beacon.carverHelper.addVariation("tile.beacon." + ItemDye.field_150923_a[meta] + ".desc", meta, "beacon", (meta + 1)); - } - beacon.carverHelper.registerAll(beacon, "beacon"); - Carving.chisel.registerOre("beacon", "beacon"); - } - }, - - BLOOD_RUNE("AWWayofTime") { - - @Override - void addBlocks() { - BlockCarvable bloodRune = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("bloodRune", GameRegistry.findBlock("AWWayofTime", "AlchemicalWizardrybloodRune"), 0, 0); - bloodRune.carverHelper.addVariation("tile.bloodRune.0.desc", 0, "bloodMagic/bloodRuneArranged"); - bloodRune.carverHelper.addVariation("tile.bloodRune.1.desc", 1, "bloodMagic/bloodRuneBricks"); - bloodRune.carverHelper.addVariation("tile.bloodRune.2.desc", 2, "bloodMagic/bloodRuneCarved"); - bloodRune.carverHelper.addVariation("tile.bloodRune.3.desc", 3, "bloodMagic/bloodRuneCarvedRadial"); - bloodRune.carverHelper.addVariation("tile.bloodRune.4.desc", 4, "bloodMagic/bloodRuneClassicPanel"); - bloodRune.carverHelper.addVariation("tile.bloodRune.5.desc", 5, "bloodMagic/bloodRuneTiles"); - bloodRune.carverHelper.registerAll(bloodRune, "bloodRune"); - Carving.chisel.registerOre("bloodRune", "bloodRune"); - } - }, - - BLOOD_BLOCK("AWWayofTime") { - - @Override - void addBlocks() { - BlockCarvable bloodBrick = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("bloodBrick", GameRegistry.findBlock("AWWayofTime", "largeBloodStoneBrick"), 0, 0); - Carving.chisel.addVariation("bloodBrick", GameRegistry.findBlock("AWWayofTime", "bloodStoneBrick"), 0, 1); - bloodBrick.carverHelper.registerAll(bloodBrick, "bloodBrick"); - Carving.chisel.registerOre("bloodBrick", "bloodBrick"); - } - }, - - BOOKSHELF { - - @Override - void addBlocks() { - BlockCarvable bookshelf = (BlockCarvable) new BlockCarvableBookshelf().setHardness(1.5F).setCreativeTab(ChiselTabs.tabWoodChiselBlocks).setStepSound(Block.soundTypeWood); - Carving.chisel.addVariation("bookshelf", Blocks.bookshelf, 0, 0); - bookshelf.carverHelper.addVariation("tile.bookshelf.1.desc", 1, "bookshelf/rainbow"); - bookshelf.carverHelper.addVariation("tile.bookshelf.2.desc", 2, "bookshelf/necromancer-novice"); - bookshelf.carverHelper.addVariation("tile.bookshelf.3.desc", 3, "bookshelf/necromancer"); - bookshelf.carverHelper.addVariation("tile.bookshelf.4.desc", 4, "bookshelf/redtomes"); - bookshelf.carverHelper.addVariation("tile.bookshelf.5.desc", 5, "bookshelf/abandoned"); - bookshelf.carverHelper.addVariation("tile.bookshelf.6.desc", 6, "bookshelf/hoarder"); - bookshelf.carverHelper.addVariation("tile.bookshelf.7.desc", 7, "bookshelf/brim"); - bookshelf.carverHelper.addVariation("tile.bookshelf.8.desc", 8, "bookshelf/historician"); - bookshelf.carverHelper.registerAll(bookshelf, "bookshelf"); - bookshelf.setHarvestLevel("axe", 0); - Carving.chisel.registerOre("bookshelf", "bookshelf"); - Blocks.fire.setFireInfo(bookshelf, 5, 20); - } - }, - - BRICK_CUSTOM { - - @Override - void addBlocks() { - BlockCarvable brickCustom = (BlockCarvable) new BlockCarvable(Material.rock).setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); - Carving.chisel.addVariation("brickCustom", Blocks.brick_block, 0, 0); - brickCustom.carverHelper.addVariation("tile.brickCustom.1.desc", 1, "brickCustom/large"); - brickCustom.carverHelper.addVariation("tile.brickCustom.2.desc", 2, "brickCustom/mortarless"); - brickCustom.carverHelper.addVariation("tile.brickCustom.3.desc", 3, "brickCustom/varied"); - // brickCustom.carverHelper.addVariation("tile.brickCustom.4.desc", - // 4, "brickCustom/cracked"); - brickCustom.carverHelper.addVariation("tile.brickCustom.5.desc", 5, "brickCustom/aged"); - brickCustom.carverHelper.addVariation("tile.brickCustom.6.desc", 6, "brickCustom/yellow"); - brickCustom.carverHelper.registerAll(brickCustom, "brickCustom"); - Carving.chisel.registerOre("brickCustom", "brickCustom"); - } - }, - - BRONZE { - - @Override - void addBlocks() { - BlockCarvable bronze = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) - .setResistance(10F); - bronze.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/bronze/caution", 20); - bronze.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/bronze/crate", 21); - bronze.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/bronze/thermal", 22); - bronze.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/bronze/adv", 23); - bronze.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/bronze/egregious", 24); - bronze.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/bronze/bolted", 25); - bronze.carverHelper.registerAll(bronze, "bronzeblock"); - Carving.chisel.registerOre("bronzeblock", "blockBronze"); - } - }, - - CARPET { - - @Override - void addBlocks() { - BlockCarvable carpet_block = (BlockCarvable) new BlockCarvable(Material.cloth).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(2.0F).setResistance(10F) - .setStepSound(Block.soundTypeCloth); - - carpet_block.carverHelper.addVariation("tile.carpet_block.0.desc", 0, "carpet/white"); - carpet_block.carverHelper.addVariation("tile.carpet_block.1.desc", 1, "carpet/orange"); - carpet_block.carverHelper.addVariation("tile.carpet_block.2.desc", 2, "carpet/lily"); - carpet_block.carverHelper.addVariation("tile.carpet_block.3.desc", 3, "carpet/lightblue"); - carpet_block.carverHelper.addVariation("tile.carpet_block.4.desc", 4, "carpet/yellow"); - carpet_block.carverHelper.addVariation("tile.carpet_block.5.desc", 5, "carpet/lightgreen"); - carpet_block.carverHelper.addVariation("tile.carpet_block.6.desc", 6, "carpet/pink"); - carpet_block.carverHelper.addVariation("tile.carpet_block.7.desc", 7, "carpet/darkgrey"); - carpet_block.carverHelper.addVariation("tile.carpet_block.8.desc", 8, "carpet/grey"); - carpet_block.carverHelper.addVariation("tile.carpet_block.9.desc", 9, "carpet/teal"); - carpet_block.carverHelper.addVariation("tile.carpet_block.10.desc", 10, "carpet/purple"); - carpet_block.carverHelper.addVariation("tile.carpet_block.11.desc", 11, "carpet/darkblue"); - carpet_block.carverHelper.addVariation("tile.carpet_block.12.desc", 12, "carpet/brown"); - carpet_block.carverHelper.addVariation("tile.carpet_block.13.desc", 13, "carpet/green"); - carpet_block.carverHelper.addVariation("tile.carpet_block.14.desc", 14, "carpet/red"); - carpet_block.carverHelper.addVariation("tile.carpet_block.15.desc", 15, "carpet/black"); - if (!Configurations.allowChiselCrossColors) { - carpet_block.carverHelper.forbidChiseling = true; - } - carpet_block.carverHelper.registerAll(carpet_block, "carpet_block"); - OreDictionary.registerOre("blockCarpet", carpet_block); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.carpet_block, 8, meta), "YYY", "YXY", "YYY", 'X', new ItemStack(Items.string, 1), 'Y', new ItemStack(Blocks.wool, 1, meta)); - } - - @Override - boolean needsMetaRecipes() { - return true; - } - }, - - CARPET_FLOOR { - - @Override - void addBlocks() { - BlockCarvableCarpet carpet = (BlockCarvableCarpet) new BlockCarvableCarpet(Material.cloth).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.1F) - .setStepSound(Block.soundTypeCloth).setLightOpacity(0).setStepSound(Block.soundTypeCloth); - - carpet.carverHelper.addVariation("tile.carpet.0.desc", 0, new SubmapManagerCarpetFloor("white")); - carpet.carverHelper.addVariation("tile.carpet.1.desc", 1, new SubmapManagerCarpetFloor("orange")); - carpet.carverHelper.addVariation("tile.carpet.2.desc", 2, new SubmapManagerCarpetFloor("lily")); - carpet.carverHelper.addVariation("tile.carpet.3.desc", 3, new SubmapManagerCarpetFloor("lightblue")); - carpet.carverHelper.addVariation("tile.carpet.4.desc", 4, new SubmapManagerCarpetFloor("yellow")); - carpet.carverHelper.addVariation("tile.carpet.5.desc", 5, new SubmapManagerCarpetFloor("lightgreen")); - carpet.carverHelper.addVariation("tile.carpet.6.desc", 6, new SubmapManagerCarpetFloor("pink")); - carpet.carverHelper.addVariation("tile.carpet.7.desc", 7, new SubmapManagerCarpetFloor("darkgrey")); - carpet.carverHelper.addVariation("tile.carpet.8.desc", 8, new SubmapManagerCarpetFloor("grey")); - carpet.carverHelper.addVariation("tile.carpet.9.desc", 9, new SubmapManagerCarpetFloor("teal")); - carpet.carverHelper.addVariation("tile.carpet.10.desc", 10, new SubmapManagerCarpetFloor("purple")); - carpet.carverHelper.addVariation("tile.carpet.11.desc", 11, new SubmapManagerCarpetFloor("darkblue")); - carpet.carverHelper.addVariation("tile.carpet.12.desc", 12, new SubmapManagerCarpetFloor("brown")); - carpet.carverHelper.addVariation("tile.carpet.13.desc", 13, new SubmapManagerCarpetFloor("green")); - carpet.carverHelper.addVariation("tile.carpet.14.desc", 14, new SubmapManagerCarpetFloor("red")); - carpet.carverHelper.addVariation("tile.carpet.15.desc", 15, new SubmapManagerCarpetFloor("black")); - if (!Configurations.allowChiselCrossColors) { - carpet.carverHelper.forbidChiseling = true; - } - carpet.carverHelper.registerAll(carpet, "carpet"); - - // for (int i = 0; i < 16; i++) { - // String group = "carpet." + i; - - // TODO needle stuff - // Carving.needle.addVariation(group, Blocks.carpet, i, 0); - // Carving.needle.addVariation(group, carpet, i, 2); - // Carving.needle.addVariation(group, carpet_block, i, 1); - // } - - OreDictionary.registerOre("carpet", carpet); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.carpet, 3, meta), "XX", 'X', new ItemStack(ChiselBlocks.carpet_block, 1, meta)); - } - - @Override - boolean needsMetaRecipes() { - return true; - } - }, - - CHISEL { - - @Override - void addItems() { - ItemChisel chisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.IRON).setCreativeTab(ChiselTabs.tabChisel); - ItemChisel diamondChisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.DIAMOND).setCreativeTab(ChiselTabs.tabChisel); - ItemChisel obsidianChisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.OBSIDIAN).setCreativeTab(ChiselTabs.tabChisel); - ItemChisel netherStarChisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.NETHERSTAR).setCreativeTab(ChiselTabs.tabChisel); - GameRegistry.registerItem(chisel, "chisel"); - GameRegistry.registerItem(diamondChisel, "diamondChisel"); - GameRegistry.registerItem(obsidianChisel, "obsidianChisel"); - GameRegistry.registerItem(netherStarChisel, "netherStarChisel"); - } - - @Override - void addRecipes() { - if (Configurations.chiselRecipe) { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.chisel), " YY", " YY", "X ", 'X', "stickWood", 'Y', "ingotIron")); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.diamondChisel), " YY", " YY", "x ", 'x', "stickWood", 'Y', "gemDiamond")); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.obsidianChisel), " YY", " YY", "x ", 'x', "stickWood", 'Y', Blocks.obsidian)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.netherStarChisel), " YY", " YY", "x ", 'x', "stickWood", 'Y', "netherStar")); - } else { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.chisel), " Y", "X ", 'X', "stickWood", 'Y', "ingotIron")); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.diamondChisel), " Y", "X ", 'X', "stickWood", 'Y', "gemDiamond")); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.obsidianChisel), " Y", "X ", 'X', "stickWood", 'Y', Blocks.obsidian)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.netherStarChisel), " YY", " YY", "x ", 'x', "stickWood", 'Y', "netherStar")); - } - } - }, - - CLOUD { - - @Override - void addBlocks() { - BlockCarvable cloud = (BlockCloud) new BlockCloud().setHardness(0.2F).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setLightOpacity(3).setStepSound(Block.soundTypeCloth); - cloud.carverHelper.addVariation("tile.cloud.0.desc", 0, "cloud/cloud"); - cloud.carverHelper.addVariation("tile.cloud.1.desc", 1, "cloud/large"); - cloud.carverHelper.addVariation("tile.cloud.2.desc", 2, "cloud/small"); - cloud.carverHelper.addVariation("tile.cloud.3.desc", 3, "cloud/vertical"); - cloud.carverHelper.addVariation("tile.cloud.4.desc", 4, "cloud/grid"); - cloud.carverHelper.registerAll(cloud, "cloud"); - OreDictionary.registerOre("cloud", cloud); - Carving.chisel.registerOre("cloud", "cloud"); - } - - @Override - void addItems() { - ItemCloudInABottle itemCloudInABottle = (ItemCloudInABottle) new ItemCloudInABottle().setTextureName("Chisel:cloudinabottle-x").setCreativeTab(ChiselTabs.tabChisel); - EntityRegistry.registerModEntity(EntityCloudInABottle.class, "CloudInABottle", 1, Chisel.instance, 40, 1, true); - GameRegistry.registerItem(itemCloudInABottle, "cloudinabottle"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselItems.cloudinabottle, 1), "X X", "XYX", " X ", 'X', Blocks.glass, 'Y', Items.quartz); - } - }, - - COBBLESTONE { - - @Override - void addBlocks() { - BlockCarvable cobblestone = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) - .setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("cobblestone", Blocks.cobblestone, 0, 0); - cobblestone.carverHelper.addVariation("tile.cobblestone.0.desc", 1, "cobblestone/terrain-cobb-brickaligned"); - cobblestone.carverHelper.addVariation("tile.cobblestone.1.desc", 2, "cobblestone/terrain-cob-detailedbrick"); - cobblestone.carverHelper.addVariation("tile.cobblestone.2.desc", 3, "cobblestone/terrain-cob-smallbrick"); - cobblestone.carverHelper.addVariation("tile.cobblestone.3.desc", 4, "cobblestone/terrain-cobblargetiledark"); - cobblestone.carverHelper.addVariation("tile.cobblestone.4.desc", 5, "cobblestone/terrain-cobbsmalltile"); - cobblestone.carverHelper.addVariation("tile.cobblestone.5.desc", 6, "cobblestone/terrain-cob-french"); - cobblestone.carverHelper.addVariation("tile.cobblestone.6.desc", 7, "cobblestone/terrain-cob-french2"); - cobblestone.carverHelper.addVariation("tile.cobblestone.7.desc", 8, "cobblestone/terrain-cobmoss-creepdungeon"); - cobblestone.carverHelper.addVariation("tile.cobblestone.8.desc", 9, "cobblestone/terrain-mossysmalltiledark"); - cobblestone.carverHelper.addVariation("tile.cobblestone.9.desc", 10, "cobblestone/terrain-pistonback-dungeontile"); - cobblestone.carverHelper.addVariation("tile.cobblestone.10.desc", 11, "cobblestone/terrain-pistonback-darkcreeper"); - cobblestone.carverHelper.addVariation("tile.cobblestone.11.desc", 12, "cobblestone/terrain-pistonback-darkdent"); - cobblestone.carverHelper.addVariation("tile.cobblestone.12.desc", 13, "cobblestone/terrain-pistonback-darkemboss"); - cobblestone.carverHelper.addVariation("tile.cobblestone.13.desc", 14, "cobblestone/terrain-pistonback-darkmarker"); - cobblestone.carverHelper.addVariation("tile.cobblestone.14.desc", 15, "cobblestone/terrain-pistonback-darkpanel"); - cobblestone.carverHelper.registerAll(cobblestone, "cobblestone"); - Carving.chisel.registerOre("cobblestone", "cobblestone"); - } - }, - - COBBLESTONE_MOSSY { - - @Override - void addBlocks() { - - BlockCarvable mossy_cobblestone = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10.0F) - .setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("mossy_cobblestone", Blocks.mossy_cobblestone, 0, 0); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.1.desc", 1, "cobblestonemossy/terrain-cobb-brickaligned"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.2.desc", 2, "cobblestonemossy/terrain-cob-detailedbrick"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.3.desc", 3, "cobblestonemossy/terrain-cob-smallbrick"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.4.desc", 4, "cobblestonemossy/terrain-cobblargetiledark"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.5.desc", 5, "cobblestonemossy/terrain-cobbsmalltile"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.6.desc", 6, "cobblestonemossy/terrain-cob-french"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.7.desc", 7, "cobblestonemossy/terrain-cob-french2"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.8.desc", 8, "cobblestonemossy/terrain-cobmoss-creepdungeon"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.9.desc", 9, "cobblestonemossy/terrain-mossysmalltiledark"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.10.desc", 10, "cobblestonemossy/terrain-pistonback-dungeontile"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.11.desc", 11, "cobblestonemossy/terrain-pistonback-darkcreeper"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.12.desc", 12, "cobblestonemossy/terrain-pistonback-darkdent"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.13.desc", 13, "cobblestonemossy/terrain-pistonback-darkemboss"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.14.desc", 14, "cobblestonemossy/terrain-pistonback-darkmarker"); - mossy_cobblestone.carverHelper.addVariation("tile.stoneMoss.15.desc", 15, "cobblestonemossy/terrain-pistonback-darkpanel"); - mossy_cobblestone.carverHelper.registerAll(mossy_cobblestone, "mossy_cobblestone"); - Carving.chisel.registerOre("mossy_cobblestone", "mossy_cobblestone"); - } - }, - - CONCRETE { - - @Override - void addBlocks() { - BlockCarvable concrete = (BlockConcrete) new BlockConcrete().setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(0.5F); - concrete.carverHelper.addVariation("tile.concrete.0.desc", 0, "concrete/default"); - concrete.carverHelper.addVariation("tile.concrete.1.desc", 1, "concrete/block"); - concrete.carverHelper.addVariation("tile.concrete.2.desc", 2, "concrete/doubleslab"); - concrete.carverHelper.addVariation("tile.concrete.3.desc", 3, "concrete/blocks"); - concrete.carverHelper.addVariation("tile.concrete.4.desc", 4, "concrete/weathered"); - concrete.carverHelper.addVariation("tile.concrete.5.desc", 5, "concrete/weathered-block"); - concrete.carverHelper.addVariation("tile.concrete.6.desc", 6, "concrete/weathered-doubleslab"); - concrete.carverHelper.addVariation("tile.concrete.7.desc", 7, "concrete/weathered-blocks"); - concrete.carverHelper.addVariation("tile.concrete.8.desc", 8, "concrete/weathered-half"); - concrete.carverHelper.addVariation("tile.concrete.9.desc", 9, "concrete/weathered-block-half"); - concrete.carverHelper.addVariation("tile.concrete.10.desc", 10, "concrete/asphalt"); - concrete.carverHelper.registerAll(concrete, "concrete"); - OreDictionary.registerOre("concrete", concrete); - Carving.chisel.registerOre("concrete", "concrete"); - } - - @Override - void addRecipes() { - Block concreteRecipeBlock = Block.getBlockFromName(Configurations.config.get("tweaks", "concrete recipe block", "gravel", - "Unlocalized name of the block that, when burned, will produce concrete (examples: lightgem, stone)").getString()); - if (concreteRecipeBlock == null) - concreteRecipeBlock = Blocks.gravel; - - FurnaceRecipes.smelting().func_151393_a(concreteRecipeBlock, new ItemStack(ChiselBlocks.concrete), 0.1F); - } - }, - - COPPER { - - @Override - void addBlocks() { - BlockCarvable copper = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) - .setResistance(10F); - copper.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/copper/caution", 20); - copper.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/copper/crate", 21); - copper.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/copper/thermal", 22); - copper.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/copper/adv", 23); - copper.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/copper/egregious", 24); - copper.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/copper/bolted", 25); - copper.carverHelper.registerAll(copper, "copperblock"); - Carving.chisel.registerOre("copperblock", "blockCopper"); - } - }, - - DIAMOND_BLOCK { - - @Override - void addBlocks() { - - BlockCarvable diamond_block = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(5F).setResistance(10F).setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("diamond_block", Blocks.diamond_block, 0, 0); - diamond_block.carverHelper.addVariation("tile.diamond.1.desc", 1, "diamond/terrain-diamond-embossed"); - diamond_block.carverHelper.addVariation("tile.diamond.2.desc", 2, "diamond/terrain-diamond-gem"); - diamond_block.carverHelper.addVariation("tile.diamond.3.desc", 3, "diamond/terrain-diamond-cells"); - diamond_block.carverHelper.addVariation("tile.diamond.4.desc", 4, "diamond/terrain-diamond-space"); - diamond_block.carverHelper.addVariation("tile.diamond.5.desc", 5, "diamond/terrain-diamond-spaceblack"); - diamond_block.carverHelper.addVariation("tile.diamond.6.desc", 6, "diamond/terrain-diamond-simple"); - diamond_block.carverHelper.addVariation("tile.diamond.7.desc", 7, "diamond/terrain-diamond-bismuth"); - diamond_block.carverHelper.addVariation("tile.diamond.8.desc", 8, "diamond/terrain-diamond-crushed"); - diamond_block.carverHelper.addVariation("tile.diamond.9.desc", 9, "diamond/terrain-diamond-four"); - diamond_block.carverHelper.addVariation("tile.diamond.10.desc", 10, "diamond/terrain-diamond-fourornate"); - diamond_block.carverHelper.addVariation("tile.diamond.11.desc", 11, "diamond/terrain-diamond-zelda"); - diamond_block.carverHelper.addVariation("tile.diamond.12.desc", 12, "diamond/terrain-diamond-ornatelayer"); - diamond_block.carverHelper.registerAll(diamond_block, "diamond_block"); - Carving.chisel.registerOre("diamond_block", "blockDiamond"); - } - }, - - DIORITE { - - @Override - void addBlocks() { - BlockCarvable diorite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); - - diorite.carverHelper.addVariation(Configurations.imTooGoodForDescriptions ? "" : "tile.diorite.0.desc", 0, "diorite/diorite"); - diorite.carverHelper.addVariation("tile.diorite.1.desc", 1, "diorite/dioritePolished"); - diorite.carverHelper.addVariation("tile.diorite.2.desc", 2, "diorite/dioritePillar"); - diorite.carverHelper.addVariation("tile.diorite.3.desc", 3, "diorite/dioriteLBrick"); - diorite.carverHelper.addVariation("tile.diorite.4.desc", 4, "diorite/dioriteOrnate"); - diorite.carverHelper.addVariation("tile.diorite.5.desc", 5, "diorite/dioritePrism"); - diorite.carverHelper.addVariation("tile.diorite.6.desc", 6, "diorite/dioriteTiles"); - diorite.carverHelper.registerAll(diorite, "diorite"); - diorite.carverHelper.registerOre("blockDiorite"); - diorite.carverHelper.registerOre("stoneDiorite"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(diorite, 2), "cq", "qc", 'c', "cobblestone", 'q', "gemQuartz")); - } - }, - - DIRT { - - @Override - void addBlocks() { - BlockCarvable dirt = (BlockCarvable) new BlockCarvable(Material.ground).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setStepSound(Block.soundTypeGravel) - .setBlockName("dirt.default"); - Carving.chisel.addVariation("dirt", Blocks.dirt, 0, -1); - - // dirt.carverHelper.addVariation("Dirt", 0, Blocks.dirt); - dirt.carverHelper.addVariation("tile.dirt.0.desc", 0, "dirt/bricks"); - dirt.carverHelper.addVariation("tile.dirt.1.desc", 1, "dirt/netherbricks"); - dirt.carverHelper.addVariation("tile.dirt.2.desc", 2, "dirt/bricks3"); - dirt.carverHelper.addVariation("tile.dirt.3.desc", 3, "dirt/cobble"); - dirt.carverHelper.addVariation("tile.dirt.4.desc", 4, "dirt/reinforcedCobbleDirt"); - dirt.carverHelper.addVariation("tile.dirt.5.desc", 5, "dirt/reinforcedDirt"); - dirt.carverHelper.addVariation("tile.dirt.6.desc", 6, "dirt/happy"); - dirt.carverHelper.addVariation("tile.dirt.7.desc", 7, "dirt/bricks2"); - dirt.carverHelper.addVariation("tile.dirt.8.desc", 8, "dirt/bricks+dirt2"); - dirt.carverHelper.addVariation("tile.dirt.9.desc", 9, "dirt/hor"); - dirt.carverHelper.addVariation("tile.dirt.10.desc", 10, "dirt/vert"); - dirt.carverHelper.addVariation("tile.dirt.11.desc", 11, "dirt/layers"); - dirt.carverHelper.addVariation("tile.dirt.12.desc", 12, "dirt/vertical"); - dirt.carverHelper.addVariation("tile.dirt.13.desc", 13, "dirt/chunky"); - dirt.carverHelper.addVariation("tile.dirt.14.desc", 14, "dirt/horizontal"); - dirt.carverHelper.addVariation("tile.dirt.15.desc", 15, "dirt/plate"); - dirt.carverHelper.registerAll(dirt, "dirt"); - dirt.setHarvestLevel("shovel", 0); - OreDictionary.registerOre("dirt", dirt); - Carving.chisel.registerOre("dirt", "dirt"); - } - }, - - EMERALD_BLOCK { - - @Override - void addBlocks() { - BlockCarvable emerald_block = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(5.0F).setResistance(10.0F) - .setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("emerald_block", Blocks.emerald_block, 0, 0); - emerald_block.carverHelper.addVariation("tile.emerald.1.desc", 1, "emerald/panel"); - emerald_block.carverHelper.addVariation("tile.emerald.2.desc", 2, "emerald/panelclassic"); - emerald_block.carverHelper.addVariation("tile.emerald.3.desc", 3, "emerald/smooth"); - emerald_block.carverHelper.addVariation("tile.emerald.4.desc", 4, "emerald/chunk"); - emerald_block.carverHelper.addVariation("tile.emerald.5.desc", 5, "emerald/goldborder"); - emerald_block.carverHelper.addVariation("tile.emerald.6.desc", 6, "emerald/zelda"); - emerald_block.carverHelper.addVariation("tile.emerald.7.desc", 7, "emerald/cell"); - emerald_block.carverHelper.addVariation("tile.emerald.8.desc", 8, "emerald/cellbismuth"); - emerald_block.carverHelper.addVariation("tile.emerald.9.desc", 9, "emerald/four"); - emerald_block.carverHelper.addVariation("tile.emerald.10.desc", 10, "emerald/fourornate"); - emerald_block.carverHelper.addVariation("tile.emerald.11.desc", 11, "emerald/ornate"); - emerald_block.carverHelper.registerAll(emerald_block, "emerald_block"); - Carving.chisel.registerOre("emerald_block", "emerald"); - } - }, - - END_STONE { - - @Override - void addBlocks() { - BlockCarvable end_Stone = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); - Carving.chisel.addVariation("end_stone", Blocks.end_stone, 0, -1); - end_Stone.carverHelper.addVariation("tile.end_Stone.0.desc", 0, "endstone/end_bricks"); - end_Stone.carverHelper.addVariation("tile.end_Stone.1.desc", 1, "endstone/chaoticBricks"); - end_Stone.carverHelper.addVariation("tile.end_Stone.2.desc", 2, "endstone/CheckeredTile"); - end_Stone.carverHelper.addVariation("tile.end_Stone.3.desc", 3, "endstone/enderCircuit"); - end_Stone.carverHelper.addVariation("tile.end_Stone.4.desc", 4, "endstone/endFrenchBricks"); - end_Stone.carverHelper.addVariation("tile.end_Stone.5.desc", 5, "endstone/endPillar"); - end_Stone.carverHelper.addVariation("tile.end_Stone.6.desc", 6, "endstone/endStoneEtched"); - end_Stone.carverHelper.addVariation("tile.end_Stone.7.desc", 7, "endstone/prismaticEndStone"); - end_Stone.carverHelper.addVariation("tile.end_Stone.8.desc", 8, "endstone/endStoneChunk"); - end_Stone.carverHelper.addVariation("tile.end_Stone.9.desc", 9, "endstone/EnderFrame"); - end_Stone.carverHelper.addVariation("tile.end_Stone.10.desc", 10, "endstone/arcaneEndStone"); - end_Stone.carverHelper.addVariation("tile.end_Stone.11.desc", 11, "endstone/framedEndStone"); - end_Stone.carverHelper.addVariation("tile.end_Stone.12.desc", 12, "endstone/endStoneOrnate"); - end_Stone.carverHelper.addVariation("tile.end_Stone.13.desc", 13, "endstone/endStoneLargeTile"); - end_Stone.carverHelper.registerBlock(end_Stone, "end_Stone"); - end_Stone.carverHelper.registerVariations("end_stone"); - end_Stone.carverHelper.registerOre("blockEndstone"); - Carving.chisel.registerOre("end_stone", "blockEndstone"); - } - }, - - FACTORY { - - @Override - void addBlocks() { - BlockCarvable factoryblock = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F) - .setStepSound(Chisel.soundMetalFootstep); - - factoryblock.carverHelper.addVariation("tile.factory.0.desc", 0, "factory/dots"); - factoryblock.carverHelper.addVariation("tile.factory.1.desc", 1, "factory/rust2"); - factoryblock.carverHelper.addVariation("tile.factory.2.desc", 2, "factory/rust"); - factoryblock.carverHelper.addVariation("tile.factory.3.desc", 3, "factory/platex"); - factoryblock.carverHelper.addVariation("tile.factory.4.desc", 4, "factory/wireframewhite"); - factoryblock.carverHelper.addVariation("tile.factory.5.desc", 5, "factory/wireframe"); - factoryblock.carverHelper.addVariation("tile.factory.6.desc", 6, "factory/hazard"); - factoryblock.carverHelper.addVariation("tile.factory.7.desc", 7, "factory/hazardorange"); - factoryblock.carverHelper.addVariation("tile.factory.8.desc", 8, "factory/circuit"); - factoryblock.carverHelper.addVariation("tile.factory.9.desc", 9, "factory/metalbox"); - factoryblock.carverHelper.addVariation("tile.factory.10.desc", 10, "factory/goldplate"); - factoryblock.carverHelper.addVariation("tile.factory.11.desc", 11, "factory/goldplating"); - factoryblock.carverHelper.addVariation("tile.factory.12.desc", 12, "factory/grinder"); - factoryblock.carverHelper.addVariation("tile.factory.13.desc", 13, "factory/plating"); - factoryblock.carverHelper.addVariation("tile.factory.14.desc", 14, "factory/rustplates"); - factoryblock.carverHelper.addVariation("tile.factory.15.desc", 15, "factory/column"); - factoryblock.carverHelper.registerAll(factoryblock, "factoryblock"); - Carving.chisel.registerOre("factoryblock", "factoryblock"); - - BlockCarvable factoryblock2 = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F) - .setStepSound(Chisel.soundMetalFootstep); - factoryblock2.carverHelper.addVariation("tile.factory2.0.desc", 0, "factory/iceiceice", 20); - factoryblock2.carverHelper.addVariation("tile.factory2.1.desc", 1, "factory/vent", 21); - factoryblock2.carverHelper.addVariation("tile.factory2.2.desc", 2, "factory/tilemosaic", 22); - factoryblock2.carverHelper.addVariation("tile.factory2.3.desc", 3, "factory/wireframeblue", 23); - factoryblock2.carverHelper.registerAll(factoryblock2, "factoryblock2"); - factoryblock2.carverHelper.registerVariations("factoryblock"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.factoryblock, Configurations.factoryBlockAmount, 0), new Object[] { "*X*", "X X", "*X*", '*', new ItemStack(Blocks.stone, 1), 'X', - new ItemStack(Items.iron_ingot, 1) }); - } - }, - - FANTASY { - - @Override - void addBlocks() { - BlockCarvable fantasyblock = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); - - fantasyblock.carverHelper.addVariation("tile.fantasyblock.0.desc", 0, "fantasy/brick"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.1.desc", 1, "fantasy/brick-faded"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.2.desc", 2, "fantasy/brick-wear"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.3.desc", 3, "fantasy/bricks"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.4.desc", 4, "fantasy/decor"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.5.desc", 5, "fantasy/decor-block"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.6.desc", 6, "fantasy/pillar"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.7.desc", 7, "fantasy/pillar-decorated"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.8.desc", 8, "fantasy/gold-decor-1"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.9.desc", 9, "fantasy/gold-decor-2"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.10.desc", 10, "fantasy/gold-decor-3"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.11.desc", 11, "fantasy/gold-decor-4"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.12.desc", 12, "fantasy/plate"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.13.desc", 13, "fantasy/block"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.14.desc", 14, "fantasy/bricks-chaotic"); - fantasyblock.carverHelper.addVariation("tile.fantasyblock.15.desc", 15, "fantasy/bricks-wear"); - fantasyblock.carverHelper.registerAll(fantasyblock, "fantasyblock"); - Carving.chisel.registerOre("fantasyblock", "fantasy"); - - BlockCarvable fantasyblock2 = (BlockCarvable) new BlockCarvable().setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.0.desc", 0, "fantasy2/brick"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.1.desc", 1, "fantasy2/brick-faded"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.2.desc", 2, "fantasy2/brick-wear"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.3.desc", 3, "fantasy2/bricks"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.4.desc", 4, "fantasy2/decor"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.5.desc", 5, "fantasy2/decor-block"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.6.desc", 6, "fantasy2/pillar"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.7.desc", 7, "fantasy2/pillar-decorated"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.8.desc", 8, "fantasy2/gold-decor-1"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.9.desc", 9, "fantasy2/gold-decor-2"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.10.desc", 10, "fantasy2/gold-decor-3"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.11.desc", 11, "fantasy2/gold-decor-4"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.12.desc", 12, "fantasy2/plate"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.13.desc", 13, "fantasy2/block"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.14.desc", 14, "fantasy2/bricks-chaotic"); - fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.15.desc", 15, "fantasy2/bricks-wear"); - - fantasyblock2.carverHelper.registerBlock(fantasyblock2, "fantasyblock2"); - fantasyblock2.carverHelper.registerVariations("fantasy"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.fantasyblock, 8, 0), "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.gold_nugget, 1)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.fantasyblock2, 8, 0), "***", "*X*", "***", '*', new ItemStack(ChiselBlocks.fantasyblock, 1), 'X', "dyeWhite")); - } - }, - - FUTURA { - - @Override - void addBlocks() { - BlockCarvable futura = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); - futura.carverHelper.addVariation("tile.futura.0.desc", 0, "futura/WIP/screenMetallicWIP"); - futura.carverHelper.addVariation("tile.futura.1.desc", 1, "futura/WIP/screenCyanWIP"); - futura.carverHelper.addVariation("tile.futura.2.desc", 2, "futura/WIP/controller", new SubmapManagerFakeController(2, "futura/WIP/controller")); - futura.carverHelper.addVariation("tile.futura.3.desc", 3, "futura/WIP/wavyWIP"); - futura.carverHelper.addVariation("tile.futura.4.desc", 4, "futura/WIP/controller", new SubmapManagerFakeController(4, "futura/WIP/controllerPurple")); - futura.carverHelper.addVariation("tile.futura.5.desc", 5, "futura/WIP/controller", new SubmapManagerFakeController(5, "futura/WIP/uberWavy")); - futura.carverHelper.registerAll(futura, "futura"); - - BlockCarvable circuits = (BlockCarvable) new BlockCarvableGlow("animations/strobe").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10.0F); - for (int i = 0; i < 16; i++) { - circuits.carverHelper.addVariation("tile.futuraCircuit." + ItemDye.field_150921_b[i] + ".desc", i, "futura/circuitPlate", (i + 20)); - } - - circuits.carverHelper.registerBlock(circuits, "futuraCircuit"); - circuits.carverHelper.registerVariations("futura"); - Carving.chisel.registerOre("futura", "futura"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.futura, 8, 0), "SBS", "BGB", "SBS", 'S', "stone", 'G', "dustRedstone", 'B', new ItemStack(Blocks.stonebrick, 1))); - } - }, - - GLASS { - - @Override - void addBlocks() { - BlockCarvableGlass glass = (BlockCarvableGlass) new BlockCarvableGlass().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F).setStepSound(Block.soundTypeGlass); - Carving.chisel.addVariation("glass", Blocks.glass, 0, 0); - glass.carverHelper.addVariation("tile.glass.1.desc", 1, "glass/terrain-glassbubble"); - glass.carverHelper.addVariation("tile.glass.2.desc", 2, "glass/terrain-glass-chinese"); - glass.carverHelper.addVariation("tile.glass.3.desc", 3, "glass/japanese"); - glass.carverHelper.addVariation("tile.glass.4.desc", 4, "glass/terrain-glassdungeon"); - glass.carverHelper.addVariation("tile.glass.5.desc", 5, "glass/terrain-glasslight"); - glass.carverHelper.addVariation("tile.glass.6.desc", 6, "glass/terrain-glassnoborder"); - glass.carverHelper.addVariation("tile.glass.7.desc", 7, "glass/terrain-glass-ornatesteel"); - glass.carverHelper.addVariation("tile.glass.8.desc", 8, "glass/terrain-glass-screen"); - glass.carverHelper.addVariation("tile.glass.9.desc", 9, "glass/terrain-glassshale"); - glass.carverHelper.addVariation("tile.glass.10.desc", 10, "glass/terrain-glass-steelframe"); - glass.carverHelper.addVariation("tile.glass.11.desc", 11, "glass/terrain-glassstone"); - glass.carverHelper.addVariation("tile.glass.12.desc", 12, "glass/terrain-glassstreak"); - glass.carverHelper.addVariation("tile.glass.13.desc", 13, "glass/terrain-glass-thickgrid"); - glass.carverHelper.addVariation("tile.glass.14.desc", 14, "glass/terrain-glass-thingrid"); - glass.carverHelper.addVariation("tile.glass.15.desc", 15, "glass/a1-glasswindow-ironfencemodern"); - glass.carverHelper.registerAll(glass, "glass"); - Carving.chisel.registerOre("glass", "glass"); - - BlockCarvableGlass glass2 = (BlockCarvableGlass) new BlockCarvableGlass().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F).setStepSound(Block.soundTypeGlass); - glass2.carverHelper.addVariation("tile.glass2.0.desc", 0, "glass/chrono", 20); - glass2.carverHelper.registerBlock(glass2, "glass2"); - glass2.carverHelper.registerVariations("glass"); - } - }, - - GLASS_PANE { - - @Override - void addBlocks() { - BlockCarvablePane glass_pane = (BlockCarvablePane) new BlockCarvablePane(Material.glass, false).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F) - .setStepSound(Block.soundTypeGlass); - Carving.chisel.addVariation("glass_pane", Blocks.glass_pane, 0, 0); - glass_pane.carverHelper.addVariation("tile.glass_pane.1.desc", 1, "glasspane/terrain-glassbubble"); - glass_pane.carverHelper.addVariation("tile.glass_pane.2.desc", 2, "glasspane/terrain-glassnoborder"); - glass_pane.carverHelper.addVariation("tile.glass_pane.3.desc", 3, "glasspane/terrain-glass-screen"); - glass_pane.carverHelper.addVariation("tile.glass_pane.4.desc", 4, "glasspane/terrain-glassstreak"); - glass_pane.carverHelper.addVariation("tile.glass_pane.12.desc", 12, "glasspane/chinese"); - glass_pane.carverHelper.addVariation("tile.glass_pane.13.desc", 13, "glasspane/chinese2"); - glass_pane.carverHelper.addVariation("tile.glass_pane.14.desc", 14, "glasspane/japanese"); - glass_pane.carverHelper.addVariation("tile.glass_pane.15.desc", 15, "glasspane/japanese2"); - glass_pane.carverHelper.registerAll(glass_pane, "glass_pane"); - Carving.chisel.registerOre("glass_pane", "glass_pane"); - } - }, - - GLASS_STAINED { - - @Override - void addBlocks() { - stainedGlassForestry = new BlockCarvableGlass(); - stainedGlassForestry.setStained(true).setHardness(0.3F).setStepSound(Block.soundTypeGlass).setBlockName("Stained Glass"); - stainedGlassForestry.carverHelper.registerBlock(stainedGlassForestry, "stained_glass_forestry"); - - for (int i = 0; i < 16; i++) { - final String blockName = "stained_glass_" + sGNames[i].replaceAll(" ", "").toLowerCase(); - String oreName = "stainedGlass" + sGNames[i].replaceAll(" ", ""); - String texName = "glassdyed/" + sGNames[i].toLowerCase().replaceAll(" ", "") + "-"; - int glassPrefix = (i & 3) << 2; - int glassId = i >> 2; - Carving.chisel.addVariation(blockName, Blocks.stained_glass, i, 0); - if (glassPrefix == 0) { - stainedGlass[glassId] = (BlockCarvableGlass) new BlockCarvableGlass().setStained(true).setHardness(0.3F).setStepSound(Block.soundTypeGlass).setBlockName("Stained Glass"); - stainedGlass[glassId].carverHelper.registerBlock(stainedGlass[glassId], blockName); - } - stainedGlass[glassId].carverHelper.addVariation(featureColors[i] + ".bubble.desc", glassPrefix, texName + "bubble"); - stainedGlass[glassId].carverHelper.addVariation(featureColors[i] + ".glass.desc", glassPrefix + 1, texName + "panel"); - stainedGlass[glassId].carverHelper.addVariation(featureColors[i] + ".glass.fancy.desc", glassPrefix + 2, texName + "panel-fancy"); - stainedGlass[glassId].carverHelper.addVariation(featureColors[i] + ".glass.noborder.desc", glassPrefix + 3, texName + "transparent"); - OreDictionary.registerOre(oreName, new ItemStack(Blocks.stained_glass, 1, i)); - Carving.chisel.registerOre(blockName, oreName); - for (IVariationInfo info : stainedGlass[glassId].carverHelper.infoList) { - if (info.getVariation().getBlockMeta() < glassPrefix || info.getVariation().getBlockMeta() >= glassPrefix + 4) - continue; - stainedGlass[glassId].carverHelper.registerVariation(blockName, info); - } - - stainedGlassForestry.carverHelper.addVariation(featureColors[i] + ".glass.forestry.desc", i, texName + "forestry"); - IVariationInfo info = stainedGlassForestry.carverHelper.infoList.get(i); - stainedGlassForestry.carverHelper.registerVariation(blockName, info); - } - } - }, - - GLASS_STAINED_PANE { - - @Override - void addBlocks() { - for (int i = 0; i < 16; i++) { - final String blockName = "stained_glass_pane_" + sGNames[i].replaceAll(" ", "").toLowerCase(); - String oreName = "stainedGlassPane" + sGNames[i].replaceAll(" ", ""); - String texName = "glasspanedyed/" + sGNames[i].toLowerCase().replaceAll(" ", "") + "-"; - Carving.chisel.addVariation(blockName, Blocks.stained_glass_pane, i, 0); - int glassPrefix = (i & 1) << 3; - int glassId = i >> 1; - if (glassPrefix == 0) { - stainedGlassPane[glassId] = (BlockCarvablePane) new BlockCarvablePane(Material.glass, true).setStained(true).setHardness(0.3F).setStepSound(Block.soundTypeGlass) - .setBlockName("Stained Glass Pane").setCreativeTab(ChiselTabs.tabOtherChiselBlocks); - stainedGlassPane[glassId].carverHelper.registerBlock(stainedGlassPane[glassId], blockName); - } - stainedGlassPane[glassId].carverHelper.addVariation(featureColors[i] + ".pane.bubble.desc", glassPrefix, texName + "bubble"); - stainedGlassPane[glassId].carverHelper.addVariation(featureColors[i] + ".pane.glass.desc", glassPrefix + 1, texName + "panel"); - stainedGlassPane[glassId].carverHelper.addVariation(featureColors[i] + ".pane.glass.fancy.desc", glassPrefix + 2, texName + "panel-fancy"); - stainedGlassPane[glassId].carverHelper.addVariation(featureColors[i] + ".pane.glass.noborder.desc", glassPrefix + 3, texName + "transparent"); - stainedGlassPane[glassId].carverHelper.addVariation(featureColors[i] + ".pane.glass.quadrant.desc", glassPrefix + 4, texName + "quad"); - stainedGlassPane[glassId].carverHelper.addVariation(featureColors[i] + ".pane.glass.fancyquadrant.desc", glassPrefix + 5, texName + "quad-fancy"); - OreDictionary.registerOre(oreName, new ItemStack(Blocks.stained_glass_pane, 1, i)); - Carving.chisel.registerOre(blockName, oreName); - for (IVariationInfo info : stainedGlassPane[glassId].carverHelper.infoList) { - if (info.getVariation().getBlockMeta() < glassPrefix || info.getVariation().getBlockMeta() >= glassPrefix + 8) - continue; - stainedGlassPane[glassId].carverHelper.registerVariation(blockName, info); - } - } - } - }, - - GLOWSTONE { - - @Override - void addBlocks() { - BlockCarvableGlowstone glowstone = (BlockCarvableGlowstone) new BlockCarvableGlowstone().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F).setLightLevel(1.0F) - .setStepSound(Block.soundTypeGlass); - Carving.chisel.addVariation("glowstone", Blocks.glowstone, 0, 0); - glowstone.carverHelper.addVariation("tile.lightstone.1.desc", 1, "lightstone/terrain-sulphur-cobble"); - glowstone.carverHelper.addVariation("tile.lightstone.2.desc", 2, "lightstone/terrain-sulphur-corroded"); - glowstone.carverHelper.addVariation("tile.lightstone.3.desc", 3, "lightstone/terrain-sulphur-glass"); - glowstone.carverHelper.addVariation("tile.lightstone.4.desc", 4, "lightstone/terrain-sulphur-neon"); - glowstone.carverHelper.addVariation("tile.lightstone.5.desc", 5, "lightstone/terrain-sulphur-ornate"); - glowstone.carverHelper.addVariation("tile.lightstone.6.desc", 6, "lightstone/terrain-sulphur-rocky"); - glowstone.carverHelper.addVariation("tile.lightstone.7.desc", 7, "lightstone/terrain-sulphur-shale"); - glowstone.carverHelper.addVariation("tile.lightstone.8.desc", 8, "lightstone/terrain-sulphur-tile"); - glowstone.carverHelper.addVariation("tile.lightstone.9.desc", 9, "lightstone/terrain-sulphur-weavelanternlight"); - glowstone.carverHelper.addVariation("tile.lightstone.10.desc", 10, "lightstone/a1-glowstone-cobble"); - glowstone.carverHelper.addVariation("tile.lightstone.11.desc", 11, "lightstone/a1-glowstone-growth"); - glowstone.carverHelper.addVariation("tile.lightstone.12.desc", 12, "lightstone/a1-glowstone-layers"); - glowstone.carverHelper.addVariation("tile.lightstone.13.desc", 13, "lightstone/a1-glowstone-tilecorroded"); - glowstone.carverHelper.addVariation("tile.lightstone.14.desc", 14, "lightstone/glowstone-bismuth"); - glowstone.carverHelper.addVariation("tile.lightstone.15.desc", 15, "lightstone/glowstone-bismuth-panel"); - glowstone.carverHelper.registerAll(glowstone, "glowstone"); - Carving.chisel.registerOre("glowstone", "glowstone"); - } - }, - - GOLD_BLOCK { - - @Override - void addBlocks() { - BlockCarvable gold_block = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(3F).setResistance(10F).setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("gold_block", Blocks.gold_block, 0, 0); - gold_block.carverHelper.addVariation("tile.gold.1.desc", 1, "gold/terrain-gold-largeingot"); - gold_block.carverHelper.addVariation("tile.gold.2.desc", 2, "gold/terrain-gold-smallingot"); - gold_block.carverHelper.addVariation("tile.gold.3.desc", 3, "gold/terrain-gold-brick"); - gold_block.carverHelper.addVariation("tile.gold.4.desc", 4, "gold/terrain-gold-cart"); - gold_block.carverHelper.addVariation("tile.gold.5.desc", 5, "gold/terrain-gold-coin-heads"); - gold_block.carverHelper.addVariation("tile.gold.6.desc", 6, "gold/terrain-gold-coin-tails"); - gold_block.carverHelper.addVariation("tile.gold.7.desc", 7, "gold/terrain-gold-crate-dark"); - gold_block.carverHelper.addVariation("tile.gold.8.desc", 8, "gold/terrain-gold-crate-light"); - gold_block.carverHelper.addVariation("tile.gold.9.desc", 9, "gold/terrain-gold-plates"); - gold_block.carverHelper.addVariation("tile.gold.10.desc", 10, "gold/terrain-gold-rivets"); - gold_block.carverHelper.addVariation("tile.gold.11.desc", 11, "gold/terrain-gold-star"); - gold_block.carverHelper.addVariation("tile.gold.12.desc", 12, "gold/terrain-gold-space"); - gold_block.carverHelper.addVariation("tile.gold.13.desc", 13, "gold/terrain-gold-spaceblack"); - gold_block.carverHelper.addVariation("tile.gold.14.desc", 14, "gold/terrain-gold-simple"); - - BlockCarvable gold2 = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) - .setResistance(10F); - gold2.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/gold/caution", 20); - gold2.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/gold/crate", 21); - gold2.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/gold/thermal", 22); - gold2.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/gold/adv", 23); - gold2.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/gold/egregious", 24); - gold2.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/gold/bolted", 25); - gold2.carverHelper.registerBlock(gold2, "gold2"); - gold2.carverHelper.registerVariations("gold_block"); - - gold_block.carverHelper.registerAll(gold_block, "gold_block"); - Carving.chisel.registerOre("gold_block", "blockGold"); - } - }, - - GRANITE { - - @Override - void addBlocks() { - BlockCarvable granite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); - - granite.carverHelper.addVariation(Configurations.imTooGoodForDescriptions ? "" : "tile.granite.0.desc", 0, "granite/granite"); - granite.carverHelper.addVariation("tile.granite.1.desc", 1, "granite/granitePolished"); - granite.carverHelper.addVariation("tile.granite.2.desc", 2, "granite/granitePillar"); - granite.carverHelper.addVariation("tile.granite.3.desc", 3, "granite/graniteLBrick"); - granite.carverHelper.addVariation("tile.granite.4.desc", 4, "granite/graniteOrnate"); - granite.carverHelper.addVariation("tile.granite.5.desc", 5, "granite/granitePrism"); - granite.carverHelper.addVariation("tile.granite.6.desc", 6, "granite/graniteTiles"); - granite.carverHelper.registerAll(granite, "granite"); - granite.carverHelper.registerOre("blockGranite"); - granite.carverHelper.registerOre("stoneGranite"); - } - - @Override - void addRecipes() { - if (DIORITE.enabled()) { - GameRegistry.addRecipe(new ShapelessOreRecipe(granite, diorite, "gemQuartz")); - } - } - }, - - GRIMSTONE { - - @Override - void addBlocks() { - BlockCarvable grimstone = (BlockGrimstone) new BlockGrimstone(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); - grimstone.carverHelper.addVariation("tile.grimstone.0.desc", 0, "grimstone/grimstone"); - grimstone.carverHelper.addVariation("tile.grimstone.1.desc", 1, "grimstone/smooth"); - grimstone.carverHelper.addVariation("tile.grimstone.2.desc", 2, "grimstone/hate"); - grimstone.carverHelper.addVariation("tile.grimstone.3.desc", 3, "grimstone/chiseled"); - grimstone.carverHelper.addVariation("tile.grimstone.4.desc", 4, "grimstone/blocks"); - grimstone.carverHelper.addVariation("tile.grimstone.5.desc", 5, "grimstone/blocks-rough"); - grimstone.carverHelper.addVariation("tile.grimstone.6.desc", 6, "grimstone/brick"); - grimstone.carverHelper.addVariation("tile.grimstone.7.desc", 7, "grimstone/largebricks"); - grimstone.carverHelper.addVariation("tile.grimstone.8.desc", 8, "grimstone/platform"); - grimstone.carverHelper.addVariation("tile.grimstone.9.desc", 9, "grimstone/platform-tiles"); - grimstone.carverHelper.addVariation("tile.grimstone.10.desc", 10, "grimstone/construction"); - grimstone.carverHelper.addVariation("tile.grimstone.11.desc", 11, "grimstone/fancy-tiles"); - grimstone.carverHelper.addVariation("tile.grimstone.12.desc", 12, "grimstone/plate"); - grimstone.carverHelper.addVariation("tile.grimstone.13.desc", 13, "grimstone/plate-rough"); - grimstone.carverHelper.addVariation("tile.grimstone.14.desc", 14, "grimstone/flaky"); - grimstone.carverHelper.registerAll(grimstone, "grimstone"); - Carving.chisel.registerOre("grimstone", "grimstone"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.grimstone, 8, 0), "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.coal, 1)); - } - }, - - HEX_PLATING { - - @Override - void addBlocks() { - BlockCarvable hexPlating = (BlockCarvable) new BlockCarvableGlow("animations/archetype2").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2).setResistance(12); - for (int i = 0; i < 16; i++) { - hexPlating.carverHelper.addVariation("tile.hexPlating." + ItemDye.field_150921_b[i] + ".desc", i, "hexPlating/hexBase"); - } - hexPlating.carverHelper.registerAll(hexPlating, "hexPlating"); - Carving.chisel.registerOre("hexPlating", "hexPlating"); - - BlockCarvable hexLargePlating = (BlockCarvable) new BlockCarvableGlow("animations/archetype2").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2).setResistance(12); - for (int i = 0; i < 16; i++) { - hexLargePlating.carverHelper.addVariation("tile.hexPlating." + ItemDye.field_150921_b[i] + ".desc", i, "hexPlating/hexNew", (i + 20)); - } - - hexLargePlating.carverHelper.registerBlock(hexLargePlating, "hexLargePlating"); - hexLargePlating.carverHelper.registerVariations("hexPlating"); - Carving.chisel.registerOre("hexPlating", "hexPlating"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.hexPlating, 8, 0), "XXX", "XYX", "XXX", 'X', "stone", 'Y', "blockCoal")); - } - }, - - HOLYSTONE { - - @Override - void addBlocks() { - BlockCarvable holystone = (BlockHolystone) new BlockHolystone(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) - .setStepSound(Chisel.soundHolystoneFootstep); - holystone.carverHelper.addVariation("tile.holystone.0.desc", 0, "holystone/holystone"); - holystone.carverHelper.addVariation("tile.holystone.1.desc", 1, "holystone/smooth"); - holystone.carverHelper.addVariation("tile.holystone.2.desc", 2, "holystone/love"); - holystone.carverHelper.addVariation("tile.holystone.3.desc", 3, "holystone/chiseled"); - holystone.carverHelper.addVariation("tile.holystone.4.desc", 4, "holystone/blocks"); - holystone.carverHelper.addVariation("tile.holystone.5.desc", 5, "holystone/blocks-rough"); - holystone.carverHelper.addVariation("tile.holystone.6.desc", 6, "holystone/brick"); - holystone.carverHelper.addVariation("tile.holystone.7.desc", 7, "holystone/largebricks"); - holystone.carverHelper.addVariation("tile.holystone.8.desc", 8, "holystone/platform"); - holystone.carverHelper.addVariation("tile.holystone.9.desc", 9, "holystone/platform-tiles"); - holystone.carverHelper.addVariation("tile.holystone.10.desc", 10, "holystone/construction"); - holystone.carverHelper.addVariation("tile.holystone.11.desc", 11, "holystone/fancy-tiles"); - holystone.carverHelper.addVariation("tile.holystone.12.desc", 12, "holystone/plate"); - holystone.carverHelper.addVariation("tile.holystone.13.desc", 13, "holystone/plate-rough"); - holystone.carverHelper.registerAll(holystone, "holystone"); - OreDictionary.registerOre("holystone", holystone); - Carving.chisel.registerOre("holystone", "holystone"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.holystone, 8, 0), "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.feather, 1)); - } - }, - - ICE { - - @Override - void addBlocks() { - BlockCarvableIce ice = (BlockCarvableIce) new BlockCarvableIce().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3).setStepSound(Block.soundTypeGlass); - Carving.chisel.addVariation("ice", Blocks.ice, 0, 0); - ice.carverHelper.addVariation("tile.ice.1.desc", 1, "ice/a1-ice-light"); - ice.carverHelper.addVariation("tile.ice.2.desc", 2, "ice/a1-stonecobble-icecobble"); - ice.carverHelper.addVariation("tile.ice.3.desc", 3, "ice/a1-netherbrick-ice"); - ice.carverHelper.addVariation("tile.ice.4.desc", 4, "ice/a1-stonecobble-icebrick"); - ice.carverHelper.addVariation("tile.ice.5.desc", 5, "ice/a1-stonecobble-icebricksmall"); - ice.carverHelper.addVariation("tile.ice.6.desc", 6, "ice/a1-stonecobble-icedungeon"); - ice.carverHelper.addVariation("tile.ice.7.desc", 7, "ice/a1-stonecobble-icefour"); - ice.carverHelper.addVariation("tile.ice.8.desc", 8, "ice/a1-stonecobble-icefrench"); - ice.carverHelper.addVariation("tile.ice.9.desc", 9, "ice/sunkentiles"); - ice.carverHelper.addVariation("tile.ice.10.desc", 10, "ice/tiles"); - ice.carverHelper.addVariation("tile.ice.11.desc", 11, "ice/a1-stonecobble-icepanel"); - ice.carverHelper.addVariation("tile.ice.12.desc", 12, "ice/a1-stoneslab-ice"); - ice.carverHelper.addVariation("tile.ice.13.desc", 13, "ice/zelda"); - ice.carverHelper.addVariation("tile.ice.14.desc", 14, "ice/bismuth"); - ice.carverHelper.addVariation("tile.ice.15.desc", 15, "ice/poison"); - ice.carverHelper.registerAll(ice, "ice"); - Carving.chisel.registerOre("ice", "ice"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.ice, 4, 1), "XX", "XX", 'X', new ItemStack(ChiselBlocks.ice_pillar, 1, OreDictionary.WILDCARD_VALUE)); - } - }, - - ICE_PILLAR(ICE) { - - @Override - void addBlocks() { - BlockCarvableIce ice_pillar = (BlockCarvableIce) new BlockCarvableIce().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3) - .setStepSound(Block.soundTypeGlass); - - ice_pillar.carverHelper.addVariation("tile.icePillar.0.desc", 0, "icepillar/plainplain"); - ice_pillar.carverHelper.addVariation("tile.icePillar.1.desc", 1, "icepillar/plaingreek"); - ice_pillar.carverHelper.addVariation("tile.icePillar.2.desc", 2, "icepillar/greekplain"); - ice_pillar.carverHelper.addVariation("tile.icePillar.3.desc", 3, "icepillar/greekgreek"); - ice_pillar.carverHelper.addVariation("tile.icePillar.4.desc", 4, "icepillar/convexplain"); - ice_pillar.carverHelper.addVariation("tile.icePillar.5.desc", 5, "icepillar/carved"); - ice_pillar.carverHelper.addVariation("tile.icePillar.6.desc", 6, "icepillar/ornamental"); - ice_pillar.carverHelper.registerAll(ice_pillar, "ice_pillar"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.ice_pillar, 6, 0), "XX", "XX", "XX", 'X', new ItemStack(ChiselBlocks.ice, 1, OreDictionary.WILDCARD_VALUE)); - } - }, - - ICE_STAIRS(ICE) { - - @Override - void addBlocks() { - CarvableStairsMaker makerIceStairs = new CarvableStairsMaker(Blocks.ice); - - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.0.desc", 0, Blocks.ice); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.1.desc", 1, "ice/a1-ice-light"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.2.desc", 2, "ice/a1-stonecobble-icecobble"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.3.desc", 3, "ice/a1-netherbrick-ice"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.4.desc", 4, "ice/a1-stonecobble-icebrick"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.5.desc", 5, "ice/a1-stonecobble-icebricksmall"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.6.desc", 6, "ice/a1-stonecobble-icedungeon"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.7.desc", 7, "ice/a1-stonecobble-icefour"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.8.desc", 8, "ice/a1-stonecobble-icefrench"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.9.desc", 9, "ice/sunkentiles"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.10.desc", 10, "ice/tiles"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.11.desc", 11, "ice/a1-stonecobble-icepanel"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.12.desc", 12, "ice/a1-stoneslab-ice"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.13.desc", 13, "ice/zelda"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.14.desc", 14, "ice/bismuth"); - makerIceStairs.carverHelper.addVariation("tile.ice_stairs.15.desc", 15, "ice/poison"); - makerIceStairs.create(new IStairsCreator() { - - @Override - public BlockCarvableStairs create(Block block, int meta, CarvableHelper helper) { - return new BlockCarvableIceStairs(block, meta, helper); - } - }, "ice_stairs", ChiselBlocks.iceStairs); - Carving.chisel.registerOre("ice_stairs", "iceStairs"); - } - }, - - IRON_BARS { - - @Override - void addBlocks() { - BlockCarvablePane iron_bars = (BlockCarvablePane) new BlockCarvablePane(Material.iron, true).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F) - .setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("iron_bars", Blocks.iron_bars, 0, 0); - iron_bars.carverHelper.addVariation("tile.iron_bars.1.desc", 1, "ironpane/fenceIron"); - iron_bars.carverHelper.addVariation("tile.iron_bars.2.desc", 2, "ironpane/barbedwire"); - iron_bars.carverHelper.addVariation("tile.iron_bars.3.desc", 3, "ironpane/cage"); - iron_bars.carverHelper.addVariation("tile.iron_bars.4.desc", 4, "ironpane/fenceIronTop"); - iron_bars.carverHelper.addVariation("tile.iron_bars.5.desc", 5, "ironpane/terrain-glass-thickgrid"); - iron_bars.carverHelper.addVariation("tile.iron_bars.6.desc", 6, "ironpane/terrain-glass-thingrid"); - iron_bars.carverHelper.addVariation("tile.iron_bars.7.desc", 7, "ironpane/terrain-glass-ornatesteel"); - iron_bars.carverHelper.addVariation("tile.iron_bars.8.desc", 8, "ironpane/bars"); - iron_bars.carverHelper.addVariation("tile.iron_bars.9.desc", 9, "ironpane/spikes"); - iron_bars.carverHelper.registerAll(iron_bars, "iron_bars"); - Carving.chisel.registerOre("iron_bars", "iron_bars"); - } - }, - - IRON_BLOCK { - - @Override - void addBlocks() { - - BlockCarvable iron_block = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(5F).setResistance(10F).setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("iron_block", Blocks.iron_block, 0, 0); - iron_block.carverHelper.addVariation("tile.iron.1.desc", 1, "iron/terrain-iron-largeingot"); - iron_block.carverHelper.addVariation("tile.iron.2.desc", 2, "iron/terrain-iron-smallingot"); - iron_block.carverHelper.addVariation("tile.iron.3.desc", 3, "iron/terrain-iron-gears"); - iron_block.carverHelper.addVariation("tile.iron.4.desc", 4, "iron/terrain-iron-brick"); - iron_block.carverHelper.addVariation("tile.iron.5.desc", 5, "iron/terrain-iron-plates"); - iron_block.carverHelper.addVariation("tile.iron.6.desc", 6, "iron/terrain-iron-rivets"); - iron_block.carverHelper.addVariation("tile.iron.7.desc", 7, "iron/terrain-iron-coin-heads"); - iron_block.carverHelper.addVariation("tile.iron.8.desc", 8, "iron/terrain-iron-coin-tails"); - iron_block.carverHelper.addVariation("tile.iron.9.desc", 9, "iron/terrain-iron-crate-dark"); - iron_block.carverHelper.addVariation("tile.iron.10.desc", 10, "iron/terrain-iron-crate-light"); - iron_block.carverHelper.addVariation("tile.iron.11.desc", 11, "iron/terrain-iron-moon"); - iron_block.carverHelper.addVariation("tile.iron.12.desc", 12, "iron/terrain-iron-space"); - iron_block.carverHelper.addVariation("tile.iron.13.desc", 13, "iron/terrain-iron-spaceblack"); - iron_block.carverHelper.addVariation("tile.iron.14.desc", 14, "iron/terrain-iron-vents"); - iron_block.carverHelper.addVariation("tile.iron.15.desc", 15, "iron/terrain-iron-simple"); - - BlockCarvable iron2 = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) - .setResistance(10F); - iron2.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/iron/caution", 20); - iron2.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/iron/crate", 21); - iron2.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/iron/thermal", 22); - iron2.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/iron/adv", 23); - iron2.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/iron/egregious", 24); - iron2.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/iron/bolted", 25); - iron2.carverHelper.registerBlock(iron2, "iron2"); - iron2.carverHelper.registerVariations("iron_block"); - - iron_block.carverHelper.registerAll(iron_block, "iron_block"); - Carving.chisel.registerOre("iron_block", "blockIron"); - } - }, - - JACKOLANTERN { - - @Override - void addBlocks() { - for (int metadata = 0; metadata < 16; metadata++) { - jackolantern[metadata] = (BlockCarvablePumpkin) new BlockCarvablePumpkin(true).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(1.0F).setBlockName("litpumpkin") - .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setLightLevel(1.0f); - jackolantern[metadata].setInformation("pumpkin/pumpkin_face_" + (metadata + 1) + "_on"); - GameRegistry.registerBlock(jackolantern[metadata], ItemCarvablePumpkin.class, ("jackolantern" + (metadata + 1))); - Carving.chisel.addVariation("jackolantern", jackolantern[metadata], 0, (metadata + 1)); - } - Carving.chisel.addVariation("jackolantern", Blocks.lit_pumpkin, 0, 0); - Carving.chisel.registerOre("jackolantern", "jackolantern"); - } - }, - - LABORATORY { - - @Override - void addBlocks() { - BlockCarvable laboratoryblock = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F) - .setStepSound(Chisel.soundMetalFootstep); - - laboratoryblock.carverHelper.addVariation("tile.laboratory.0.desc", 0, "laboratory/wallpanel"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.1.desc", 1, "laboratory/dottedpanel"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.2.desc", 2, "laboratory/largewall"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.3.desc", 3, "laboratory/roundel"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.4.desc", 4, "laboratory/wallvents"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.5.desc", 5, "laboratory/largetile"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.6.desc", 6, "laboratory/smalltile"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.7.desc", 7, "laboratory/floortile"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.8.desc", 8, "laboratory/checkertile"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.9.desc", 9, "laboratory/clearscreen"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.10.desc", 10, "laboratory/fuzzscreen"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.11.desc", 11, "laboratory/largesteel"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.12.desc", 12, "laboratory/smallsteel"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.13.desc", 13, "laboratory/directionright"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.14.desc", 14, "laboratory/directionleft"); - laboratoryblock.carverHelper.addVariation("tile.laboratory.15.desc", 15, "laboratory/infocon"); - laboratoryblock.carverHelper.registerAll(laboratoryblock, "laboratoryblock"); - Carving.chisel.registerOre("laboratoryblock", "laboratoryblock"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.laboratoryblock, 8, 0), "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.quartz, 1)); - } - }, - - LAPIS_BLOCK { - - @Override - void addBlocks() { - BlockCarvable lapis_block = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(3F).setResistance(5F) - .setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("lapis_block", Blocks.lapis_block, 0, 0); - lapis_block.carverHelper.addVariation("tile.lapis.1.desc", 1, "lapis/terrain-lapisblock-chunky"); - lapis_block.carverHelper.addVariation("tile.lapis.2.desc", 2, "lapis/terrain-lapisblock-panel"); - lapis_block.carverHelper.addVariation("tile.lapis.3.desc", 3, "lapis/terrain-lapisblock-zelda"); - lapis_block.carverHelper.addVariation("tile.lapis.4.desc", 4, "lapis/terrain-lapisornate"); - lapis_block.carverHelper.addVariation("tile.lapis.5.desc", 5, "lapis/terrain-lapistile"); - lapis_block.carverHelper.addVariation("tile.lapis.6.desc", 6, "lapis/a1-blocklapis-panel"); - lapis_block.carverHelper.addVariation("tile.lapis.7.desc", 7, "lapis/a1-blocklapis-smooth"); - lapis_block.carverHelper.addVariation("tile.lapis.8.desc", 8, "lapis/a1-blocklapis-ornatelayer"); - - lapis_block.carverHelper.registerAll(lapis_block, "lapis_block"); - Carving.chisel.registerOre("lapis_block", "lapis"); - } - }, - - LAVASTONE { - - @Override - void addBlocks() { - BlockLavastone lavastone = (BlockLavastone) new BlockLavastone(Material.rock, "lava_still").setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); - lavastone.carverHelper.addVariation("tile.lavastone.0.desc", 0, "lavastone/cobble"); - lavastone.carverHelper.addVariation("tile.lavastone.1.desc", 1, "lavastone/black"); - lavastone.carverHelper.addVariation("tile.lavastone.2.desc", 2, "lavastone/tiles"); - lavastone.carverHelper.addVariation("tile.lavastone.3.desc", 3, "lavastone/chaotic"); - lavastone.carverHelper.addVariation("tile.lavastone.4.desc", 4, "lavastone/creeper"); - lavastone.carverHelper.addVariation("tile.lavastone.5.desc", 5, "lavastone/panel"); - lavastone.carverHelper.addVariation("tile.lavastone.6.desc", 6, "lavastone/panel-ornate"); - lavastone.carverHelper.addVariation("tile.lavastone.7.desc", 7, "lavastone/dark"); - lavastone.carverHelper.registerAll(lavastone, "lavastone"); - OreDictionary.registerOre("lavastone", lavastone); - Carving.chisel.registerOre("lavastone", "lavastone"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.lavastone, 8, 0), "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.lava_bucket, 1)); - } - }, - - LEAD { - - @Override - void addBlocks() { - BlockCarvable lead = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) - .setResistance(10F); - lead.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/lead/caution"); - lead.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/lead/crate"); - lead.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/lead/thermal"); - lead.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/lead/adv"); - lead.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/lead/egregious"); - lead.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/lead/bolted"); - lead.carverHelper.registerAll(lead, "leadblock"); - Carving.chisel.registerOre("leadblock", "blockLead"); - } - }, - - LEAVES { - - @Override - void addBlocks() { - BlockLeaf leaves = (BlockLeaf) new BlockLeaf(Material.leaves).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.2F).setStepSound(Block.soundTypeGrass); - Carving.chisel.addGroup(new SimpleCarvingGroup("leaves") { - - @Override - public List getVariations() { - if (Configurations.chiselBackToVanillaLeaves) { - return super.getVariations(); - } else { - List ret = Lists.newArrayList(); - for (ICarvingVariation v : super.getVariations()) { - if (v.getBlock() != Blocks.leaves && v.getBlock() != Blocks.leaves2) { - ret.add(v); - } - } - return ret; - } - } - }); - Carving.chisel.addVariation("leaves", Blocks.leaves, 0, 0); - Carving.chisel.addVariation("leaves", Blocks.leaves, 1, 0); - Carving.chisel.addVariation("leaves", Blocks.leaves, 2, 0); - Carving.chisel.addVariation("leaves", Blocks.leaves, 3, 0); - Carving.chisel.addVariation("leaves", Blocks.leaves2, 0, 0); - Carving.chisel.addVariation("leaves", Blocks.leaves2, 1, 0); - - leaves.carverHelper.addVariation("tile.leaves.6.desc", 6, new SubmapManagerLeaves("leaves/dead")); - leaves.carverHelper.addVariation("tile.leaves.7.desc", 7, new SubmapManagerLeaves("leaves/fancy")); - leaves.carverHelper.addVariation("tile.leaves.8.desc", 8, new SubmapManagerLeaves("leaves/pinkpetal")); - leaves.carverHelper.addVariation("tile.leaves.9.desc", 9, new SubmapManagerLeaves("leaves/red_roses")); - leaves.carverHelper.addVariation("tile.leaves.10.desc", 10, new SubmapManagerLeaves("leaves/roses")); - leaves.carverHelper.addVariation("tile.leaves.11.desc", 11, new SubmapManagerLeaves("leaves/christmasBalls")); - leaves.carverHelper.addVariation("tile.leaves.12.desc", 12, new SubmapManagerLeaves("leaves/christmasLights")); - - leaves.carverHelper.registerAll(leaves, "leaves"); - Carving.chisel.registerOre("leaves", "leaves"); - } - }, - - LIMESTONE { - - @Override - void addBlocks() { - BlockCarvable limestone = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) - .setStepSound(Block.soundTypeStone); - - limestone.carverHelper.addVariation("tile.limestone.0.desc", 0, "limestone"); - limestone.carverHelper.addVariation("tile.limestone.1.desc", 1, "limestone/terrain-cobbsmalltilelight"); - limestone.carverHelper.addVariation("tile.limestone.2.desc", 2, "limestone/terrain-cob-frenchlight"); - limestone.carverHelper.addVariation("tile.limestone.3.desc", 3, "limestone/terrain-cob-french2light"); - limestone.carverHelper.addVariation("tile.limestone.4.desc", 4, "limestone/terrain-cobmoss-creepdungeonlight"); - limestone.carverHelper.addVariation("tile.limestone.5.desc", 5, "limestone/terrain-cob-smallbricklight"); - limestone.carverHelper.addVariation("tile.limestone.6.desc", 6, "limestone/terrain-mossysmalltilelight"); - limestone.carverHelper.addVariation("tile.limestone.7.desc", 7, "limestone/terrain-pistonback-dungeon"); - limestone.carverHelper.addVariation("tile.limestone.8.desc", 8, "limestone/terrain-pistonback-dungeonornate"); - limestone.carverHelper.addVariation("tile.limestone.9.desc", 9, "limestone/terrain-pistonback-dungeonvent"); - limestone.carverHelper.addVariation("tile.limestone.10.desc", 10, "limestone/terrain-pistonback-lightcreeper"); - limestone.carverHelper.addVariation("tile.limestone.11.desc", 11, "limestone/terrain-pistonback-lightdent"); - limestone.carverHelper.addVariation("tile.limestone.12.desc", 12, "limestone/terrain-pistonback-lightemboss"); - limestone.carverHelper.addVariation("tile.limestone.13.desc", 13, "limestone/terrain-pistonback-lightfour"); - limestone.carverHelper.addVariation("tile.limestone.14.desc", 14, "limestone/terrain-pistonback-lightmarker"); - limestone.carverHelper.addVariation("tile.limestone.15.desc", 15, "limestone/terrain-pistonback-lightpanel"); - limestone.carverHelper.registerAll(limestone, "limestone"); - OreDictionary.registerOre("limestone", limestone); - Carving.chisel.registerOre("limestone", "limestone"); - - BlockCarvableSlab limestone_slab = (BlockCarvableSlab) new BlockCarvableSlab(limestone).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); - - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.0.desc", 0, "limestone"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.1.desc", 1, "limestone/terrain-cobbsmalltilelight"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.2.desc", 2, "limestone/terrain-cob-frenchlight"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.3.desc", 3, "limestone/terrain-cob-french2light"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.4.desc", 4, "limestone/terrain-cobmoss-creepdungeonlight"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.5.desc", 5, "limestone/terrain-cob-smallbricklight"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.6.desc", 6, "limestone/terrain-mossysmalltilelight"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.7.desc", 7, "limestone/terrain-pistonback-dungeon"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.8.desc", 8, "limestone/terrain-pistonback-dungeonornate"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.9.desc", 9, "limestone/terrain-pistonback-dungeonvent"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.10.desc", 10, "limestone/terrain-pistonback-lightcreeper"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.11.desc", 11, "limestone/terrain-pistonback-lightdent"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.12.desc", 12, "limestone/terrain-pistonback-lightemboss"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.13.desc", 13, "limestone/terrain-pistonback-lightfour"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.14.desc", 14, "limestone/terrain-pistonback-lightmarker"); - limestone_slab.carverHelper.addVariation("tile.limestoneSlab.15.desc", 15, "limestone/terrain-pistonback-lightpanel"); - limestone_slab.carverHelper.registerAll(limestone_slab, "limestone_slab", ItemCarvableSlab.class); - registerSlabTop(limestone_slab, limestone_slab.top); - Carving.chisel.registerOre("limestone_slab", "limestone_slab"); - - CarvableStairsMaker makerLimestoneStairs = new CarvableStairsMaker(limestone); - - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.0.desc", 0, "limestone"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.1.desc", 1, "limestone/terrain-cobbsmalltilelight"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.2.desc", 2, "limestone/terrain-cob-frenchlight"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.3.desc", 3, "limestone/terrain-cob-french2light"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.4.desc", 4, "limestone/terrain-cobmoss-creepdungeonlight"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.5.desc", 5, "limestone/terrain-cob-smallbricklight"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.6.desc", 6, "limestone/terrain-mossysmalltilelight"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.7.desc", 7, "limestone/terrain-pistonback-dungeon"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.8.desc", 8, "limestone/terrain-pistonback-dungeonornate"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.9.desc", 9, "limestone/terrain-pistonback-dungeonvent"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.10.desc", 10, "limestone/terrain-pistonback-lightcreeper"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.11.desc", 11, "limestone/terrain-pistonback-lightdent"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.12.desc", 12, "limestone/terrain-pistonback-lightemboss"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.13.desc", 13, "limestone/terrain-pistonback-lightfour"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.14.desc", 14, "limestone/terrain-pistonback-lightmarker"); - makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.15.desc", 15, "limestone/terrain-pistonback-lightpanel"); - makerLimestoneStairs.create("limestone_stairs", ChiselBlocks.limestoneStairs); - Carving.chisel.registerOre("limestone_stairs", "limestone_stairs"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.limestone_slab, 6, 0), "***", '*', new ItemStack(ChiselBlocks.limestone, 1, OreDictionary.WILDCARD_VALUE)); - } - }, - - MARBLE { - - @Override - void addBlocks() { - BlockCarvable marble = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) - .setStepSound(Block.soundTypeStone); - - marble.carverHelper.addVariation("tile.marble.0.desc", 0, "marble"); - marble.carverHelper.addVariation("tile.marble.1.desc", 1, "marble/a1-stoneornamental-marblebrick"); - marble.carverHelper.addVariation("tile.marble.2.desc", 2, "marble/a1-stoneornamental-marbleclassicpanel"); - marble.carverHelper.addVariation("tile.marble.3.desc", 3, "marble/a1-stoneornamental-marbleornate"); - marble.carverHelper.addVariation("tile.marble.4.desc", 4, "marble/panel"); - marble.carverHelper.addVariation("tile.marble.5.desc", 5, "marble/block"); - marble.carverHelper.addVariation("tile.marble.6.desc", 6, "marble/terrain-pistonback-marblecreeperdark"); - marble.carverHelper.addVariation("tile.marble.7.desc", 7, "marble/terrain-pistonback-marblecreeperlight"); - marble.carverHelper.addVariation("tile.marble.8.desc", 8, "marble/a1-stoneornamental-marblecarved"); - marble.carverHelper.addVariation("tile.marble.9.desc", 9, "marble/a1-stoneornamental-marblecarvedradial"); - marble.carverHelper.addVariation("tile.marble.10.desc", 10, "marble/terrain-pistonback-marbledent"); - marble.carverHelper.addVariation("tile.marble.11.desc", 11, "marble/terrain-pistonback-marbledent-small"); - marble.carverHelper.addVariation("tile.marble.12.desc", 12, "marble/marble-bricks"); - marble.carverHelper.addVariation("tile.marble.13.desc", 13, "marble/marble-arranged-bricks"); - marble.carverHelper.addVariation("tile.marble.14.desc", 14, "marble/marble-fancy-bricks"); - marble.carverHelper.addVariation("tile.marble.15.desc", 15, "marble/marble-blocks"); - marble.carverHelper.registerAll(marble, "marble"); - OreDictionary.registerOre("marble", marble); - OreDictionary.registerOre("blockMarble", marble); - Carving.chisel.registerOre("marble", "marble"); - - BlockCarvableSlab marble_slab = (BlockCarvableSlab) new BlockCarvableSlab(marble).setHardness(2.0F).setResistance(10F); - - marble_slab.carverHelper.addVariation("tile.marbleSlab.0.desc", 0, "marble"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.1.desc", 1, "marbleslab/a1-stoneornamental-marblebrick"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.2.desc", 2, "marbleslab/a1-stoneornamental-marbleclassicpanel"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.3.desc", 3, "marbleslab/a1-stoneornamental-marbleornate"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.4.desc", 4, "marbleslab/a1-stoneornamental-marblepanel"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.5.desc", 5, "marbleslab/terrain-pistonback-marble"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.6.desc", 6, "marbleslab/terrain-pistonback-marblecreeperdark"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.7.desc", 7, "marbleslab/terrain-pistonback-marblecreeperlight"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.8.desc", 8, "marbleslab/a1-stoneornamental-marblecarved"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.9.desc", 9, "marbleslab/a1-stoneornamental-marblecarvedradial"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.10.desc", 10, "marbleslab/terrain-pistonback-marbledent"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.11.desc", 11, "marbleslab/terrain-pistonback-marbledent-small"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.12.desc", 12, "marbleslab/marble-bricks"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.13.desc", 13, new SubmapManagerSlab("marbleslab/marble-arranged-bricks")); - marble_slab.carverHelper.addVariation("tile.marbleSlab.14.desc", 14, "marbleslab/marble-fancy-bricks"); - marble_slab.carverHelper.addVariation("tile.marbleSlab.15.desc", 15, "marbleslab/marble-blocks"); - marble_slab.carverHelper.registerAll(marble_slab, "marble_slab", ItemCarvableSlab.class); - registerSlabTop(marble_slab, marble_slab.top); - Carving.chisel.registerOre("marble_slab", "marble_slab"); - - CarvableStairsMaker makerMarbleStairs = new CarvableStairsMaker(marble); - - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.0.desc", 0, "marble"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.6.desc", 1, "marbleslab/a1-stoneornamental-marblebrick"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.2.desc", 2, "marbleslab/a1-stoneornamental-marbleclassicpanel"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.3.desc", 3, "marbleslab/a1-stoneornamental-marbleornate"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.4.desc", 4, "marbleslab/a1-stoneornamental-marblepanel"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.5.desc", 5, "marbleslab/terrain-pistonback-marble"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.6.desc", 6, "marbleslab/terrain-pistonback-marblecreeperdark"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.7.desc", 7, "marbleslab/terrain-pistonback-marblecreeperlight"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.8.desc", 8, "marbleslab/a1-stoneornamental-marblecarved"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.9.desc", 9, "marbleslab/a1-stoneornamental-marblecarvedradial"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.10.desc", 10, "marbleslab/terrain-pistonback-marbledent"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.11.desc", 11, "marbleslab/terrain-pistonback-marbledent-small"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.12.desc", 12, "marbleslab/marble-bricks"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.13.desc", 13, "marbleslab/marble-arranged-bricks"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.14.desc", 14, "marbleslab/marble-fancy-bricks"); - makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.15.desc", 15, "marbleslab/marble-blocks"); - makerMarbleStairs.create("marble_stairs", ChiselBlocks.marbleStairs); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.marble_slab, 6, 0), "***", '*', new ItemStack(ChiselBlocks.marble, 1, OreDictionary.WILDCARD_VALUE)); - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.marble, 4), "XX", "XX", 'X', new ItemStack(ChiselBlocks.marble_pillar, 1, OreDictionary.WILDCARD_VALUE)); - } - }, - - MARBLE_PILLAR(MARBLE) { - - @Override - void addBlocks() { - - BlockCarvable marble_pillar; - if (Configurations.oldPillars) { - marble_pillar = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) - .setStepSound(Block.soundTypeStone); - - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.0.desc", 0, "marblepillarold/column"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.1.desc", 1, "marblepillarold/capstone"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.2.desc", 2, "marblepillarold/base"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.3.desc", 3, "marblepillarold/small"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.4.desc", 4, "marblepillarold/pillar-carved"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.5.desc", 5, "marblepillarold/a1-stoneornamental-marblegreek"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.6.desc", 6, "marblepillarold/a1-stonepillar-greek"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.7.desc", 7, "marblepillarold/a1-stonepillar-plain"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.8.desc", 8, "marblepillarold/a1-stonepillar-greektopplain"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.9.desc", 9, "marblepillarold/a1-stonepillar-plaintopplain"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.10.desc", 10, "marblepillarold/a1-stonepillar-greekbottomplain"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.11.desc", 11, "marblepillarold/a1-stonepillar-plainbottomplain"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.12.desc", 12, "marblepillarold/a1-stonepillar-greektopgreek"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.13.desc", 13, "marblepillarold/a1-stonepillar-plaintopgreek"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.14.desc", 14, "marblepillarold/a1-stonepillar-greekbottomgreek"); - marble_pillar.carverHelper.addVariation("tile.marblePillarOld.15.desc", 15, "marblepillarold/a1-stonepillar-plainbottomgreek"); - } else { - marble_pillar = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) - .setStepSound(Block.soundTypeStone); - - marble_pillar.carverHelper.addVariation("tile.marblePillar.0.desc", 0, "marblepillar/pillar"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.1.desc", 1, "marblepillar/default"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.2.desc", 2, "marblepillar/simple"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.3.desc", 3, "marblepillar/convex"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.4.desc", 4, "marblepillar/rough"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.5.desc", 5, "marblepillar/greekdecor"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.6.desc", 6, "marblepillar/greekgreek"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.7.desc", 7, "marblepillar/greekplain"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.8.desc", 8, "marblepillar/plaindecor"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.9.desc", 9, "marblepillar/plaingreek"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.10.desc", 10, "marblepillar/plainplain"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.11.desc", 11, "marblepillar/widedecor"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.12.desc", 12, "marblepillar/widegreek"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.13.desc", 13, "marblepillar/wideplain"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.14.desc", 14, "marblepillar/carved"); - marble_pillar.carverHelper.addVariation("tile.marblePillar.15.desc", 15, "marblepillar/ornamental"); - } - marble_pillar.carverHelper.registerAll(marble_pillar, "marble_pillar"); - - BlockCarvableSlab marble_pillar_slab = (BlockCarvableSlab) new BlockCarvableSlab(marble_pillar).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) - .setStepSound(Block.soundTypeStone); - - if (Configurations.oldPillars) { - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.0.desc", 0, "marblepillarslabold/column"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.1.desc", 1, "marblepillarslabold/capstone"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.2.desc", 2, "marblepillarslabold/base"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.3.desc", 3, "marblepillarslabold/small"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.4.desc", 4, "marblepillarslabold/pillar-carved"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.5.desc", 5, "marblepillarslabold/a1-stoneornamental-marblegreek"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.6.desc", 6, "marblepillarslabold/a1-stonepillar-greek"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.7.desc", 7, "marblepillarslabold/a1-stonepillar-plain"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.8.desc", 8, "marblepillarslabold/a1-stonepillar-greektopplain"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.9.desc", 9, "marblepillarslabold/a1-stonepillar-plaintopplain"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.10.desc", 10, "marblepillarslabold/a1-stonepillar-greekbottomplain"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.11.desc", 11, "marblepillarslabold/a1-stonepillar-plainbottomplain"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.12.desc", 12, "marblepillarslabold/a1-stonepillar-greektopgreek"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.13.desc", 13, "marblepillarslabold/a1-stonepillar-plaintopgreek"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.14.desc", 14, "marblepillarslabold/a1-stonepillar-greekbottomgreek"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlabOld.15.desc", 15, "marblepillarslabold/a1-stonepillar-plainbottomgreek"); - } else { - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.0.desc", 0, "marblepillarslab/pillar"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.1.desc", 1, "marblepillarslab/default"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.2.desc", 2, "marblepillarslab/simple"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.3.desc", 3, "marblepillarslab/convex"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.4.desc", 4, "marblepillarslab/rough"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.5.desc", 5, "marblepillarslab/greekdecor"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.6.desc", 6, "marblepillarslab/greekgreek"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.7.desc", 7, "marblepillarslab/greekplain"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.8.desc", 8, "marblepillarslab/plaindecor"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.9.desc", 9, "marblepillarslab/plaingreek"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.10.desc", 10, "marblepillarslab/plainplain"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.11.desc", 11, "marblepillarslab/widedecor"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.12.desc", 12, "marblepillarslab/widegreek"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.13.desc", 13, "marblepillarslab/wideplain"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.14.desc", 14, "marblepillarslab/carved"); - marble_pillar_slab.carverHelper.addVariation("tile.marblePillarSlab.15.desc", 15, "marblepillarslab/ornamental"); - } - marble_pillar_slab.carverHelper.registerAll(marble_pillar_slab, "marble_pillar_slab", ItemCarvableSlab.class); - registerSlabTop(marble_pillar_slab, marble_pillar_slab.top); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.marble_pillar, 6), "XX", "XX", "XX", 'X', new ItemStack(ChiselBlocks.marble, 1, OreDictionary.WILDCARD_VALUE)); - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.marble_pillar_slab, 6, 0), "***", '*', new ItemStack(ChiselBlocks.marble_pillar, 1, OreDictionary.WILDCARD_VALUE)); - } - }, - - NATION { - - @Override - void addBlocks() { - BlockCarvable imperial = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); - imperial.carverHelper.addVariation("tile.imperial.0.desc", 0, "military/imperialCamo"); - imperial.carverHelper.addVariation("tile.imperial.1.desc", 1, "military/imperialCamoSecluded"); - imperial.carverHelper.addVariation("tile.imperial.2.desc", 2, "military/imperialPlate"); - imperial.carverHelper.addVariation("tile.imperial.3.desc", 3, "military/imperialCautionWhite"); - imperial.carverHelper.addVariation("tile.imperial.4.desc", 4, "military/imperialCautionOrange"); - imperial.carverHelper.registerBlock(imperial, "nation"); - - BlockCarvable rebel = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); - rebel.carverHelper.addVariation("tile.rebel.0.desc", 0, "military/rebelCamo", 20); - rebel.carverHelper.addVariation("tile.rebel.1.desc", 1, "military/rebelCamoSecluded", 21); - rebel.carverHelper.addVariation("tile.rebel.2.desc", 2, "military/rebelPlate", 22); - rebel.carverHelper.addVariation("tile.rebel.3.desc", 3, "military/rebelCautionWhite", 23); - rebel.carverHelper.addVariation("tile.rebel.4.desc", 4, "military/rebelCautionRed", 24); - rebel.carverHelper.registerBlock(rebel, "rebel"); - - imperial.carverHelper.registerVariations("military"); - rebel.carverHelper.registerVariations("military"); - - Carving.chisel.registerOre("military", "military"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.rebel, 32, 0), new Object[] { "xyx", "yzy", "xyx", 'x', "stone", 'y', Items.iron_ingot, 'z', Items.gold_nugget })); - } - }, - - NETHER_BRICK { - - @Override - void addBlocks() { - BlockCarvable nether_brick = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10.0F) - .setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("nether_brick", Blocks.nether_brick, 0, 0); - // netherBrick.carverHelper.addVariation("Nether brick", 0, - // Blocks.nether_brick); - nether_brick.carverHelper.addVariation("tile.netherBrick.1.desc", 1, "netherbrick/a1-netherbrick-brinstar"); - nether_brick.carverHelper.addVariation("tile.netherBrick.2.desc", 2, "netherbrick/a1-netherbrick-classicspatter"); - nether_brick.carverHelper.addVariation("tile.netherBrick.3.desc", 3, "netherbrick/a1-netherbrick-guts"); - nether_brick.carverHelper.addVariation("tile.netherBrick.4.desc", 4, "netherbrick/a1-netherbrick-gutsdark"); - nether_brick.carverHelper.addVariation("tile.netherBrick.5.desc", 5, "netherbrick/a1-netherbrick-gutssmall"); - nether_brick.carverHelper.addVariation("tile.netherBrick.6.desc", 6, "netherbrick/a1-netherbrick-lavabrinstar"); - nether_brick.carverHelper.addVariation("tile.netherBrick.7.desc", 7, "netherbrick/a1-netherbrick-lavabrown"); - nether_brick.carverHelper.addVariation("tile.netherBrick.8.desc", 8, "netherbrick/a1-netherbrick-lavaobsidian"); - nether_brick.carverHelper.addVariation("tile.netherBrick.9.desc", 9, "netherbrick/a1-netherbrick-lavastonedark"); - nether_brick.carverHelper.addVariation("tile.netherBrick.10.desc", 10, "netherbrick/a1-netherbrick-meat"); - nether_brick.carverHelper.addVariation("tile.netherBrick.11.desc", 11, "netherbrick/a1-netherbrick-meatred"); - nether_brick.carverHelper.addVariation("tile.netherBrick.12.desc", 12, "netherbrick/a1-netherbrick-meatredsmall"); - nether_brick.carverHelper.addVariation("tile.netherBrick.13.desc", 13, "netherbrick/a1-netherbrick-meatsmall"); - nether_brick.carverHelper.addVariation("tile.netherBrick.14.desc", 14, "netherbrick/a1-netherbrick-red"); - nether_brick.carverHelper.addVariation("tile.netherBrick.15.desc", 15, "netherbrick/a1-netherbrick-redsmall"); - nether_brick.carverHelper.registerAll(nether_brick, "nether_brick"); - Carving.chisel.registerOre("nether_brick", "nether_brick"); - } - }, - - NETHER_RACK { - - @Override - void addBlocks() { - - BlockCarvable netherrack = (BlockCarvable) new BlockCarvable(Material.rock) { - - @Override - public boolean isFireSource(World world, int x, int y, int z, ForgeDirection side) { - return side == ForgeDirection.UP; - } - - }.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(0.4F).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("netherrack", Blocks.netherrack, 0, 0); - netherrack.carverHelper.addVariation("tile.hellrock.1.desc", 1, "netherrack/a1-netherrack-bloodgravel"); - netherrack.carverHelper.addVariation("tile.hellrock.2.desc", 2, "netherrack/a1-netherrack-bloodrock"); - netherrack.carverHelper.addVariation("tile.hellrock.3.desc", 3, "netherrack/a1-netherrack-bloodrockgrey"); - netherrack.carverHelper.addVariation("tile.hellrock.4.desc", 4, "netherrack/a1-netherrack-brinstar"); - netherrack.carverHelper.addVariation("tile.hellrock.5.desc", 5, "netherrack/a1-netherrack-brinstarshale"); - netherrack.carverHelper.addVariation("tile.hellrock.6.desc", 6, "netherrack/a1-netherrack-classic"); - netherrack.carverHelper.addVariation("tile.hellrock.7.desc", 7, "netherrack/a1-netherrack-classicspatter"); - netherrack.carverHelper.addVariation("tile.hellrock.8.desc", 8, "netherrack/a1-netherrack-guts"); - netherrack.carverHelper.addVariation("tile.hellrock.9.desc", 9, "netherrack/a1-netherrack-gutsdark"); - netherrack.carverHelper.addVariation("tile.hellrock.10.desc", 10, "netherrack/a1-netherrack-meat"); - netherrack.carverHelper.addVariation("tile.hellrock.11.desc", 11, "netherrack/a1-netherrack-meatred"); - netherrack.carverHelper.addVariation("tile.hellrock.12.desc", 12, "netherrack/a1-netherrack-meatrock"); - netherrack.carverHelper.addVariation("tile.hellrock.13.desc", 13, "netherrack/a1-netherrack-red"); - netherrack.carverHelper.addVariation("tile.hellrock.14.desc", 14, "netherrack/a1-netherrack-wells"); - - netherrack.carverHelper.registerAll(netherrack, "netherrack"); - Carving.chisel.registerOre("netherrack", "netherrack"); - } - }, - - OBSIDIAN { - - @Override - void addBlocks() { - BlockCarvable obsidian = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(50.0F).setResistance(2000.0F) - .setStepSound(Block.soundTypeStone); - - Carving.chisel.addVariation("obsidian", Blocks.obsidian, 0, 0); - obsidian.carverHelper.addVariation("tile.obsidian.1.desc", 1, "obsidian/pillar"); - obsidian.carverHelper.addVariation("tile.obsidian.2.desc", 2, "obsidian/pillar-quartz"); - obsidian.carverHelper.addVariation("tile.obsidian.3.desc", 3, "obsidian/chiseled"); - obsidian.carverHelper.addVariation("tile.obsidian.4.desc", 4, "obsidian/panel-shiny"); - obsidian.carverHelper.addVariation("tile.obsidian.5.desc", 5, "obsidian/panel"); - obsidian.carverHelper.addVariation("tile.obsidian.6.desc", 6, "obsidian/chunks"); - obsidian.carverHelper.addVariation("tile.obsidian.7.desc", 7, "obsidian/growth"); - obsidian.carverHelper.addVariation("tile.obsidian.8.desc", 8, "obsidian/crystal"); - obsidian.carverHelper.addVariation("tile.obsidian.9.desc", 9, "obsidian/map-a"); - obsidian.carverHelper.addVariation("tile.obsidian.10.desc", 10, "obsidian/map-b"); - obsidian.carverHelper.addVariation("tile.obsidian.11.desc", 11, "obsidian/panel-light"); - obsidian.carverHelper.addVariation("tile.obsidian.12.desc", 12, "obsidian/blocks"); - obsidian.carverHelper.addVariation("tile.obsidian.13.desc", 13, "obsidian/tiles"); - obsidian.carverHelper.addVariation("tile.obsidian.14.desc", 14, "obsidian/greek"); - obsidian.carverHelper.addVariation("tile.obsidian.15.desc", 15, "obsidian/crate"); - - obsidian.carverHelper.registerAll(obsidian, "obsidian"); - Carving.chisel.registerOre("obsidian", "obsidian"); - } - }, - - PACKEDICE { - - @Override - void addBlocks() { - BlockCarvablePackedIce packedice = (BlockCarvablePackedIce) new BlockCarvablePackedIce().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3) - .setStepSound(Block.soundTypeGlass); - Carving.chisel.addVariation("packedice", Blocks.packed_ice, 0, 0); - packedice.carverHelper.addVariation("tile.packedice.1.desc", 1, "ice/a1-ice-light"); - packedice.carverHelper.addVariation("tile.packedice.2.desc", 2, "ice/a1-stonecobble-icecobble"); - packedice.carverHelper.addVariation("tile.packedice.3.desc", 3, "ice/a1-netherbrick-ice"); - packedice.carverHelper.addVariation("tile.packedice.4.desc", 4, "ice/a1-stonecobble-icebrick"); - packedice.carverHelper.addVariation("tile.packedice.5.desc", 5, "ice/a1-stonecobble-icebricksmall"); - packedice.carverHelper.addVariation("tile.packedice.6.desc", 6, "ice/a1-stonecobble-icedungeon"); - packedice.carverHelper.addVariation("tile.packedice.7.desc", 7, "ice/a1-stonecobble-icefour"); - packedice.carverHelper.addVariation("tile.packedice.8.desc", 8, "ice/a1-stonecobble-icefrench"); - packedice.carverHelper.addVariation("tile.packedice.9.desc", 9, "ice/sunkentiles"); - packedice.carverHelper.addVariation("tile.packedice.10.desc", 10, "ice/tiles"); - packedice.carverHelper.addVariation("tile.packedice.11.desc", 11, "ice/a1-stonecobble-icepanel"); - packedice.carverHelper.addVariation("tile.packedice.12.desc", 12, "ice/a1-stoneslab-ice"); - packedice.carverHelper.addVariation("tile.packedice.13.desc", 13, "ice/zelda"); - packedice.carverHelper.addVariation("tile.packedice.14.desc", 14, "ice/bismuth"); - packedice.carverHelper.addVariation("tile.packedice.15.desc", 15, "ice/poison"); - packedice.carverHelper.registerAll(packedice, "packedice"); - Carving.chisel.registerOre("packedice", "packedice"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.packedice_pillar, 6, 0), "XX", "XX", "XX", 'X', new ItemStack(ChiselBlocks.packedice, 1, OreDictionary.WILDCARD_VALUE)); - } - }, - - PACKEDICE_PILLAR { - - @Override - void addBlocks() { - BlockCarvablePackedIce packedice_pillar = (BlockCarvablePackedIce) new BlockCarvablePackedIce().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3) - .setStepSound(Block.soundTypeGlass); - - packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.0.desc", 0, "icepillar/plainplain"); - packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.1.desc", 1, "icepillar/plaingreek"); - packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.2.desc", 2, "icepillar/greekplain"); - packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.3.desc", 3, "icepillar/greekgreek"); - packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.4.desc", 4, "icepillar/convexplain"); - packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.5.desc", 5, "icepillar/carved"); - packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.6.desc", 6, "icepillar/ornamental"); - packedice_pillar.carverHelper.registerAll(packedice_pillar, "packedice_pillar"); - } - }, - - PACKEDICE_STAIRS { - - @Override - void addBlocks() { - CarvableStairsMaker makerPackedIceStairs = new CarvableStairsMaker(Blocks.packed_ice); - - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.0.desc", 0, Blocks.packed_ice); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.1.desc", 1, "ice/a1-ice-light"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.2.desc", 2, "ice/a1-stonecobble-icecobble"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.3.desc", 3, "ice/a1-netherbrick-ice"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.4.desc", 4, "ice/a1-stonecobble-icebrick"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.5.desc", 5, "ice/a1-stonecobble-icebricksmall"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.6.desc", 6, "ice/a1-stonecobble-icedungeon"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.7.desc", 7, "ice/a1-stonecobble-icefour"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.8.desc", 8, "ice/a1-stonecobble-icefrench"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.9.desc", 9, "ice/sunkentiles"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.10.desc", 10, "ice/tiles"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.11.desc", 11, "ice/a1-stonecobble-icepanel"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.12.desc", 12, "ice/a1-stoneslab-ice"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.13.desc", 13, "ice/zelda"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.14.desc", 14, "ice/bismuth"); - makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.15.desc", 15, "ice/poison"); - makerPackedIceStairs.create(new IStairsCreator() { - - @Override - public BlockCarvableStairs create(Block block, int meta, CarvableHelper helper) { - return new BlockCarvablePackedIceStairs(block, meta, helper); - } - }, "packedice_stairs", ChiselBlocks.packediceStairs); - Carving.chisel.registerOre("packedice_stairs", "packedIceStairs"); - } - }, - - PAPER_WALL { - - @Override - void addBlocks() { - BlockCarvablePane paperwall = (BlockCarvablePane) new BlockCarvablePane(Material.ground, true).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setResistance(0.5F); - - paperwall.carverHelper.addVariation("tile.paperwall.0.desc", 0, "paper/box"); - paperwall.carverHelper.addVariation("tile.paperwall.1.desc", 1, "paper/throughMiddle"); - paperwall.carverHelper.addVariation("tile.paperwall.2.desc", 2, "paper/cross"); - paperwall.carverHelper.addVariation("tile.paperwall.3.desc", 3, "paper/sixSections"); - paperwall.carverHelper.addVariation("tile.paperwall.4.desc", 4, "paper/vertical"); - paperwall.carverHelper.addVariation("tile.paperwall.5.desc", 5, "paper/horizontal"); - paperwall.carverHelper.addVariation("tile.paperwall.6.desc", 6, "paper/floral"); - paperwall.carverHelper.addVariation("tile.paperwall.7.desc", 7, "paper/plain"); - paperwall.carverHelper.addVariation("tile.paperwall.8.desc", 8, "paper/door"); - - paperwall.carverHelper.registerAll(paperwall, "paperwall"); - Carving.chisel.registerOre("paperwall", "paperwall"); - - BlockCarvable paperwall_block = (BlockCarvable) new BlockCarvable(Material.ground).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setResistance(0.5F); - - paperwall_block.carverHelper.addVariation("tile.paperwall.0.desc", 0, "paper/box"); - paperwall_block.carverHelper.addVariation("tile.paperwall.1.desc", 1, "paper/throughMiddle"); - paperwall_block.carverHelper.addVariation("tile.paperwall.2.desc", 2, "paper/cross"); - paperwall_block.carverHelper.addVariation("tile.paperwall.3.desc", 3, "paper/sixSections"); - paperwall_block.carverHelper.addVariation("tile.paperwall.4.desc", 4, "paper/vertical"); - paperwall_block.carverHelper.addVariation("tile.paperwall.5.desc", 5, "paper/horizontal"); - paperwall_block.carverHelper.addVariation("tile.paperwall.6.desc", 6, "paper/floral"); - paperwall_block.carverHelper.addVariation("tile.paperwall.7.desc", 7, "paper/plain"); - paperwall_block.carverHelper.addVariation("tile.paperwall.8.desc", 8, "paper/door"); - - paperwall_block.carverHelper.registerAll(paperwall_block, "paperwall_block"); - Carving.chisel.registerOre("paperwall_block", "paperwall_block"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.paperwall, 8), "ppp", "psp", "ppp", ('p'), Items.paper, ('s'), "stickWood")); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.paperwall_block, 4), "pp", "pp", ('p'), ChiselBlocks.paperwall)); - } - }, - - PRESENT { - - @Override - void addBlocks() { - BlockPresent present = (BlockPresent) new BlockPresent().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(2.0F).setResistance(10.0F).setBlockName("chisel.present"); - for (int i = 0; i < 16; i++) { - present.carverHelper.addVariation("tile.chisel.present.desc", i, "planks_oak", "minecraft"); - } - present.carverHelper.registerAll(present, "present", ItemBlockPresent.class); - Carving.chisel.registerOre("present", "chest"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ChiselBlocks.present, 1, meta), new ItemStack(Blocks.chest, 1), dyeOres[meta])); - } - - @Override - boolean needsMetaRecipes() { - return true; - } - }, - - PUMPKIN { - - @Override - void addBlocks() { - for (int metadata = 0; metadata < 16; metadata++) { - pumpkin[metadata] = (BlockCarvablePumpkin) new BlockCarvablePumpkin(false).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(1.0F).setBlockName("pumpkin") - .setCreativeTab(ChiselTabs.tabOtherChiselBlocks); - pumpkin[metadata].setInformation("pumpkin/pumpkin_face_" + (metadata + 1) + "_off"); - GameRegistry.registerBlock(pumpkin[metadata], ItemCarvablePumpkin.class, "pumpkin" + (metadata + 1)); - Carving.chisel.addVariation("pumpkin", pumpkin[metadata], 0, (metadata + 1)); - } - Carving.chisel.addVariation("pumpkin", Blocks.pumpkin, 0, 0); - Carving.chisel.registerOre("pumpkin", "pumpkin"); - } - - @Override - void addRecipes() { - GameRegistry.addShapelessRecipe(new ItemStack(ChiselBlocks.jackolantern[meta]), new ItemStack(ChiselBlocks.pumpkin[meta], 1), new ItemStack(Item.getItemFromBlock(Blocks.torch), 1)); - } - - @Override - boolean needsMetaRecipes() { - return true; - } - }, - - PURPUR { - - @Override - void addBlocks() { - BlockCarvable purpur = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); - purpur.carverHelper.addVariation("tile.purpur.0.desc", 0, "end_purpur/purpur_block"); - purpur.carverHelper.addVariation("tile.purpur.1.desc", 1, "end_purpur/purpur_pillar"); - purpur.carverHelper.addVariation("tile.purpur.2.desc", 2, "end_purpur/shulker"); - purpur.carverHelper.addVariation("tile.purpur.3.desc", 3, "end_purpur/tilePurpur"); - purpur.carverHelper.addVariation("tile.purpur.4.desc", 4, "end_purpur/tileBrokenPurpur"); - purpur.carverHelper.addVariation("tile.purpur.5.desc", 5, "end_purpur/prismaticPurpur"); - purpur.carverHelper.addVariation("tile.purpur.6.desc", 6, "end_purpur/purpurBricks"); - purpur.carverHelper.addVariation("tile.purpur.7.desc", 7, "end_purpur/purpurCobble"); - purpur.carverHelper.addVariation("tile.purpur.8.desc", 8, "end_purpur/arcanePurpur"); - purpur.carverHelper.addVariation("tile.purpur.9.desc", 9, "end_purpur/purpurLargeTile"); - purpur.carverHelper.addVariation("tile.purpur.10.desc", 10, "end_purpur/purpurOrnate"); - - purpur.carverHelper.registerAll(purpur, "purpur"); - Carving.chisel.registerOre("purpur", "purpur"); - } - - @Override - void addRecipes() { - GameRegistry.addShapelessRecipe(new ItemStack(ChiselBlocks.purpur), new ItemStack(Item.getItemFromBlock(Blocks.end_stone), 1), new ItemStack(Items.dye, 1, 5)); - } - }, - - QUARTZ { - - @Override - void addBlocks() { - Carving.chisel.addVariation("quartz", Blocks.quartz_block, 0, 0); - Carving.chisel.addVariation("quartz", Blocks.quartz_block, 1, 0); - Carving.chisel.addVariation("quartz", Blocks.quartz_block, 2, 0); - Carving.chisel.registerOre("quartz", "quartz"); - } - }, - - /** - * Dummy feature for all RC subsets - */ - RAILCRAFT("Railcraft"), - - RC_ABYSSAL_BLOCK(RAILCRAFT.getRequiredMod(), RAILCRAFT) { - - @Override - void addBlocks() { - Block abyssal = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.abyssal"); - if (abyssal == null) { - abyssal = GameRegistry.findBlock("Railcraft", "brick.abyssal"); - } - - Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 0, 0); - Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 1, 1); - Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 2, 2); - Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 3, 3); - Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 4, 4); - Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 5, 5); - Carving.chisel.registerOre("RCAbyssalBlock", "RCAbyssalBlock"); - } - - ; - }, - RC_BLEACHED_BONE(RAILCRAFT.getRequiredMod(), RAILCRAFT) { - - @Override - void addBlocks() { - Block bleachedBone = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"); - if (bleachedBone == null) { - bleachedBone = GameRegistry.findBlock("Railcraft", "brick.bleachedbone"); - } - - Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 0, 0); - Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 1, 1); - Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 2, 2); - Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 3, 3); - Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 4, 4); - Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 5, 5); - Carving.chisel.registerOre("RCBleachedBone", "RCBleachedBone"); - } - }, - - RC_BLOOD_STAINED(RAILCRAFT.getRequiredMod(), RAILCRAFT) { - - @Override - void addBlocks() { - Block bloodStained = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"); - if (bloodStained == null) { - bloodStained = GameRegistry.findBlock("Railcraft", "brick.bloodstained"); - } - - Carving.chisel.addVariation("RCBloodStained", bloodStained, 0, 0); - Carving.chisel.addVariation("RCBloodStained", bloodStained, 1, 1); - Carving.chisel.addVariation("RCBloodStained", bloodStained, 2, 2); - Carving.chisel.addVariation("RCBloodStained", bloodStained, 3, 3); - Carving.chisel.addVariation("RCBloodStained", bloodStained, 4, 4); - Carving.chisel.addVariation("RCBloodStained", bloodStained, 5, 5); - Carving.chisel.registerOre("RCBloodStained", "RCBloodStained"); - } - }, - - RC_FROST_BOUND_BLOCK(RAILCRAFT.getRequiredMod(), RAILCRAFT) { - - @Override - void addBlocks() { - Block frostBound = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"); - if (frostBound == null) { - frostBound = GameRegistry.findBlock("Railcraft", "brick.frostbound"); - } - Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 0, 0); - Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 1, 1); - Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 2, 2); - Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 3, 3); - Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 4, 4); - Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 5, 5); - Carving.chisel.registerOre("RCFrostBoundBlock", "RCFrostBoundBlock"); - } - }, - - RC_INFERNAL_STONE(RAILCRAFT.getRequiredMod(), RAILCRAFT) { - - @Override - void addBlocks() { - Block infernal = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"); - if (infernal == null) { - infernal = GameRegistry.findBlock("Railcraft", "brick.infernal"); - } - Carving.chisel.addVariation("RCInfernalStone", infernal, 0, 0); - Carving.chisel.addVariation("RCInfernalStone", infernal, 1, 1); - Carving.chisel.addVariation("RCInfernalStone", infernal, 2, 2); - Carving.chisel.addVariation("RCInfernalStone", infernal, 3, 3); - Carving.chisel.addVariation("RCInfernalStone", infernal, 4, 4); - Carving.chisel.addVariation("RCInfernalStone", infernal, 5, 5); - Carving.chisel.registerOre("RCInfernalStone", "RCInfernalStone"); - } - }, - - RC_QUARRIED_BLOCK(RAILCRAFT.getRequiredMod(), RAILCRAFT) { - - @Override - void addBlocks() { - Block quarried = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"); - if (quarried == null) { - quarried = GameRegistry.findBlock("Railcraft", "brick.quarried"); - } - Carving.chisel.addVariation("RCQuarriedBlock", quarried, 0, 0); - Carving.chisel.addVariation("RCQuarriedBlock", quarried, 1, 1); - Carving.chisel.addVariation("RCQuarriedBlock", quarried, 2, 2); - Carving.chisel.addVariation("RCQuarriedBlock", quarried, 3, 3); - Carving.chisel.addVariation("RCQuarriedBlock", quarried, 4, 4); - Carving.chisel.addVariation("RCQuarriedBlock", quarried, 5, 5); - Carving.chisel.registerOre("RCQuarriedBlock", "RCQuarriedBlock"); - } - - ; - }, - - RC_SANDY_STONE(RAILCRAFT.getRequiredMod(), RAILCRAFT) { - - @Override - void addBlocks() { - Block sandy = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"); - if (sandy == null) { - sandy = GameRegistry.findBlock("Railcraft", "brick.sandy"); - } - Carving.chisel.addVariation("RCSandyStone", sandy, 0, 0); - Carving.chisel.addVariation("RCSandyStone", sandy, 1, 1); - Carving.chisel.addVariation("RCSandyStone", sandy, 2, 2); - Carving.chisel.addVariation("RCSandyStone", sandy, 3, 3); - Carving.chisel.addVariation("RCSandyStone", sandy, 4, 4); - Carving.chisel.addVariation("RCSandyStone", sandy, 5, 5); - Carving.chisel.registerOre("RCSandyStone", "RCSandyStone"); - } - }, - - REDSTONE_BLOCK { - - @Override - void addBlocks() { - BlockCarvable redstone_block = (BlockCarvablePowered) (new BlockCarvablePowered(Material.iron)).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(5.0F).setResistance(10.0F) - .setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("redstone_block", Blocks.redstone_block, 0, 0); - redstone_block.carverHelper.addVariation("tile.redstone_block.1.desc", 1, "redstone/smooth"); - redstone_block.carverHelper.addVariation("tile.redstone_block.2.desc", 2, "redstone/block"); - redstone_block.carverHelper.addVariation("tile.redstone_block.3.desc", 3, "redstone/blocks"); - redstone_block.carverHelper.addVariation("tile.redstone_block.4.desc", 4, "redstone/bricks"); - redstone_block.carverHelper.addVariation("tile.redstone_block.5.desc", 5, "redstone/smallbricks"); - redstone_block.carverHelper.addVariation("tile.redstone_block.6.desc", 6, "redstone/smallchaotic"); - redstone_block.carverHelper.addVariation("tile.redstone_block.7.desc", 7, "redstone/chiseled"); - redstone_block.carverHelper.addVariation("tile.redstone_block.8.desc", 8, "redstone/ere"); - redstone_block.carverHelper.addVariation("tile.redstone_block.9.desc", 9, "redstone/ornate-tiles"); - redstone_block.carverHelper.addVariation("tile.redstone_block.10.desc", 10, "redstone/pillar"); - redstone_block.carverHelper.addVariation("tile.redstone_block.11.desc", 11, "redstone/tiles"); - redstone_block.carverHelper.addVariation("tile.redstone_block.12.desc", 12, "redstone/circuit"); - redstone_block.carverHelper.addVariation("tile.redstone_block.13.desc", 13, "redstone/supaplex"); - redstone_block.carverHelper.addVariation("tile.redstone_block.14.desc", 14, "redstone/a1-blockredstone-skullred"); - redstone_block.carverHelper.addVariation("tile.redstone_block.15.desc", 15, "redstone/a1-blockredstone-redstonezelda"); - - redstone_block.carverHelper.registerAll(redstone_block, "redstone_block"); - Carving.chisel.registerOre("redstone_block", "redstone"); - } - }, - - ROAD_LINE { - - @Override - void addBlocks() { - BlockRoadLine road_line = (BlockRoadLine) new BlockRoadLine().setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.01F) - .setBlockName("roadLine"); - road_line.carverHelper.addVariation("tile.roadLine.0.desc", 0, "line-marking/white-center"); - road_line.carverHelper.addVariation("tile.roadLine.1.desc", 1, "line-marking/double-white-center"); - road_line.carverHelper.addVariation("tile.roadLine.2.desc", 2, "line-marking/yellow-center"); - road_line.carverHelper.addVariation("tile.roadLine.3.desc", 3, "line-marking/double-yellow-center"); - road_line.carverHelper.registerAll(road_line, "road_line"); - Carving.chisel.registerOre("road_line", "roadLine"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.road_line, 8, 0), "wrw", "wrw", "wrw", ('w'), "dyeWhite", ('r'), Items.redstone)); - } - }, - - SANDSTONE { - - @Override - void addBlocks() { - BlockCarvable sandstone = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone).setHardness(0.8F); - Carving.chisel.addVariation("sandstone", Blocks.sandstone, 0, -5); - Carving.chisel.addVariation("sandstone", Blocks.sandstone, 1, -4); - Carving.chisel.addVariation("sandstone", Blocks.sandstone, 2, -3); - sandstone.carverHelper.addVariation("tile.sandstone.0.desc", 0, "sandstone/terrain-sandstone-smoothglyph", 16); - sandstone.carverHelper.addVariation("tile.sandstone.1.desc", 1, "sandstone/terrain-sandstone-solidcobble", 17); - sandstone.carverHelper.addVariation("tile.sandstone.2.desc", 2, "sandstone/a0-sandstonepreview-boxcreeper", 18); - sandstone.carverHelper.addVariation("tile.sandstone.3.desc", 3, "sandstone/faded"); - sandstone.carverHelper.addVariation("tile.sandstone.4.desc", 4, "sandstone/column"); - sandstone.carverHelper.addVariation("tile.sandstone.5.desc", 5, "sandstone/capstone"); - sandstone.carverHelper.addVariation("tile.sandstone.6.desc", 6, "sandstone/small"); - sandstone.carverHelper.addVariation("tile.sandstone.7.desc", 7, "sandstone/base"); - sandstone.carverHelper.addVariation("tile.sandstone.8.desc", 8, "sandstone/smooth"); - sandstone.carverHelper.addVariation("tile.sandstone.9.desc", 9, "sandstone/smooth-cap"); - sandstone.carverHelper.addVariation("tile.sandstone.10.desc", 10, "sandstone/smooth-small"); - sandstone.carverHelper.addVariation("tile.sandstone.11.desc", 11, "sandstone/smooth-base"); - sandstone.carverHelper.addVariation("tile.sandstone.12.desc", 12, "sandstone/block"); - sandstone.carverHelper.addVariation("tile.sandstone.13.desc", 13, "sandstone/blocks"); - sandstone.carverHelper.addVariation("tile.sandstone.14.desc", 14, "sandstone/mosaic"); - sandstone.carverHelper.addVariation("tile.sandstone.15.desc", 15, "sandstone/horizontal-tiles"); - sandstone.carverHelper.registerAll(sandstone, "sandstone"); - - BlockCarvable sandstone2 = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone).setHardness(0.8F); - sandstone2.carverHelper.addVariation("tile.sandstone.16.desc", 0, "sandstone2/terrain-sandstone-brickflat", 19); - sandstone2.carverHelper.addVariation("tile.sandstone.17.desc", 1, "sandstone2/a0-sandstonepreview-smoothflat", 20); - sandstone2.carverHelper.registerBlock(sandstone2, "sandstone2"); - sandstone2.carverHelper.registerVariations("sandstone"); - - BlockCarvable sandstone_scribbles = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone).setHardness(0.8F); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 0, "sandstone-scribbles/scribbles-0", 36); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 1, "sandstone-scribbles/scribbles-1", 37); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 2, "sandstone-scribbles/scribbles-2", 38); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 3, "sandstone-scribbles/scribbles-3", 39); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 4, "sandstone-scribbles/scribbles-4", 40); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 5, "sandstone-scribbles/scribbles-5", 41); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 6, "sandstone-scribbles/scribbles-6", 42); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 7, "sandstone-scribbles/scribbles-7", 43); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 8, "sandstone-scribbles/scribbles-8", 44); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 9, "sandstone-scribbles/scribbles-9", 45); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 10, "sandstone-scribbles/scribbles-10", 46); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 11, "sandstone-scribbles/scribbles-11", 47); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 12, "sandstone-scribbles/scribbles-12", 48); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 13, "sandstone-scribbles/scribbles-13", 49); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 14, "sandstone-scribbles/scribbles-14", 50); - sandstone_scribbles.carverHelper.addVariation("tile.sandstoneScribbles.desc", 15, "sandstone-scribbles/scribbles-15", 51); - sandstone_scribbles.carverHelper.registerBlock(sandstone_scribbles, "sandstone_scribbles"); - sandstone_scribbles.carverHelper.registerVariations("sandstone"); - - Carving.chisel.registerOre("sandstone", "sandstone"); - } - - @Override - void addRecipes() { - if (meta == 0) { - // The following recipe is due to bugs with Chisel 1.5.1 to - // 1.5.6a - GameRegistry.addRecipe(new ItemStack(Blocks.sandstone, 1, 0), "X", 'X', new ItemStack(ChiselBlocks.sandstone, 1, 0)); - // The following recipe is due to bug with Chisel 1.5.6b - GameRegistry.addRecipe(new ItemStack(Blocks.sandstone, 1, 1), "X", 'X', new ItemStack(ChiselBlocks.sandstone, 1, 1)); - } - GameRegistry.addRecipe(new ItemStack(Blocks.sandstone, 1, 1), "X", 'X', new ItemStack(ChiselBlocks.sandstone_scribbles, 1, OreDictionary.WILDCARD_VALUE)); - } - }, - - SILVER { - - @Override - void addBlocks() { - BlockCarvable silver = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) - .setResistance(10F); - silver.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/silver/caution", 20); - silver.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/silver/crate", 21); - silver.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/silver/thermal", 22); - silver.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/silver/adv", 23); - silver.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/silver/egregious", 24); - silver.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/silver/bolted", 25); - silver.carverHelper.registerAll(silver, "silverblock"); - Carving.chisel.registerOre("silverblock", "blockSilver"); - } - }, - - SMASHING_ROCK { - - @Override - void addItems() { - ItemSmashingRock smashingrock = (ItemSmashingRock) new ItemSmashingRock().setTextureName("Chisel:smashingrock").setCreativeTab(ChiselTabs.tabChisel); - EntityRegistry.registerModEntity(EntitySmashingRock.class, "SmashingRock", 3, Chisel.instance, 40, 1, true); - GameRegistry.registerItem(smashingrock, "smashingrock"); - } - - @Override - void addRecipes() { - GameRegistry.addShapelessRecipe(new ItemStack(ChiselItems.smashingrock, 16), new Object[] { new ItemStack(Items.stone_pickaxe), new ItemStack(Items.glass_bottle, 1), - new ItemStack(Items.stone_shovel) }); - } - }, - - SNAKE_SANDSTONE(SANDSTONE) { - - @Override - void addBlocks() { - BlockSnakestone sand_snakestone = (BlockSnakestone) new BlockSnakestone("Chisel:snakestone/sandsnake/").setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setBlockName( - "chisel.snakestoneSand"); - GameRegistry.registerBlock(sand_snakestone, ItemCarvable.class, "sand_snakestone"); - // TODO- eat me! - // LanguageRegistry.addName(new ItemStack(sandSnakestone, 1, 1), - // "Sandstone snake block head"); - // LanguageRegistry.addName(new ItemStack(sandSnakestone, 1, - // 13), "Sandstone snake block body"); - Carving.chisel.addVariation("sandstone", sand_snakestone, 1, 100); - Carving.chisel.addVariation("sandstone", sand_snakestone, 13, 101); - // Carving.chisel.registerOre("sandstone", "sandSnakestone"); - } - }, - - SNAKESTONE { - - @Override - void addBlocks() { - BlockSnakestone stone_snakestone = (BlockSnakestone) new BlockSnakestone("Chisel:snakestone/snake/").setBlockName("chisel.snakestoneStone").setCreativeTab(ChiselTabs.tabStoneChiselBlocks); - GameRegistry.registerBlock(stone_snakestone, ItemCarvable.class, "stone_snakestone"); - // LanguageRegistry.addName(new ItemStack(snakestone, 1, 1), - // "Stone snake block head"); - // LanguageRegistry.addName(new ItemStack(snakestone, 1, 13), - // "Stone snake block body"); - Carving.chisel.addVariation("stonebrick", stone_snakestone, 1, 100); - Carving.chisel.addVariation("stonebrick", stone_snakestone, 13, 101); - // Carving.chisel.registerOre("snakestoneStone", "snakestoneStone"); - } - }, - - SNAKESTONE_OBSIDIAN { - - @Override - void addBlocks() { - BlockSnakestoneObsidian obsidian_snakestone = (BlockSnakestoneObsidian) new BlockSnakestoneObsidian("Chisel:snakestone/obsidian/").setBlockName("chisel.obsidianSnakestone") - .setHardness(50.0F).setResistance(2000.0F); - GameRegistry.registerBlock(obsidian_snakestone, ItemCarvable.class, "obsidian_snakestone"); - Carving.chisel.addVariation("obsidian", obsidian_snakestone, 1, 100); - Carving.chisel.addVariation("obsidian", obsidian_snakestone, 13, 101); - // Carving.chisel.registerOre("obsidianSnakestone", - // "obsidianSnakestone"); - } - }, - - STEEL { - - @Override - void addBlocks() { - BlockCarvable steel = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) - .setResistance(10F); - steel.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/steel/caution", 20); - steel.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/steel/crate", 21); - steel.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/steel/thermal", 22); - steel.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/steel/adv", 23); - steel.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/steel/egregious", 24); - steel.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/steel/bolted", 25); - steel.carverHelper.registerAll(steel, "steelblock"); - Carving.chisel.registerOre("steelblock", "blockSteel"); - } - }, - - STONE_BRICK { - - @Override - void addBlocks() { - BlockCarvable stonebricksmooth = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(1.5F).setResistance(10.0F) - .setStepSound(Block.soundTypeStone); - if (Configurations.allowSmoothStone) { - Carving.chisel.addVariation("stonebricksmooth", Blocks.stone, 0, -1); - } - for (int i = 0; i < 4; i++) { - if ((i == 1) && (Configurations.allowMossy)) { - Carving.chisel.addVariation("stonebricksmooth", Blocks.stonebrick, i, i); - } else if (i != 1) { - Carving.chisel.addVariation("stonebricksmooth", Blocks.stonebrick, i, i); - } - } - - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.0.desc", 0, "stonebrick2/masonBricksPlain", 16); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.1.desc", 1, "stonebrick2/masonBricksFelsic", 17); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.2.desc", 2, "stonebrick2/masonBricksMafic", 18); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.3.desc", 3, "stonebrick2/masonBricksMixed", 19); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.4.desc", 4, "stonebrick/smallbricks"); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.5.desc", 5, "stonebrick/largebricks"); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.6.desc", 6, "stonebrick/smallchaotic"); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.7.desc", 7, "stonebrick/chaoticbricks"); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.8.desc", 8, "stonebrick/chaotic"); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.9.desc", 9, "stonebrick/fancy"); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.10.desc", 10, "stonebrick/ornate"); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.11.desc", 11, "stonebrick/largeornate"); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.12.desc", 12, "stonebrick/panel-hard"); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.13.desc", 13, "stonebrick/sunken"); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.14.desc", 14, "stonebrick/ornatepanel"); - stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.15.desc", 15, "stonebrick/poison"); - - stonebricksmooth.carverHelper.registerAll(stonebricksmooth, "stonebricksmooth"); - Carving.chisel.registerOre("stonebricksmooth", "stonebricksmooth"); - - // Carving.chisel.addVariation("stonebricksmooth", GameRegistry.findBlock("Chisel-2", "tile.TFTowerStone"), 0, 0); - } - }, - - TALLOW("Thaumcraft") { - - @Override - void addBlocks() { - BlockCarvable tallow = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeSnow); - Carving.chisel.addVariation("tallow", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 5, 0); - tallow.carverHelper.addVariation("tile.tallow.0.desc", 0, "tallow/smooth"); - tallow.carverHelper.addVariation("tile.tallow.0.desc", 1, "tallow/faces"); - tallow.carverHelper.registerAll(tallow, "tallow"); - Carving.chisel.registerOre("tallow", "tallow"); - } - }, - - TECHNICAL { - - @Override - void addBlocks() { - BlockCarvable technical = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); - technical.carverHelper.addVariation("tile.technical.0.desc", 0, "technical/scaffold"); - technical.carverHelper.addVariation("tile.technical.1.desc", 1, "technical/cautiontape"); - technical.carverHelper.addVariation("tile.technical.2.desc", 2, "technical/industrialrelic"); - technical.carverHelper.addVariation("tile.technical.3.desc", 3, "technical/pipesLarge"); - technical.carverHelper.addVariation("tile.technical.4.desc", 4, "technical/fanFast"); - technical.carverHelper.addVariation("tile.technical.5.desc", 5, "technical/pipesSmall"); - technical.carverHelper.addVariation("tile.technical.6.desc", 6, "technical/fanStill"); - technical.carverHelper.addVariation("tile.technical.7.desc", 7, "technical/vent"); - technical.carverHelper.addVariation("tile.technical.8.desc", 8, "technical/ventGlowing"); - technical.carverHelper.addVariation("tile.technical.9.desc", 9, "technical/insulationv2"); - technical.carverHelper.addVariation("tile.technical.10.desc", 10, "technical/spinningStuffAnim"); - technical.carverHelper.addVariation("tile.technical.11.desc", 11, "technical/cables"); - technical.carverHelper.addVariation("tile.technical.12.desc", 12, "technical/rustyBoltedPlates"); - technical.carverHelper.addVariation("tile.technical.13.desc", 13, "technical/grate"); - technical.carverHelper.addVariation("tile.technical.14.desc", 14, "technical/malfunctionFan"); - technical.carverHelper.addVariation("tile.technical.15.desc", 15, "technical/grateRusty"); - technical.carverHelper.registerAll(technical, "technical"); - - BlockCarvableGlass technical2 = (BlockCarvableGlass) new BlockCarvableGlass().setHardness(2.0F).setResistance(10F); - technical2.carverHelper.addVariation("tile.technical.0.desc", 0, "technical/scaffoldTransparent", 20); - technical2.carverHelper.addVariation("tile.technical.4.desc", 1, "technical/fanFastTransparent", 21); - technical2.carverHelper.addVariation("tile.technical.6.desc", 2, "technical/fanStillTransparent", 22); - technical2.carverHelper.addVariation("tile.technical.14.desc", 3, "technical/fanStillTransparent", 23); - technical2.carverHelper.registerBlock(technical2, "technical2"); - technical2.carverHelper.registerVariations("technical"); - - BlockCarvable technicalLarge = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); - technicalLarge.carverHelper.addVariation("tile.technical3.0.desc", 0, "technical/massiveFan", 40); - technicalLarge.carverHelper.addVariation("tile.technical3.1.desc", 1, "technical/massiveHexPlating", 41); - technicalLarge.carverHelper.registerBlock(technicalLarge, "technical3"); - technicalLarge.carverHelper.registerVariations("technical"); - - BlockCarvable technical4 = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); - technical4.carverHelper.addVariation("tile.technical4.0.desc", 0, "technical/new/weatheredGreenPanels"); - technical4.carverHelper.addVariation("tile.technical4.1.desc", 1, "technical/new/weatheredOrangePanels"); - technical4.carverHelper.addVariation("tile.technical4.2.desc", 2, "technical/new/Sturdy"); - technical4.carverHelper.addVariation("tile.technical4.3.desc", 3, "technical/new/MegaCell"); - technical4.carverHelper - .addVariation("tile.technical4.4.desc", 4, "technical/new/ExhaustPlating"/* , new SubmapManagerCombinedCTM(4, "technical/new/test/ExhaustPlating", TextureType.R4) */); - technical4.carverHelper.addVariation("tile.technical4.5.desc", 5, "technical/new/MakeshiftPanels"); - technical4.carverHelper.addVariation("tile.technical4.6.desc", 6, "technical/new/Piping"); - technical4.carverHelper.addVariation("tile.technical4.7.desc", 7, "technical/new/concrete/concreteBlocks" , new SubmapManagerCombinedCTM(9, "technical/new/concrete/concreteBlocks", TextureType.R9)); + AE_CERTUS_QUARTZ("appliedenergistics2") { + + private Block blockCheck; + private boolean blockChecked; + + @Override + void addBlocks() { + Carving.chisel.addVariation( + "AECertusQuartz", + GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartz"), + 0, + 0); + Carving.chisel.addVariation( + "AECertusQuartz", + GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartzPillar"), + 0, + 1); + Carving.chisel.addVariation( + "AECertusQuartz", + GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartzChiseled"), + 0, + 2); + Carving.chisel.registerOre("AECertusQuartz", "AECertusQuartz"); + } + + @Override + public boolean enabled() { + if (!blockChecked) { + blockCheck = GameRegistry.findBlock("appliedenergistics2", "tile.BlockQuartz"); + blockChecked = true; + } + return super.enabled() && blockCheck != null; + } + }, + + AE_SKY_STONE("appliedenergistics2") { + + @Override + void addBlocks() { + Carving.chisel.addVariation( + "AESkyStone", + GameRegistry.findBlock("appliedenergistics2", "tile.BlockSkyStone"), + 1, + 0); + Carving.chisel.addVariation( + "AESkyStone", + GameRegistry.findBlock("appliedenergistics2", "tile.BlockSkyStone"), + 2, + 1); + Carving.chisel.addVariation( + "AESkyStone", + GameRegistry.findBlock("appliedenergistics2", "tile.BlockSkyStone"), + 3, + 2); + Carving.chisel.registerOre("AESkyStone", "AESkyStone"); + } + }, + + ALUMINUM { + + @Override + void addBlocks() { + BlockCarvable aluminum = (BlockCarvable) new BlockBeaconBase(Material.iron) + .setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) + .setResistance(10F); + aluminum.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/aluminum/caution", 20); + aluminum.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/aluminum/crate", 21); + aluminum.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/aluminum/thermal", 22); + aluminum.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/aluminum/adv", 23); + aluminum.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/aluminum/egregious", 24); + aluminum.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/aluminum/bolted", 25); + aluminum.carverHelper.registerAll(aluminum, "aluminumblock"); + Carving.chisel.registerOre("aluminumblock", "blockAluminum"); + + CarvableStairsMaker aluminumStairs = new CarvableStairsMaker(aluminum); + + aluminumStairs.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/aluminum/caution"); + aluminumStairs.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/aluminum/crate"); + aluminumStairs.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/aluminum/thermal"); + aluminumStairs.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/aluminum/adv"); + aluminumStairs.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/aluminum/egregious"); + aluminumStairs.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/aluminum/bolted"); + aluminumStairs.create("aluminum_stairs", ChiselBlocks.aluminumStairs); + Carving.chisel.registerOre("aluminum_stairs", "aluminum_stairs"); + } + }, + + AMBER("Thaumcraft") { + + @Override + void addBlocks() { + BlockCarvable amber = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("amber", GameRegistry.findBlock("Thaumcraft", "blockCosmeticOpaque"), 0, 0); + Carving.chisel.addVariation("amber", GameRegistry.findBlock("Thaumcraft", "blockCosmeticOpaque"), 1, 1); + amber.carverHelper.registerAll(amber, "amber"); + Carving.chisel.registerOre("amber", "amber"); + } + }, + + ANDESITE { + + @Override + void addBlocks() { + BlockCarvable andesite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F) + .setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); + andesite.carverHelper.addVariation( + Configurations.imTooGoodForDescriptions ? "" : "tile.andesite.0.desc", + 0, + "andesite/andesite"); + andesite.carverHelper.addVariation("tile.andesite.1.desc", 1, "andesite/andesitePolished"); + andesite.carverHelper.addVariation("tile.andesite.2.desc", 2, "andesite/andesitePillar"); + andesite.carverHelper.addVariation("tile.andesite.3.desc", 3, "andesite/andesiteLBrick"); + andesite.carverHelper.addVariation("tile.andesite.4.desc", 4, "andesite/andesiteOrnate"); + andesite.carverHelper.addVariation("tile.andesite.5.desc", 5, "andesite/andesitePrism"); + andesite.carverHelper.addVariation("tile.andesite.6.desc", 6, "andesite/andesiteTiles"); + andesite.carverHelper.registerAll(andesite, "andesite"); + andesite.carverHelper.registerOre("blockAndesite"); + andesite.carverHelper.registerOre("stoneAndesite"); + } + + @Override + void addRecipes() { + if (DIORITE.enabled()) { + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(andesite, 2), diorite, "cobblestone")); + } + } + }, + + ANTIBLOCK { + + @Override + void addBlocks() { + BlockCarvable antiBlock = (BlockCarvable) new BlockCarvableAntiBlock() + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks); + + if (!Configurations.allowChiselCrossColors) { + antiBlock.carverHelper.forbidChiseling = true; + } + + for (int i = 0; i < 16; i++) { + antiBlock.carverHelper.addVariation( + "tile.antiBlock." + ItemDye.field_150921_b[i] + ".desc", + i, + new SubmapManagerAntiblock(ItemDye.field_150921_b[i])); + } + + antiBlock.carverHelper.registerAll(antiBlock, "antiBlock"); + OreDictionary.registerOre("antiBlock", antiBlock); + } + + @Override + void addRecipes() { + if (meta == 0) { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.antiBlock, 8, 15), + "SSS", + "SGS", + "SSS", + 'S', + "stone", + 'G', + "dustGlowstone")); + } + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.antiBlock, 8, meta), + "BBB", + "BdB", + "BBB", + 'd', + dyeOres[meta], + 'B', + new ItemStack(ChiselBlocks.antiBlock, 1, OreDictionary.WILDCARD_VALUE))); + } + + @Override + boolean needsMetaRecipes() { + return true; + } + }, + + ARCANE("Thaumcraft") { + + @Override + void addBlocks() { + BlockCarvable arcane = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("arcane", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 6, -5); + // Carving.chisel.addVariation("arcane", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 7, -4); + arcane.carverHelper.addVariation("tile.arcane.0.desc", 0, "arcane/moonEngrave"); + arcane.carverHelper.addVariation("tile.arcane.1.desc", 1, "arcane/moonGlowAnim"); + arcane.carverHelper.addVariation("tile.arcane.2.desc", 2, "arcane/arcaneTile"); + arcane.carverHelper.addVariation("tile.arcane.3.desc", 3, "arcane/runes"); + arcane.carverHelper.addVariation("tile.arcane.4.desc", 4, "arcane/runesGlow"); + arcane.carverHelper.addVariation("tile.arcane.5.desc", 5, "arcane/bigBrick"); + arcane.carverHelper.addVariation("tile.arcane.6.desc", 6, "arcane/conduitGlowAnim"); + arcane.carverHelper.addVariation("tile.arcane.7.desc", 7, "arcane/BorderBrain"); + arcane.carverHelper.addVariation("tile.arcane.8.desc", 8, "arcane/ArcaneBorder"); + arcane.carverHelper.addVariation("tile.arcane.9.desc", 9, "arcane/arcaneMatrix"); + arcane.carverHelper.addVariation("tile.arcane.10.desc", 10, "arcane/thaumcraftLogo"); + arcane.carverHelper.addVariation("tile.arcane.11.desc", 11, "arcane/arcaneCrackAnim"); + arcane.carverHelper.registerAll(arcane, "arcane"); + Carving.chisel.registerOre("arcane", "arcane"); + } + }, + + AUTO_CHISEL { + + @Override + void addBlocks() { + Block autoChisel = new BlockAutoChisel().setBlockTextureName(Chisel.MOD_ID + ":autoChisel/autoChisel") + .setCreativeTab(ChiselTabs.tabChisel).setBlockName("chisel.autoChisel"); + GameRegistry.registerBlock(autoChisel, "autoChisel"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.autoChisel, 1), + new Object[] { "XXX", " Y ", "YYY", Character.valueOf('X'), Blocks.stone_slab, + Character.valueOf('Y'), "ingotIron" })); + } + }, + + AUTO_CHISEL_UPGRADES(AUTO_CHISEL) { + + @Override + void addItems() { + ItemUpgrade upgrade = (ItemUpgrade) new ItemUpgrade("upgrade").setCreativeTab(ChiselTabs.tabChisel); + GameRegistry.registerItem(upgrade, "upgrade"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselItems.upgrade, 1, 0), + new Object[] { "IEI", "EUE", "RRR", 'I', "ingotIron", 'E', Items.emerald, 'R', + Items.redstone, 'U', Items.sugar })); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselItems.upgrade, 1, 1), + new Object[] { "IEI", "EUE", "RRR", 'I', "ingotIron", 'E', Items.emerald, 'R', + Items.redstone, 'U', Blocks.hopper })); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselItems.upgrade, 1, 2), + new Object[] { "IEI", "EUE", "RRR", 'I', "ingotIron", 'E', Items.emerald, 'R', + Items.redstone, 'U', Blocks.crafting_table })); + } + }, + + BALL_OF_MOSS { + + @Override + void addItems() { + ItemBallOMoss ballomoss = (ItemBallOMoss) new ItemBallOMoss().setTextureName("Chisel:ballomoss") + .setCreativeTab(ChiselTabs.tabChisel); + EntityRegistry.registerModEntity(EntityBallOMoss.class, "BallOMoss", 2, Chisel.instance, 40, 1, true); + GameRegistry.registerItem(ballomoss, "ballomoss"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselItems.ballomoss, 1), + "XYX", + "YXY", + "XYX", + 'X', + Blocks.vine, + 'Y', + Items.stick); + } + }, + + BEACON { + + @Override + void addBlocks() { + BlockCarvableBeacon beacon = (BlockCarvableBeacon) new BlockCarvableBeacon() + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks); + Carving.chisel.addVariation("beacon", Blocks.beacon, 0, 0); + for (int meta = 0; meta < 16; meta++) { + beacon.carverHelper.addVariation( + "tile.beacon." + ItemDye.field_150923_a[meta] + ".desc", + meta, + "beacon", + (meta + 1)); + } + beacon.carverHelper.registerAll(beacon, "beacon"); + Carving.chisel.registerOre("beacon", "beacon"); + } + }, + + BLOOD_RUNE("AWWayofTime") { + + @Override + void addBlocks() { + BlockCarvable bloodRune = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation( + "bloodRune", + GameRegistry.findBlock("AWWayofTime", "AlchemicalWizardrybloodRune"), + 0, + 0); + bloodRune.carverHelper.addVariation("tile.bloodRune.0.desc", 0, "bloodMagic/bloodRuneArranged"); + bloodRune.carverHelper.addVariation("tile.bloodRune.1.desc", 1, "bloodMagic/bloodRuneBricks"); + bloodRune.carverHelper.addVariation("tile.bloodRune.2.desc", 2, "bloodMagic/bloodRuneCarved"); + bloodRune.carverHelper.addVariation("tile.bloodRune.3.desc", 3, "bloodMagic/bloodRuneCarvedRadial"); + bloodRune.carverHelper.addVariation("tile.bloodRune.4.desc", 4, "bloodMagic/bloodRuneClassicPanel"); + bloodRune.carverHelper.addVariation("tile.bloodRune.5.desc", 5, "bloodMagic/bloodRuneTiles"); + bloodRune.carverHelper.registerAll(bloodRune, "bloodRune"); + Carving.chisel.registerOre("bloodRune", "bloodRune"); + } + }, + + BLOOD_BLOCK("AWWayofTime") { + + @Override + void addBlocks() { + BlockCarvable bloodBrick = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); + Carving.chisel + .addVariation("bloodBrick", GameRegistry.findBlock("AWWayofTime", "largeBloodStoneBrick"), 0, 0); + Carving.chisel.addVariation("bloodBrick", GameRegistry.findBlock("AWWayofTime", "bloodStoneBrick"), 0, 1); + bloodBrick.carverHelper.registerAll(bloodBrick, "bloodBrick"); + Carving.chisel.registerOre("bloodBrick", "bloodBrick"); + } + }, + + BOOKSHELF { + + @Override + void addBlocks() { + BlockCarvable bookshelf = (BlockCarvable) new BlockCarvableBookshelf().setHardness(1.5F) + .setCreativeTab(ChiselTabs.tabWoodChiselBlocks).setStepSound(Block.soundTypeWood); + Carving.chisel.addVariation("bookshelf", Blocks.bookshelf, 0, 0); + bookshelf.carverHelper.addVariation("tile.bookshelf.1.desc", 1, "bookshelf/rainbow"); + bookshelf.carverHelper.addVariation("tile.bookshelf.2.desc", 2, "bookshelf/necromancer-novice"); + bookshelf.carverHelper.addVariation("tile.bookshelf.3.desc", 3, "bookshelf/necromancer"); + bookshelf.carverHelper.addVariation("tile.bookshelf.4.desc", 4, "bookshelf/redtomes"); + bookshelf.carverHelper.addVariation("tile.bookshelf.5.desc", 5, "bookshelf/abandoned"); + bookshelf.carverHelper.addVariation("tile.bookshelf.6.desc", 6, "bookshelf/hoarder"); + bookshelf.carverHelper.addVariation("tile.bookshelf.7.desc", 7, "bookshelf/brim"); + bookshelf.carverHelper.addVariation("tile.bookshelf.8.desc", 8, "bookshelf/historician"); + bookshelf.carverHelper.registerAll(bookshelf, "bookshelf"); + bookshelf.setHarvestLevel("axe", 0); + Carving.chisel.registerOre("bookshelf", "bookshelf"); + Blocks.fire.setFireInfo(bookshelf, 5, 20); + } + }, + + BRICK_CUSTOM { + + @Override + void addBlocks() { + BlockCarvable brickCustom = (BlockCarvable) new BlockCarvable(Material.rock) + .setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); + Carving.chisel.addVariation("brickCustom", Blocks.brick_block, 0, 0); + brickCustom.carverHelper.addVariation("tile.brickCustom.1.desc", 1, "brickCustom/large"); + brickCustom.carverHelper.addVariation("tile.brickCustom.2.desc", 2, "brickCustom/mortarless"); + brickCustom.carverHelper.addVariation("tile.brickCustom.3.desc", 3, "brickCustom/varied"); + // brickCustom.carverHelper.addVariation("tile.brickCustom.4.desc", + // 4, "brickCustom/cracked"); + brickCustom.carverHelper.addVariation("tile.brickCustom.5.desc", 5, "brickCustom/aged"); + brickCustom.carverHelper.addVariation("tile.brickCustom.6.desc", 6, "brickCustom/yellow"); + brickCustom.carverHelper.registerAll(brickCustom, "brickCustom"); + Carving.chisel.registerOre("brickCustom", "brickCustom"); + } + }, + + BRONZE { + + @Override + void addBlocks() { + BlockCarvable bronze = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F).setResistance(10F); + bronze.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/bronze/caution", 20); + bronze.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/bronze/crate", 21); + bronze.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/bronze/thermal", 22); + bronze.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/bronze/adv", 23); + bronze.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/bronze/egregious", 24); + bronze.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/bronze/bolted", 25); + bronze.carverHelper.registerAll(bronze, "bronzeblock"); + Carving.chisel.registerOre("bronzeblock", "blockBronze"); + } + }, + + CARPET { + + @Override + void addBlocks() { + BlockCarvable carpet_block = (BlockCarvable) new BlockCarvable(Material.cloth) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Block.soundTypeCloth); + + carpet_block.carverHelper.addVariation("tile.carpet_block.0.desc", 0, "carpet/white"); + carpet_block.carverHelper.addVariation("tile.carpet_block.1.desc", 1, "carpet/orange"); + carpet_block.carverHelper.addVariation("tile.carpet_block.2.desc", 2, "carpet/lily"); + carpet_block.carverHelper.addVariation("tile.carpet_block.3.desc", 3, "carpet/lightblue"); + carpet_block.carverHelper.addVariation("tile.carpet_block.4.desc", 4, "carpet/yellow"); + carpet_block.carverHelper.addVariation("tile.carpet_block.5.desc", 5, "carpet/lightgreen"); + carpet_block.carverHelper.addVariation("tile.carpet_block.6.desc", 6, "carpet/pink"); + carpet_block.carverHelper.addVariation("tile.carpet_block.7.desc", 7, "carpet/darkgrey"); + carpet_block.carverHelper.addVariation("tile.carpet_block.8.desc", 8, "carpet/grey"); + carpet_block.carverHelper.addVariation("tile.carpet_block.9.desc", 9, "carpet/teal"); + carpet_block.carverHelper.addVariation("tile.carpet_block.10.desc", 10, "carpet/purple"); + carpet_block.carverHelper.addVariation("tile.carpet_block.11.desc", 11, "carpet/darkblue"); + carpet_block.carverHelper.addVariation("tile.carpet_block.12.desc", 12, "carpet/brown"); + carpet_block.carverHelper.addVariation("tile.carpet_block.13.desc", 13, "carpet/green"); + carpet_block.carverHelper.addVariation("tile.carpet_block.14.desc", 14, "carpet/red"); + carpet_block.carverHelper.addVariation("tile.carpet_block.15.desc", 15, "carpet/black"); + if (!Configurations.allowChiselCrossColors) { + carpet_block.carverHelper.forbidChiseling = true; + } + carpet_block.carverHelper.registerAll(carpet_block, "carpet_block"); + OreDictionary.registerOre("blockCarpet", carpet_block); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.carpet_block, 8, meta), + "YYY", + "YXY", + "YYY", + 'X', + new ItemStack(Items.string, 1), + 'Y', + new ItemStack(Blocks.wool, 1, meta)); + } + + @Override + boolean needsMetaRecipes() { + return true; + } + }, + + CARPET_FLOOR { + + @Override + void addBlocks() { + BlockCarvableCarpet carpet = (BlockCarvableCarpet) new BlockCarvableCarpet(Material.cloth) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.1F) + .setStepSound(Block.soundTypeCloth).setLightOpacity(0).setStepSound(Block.soundTypeCloth); + + carpet.carverHelper.addVariation("tile.carpet.0.desc", 0, new SubmapManagerCarpetFloor("white")); + carpet.carverHelper.addVariation("tile.carpet.1.desc", 1, new SubmapManagerCarpetFloor("orange")); + carpet.carverHelper.addVariation("tile.carpet.2.desc", 2, new SubmapManagerCarpetFloor("lily")); + carpet.carverHelper.addVariation("tile.carpet.3.desc", 3, new SubmapManagerCarpetFloor("lightblue")); + carpet.carverHelper.addVariation("tile.carpet.4.desc", 4, new SubmapManagerCarpetFloor("yellow")); + carpet.carverHelper.addVariation("tile.carpet.5.desc", 5, new SubmapManagerCarpetFloor("lightgreen")); + carpet.carverHelper.addVariation("tile.carpet.6.desc", 6, new SubmapManagerCarpetFloor("pink")); + carpet.carverHelper.addVariation("tile.carpet.7.desc", 7, new SubmapManagerCarpetFloor("darkgrey")); + carpet.carverHelper.addVariation("tile.carpet.8.desc", 8, new SubmapManagerCarpetFloor("grey")); + carpet.carverHelper.addVariation("tile.carpet.9.desc", 9, new SubmapManagerCarpetFloor("teal")); + carpet.carverHelper.addVariation("tile.carpet.10.desc", 10, new SubmapManagerCarpetFloor("purple")); + carpet.carverHelper.addVariation("tile.carpet.11.desc", 11, new SubmapManagerCarpetFloor("darkblue")); + carpet.carverHelper.addVariation("tile.carpet.12.desc", 12, new SubmapManagerCarpetFloor("brown")); + carpet.carverHelper.addVariation("tile.carpet.13.desc", 13, new SubmapManagerCarpetFloor("green")); + carpet.carverHelper.addVariation("tile.carpet.14.desc", 14, new SubmapManagerCarpetFloor("red")); + carpet.carverHelper.addVariation("tile.carpet.15.desc", 15, new SubmapManagerCarpetFloor("black")); + if (!Configurations.allowChiselCrossColors) { + carpet.carverHelper.forbidChiseling = true; + } + carpet.carverHelper.registerAll(carpet, "carpet"); + + // for (int i = 0; i < 16; i++) { + // String group = "carpet." + i; + + // TODO needle stuff + // Carving.needle.addVariation(group, Blocks.carpet, i, 0); + // Carving.needle.addVariation(group, carpet, i, 2); + // Carving.needle.addVariation(group, carpet_block, i, 1); + // } + + OreDictionary.registerOre("carpet", carpet); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.carpet, 3, meta), + "XX", + 'X', + new ItemStack(ChiselBlocks.carpet_block, 1, meta)); + } + + @Override + boolean needsMetaRecipes() { + return true; + } + }, + + CHISEL { + + @Override + void addItems() { + ItemChisel chisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.IRON) + .setCreativeTab(ChiselTabs.tabChisel); + ItemChisel diamondChisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.DIAMOND) + .setCreativeTab(ChiselTabs.tabChisel); + ItemChisel obsidianChisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.OBSIDIAN) + .setCreativeTab(ChiselTabs.tabChisel); + ItemChisel netherStarChisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.NETHERSTAR) + .setCreativeTab(ChiselTabs.tabChisel); + GameRegistry.registerItem(chisel, "chisel"); + GameRegistry.registerItem(diamondChisel, "diamondChisel"); + GameRegistry.registerItem(obsidianChisel, "obsidianChisel"); + GameRegistry.registerItem(netherStarChisel, "netherStarChisel"); + } + + @Override + void addRecipes() { + if (Configurations.chiselRecipe) { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselItems.chisel), + " YY", + " YY", + "X ", + 'X', + "stickWood", + 'Y', + "ingotIron")); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselItems.diamondChisel), + " YY", + " YY", + "x ", + 'x', + "stickWood", + 'Y', + "gemDiamond")); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselItems.obsidianChisel), + " YY", + " YY", + "x ", + 'x', + "stickWood", + 'Y', + Blocks.obsidian)); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselItems.netherStarChisel), + " YY", + " YY", + "x ", + 'x', + "stickWood", + 'Y', + "netherStar")); + } else { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselItems.chisel), + " Y", + "X ", + 'X', + "stickWood", + 'Y', + "ingotIron")); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselItems.diamondChisel), + " Y", + "X ", + 'X', + "stickWood", + 'Y', + "gemDiamond")); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselItems.obsidianChisel), + " Y", + "X ", + 'X', + "stickWood", + 'Y', + Blocks.obsidian)); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselItems.netherStarChisel), + " YY", + " YY", + "x ", + 'x', + "stickWood", + 'Y', + "netherStar")); + } + } + }, + + CLOUD { + + @Override + void addBlocks() { + BlockCarvable cloud = (BlockCloud) new BlockCloud().setHardness(0.2F) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setLightOpacity(3) + .setStepSound(Block.soundTypeCloth); + cloud.carverHelper.addVariation("tile.cloud.0.desc", 0, "cloud/cloud"); + cloud.carverHelper.addVariation("tile.cloud.1.desc", 1, "cloud/large"); + cloud.carverHelper.addVariation("tile.cloud.2.desc", 2, "cloud/small"); + cloud.carverHelper.addVariation("tile.cloud.3.desc", 3, "cloud/vertical"); + cloud.carverHelper.addVariation("tile.cloud.4.desc", 4, "cloud/grid"); + cloud.carverHelper.registerAll(cloud, "cloud"); + OreDictionary.registerOre("cloud", cloud); + Carving.chisel.registerOre("cloud", "cloud"); + } + + @Override + void addItems() { + ItemCloudInABottle itemCloudInABottle = (ItemCloudInABottle) new ItemCloudInABottle() + .setTextureName("Chisel:cloudinabottle-x").setCreativeTab(ChiselTabs.tabChisel); + EntityRegistry + .registerModEntity(EntityCloudInABottle.class, "CloudInABottle", 1, Chisel.instance, 40, 1, true); + GameRegistry.registerItem(itemCloudInABottle, "cloudinabottle"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselItems.cloudinabottle, 1), + "X X", + "XYX", + " X ", + 'X', + Blocks.glass, + 'Y', + Items.quartz); + } + }, + + COBBLESTONE { + + @Override + void addBlocks() { + BlockCarvable cobblestone = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("cobblestone", Blocks.cobblestone, 0, 0); + cobblestone.carverHelper + .addVariation("tile.cobblestone.0.desc", 1, "cobblestone/terrain-cobb-brickaligned"); + cobblestone.carverHelper + .addVariation("tile.cobblestone.1.desc", 2, "cobblestone/terrain-cob-detailedbrick"); + cobblestone.carverHelper.addVariation("tile.cobblestone.2.desc", 3, "cobblestone/terrain-cob-smallbrick"); + cobblestone.carverHelper + .addVariation("tile.cobblestone.3.desc", 4, "cobblestone/terrain-cobblargetiledark"); + cobblestone.carverHelper.addVariation("tile.cobblestone.4.desc", 5, "cobblestone/terrain-cobbsmalltile"); + cobblestone.carverHelper.addVariation("tile.cobblestone.5.desc", 6, "cobblestone/terrain-cob-french"); + cobblestone.carverHelper.addVariation("tile.cobblestone.6.desc", 7, "cobblestone/terrain-cob-french2"); + cobblestone.carverHelper + .addVariation("tile.cobblestone.7.desc", 8, "cobblestone/terrain-cobmoss-creepdungeon"); + cobblestone.carverHelper + .addVariation("tile.cobblestone.8.desc", 9, "cobblestone/terrain-mossysmalltiledark"); + cobblestone.carverHelper + .addVariation("tile.cobblestone.9.desc", 10, "cobblestone/terrain-pistonback-dungeontile"); + cobblestone.carverHelper + .addVariation("tile.cobblestone.10.desc", 11, "cobblestone/terrain-pistonback-darkcreeper"); + cobblestone.carverHelper + .addVariation("tile.cobblestone.11.desc", 12, "cobblestone/terrain-pistonback-darkdent"); + cobblestone.carverHelper + .addVariation("tile.cobblestone.12.desc", 13, "cobblestone/terrain-pistonback-darkemboss"); + cobblestone.carverHelper + .addVariation("tile.cobblestone.13.desc", 14, "cobblestone/terrain-pistonback-darkmarker"); + cobblestone.carverHelper + .addVariation("tile.cobblestone.14.desc", 15, "cobblestone/terrain-pistonback-darkpanel"); + cobblestone.carverHelper.registerAll(cobblestone, "cobblestone"); + Carving.chisel.registerOre("cobblestone", "cobblestone"); + } + }, + + COBBLESTONE_MOSSY { + + @Override + void addBlocks() { + + BlockCarvable mossy_cobblestone = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10.0F) + .setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("mossy_cobblestone", Blocks.mossy_cobblestone, 0, 0); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.1.desc", 1, "cobblestonemossy/terrain-cobb-brickaligned"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.2.desc", 2, "cobblestonemossy/terrain-cob-detailedbrick"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.3.desc", 3, "cobblestonemossy/terrain-cob-smallbrick"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.4.desc", 4, "cobblestonemossy/terrain-cobblargetiledark"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.5.desc", 5, "cobblestonemossy/terrain-cobbsmalltile"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.6.desc", 6, "cobblestonemossy/terrain-cob-french"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.7.desc", 7, "cobblestonemossy/terrain-cob-french2"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.8.desc", 8, "cobblestonemossy/terrain-cobmoss-creepdungeon"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.9.desc", 9, "cobblestonemossy/terrain-mossysmalltiledark"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.10.desc", 10, "cobblestonemossy/terrain-pistonback-dungeontile"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.11.desc", 11, "cobblestonemossy/terrain-pistonback-darkcreeper"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.12.desc", 12, "cobblestonemossy/terrain-pistonback-darkdent"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.13.desc", 13, "cobblestonemossy/terrain-pistonback-darkemboss"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.14.desc", 14, "cobblestonemossy/terrain-pistonback-darkmarker"); + mossy_cobblestone.carverHelper + .addVariation("tile.stoneMoss.15.desc", 15, "cobblestonemossy/terrain-pistonback-darkpanel"); + mossy_cobblestone.carverHelper.registerAll(mossy_cobblestone, "mossy_cobblestone"); + Carving.chisel.registerOre("mossy_cobblestone", "mossy_cobblestone"); + } + }, + + CONCRETE { + + @Override + void addBlocks() { + BlockCarvable concrete = (BlockConcrete) new BlockConcrete().setStepSound(Block.soundTypeStone) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(0.5F); + concrete.carverHelper.addVariation("tile.concrete.0.desc", 0, "concrete/default"); + concrete.carverHelper.addVariation("tile.concrete.1.desc", 1, "concrete/block"); + concrete.carverHelper.addVariation("tile.concrete.2.desc", 2, "concrete/doubleslab"); + concrete.carverHelper.addVariation("tile.concrete.3.desc", 3, "concrete/blocks"); + concrete.carverHelper.addVariation("tile.concrete.4.desc", 4, "concrete/weathered"); + concrete.carverHelper.addVariation("tile.concrete.5.desc", 5, "concrete/weathered-block"); + concrete.carverHelper.addVariation("tile.concrete.6.desc", 6, "concrete/weathered-doubleslab"); + concrete.carverHelper.addVariation("tile.concrete.7.desc", 7, "concrete/weathered-blocks"); + concrete.carverHelper.addVariation("tile.concrete.8.desc", 8, "concrete/weathered-half"); + concrete.carverHelper.addVariation("tile.concrete.9.desc", 9, "concrete/weathered-block-half"); + concrete.carverHelper.addVariation("tile.concrete.10.desc", 10, "concrete/asphalt"); + concrete.carverHelper.registerAll(concrete, "concrete"); + OreDictionary.registerOre("concrete", concrete); + Carving.chisel.registerOre("concrete", "concrete"); + } + + @Override + void addRecipes() { + Block concreteRecipeBlock = Block.getBlockFromName( + Configurations.config.get( + "tweaks", + "concrete recipe block", + "gravel", + "Unlocalized name of the block that, when burned, will produce concrete (examples: lightgem, stone)") + .getString()); + if (concreteRecipeBlock == null) concreteRecipeBlock = Blocks.gravel; + + FurnaceRecipes.smelting().func_151393_a(concreteRecipeBlock, new ItemStack(ChiselBlocks.concrete), 0.1F); + } + }, + + COPPER { + + @Override + void addBlocks() { + BlockCarvable copper = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F).setResistance(10F); + copper.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/copper/caution", 20); + copper.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/copper/crate", 21); + copper.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/copper/thermal", 22); + copper.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/copper/adv", 23); + copper.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/copper/egregious", 24); + copper.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/copper/bolted", 25); + copper.carverHelper.registerAll(copper, "copperblock"); + Carving.chisel.registerOre("copperblock", "blockCopper"); + } + }, + + DIAMOND_BLOCK { + + @Override + void addBlocks() { + + BlockCarvable diamond_block = (BlockBeaconBase) new BlockBeaconBase() + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(5F).setResistance(10F) + .setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("diamond_block", Blocks.diamond_block, 0, 0); + diamond_block.carverHelper.addVariation("tile.diamond.1.desc", 1, "diamond/terrain-diamond-embossed"); + diamond_block.carverHelper.addVariation("tile.diamond.2.desc", 2, "diamond/terrain-diamond-gem"); + diamond_block.carverHelper.addVariation("tile.diamond.3.desc", 3, "diamond/terrain-diamond-cells"); + diamond_block.carverHelper.addVariation("tile.diamond.4.desc", 4, "diamond/terrain-diamond-space"); + diamond_block.carverHelper.addVariation("tile.diamond.5.desc", 5, "diamond/terrain-diamond-spaceblack"); + diamond_block.carverHelper.addVariation("tile.diamond.6.desc", 6, "diamond/terrain-diamond-simple"); + diamond_block.carverHelper.addVariation("tile.diamond.7.desc", 7, "diamond/terrain-diamond-bismuth"); + diamond_block.carverHelper.addVariation("tile.diamond.8.desc", 8, "diamond/terrain-diamond-crushed"); + diamond_block.carverHelper.addVariation("tile.diamond.9.desc", 9, "diamond/terrain-diamond-four"); + diamond_block.carverHelper.addVariation("tile.diamond.10.desc", 10, "diamond/terrain-diamond-fourornate"); + diamond_block.carverHelper.addVariation("tile.diamond.11.desc", 11, "diamond/terrain-diamond-zelda"); + diamond_block.carverHelper.addVariation("tile.diamond.12.desc", 12, "diamond/terrain-diamond-ornatelayer"); + diamond_block.carverHelper.registerAll(diamond_block, "diamond_block"); + Carving.chisel.registerOre("diamond_block", "blockDiamond"); + } + }, + + DIORITE { + + @Override + void addBlocks() { + BlockCarvable diorite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F) + .setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); + + diorite.carverHelper.addVariation( + Configurations.imTooGoodForDescriptions ? "" : "tile.diorite.0.desc", + 0, + "diorite/diorite"); + diorite.carverHelper.addVariation("tile.diorite.1.desc", 1, "diorite/dioritePolished"); + diorite.carverHelper.addVariation("tile.diorite.2.desc", 2, "diorite/dioritePillar"); + diorite.carverHelper.addVariation("tile.diorite.3.desc", 3, "diorite/dioriteLBrick"); + diorite.carverHelper.addVariation("tile.diorite.4.desc", 4, "diorite/dioriteOrnate"); + diorite.carverHelper.addVariation("tile.diorite.5.desc", 5, "diorite/dioritePrism"); + diorite.carverHelper.addVariation("tile.diorite.6.desc", 6, "diorite/dioriteTiles"); + diorite.carverHelper.registerAll(diorite, "diorite"); + diorite.carverHelper.registerOre("blockDiorite"); + diorite.carverHelper.registerOre("stoneDiorite"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe(new ItemStack(diorite, 2), "cq", "qc", 'c', "cobblestone", 'q', "gemQuartz")); + } + }, + + DIRT { + + @Override + void addBlocks() { + BlockCarvable dirt = (BlockCarvable) new BlockCarvable(Material.ground) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F) + .setStepSound(Block.soundTypeGravel).setBlockName("dirt.default"); + Carving.chisel.addVariation("dirt", Blocks.dirt, 0, -1); + + // dirt.carverHelper.addVariation("Dirt", 0, Blocks.dirt); + dirt.carverHelper.addVariation("tile.dirt.0.desc", 0, "dirt/bricks"); + dirt.carverHelper.addVariation("tile.dirt.1.desc", 1, "dirt/netherbricks"); + dirt.carverHelper.addVariation("tile.dirt.2.desc", 2, "dirt/bricks3"); + dirt.carverHelper.addVariation("tile.dirt.3.desc", 3, "dirt/cobble"); + dirt.carverHelper.addVariation("tile.dirt.4.desc", 4, "dirt/reinforcedCobbleDirt"); + dirt.carverHelper.addVariation("tile.dirt.5.desc", 5, "dirt/reinforcedDirt"); + dirt.carverHelper.addVariation("tile.dirt.6.desc", 6, "dirt/happy"); + dirt.carverHelper.addVariation("tile.dirt.7.desc", 7, "dirt/bricks2"); + dirt.carverHelper.addVariation("tile.dirt.8.desc", 8, "dirt/bricks+dirt2"); + dirt.carverHelper.addVariation("tile.dirt.9.desc", 9, "dirt/hor"); + dirt.carverHelper.addVariation("tile.dirt.10.desc", 10, "dirt/vert"); + dirt.carverHelper.addVariation("tile.dirt.11.desc", 11, "dirt/layers"); + dirt.carverHelper.addVariation("tile.dirt.12.desc", 12, "dirt/vertical"); + dirt.carverHelper.addVariation("tile.dirt.13.desc", 13, "dirt/chunky"); + dirt.carverHelper.addVariation("tile.dirt.14.desc", 14, "dirt/horizontal"); + dirt.carverHelper.addVariation("tile.dirt.15.desc", 15, "dirt/plate"); + dirt.carverHelper.registerAll(dirt, "dirt"); + dirt.setHarvestLevel("shovel", 0); + OreDictionary.registerOre("dirt", dirt); + Carving.chisel.registerOre("dirt", "dirt"); + } + }, + + EMERALD_BLOCK { + + @Override + void addBlocks() { + BlockCarvable emerald_block = (BlockBeaconBase) new BlockBeaconBase() + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(5.0F).setResistance(10.0F) + .setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("emerald_block", Blocks.emerald_block, 0, 0); + emerald_block.carverHelper.addVariation("tile.emerald.1.desc", 1, "emerald/panel"); + emerald_block.carverHelper.addVariation("tile.emerald.2.desc", 2, "emerald/panelclassic"); + emerald_block.carverHelper.addVariation("tile.emerald.3.desc", 3, "emerald/smooth"); + emerald_block.carverHelper.addVariation("tile.emerald.4.desc", 4, "emerald/chunk"); + emerald_block.carverHelper.addVariation("tile.emerald.5.desc", 5, "emerald/goldborder"); + emerald_block.carverHelper.addVariation("tile.emerald.6.desc", 6, "emerald/zelda"); + emerald_block.carverHelper.addVariation("tile.emerald.7.desc", 7, "emerald/cell"); + emerald_block.carverHelper.addVariation("tile.emerald.8.desc", 8, "emerald/cellbismuth"); + emerald_block.carverHelper.addVariation("tile.emerald.9.desc", 9, "emerald/four"); + emerald_block.carverHelper.addVariation("tile.emerald.10.desc", 10, "emerald/fourornate"); + emerald_block.carverHelper.addVariation("tile.emerald.11.desc", 11, "emerald/ornate"); + emerald_block.carverHelper.registerAll(emerald_block, "emerald_block"); + Carving.chisel.registerOre("emerald_block", "emerald"); + } + }, + + END_STONE { + + @Override + void addBlocks() { + BlockCarvable end_Stone = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F) + .setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); + Carving.chisel.addVariation("end_stone", Blocks.end_stone, 0, -1); + end_Stone.carverHelper.addVariation("tile.end_Stone.0.desc", 0, "endstone/end_bricks"); + end_Stone.carverHelper.addVariation("tile.end_Stone.1.desc", 1, "endstone/chaoticBricks"); + end_Stone.carverHelper.addVariation("tile.end_Stone.2.desc", 2, "endstone/CheckeredTile"); + end_Stone.carverHelper.addVariation("tile.end_Stone.3.desc", 3, "endstone/enderCircuit"); + end_Stone.carverHelper.addVariation("tile.end_Stone.4.desc", 4, "endstone/endFrenchBricks"); + end_Stone.carverHelper.addVariation("tile.end_Stone.5.desc", 5, "endstone/endPillar"); + end_Stone.carverHelper.addVariation("tile.end_Stone.6.desc", 6, "endstone/endStoneEtched"); + end_Stone.carverHelper.addVariation("tile.end_Stone.7.desc", 7, "endstone/prismaticEndStone"); + end_Stone.carverHelper.addVariation("tile.end_Stone.8.desc", 8, "endstone/endStoneChunk"); + end_Stone.carverHelper.addVariation("tile.end_Stone.9.desc", 9, "endstone/EnderFrame"); + end_Stone.carverHelper.addVariation("tile.end_Stone.10.desc", 10, "endstone/arcaneEndStone"); + end_Stone.carverHelper.addVariation("tile.end_Stone.11.desc", 11, "endstone/framedEndStone"); + end_Stone.carverHelper.addVariation("tile.end_Stone.12.desc", 12, "endstone/endStoneOrnate"); + end_Stone.carverHelper.addVariation("tile.end_Stone.13.desc", 13, "endstone/endStoneLargeTile"); + end_Stone.carverHelper.registerBlock(end_Stone, "end_Stone"); + end_Stone.carverHelper.registerVariations("end_stone"); + end_Stone.carverHelper.registerOre("blockEndstone"); + Carving.chisel.registerOre("end_stone", "blockEndstone"); + } + }, + + FACTORY { + + @Override + void addBlocks() { + BlockCarvable factoryblock = (BlockCarvable) new BlockCarvable(Material.iron) + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Chisel.soundMetalFootstep); + + factoryblock.carverHelper.addVariation("tile.factory.0.desc", 0, "factory/dots"); + factoryblock.carverHelper.addVariation("tile.factory.1.desc", 1, "factory/rust2"); + factoryblock.carverHelper.addVariation("tile.factory.2.desc", 2, "factory/rust"); + factoryblock.carverHelper.addVariation("tile.factory.3.desc", 3, "factory/platex"); + factoryblock.carverHelper.addVariation("tile.factory.4.desc", 4, "factory/wireframewhite"); + factoryblock.carverHelper.addVariation("tile.factory.5.desc", 5, "factory/wireframe"); + factoryblock.carverHelper.addVariation("tile.factory.6.desc", 6, "factory/hazard"); + factoryblock.carverHelper.addVariation("tile.factory.7.desc", 7, "factory/hazardorange"); + factoryblock.carverHelper.addVariation("tile.factory.8.desc", 8, "factory/circuit"); + factoryblock.carverHelper.addVariation("tile.factory.9.desc", 9, "factory/metalbox"); + factoryblock.carverHelper.addVariation("tile.factory.10.desc", 10, "factory/goldplate"); + factoryblock.carverHelper.addVariation("tile.factory.11.desc", 11, "factory/goldplating"); + factoryblock.carverHelper.addVariation("tile.factory.12.desc", 12, "factory/grinder"); + factoryblock.carverHelper.addVariation("tile.factory.13.desc", 13, "factory/plating"); + factoryblock.carverHelper.addVariation("tile.factory.14.desc", 14, "factory/rustplates"); + factoryblock.carverHelper.addVariation("tile.factory.15.desc", 15, "factory/column"); + factoryblock.carverHelper.registerAll(factoryblock, "factoryblock"); + Carving.chisel.registerOre("factoryblock", "factoryblock"); + + BlockCarvable factoryblock2 = (BlockCarvable) new BlockCarvable(Material.iron) + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Chisel.soundMetalFootstep); + factoryblock2.carverHelper.addVariation("tile.factory2.0.desc", 0, "factory/iceiceice", 20); + factoryblock2.carverHelper.addVariation("tile.factory2.1.desc", 1, "factory/vent", 21); + factoryblock2.carverHelper.addVariation("tile.factory2.2.desc", 2, "factory/tilemosaic", 22); + factoryblock2.carverHelper.addVariation("tile.factory2.3.desc", 3, "factory/wireframeblue", 23); + factoryblock2.carverHelper.registerAll(factoryblock2, "factoryblock2"); + factoryblock2.carverHelper.registerVariations("factoryblock"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.factoryblock, Configurations.factoryBlockAmount, 0), + new Object[] { "*X*", "X X", "*X*", '*', new ItemStack(Blocks.stone, 1), 'X', + new ItemStack(Items.iron_ingot, 1) }); + } + }, + + FANTASY { + + @Override + void addBlocks() { + BlockCarvable fantasyblock = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); + + fantasyblock.carverHelper.addVariation("tile.fantasyblock.0.desc", 0, "fantasy/brick"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.1.desc", 1, "fantasy/brick-faded"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.2.desc", 2, "fantasy/brick-wear"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.3.desc", 3, "fantasy/bricks"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.4.desc", 4, "fantasy/decor"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.5.desc", 5, "fantasy/decor-block"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.6.desc", 6, "fantasy/pillar"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.7.desc", 7, "fantasy/pillar-decorated"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.8.desc", 8, "fantasy/gold-decor-1"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.9.desc", 9, "fantasy/gold-decor-2"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.10.desc", 10, "fantasy/gold-decor-3"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.11.desc", 11, "fantasy/gold-decor-4"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.12.desc", 12, "fantasy/plate"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.13.desc", 13, "fantasy/block"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.14.desc", 14, "fantasy/bricks-chaotic"); + fantasyblock.carverHelper.addVariation("tile.fantasyblock.15.desc", 15, "fantasy/bricks-wear"); + fantasyblock.carverHelper.registerAll(fantasyblock, "fantasyblock"); + Carving.chisel.registerOre("fantasyblock", "fantasy"); + + BlockCarvable fantasyblock2 = (BlockCarvable) new BlockCarvable() + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.0.desc", 0, "fantasy2/brick"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.1.desc", 1, "fantasy2/brick-faded"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.2.desc", 2, "fantasy2/brick-wear"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.3.desc", 3, "fantasy2/bricks"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.4.desc", 4, "fantasy2/decor"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.5.desc", 5, "fantasy2/decor-block"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.6.desc", 6, "fantasy2/pillar"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.7.desc", 7, "fantasy2/pillar-decorated"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.8.desc", 8, "fantasy2/gold-decor-1"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.9.desc", 9, "fantasy2/gold-decor-2"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.10.desc", 10, "fantasy2/gold-decor-3"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.11.desc", 11, "fantasy2/gold-decor-4"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.12.desc", 12, "fantasy2/plate"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.13.desc", 13, "fantasy2/block"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.14.desc", 14, "fantasy2/bricks-chaotic"); + fantasyblock2.carverHelper.addVariation("tile.fantasyblock2.15.desc", 15, "fantasy2/bricks-wear"); + + fantasyblock2.carverHelper.registerBlock(fantasyblock2, "fantasyblock2"); + fantasyblock2.carverHelper.registerVariations("fantasy"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.fantasyblock, 8, 0), + "***", + "*X*", + "***", + '*', + new ItemStack(Blocks.stone, 1), + 'X', + new ItemStack(Items.gold_nugget, 1)); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.fantasyblock2, 8, 0), + "***", + "*X*", + "***", + '*', + new ItemStack(ChiselBlocks.fantasyblock, 1), + 'X', + "dyeWhite")); + } + }, + + FUTURA { + + @Override + void addBlocks() { + BlockCarvable futura = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); + futura.carverHelper.addVariation("tile.futura.0.desc", 0, "futura/WIP/screenMetallicWIP"); + futura.carverHelper.addVariation("tile.futura.1.desc", 1, "futura/WIP/screenCyanWIP"); + futura.carverHelper.addVariation( + "tile.futura.2.desc", + 2, + "futura/WIP/controller", + new SubmapManagerFakeController(2, "futura/WIP/controller")); + futura.carverHelper.addVariation("tile.futura.3.desc", 3, "futura/WIP/wavyWIP"); + futura.carverHelper.addVariation( + "tile.futura.4.desc", + 4, + "futura/WIP/controller", + new SubmapManagerFakeController(4, "futura/WIP/controllerPurple")); + futura.carverHelper.addVariation( + "tile.futura.5.desc", + 5, + "futura/WIP/controller", + new SubmapManagerFakeController(5, "futura/WIP/uberWavy")); + futura.carverHelper.registerAll(futura, "futura"); + + BlockCarvable circuits = (BlockCarvable) new BlockCarvableGlow("animations/strobe") + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10.0F); + for (int i = 0; i < 16; i++) { + circuits.carverHelper.addVariation( + "tile.futuraCircuit." + ItemDye.field_150921_b[i] + ".desc", + i, + "futura/circuitPlate", + (i + 20)); + } + + circuits.carverHelper.registerBlock(circuits, "futuraCircuit"); + circuits.carverHelper.registerVariations("futura"); + Carving.chisel.registerOre("futura", "futura"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.futura, 8, 0), + "SBS", + "BGB", + "SBS", + 'S', + "stone", + 'G', + "dustRedstone", + 'B', + new ItemStack(Blocks.stonebrick, 1))); + } + }, + + GLASS { + + @Override + void addBlocks() { + BlockCarvableGlass glass = (BlockCarvableGlass) new BlockCarvableGlass() + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F) + .setStepSound(Block.soundTypeGlass); + Carving.chisel.addVariation("glass", Blocks.glass, 0, 0); + glass.carverHelper.addVariation("tile.glass.1.desc", 1, "glass/terrain-glassbubble"); + glass.carverHelper.addVariation("tile.glass.2.desc", 2, "glass/terrain-glass-chinese"); + glass.carverHelper.addVariation("tile.glass.3.desc", 3, "glass/japanese"); + glass.carverHelper.addVariation("tile.glass.4.desc", 4, "glass/terrain-glassdungeon"); + glass.carverHelper.addVariation("tile.glass.5.desc", 5, "glass/terrain-glasslight"); + glass.carverHelper.addVariation("tile.glass.6.desc", 6, "glass/terrain-glassnoborder"); + glass.carverHelper.addVariation("tile.glass.7.desc", 7, "glass/terrain-glass-ornatesteel"); + glass.carverHelper.addVariation("tile.glass.8.desc", 8, "glass/terrain-glass-screen"); + glass.carverHelper.addVariation("tile.glass.9.desc", 9, "glass/terrain-glassshale"); + glass.carverHelper.addVariation("tile.glass.10.desc", 10, "glass/terrain-glass-steelframe"); + glass.carverHelper.addVariation("tile.glass.11.desc", 11, "glass/terrain-glassstone"); + glass.carverHelper.addVariation("tile.glass.12.desc", 12, "glass/terrain-glassstreak"); + glass.carverHelper.addVariation("tile.glass.13.desc", 13, "glass/terrain-glass-thickgrid"); + glass.carverHelper.addVariation("tile.glass.14.desc", 14, "glass/terrain-glass-thingrid"); + glass.carverHelper.addVariation("tile.glass.15.desc", 15, "glass/a1-glasswindow-ironfencemodern"); + glass.carverHelper.registerAll(glass, "glass"); + Carving.chisel.registerOre("glass", "glass"); + + BlockCarvableGlass glass2 = (BlockCarvableGlass) new BlockCarvableGlass() + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F) + .setStepSound(Block.soundTypeGlass); + glass2.carverHelper.addVariation("tile.glass2.0.desc", 0, "glass/chrono", 20); + glass2.carverHelper.registerBlock(glass2, "glass2"); + glass2.carverHelper.registerVariations("glass"); + } + }, + + GLASS_PANE { + + @Override + void addBlocks() { + BlockCarvablePane glass_pane = (BlockCarvablePane) new BlockCarvablePane(Material.glass, false) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F) + .setStepSound(Block.soundTypeGlass); + Carving.chisel.addVariation("glass_pane", Blocks.glass_pane, 0, 0); + glass_pane.carverHelper.addVariation("tile.glass_pane.1.desc", 1, "glasspane/terrain-glassbubble"); + glass_pane.carverHelper.addVariation("tile.glass_pane.2.desc", 2, "glasspane/terrain-glassnoborder"); + glass_pane.carverHelper.addVariation("tile.glass_pane.3.desc", 3, "glasspane/terrain-glass-screen"); + glass_pane.carverHelper.addVariation("tile.glass_pane.4.desc", 4, "glasspane/terrain-glassstreak"); + glass_pane.carverHelper.addVariation("tile.glass_pane.12.desc", 12, "glasspane/chinese"); + glass_pane.carverHelper.addVariation("tile.glass_pane.13.desc", 13, "glasspane/chinese2"); + glass_pane.carverHelper.addVariation("tile.glass_pane.14.desc", 14, "glasspane/japanese"); + glass_pane.carverHelper.addVariation("tile.glass_pane.15.desc", 15, "glasspane/japanese2"); + glass_pane.carverHelper.registerAll(glass_pane, "glass_pane"); + Carving.chisel.registerOre("glass_pane", "glass_pane"); + } + }, + + GLASS_STAINED { + + @Override + void addBlocks() { + stainedGlassForestry = new BlockCarvableGlass(); + stainedGlassForestry.setStained(true).setHardness(0.3F).setStepSound(Block.soundTypeGlass) + .setBlockName("Stained Glass"); + stainedGlassForestry.carverHelper.registerBlock(stainedGlassForestry, "stained_glass_forestry"); + + for (int i = 0; i < 16; i++) { + final String blockName = "stained_glass_" + sGNames[i].replaceAll(" ", "").toLowerCase(); + String oreName = "stainedGlass" + sGNames[i].replaceAll(" ", ""); + String texName = "glassdyed/" + sGNames[i].toLowerCase().replaceAll(" ", "") + "-"; + int glassPrefix = (i & 3) << 2; + int glassId = i >> 2; + Carving.chisel.addVariation(blockName, Blocks.stained_glass, i, 0); + if (glassPrefix == 0) { + stainedGlass[glassId] = (BlockCarvableGlass) new BlockCarvableGlass().setStained(true) + .setHardness(0.3F).setStepSound(Block.soundTypeGlass).setBlockName("Stained Glass"); + stainedGlass[glassId].carverHelper.registerBlock(stainedGlass[glassId], blockName); + } + stainedGlass[glassId].carverHelper + .addVariation(featureColors[i] + ".bubble.desc", glassPrefix, texName + "bubble"); + stainedGlass[glassId].carverHelper + .addVariation(featureColors[i] + ".glass.desc", glassPrefix + 1, texName + "panel"); + stainedGlass[glassId].carverHelper + .addVariation(featureColors[i] + ".glass.fancy.desc", glassPrefix + 2, texName + "panel-fancy"); + stainedGlass[glassId].carverHelper.addVariation( + featureColors[i] + ".glass.noborder.desc", + glassPrefix + 3, + texName + "transparent"); + OreDictionary.registerOre(oreName, new ItemStack(Blocks.stained_glass, 1, i)); + Carving.chisel.registerOre(blockName, oreName); + for (IVariationInfo info : stainedGlass[glassId].carverHelper.infoList) { + if (info.getVariation().getBlockMeta() < glassPrefix + || info.getVariation().getBlockMeta() >= glassPrefix + 4) + continue; + stainedGlass[glassId].carverHelper.registerVariation(blockName, info); + } + + stainedGlassForestry.carverHelper + .addVariation(featureColors[i] + ".glass.forestry.desc", i, texName + "forestry"); + IVariationInfo info = stainedGlassForestry.carverHelper.infoList.get(i); + stainedGlassForestry.carverHelper.registerVariation(blockName, info); + } + } + }, + + GLASS_STAINED_PANE { + + @Override + void addBlocks() { + for (int i = 0; i < 16; i++) { + final String blockName = "stained_glass_pane_" + sGNames[i].replaceAll(" ", "").toLowerCase(); + String oreName = "stainedGlassPane" + sGNames[i].replaceAll(" ", ""); + String texName = "glasspanedyed/" + sGNames[i].toLowerCase().replaceAll(" ", "") + "-"; + Carving.chisel.addVariation(blockName, Blocks.stained_glass_pane, i, 0); + int glassPrefix = (i & 1) << 3; + int glassId = i >> 1; + if (glassPrefix == 0) { + stainedGlassPane[glassId] = (BlockCarvablePane) new BlockCarvablePane(Material.glass, true) + .setStained(true).setHardness(0.3F).setStepSound(Block.soundTypeGlass) + .setBlockName("Stained Glass Pane").setCreativeTab(ChiselTabs.tabOtherChiselBlocks); + stainedGlassPane[glassId].carverHelper.registerBlock(stainedGlassPane[glassId], blockName); + } + stainedGlassPane[glassId].carverHelper + .addVariation(featureColors[i] + ".pane.bubble.desc", glassPrefix, texName + "bubble"); + stainedGlassPane[glassId].carverHelper + .addVariation(featureColors[i] + ".pane.glass.desc", glassPrefix + 1, texName + "panel"); + stainedGlassPane[glassId].carverHelper.addVariation( + featureColors[i] + ".pane.glass.fancy.desc", + glassPrefix + 2, + texName + "panel-fancy"); + stainedGlassPane[glassId].carverHelper.addVariation( + featureColors[i] + ".pane.glass.noborder.desc", + glassPrefix + 3, + texName + "transparent"); + stainedGlassPane[glassId].carverHelper.addVariation( + featureColors[i] + ".pane.glass.quadrant.desc", + glassPrefix + 4, + texName + "quad"); + stainedGlassPane[glassId].carverHelper.addVariation( + featureColors[i] + ".pane.glass.fancyquadrant.desc", + glassPrefix + 5, + texName + "quad-fancy"); + OreDictionary.registerOre(oreName, new ItemStack(Blocks.stained_glass_pane, 1, i)); + Carving.chisel.registerOre(blockName, oreName); + for (IVariationInfo info : stainedGlassPane[glassId].carverHelper.infoList) { + if (info.getVariation().getBlockMeta() < glassPrefix + || info.getVariation().getBlockMeta() >= glassPrefix + 8) + continue; + stainedGlassPane[glassId].carverHelper.registerVariation(blockName, info); + } + } + } + }, + + GLOWSTONE { + + @Override + void addBlocks() { + BlockCarvableGlowstone glowstone = (BlockCarvableGlowstone) new BlockCarvableGlowstone() + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F).setLightLevel(1.0F) + .setStepSound(Block.soundTypeGlass); + Carving.chisel.addVariation("glowstone", Blocks.glowstone, 0, 0); + glowstone.carverHelper.addVariation("tile.lightstone.1.desc", 1, "lightstone/terrain-sulphur-cobble"); + glowstone.carverHelper.addVariation("tile.lightstone.2.desc", 2, "lightstone/terrain-sulphur-corroded"); + glowstone.carverHelper.addVariation("tile.lightstone.3.desc", 3, "lightstone/terrain-sulphur-glass"); + glowstone.carverHelper.addVariation("tile.lightstone.4.desc", 4, "lightstone/terrain-sulphur-neon"); + glowstone.carverHelper.addVariation("tile.lightstone.5.desc", 5, "lightstone/terrain-sulphur-ornate"); + glowstone.carverHelper.addVariation("tile.lightstone.6.desc", 6, "lightstone/terrain-sulphur-rocky"); + glowstone.carverHelper.addVariation("tile.lightstone.7.desc", 7, "lightstone/terrain-sulphur-shale"); + glowstone.carverHelper.addVariation("tile.lightstone.8.desc", 8, "lightstone/terrain-sulphur-tile"); + glowstone.carverHelper + .addVariation("tile.lightstone.9.desc", 9, "lightstone/terrain-sulphur-weavelanternlight"); + glowstone.carverHelper.addVariation("tile.lightstone.10.desc", 10, "lightstone/a1-glowstone-cobble"); + glowstone.carverHelper.addVariation("tile.lightstone.11.desc", 11, "lightstone/a1-glowstone-growth"); + glowstone.carverHelper.addVariation("tile.lightstone.12.desc", 12, "lightstone/a1-glowstone-layers"); + glowstone.carverHelper.addVariation("tile.lightstone.13.desc", 13, "lightstone/a1-glowstone-tilecorroded"); + glowstone.carverHelper.addVariation("tile.lightstone.14.desc", 14, "lightstone/glowstone-bismuth"); + glowstone.carverHelper.addVariation("tile.lightstone.15.desc", 15, "lightstone/glowstone-bismuth-panel"); + glowstone.carverHelper.registerAll(glowstone, "glowstone"); + Carving.chisel.registerOre("glowstone", "glowstone"); + } + }, + + GOLD_BLOCK { + + @Override + void addBlocks() { + BlockCarvable gold_block = (BlockBeaconBase) new BlockBeaconBase() + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(3F).setResistance(10F) + .setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("gold_block", Blocks.gold_block, 0, 0); + gold_block.carverHelper.addVariation("tile.gold.1.desc", 1, "gold/terrain-gold-largeingot"); + gold_block.carverHelper.addVariation("tile.gold.2.desc", 2, "gold/terrain-gold-smallingot"); + gold_block.carverHelper.addVariation("tile.gold.3.desc", 3, "gold/terrain-gold-brick"); + gold_block.carverHelper.addVariation("tile.gold.4.desc", 4, "gold/terrain-gold-cart"); + gold_block.carverHelper.addVariation("tile.gold.5.desc", 5, "gold/terrain-gold-coin-heads"); + gold_block.carverHelper.addVariation("tile.gold.6.desc", 6, "gold/terrain-gold-coin-tails"); + gold_block.carverHelper.addVariation("tile.gold.7.desc", 7, "gold/terrain-gold-crate-dark"); + gold_block.carverHelper.addVariation("tile.gold.8.desc", 8, "gold/terrain-gold-crate-light"); + gold_block.carverHelper.addVariation("tile.gold.9.desc", 9, "gold/terrain-gold-plates"); + gold_block.carverHelper.addVariation("tile.gold.10.desc", 10, "gold/terrain-gold-rivets"); + gold_block.carverHelper.addVariation("tile.gold.11.desc", 11, "gold/terrain-gold-star"); + gold_block.carverHelper.addVariation("tile.gold.12.desc", 12, "gold/terrain-gold-space"); + gold_block.carverHelper.addVariation("tile.gold.13.desc", 13, "gold/terrain-gold-spaceblack"); + gold_block.carverHelper.addVariation("tile.gold.14.desc", 14, "gold/terrain-gold-simple"); + + BlockCarvable gold2 = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F).setResistance(10F); + gold2.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/gold/caution", 20); + gold2.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/gold/crate", 21); + gold2.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/gold/thermal", 22); + gold2.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/gold/adv", 23); + gold2.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/gold/egregious", 24); + gold2.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/gold/bolted", 25); + gold2.carverHelper.registerBlock(gold2, "gold2"); + gold2.carverHelper.registerVariations("gold_block"); + + gold_block.carverHelper.registerAll(gold_block, "gold_block"); + Carving.chisel.registerOre("gold_block", "blockGold"); + } + }, + + GRANITE { + + @Override + void addBlocks() { + BlockCarvable granite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F) + .setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); + + granite.carverHelper.addVariation( + Configurations.imTooGoodForDescriptions ? "" : "tile.granite.0.desc", + 0, + "granite/granite"); + granite.carverHelper.addVariation("tile.granite.1.desc", 1, "granite/granitePolished"); + granite.carverHelper.addVariation("tile.granite.2.desc", 2, "granite/granitePillar"); + granite.carverHelper.addVariation("tile.granite.3.desc", 3, "granite/graniteLBrick"); + granite.carverHelper.addVariation("tile.granite.4.desc", 4, "granite/graniteOrnate"); + granite.carverHelper.addVariation("tile.granite.5.desc", 5, "granite/granitePrism"); + granite.carverHelper.addVariation("tile.granite.6.desc", 6, "granite/graniteTiles"); + granite.carverHelper.registerAll(granite, "granite"); + granite.carverHelper.registerOre("blockGranite"); + granite.carverHelper.registerOre("stoneGranite"); + } + + @Override + void addRecipes() { + if (DIORITE.enabled()) { + GameRegistry.addRecipe(new ShapelessOreRecipe(granite, diorite, "gemQuartz")); + } + } + }, + + GRIMSTONE { + + @Override + void addBlocks() { + BlockCarvable grimstone = (BlockGrimstone) new BlockGrimstone(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); + grimstone.carverHelper.addVariation("tile.grimstone.0.desc", 0, "grimstone/grimstone"); + grimstone.carverHelper.addVariation("tile.grimstone.1.desc", 1, "grimstone/smooth"); + grimstone.carverHelper.addVariation("tile.grimstone.2.desc", 2, "grimstone/hate"); + grimstone.carverHelper.addVariation("tile.grimstone.3.desc", 3, "grimstone/chiseled"); + grimstone.carverHelper.addVariation("tile.grimstone.4.desc", 4, "grimstone/blocks"); + grimstone.carverHelper.addVariation("tile.grimstone.5.desc", 5, "grimstone/blocks-rough"); + grimstone.carverHelper.addVariation("tile.grimstone.6.desc", 6, "grimstone/brick"); + grimstone.carverHelper.addVariation("tile.grimstone.7.desc", 7, "grimstone/largebricks"); + grimstone.carverHelper.addVariation("tile.grimstone.8.desc", 8, "grimstone/platform"); + grimstone.carverHelper.addVariation("tile.grimstone.9.desc", 9, "grimstone/platform-tiles"); + grimstone.carverHelper.addVariation("tile.grimstone.10.desc", 10, "grimstone/construction"); + grimstone.carverHelper.addVariation("tile.grimstone.11.desc", 11, "grimstone/fancy-tiles"); + grimstone.carverHelper.addVariation("tile.grimstone.12.desc", 12, "grimstone/plate"); + grimstone.carverHelper.addVariation("tile.grimstone.13.desc", 13, "grimstone/plate-rough"); + grimstone.carverHelper.addVariation("tile.grimstone.14.desc", 14, "grimstone/flaky"); + grimstone.carverHelper.registerAll(grimstone, "grimstone"); + Carving.chisel.registerOre("grimstone", "grimstone"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.grimstone, 8, 0), + "***", + "*X*", + "***", + '*', + new ItemStack(Blocks.stone, 1), + 'X', + new ItemStack(Items.coal, 1)); + } + }, + + HEX_PLATING { + + @Override + void addBlocks() { + BlockCarvable hexPlating = (BlockCarvable) new BlockCarvableGlow("animations/archetype2") + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2).setResistance(12); + for (int i = 0; i < 16; i++) { + hexPlating.carverHelper.addVariation( + "tile.hexPlating." + ItemDye.field_150921_b[i] + ".desc", + i, + "hexPlating/hexBase"); + } + hexPlating.carverHelper.registerAll(hexPlating, "hexPlating"); + Carving.chisel.registerOre("hexPlating", "hexPlating"); + + BlockCarvable hexLargePlating = (BlockCarvable) new BlockCarvableGlow("animations/archetype2") + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2).setResistance(12); + for (int i = 0; i < 16; i++) { + hexLargePlating.carverHelper.addVariation( + "tile.hexPlating." + ItemDye.field_150921_b[i] + ".desc", + i, + "hexPlating/hexNew", + (i + 20)); + } + + hexLargePlating.carverHelper.registerBlock(hexLargePlating, "hexLargePlating"); + hexLargePlating.carverHelper.registerVariations("hexPlating"); + Carving.chisel.registerOre("hexPlating", "hexPlating"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.hexPlating, 8, 0), + "XXX", + "XYX", + "XXX", + 'X', + "stone", + 'Y', + "blockCoal")); + } + }, + + HOLYSTONE { + + @Override + void addBlocks() { + BlockCarvable holystone = (BlockHolystone) new BlockHolystone(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Chisel.soundHolystoneFootstep); + holystone.carverHelper.addVariation("tile.holystone.0.desc", 0, "holystone/holystone"); + holystone.carverHelper.addVariation("tile.holystone.1.desc", 1, "holystone/smooth"); + holystone.carverHelper.addVariation("tile.holystone.2.desc", 2, "holystone/love"); + holystone.carverHelper.addVariation("tile.holystone.3.desc", 3, "holystone/chiseled"); + holystone.carverHelper.addVariation("tile.holystone.4.desc", 4, "holystone/blocks"); + holystone.carverHelper.addVariation("tile.holystone.5.desc", 5, "holystone/blocks-rough"); + holystone.carverHelper.addVariation("tile.holystone.6.desc", 6, "holystone/brick"); + holystone.carverHelper.addVariation("tile.holystone.7.desc", 7, "holystone/largebricks"); + holystone.carverHelper.addVariation("tile.holystone.8.desc", 8, "holystone/platform"); + holystone.carverHelper.addVariation("tile.holystone.9.desc", 9, "holystone/platform-tiles"); + holystone.carverHelper.addVariation("tile.holystone.10.desc", 10, "holystone/construction"); + holystone.carverHelper.addVariation("tile.holystone.11.desc", 11, "holystone/fancy-tiles"); + holystone.carverHelper.addVariation("tile.holystone.12.desc", 12, "holystone/plate"); + holystone.carverHelper.addVariation("tile.holystone.13.desc", 13, "holystone/plate-rough"); + holystone.carverHelper.registerAll(holystone, "holystone"); + OreDictionary.registerOre("holystone", holystone); + Carving.chisel.registerOre("holystone", "holystone"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.holystone, 8, 0), + "***", + "*X*", + "***", + '*', + new ItemStack(Blocks.stone, 1), + 'X', + new ItemStack(Items.feather, 1)); + } + }, + + ICE { + + @Override + void addBlocks() { + BlockCarvableIce ice = (BlockCarvableIce) new BlockCarvableIce() + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3) + .setStepSound(Block.soundTypeGlass); + Carving.chisel.addVariation("ice", Blocks.ice, 0, 0); + ice.carverHelper.addVariation("tile.ice.1.desc", 1, "ice/a1-ice-light"); + ice.carverHelper.addVariation("tile.ice.2.desc", 2, "ice/a1-stonecobble-icecobble"); + ice.carverHelper.addVariation("tile.ice.3.desc", 3, "ice/a1-netherbrick-ice"); + ice.carverHelper.addVariation("tile.ice.4.desc", 4, "ice/a1-stonecobble-icebrick"); + ice.carverHelper.addVariation("tile.ice.5.desc", 5, "ice/a1-stonecobble-icebricksmall"); + ice.carverHelper.addVariation("tile.ice.6.desc", 6, "ice/a1-stonecobble-icedungeon"); + ice.carverHelper.addVariation("tile.ice.7.desc", 7, "ice/a1-stonecobble-icefour"); + ice.carverHelper.addVariation("tile.ice.8.desc", 8, "ice/a1-stonecobble-icefrench"); + ice.carverHelper.addVariation("tile.ice.9.desc", 9, "ice/sunkentiles"); + ice.carverHelper.addVariation("tile.ice.10.desc", 10, "ice/tiles"); + ice.carverHelper.addVariation("tile.ice.11.desc", 11, "ice/a1-stonecobble-icepanel"); + ice.carverHelper.addVariation("tile.ice.12.desc", 12, "ice/a1-stoneslab-ice"); + ice.carverHelper.addVariation("tile.ice.13.desc", 13, "ice/zelda"); + ice.carverHelper.addVariation("tile.ice.14.desc", 14, "ice/bismuth"); + ice.carverHelper.addVariation("tile.ice.15.desc", 15, "ice/poison"); + ice.carverHelper.registerAll(ice, "ice"); + Carving.chisel.registerOre("ice", "ice"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.ice, 4, 1), + "XX", + "XX", + 'X', + new ItemStack(ChiselBlocks.ice_pillar, 1, OreDictionary.WILDCARD_VALUE)); + } + }, + + ICE_PILLAR(ICE) { + + @Override + void addBlocks() { + BlockCarvableIce ice_pillar = (BlockCarvableIce) new BlockCarvableIce() + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3) + .setStepSound(Block.soundTypeGlass); + + ice_pillar.carverHelper.addVariation("tile.icePillar.0.desc", 0, "icepillar/plainplain"); + ice_pillar.carverHelper.addVariation("tile.icePillar.1.desc", 1, "icepillar/plaingreek"); + ice_pillar.carverHelper.addVariation("tile.icePillar.2.desc", 2, "icepillar/greekplain"); + ice_pillar.carverHelper.addVariation("tile.icePillar.3.desc", 3, "icepillar/greekgreek"); + ice_pillar.carverHelper.addVariation("tile.icePillar.4.desc", 4, "icepillar/convexplain"); + ice_pillar.carverHelper.addVariation("tile.icePillar.5.desc", 5, "icepillar/carved"); + ice_pillar.carverHelper.addVariation("tile.icePillar.6.desc", 6, "icepillar/ornamental"); + ice_pillar.carverHelper.registerAll(ice_pillar, "ice_pillar"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.ice_pillar, 6, 0), + "XX", + "XX", + "XX", + 'X', + new ItemStack(ChiselBlocks.ice, 1, OreDictionary.WILDCARD_VALUE)); + } + }, + + ICE_STAIRS(ICE) { + + @Override + void addBlocks() { + CarvableStairsMaker makerIceStairs = new CarvableStairsMaker(Blocks.ice); + + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.0.desc", 0, Blocks.ice); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.1.desc", 1, "ice/a1-ice-light"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.2.desc", 2, "ice/a1-stonecobble-icecobble"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.3.desc", 3, "ice/a1-netherbrick-ice"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.4.desc", 4, "ice/a1-stonecobble-icebrick"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.5.desc", 5, "ice/a1-stonecobble-icebricksmall"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.6.desc", 6, "ice/a1-stonecobble-icedungeon"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.7.desc", 7, "ice/a1-stonecobble-icefour"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.8.desc", 8, "ice/a1-stonecobble-icefrench"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.9.desc", 9, "ice/sunkentiles"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.10.desc", 10, "ice/tiles"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.11.desc", 11, "ice/a1-stonecobble-icepanel"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.12.desc", 12, "ice/a1-stoneslab-ice"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.13.desc", 13, "ice/zelda"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.14.desc", 14, "ice/bismuth"); + makerIceStairs.carverHelper.addVariation("tile.ice_stairs.15.desc", 15, "ice/poison"); + makerIceStairs.create(new IStairsCreator() { + + @Override + public BlockCarvableStairs create(Block block, int meta, CarvableHelper helper) { + return new BlockCarvableIceStairs(block, meta, helper); + } + }, "ice_stairs", ChiselBlocks.iceStairs); + Carving.chisel.registerOre("ice_stairs", "iceStairs"); + } + }, + + IRON_BARS { + + @Override + void addBlocks() { + BlockCarvablePane iron_bars = (BlockCarvablePane) new BlockCarvablePane(Material.iron, true) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F) + .setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("iron_bars", Blocks.iron_bars, 0, 0); + iron_bars.carverHelper.addVariation("tile.iron_bars.1.desc", 1, "ironpane/fenceIron"); + iron_bars.carverHelper.addVariation("tile.iron_bars.2.desc", 2, "ironpane/barbedwire"); + iron_bars.carverHelper.addVariation("tile.iron_bars.3.desc", 3, "ironpane/cage"); + iron_bars.carverHelper.addVariation("tile.iron_bars.4.desc", 4, "ironpane/fenceIronTop"); + iron_bars.carverHelper.addVariation("tile.iron_bars.5.desc", 5, "ironpane/terrain-glass-thickgrid"); + iron_bars.carverHelper.addVariation("tile.iron_bars.6.desc", 6, "ironpane/terrain-glass-thingrid"); + iron_bars.carverHelper.addVariation("tile.iron_bars.7.desc", 7, "ironpane/terrain-glass-ornatesteel"); + iron_bars.carverHelper.addVariation("tile.iron_bars.8.desc", 8, "ironpane/bars"); + iron_bars.carverHelper.addVariation("tile.iron_bars.9.desc", 9, "ironpane/spikes"); + iron_bars.carverHelper.registerAll(iron_bars, "iron_bars"); + Carving.chisel.registerOre("iron_bars", "iron_bars"); + } + }, + + IRON_BLOCK { + + @Override + void addBlocks() { + + BlockCarvable iron_block = (BlockBeaconBase) new BlockBeaconBase() + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(5F).setResistance(10F) + .setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("iron_block", Blocks.iron_block, 0, 0); + iron_block.carverHelper.addVariation("tile.iron.1.desc", 1, "iron/terrain-iron-largeingot"); + iron_block.carverHelper.addVariation("tile.iron.2.desc", 2, "iron/terrain-iron-smallingot"); + iron_block.carverHelper.addVariation("tile.iron.3.desc", 3, "iron/terrain-iron-gears"); + iron_block.carverHelper.addVariation("tile.iron.4.desc", 4, "iron/terrain-iron-brick"); + iron_block.carverHelper.addVariation("tile.iron.5.desc", 5, "iron/terrain-iron-plates"); + iron_block.carverHelper.addVariation("tile.iron.6.desc", 6, "iron/terrain-iron-rivets"); + iron_block.carverHelper.addVariation("tile.iron.7.desc", 7, "iron/terrain-iron-coin-heads"); + iron_block.carverHelper.addVariation("tile.iron.8.desc", 8, "iron/terrain-iron-coin-tails"); + iron_block.carverHelper.addVariation("tile.iron.9.desc", 9, "iron/terrain-iron-crate-dark"); + iron_block.carverHelper.addVariation("tile.iron.10.desc", 10, "iron/terrain-iron-crate-light"); + iron_block.carverHelper.addVariation("tile.iron.11.desc", 11, "iron/terrain-iron-moon"); + iron_block.carverHelper.addVariation("tile.iron.12.desc", 12, "iron/terrain-iron-space"); + iron_block.carverHelper.addVariation("tile.iron.13.desc", 13, "iron/terrain-iron-spaceblack"); + iron_block.carverHelper.addVariation("tile.iron.14.desc", 14, "iron/terrain-iron-vents"); + iron_block.carverHelper.addVariation("tile.iron.15.desc", 15, "iron/terrain-iron-simple"); + + BlockCarvable iron2 = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F).setResistance(10F); + iron2.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/iron/caution", 20); + iron2.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/iron/crate", 21); + iron2.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/iron/thermal", 22); + iron2.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/iron/adv", 23); + iron2.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/iron/egregious", 24); + iron2.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/iron/bolted", 25); + iron2.carverHelper.registerBlock(iron2, "iron2"); + iron2.carverHelper.registerVariations("iron_block"); + + iron_block.carverHelper.registerAll(iron_block, "iron_block"); + Carving.chisel.registerOre("iron_block", "blockIron"); + } + }, + + JACKOLANTERN { + + @Override + void addBlocks() { + for (int metadata = 0; metadata < 16; metadata++) { + jackolantern[metadata] = (BlockCarvablePumpkin) new BlockCarvablePumpkin(true) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(1.0F).setBlockName("litpumpkin") + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setLightLevel(1.0f); + jackolantern[metadata].setInformation("pumpkin/pumpkin_face_" + (metadata + 1) + "_on"); + GameRegistry.registerBlock( + jackolantern[metadata], + ItemCarvablePumpkin.class, + ("jackolantern" + (metadata + 1))); + Carving.chisel.addVariation("jackolantern", jackolantern[metadata], 0, (metadata + 1)); + } + Carving.chisel.addVariation("jackolantern", Blocks.lit_pumpkin, 0, 0); + Carving.chisel.registerOre("jackolantern", "jackolantern"); + } + }, + + LABORATORY { + + @Override + void addBlocks() { + BlockCarvable laboratoryblock = (BlockCarvable) new BlockCarvable(Material.iron) + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Chisel.soundMetalFootstep); + + laboratoryblock.carverHelper.addVariation("tile.laboratory.0.desc", 0, "laboratory/wallpanel"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.1.desc", 1, "laboratory/dottedpanel"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.2.desc", 2, "laboratory/largewall"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.3.desc", 3, "laboratory/roundel"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.4.desc", 4, "laboratory/wallvents"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.5.desc", 5, "laboratory/largetile"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.6.desc", 6, "laboratory/smalltile"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.7.desc", 7, "laboratory/floortile"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.8.desc", 8, "laboratory/checkertile"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.9.desc", 9, "laboratory/clearscreen"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.10.desc", 10, "laboratory/fuzzscreen"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.11.desc", 11, "laboratory/largesteel"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.12.desc", 12, "laboratory/smallsteel"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.13.desc", 13, "laboratory/directionright"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.14.desc", 14, "laboratory/directionleft"); + laboratoryblock.carverHelper.addVariation("tile.laboratory.15.desc", 15, "laboratory/infocon"); + laboratoryblock.carverHelper.registerAll(laboratoryblock, "laboratoryblock"); + Carving.chisel.registerOre("laboratoryblock", "laboratoryblock"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.laboratoryblock, 8, 0), + "***", + "*X*", + "***", + '*', + new ItemStack(Blocks.stone, 1), + 'X', + new ItemStack(Items.quartz, 1)); + } + }, + + LAPIS_BLOCK { + + @Override + void addBlocks() { + BlockCarvable lapis_block = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(3F).setResistance(5F) + .setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("lapis_block", Blocks.lapis_block, 0, 0); + lapis_block.carverHelper.addVariation("tile.lapis.1.desc", 1, "lapis/terrain-lapisblock-chunky"); + lapis_block.carverHelper.addVariation("tile.lapis.2.desc", 2, "lapis/terrain-lapisblock-panel"); + lapis_block.carverHelper.addVariation("tile.lapis.3.desc", 3, "lapis/terrain-lapisblock-zelda"); + lapis_block.carverHelper.addVariation("tile.lapis.4.desc", 4, "lapis/terrain-lapisornate"); + lapis_block.carverHelper.addVariation("tile.lapis.5.desc", 5, "lapis/terrain-lapistile"); + lapis_block.carverHelper.addVariation("tile.lapis.6.desc", 6, "lapis/a1-blocklapis-panel"); + lapis_block.carverHelper.addVariation("tile.lapis.7.desc", 7, "lapis/a1-blocklapis-smooth"); + lapis_block.carverHelper.addVariation("tile.lapis.8.desc", 8, "lapis/a1-blocklapis-ornatelayer"); + + lapis_block.carverHelper.registerAll(lapis_block, "lapis_block"); + Carving.chisel.registerOre("lapis_block", "lapis"); + } + }, + + LAVASTONE { + + @Override + void addBlocks() { + BlockLavastone lavastone = (BlockLavastone) new BlockLavastone(Material.rock, "lava_still") + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); + lavastone.carverHelper.addVariation("tile.lavastone.0.desc", 0, "lavastone/cobble"); + lavastone.carverHelper.addVariation("tile.lavastone.1.desc", 1, "lavastone/black"); + lavastone.carverHelper.addVariation("tile.lavastone.2.desc", 2, "lavastone/tiles"); + lavastone.carverHelper.addVariation("tile.lavastone.3.desc", 3, "lavastone/chaotic"); + lavastone.carverHelper.addVariation("tile.lavastone.4.desc", 4, "lavastone/creeper"); + lavastone.carverHelper.addVariation("tile.lavastone.5.desc", 5, "lavastone/panel"); + lavastone.carverHelper.addVariation("tile.lavastone.6.desc", 6, "lavastone/panel-ornate"); + lavastone.carverHelper.addVariation("tile.lavastone.7.desc", 7, "lavastone/dark"); + lavastone.carverHelper.registerAll(lavastone, "lavastone"); + OreDictionary.registerOre("lavastone", lavastone); + Carving.chisel.registerOre("lavastone", "lavastone"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.lavastone, 8, 0), + "***", + "*X*", + "***", + '*', + new ItemStack(Blocks.stone, 1), + 'X', + new ItemStack(Items.lava_bucket, 1)); + } + }, + + LEAD { + + @Override + void addBlocks() { + BlockCarvable lead = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F).setResistance(10F); + lead.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/lead/caution"); + lead.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/lead/crate"); + lead.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/lead/thermal"); + lead.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/lead/adv"); + lead.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/lead/egregious"); + lead.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/lead/bolted"); + lead.carverHelper.registerAll(lead, "leadblock"); + Carving.chisel.registerOre("leadblock", "blockLead"); + } + }, + + LEAVES { + + @Override + void addBlocks() { + BlockLeaf leaves = (BlockLeaf) new BlockLeaf(Material.leaves) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.2F) + .setStepSound(Block.soundTypeGrass); + Carving.chisel.addGroup(new SimpleCarvingGroup("leaves") { + + @Override + public List getVariations() { + if (Configurations.chiselBackToVanillaLeaves) { + return super.getVariations(); + } else { + List ret = Lists.newArrayList(); + for (ICarvingVariation v : super.getVariations()) { + if (v.getBlock() != Blocks.leaves && v.getBlock() != Blocks.leaves2) { + ret.add(v); + } + } + return ret; + } + } + }); + Carving.chisel.addVariation("leaves", Blocks.leaves, 0, 0); + Carving.chisel.addVariation("leaves", Blocks.leaves, 1, 0); + Carving.chisel.addVariation("leaves", Blocks.leaves, 2, 0); + Carving.chisel.addVariation("leaves", Blocks.leaves, 3, 0); + Carving.chisel.addVariation("leaves", Blocks.leaves2, 0, 0); + Carving.chisel.addVariation("leaves", Blocks.leaves2, 1, 0); + + leaves.carverHelper.addVariation("tile.leaves.6.desc", 6, new SubmapManagerLeaves("leaves/dead")); + leaves.carverHelper.addVariation("tile.leaves.7.desc", 7, new SubmapManagerLeaves("leaves/fancy")); + leaves.carverHelper.addVariation("tile.leaves.8.desc", 8, new SubmapManagerLeaves("leaves/pinkpetal")); + leaves.carverHelper.addVariation("tile.leaves.9.desc", 9, new SubmapManagerLeaves("leaves/red_roses")); + leaves.carverHelper.addVariation("tile.leaves.10.desc", 10, new SubmapManagerLeaves("leaves/roses")); + leaves.carverHelper + .addVariation("tile.leaves.11.desc", 11, new SubmapManagerLeaves("leaves/christmasBalls")); + leaves.carverHelper + .addVariation("tile.leaves.12.desc", 12, new SubmapManagerLeaves("leaves/christmasLights")); + + leaves.carverHelper.registerAll(leaves, "leaves"); + Carving.chisel.registerOre("leaves", "leaves"); + } + }, + + LIMESTONE { + + @Override + void addBlocks() { + BlockCarvable limestone = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Block.soundTypeStone); + + limestone.carverHelper.addVariation("tile.limestone.0.desc", 0, "limestone"); + limestone.carverHelper.addVariation("tile.limestone.1.desc", 1, "limestone/terrain-cobbsmalltilelight"); + limestone.carverHelper.addVariation("tile.limestone.2.desc", 2, "limestone/terrain-cob-frenchlight"); + limestone.carverHelper.addVariation("tile.limestone.3.desc", 3, "limestone/terrain-cob-french2light"); + limestone.carverHelper + .addVariation("tile.limestone.4.desc", 4, "limestone/terrain-cobmoss-creepdungeonlight"); + limestone.carverHelper.addVariation("tile.limestone.5.desc", 5, "limestone/terrain-cob-smallbricklight"); + limestone.carverHelper.addVariation("tile.limestone.6.desc", 6, "limestone/terrain-mossysmalltilelight"); + limestone.carverHelper.addVariation("tile.limestone.7.desc", 7, "limestone/terrain-pistonback-dungeon"); + limestone.carverHelper + .addVariation("tile.limestone.8.desc", 8, "limestone/terrain-pistonback-dungeonornate"); + limestone.carverHelper.addVariation("tile.limestone.9.desc", 9, "limestone/terrain-pistonback-dungeonvent"); + limestone.carverHelper + .addVariation("tile.limestone.10.desc", 10, "limestone/terrain-pistonback-lightcreeper"); + limestone.carverHelper.addVariation("tile.limestone.11.desc", 11, "limestone/terrain-pistonback-lightdent"); + limestone.carverHelper + .addVariation("tile.limestone.12.desc", 12, "limestone/terrain-pistonback-lightemboss"); + limestone.carverHelper.addVariation("tile.limestone.13.desc", 13, "limestone/terrain-pistonback-lightfour"); + limestone.carverHelper + .addVariation("tile.limestone.14.desc", 14, "limestone/terrain-pistonback-lightmarker"); + limestone.carverHelper + .addVariation("tile.limestone.15.desc", 15, "limestone/terrain-pistonback-lightpanel"); + limestone.carverHelper.registerAll(limestone, "limestone"); + OreDictionary.registerOre("limestone", limestone); + Carving.chisel.registerOre("limestone", "limestone"); + + BlockCarvableSlab limestone_slab = (BlockCarvableSlab) new BlockCarvableSlab(limestone) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); + + limestone_slab.carverHelper.addVariation("tile.limestoneSlab.0.desc", 0, "limestone"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.1.desc", 1, "limestone/terrain-cobbsmalltilelight"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.2.desc", 2, "limestone/terrain-cob-frenchlight"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.3.desc", 3, "limestone/terrain-cob-french2light"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.4.desc", 4, "limestone/terrain-cobmoss-creepdungeonlight"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.5.desc", 5, "limestone/terrain-cob-smallbricklight"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.6.desc", 6, "limestone/terrain-mossysmalltilelight"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.7.desc", 7, "limestone/terrain-pistonback-dungeon"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.8.desc", 8, "limestone/terrain-pistonback-dungeonornate"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.9.desc", 9, "limestone/terrain-pistonback-dungeonvent"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.10.desc", 10, "limestone/terrain-pistonback-lightcreeper"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.11.desc", 11, "limestone/terrain-pistonback-lightdent"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.12.desc", 12, "limestone/terrain-pistonback-lightemboss"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.13.desc", 13, "limestone/terrain-pistonback-lightfour"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.14.desc", 14, "limestone/terrain-pistonback-lightmarker"); + limestone_slab.carverHelper + .addVariation("tile.limestoneSlab.15.desc", 15, "limestone/terrain-pistonback-lightpanel"); + limestone_slab.carverHelper.registerAll(limestone_slab, "limestone_slab", ItemCarvableSlab.class); + registerSlabTop(limestone_slab, limestone_slab.top); + Carving.chisel.registerOre("limestone_slab", "limestone_slab"); + + CarvableStairsMaker makerLimestoneStairs = new CarvableStairsMaker(limestone); + + makerLimestoneStairs.carverHelper.addVariation("tile.limestoneStairs.0.desc", 0, "limestone"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.1.desc", 1, "limestone/terrain-cobbsmalltilelight"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.2.desc", 2, "limestone/terrain-cob-frenchlight"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.3.desc", 3, "limestone/terrain-cob-french2light"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.4.desc", 4, "limestone/terrain-cobmoss-creepdungeonlight"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.5.desc", 5, "limestone/terrain-cob-smallbricklight"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.6.desc", 6, "limestone/terrain-mossysmalltilelight"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.7.desc", 7, "limestone/terrain-pistonback-dungeon"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.8.desc", 8, "limestone/terrain-pistonback-dungeonornate"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.9.desc", 9, "limestone/terrain-pistonback-dungeonvent"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.10.desc", 10, "limestone/terrain-pistonback-lightcreeper"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.11.desc", 11, "limestone/terrain-pistonback-lightdent"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.12.desc", 12, "limestone/terrain-pistonback-lightemboss"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.13.desc", 13, "limestone/terrain-pistonback-lightfour"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.14.desc", 14, "limestone/terrain-pistonback-lightmarker"); + makerLimestoneStairs.carverHelper + .addVariation("tile.limestoneStairs.15.desc", 15, "limestone/terrain-pistonback-lightpanel"); + makerLimestoneStairs.create("limestone_stairs", ChiselBlocks.limestoneStairs); + Carving.chisel.registerOre("limestone_stairs", "limestone_stairs"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.limestone_slab, 6, 0), + "***", + '*', + new ItemStack(ChiselBlocks.limestone, 1, OreDictionary.WILDCARD_VALUE)); + } + }, + + MARBLE { + + @Override + void addBlocks() { + BlockCarvable marble = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Block.soundTypeStone); + + marble.carverHelper.addVariation("tile.marble.0.desc", 0, "marble"); + marble.carverHelper.addVariation("tile.marble.1.desc", 1, "marble/a1-stoneornamental-marblebrick"); + marble.carverHelper.addVariation("tile.marble.2.desc", 2, "marble/a1-stoneornamental-marbleclassicpanel"); + marble.carverHelper.addVariation("tile.marble.3.desc", 3, "marble/a1-stoneornamental-marbleornate"); + marble.carverHelper.addVariation("tile.marble.4.desc", 4, "marble/panel"); + marble.carverHelper.addVariation("tile.marble.5.desc", 5, "marble/block"); + marble.carverHelper.addVariation("tile.marble.6.desc", 6, "marble/terrain-pistonback-marblecreeperdark"); + marble.carverHelper.addVariation("tile.marble.7.desc", 7, "marble/terrain-pistonback-marblecreeperlight"); + marble.carverHelper.addVariation("tile.marble.8.desc", 8, "marble/a1-stoneornamental-marblecarved"); + marble.carverHelper.addVariation("tile.marble.9.desc", 9, "marble/a1-stoneornamental-marblecarvedradial"); + marble.carverHelper.addVariation("tile.marble.10.desc", 10, "marble/terrain-pistonback-marbledent"); + marble.carverHelper.addVariation("tile.marble.11.desc", 11, "marble/terrain-pistonback-marbledent-small"); + marble.carverHelper.addVariation("tile.marble.12.desc", 12, "marble/marble-bricks"); + marble.carverHelper.addVariation("tile.marble.13.desc", 13, "marble/marble-arranged-bricks"); + marble.carverHelper.addVariation("tile.marble.14.desc", 14, "marble/marble-fancy-bricks"); + marble.carverHelper.addVariation("tile.marble.15.desc", 15, "marble/marble-blocks"); + marble.carverHelper.registerAll(marble, "marble"); + OreDictionary.registerOre("marble", marble); + OreDictionary.registerOre("blockMarble", marble); + Carving.chisel.registerOre("marble", "marble"); + + BlockCarvableSlab marble_slab = (BlockCarvableSlab) new BlockCarvableSlab(marble).setHardness(2.0F) + .setResistance(10F); + + marble_slab.carverHelper.addVariation("tile.marbleSlab.0.desc", 0, "marble"); + marble_slab.carverHelper + .addVariation("tile.marbleSlab.1.desc", 1, "marbleslab/a1-stoneornamental-marblebrick"); + marble_slab.carverHelper + .addVariation("tile.marbleSlab.2.desc", 2, "marbleslab/a1-stoneornamental-marbleclassicpanel"); + marble_slab.carverHelper + .addVariation("tile.marbleSlab.3.desc", 3, "marbleslab/a1-stoneornamental-marbleornate"); + marble_slab.carverHelper + .addVariation("tile.marbleSlab.4.desc", 4, "marbleslab/a1-stoneornamental-marblepanel"); + marble_slab.carverHelper.addVariation("tile.marbleSlab.5.desc", 5, "marbleslab/terrain-pistonback-marble"); + marble_slab.carverHelper + .addVariation("tile.marbleSlab.6.desc", 6, "marbleslab/terrain-pistonback-marblecreeperdark"); + marble_slab.carverHelper + .addVariation("tile.marbleSlab.7.desc", 7, "marbleslab/terrain-pistonback-marblecreeperlight"); + marble_slab.carverHelper + .addVariation("tile.marbleSlab.8.desc", 8, "marbleslab/a1-stoneornamental-marblecarved"); + marble_slab.carverHelper + .addVariation("tile.marbleSlab.9.desc", 9, "marbleslab/a1-stoneornamental-marblecarvedradial"); + marble_slab.carverHelper + .addVariation("tile.marbleSlab.10.desc", 10, "marbleslab/terrain-pistonback-marbledent"); + marble_slab.carverHelper + .addVariation("tile.marbleSlab.11.desc", 11, "marbleslab/terrain-pistonback-marbledent-small"); + marble_slab.carverHelper.addVariation("tile.marbleSlab.12.desc", 12, "marbleslab/marble-bricks"); + marble_slab.carverHelper.addVariation( + "tile.marbleSlab.13.desc", + 13, + new SubmapManagerSlab("marbleslab/marble-arranged-bricks")); + marble_slab.carverHelper.addVariation("tile.marbleSlab.14.desc", 14, "marbleslab/marble-fancy-bricks"); + marble_slab.carverHelper.addVariation("tile.marbleSlab.15.desc", 15, "marbleslab/marble-blocks"); + marble_slab.carverHelper.registerAll(marble_slab, "marble_slab", ItemCarvableSlab.class); + registerSlabTop(marble_slab, marble_slab.top); + Carving.chisel.registerOre("marble_slab", "marble_slab"); + + CarvableStairsMaker makerMarbleStairs = new CarvableStairsMaker(marble); + + makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.0.desc", 0, "marble"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.6.desc", 1, "marbleslab/a1-stoneornamental-marblebrick"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.2.desc", 2, "marbleslab/a1-stoneornamental-marbleclassicpanel"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.3.desc", 3, "marbleslab/a1-stoneornamental-marbleornate"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.4.desc", 4, "marbleslab/a1-stoneornamental-marblepanel"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.5.desc", 5, "marbleslab/terrain-pistonback-marble"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.6.desc", 6, "marbleslab/terrain-pistonback-marblecreeperdark"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.7.desc", 7, "marbleslab/terrain-pistonback-marblecreeperlight"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.8.desc", 8, "marbleslab/a1-stoneornamental-marblecarved"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.9.desc", 9, "marbleslab/a1-stoneornamental-marblecarvedradial"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.10.desc", 10, "marbleslab/terrain-pistonback-marbledent"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.11.desc", 11, "marbleslab/terrain-pistonback-marbledent-small"); + makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.12.desc", 12, "marbleslab/marble-bricks"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.13.desc", 13, "marbleslab/marble-arranged-bricks"); + makerMarbleStairs.carverHelper + .addVariation("tile.marbleStairs.14.desc", 14, "marbleslab/marble-fancy-bricks"); + makerMarbleStairs.carverHelper.addVariation("tile.marbleStairs.15.desc", 15, "marbleslab/marble-blocks"); + makerMarbleStairs.create("marble_stairs", ChiselBlocks.marbleStairs); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.marble_slab, 6, 0), + "***", + '*', + new ItemStack(ChiselBlocks.marble, 1, OreDictionary.WILDCARD_VALUE)); + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.marble, 4), + "XX", + "XX", + 'X', + new ItemStack(ChiselBlocks.marble_pillar, 1, OreDictionary.WILDCARD_VALUE)); + } + }, + + MARBLE_PILLAR(MARBLE) { + + @Override + void addBlocks() { + + BlockCarvable marble_pillar; + if (Configurations.oldPillars) { + marble_pillar = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Block.soundTypeStone); + + marble_pillar.carverHelper.addVariation("tile.marblePillarOld.0.desc", 0, "marblepillarold/column"); + marble_pillar.carverHelper.addVariation("tile.marblePillarOld.1.desc", 1, "marblepillarold/capstone"); + marble_pillar.carverHelper.addVariation("tile.marblePillarOld.2.desc", 2, "marblepillarold/base"); + marble_pillar.carverHelper.addVariation("tile.marblePillarOld.3.desc", 3, "marblepillarold/small"); + marble_pillar.carverHelper + .addVariation("tile.marblePillarOld.4.desc", 4, "marblepillarold/pillar-carved"); + marble_pillar.carverHelper.addVariation( + "tile.marblePillarOld.5.desc", + 5, + "marblepillarold/a1-stoneornamental-marblegreek"); + marble_pillar.carverHelper + .addVariation("tile.marblePillarOld.6.desc", 6, "marblepillarold/a1-stonepillar-greek"); + marble_pillar.carverHelper + .addVariation("tile.marblePillarOld.7.desc", 7, "marblepillarold/a1-stonepillar-plain"); + marble_pillar.carverHelper + .addVariation("tile.marblePillarOld.8.desc", 8, "marblepillarold/a1-stonepillar-greektopplain"); + marble_pillar.carverHelper + .addVariation("tile.marblePillarOld.9.desc", 9, "marblepillarold/a1-stonepillar-plaintopplain"); + marble_pillar.carverHelper.addVariation( + "tile.marblePillarOld.10.desc", + 10, + "marblepillarold/a1-stonepillar-greekbottomplain"); + marble_pillar.carverHelper.addVariation( + "tile.marblePillarOld.11.desc", + 11, + "marblepillarold/a1-stonepillar-plainbottomplain"); + marble_pillar.carverHelper.addVariation( + "tile.marblePillarOld.12.desc", + 12, + "marblepillarold/a1-stonepillar-greektopgreek"); + marble_pillar.carverHelper.addVariation( + "tile.marblePillarOld.13.desc", + 13, + "marblepillarold/a1-stonepillar-plaintopgreek"); + marble_pillar.carverHelper.addVariation( + "tile.marblePillarOld.14.desc", + 14, + "marblepillarold/a1-stonepillar-greekbottomgreek"); + marble_pillar.carverHelper.addVariation( + "tile.marblePillarOld.15.desc", + 15, + "marblepillarold/a1-stonepillar-plainbottomgreek"); + } else { + marble_pillar = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Block.soundTypeStone); + + marble_pillar.carverHelper.addVariation("tile.marblePillar.0.desc", 0, "marblepillar/pillar"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.1.desc", 1, "marblepillar/default"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.2.desc", 2, "marblepillar/simple"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.3.desc", 3, "marblepillar/convex"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.4.desc", 4, "marblepillar/rough"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.5.desc", 5, "marblepillar/greekdecor"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.6.desc", 6, "marblepillar/greekgreek"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.7.desc", 7, "marblepillar/greekplain"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.8.desc", 8, "marblepillar/plaindecor"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.9.desc", 9, "marblepillar/plaingreek"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.10.desc", 10, "marblepillar/plainplain"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.11.desc", 11, "marblepillar/widedecor"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.12.desc", 12, "marblepillar/widegreek"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.13.desc", 13, "marblepillar/wideplain"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.14.desc", 14, "marblepillar/carved"); + marble_pillar.carverHelper.addVariation("tile.marblePillar.15.desc", 15, "marblepillar/ornamental"); + } + marble_pillar.carverHelper.registerAll(marble_pillar, "marble_pillar"); + + BlockCarvableSlab marble_pillar_slab = (BlockCarvableSlab) new BlockCarvableSlab(marble_pillar) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Block.soundTypeStone); + + if (Configurations.oldPillars) { + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlabOld.0.desc", 0, "marblepillarslabold/column"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlabOld.1.desc", 1, "marblepillarslabold/capstone"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlabOld.2.desc", 2, "marblepillarslabold/base"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlabOld.3.desc", 3, "marblepillarslabold/small"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlabOld.4.desc", 4, "marblepillarslabold/pillar-carved"); + marble_pillar_slab.carverHelper.addVariation( + "tile.marblePillarSlabOld.5.desc", + 5, + "marblepillarslabold/a1-stoneornamental-marblegreek"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlabOld.6.desc", 6, "marblepillarslabold/a1-stonepillar-greek"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlabOld.7.desc", 7, "marblepillarslabold/a1-stonepillar-plain"); + marble_pillar_slab.carverHelper.addVariation( + "tile.marblePillarSlabOld.8.desc", + 8, + "marblepillarslabold/a1-stonepillar-greektopplain"); + marble_pillar_slab.carverHelper.addVariation( + "tile.marblePillarSlabOld.9.desc", + 9, + "marblepillarslabold/a1-stonepillar-plaintopplain"); + marble_pillar_slab.carverHelper.addVariation( + "tile.marblePillarSlabOld.10.desc", + 10, + "marblepillarslabold/a1-stonepillar-greekbottomplain"); + marble_pillar_slab.carverHelper.addVariation( + "tile.marblePillarSlabOld.11.desc", + 11, + "marblepillarslabold/a1-stonepillar-plainbottomplain"); + marble_pillar_slab.carverHelper.addVariation( + "tile.marblePillarSlabOld.12.desc", + 12, + "marblepillarslabold/a1-stonepillar-greektopgreek"); + marble_pillar_slab.carverHelper.addVariation( + "tile.marblePillarSlabOld.13.desc", + 13, + "marblepillarslabold/a1-stonepillar-plaintopgreek"); + marble_pillar_slab.carverHelper.addVariation( + "tile.marblePillarSlabOld.14.desc", + 14, + "marblepillarslabold/a1-stonepillar-greekbottomgreek"); + marble_pillar_slab.carverHelper.addVariation( + "tile.marblePillarSlabOld.15.desc", + 15, + "marblepillarslabold/a1-stonepillar-plainbottomgreek"); + } else { + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.0.desc", 0, "marblepillarslab/pillar"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.1.desc", 1, "marblepillarslab/default"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.2.desc", 2, "marblepillarslab/simple"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.3.desc", 3, "marblepillarslab/convex"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.4.desc", 4, "marblepillarslab/rough"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.5.desc", 5, "marblepillarslab/greekdecor"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.6.desc", 6, "marblepillarslab/greekgreek"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.7.desc", 7, "marblepillarslab/greekplain"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.8.desc", 8, "marblepillarslab/plaindecor"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.9.desc", 9, "marblepillarslab/plaingreek"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.10.desc", 10, "marblepillarslab/plainplain"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.11.desc", 11, "marblepillarslab/widedecor"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.12.desc", 12, "marblepillarslab/widegreek"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.13.desc", 13, "marblepillarslab/wideplain"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.14.desc", 14, "marblepillarslab/carved"); + marble_pillar_slab.carverHelper + .addVariation("tile.marblePillarSlab.15.desc", 15, "marblepillarslab/ornamental"); + } + marble_pillar_slab.carverHelper + .registerAll(marble_pillar_slab, "marble_pillar_slab", ItemCarvableSlab.class); + registerSlabTop(marble_pillar_slab, marble_pillar_slab.top); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.marble_pillar, 6), + "XX", + "XX", + "XX", + 'X', + new ItemStack(ChiselBlocks.marble, 1, OreDictionary.WILDCARD_VALUE)); + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.marble_pillar_slab, 6, 0), + "***", + '*', + new ItemStack(ChiselBlocks.marble_pillar, 1, OreDictionary.WILDCARD_VALUE)); + } + }, + + NATION { + + @Override + void addBlocks() { + BlockCarvable imperial = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); + imperial.carverHelper.addVariation("tile.imperial.0.desc", 0, "military/imperialCamo"); + imperial.carverHelper.addVariation("tile.imperial.1.desc", 1, "military/imperialCamoSecluded"); + imperial.carverHelper.addVariation("tile.imperial.2.desc", 2, "military/imperialPlate"); + imperial.carverHelper.addVariation("tile.imperial.3.desc", 3, "military/imperialCautionWhite"); + imperial.carverHelper.addVariation("tile.imperial.4.desc", 4, "military/imperialCautionOrange"); + imperial.carverHelper.registerBlock(imperial, "nation"); + + BlockCarvable rebel = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); + rebel.carverHelper.addVariation("tile.rebel.0.desc", 0, "military/rebelCamo", 20); + rebel.carverHelper.addVariation("tile.rebel.1.desc", 1, "military/rebelCamoSecluded", 21); + rebel.carverHelper.addVariation("tile.rebel.2.desc", 2, "military/rebelPlate", 22); + rebel.carverHelper.addVariation("tile.rebel.3.desc", 3, "military/rebelCautionWhite", 23); + rebel.carverHelper.addVariation("tile.rebel.4.desc", 4, "military/rebelCautionRed", 24); + rebel.carverHelper.registerBlock(rebel, "rebel"); + + imperial.carverHelper.registerVariations("military"); + rebel.carverHelper.registerVariations("military"); + + Carving.chisel.registerOre("military", "military"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.rebel, 32, 0), + new Object[] { "xyx", "yzy", "xyx", 'x', "stone", 'y', Items.iron_ingot, 'z', + Items.gold_nugget })); + } + }, + + NETHER_BRICK { + + @Override + void addBlocks() { + BlockCarvable nether_brick = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10.0F) + .setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("nether_brick", Blocks.nether_brick, 0, 0); + // netherBrick.carverHelper.addVariation("Nether brick", 0, + // Blocks.nether_brick); + nether_brick.carverHelper.addVariation("tile.netherBrick.1.desc", 1, "netherbrick/a1-netherbrick-brinstar"); + nether_brick.carverHelper + .addVariation("tile.netherBrick.2.desc", 2, "netherbrick/a1-netherbrick-classicspatter"); + nether_brick.carverHelper.addVariation("tile.netherBrick.3.desc", 3, "netherbrick/a1-netherbrick-guts"); + nether_brick.carverHelper.addVariation("tile.netherBrick.4.desc", 4, "netherbrick/a1-netherbrick-gutsdark"); + nether_brick.carverHelper + .addVariation("tile.netherBrick.5.desc", 5, "netherbrick/a1-netherbrick-gutssmall"); + nether_brick.carverHelper + .addVariation("tile.netherBrick.6.desc", 6, "netherbrick/a1-netherbrick-lavabrinstar"); + nether_brick.carverHelper + .addVariation("tile.netherBrick.7.desc", 7, "netherbrick/a1-netherbrick-lavabrown"); + nether_brick.carverHelper + .addVariation("tile.netherBrick.8.desc", 8, "netherbrick/a1-netherbrick-lavaobsidian"); + nether_brick.carverHelper + .addVariation("tile.netherBrick.9.desc", 9, "netherbrick/a1-netherbrick-lavastonedark"); + nether_brick.carverHelper.addVariation("tile.netherBrick.10.desc", 10, "netherbrick/a1-netherbrick-meat"); + nether_brick.carverHelper + .addVariation("tile.netherBrick.11.desc", 11, "netherbrick/a1-netherbrick-meatred"); + nether_brick.carverHelper + .addVariation("tile.netherBrick.12.desc", 12, "netherbrick/a1-netherbrick-meatredsmall"); + nether_brick.carverHelper + .addVariation("tile.netherBrick.13.desc", 13, "netherbrick/a1-netherbrick-meatsmall"); + nether_brick.carverHelper.addVariation("tile.netherBrick.14.desc", 14, "netherbrick/a1-netherbrick-red"); + nether_brick.carverHelper + .addVariation("tile.netherBrick.15.desc", 15, "netherbrick/a1-netherbrick-redsmall"); + nether_brick.carverHelper.registerAll(nether_brick, "nether_brick"); + Carving.chisel.registerOre("nether_brick", "nether_brick"); + } + }, + + NETHER_RACK { + + @Override + void addBlocks() { + + BlockCarvable netherrack = (BlockCarvable) new BlockCarvable(Material.rock) { + + @Override + public boolean isFireSource(World world, int x, int y, int z, ForgeDirection side) { + return side == ForgeDirection.UP; + } + + }.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(0.4F).setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("netherrack", Blocks.netherrack, 0, 0); + netherrack.carverHelper.addVariation("tile.hellrock.1.desc", 1, "netherrack/a1-netherrack-bloodgravel"); + netherrack.carverHelper.addVariation("tile.hellrock.2.desc", 2, "netherrack/a1-netherrack-bloodrock"); + netherrack.carverHelper.addVariation("tile.hellrock.3.desc", 3, "netherrack/a1-netherrack-bloodrockgrey"); + netherrack.carverHelper.addVariation("tile.hellrock.4.desc", 4, "netherrack/a1-netherrack-brinstar"); + netherrack.carverHelper.addVariation("tile.hellrock.5.desc", 5, "netherrack/a1-netherrack-brinstarshale"); + netherrack.carverHelper.addVariation("tile.hellrock.6.desc", 6, "netherrack/a1-netherrack-classic"); + netherrack.carverHelper.addVariation("tile.hellrock.7.desc", 7, "netherrack/a1-netherrack-classicspatter"); + netherrack.carverHelper.addVariation("tile.hellrock.8.desc", 8, "netherrack/a1-netherrack-guts"); + netherrack.carverHelper.addVariation("tile.hellrock.9.desc", 9, "netherrack/a1-netherrack-gutsdark"); + netherrack.carverHelper.addVariation("tile.hellrock.10.desc", 10, "netherrack/a1-netherrack-meat"); + netherrack.carverHelper.addVariation("tile.hellrock.11.desc", 11, "netherrack/a1-netherrack-meatred"); + netherrack.carverHelper.addVariation("tile.hellrock.12.desc", 12, "netherrack/a1-netherrack-meatrock"); + netherrack.carverHelper.addVariation("tile.hellrock.13.desc", 13, "netherrack/a1-netherrack-red"); + netherrack.carverHelper.addVariation("tile.hellrock.14.desc", 14, "netherrack/a1-netherrack-wells"); + + netherrack.carverHelper.registerAll(netherrack, "netherrack"); + Carving.chisel.registerOre("netherrack", "netherrack"); + } + }, + + OBSIDIAN { + + @Override + void addBlocks() { + BlockCarvable obsidian = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(50.0F).setResistance(2000.0F) + .setStepSound(Block.soundTypeStone); + + Carving.chisel.addVariation("obsidian", Blocks.obsidian, 0, 0); + obsidian.carverHelper.addVariation("tile.obsidian.1.desc", 1, "obsidian/pillar"); + obsidian.carverHelper.addVariation("tile.obsidian.2.desc", 2, "obsidian/pillar-quartz"); + obsidian.carverHelper.addVariation("tile.obsidian.3.desc", 3, "obsidian/chiseled"); + obsidian.carverHelper.addVariation("tile.obsidian.4.desc", 4, "obsidian/panel-shiny"); + obsidian.carverHelper.addVariation("tile.obsidian.5.desc", 5, "obsidian/panel"); + obsidian.carverHelper.addVariation("tile.obsidian.6.desc", 6, "obsidian/chunks"); + obsidian.carverHelper.addVariation("tile.obsidian.7.desc", 7, "obsidian/growth"); + obsidian.carverHelper.addVariation("tile.obsidian.8.desc", 8, "obsidian/crystal"); + obsidian.carverHelper.addVariation("tile.obsidian.9.desc", 9, "obsidian/map-a"); + obsidian.carverHelper.addVariation("tile.obsidian.10.desc", 10, "obsidian/map-b"); + obsidian.carverHelper.addVariation("tile.obsidian.11.desc", 11, "obsidian/panel-light"); + obsidian.carverHelper.addVariation("tile.obsidian.12.desc", 12, "obsidian/blocks"); + obsidian.carverHelper.addVariation("tile.obsidian.13.desc", 13, "obsidian/tiles"); + obsidian.carverHelper.addVariation("tile.obsidian.14.desc", 14, "obsidian/greek"); + obsidian.carverHelper.addVariation("tile.obsidian.15.desc", 15, "obsidian/crate"); + + obsidian.carverHelper.registerAll(obsidian, "obsidian"); + Carving.chisel.registerOre("obsidian", "obsidian"); + } + }, + + PACKEDICE { + + @Override + void addBlocks() { + BlockCarvablePackedIce packedice = (BlockCarvablePackedIce) new BlockCarvablePackedIce() + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3) + .setStepSound(Block.soundTypeGlass); + Carving.chisel.addVariation("packedice", Blocks.packed_ice, 0, 0); + packedice.carverHelper.addVariation("tile.packedice.1.desc", 1, "ice/a1-ice-light"); + packedice.carverHelper.addVariation("tile.packedice.2.desc", 2, "ice/a1-stonecobble-icecobble"); + packedice.carverHelper.addVariation("tile.packedice.3.desc", 3, "ice/a1-netherbrick-ice"); + packedice.carverHelper.addVariation("tile.packedice.4.desc", 4, "ice/a1-stonecobble-icebrick"); + packedice.carverHelper.addVariation("tile.packedice.5.desc", 5, "ice/a1-stonecobble-icebricksmall"); + packedice.carverHelper.addVariation("tile.packedice.6.desc", 6, "ice/a1-stonecobble-icedungeon"); + packedice.carverHelper.addVariation("tile.packedice.7.desc", 7, "ice/a1-stonecobble-icefour"); + packedice.carverHelper.addVariation("tile.packedice.8.desc", 8, "ice/a1-stonecobble-icefrench"); + packedice.carverHelper.addVariation("tile.packedice.9.desc", 9, "ice/sunkentiles"); + packedice.carverHelper.addVariation("tile.packedice.10.desc", 10, "ice/tiles"); + packedice.carverHelper.addVariation("tile.packedice.11.desc", 11, "ice/a1-stonecobble-icepanel"); + packedice.carverHelper.addVariation("tile.packedice.12.desc", 12, "ice/a1-stoneslab-ice"); + packedice.carverHelper.addVariation("tile.packedice.13.desc", 13, "ice/zelda"); + packedice.carverHelper.addVariation("tile.packedice.14.desc", 14, "ice/bismuth"); + packedice.carverHelper.addVariation("tile.packedice.15.desc", 15, "ice/poison"); + packedice.carverHelper.registerAll(packedice, "packedice"); + Carving.chisel.registerOre("packedice", "packedice"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.packedice_pillar, 6, 0), + "XX", + "XX", + "XX", + 'X', + new ItemStack(ChiselBlocks.packedice, 1, OreDictionary.WILDCARD_VALUE)); + } + }, + + PACKEDICE_PILLAR { + + @Override + void addBlocks() { + BlockCarvablePackedIce packedice_pillar = (BlockCarvablePackedIce) new BlockCarvablePackedIce() + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3) + .setStepSound(Block.soundTypeGlass); + + packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.0.desc", 0, "icepillar/plainplain"); + packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.1.desc", 1, "icepillar/plaingreek"); + packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.2.desc", 2, "icepillar/greekplain"); + packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.3.desc", 3, "icepillar/greekgreek"); + packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.4.desc", 4, "icepillar/convexplain"); + packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.5.desc", 5, "icepillar/carved"); + packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.6.desc", 6, "icepillar/ornamental"); + packedice_pillar.carverHelper.registerAll(packedice_pillar, "packedice_pillar"); + } + }, + + PACKEDICE_STAIRS { + + @Override + void addBlocks() { + CarvableStairsMaker makerPackedIceStairs = new CarvableStairsMaker(Blocks.packed_ice); + + makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.0.desc", 0, Blocks.packed_ice); + makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.1.desc", 1, "ice/a1-ice-light"); + makerPackedIceStairs.carverHelper + .addVariation("tile.packedice_stairs.2.desc", 2, "ice/a1-stonecobble-icecobble"); + makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.3.desc", 3, "ice/a1-netherbrick-ice"); + makerPackedIceStairs.carverHelper + .addVariation("tile.packedice_stairs.4.desc", 4, "ice/a1-stonecobble-icebrick"); + makerPackedIceStairs.carverHelper + .addVariation("tile.packedice_stairs.5.desc", 5, "ice/a1-stonecobble-icebricksmall"); + makerPackedIceStairs.carverHelper + .addVariation("tile.packedice_stairs.6.desc", 6, "ice/a1-stonecobble-icedungeon"); + makerPackedIceStairs.carverHelper + .addVariation("tile.packedice_stairs.7.desc", 7, "ice/a1-stonecobble-icefour"); + makerPackedIceStairs.carverHelper + .addVariation("tile.packedice_stairs.8.desc", 8, "ice/a1-stonecobble-icefrench"); + makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.9.desc", 9, "ice/sunkentiles"); + makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.10.desc", 10, "ice/tiles"); + makerPackedIceStairs.carverHelper + .addVariation("tile.packedice_stairs.11.desc", 11, "ice/a1-stonecobble-icepanel"); + makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.12.desc", 12, "ice/a1-stoneslab-ice"); + makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.13.desc", 13, "ice/zelda"); + makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.14.desc", 14, "ice/bismuth"); + makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.15.desc", 15, "ice/poison"); + makerPackedIceStairs.create(new IStairsCreator() { + + @Override + public BlockCarvableStairs create(Block block, int meta, CarvableHelper helper) { + return new BlockCarvablePackedIceStairs(block, meta, helper); + } + }, "packedice_stairs", ChiselBlocks.packediceStairs); + Carving.chisel.registerOre("packedice_stairs", "packedIceStairs"); + } + }, + + PAPER_WALL { + + @Override + void addBlocks() { + BlockCarvablePane paperwall = (BlockCarvablePane) new BlockCarvablePane(Material.ground, true) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setResistance(0.5F); + + paperwall.carverHelper.addVariation("tile.paperwall.0.desc", 0, "paper/box"); + paperwall.carverHelper.addVariation("tile.paperwall.1.desc", 1, "paper/throughMiddle"); + paperwall.carverHelper.addVariation("tile.paperwall.2.desc", 2, "paper/cross"); + paperwall.carverHelper.addVariation("tile.paperwall.3.desc", 3, "paper/sixSections"); + paperwall.carverHelper.addVariation("tile.paperwall.4.desc", 4, "paper/vertical"); + paperwall.carverHelper.addVariation("tile.paperwall.5.desc", 5, "paper/horizontal"); + paperwall.carverHelper.addVariation("tile.paperwall.6.desc", 6, "paper/floral"); + paperwall.carverHelper.addVariation("tile.paperwall.7.desc", 7, "paper/plain"); + paperwall.carverHelper.addVariation("tile.paperwall.8.desc", 8, "paper/door"); + + paperwall.carverHelper.registerAll(paperwall, "paperwall"); + Carving.chisel.registerOre("paperwall", "paperwall"); + + BlockCarvable paperwall_block = (BlockCarvable) new BlockCarvable(Material.ground) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setResistance(0.5F); + + paperwall_block.carverHelper.addVariation("tile.paperwall.0.desc", 0, "paper/box"); + paperwall_block.carverHelper.addVariation("tile.paperwall.1.desc", 1, "paper/throughMiddle"); + paperwall_block.carverHelper.addVariation("tile.paperwall.2.desc", 2, "paper/cross"); + paperwall_block.carverHelper.addVariation("tile.paperwall.3.desc", 3, "paper/sixSections"); + paperwall_block.carverHelper.addVariation("tile.paperwall.4.desc", 4, "paper/vertical"); + paperwall_block.carverHelper.addVariation("tile.paperwall.5.desc", 5, "paper/horizontal"); + paperwall_block.carverHelper.addVariation("tile.paperwall.6.desc", 6, "paper/floral"); + paperwall_block.carverHelper.addVariation("tile.paperwall.7.desc", 7, "paper/plain"); + paperwall_block.carverHelper.addVariation("tile.paperwall.8.desc", 8, "paper/door"); + + paperwall_block.carverHelper.registerAll(paperwall_block, "paperwall_block"); + Carving.chisel.registerOre("paperwall_block", "paperwall_block"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.paperwall, 8), + "ppp", + "psp", + "ppp", + ('p'), + Items.paper, + ('s'), + "stickWood")); + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.paperwall_block, 4), + "pp", + "pp", + ('p'), + ChiselBlocks.paperwall)); + } + }, + + PRESENT { + + @Override + void addBlocks() { + BlockPresent present = (BlockPresent) new BlockPresent().setCreativeTab(ChiselTabs.tabOtherChiselBlocks) + .setHardness(2.0F).setResistance(10.0F).setBlockName("chisel.present"); + for (int i = 0; i < 16; i++) { + present.carverHelper.addVariation("tile.chisel.present.desc", i, "planks_oak", "minecraft"); + } + present.carverHelper.registerAll(present, "present", ItemBlockPresent.class); + Carving.chisel.registerOre("present", "chest"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapelessOreRecipe( + new ItemStack(ChiselBlocks.present, 1, meta), + new ItemStack(Blocks.chest, 1), + dyeOres[meta])); + } + + @Override + boolean needsMetaRecipes() { + return true; + } + }, + + PUMPKIN { + + @Override + void addBlocks() { + for (int metadata = 0; metadata < 16; metadata++) { + pumpkin[metadata] = (BlockCarvablePumpkin) new BlockCarvablePumpkin(false) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(1.0F).setBlockName("pumpkin") + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks); + pumpkin[metadata].setInformation("pumpkin/pumpkin_face_" + (metadata + 1) + "_off"); + GameRegistry.registerBlock(pumpkin[metadata], ItemCarvablePumpkin.class, "pumpkin" + (metadata + 1)); + Carving.chisel.addVariation("pumpkin", pumpkin[metadata], 0, (metadata + 1)); + } + Carving.chisel.addVariation("pumpkin", Blocks.pumpkin, 0, 0); + Carving.chisel.registerOre("pumpkin", "pumpkin"); + } + + @Override + void addRecipes() { + GameRegistry.addShapelessRecipe( + new ItemStack(ChiselBlocks.jackolantern[meta]), + new ItemStack(ChiselBlocks.pumpkin[meta], 1), + new ItemStack(Item.getItemFromBlock(Blocks.torch), 1)); + } + + @Override + boolean needsMetaRecipes() { + return true; + } + }, + + PURPUR { + + @Override + void addBlocks() { + BlockCarvable purpur = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F) + .setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks); + purpur.carverHelper.addVariation("tile.purpur.0.desc", 0, "end_purpur/purpur_block"); + purpur.carverHelper.addVariation("tile.purpur.1.desc", 1, "end_purpur/purpur_pillar"); + purpur.carverHelper.addVariation("tile.purpur.2.desc", 2, "end_purpur/shulker"); + purpur.carverHelper.addVariation("tile.purpur.3.desc", 3, "end_purpur/tilePurpur"); + purpur.carverHelper.addVariation("tile.purpur.4.desc", 4, "end_purpur/tileBrokenPurpur"); + purpur.carverHelper.addVariation("tile.purpur.5.desc", 5, "end_purpur/prismaticPurpur"); + purpur.carverHelper.addVariation("tile.purpur.6.desc", 6, "end_purpur/purpurBricks"); + purpur.carverHelper.addVariation("tile.purpur.7.desc", 7, "end_purpur/purpurCobble"); + purpur.carverHelper.addVariation("tile.purpur.8.desc", 8, "end_purpur/arcanePurpur"); + purpur.carverHelper.addVariation("tile.purpur.9.desc", 9, "end_purpur/purpurLargeTile"); + purpur.carverHelper.addVariation("tile.purpur.10.desc", 10, "end_purpur/purpurOrnate"); + + purpur.carverHelper.registerAll(purpur, "purpur"); + Carving.chisel.registerOre("purpur", "purpur"); + } + + @Override + void addRecipes() { + GameRegistry.addShapelessRecipe( + new ItemStack(ChiselBlocks.purpur), + new ItemStack(Item.getItemFromBlock(Blocks.end_stone), 1), + new ItemStack(Items.dye, 1, 5)); + } + }, + + QUARTZ { + + @Override + void addBlocks() { + Carving.chisel.addVariation("quartz", Blocks.quartz_block, 0, 0); + Carving.chisel.addVariation("quartz", Blocks.quartz_block, 1, 0); + Carving.chisel.addVariation("quartz", Blocks.quartz_block, 2, 0); + Carving.chisel.registerOre("quartz", "quartz"); + } + }, + + /** + * Dummy feature for all RC subsets + */ + RAILCRAFT("Railcraft"), + + RC_ABYSSAL_BLOCK(RAILCRAFT.getRequiredMod(), RAILCRAFT) { + + @Override + void addBlocks() { + Block abyssal = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.abyssal"); + if (abyssal == null) { + abyssal = GameRegistry.findBlock("Railcraft", "brick.abyssal"); + } + + Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 0, 0); + Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 1, 1); + Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 2, 2); + Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 3, 3); + Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 4, 4); + Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 5, 5); + Carving.chisel.registerOre("RCAbyssalBlock", "RCAbyssalBlock"); + } + + ; + }, + RC_BLEACHED_BONE(RAILCRAFT.getRequiredMod(), RAILCRAFT) { + + @Override + void addBlocks() { + Block bleachedBone = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"); + if (bleachedBone == null) { + bleachedBone = GameRegistry.findBlock("Railcraft", "brick.bleachedbone"); + } + + Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 0, 0); + Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 1, 1); + Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 2, 2); + Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 3, 3); + Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 4, 4); + Carving.chisel.addVariation("RCBleachedBone", bleachedBone, 5, 5); + Carving.chisel.registerOre("RCBleachedBone", "RCBleachedBone"); + } + }, + + RC_BLOOD_STAINED(RAILCRAFT.getRequiredMod(), RAILCRAFT) { + + @Override + void addBlocks() { + Block bloodStained = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"); + if (bloodStained == null) { + bloodStained = GameRegistry.findBlock("Railcraft", "brick.bloodstained"); + } + + Carving.chisel.addVariation("RCBloodStained", bloodStained, 0, 0); + Carving.chisel.addVariation("RCBloodStained", bloodStained, 1, 1); + Carving.chisel.addVariation("RCBloodStained", bloodStained, 2, 2); + Carving.chisel.addVariation("RCBloodStained", bloodStained, 3, 3); + Carving.chisel.addVariation("RCBloodStained", bloodStained, 4, 4); + Carving.chisel.addVariation("RCBloodStained", bloodStained, 5, 5); + Carving.chisel.registerOre("RCBloodStained", "RCBloodStained"); + } + }, + + RC_FROST_BOUND_BLOCK(RAILCRAFT.getRequiredMod(), RAILCRAFT) { + + @Override + void addBlocks() { + Block frostBound = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"); + if (frostBound == null) { + frostBound = GameRegistry.findBlock("Railcraft", "brick.frostbound"); + } + Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 0, 0); + Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 1, 1); + Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 2, 2); + Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 3, 3); + Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 4, 4); + Carving.chisel.addVariation("RCFrostBoundBlock", frostBound, 5, 5); + Carving.chisel.registerOre("RCFrostBoundBlock", "RCFrostBoundBlock"); + } + }, + + RC_INFERNAL_STONE(RAILCRAFT.getRequiredMod(), RAILCRAFT) { + + @Override + void addBlocks() { + Block infernal = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"); + if (infernal == null) { + infernal = GameRegistry.findBlock("Railcraft", "brick.infernal"); + } + Carving.chisel.addVariation("RCInfernalStone", infernal, 0, 0); + Carving.chisel.addVariation("RCInfernalStone", infernal, 1, 1); + Carving.chisel.addVariation("RCInfernalStone", infernal, 2, 2); + Carving.chisel.addVariation("RCInfernalStone", infernal, 3, 3); + Carving.chisel.addVariation("RCInfernalStone", infernal, 4, 4); + Carving.chisel.addVariation("RCInfernalStone", infernal, 5, 5); + Carving.chisel.registerOre("RCInfernalStone", "RCInfernalStone"); + } + }, + + RC_QUARRIED_BLOCK(RAILCRAFT.getRequiredMod(), RAILCRAFT) { + + @Override + void addBlocks() { + Block quarried = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"); + if (quarried == null) { + quarried = GameRegistry.findBlock("Railcraft", "brick.quarried"); + } + Carving.chisel.addVariation("RCQuarriedBlock", quarried, 0, 0); + Carving.chisel.addVariation("RCQuarriedBlock", quarried, 1, 1); + Carving.chisel.addVariation("RCQuarriedBlock", quarried, 2, 2); + Carving.chisel.addVariation("RCQuarriedBlock", quarried, 3, 3); + Carving.chisel.addVariation("RCQuarriedBlock", quarried, 4, 4); + Carving.chisel.addVariation("RCQuarriedBlock", quarried, 5, 5); + Carving.chisel.registerOre("RCQuarriedBlock", "RCQuarriedBlock"); + } + + ; + }, + + RC_SANDY_STONE(RAILCRAFT.getRequiredMod(), RAILCRAFT) { + + @Override + void addBlocks() { + Block sandy = GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"); + if (sandy == null) { + sandy = GameRegistry.findBlock("Railcraft", "brick.sandy"); + } + Carving.chisel.addVariation("RCSandyStone", sandy, 0, 0); + Carving.chisel.addVariation("RCSandyStone", sandy, 1, 1); + Carving.chisel.addVariation("RCSandyStone", sandy, 2, 2); + Carving.chisel.addVariation("RCSandyStone", sandy, 3, 3); + Carving.chisel.addVariation("RCSandyStone", sandy, 4, 4); + Carving.chisel.addVariation("RCSandyStone", sandy, 5, 5); + Carving.chisel.registerOre("RCSandyStone", "RCSandyStone"); + } + }, + + REDSTONE_BLOCK { + + @Override + void addBlocks() { + BlockCarvable redstone_block = (BlockCarvablePowered) (new BlockCarvablePowered(Material.iron)) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(5.0F).setResistance(10.0F) + .setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("redstone_block", Blocks.redstone_block, 0, 0); + redstone_block.carverHelper.addVariation("tile.redstone_block.1.desc", 1, "redstone/smooth"); + redstone_block.carverHelper.addVariation("tile.redstone_block.2.desc", 2, "redstone/block"); + redstone_block.carverHelper.addVariation("tile.redstone_block.3.desc", 3, "redstone/blocks"); + redstone_block.carverHelper.addVariation("tile.redstone_block.4.desc", 4, "redstone/bricks"); + redstone_block.carverHelper.addVariation("tile.redstone_block.5.desc", 5, "redstone/smallbricks"); + redstone_block.carverHelper.addVariation("tile.redstone_block.6.desc", 6, "redstone/smallchaotic"); + redstone_block.carverHelper.addVariation("tile.redstone_block.7.desc", 7, "redstone/chiseled"); + redstone_block.carverHelper.addVariation("tile.redstone_block.8.desc", 8, "redstone/ere"); + redstone_block.carverHelper.addVariation("tile.redstone_block.9.desc", 9, "redstone/ornate-tiles"); + redstone_block.carverHelper.addVariation("tile.redstone_block.10.desc", 10, "redstone/pillar"); + redstone_block.carverHelper.addVariation("tile.redstone_block.11.desc", 11, "redstone/tiles"); + redstone_block.carverHelper.addVariation("tile.redstone_block.12.desc", 12, "redstone/circuit"); + redstone_block.carverHelper.addVariation("tile.redstone_block.13.desc", 13, "redstone/supaplex"); + redstone_block.carverHelper + .addVariation("tile.redstone_block.14.desc", 14, "redstone/a1-blockredstone-skullred"); + redstone_block.carverHelper + .addVariation("tile.redstone_block.15.desc", 15, "redstone/a1-blockredstone-redstonezelda"); + + redstone_block.carverHelper.registerAll(redstone_block, "redstone_block"); + Carving.chisel.registerOre("redstone_block", "redstone"); + } + }, + + ROAD_LINE { + + @Override + void addBlocks() { + BlockRoadLine road_line = (BlockRoadLine) new BlockRoadLine().setStepSound(Block.soundTypeStone) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.01F).setBlockName("roadLine"); + road_line.carverHelper.addVariation("tile.roadLine.0.desc", 0, "line-marking/white-center"); + road_line.carverHelper.addVariation("tile.roadLine.1.desc", 1, "line-marking/double-white-center"); + road_line.carverHelper.addVariation("tile.roadLine.2.desc", 2, "line-marking/yellow-center"); + road_line.carverHelper.addVariation("tile.roadLine.3.desc", 3, "line-marking/double-yellow-center"); + road_line.carverHelper.registerAll(road_line, "road_line"); + Carving.chisel.registerOre("road_line", "roadLine"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.road_line, 8, 0), + "wrw", + "wrw", + "wrw", + ('w'), + "dyeWhite", + ('r'), + Items.redstone)); + } + }, + + SANDSTONE { + + @Override + void addBlocks() { + BlockCarvable sandstone = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone) + .setHardness(0.8F); + Carving.chisel.addVariation("sandstone", Blocks.sandstone, 0, -5); + Carving.chisel.addVariation("sandstone", Blocks.sandstone, 1, -4); + Carving.chisel.addVariation("sandstone", Blocks.sandstone, 2, -3); + sandstone.carverHelper + .addVariation("tile.sandstone.0.desc", 0, "sandstone/terrain-sandstone-smoothglyph", 16); + sandstone.carverHelper + .addVariation("tile.sandstone.1.desc", 1, "sandstone/terrain-sandstone-solidcobble", 17); + sandstone.carverHelper + .addVariation("tile.sandstone.2.desc", 2, "sandstone/a0-sandstonepreview-boxcreeper", 18); + sandstone.carverHelper.addVariation("tile.sandstone.3.desc", 3, "sandstone/faded"); + sandstone.carverHelper.addVariation("tile.sandstone.4.desc", 4, "sandstone/column"); + sandstone.carverHelper.addVariation("tile.sandstone.5.desc", 5, "sandstone/capstone"); + sandstone.carverHelper.addVariation("tile.sandstone.6.desc", 6, "sandstone/small"); + sandstone.carverHelper.addVariation("tile.sandstone.7.desc", 7, "sandstone/base"); + sandstone.carverHelper.addVariation("tile.sandstone.8.desc", 8, "sandstone/smooth"); + sandstone.carverHelper.addVariation("tile.sandstone.9.desc", 9, "sandstone/smooth-cap"); + sandstone.carverHelper.addVariation("tile.sandstone.10.desc", 10, "sandstone/smooth-small"); + sandstone.carverHelper.addVariation("tile.sandstone.11.desc", 11, "sandstone/smooth-base"); + sandstone.carverHelper.addVariation("tile.sandstone.12.desc", 12, "sandstone/block"); + sandstone.carverHelper.addVariation("tile.sandstone.13.desc", 13, "sandstone/blocks"); + sandstone.carverHelper.addVariation("tile.sandstone.14.desc", 14, "sandstone/mosaic"); + sandstone.carverHelper.addVariation("tile.sandstone.15.desc", 15, "sandstone/horizontal-tiles"); + sandstone.carverHelper.registerAll(sandstone, "sandstone"); + + BlockCarvable sandstone2 = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone) + .setHardness(0.8F); + sandstone2.carverHelper + .addVariation("tile.sandstone.16.desc", 0, "sandstone2/terrain-sandstone-brickflat", 19); + sandstone2.carverHelper + .addVariation("tile.sandstone.17.desc", 1, "sandstone2/a0-sandstonepreview-smoothflat", 20); + sandstone2.carverHelper.registerBlock(sandstone2, "sandstone2"); + sandstone2.carverHelper.registerVariations("sandstone"); + + BlockCarvable sandstone_scribbles = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone) + .setHardness(0.8F); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 0, "sandstone-scribbles/scribbles-0", 36); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 1, "sandstone-scribbles/scribbles-1", 37); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 2, "sandstone-scribbles/scribbles-2", 38); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 3, "sandstone-scribbles/scribbles-3", 39); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 4, "sandstone-scribbles/scribbles-4", 40); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 5, "sandstone-scribbles/scribbles-5", 41); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 6, "sandstone-scribbles/scribbles-6", 42); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 7, "sandstone-scribbles/scribbles-7", 43); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 8, "sandstone-scribbles/scribbles-8", 44); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 9, "sandstone-scribbles/scribbles-9", 45); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 10, "sandstone-scribbles/scribbles-10", 46); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 11, "sandstone-scribbles/scribbles-11", 47); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 12, "sandstone-scribbles/scribbles-12", 48); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 13, "sandstone-scribbles/scribbles-13", 49); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 14, "sandstone-scribbles/scribbles-14", 50); + sandstone_scribbles.carverHelper + .addVariation("tile.sandstoneScribbles.desc", 15, "sandstone-scribbles/scribbles-15", 51); + sandstone_scribbles.carverHelper.registerBlock(sandstone_scribbles, "sandstone_scribbles"); + sandstone_scribbles.carverHelper.registerVariations("sandstone"); + + Carving.chisel.registerOre("sandstone", "sandstone"); + } + + @Override + void addRecipes() { + if (meta == 0) { + // The following recipe is due to bugs with Chisel 1.5.1 to + // 1.5.6a + GameRegistry.addRecipe( + new ItemStack(Blocks.sandstone, 1, 0), + "X", + 'X', + new ItemStack(ChiselBlocks.sandstone, 1, 0)); + // The following recipe is due to bug with Chisel 1.5.6b + GameRegistry.addRecipe( + new ItemStack(Blocks.sandstone, 1, 1), + "X", + 'X', + new ItemStack(ChiselBlocks.sandstone, 1, 1)); + } + GameRegistry.addRecipe( + new ItemStack(Blocks.sandstone, 1, 1), + "X", + 'X', + new ItemStack(ChiselBlocks.sandstone_scribbles, 1, OreDictionary.WILDCARD_VALUE)); + } + }, + + SILVER { + + @Override + void addBlocks() { + BlockCarvable silver = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F).setResistance(10F); + silver.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/silver/caution", 20); + silver.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/silver/crate", 21); + silver.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/silver/thermal", 22); + silver.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/silver/adv", 23); + silver.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/silver/egregious", 24); + silver.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/silver/bolted", 25); + silver.carverHelper.registerAll(silver, "silverblock"); + Carving.chisel.registerOre("silverblock", "blockSilver"); + } + }, + + SMASHING_ROCK { + + @Override + void addItems() { + ItemSmashingRock smashingrock = (ItemSmashingRock) new ItemSmashingRock() + .setTextureName("Chisel:smashingrock").setCreativeTab(ChiselTabs.tabChisel); + EntityRegistry.registerModEntity(EntitySmashingRock.class, "SmashingRock", 3, Chisel.instance, 40, 1, true); + GameRegistry.registerItem(smashingrock, "smashingrock"); + } + + @Override + void addRecipes() { + GameRegistry.addShapelessRecipe( + new ItemStack(ChiselItems.smashingrock, 16), + new Object[] { new ItemStack(Items.stone_pickaxe), new ItemStack(Items.glass_bottle, 1), + new ItemStack(Items.stone_shovel) }); + } + }, + + SNAKE_SANDSTONE(SANDSTONE) { + + @Override + void addBlocks() { + BlockSnakestone sand_snakestone = (BlockSnakestone) new BlockSnakestone("Chisel:snakestone/sandsnake/") + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setBlockName("chisel.snakestoneSand"); + GameRegistry.registerBlock(sand_snakestone, ItemCarvable.class, "sand_snakestone"); + // TODO- eat me! + // LanguageRegistry.addName(new ItemStack(sandSnakestone, 1, 1), + // "Sandstone snake block head"); + // LanguageRegistry.addName(new ItemStack(sandSnakestone, 1, + // 13), "Sandstone snake block body"); + Carving.chisel.addVariation("sandstone", sand_snakestone, 1, 100); + Carving.chisel.addVariation("sandstone", sand_snakestone, 13, 101); + // Carving.chisel.registerOre("sandstone", "sandSnakestone"); + } + }, + + SNAKESTONE { + + @Override + void addBlocks() { + BlockSnakestone stone_snakestone = (BlockSnakestone) new BlockSnakestone("Chisel:snakestone/snake/") + .setBlockName("chisel.snakestoneStone").setCreativeTab(ChiselTabs.tabStoneChiselBlocks); + GameRegistry.registerBlock(stone_snakestone, ItemCarvable.class, "stone_snakestone"); + // LanguageRegistry.addName(new ItemStack(snakestone, 1, 1), + // "Stone snake block head"); + // LanguageRegistry.addName(new ItemStack(snakestone, 1, 13), + // "Stone snake block body"); + Carving.chisel.addVariation("stonebrick", stone_snakestone, 1, 100); + Carving.chisel.addVariation("stonebrick", stone_snakestone, 13, 101); + // Carving.chisel.registerOre("snakestoneStone", "snakestoneStone"); + } + }, + + SNAKESTONE_OBSIDIAN { + + @Override + void addBlocks() { + BlockSnakestoneObsidian obsidian_snakestone = (BlockSnakestoneObsidian) new BlockSnakestoneObsidian( + "Chisel:snakestone/obsidian/").setBlockName("chisel.obsidianSnakestone").setHardness(50.0F) + .setResistance(2000.0F); + GameRegistry.registerBlock(obsidian_snakestone, ItemCarvable.class, "obsidian_snakestone"); + Carving.chisel.addVariation("obsidian", obsidian_snakestone, 1, 100); + Carving.chisel.addVariation("obsidian", obsidian_snakestone, 13, 101); + // Carving.chisel.registerOre("obsidianSnakestone", + // "obsidianSnakestone"); + } + }, + + STEEL { + + @Override + void addBlocks() { + BlockCarvable steel = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F).setResistance(10F); + steel.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/steel/caution", 20); + steel.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/steel/crate", 21); + steel.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/steel/thermal", 22); + steel.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/steel/adv", 23); + steel.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/steel/egregious", 24); + steel.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/steel/bolted", 25); + steel.carverHelper.registerAll(steel, "steelblock"); + Carving.chisel.registerOre("steelblock", "blockSteel"); + } + }, + + STONE_BRICK { + + @Override + void addBlocks() { + BlockCarvable stonebricksmooth = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(1.5F).setResistance(10.0F) + .setStepSound(Block.soundTypeStone); + if (Configurations.allowSmoothStone) { + Carving.chisel.addVariation("stonebricksmooth", Blocks.stone, 0, -1); + } + for (int i = 0; i < 4; i++) { + if ((i == 1) && (Configurations.allowMossy)) { + Carving.chisel.addVariation("stonebricksmooth", Blocks.stonebrick, i, i); + } else if (i != 1) { + Carving.chisel.addVariation("stonebricksmooth", Blocks.stonebrick, i, i); + } + } + + stonebricksmooth.carverHelper + .addVariation("tile.stonebricksmooth.0.desc", 0, "stonebrick2/masonBricksPlain", 16); + stonebricksmooth.carverHelper + .addVariation("tile.stonebricksmooth.1.desc", 1, "stonebrick2/masonBricksFelsic", 17); + stonebricksmooth.carverHelper + .addVariation("tile.stonebricksmooth.2.desc", 2, "stonebrick2/masonBricksMafic", 18); + stonebricksmooth.carverHelper + .addVariation("tile.stonebricksmooth.3.desc", 3, "stonebrick2/masonBricksMixed", 19); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.4.desc", 4, "stonebrick/smallbricks"); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.5.desc", 5, "stonebrick/largebricks"); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.6.desc", 6, "stonebrick/smallchaotic"); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.7.desc", 7, "stonebrick/chaoticbricks"); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.8.desc", 8, "stonebrick/chaotic"); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.9.desc", 9, "stonebrick/fancy"); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.10.desc", 10, "stonebrick/ornate"); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.11.desc", 11, "stonebrick/largeornate"); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.12.desc", 12, "stonebrick/panel-hard"); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.13.desc", 13, "stonebrick/sunken"); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.14.desc", 14, "stonebrick/ornatepanel"); + stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.15.desc", 15, "stonebrick/poison"); + + stonebricksmooth.carverHelper.registerAll(stonebricksmooth, "stonebricksmooth"); + Carving.chisel.registerOre("stonebricksmooth", "stonebricksmooth"); + + // Carving.chisel.addVariation("stonebricksmooth", GameRegistry.findBlock("Chisel-2", "tile.TFTowerStone"), + // 0, 0); + } + }, + + TALLOW("Thaumcraft") { + + @Override + void addBlocks() { + BlockCarvable tallow = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeSnow); + Carving.chisel.addVariation("tallow", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 5, 0); + tallow.carverHelper.addVariation("tile.tallow.0.desc", 0, "tallow/smooth"); + tallow.carverHelper.addVariation("tile.tallow.0.desc", 1, "tallow/faces"); + tallow.carverHelper.registerAll(tallow, "tallow"); + Carving.chisel.registerOre("tallow", "tallow"); + } + }, + + TECHNICAL { + + @Override + void addBlocks() { + BlockCarvable technical = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); + technical.carverHelper.addVariation("tile.technical.0.desc", 0, "technical/scaffold"); + technical.carverHelper.addVariation("tile.technical.1.desc", 1, "technical/cautiontape"); + technical.carverHelper.addVariation("tile.technical.2.desc", 2, "technical/industrialrelic"); + technical.carverHelper.addVariation("tile.technical.3.desc", 3, "technical/pipesLarge"); + technical.carverHelper.addVariation("tile.technical.4.desc", 4, "technical/fanFast"); + technical.carverHelper.addVariation("tile.technical.5.desc", 5, "technical/pipesSmall"); + technical.carverHelper.addVariation("tile.technical.6.desc", 6, "technical/fanStill"); + technical.carverHelper.addVariation("tile.technical.7.desc", 7, "technical/vent"); + technical.carverHelper.addVariation("tile.technical.8.desc", 8, "technical/ventGlowing"); + technical.carverHelper.addVariation("tile.technical.9.desc", 9, "technical/insulationv2"); + technical.carverHelper.addVariation("tile.technical.10.desc", 10, "technical/spinningStuffAnim"); + technical.carverHelper.addVariation("tile.technical.11.desc", 11, "technical/cables"); + technical.carverHelper.addVariation("tile.technical.12.desc", 12, "technical/rustyBoltedPlates"); + technical.carverHelper.addVariation("tile.technical.13.desc", 13, "technical/grate"); + technical.carverHelper.addVariation("tile.technical.14.desc", 14, "technical/malfunctionFan"); + technical.carverHelper.addVariation("tile.technical.15.desc", 15, "technical/grateRusty"); + technical.carverHelper.registerAll(technical, "technical"); + + BlockCarvableGlass technical2 = (BlockCarvableGlass) new BlockCarvableGlass().setHardness(2.0F) + .setResistance(10F); + technical2.carverHelper.addVariation("tile.technical.0.desc", 0, "technical/scaffoldTransparent", 20); + technical2.carverHelper.addVariation("tile.technical.4.desc", 1, "technical/fanFastTransparent", 21); + technical2.carverHelper.addVariation("tile.technical.6.desc", 2, "technical/fanStillTransparent", 22); + technical2.carverHelper.addVariation("tile.technical.14.desc", 3, "technical/fanStillTransparent", 23); + technical2.carverHelper.registerBlock(technical2, "technical2"); + technical2.carverHelper.registerVariations("technical"); + + BlockCarvable technicalLarge = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); + technicalLarge.carverHelper.addVariation("tile.technical3.0.desc", 0, "technical/massiveFan", 40); + technicalLarge.carverHelper.addVariation("tile.technical3.1.desc", 1, "technical/massiveHexPlating", 41); + technicalLarge.carverHelper.registerBlock(technicalLarge, "technical3"); + technicalLarge.carverHelper.registerVariations("technical"); + + BlockCarvable technical4 = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); + technical4.carverHelper.addVariation("tile.technical4.0.desc", 0, "technical/new/weatheredGreenPanels"); + technical4.carverHelper.addVariation("tile.technical4.1.desc", 1, "technical/new/weatheredOrangePanels"); + technical4.carverHelper.addVariation("tile.technical4.2.desc", 2, "technical/new/Sturdy"); + technical4.carverHelper.addVariation("tile.technical4.3.desc", 3, "technical/new/MegaCell"); + technical4.carverHelper.addVariation( + "tile.technical4.4.desc", + 4, + "technical/new/ExhaustPlating"/* + * , new SubmapManagerCombinedCTM(4, + * "technical/new/test/ExhaustPlating", TextureType.R4) + */); + technical4.carverHelper.addVariation("tile.technical4.5.desc", 5, "technical/new/MakeshiftPanels"); + technical4.carverHelper.addVariation("tile.technical4.6.desc", 6, "technical/new/Piping"); + technical4.carverHelper.addVariation( + "tile.technical4.7.desc", + 7, + "technical/new/concrete/concreteBlocks", + new SubmapManagerCombinedCTM(9, "technical/new/concrete/concreteBlocks", TextureType.R9)); // The animation is malfunctioning. :( - // technical4.carverHelper.addVariation("tile.technical4.7.desc", 7, "technical/new/TapeDrive"); - technical4.carverHelper.registerBlock(technical4, "technical4"); - technical4.carverHelper.registerVariations("technical"); - - Carving.chisel.registerOre("technical", "technical"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.technical, Configurations.factoryBlockAmount, 0), new Object[] { "xyx", "yxy", "xyx", 'x', "stone", 'y', - Items.iron_ingot })); - /* - * GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.technical2, Configurations.factoryBlockAmount, 0), new Object[] { "xyx", "yzy", "xyx", 'x', "stone", 'y', - * "ingotIron", 'z', Blocks.glass })); // - */ - } - }, - - TEMPLE_BLOCK { - - @Override - void addBlocks() { - BlockCarvable templeblock = (BlockCarvable) new BlockEldritch().setHardness(2.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setResistance(10F) - .setStepSound(Chisel.soundTempleFootstep); - - templeblock.carverHelper.addVariation("tile.templeblock.0.desc", 0, "temple/cobble"); - templeblock.carverHelper.addVariation("tile.templeblock.1.desc", 1, "temple/ornate"); - templeblock.carverHelper.addVariation("tile.templeblock.2.desc", 2, "temple/plate"); - templeblock.carverHelper.addVariation("tile.templeblock.3.desc", 3, "temple/plate-cracked"); - templeblock.carverHelper.addVariation("tile.templeblock.4.desc", 4, "temple/bricks"); - templeblock.carverHelper.addVariation("tile.templeblock.5.desc", 5, "temple/bricks-large"); - templeblock.carverHelper.addVariation("tile.templeblock.6.desc", 6, "temple/bricks-weared"); - templeblock.carverHelper.addVariation("tile.templeblock.7.desc", 7, "temple/bricks-disarray"); - templeblock.carverHelper.addVariation("tile.templeblock.8.desc", 8, "temple/column"); - templeblock.carverHelper.addVariation("tile.templeblock.9.desc", 9, "temple/stand"); - templeblock.carverHelper.addVariation("tile.templeblock.10.desc", 10, "temple/stand-mosaic"); - templeblock.carverHelper.addVariation("tile.templeblock.11.desc", 11, "temple/stand-creeper"); - templeblock.carverHelper.addVariation("tile.templeblock.12.desc", 12, "temple/tiles"); - templeblock.carverHelper.addVariation("tile.templeblock.13.desc", 13, "temple/smalltiles"); - templeblock.carverHelper.addVariation("tile.templeblock.14.desc", 14, "temple/tiles-light"); - templeblock.carverHelper.addVariation("tile.templeblock.15.desc", 15, "temple/smalltiles-light"); - templeblock.carverHelper.registerAll(templeblock, "templeblock"); - Carving.chisel.registerOre("templeblock", "templeblock"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.templeblock, 8, 0), "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', dyeOres[4])); - } - }, - - TEMPLE_BLOCK_MOSSY { - - @Override - void addBlocks() { - BlockCarvable mossy_templeblock = (BlockCarvable) new BlockEldritch().setHardness(2.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setResistance(10F) - .setStepSound(Chisel.soundTempleFootstep); - - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.0.desc", 0, "templemossy/cobble"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.1.desc", 1, "templemossy/ornate"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.2.desc", 2, "templemossy/plate"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.3.desc", 3, "templemossy/plate-cracked"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.4.desc", 4, "templemossy/bricks"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.5.desc", 5, "templemossy/bricks-large"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.6.desc", 6, "templemossy/bricks-weared"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.7.desc", 7, "templemossy/bricks-disarray"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.8.desc", 8, "templemossy/column"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.9.desc", 9, "templemossy/stand"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.10.desc", 10, "templemossy/stand-mosaic"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.11.desc", 11, "templemossy/stand-creeper"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.12.desc", 12, "templemossy/tiles"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.13.desc", 13, "templemossy/smalltiles"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.14.desc", 14, "templemossy/tiles-light"); - mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.15.desc", 15, "templemossy/smalltiles-light"); - mossy_templeblock.carverHelper.registerAll(mossy_templeblock, "mossy_templeblock"); - Carving.chisel.registerOre("mossy_templeblock", "mossy_templeblock"); - } - - ; - }, - - TIN { - - @Override - void addBlocks() { - BlockCarvable tin = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) - .setResistance(10F); - tin.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/tin/caution", 20); - tin.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/tin/crate", 21); - tin.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/tin/thermal", 22); - tin.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/tin/adv", 23); - tin.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/tin/egregious", 24); - tin.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/tin/bolted", 25); - tin.carverHelper.registerAll(tin, "tinblock"); - Carving.chisel.registerOre("tinblock", "blockTin"); - } - }, - - /** - * Dummy feature for all TF subsets - */ - TWILGHT_FOREST("TwilightForest"), - - TF_MAZESTONE(TWILGHT_FOREST.getRequiredMod(), TWILGHT_FOREST) { - - @Override - void addBlocks() { - Carving.chisel.addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 0, 0); - Carving.chisel.addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 1, 1); - Carving.chisel.addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 2, 2); - Carving.chisel.addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 3, 3); - Carving.chisel.addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 4, 4); - Carving.chisel.addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 5, 5); - Carving.chisel.addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 6, 6); - Carving.chisel.addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 7, 7); - Carving.chisel.registerOre("TFMazestone", "TFMazestone"); - } - }, - - TF_TOWERSTONE(TWILGHT_FOREST.getRequiredMod(), TWILGHT_FOREST) { - - @Override - void addBlocks() { - Carving.chisel.addVariation("TFTowerStone", GameRegistry.findBlock("TwilightForest", "tile.TFTowerStone"), 0, 0); - Carving.chisel.addVariation("TFTowerStone", GameRegistry.findBlock("TwilightForest", "tile.TFTowerStone"), 1, 1); - Carving.chisel.addVariation("TFTowerStone", GameRegistry.findBlock("TwilightForest", "tile.TFTowerStone"), 2, 2); - Carving.chisel.addVariation("TFTowerStone", GameRegistry.findBlock("TwilightForest", "tile.TFTowerStone"), 3, 3); - Carving.chisel.registerOre("TFTowerStone", "TFTowerStone"); - } - }, - - TF_UNDER_BRICK(TWILGHT_FOREST.getRequiredMod(), TWILGHT_FOREST) { - - @Override - void addBlocks() { - Carving.chisel.addVariation("TFUnderBrick", GameRegistry.findBlock("TwilightForest", "tile.TFUnderBrick"), 0, 0); - Carving.chisel.addVariation("TFUnderBrick", GameRegistry.findBlock("TwilightForest", "tile.TFUnderBrick"), 1, 1); - Carving.chisel.addVariation("TFUnderBrick", GameRegistry.findBlock("TwilightForest", "tile.TFUnderBrick"), 2, 2); - Carving.chisel.registerOre("TFUnderBrick", "TFUnderBrick"); - } - }, - - THAUMIUM("Thaumcraft") { - - @Override - void addBlocks() { - BlockCarvable thaumium = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("thaumium", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 4, 0); - thaumium.carverHelper.addVariation("tile.thaumium.0.desc", 0, "thaumium/ornate", 20); - thaumium.carverHelper.addVariation("tile.thaumium.1.desc", 1, "thaumium/totem", 21); - thaumium.carverHelper.addVariation("tile.thaumium.2.desc", 2, "thaumium/thaumiumBigBricks", 22); - thaumium.carverHelper.addVariation("tile.thaumium.3.desc", 3, "thaumium/small", 23); - thaumium.carverHelper.addVariation("tile.thaumium.4.desc", 4, "thaumium/lattice", 24); - thaumium.carverHelper.addVariation("tile.thaumium.5.desc", 5, "thaumium/planks", 25); - thaumium.carverHelper.registerAll(thaumium, "thaumium"); - Carving.chisel.registerOre("thaumium", "thaumium"); - } - }, - - TORCH { - - @Override - void addBlocks() { - Carving.chisel.addVariation("torch", Blocks.torch, 0, 0); - for (int type = 0; type < 10; type++) { - String name = "torch" + (type + 1); - BlockCarvableTorch t = new BlockCarvableTorch(type, name); - if (type == 8 || type == 9) { - t.disableParticles(); - } - if (Loader.isModLoaded("ForgeMultipart")) { - GameRegistry.registerBlock(t, ItemBlockChiselTorchPart.class, name, t); - } else { - GameRegistry.registerBlock(t, name); - } - Carving.chisel.addVariation("torch", t, 0, (type + 1)); - torches[type] = t; - } - Carving.chisel.registerOre("torch", "torch"); - } - }, - - TYRIAN { - - @Override - void addBlocks() { - BlockCarvable tyrian = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(5.0F).setResistance(10.0F) - .setStepSound(Block.soundTypeMetal); - - tyrian.carverHelper.addVariation("tile.tyrian.0.desc", 0, "tyrian/shining"); - tyrian.carverHelper.addVariation("tile.tyrian.1.desc", 1, "tyrian/tyrian"); - tyrian.carverHelper.addVariation("tile.tyrian.2.desc", 2, "tyrian/chaotic"); - tyrian.carverHelper.addVariation("tile.tyrian.3.desc", 3, "tyrian/softplate"); - tyrian.carverHelper.addVariation("tile.tyrian.4.desc", 4, "tyrian/rust"); - tyrian.carverHelper.addVariation("tile.tyrian.5.desc", 5, "tyrian/elaborate"); - tyrian.carverHelper.addVariation("tile.tyrian.6.desc", 6, "tyrian/routes"); - tyrian.carverHelper.addVariation("tile.tyrian.7.desc", 7, "tyrian/platform"); - tyrian.carverHelper.addVariation("tile.tyrian.8.desc", 8, "tyrian/platetiles"); - tyrian.carverHelper.addVariation("tile.tyrian.9.desc", 9, "tyrian/diagonal"); - tyrian.carverHelper.addVariation("tile.tyrian.10.desc", 10, "tyrian/dent"); - tyrian.carverHelper.addVariation("tile.tyrian.11.desc", 11, "tyrian/blueplating"); - tyrian.carverHelper.addVariation("tile.tyrian.12.desc", 12, "tyrian/black"); - tyrian.carverHelper.addVariation("tile.tyrian.13.desc", 13, "tyrian/black2"); - tyrian.carverHelper.addVariation("tile.tyrian.14.desc", 14, "tyrian/opening"); - tyrian.carverHelper.addVariation("tile.tyrian.15.desc", 15, "tyrian/plate"); - tyrian.carverHelper.registerAll(tyrian, "tyrian"); - OreDictionary.registerOre("tyrian", tyrian); - Carving.chisel.registerOre("tyrian", "tyrian"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.tyrian, 8, 0), "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.iron_ingot, 1)); - } - }, - - URANIUM /* Whose ranium? */{ - - @Override - void addBlocks() { - BlockCarvable uranium = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) - .setResistance(10F); - uranium.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/uranium/caution", 20); - uranium.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/uranium/crate", 21); - uranium.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/uranium/thermal", 22); - uranium.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/uranium/adv", 23); - uranium.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/uranium/egregious", 24); - uranium.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/uranium/bolted", 25); - uranium.carverHelper.registerAll(uranium, "uraniumblock"); - Carving.chisel.registerOre("uraniumblock", "blockUranium"); - } - }, - - VALENTINES { - - @Override - void addBlocks() { - BlockCarvable valentines = (BlockCarvable) new BlockCarvable(Material.wood).setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(2F) - .setResistance(10F); - valentines.carverHelper.addVariation("tile.valentines.0.desc", 0, "valentines/1"); - valentines.carverHelper.addVariation("tile.valentines.1.desc", 1, "valentines/companion"); - valentines.carverHelper.addVariation("tile.valentines.2.desc", 2, "valentines/2"); - valentines.carverHelper.addVariation("tile.valentines.3.desc", 3, "valentines/3"); - valentines.carverHelper.addVariation("tile.valentines.4.desc", 4, "valentines/4"); - valentines.carverHelper.addVariation("tile.valentines.5.desc", 5, "valentines/5"); - valentines.carverHelper.addVariation("tile.valentines.6.desc", 6, "valentines/6"); - valentines.carverHelper.addVariation("tile.valentines.7.desc", 7, "valentines/7"); - valentines.carverHelper.addVariation("tile.valentines.8.desc", 8, "valentines/8"); - valentines.carverHelper.addVariation("tile.valentines.9.desc", 9, "valentines/9"); - valentines.carverHelper.registerAll(valentines, "valentines"); - Carving.chisel.registerOre("valentines", "blockValentines"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.valentines, 8, 0), "***", "*X*", "***", '*', "stone", 'X', new ItemStack(Items.dye, 1, 9))); - } - }, - - VOIDSTONE { - - @Override - void addBlocks() { - BlockCarvable voidstone = (BlockCarvable) new BlockCarvable().setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone) - .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F); - voidstone.carverHelper.addVariation("tile.voidstone.0.desc", 0, "voidstone/raw", 0); - voidstone.carverHelper.addVariation("tile.voidstone.1.desc", 1, "voidstone/quarters", 1); - voidstone.carverHelper.addVariation("tile.voidstone.2.desc", 2, "voidstone/smooth", 2); - voidstone.carverHelper.addVariation("tile.voidstone.3.desc", 3, "voidstone/skulls", 3); - voidstone.carverHelper.addVariation("tile.voidstone.4.desc", 4, "voidstone/rune", 4); - voidstone.carverHelper.addVariation("tile.voidstone.5.desc", 5, "voidstone/metalborder", 5); - voidstone.carverHelper.addVariation("tile.voidstone.6.desc", 6, "voidstone/eye", 6); - voidstone.carverHelper.addVariation("tile.voidstone.7.desc", 7, "voidstone/bevel", 7); - - voidstone.carverHelper.registerAll(voidstone, "voidstone"); - Carving.chisel.registerOre("voidstone", "voidstone"); - - BlockCarvable voidstone2 = (BlockCarvable) new BlockCarvable().setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F); - voidstone2.carverHelper.addVariation("tile.voidstone.0.desc", 0, new SubmapManagerVoidstone("voidstone/animated/raw", 0)); - voidstone2.carverHelper.addVariation("tile.voidstone.1.desc", 1, new SubmapManagerVoidstone("voidstone/animated/quarters", 1)); - voidstone2.carverHelper.addVariation("tile.voidstone.2.desc", 2, new SubmapManagerVoidstone("voidstone/animated/smooth", 2)); - voidstone2.carverHelper.addVariation("tile.voidstone.3.desc", 3, new SubmapManagerVoidstone("voidstone/animated/skulls", 3)); - voidstone2.carverHelper.addVariation("tile.voidstone.4.desc", 4, new SubmapManagerVoidstone("voidstone/animated/rune", 4)); - voidstone2.carverHelper.addVariation("tile.voidstone.5.desc", 5, new SubmapManagerVoidstone("voidstone/animated/metalborder", 5)); - voidstone2.carverHelper.addVariation("tile.voidstone.6.desc", 6, new SubmapManagerVoidstone("voidstone/animated/eye", 6)); - voidstone2.carverHelper.addVariation("tile.voidstone.7.desc", 7, new SubmapManagerVoidstone("voidstone/animated/bevel", 7)); - - voidstone2.carverHelper.registerAll(voidstone2, "voidstone2"); - Carving.chisel.registerOre("voidstone2", "voidstone2"); - - BlockCarvable voidstonerunic = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F); - - for (int i = 1; i < 16; i++) - voidstonerunic.carverHelper.addVariation("tile.voidstoneRunic." + sGNames[i].replaceAll(" ", "").toLowerCase() + ".desc", i, "voidstone/runes/rune" + sGNames[i].replaceAll(" ", "")); - voidstonerunic.carverHelper.registerAll(voidstonerunic, "voidstoneRunic"); - voidstonerunic.carverHelper.registerVariations("voidstone"); - - Carving.chisel.registerOre("voidstoneRunic", "voidstoneRunic"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.voidstone, 8, 0), new Object[] { "oxo", "xyx", "oxo", 'x', new ItemStack(Blocks.stone, 1), 'y', new ItemStack(Items.ender_pearl, 1), 'o', - new ItemStack(Blocks.obsidian, 1) }); - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.voidstone2, 8, 0), new Object[] { "oxo", "xyx", "oxo", 'x', new ItemStack(Blocks.stone, 1), 'y', new ItemStack(Items.ender_eye, 1), 'o', - new ItemStack(Blocks.obsidian, 1) }); - } - }, - - VOIDSTONE_PILLARS(VOIDSTONE) { - - @Override - void addBlocks() { - BlockCarvable voidstonePillar = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone); - voidstonePillar.carverHelper.addVariation("tile.voidstonePillar.0.desc", 0, "voidstone/pillar"); - voidstonePillar.carverHelper.registerAll(voidstonePillar, "voidstonePillar"); - Carving.chisel.registerOre("voidstonePillar", "voidstonePillar"); - - BlockCarvable voidstonePillar2 = (BlockCarvable) new BlockCarvable(Material.rock).setStepSound(Block.soundTypeStone); - voidstonePillar2.carverHelper.addVariation("tile.voidstonePillar2.0.desc", 0, "voidstone/animated/pillar"); - voidstonePillar2.carverHelper.registerAll(voidstonePillar2, "voidstonePillar2"); - Carving.chisel.registerOre("voidstonePillar2", "voidstonePillar2"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.voidstonePillar, 4, 0), "xx", "xx", 'x', new ItemStack(ChiselBlocks.voidstone, 1)); - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.voidstonePillar2, 4, 0), "xx", "xx", 'x', new ItemStack(ChiselBlocks.voidstone2, 1)); - } - }, - - WARNING_SIGN { - - @Override - void addBlocks() { - BlockCarvableLayered warningSign = (BlockCarvableLayered) new BlockCarvableLayered(Material.iron, "warning/base").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F) - .setResistance(10.0F); - warningSign.carverHelper.addVariation("tile.warningSign.0.desc", 0, "warning/rad"); - warningSign.carverHelper.addVariation("tile.warningSign.1.desc", 1, "warning/bio"); - warningSign.carverHelper.addVariation("tile.warningSign.2.desc", 2, "warning/fire"); - warningSign.carverHelper.addVariation("tile.warningSign.3.desc", 3, "warning/explosion"); - warningSign.carverHelper.addVariation("tile.warningSign.4.desc", 4, "warning/death"); - warningSign.carverHelper.addVariation("tile.warningSign.5.desc", 5, "warning/falling"); - warningSign.carverHelper.addVariation("tile.warningSign.6.desc", 6, "warning/fall"); - warningSign.carverHelper.addVariation("tile.warningSign.7.desc", 7, "warning/voltage"); - warningSign.carverHelper.addVariation("tile.warningSign.8.desc", 8, "warning/generic"); - warningSign.carverHelper.addVariation("tile.warningSign.9.desc", 9, "warning/acid"); - warningSign.carverHelper.addVariation("tile.warningSign.10.desc", 10, "warning/underconstruction"); - warningSign.carverHelper.addVariation("tile.warningSign.11.desc", 11, "warning/sound"); - warningSign.carverHelper.addVariation("tile.warningSign.12.desc", 12, "warning/noentry"); - warningSign.carverHelper.addVariation("tile.warningSign.13.desc", 13, "warning/cryogenic"); - warningSign.carverHelper.addVariation("tile.warningSign.14.desc", 14, "warning/oxygen"); - warningSign.carverHelper.registerAll(warningSign, "warningSign"); - Carving.chisel.registerOre("warningSign", "warningSign"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.warningSign, 4, 0), new Object[] { "xxx", "xyx", "xxx", 'x', "stone", 'y', Items.sign })); - } - }, - - WATERSTONE { - - @Override - void addBlocks() { - BlockWaterstone waterstone = (BlockWaterstone) new BlockWaterstone(Material.rock, "water_still").setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10.0F); - waterstone.carverHelper.addVariation("tile.waterstone.0.desc", 0, "waterstone/cobble"); - waterstone.carverHelper.addVariation("tile.waterstone.1.desc", 1, "waterstone/black"); - waterstone.carverHelper.addVariation("tile.waterstone.2.desc", 2, "waterstone/tiles"); - waterstone.carverHelper.addVariation("tile.waterstone.3.desc", 3, "waterstone/chaotic"); - waterstone.carverHelper.addVariation("tile.waterstone.4.desc", 4, "waterstone/creeper"); - waterstone.carverHelper.addVariation("tile.waterstone.5.desc", 5, "waterstone/panel"); - waterstone.carverHelper.addVariation("tile.waterstone.6.desc", 6, "waterstone/panel-ornate"); - waterstone.carverHelper.registerAll(waterstone, "waterstone"); - OreDictionary.registerOre("blockWaterstone", waterstone); - Carving.chisel.registerOre("waterstone", "blockWaterstone"); - } - - @Override - void addRecipes() { - GameRegistry.addRecipe(new ItemStack(ChiselBlocks.waterstone, 8, 0), "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.water_bucket, 1)); - } - }, - - WOOD { - - @Override - void addBlocks() { - String[] plank_names = { "oak", "spruce", "birch", "jungle", "acacia", "dark-oak" }; - for (int i = 0; i < plank_names.length; i++) { - String n = plank_names[i]; - final String name = n.replace('-', '_') + "_planks"; - - planks[i] = (BlockCarvable) (new BlockCarvable(Material.wood)).setCreativeTab(ChiselTabs.tabWoodChiselBlocks).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood); - - planks[i].carverHelper.addVariation("tile." + n + ".planks.1.desc", 1, "planks-" + n + "/clean"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.2.desc", 2, "planks-" + n + "/short"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.6.desc", 6, "planks-" + n + "/fancy"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.8.desc", 8, "planks-" + n + "/panel-nails"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.9.desc", 9, "planks-" + n + "/double"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.10.desc", 10, "planks-" + n + "/crate"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.11.desc", 11, "planks-" + n + "/crate-fancy"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.13.desc", 13, "planks-" + n + "/large"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.3.desc", 3, "planks-" + n + "/vertical"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.4.desc", 4, "planks-" + n + "/vertical-uneven"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.5.desc", 5, "planks-" + n + "/parquet"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.7.desc", 7, "planks-" + n + "/blinds"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.12.desc", 12, "planks-" + n + "/crateex"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.14.desc", 14, "planks-" + n + "/chaotic-hor"); - planks[i].carverHelper.addVariation("tile." + n + ".planks.15.desc", 15, "planks-" + n + "/chaotic"); - planks[i].carverHelper.registerAll(planks[i], name); - Carving.chisel.addVariation(name, Blocks.planks, i, 0); - planks[i].setHarvestLevel("axe", 0); - Carving.chisel.registerOre(name, "wood"); - Carving.chisel.setVariationSound(name, Chisel.MOD_ID + ":chisel.wood"); - Blocks.fire.setFireInfo(planks[i], 5, 20); - } - } - }, - - WOOLEN_CLAY { - - @Override - void addBlocks() { - BlockCarvable woolen_clay = (BlockCarvable) new BlockCarvable(Material.clay).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(2F).setResistance(10F); - - for (int i = 0; i < 16; i++) - woolen_clay.carverHelper.addVariation("tile.woolenClay." + i + ".desc", i, "woolenClay/" + sGNames[i].replaceAll(" ", "").toLowerCase()); - woolen_clay.carverHelper.registerAll(woolen_clay, "woolen_clay"); - - Carving.chisel.registerOre("woolen_clay", "woolen_clay"); - } - - @Override - void addRecipes() { - OreDictionary.registerOre("stainedClay" + sGNames[meta].replaceAll(" ", ""), new ItemStack(Blocks.stained_hardened_clay, 1, meta)); - OreDictionary.registerOre("blockWool" + sGNames[meta].replaceAll(" ", ""), new ItemStack(Blocks.wool, 1, meta)); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ChiselBlocks.woolen_clay, 2, meta), new Object[] { "blockWool" + sGNames[meta].replaceAll(" ", ""), - "stainedClay" + sGNames[meta].replaceAll(" ", "") })); - } - - @Override - boolean needsMetaRecipes() { - return true; - } - }; - - private static final String[] dyeOres = { "dyeBlack", "dyeRed", "dyeGreen", "dyeBrown", "dyeBlue", "dyePurple", "dyeCyan", "dyeLightGray", "dyeGray", "dyePink", "dyeLime", "dyeYellow", - "dyeLightBlue", "dyeMagenta", "dyeOrange", "dyeWhite" }; - - private static int meta = 0; - - static void init() { - Chisel.logger.info("Starting init..."); - loadRecipes(); - Chisel.logger.info("Init finished."); - } - - private static void loadBlocks() { - Chisel.logger.info("Loading blocks..."); - int num = 0; - for (Features f : values()) { - if (f.enabled()) { - f.addBlocks(); - ++num; - } else { - logDisabled(f); - } - } - Chisel.logger.info(num + " Feature's blocks loaded."); - Chisel.logger.info("Loading Tile Entities..."); - Chisel.proxy.registerTileEntities(); - Chisel.logger.info("Tile Entities loaded."); - } - - private static void loadItems() { - Chisel.logger.info("Loading items..."); - int num = 0; - for (Features f : values()) { - if (f.enabled()) { - f.addItems(); - ++num; - } else { - logDisabled(f); - } - } - Chisel.logger.info(num + " Feature's items loaded."); - } - - private static void loadRecipes() { - Chisel.logger.info("Loading recipes..."); - int num = 0; - for (Features f : values()) { - if (f.enabled()) { - if (f.needsMetaRecipes()) { - for (int i = 0; i < 16; i++) { - meta = i; - f.addRecipes(); - } - meta = 0; - } else { - f.addRecipes(); - } - ++num; - } else { - logDisabled(f); - } - } - Chisel.logger.info(num + " Feature's recipes loaded."); - } - - private static void logDisabled(Features f) { - if (!f.hasParentFeature() && f.parent != null) { - Chisel.logger.info("Skipping feature {} as its parent feature {} was disabled.", Configurations.featureName(f), Configurations.featureName(f.parent)); - } else if (!f.hasRequiredMod() && f.getRequiredMod() != null) { - Chisel.logger.info("Skipping feature {} as its required mod {} was missing.", Configurations.featureName(f), f.getRequiredMod()); - } else { - Chisel.logger.info("Skipping feature {} as it was disabled in the config.", Configurations.featureName(f)); - } - } - - public static boolean oneModdedFeatureLoaded() { - for (Features f : values()) { - if (f.hasRequiredMod()) { - return true; - } - } - return false; - } - - static void preInit() { - Chisel.logger.info("Starting pre-init..."); - loadBlocks(); - loadItems(); - Chisel.logger.info("Pre-init finished."); - } - - private Features parent; - - private String requiredMod; - - private Features() { - this(null, null); - } - - private Features(Features parent) { - this(null, parent); - } - - private Features(String requiredMod) { - this(requiredMod, null); - } - - private Features(String requriedMod, Features parent) { - this.requiredMod = requriedMod; - this.parent = parent; - } - - void addBlocks() { - ; - } - - void addItems() { - ; - } - - void addRecipes() { - ; - } - - public boolean enabled() { - return Configurations.featureEnabled(this) && hasRequiredMod() && hasParentFeature(); - } - - private final boolean hasParentFeature() { - return parent == null || parent.enabled(); - } - - private final boolean hasRequiredMod() { - return getRequiredMod() == null || Loader.isModLoaded(getRequiredMod()); - } - - private String getRequiredMod() { - return requiredMod; - } - - boolean needsMetaRecipes() { - return false; - } - - private static void registerSlabTop(Block bottom, Block top) { - String name = Block.blockRegistry.getNameForObject(bottom); - name = name.substring(name.indexOf(':') + 1) + "_top"; - GameRegistry.registerBlock(top, name); - } + // technical4.carverHelper.addVariation("tile.technical4.7.desc", 7, "technical/new/TapeDrive"); + technical4.carverHelper.registerBlock(technical4, "technical4"); + technical4.carverHelper.registerVariations("technical"); + + Carving.chisel.registerOre("technical", "technical"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.technical, Configurations.factoryBlockAmount, 0), + new Object[] { "xyx", "yxy", "xyx", 'x', "stone", 'y', Items.iron_ingot })); + /* + * GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.technical2, + * Configurations.factoryBlockAmount, 0), new Object[] { "xyx", "yzy", "xyx", 'x', "stone", 'y', + * "ingotIron", 'z', Blocks.glass })); // + */ + } + }, + + TEMPLE_BLOCK { + + @Override + void addBlocks() { + BlockCarvable templeblock = (BlockCarvable) new BlockEldritch().setHardness(2.0F) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setResistance(10F) + .setStepSound(Chisel.soundTempleFootstep); + + templeblock.carverHelper.addVariation("tile.templeblock.0.desc", 0, "temple/cobble"); + templeblock.carverHelper.addVariation("tile.templeblock.1.desc", 1, "temple/ornate"); + templeblock.carverHelper.addVariation("tile.templeblock.2.desc", 2, "temple/plate"); + templeblock.carverHelper.addVariation("tile.templeblock.3.desc", 3, "temple/plate-cracked"); + templeblock.carverHelper.addVariation("tile.templeblock.4.desc", 4, "temple/bricks"); + templeblock.carverHelper.addVariation("tile.templeblock.5.desc", 5, "temple/bricks-large"); + templeblock.carverHelper.addVariation("tile.templeblock.6.desc", 6, "temple/bricks-weared"); + templeblock.carverHelper.addVariation("tile.templeblock.7.desc", 7, "temple/bricks-disarray"); + templeblock.carverHelper.addVariation("tile.templeblock.8.desc", 8, "temple/column"); + templeblock.carverHelper.addVariation("tile.templeblock.9.desc", 9, "temple/stand"); + templeblock.carverHelper.addVariation("tile.templeblock.10.desc", 10, "temple/stand-mosaic"); + templeblock.carverHelper.addVariation("tile.templeblock.11.desc", 11, "temple/stand-creeper"); + templeblock.carverHelper.addVariation("tile.templeblock.12.desc", 12, "temple/tiles"); + templeblock.carverHelper.addVariation("tile.templeblock.13.desc", 13, "temple/smalltiles"); + templeblock.carverHelper.addVariation("tile.templeblock.14.desc", 14, "temple/tiles-light"); + templeblock.carverHelper.addVariation("tile.templeblock.15.desc", 15, "temple/smalltiles-light"); + templeblock.carverHelper.registerAll(templeblock, "templeblock"); + Carving.chisel.registerOre("templeblock", "templeblock"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.templeblock, 8, 0), + "***", + "*X*", + "***", + '*', + new ItemStack(Blocks.stone, 1), + 'X', + dyeOres[4])); + } + }, + + TEMPLE_BLOCK_MOSSY { + + @Override + void addBlocks() { + BlockCarvable mossy_templeblock = (BlockCarvable) new BlockEldritch().setHardness(2.0F) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setResistance(10F) + .setStepSound(Chisel.soundTempleFootstep); + + mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.0.desc", 0, "templemossy/cobble"); + mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.1.desc", 1, "templemossy/ornate"); + mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.2.desc", 2, "templemossy/plate"); + mossy_templeblock.carverHelper + .addVariation("tile.mossy_templeblock.3.desc", 3, "templemossy/plate-cracked"); + mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.4.desc", 4, "templemossy/bricks"); + mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.5.desc", 5, "templemossy/bricks-large"); + mossy_templeblock.carverHelper + .addVariation("tile.mossy_templeblock.6.desc", 6, "templemossy/bricks-weared"); + mossy_templeblock.carverHelper + .addVariation("tile.mossy_templeblock.7.desc", 7, "templemossy/bricks-disarray"); + mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.8.desc", 8, "templemossy/column"); + mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.9.desc", 9, "templemossy/stand"); + mossy_templeblock.carverHelper + .addVariation("tile.mossy_templeblock.10.desc", 10, "templemossy/stand-mosaic"); + mossy_templeblock.carverHelper + .addVariation("tile.mossy_templeblock.11.desc", 11, "templemossy/stand-creeper"); + mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.12.desc", 12, "templemossy/tiles"); + mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.13.desc", 13, "templemossy/smalltiles"); + mossy_templeblock.carverHelper + .addVariation("tile.mossy_templeblock.14.desc", 14, "templemossy/tiles-light"); + mossy_templeblock.carverHelper + .addVariation("tile.mossy_templeblock.15.desc", 15, "templemossy/smalltiles-light"); + mossy_templeblock.carverHelper.registerAll(mossy_templeblock, "mossy_templeblock"); + Carving.chisel.registerOre("mossy_templeblock", "mossy_templeblock"); + } + + ; + }, + + TIN { + + @Override + void addBlocks() { + BlockCarvable tin = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F).setResistance(10F); + tin.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/tin/caution", 20); + tin.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/tin/crate", 21); + tin.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/tin/thermal", 22); + tin.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/tin/adv", 23); + tin.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/tin/egregious", 24); + tin.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/tin/bolted", 25); + tin.carverHelper.registerAll(tin, "tinblock"); + Carving.chisel.registerOre("tinblock", "blockTin"); + } + }, + + /** + * Dummy feature for all TF subsets + */ + TWILGHT_FOREST("TwilightForest"), + + TF_MAZESTONE(TWILGHT_FOREST.getRequiredMod(), TWILGHT_FOREST) { + + @Override + void addBlocks() { + Carving.chisel + .addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 0, 0); + Carving.chisel + .addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 1, 1); + Carving.chisel + .addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 2, 2); + Carving.chisel + .addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 3, 3); + Carving.chisel + .addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 4, 4); + Carving.chisel + .addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 5, 5); + Carving.chisel + .addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 6, 6); + Carving.chisel + .addVariation("TFMazestone", GameRegistry.findBlock("TwilightForest", "tile.TFMazestone"), 7, 7); + Carving.chisel.registerOre("TFMazestone", "TFMazestone"); + } + }, + + TF_TOWERSTONE(TWILGHT_FOREST.getRequiredMod(), TWILGHT_FOREST) { + + @Override + void addBlocks() { + Carving.chisel + .addVariation("TFTowerStone", GameRegistry.findBlock("TwilightForest", "tile.TFTowerStone"), 0, 0); + Carving.chisel + .addVariation("TFTowerStone", GameRegistry.findBlock("TwilightForest", "tile.TFTowerStone"), 1, 1); + Carving.chisel + .addVariation("TFTowerStone", GameRegistry.findBlock("TwilightForest", "tile.TFTowerStone"), 2, 2); + Carving.chisel + .addVariation("TFTowerStone", GameRegistry.findBlock("TwilightForest", "tile.TFTowerStone"), 3, 3); + Carving.chisel.registerOre("TFTowerStone", "TFTowerStone"); + } + }, + + TF_UNDER_BRICK(TWILGHT_FOREST.getRequiredMod(), TWILGHT_FOREST) { + + @Override + void addBlocks() { + Carving.chisel + .addVariation("TFUnderBrick", GameRegistry.findBlock("TwilightForest", "tile.TFUnderBrick"), 0, 0); + Carving.chisel + .addVariation("TFUnderBrick", GameRegistry.findBlock("TwilightForest", "tile.TFUnderBrick"), 1, 1); + Carving.chisel + .addVariation("TFUnderBrick", GameRegistry.findBlock("TwilightForest", "tile.TFUnderBrick"), 2, 2); + Carving.chisel.registerOre("TFUnderBrick", "TFUnderBrick"); + } + }, + + THAUMIUM("Thaumcraft") { + + @Override + void addBlocks() { + BlockCarvable thaumium = (BlockCarvable) new BlockCarvable(Material.iron) + .setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("thaumium", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 4, 0); + thaumium.carverHelper.addVariation("tile.thaumium.0.desc", 0, "thaumium/ornate", 20); + thaumium.carverHelper.addVariation("tile.thaumium.1.desc", 1, "thaumium/totem", 21); + thaumium.carverHelper.addVariation("tile.thaumium.2.desc", 2, "thaumium/thaumiumBigBricks", 22); + thaumium.carverHelper.addVariation("tile.thaumium.3.desc", 3, "thaumium/small", 23); + thaumium.carverHelper.addVariation("tile.thaumium.4.desc", 4, "thaumium/lattice", 24); + thaumium.carverHelper.addVariation("tile.thaumium.5.desc", 5, "thaumium/planks", 25); + thaumium.carverHelper.registerAll(thaumium, "thaumium"); + Carving.chisel.registerOre("thaumium", "thaumium"); + } + }, + + TORCH { + + @Override + void addBlocks() { + Carving.chisel.addVariation("torch", Blocks.torch, 0, 0); + for (int type = 0; type < 10; type++) { + String name = "torch" + (type + 1); + BlockCarvableTorch t = new BlockCarvableTorch(type, name); + if (type == 8 || type == 9) { + t.disableParticles(); + } + if (Loader.isModLoaded("ForgeMultipart")) { + GameRegistry.registerBlock(t, ItemBlockChiselTorchPart.class, name, t); + } else { + GameRegistry.registerBlock(t, name); + } + Carving.chisel.addVariation("torch", t, 0, (type + 1)); + torches[type] = t; + } + Carving.chisel.registerOre("torch", "torch"); + } + }, + + TYRIAN { + + @Override + void addBlocks() { + BlockCarvable tyrian = (BlockCarvable) new BlockCarvable(Material.iron) + .setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(5.0F).setResistance(10.0F) + .setStepSound(Block.soundTypeMetal); + + tyrian.carverHelper.addVariation("tile.tyrian.0.desc", 0, "tyrian/shining"); + tyrian.carverHelper.addVariation("tile.tyrian.1.desc", 1, "tyrian/tyrian"); + tyrian.carverHelper.addVariation("tile.tyrian.2.desc", 2, "tyrian/chaotic"); + tyrian.carverHelper.addVariation("tile.tyrian.3.desc", 3, "tyrian/softplate"); + tyrian.carverHelper.addVariation("tile.tyrian.4.desc", 4, "tyrian/rust"); + tyrian.carverHelper.addVariation("tile.tyrian.5.desc", 5, "tyrian/elaborate"); + tyrian.carverHelper.addVariation("tile.tyrian.6.desc", 6, "tyrian/routes"); + tyrian.carverHelper.addVariation("tile.tyrian.7.desc", 7, "tyrian/platform"); + tyrian.carverHelper.addVariation("tile.tyrian.8.desc", 8, "tyrian/platetiles"); + tyrian.carverHelper.addVariation("tile.tyrian.9.desc", 9, "tyrian/diagonal"); + tyrian.carverHelper.addVariation("tile.tyrian.10.desc", 10, "tyrian/dent"); + tyrian.carverHelper.addVariation("tile.tyrian.11.desc", 11, "tyrian/blueplating"); + tyrian.carverHelper.addVariation("tile.tyrian.12.desc", 12, "tyrian/black"); + tyrian.carverHelper.addVariation("tile.tyrian.13.desc", 13, "tyrian/black2"); + tyrian.carverHelper.addVariation("tile.tyrian.14.desc", 14, "tyrian/opening"); + tyrian.carverHelper.addVariation("tile.tyrian.15.desc", 15, "tyrian/plate"); + tyrian.carverHelper.registerAll(tyrian, "tyrian"); + OreDictionary.registerOre("tyrian", tyrian); + Carving.chisel.registerOre("tyrian", "tyrian"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.tyrian, 8, 0), + "***", + "*X*", + "***", + '*', + new ItemStack(Blocks.stone, 1), + 'X', + new ItemStack(Items.iron_ingot, 1)); + } + }, + + URANIUM /* Whose ranium? */ { + + @Override + void addBlocks() { + BlockCarvable uranium = (BlockCarvable) new BlockBeaconBase(Material.iron) + .setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F) + .setResistance(10F); + uranium.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/uranium/caution", 20); + uranium.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/uranium/crate", 21); + uranium.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/uranium/thermal", 22); + uranium.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/uranium/adv", 23); + uranium.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/uranium/egregious", 24); + uranium.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/uranium/bolted", 25); + uranium.carverHelper.registerAll(uranium, "uraniumblock"); + Carving.chisel.registerOre("uraniumblock", "blockUranium"); + } + }, + + VALENTINES { + + @Override + void addBlocks() { + BlockCarvable valentines = (BlockCarvable) new BlockCarvable(Material.wood) + .setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(2F) + .setResistance(10F); + valentines.carverHelper.addVariation("tile.valentines.0.desc", 0, "valentines/1"); + valentines.carverHelper.addVariation("tile.valentines.1.desc", 1, "valentines/companion"); + valentines.carverHelper.addVariation("tile.valentines.2.desc", 2, "valentines/2"); + valentines.carverHelper.addVariation("tile.valentines.3.desc", 3, "valentines/3"); + valentines.carverHelper.addVariation("tile.valentines.4.desc", 4, "valentines/4"); + valentines.carverHelper.addVariation("tile.valentines.5.desc", 5, "valentines/5"); + valentines.carverHelper.addVariation("tile.valentines.6.desc", 6, "valentines/6"); + valentines.carverHelper.addVariation("tile.valentines.7.desc", 7, "valentines/7"); + valentines.carverHelper.addVariation("tile.valentines.8.desc", 8, "valentines/8"); + valentines.carverHelper.addVariation("tile.valentines.9.desc", 9, "valentines/9"); + valentines.carverHelper.registerAll(valentines, "valentines"); + Carving.chisel.registerOre("valentines", "blockValentines"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.valentines, 8, 0), + "***", + "*X*", + "***", + '*', + "stone", + 'X', + new ItemStack(Items.dye, 1, 9))); + } + }, + + VOIDSTONE { + + @Override + void addBlocks() { + BlockCarvable voidstone = (BlockCarvable) new BlockCarvable() + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F); + voidstone.carverHelper.addVariation("tile.voidstone.0.desc", 0, "voidstone/raw", 0); + voidstone.carverHelper.addVariation("tile.voidstone.1.desc", 1, "voidstone/quarters", 1); + voidstone.carverHelper.addVariation("tile.voidstone.2.desc", 2, "voidstone/smooth", 2); + voidstone.carverHelper.addVariation("tile.voidstone.3.desc", 3, "voidstone/skulls", 3); + voidstone.carverHelper.addVariation("tile.voidstone.4.desc", 4, "voidstone/rune", 4); + voidstone.carverHelper.addVariation("tile.voidstone.5.desc", 5, "voidstone/metalborder", 5); + voidstone.carverHelper.addVariation("tile.voidstone.6.desc", 6, "voidstone/eye", 6); + voidstone.carverHelper.addVariation("tile.voidstone.7.desc", 7, "voidstone/bevel", 7); + + voidstone.carverHelper.registerAll(voidstone, "voidstone"); + Carving.chisel.registerOre("voidstone", "voidstone"); + + BlockCarvable voidstone2 = (BlockCarvable) new BlockCarvable().setStepSound(Block.soundTypeStone) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F); + voidstone2.carverHelper + .addVariation("tile.voidstone.0.desc", 0, new SubmapManagerVoidstone("voidstone/animated/raw", 0)); + voidstone2.carverHelper.addVariation( + "tile.voidstone.1.desc", + 1, + new SubmapManagerVoidstone("voidstone/animated/quarters", 1)); + voidstone2.carverHelper.addVariation( + "tile.voidstone.2.desc", + 2, + new SubmapManagerVoidstone("voidstone/animated/smooth", 2)); + voidstone2.carverHelper.addVariation( + "tile.voidstone.3.desc", + 3, + new SubmapManagerVoidstone("voidstone/animated/skulls", 3)); + voidstone2.carverHelper + .addVariation("tile.voidstone.4.desc", 4, new SubmapManagerVoidstone("voidstone/animated/rune", 4)); + voidstone2.carverHelper.addVariation( + "tile.voidstone.5.desc", + 5, + new SubmapManagerVoidstone("voidstone/animated/metalborder", 5)); + voidstone2.carverHelper + .addVariation("tile.voidstone.6.desc", 6, new SubmapManagerVoidstone("voidstone/animated/eye", 6)); + voidstone2.carverHelper.addVariation( + "tile.voidstone.7.desc", + 7, + new SubmapManagerVoidstone("voidstone/animated/bevel", 7)); + + voidstone2.carverHelper.registerAll(voidstone2, "voidstone2"); + Carving.chisel.registerOre("voidstone2", "voidstone2"); + + BlockCarvable voidstonerunic = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F); + + for (int i = 1; i < 16; i++) voidstonerunic.carverHelper.addVariation( + "tile.voidstoneRunic." + sGNames[i].replaceAll(" ", "").toLowerCase() + ".desc", + i, + "voidstone/runes/rune" + sGNames[i].replaceAll(" ", "")); + voidstonerunic.carverHelper.registerAll(voidstonerunic, "voidstoneRunic"); + voidstonerunic.carverHelper.registerVariations("voidstone"); + + Carving.chisel.registerOre("voidstoneRunic", "voidstoneRunic"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.voidstone, 8, 0), + new Object[] { "oxo", "xyx", "oxo", 'x', new ItemStack(Blocks.stone, 1), 'y', + new ItemStack(Items.ender_pearl, 1), 'o', new ItemStack(Blocks.obsidian, 1) }); + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.voidstone2, 8, 0), + new Object[] { "oxo", "xyx", "oxo", 'x', new ItemStack(Blocks.stone, 1), 'y', + new ItemStack(Items.ender_eye, 1), 'o', new ItemStack(Blocks.obsidian, 1) }); + } + }, + + VOIDSTONE_PILLARS(VOIDSTONE) { + + @Override + void addBlocks() { + BlockCarvable voidstonePillar = (BlockCarvable) new BlockCarvable(Material.rock) + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone); + voidstonePillar.carverHelper.addVariation("tile.voidstonePillar.0.desc", 0, "voidstone/pillar"); + voidstonePillar.carverHelper.registerAll(voidstonePillar, "voidstonePillar"); + Carving.chisel.registerOre("voidstonePillar", "voidstonePillar"); + + BlockCarvable voidstonePillar2 = (BlockCarvable) new BlockCarvable(Material.rock) + .setStepSound(Block.soundTypeStone); + voidstonePillar2.carverHelper.addVariation("tile.voidstonePillar2.0.desc", 0, "voidstone/animated/pillar"); + voidstonePillar2.carverHelper.registerAll(voidstonePillar2, "voidstonePillar2"); + Carving.chisel.registerOre("voidstonePillar2", "voidstonePillar2"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.voidstonePillar, 4, 0), + "xx", + "xx", + 'x', + new ItemStack(ChiselBlocks.voidstone, 1)); + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.voidstonePillar2, 4, 0), + "xx", + "xx", + 'x', + new ItemStack(ChiselBlocks.voidstone2, 1)); + } + }, + + WARNING_SIGN { + + @Override + void addBlocks() { + BlockCarvableLayered warningSign = (BlockCarvableLayered) new BlockCarvableLayered( + Material.iron, + "warning/base").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F) + .setResistance(10.0F); + warningSign.carverHelper.addVariation("tile.warningSign.0.desc", 0, "warning/rad"); + warningSign.carverHelper.addVariation("tile.warningSign.1.desc", 1, "warning/bio"); + warningSign.carverHelper.addVariation("tile.warningSign.2.desc", 2, "warning/fire"); + warningSign.carverHelper.addVariation("tile.warningSign.3.desc", 3, "warning/explosion"); + warningSign.carverHelper.addVariation("tile.warningSign.4.desc", 4, "warning/death"); + warningSign.carverHelper.addVariation("tile.warningSign.5.desc", 5, "warning/falling"); + warningSign.carverHelper.addVariation("tile.warningSign.6.desc", 6, "warning/fall"); + warningSign.carverHelper.addVariation("tile.warningSign.7.desc", 7, "warning/voltage"); + warningSign.carverHelper.addVariation("tile.warningSign.8.desc", 8, "warning/generic"); + warningSign.carverHelper.addVariation("tile.warningSign.9.desc", 9, "warning/acid"); + warningSign.carverHelper.addVariation("tile.warningSign.10.desc", 10, "warning/underconstruction"); + warningSign.carverHelper.addVariation("tile.warningSign.11.desc", 11, "warning/sound"); + warningSign.carverHelper.addVariation("tile.warningSign.12.desc", 12, "warning/noentry"); + warningSign.carverHelper.addVariation("tile.warningSign.13.desc", 13, "warning/cryogenic"); + warningSign.carverHelper.addVariation("tile.warningSign.14.desc", 14, "warning/oxygen"); + warningSign.carverHelper.registerAll(warningSign, "warningSign"); + Carving.chisel.registerOre("warningSign", "warningSign"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ShapedOreRecipe( + new ItemStack(ChiselBlocks.warningSign, 4, 0), + new Object[] { "xxx", "xyx", "xxx", 'x', "stone", 'y', Items.sign })); + } + }, + + WATERSTONE { + + @Override + void addBlocks() { + BlockWaterstone waterstone = (BlockWaterstone) new BlockWaterstone(Material.rock, "water_still") + .setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10.0F); + waterstone.carverHelper.addVariation("tile.waterstone.0.desc", 0, "waterstone/cobble"); + waterstone.carverHelper.addVariation("tile.waterstone.1.desc", 1, "waterstone/black"); + waterstone.carverHelper.addVariation("tile.waterstone.2.desc", 2, "waterstone/tiles"); + waterstone.carverHelper.addVariation("tile.waterstone.3.desc", 3, "waterstone/chaotic"); + waterstone.carverHelper.addVariation("tile.waterstone.4.desc", 4, "waterstone/creeper"); + waterstone.carverHelper.addVariation("tile.waterstone.5.desc", 5, "waterstone/panel"); + waterstone.carverHelper.addVariation("tile.waterstone.6.desc", 6, "waterstone/panel-ornate"); + waterstone.carverHelper.registerAll(waterstone, "waterstone"); + OreDictionary.registerOre("blockWaterstone", waterstone); + Carving.chisel.registerOre("waterstone", "blockWaterstone"); + } + + @Override + void addRecipes() { + GameRegistry.addRecipe( + new ItemStack(ChiselBlocks.waterstone, 8, 0), + "***", + "*X*", + "***", + '*', + new ItemStack(Blocks.stone, 1), + 'X', + new ItemStack(Items.water_bucket, 1)); + } + }, + + WOOD { + + @Override + void addBlocks() { + String[] plank_names = { "oak", "spruce", "birch", "jungle", "acacia", "dark-oak" }; + for (int i = 0; i < plank_names.length; i++) { + String n = plank_names[i]; + final String name = n.replace('-', '_') + "_planks"; + + planks[i] = (BlockCarvable) (new BlockCarvable(Material.wood)) + .setCreativeTab(ChiselTabs.tabWoodChiselBlocks).setHardness(2.0F).setResistance(5.0F) + .setStepSound(Block.soundTypeWood); + + planks[i].carverHelper.addVariation("tile." + n + ".planks.1.desc", 1, "planks-" + n + "/clean"); + planks[i].carverHelper.addVariation("tile." + n + ".planks.2.desc", 2, "planks-" + n + "/short"); + planks[i].carverHelper.addVariation("tile." + n + ".planks.6.desc", 6, "planks-" + n + "/fancy"); + planks[i].carverHelper.addVariation("tile." + n + ".planks.8.desc", 8, "planks-" + n + "/panel-nails"); + planks[i].carverHelper.addVariation("tile." + n + ".planks.9.desc", 9, "planks-" + n + "/double"); + planks[i].carverHelper.addVariation("tile." + n + ".planks.10.desc", 10, "planks-" + n + "/crate"); + planks[i].carverHelper + .addVariation("tile." + n + ".planks.11.desc", 11, "planks-" + n + "/crate-fancy"); + planks[i].carverHelper.addVariation("tile." + n + ".planks.13.desc", 13, "planks-" + n + "/large"); + planks[i].carverHelper.addVariation("tile." + n + ".planks.3.desc", 3, "planks-" + n + "/vertical"); + planks[i].carverHelper + .addVariation("tile." + n + ".planks.4.desc", 4, "planks-" + n + "/vertical-uneven"); + planks[i].carverHelper.addVariation("tile." + n + ".planks.5.desc", 5, "planks-" + n + "/parquet"); + planks[i].carverHelper.addVariation("tile." + n + ".planks.7.desc", 7, "planks-" + n + "/blinds"); + planks[i].carverHelper.addVariation("tile." + n + ".planks.12.desc", 12, "planks-" + n + "/crateex"); + planks[i].carverHelper + .addVariation("tile." + n + ".planks.14.desc", 14, "planks-" + n + "/chaotic-hor"); + planks[i].carverHelper.addVariation("tile." + n + ".planks.15.desc", 15, "planks-" + n + "/chaotic"); + planks[i].carverHelper.registerAll(planks[i], name); + Carving.chisel.addVariation(name, Blocks.planks, i, 0); + planks[i].setHarvestLevel("axe", 0); + Carving.chisel.registerOre(name, "wood"); + Carving.chisel.setVariationSound(name, Chisel.MOD_ID + ":chisel.wood"); + Blocks.fire.setFireInfo(planks[i], 5, 20); + } + } + }, + + WOOLEN_CLAY { + + @Override + void addBlocks() { + BlockCarvable woolen_clay = (BlockCarvable) new BlockCarvable(Material.clay) + .setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(2F).setResistance(10F); + + for (int i = 0; i < 16; i++) woolen_clay.carverHelper.addVariation( + "tile.woolenClay." + i + ".desc", + i, + "woolenClay/" + sGNames[i].replaceAll(" ", "").toLowerCase()); + woolen_clay.carverHelper.registerAll(woolen_clay, "woolen_clay"); + + Carving.chisel.registerOre("woolen_clay", "woolen_clay"); + } + + @Override + void addRecipes() { + OreDictionary.registerOre( + "stainedClay" + sGNames[meta].replaceAll(" ", ""), + new ItemStack(Blocks.stained_hardened_clay, 1, meta)); + OreDictionary + .registerOre("blockWool" + sGNames[meta].replaceAll(" ", ""), new ItemStack(Blocks.wool, 1, meta)); + GameRegistry.addRecipe( + new ShapelessOreRecipe( + new ItemStack(ChiselBlocks.woolen_clay, 2, meta), + new Object[] { "blockWool" + sGNames[meta].replaceAll(" ", ""), + "stainedClay" + sGNames[meta].replaceAll(" ", "") })); + } + + @Override + boolean needsMetaRecipes() { + return true; + } + }; + + private static final String[] dyeOres = { "dyeBlack", "dyeRed", "dyeGreen", "dyeBrown", "dyeBlue", "dyePurple", + "dyeCyan", "dyeLightGray", "dyeGray", "dyePink", "dyeLime", "dyeYellow", "dyeLightBlue", "dyeMagenta", + "dyeOrange", "dyeWhite" }; + + private static int meta = 0; + + static void init() { + Chisel.logger.info("Starting init..."); + loadRecipes(); + Chisel.logger.info("Init finished."); + } + + private static void loadBlocks() { + Chisel.logger.info("Loading blocks..."); + int num = 0; + for (Features f : values()) { + if (f.enabled()) { + f.addBlocks(); + ++num; + } else { + logDisabled(f); + } + } + Chisel.logger.info(num + " Feature's blocks loaded."); + Chisel.logger.info("Loading Tile Entities..."); + Chisel.proxy.registerTileEntities(); + Chisel.logger.info("Tile Entities loaded."); + } + + private static void loadItems() { + Chisel.logger.info("Loading items..."); + int num = 0; + for (Features f : values()) { + if (f.enabled()) { + f.addItems(); + ++num; + } else { + logDisabled(f); + } + } + Chisel.logger.info(num + " Feature's items loaded."); + } + + private static void loadRecipes() { + Chisel.logger.info("Loading recipes..."); + int num = 0; + for (Features f : values()) { + if (f.enabled()) { + if (f.needsMetaRecipes()) { + for (int i = 0; i < 16; i++) { + meta = i; + f.addRecipes(); + } + meta = 0; + } else { + f.addRecipes(); + } + ++num; + } else { + logDisabled(f); + } + } + Chisel.logger.info(num + " Feature's recipes loaded."); + } + + private static void logDisabled(Features f) { + if (!f.hasParentFeature() && f.parent != null) { + Chisel.logger.info( + "Skipping feature {} as its parent feature {} was disabled.", + Configurations.featureName(f), + Configurations.featureName(f.parent)); + } else if (!f.hasRequiredMod() && f.getRequiredMod() != null) { + Chisel.logger.info( + "Skipping feature {} as its required mod {} was missing.", + Configurations.featureName(f), + f.getRequiredMod()); + } else { + Chisel.logger.info("Skipping feature {} as it was disabled in the config.", Configurations.featureName(f)); + } + } + + public static boolean oneModdedFeatureLoaded() { + for (Features f : values()) { + if (f.hasRequiredMod()) { + return true; + } + } + return false; + } + + static void preInit() { + Chisel.logger.info("Starting pre-init..."); + loadBlocks(); + loadItems(); + Chisel.logger.info("Pre-init finished."); + } + + private Features parent; + + private String requiredMod; + + private Features() { + this(null, null); + } + + private Features(Features parent) { + this(null, parent); + } + + private Features(String requiredMod) { + this(requiredMod, null); + } + + private Features(String requriedMod, Features parent) { + this.requiredMod = requriedMod; + this.parent = parent; + } + + void addBlocks() { + ; + } + + void addItems() { + ; + } + + void addRecipes() { + ; + } + + public boolean enabled() { + return Configurations.featureEnabled(this) && hasRequiredMod() && hasParentFeature(); + } + + private final boolean hasParentFeature() { + return parent == null || parent.enabled(); + } + + private final boolean hasRequiredMod() { + return getRequiredMod() == null || Loader.isModLoaded(getRequiredMod()); + } + + private String getRequiredMod() { + return requiredMod; + } + + boolean needsMetaRecipes() { + return false; + } + + private static void registerSlabTop(Block bottom, Block top) { + String name = Block.blockRegistry.getNameForObject(bottom); + name = name.substring(name.indexOf(':') + 1) + "_top"; + GameRegistry.registerBlock(top, name); + } } diff --git a/src/main/java/team/chisel/block/BlockAutoChisel.java b/src/main/java/team/chisel/block/BlockAutoChisel.java index 21f38b70..c501ee29 100644 --- a/src/main/java/team/chisel/block/BlockAutoChisel.java +++ b/src/main/java/team/chisel/block/BlockAutoChisel.java @@ -1,7 +1,5 @@ package team.chisel.block; -import team.chisel.Chisel; -import team.chisel.block.tileentity.TileEntityAutoChisel; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -10,67 +8,70 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import team.chisel.Chisel; +import team.chisel.block.tileentity.TileEntityAutoChisel; + public class BlockAutoChisel extends BlockContainer { - public BlockAutoChisel() { - super(Material.rock); - setHardness(1F); - setBlockBounds(0.125f, 0, 0.125f, 0.875f, 0.8125f, 0.875f); - } + public BlockAutoChisel() { + super(Material.rock); + setHardness(1F); + setBlockBounds(0.125f, 0, 0.125f, 0.875f, 0.8125f, 0.875f); + } - @Override - public int getRenderType() { - return Chisel.renderAutoChiselId; - } + @Override + public int getRenderType() { + return Chisel.renderAutoChiselId; + } - @Override - public boolean isOpaqueCube() { - return false; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float x1, float y1, float z1) { - TileEntity tile = world.getTileEntity(x, y, z); - if (world.isRemote) - return true; + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float x1, + float y1, float z1) { + TileEntity tile = world.getTileEntity(x, y, z); + if (world.isRemote) return true; - if (tile != null && tile instanceof TileEntityAutoChisel && !player.isSneaking()) { - player.openGui(Chisel.instance, 1, world, x, y, z); - } + if (tile != null && tile instanceof TileEntityAutoChisel && !player.isSneaking()) { + player.openGui(Chisel.instance, 1, world, x, y, z); + } - return true; - } + return true; + } - @Override - public void breakBlock(World world, int x, int y, int z, Block block, int par6) { - dropItems(world, x, y, z); - super.breakBlock(world, x, y, z, block, par6); - } + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int par6) { + dropItems(world, x, y, z); + super.breakBlock(world, x, y, z, block, par6); + } - private void dropItems(World world, int x, int y, int z) { - TileEntity tileEntity = world.getTileEntity(x, y, z); + private void dropItems(World world, int x, int y, int z) { + TileEntity tileEntity = world.getTileEntity(x, y, z); - if (!(tileEntity instanceof TileEntityAutoChisel)) { - return; - } + if (!(tileEntity instanceof TileEntityAutoChisel)) { + return; + } - TileEntityAutoChisel inventory = (TileEntityAutoChisel) world.getTileEntity(x, y, z); + TileEntityAutoChisel inventory = (TileEntityAutoChisel) world.getTileEntity(x, y, z); - for (int c = 0; c < inventory.getSizeInventory(); c++) { - ItemStack stack = inventory.getStackInSlot(c); - if (stack != null) { - dropBlockAsItem(world, x, y, z, stack); - } - } - } + for (int c = 0; c < inventory.getSizeInventory(); c++) { + ItemStack stack = inventory.getStackInSlot(c); + if (stack != null) { + dropBlockAsItem(world, x, y, z, stack); + } + } + } - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityAutoChisel(); - } + @Override + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityAutoChisel(); + } } diff --git a/src/main/java/team/chisel/block/BlockBeaconBase.java b/src/main/java/team/chisel/block/BlockBeaconBase.java index 3bfecfda..85cce3f2 100644 --- a/src/main/java/team/chisel/block/BlockBeaconBase.java +++ b/src/main/java/team/chisel/block/BlockBeaconBase.java @@ -8,16 +8,16 @@ import net.minecraft.world.IBlockAccess; */ public class BlockBeaconBase extends BlockCarvable { - public BlockBeaconBase() { - super(); - } + public BlockBeaconBase() { + super(); + } - public BlockBeaconBase(Material mat) { - super(mat); - } + public BlockBeaconBase(Material mat) { + super(mat); + } - @Override - public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { - return true; - } + @Override + public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { + return true; + } } diff --git a/src/main/java/team/chisel/block/BlockCarvable.java b/src/main/java/team/chisel/block/BlockCarvable.java index 573248cd..1adb5d20 100644 --- a/src/main/java/team/chisel/block/BlockCarvable.java +++ b/src/main/java/team/chisel/block/BlockCarvable.java @@ -2,13 +2,6 @@ package team.chisel.block; import java.util.List; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.CarvableHelper; -import com.cricketcraft.chisel.api.carving.IVariationInfo; -import com.cricketcraft.chisel.api.rendering.ClientUtils; - -import team.chisel.Chisel; -import com.cricketcraft.chisel.api.ChiselTabs; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -16,167 +9,163 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; + +import team.chisel.Chisel; + +import com.cricketcraft.chisel.api.ChiselTabs; +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.IVariationInfo; +import com.cricketcraft.chisel.api.rendering.ClientUtils; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockCarvable extends Block implements ICarvable { - public CarvableHelper carverHelper; - private boolean isAlpha; + public CarvableHelper carverHelper; + private boolean isAlpha; - public BlockCarvable() { - this(Material.rock); - } + public BlockCarvable() { + this(Material.rock); + } - public BlockCarvable(Material m) { - super(m); - if (m == Material.rock || m == Material.iron) { - setHarvestLevel("pickaxe", 0); - } - carverHelper = new CarvableHelper(this); - setResistance(10.0F); - setHardness(2.0F); - setCreativeTab(ChiselTabs.tabOtherChiselBlocks); - } + public BlockCarvable(Material m) { + super(m); + if (m == Material.rock || m == Material.iron) { + setHarvestLevel("pickaxe", 0); + } + carverHelper = new CarvableHelper(this); + setResistance(10.0F); + setHardness(2.0F); + setCreativeTab(ChiselTabs.tabOtherChiselBlocks); + } - public BlockCarvable setStained(boolean a) { - this.isAlpha = a; - return this; - } + public BlockCarvable setStained(boolean a) { + this.isAlpha = a; + return this; + } - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return isAlpha ? 1 : 0; - } + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return isAlpha ? 1 : 0; + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - return carverHelper.getIcon(world, x, y, z, side); - } + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return carverHelper.getIcon(world, x, y, z, side); + } - @Override - public int damageDropped(int i) { - return i; - } + @Override + public int damageDropped(int i) { + return i; + } - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister register) { - carverHelper.registerBlockIcons(Chisel.MOD_ID, this, register); - } + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister register) { + carverHelper.registerBlockIcons(Chisel.MOD_ID, this, register); + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item item, CreativeTabs tabs, List list) { - carverHelper.registerSubBlocks(this, tabs, list); - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - public int getRenderType() { - return ClientUtils.renderCTMId; - } + @Override + public int getRenderType() { + return ClientUtils.renderCTMId; + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } - public static class SoundType extends Block.SoundType { + public static class SoundType extends Block.SoundType { - public final String soundNameStep; - public final String soundNameBreak; - public final String soundNamePlace; + public final String soundNameStep; + public final String soundNameBreak; + public final String soundNamePlace; - /** - * Creates a SoundType with automatic names for step and break sounds. Sound names dig.soundName and step.soundName must be specified in the sounds.json - * - * @param soundName - * block of the sound. Will automatically be expanded to "mod:dig.soundName" and "mod:step.soundName" respectively) - * @param volume - * default 1.0f - * @param frequency - * default 1.0f - */ - public SoundType(String soundName, float volume, float frequency) { - super(soundName, volume, frequency); - this.soundNameStep = null; - this.soundNameBreak = null; - this.soundNamePlace = null; - } + /** + * Creates a SoundType with automatic names for step and break sounds. Sound names dig.soundName and + * step.soundName must be specified in the sounds.json + * + * @param soundName block of the sound. Will automatically be expanded to "mod:dig.soundName" and + * "mod:step.soundName" respectively) + * @param volume default 1.0f + * @param frequency default 1.0f + */ + public SoundType(String soundName, float volume, float frequency) { + super(soundName, volume, frequency); + this.soundNameStep = null; + this.soundNameBreak = null; + this.soundNamePlace = null; + } - /** - * Creates a SoundType with manual names for step and break sounds. Sound names must be specified in the sounds.json - * - * @param soundNameBreak - * block break sound - * @param soundNameStep - * block step sound - * @param volume - * default 1.0f - * @param frequency - * default 1.0f - */ - public SoundType(String soundNameBreak, String soundNameStep, float volume, float frequency) { - super(soundNameStep, volume, frequency); - this.soundNameStep = soundNameStep; - this.soundNameBreak = soundNameBreak; - this.soundNamePlace = null; - } + /** + * Creates a SoundType with manual names for step and break sounds. Sound names must be specified in the + * sounds.json + * + * @param soundNameBreak block break sound + * @param soundNameStep block step sound + * @param volume default 1.0f + * @param frequency default 1.0f + */ + public SoundType(String soundNameBreak, String soundNameStep, float volume, float frequency) { + super(soundNameStep, volume, frequency); + this.soundNameStep = soundNameStep; + this.soundNameBreak = soundNameBreak; + this.soundNamePlace = null; + } - /** - * Creates a SoundType with manual names for step, break and place sounds. Sound names must be specified in the sounds.json - * - * @param soundNameBreak - * block break sound - * @param soundNameStep - * block step sound - * @param soundNamePlace - * block place sound - * @param volume - * default 1.0f - * @param frequency - * default 1.0f - */ - public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume, float frequency) { - super(soundNameStep, volume, frequency); - this.soundNameStep = soundNameStep; - this.soundNameBreak = soundNameBreak; - this.soundNamePlace = soundNamePlace; - } + /** + * Creates a SoundType with manual names for step, break and place sounds. Sound names must be specified in the + * sounds.json + * + * @param soundNameBreak block break sound + * @param soundNameStep block step sound + * @param soundNamePlace block place sound + * @param volume default 1.0f + * @param frequency default 1.0f + */ + public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume, + float frequency) { + super(soundNameStep, volume, frequency); + this.soundNameStep = soundNameStep; + this.soundNameBreak = soundNameBreak; + this.soundNamePlace = soundNamePlace; + } - @Override - public String getBreakSound() { - if (soundNameBreak == null) - return Chisel.MOD_ID + ":dig." + this.soundName; - else - return this.soundNameBreak; - } + @Override + public String getBreakSound() { + if (soundNameBreak == null) return Chisel.MOD_ID + ":dig." + this.soundName; + else return this.soundNameBreak; + } - @Override - public String getStepResourcePath() { - if (soundNameStep == null) - return Chisel.MOD_ID + ":step." + this.soundName; - else - return this.soundNameStep; - } + @Override + public String getStepResourcePath() { + if (soundNameStep == null) return Chisel.MOD_ID + ":step." + this.soundName; + else return this.soundNameStep; + } - @Override - public String func_150496_b() { - if (soundNamePlace == null) - return getBreakSound(); - else - return this.soundNamePlace; - } - } + @Override + public String func_150496_b() { + if (soundNamePlace == null) return getBreakSound(); + else return this.soundNamePlace; + } + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableAntiBlock.java b/src/main/java/team/chisel/block/BlockCarvableAntiBlock.java index 2ac77918..403707af 100644 --- a/src/main/java/team/chisel/block/BlockCarvableAntiBlock.java +++ b/src/main/java/team/chisel/block/BlockCarvableAntiBlock.java @@ -1,19 +1,19 @@ package team.chisel.block; -import com.cricketcraft.chisel.api.ICarvable; - import net.minecraft.block.material.Material; import net.minecraft.entity.EnumCreatureType; import net.minecraft.world.IBlockAccess; +import com.cricketcraft.chisel.api.ICarvable; + public class BlockCarvableAntiBlock extends BlockCarvableColor implements ICarvable { - public BlockCarvableAntiBlock() { - super(Material.rock); - } + public BlockCarvableAntiBlock() { + super(Material.rock); + } - @Override - public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { - return false; - } + @Override + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { + return false; + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableBeacon.java b/src/main/java/team/chisel/block/BlockCarvableBeacon.java index 9d37bf8c..61e58101 100644 --- a/src/main/java/team/chisel/block/BlockCarvableBeacon.java +++ b/src/main/java/team/chisel/block/BlockCarvableBeacon.java @@ -12,6 +12,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import team.chisel.block.tileentity.TileEntityCarvableBeacon; import team.chisel.init.ChiselBlocks; @@ -22,77 +23,78 @@ import com.cricketcraft.chisel.api.carving.IVariationInfo; public class BlockCarvableBeacon extends BlockBeacon implements ICarvable { - public static int renderId; + public static int renderId; - public CarvableHelper carverHelper; + public CarvableHelper carverHelper; - public BlockCarvableBeacon() { - super(); - setCreativeTab(ChiselTabs.tabOtherChiselBlocks); - setLightLevel(5.0F); - setBlockTextureName("beacon"); - carverHelper = new CarvableHelper(this); - } + public BlockCarvableBeacon() { + super(); + setCreativeTab(ChiselTabs.tabOtherChiselBlocks); + setLightLevel(5.0F); + setBlockTextureName("beacon"); + carverHelper = new CarvableHelper(this); + } - @Override - public TileEntity createNewTileEntity(World world, int meta) { - return new TileEntityCarvableBeacon(); - } + @Override + public TileEntity createNewTileEntity(World world, int meta) { + return new TileEntityCarvableBeacon(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par5, float hitX, float hitY, float hitZ) { - if (world.isRemote) { - return true; - } else { - TileEntityCarvableBeacon tileentitybeacon = (TileEntityCarvableBeacon) world.getTileEntity(x, y, z); + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par5, float hitX, + float hitY, float hitZ) { + if (world.isRemote) { + return true; + } else { + TileEntityCarvableBeacon tileentitybeacon = (TileEntityCarvableBeacon) world.getTileEntity(x, y, z); - if (tileentitybeacon != null) { - player.func_146104_a(tileentitybeacon); - } + if (tileentitybeacon != null) { + player.func_146104_a(tileentitybeacon); + } - return true; - } - } + return true; + } + } - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public void getSubBlocks(Item item, CreativeTabs p_149666_2_, List list) { - for (int i = 0; i < 16; i++) { - list.add(new ItemStack(item, 1, i)); - } - } + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public void getSubBlocks(Item item, CreativeTabs p_149666_2_, List list) { + for (int i = 0; i < 16; i++) { + list.add(new ItemStack(item, 1, i)); + } + } - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - return new ItemStack(ChiselBlocks.beacon, 1, world.getBlockMetadata(x, y, z)); - } - - @Override - public int damageDropped(int meta) { - return meta; - } + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { + return new ItemStack(ChiselBlocks.beacon, 1, world.getBlockMetadata(x, y, z)); + } - @Override - public int getRenderType() { - return renderId; - } + @Override + public int damageDropped(int meta) { + return meta; + } - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) { - super.onBlockPlacedBy(world, x, y, z, player, stack); + @Override + public int getRenderType() { + return renderId; + } - if (stack.hasDisplayName()) { - ((TileEntityCarvableBeacon) world.getTileEntity(x, y, z)).func_145999_a(stack.getDisplayName()); - } - } + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) { + super.onBlockPlacedBy(world, x, y, z, player, stack); - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + if (stack.hasDisplayName()) { + ((TileEntityCarvableBeacon) world.getTileEntity(x, y, z)).func_145999_a(stack.getDisplayName()); + } + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } + + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableBookshelf.java b/src/main/java/team/chisel/block/BlockCarvableBookshelf.java index 0d940f7d..4f1095c2 100644 --- a/src/main/java/team/chisel/block/BlockCarvableBookshelf.java +++ b/src/main/java/team/chisel/block/BlockCarvableBookshelf.java @@ -9,53 +9,52 @@ import net.minecraft.item.Item; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockCarvableBookshelf extends BlockCarvable { - public BlockCarvableBookshelf() { - super(Material.wood); - setHarvestLevel("axe", 0); - } + public BlockCarvableBookshelf() { + super(Material.wood); + setHarvestLevel("axe", 0); + } - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int metadata) { - if (side < 2) - return Blocks.planks.getBlockTextureFromSide(side); - return super.getIcon(side, metadata); - } + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) { + if (side < 2) return Blocks.planks.getBlockTextureFromSide(side); + return super.getIcon(side, metadata); + } - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - if (side < 2) - return Blocks.planks.getBlockTextureFromSide(side); - return super.getIcon(world, x, y, z, side); - } + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + if (side < 2) return Blocks.planks.getBlockTextureFromSide(side); + return super.getIcon(world, x, y, z, side); + } - @Override - public int quantityDropped(Random random) { - return 3; - } + @Override + public int quantityDropped(Random random) { + return 3; + } - @Override - public Item getItemDropped(int ammount, Random random, int meta) { - return Items.book; - } + @Override + public Item getItemDropped(int ammount, Random random, int meta) { + return Items.book; + } - @Override - public int damageDropped(int damage) { - return 0; - } + @Override + public int damageDropped(int damage) { + return 0; + } - @Override - public int getDamageValue(World world, int x, int y, int z) { - return world.getBlockMetadata(x, y, z); - } + @Override + public int getDamageValue(World world, int x, int y, int z) { + return world.getBlockMetadata(x, y, z); + } - @Override - public float getEnchantPowerBonus(World world, int x, int y, int z) { - return 1; - } + @Override + public float getEnchantPowerBonus(World world, int x, int y, int z) { + return 1; + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableCarpet.java b/src/main/java/team/chisel/block/BlockCarvableCarpet.java index 1700e870..3d0af41e 100644 --- a/src/main/java/team/chisel/block/BlockCarvableCarpet.java +++ b/src/main/java/team/chisel/block/BlockCarvableCarpet.java @@ -2,11 +2,6 @@ package team.chisel.block; import java.util.List; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.CarvableHelper; -import com.cricketcraft.chisel.api.carving.IVariationInfo; -import com.cricketcraft.chisel.api.rendering.ClientUtils; - import net.minecraft.block.BlockCarpet; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -15,52 +10,57 @@ import net.minecraft.item.Item; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.IVariationInfo; +import com.cricketcraft.chisel.api.rendering.ClientUtils; + public class BlockCarvableCarpet extends BlockCarpet implements ICarvable { - public CarvableHelper carverHelper; + public CarvableHelper carverHelper; - public BlockCarvableCarpet(Material m) { - carverHelper = new CarvableHelper(this); - } + public BlockCarvableCarpet(Material m) { + carverHelper = new CarvableHelper(this); + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - return carverHelper.getIcon(world, x, y, z, side); - } + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return carverHelper.getIcon(world, x, y, z, side); + } - @Override - public int damageDropped(int i) { - return i; - } + @Override + public int damageDropped(int i) { + return i; + } - @Override - public void registerBlockIcons(IIconRegister register) { - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public void registerBlockIcons(IIconRegister register) { + carverHelper.registerBlockIcons("Chisel", this, register); + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item item, CreativeTabs tabs, List list) { - carverHelper.registerSubBlocks(this, tabs, list); - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - public int getRenderType() { - return ClientUtils.renderCTMId; - } + @Override + public int getRenderType() { + return ClientUtils.renderCTMId; + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableColor.java b/src/main/java/team/chisel/block/BlockCarvableColor.java index 1d63b8c1..1cc4d111 100644 --- a/src/main/java/team/chisel/block/BlockCarvableColor.java +++ b/src/main/java/team/chisel/block/BlockCarvableColor.java @@ -6,21 +6,21 @@ import net.minecraftforge.common.util.ForgeDirection; public class BlockCarvableColor extends BlockCarvable { - public BlockCarvableColor() { - this(Material.rock); - } + public BlockCarvableColor() { + this(Material.rock); + } - public BlockCarvableColor(Material m) { - super(m); - } + public BlockCarvableColor(Material m) { + super(m); + } - @Override - public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int color) { - int newColor = 15 - color; - if (world.getBlockMetadata(x, y, z) != newColor) { - world.setBlockMetadataWithNotify(x, y, z, newColor, 3); - return true; - } - return false; - } + @Override + public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int color) { + int newColor = 15 - color; + if (world.getBlockMetadata(x, y, z) != newColor) { + world.setBlockMetadataWithNotify(x, y, z, newColor, 3); + return true; + } + return false; + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableGlass.java b/src/main/java/team/chisel/block/BlockCarvableGlass.java index 6f1c34c7..253fb9ef 100644 --- a/src/main/java/team/chisel/block/BlockCarvableGlass.java +++ b/src/main/java/team/chisel/block/BlockCarvableGlass.java @@ -11,6 +11,7 @@ import net.minecraft.item.Item; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; + import team.chisel.ctmlib.CTM; import com.cricketcraft.chisel.api.ChiselTabs; @@ -24,84 +25,84 @@ import cpw.mods.fml.relauncher.SideOnly; public class BlockCarvableGlass extends BlockGlass implements ICarvable { - public CarvableHelper carverHelper; - private boolean isAlpha = false; - private CTM ctm = CTM.getInstance(); + public CarvableHelper carverHelper; + private boolean isAlpha = false; + private CTM ctm = CTM.getInstance(); - public BlockCarvableGlass() { - super(Material.glass, false); + public BlockCarvableGlass() { + super(Material.glass, false); - carverHelper = new CarvableHelper(this); - setCreativeTab(ChiselTabs.tabOtherChiselBlocks); - } + carverHelper = new CarvableHelper(this); + setCreativeTab(ChiselTabs.tabOtherChiselBlocks); + } - public BlockCarvableGlass setStained(boolean a) { - this.isAlpha = a; - return this; - } + public BlockCarvableGlass setStained(boolean a) { + this.isAlpha = a; + return this; + } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - public boolean isNormalCube() { - return true; - } + @Override + public boolean isNormalCube() { + return true; + } - @Override - public int getRenderType() { - return ClientUtils.renderCTMId; - } + @Override + public int getRenderType() { + return ClientUtils.renderCTMId; + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - } - - @Override - public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { - ForgeDirection face = ForgeDirection.getOrientation(side).getOpposite(); - int meX = x + face.offsetX; - int meY = y + face.offsetY; - int meZ = z + face.offsetZ; - Block block = world.getBlock(meX, meY, meZ); - int meta = world.getBlockMetadata(meX, meY, meZ); - Block otherBlock = ctm.getBlockOrFacade(world, x, y, z, face.ordinal()); - int otherMeta = ctm.getBlockOrFacadeMetadata(world, x, y, z, face.ordinal()); - return block != otherBlock || meta != otherMeta; - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public int damageDropped(int i) { - return i; - } + @Override + public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { + ForgeDirection face = ForgeDirection.getOrientation(side).getOpposite(); + int meX = x + face.offsetX; + int meY = y + face.offsetY; + int meZ = z + face.offsetZ; + Block block = world.getBlock(meX, meY, meZ); + int meta = world.getBlockMetadata(meX, meY, meZ); + Block otherBlock = ctm.getBlockOrFacade(world, x, y, z, face.ordinal()); + int otherMeta = ctm.getBlockOrFacadeMetadata(world, x, y, z, face.ordinal()); + return block != otherBlock || meta != otherMeta; + } - @Override - public void registerBlockIcons(IIconRegister register) { - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public int damageDropped(int i) { + return i; + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item item, CreativeTabs tabs, List list) { - carverHelper.registerSubBlocks(this, tabs, list); - } + @Override + public void registerBlockIcons(IIconRegister register) { + carverHelper.registerBlockIcons("Chisel", this, register); + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return isAlpha ? 1 : 0; - } + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return isAlpha ? 1 : 0; + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableGlow.java b/src/main/java/team/chisel/block/BlockCarvableGlow.java index e1cead80..e6c3e0f9 100644 --- a/src/main/java/team/chisel/block/BlockCarvableGlow.java +++ b/src/main/java/team/chisel/block/BlockCarvableGlow.java @@ -1,58 +1,59 @@ package team.chisel.block; -import team.chisel.Chisel; -import team.chisel.client.render.SubmapManagerBase; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; + +import team.chisel.Chisel; +import team.chisel.client.render.SubmapManagerBase; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockCarvableGlow extends BlockCarvableColor { - @SideOnly(Side.CLIENT) - private IIcon glowTexture; + @SideOnly(Side.CLIENT) + private IIcon glowTexture; - private SubmapManagerBase submapManagerBase; - private String glowTexturePath; + private SubmapManagerBase submapManagerBase; + private String glowTexturePath; - public BlockCarvableGlow(String glowTexture) { - super(); - setLightLevel(0.5f); - this.glowTexturePath = glowTexture; - } + public BlockCarvableGlow(String glowTexture) { + super(); + setLightLevel(0.5f); + this.glowTexturePath = glowTexture; + } - public BlockCarvableGlow(Material mat, String glowTexture) { - super(mat); - this.glowTexturePath = glowTexture; - } + public BlockCarvableGlow(Material mat, String glowTexture) { + super(mat); + this.glowTexturePath = glowTexture; + } - public BlockCarvableGlow(Material material, String glowTexture, SubmapManagerBase submapManagerBase) { - super(material); - this.glowTexturePath = glowTexture; - this.submapManagerBase = submapManagerBase; - } + public BlockCarvableGlow(Material material, String glowTexture, SubmapManagerBase submapManagerBase) { + super(material); + this.glowTexturePath = glowTexture; + this.submapManagerBase = submapManagerBase; + } - @Override - public void registerBlockIcons(IIconRegister register) { - super.registerBlockIcons(register); - glowTexture = register.registerIcon(Chisel.MOD_ID + ":" + glowTexturePath); - } + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); + glowTexture = register.registerIcon(Chisel.MOD_ID + ":" + glowTexturePath); + } - public boolean hasSubmapManager() { - return submapManagerBase == null; - } + public boolean hasSubmapManager() { + return submapManagerBase == null; + } - public SubmapManagerBase getSubmapManager() { - return hasSubmapManager() ? submapManagerBase : null; - } + public SubmapManagerBase getSubmapManager() { + return hasSubmapManager() ? submapManagerBase : null; + } - public IIcon getGlowTexture() { - return glowTexture; - } + public IIcon getGlowTexture() { + return glowTexture; + } - @Override - public int getRenderType() { - return Chisel.renderGlowId; - } + @Override + public int getRenderType() { + return Chisel.renderGlowId; + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableGlowstone.java b/src/main/java/team/chisel/block/BlockCarvableGlowstone.java index 731e6047..665c9cfe 100644 --- a/src/main/java/team/chisel/block/BlockCarvableGlowstone.java +++ b/src/main/java/team/chisel/block/BlockCarvableGlowstone.java @@ -14,29 +14,29 @@ import net.minecraft.world.World; public class BlockCarvableGlowstone extends BlockCarvable { - public BlockCarvableGlowstone() { - super(Material.glass); - } + public BlockCarvableGlowstone() { + super(Material.glass); + } - @Override - public int quantityDropped(Random random) { - return Blocks.glowstone.quantityDropped(random); - } + @Override + public int quantityDropped(Random random) { + return Blocks.glowstone.quantityDropped(random); + } - @Override - public Item getItemDropped(int i, Random random, int a) { - return Items.glowstone_dust; - } + @Override + public Item getItemDropped(int i, Random random, int a) { + return Items.glowstone_dust; + } - @Override - public int damageDropped(int i) { - return 0; - } + @Override + public int damageDropped(int i) { + return 0; + } - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) { - Block glowstone = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - return new ItemStack(Item.getItemFromBlock(glowstone), 1, meta); - } + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) { + Block glowstone = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + return new ItemStack(Item.getItemFromBlock(glowstone), 1, meta); + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableIce.java b/src/main/java/team/chisel/block/BlockCarvableIce.java index 6986d082..64a42f9a 100644 --- a/src/main/java/team/chisel/block/BlockCarvableIce.java +++ b/src/main/java/team/chisel/block/BlockCarvableIce.java @@ -2,11 +2,6 @@ package team.chisel.block; import java.util.List; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.CarvableHelper; -import com.cricketcraft.chisel.api.carving.IVariationInfo; -import com.cricketcraft.chisel.api.rendering.ClientUtils; - import net.minecraft.block.Block; import net.minecraft.block.BlockIce; import net.minecraft.client.renderer.texture.IIconRegister; @@ -18,58 +13,63 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.IVariationInfo; +import com.cricketcraft.chisel.api.rendering.ClientUtils; + public class BlockCarvableIce extends BlockIce implements ICarvable { - public CarvableHelper carverHelper; + public CarvableHelper carverHelper; - public BlockCarvableIce() { - super(); - carverHelper = new CarvableHelper(this); - } + public BlockCarvableIce() { + super(); + carverHelper = new CarvableHelper(this); + } - @Override - public int getRenderType() { - return ClientUtils.renderCTMId; - } + @Override + public int getRenderType() { + return ClientUtils.renderCTMId; + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public void registerBlockIcons(IIconRegister register) { - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public void registerBlockIcons(IIconRegister register) { + carverHelper.registerBlockIcons("Chisel", this, register); + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item item, CreativeTabs tabs, List list) { - carverHelper.registerSubBlocks(this, tabs, list); - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { - super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + @Override + public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { + super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); - par2EntityPlayer.addExhaustion(0.025F); + par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + par2EntityPlayer.addExhaustion(0.025F); - /* - * if(this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) { ItemStack itemstack = - * this.createStackedBlock(par6); - * - * if(itemstack != null) { this.dropBlockAsItem(par1World, par3, par4, par5, itemstack); } } - */ - } + /* + * if(this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && + * EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) { ItemStack itemstack = + * this.createStackedBlock(par6); if(itemstack != null) { this.dropBlockAsItem(par1World, par3, par4, par5, + * itemstack); } } + */ + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableIceStairs.java b/src/main/java/team/chisel/block/BlockCarvableIceStairs.java index cc2cf87d..2920ec4d 100644 --- a/src/main/java/team/chisel/block/BlockCarvableIceStairs.java +++ b/src/main/java/team/chisel/block/BlockCarvableIceStairs.java @@ -2,44 +2,45 @@ package team.chisel.block; import java.util.Random; -import com.cricketcraft.chisel.api.carving.CarvableHelper; - -import team.chisel.init.ChiselBlocks; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; +import team.chisel.init.ChiselBlocks; + +import com.cricketcraft.chisel.api.carving.CarvableHelper; + public class BlockCarvableIceStairs extends BlockCarvableStairs { - public BlockCarvableIceStairs(Block block, int meta, CarvableHelper helper) { - super(block, meta, helper); + public BlockCarvableIceStairs(Block block, int meta, CarvableHelper helper) { + super(block, meta, helper); - slipperiness = 0.98F; - setTickRandomly(true); - } + slipperiness = 0.98F; + setTickRandomly(true); + } - @Override - public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { - ChiselBlocks.ice.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - } + @Override + public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { + ChiselBlocks.ice.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + } - @Override - public int quantityDropped(Random par1Random) { - return ChiselBlocks.ice.quantityDropped(par1Random); - } + @Override + public int quantityDropped(Random par1Random) { + return ChiselBlocks.ice.quantityDropped(par1Random); + } - @Override - public int damageDropped(int i) { - return 0; - } + @Override + public int damageDropped(int i) { + return 0; + } - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - ChiselBlocks.ice.updateTick(par1World, par2, par3, par4, par5Random); - } + @Override + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { + ChiselBlocks.ice.updateTick(par1World, par2, par3, par4, par5Random); + } - @Override - public int getMobilityFlag() { - return 0; - } + @Override + public int getMobilityFlag() { + return 0; + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableLamp.java b/src/main/java/team/chisel/block/BlockCarvableLamp.java index 806e5283..6890b642 100644 --- a/src/main/java/team/chisel/block/BlockCarvableLamp.java +++ b/src/main/java/team/chisel/block/BlockCarvableLamp.java @@ -11,71 +11,70 @@ import net.minecraft.world.World; public class BlockCarvableLamp extends BlockCarvable { - BlockCarvableLamp blockUnpowered; - BlockCarvableLamp blockPowered; - boolean powered; + BlockCarvableLamp blockUnpowered; + BlockCarvableLamp blockPowered; + boolean powered; - public BlockCarvableLamp() { - super(Material.redstoneLight); + public BlockCarvableLamp() { + super(Material.redstoneLight); - powered = false; - blockUnpowered = this; - blockPowered = new BlockCarvableLamp(this); + powered = false; + blockUnpowered = this; + blockPowered = new BlockCarvableLamp(this); - setHardness(0.3F); - } + setHardness(0.3F); + } - public BlockCarvableLamp(BlockCarvableLamp unpoweredVersion) { - super(Material.redstoneLight); + public BlockCarvableLamp(BlockCarvableLamp unpoweredVersion) { + super(Material.redstoneLight); - carverHelper = unpoweredVersion.carverHelper; + carverHelper = unpoweredVersion.carverHelper; - powered = true; - blockUnpowered = unpoweredVersion; - blockPowered = this; + powered = true; + blockUnpowered = unpoweredVersion; + blockPowered = this; - setLightLevel(1.0F); - setHardness(0.3F); - } + setLightLevel(1.0F); + setHardness(0.3F); + } - public void checkPower(World world, int x, int y, int z) { - if (world.isRemote) - return; + public void checkPower(World world, int x, int y, int z) { + if (world.isRemote) return; - boolean isGettingPower = world.isBlockIndirectlyGettingPowered(x, y, z); - int meta = world.getBlockMetadata(x, y, z); + boolean isGettingPower = world.isBlockIndirectlyGettingPowered(x, y, z); + int meta = world.getBlockMetadata(x, y, z); - if (powered && !isGettingPower) { - world.setBlock(x, y, z, blockUnpowered, meta, 2); - } else if (!powered && isGettingPower) { - world.setBlock(x, y, z, blockPowered, meta, 2); - } - } + if (powered && !isGettingPower) { + world.setBlock(x, y, z, blockUnpowered, meta, 2); + } else if (!powered && isGettingPower) { + world.setBlock(x, y, z, blockPowered, meta, 2); + } + } - @Override - public void onBlockAdded(World world, int x, int y, int z) { - checkPower(world, x, y, z); - } + @Override + public void onBlockAdded(World world, int x, int y, int z) { + checkPower(world, x, y, z); + } - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - checkPower(world, x, y, z); - } + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { + checkPower(world, x, y, z); + } - /* - * @Override public void updateTick(World world, int x, int y, int z, Random rand){ if (world.isRemote) return; - * - * if(powered && !world.isBlockIndirectlyGettingPowered(x, y, z)){ int meta=world.getBlockMetadata(x, y, z); world.setBlock(x, y, z, Block.redstoneLampIdle.blockID, meta, 2); } } - */ + /* + * @Override public void updateTick(World world, int x, int y, int z, Random rand){ if (world.isRemote) return; + * if(powered && !world.isBlockIndirectlyGettingPowered(x, y, z)){ int meta=world.getBlockMetadata(x, y, z); + * world.setBlock(x, y, z, Block.redstoneLampIdle.blockID, meta, 2); } } + */ - @Override - public Item getItemDropped(int par1, Random par2Random, int par3) { - return Item.getItemFromBlock(blockUnpowered); - } + @Override + public Item getItemDropped(int par1, Random par2Random, int par3) { + return Item.getItemFromBlock(blockUnpowered); + } - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - return new ItemStack(blockUnpowered, 1, world.getBlockMetadata(x, y, z)); - } + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { + return new ItemStack(blockUnpowered, 1, world.getBlockMetadata(x, y, z)); + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableLayered.java b/src/main/java/team/chisel/block/BlockCarvableLayered.java index 02889ac7..b070524e 100644 --- a/src/main/java/team/chisel/block/BlockCarvableLayered.java +++ b/src/main/java/team/chisel/block/BlockCarvableLayered.java @@ -1,35 +1,36 @@ package team.chisel.block; -import team.chisel.Chisel; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; + +import team.chisel.Chisel; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockCarvableLayered extends BlockCarvable { - @SideOnly(Side.CLIENT) - private IIcon baseTexture; - private String baseTexLocation; + @SideOnly(Side.CLIENT) + private IIcon baseTexture; + private String baseTexLocation; - public BlockCarvableLayered(Material mat, String baseTexLocation) { - super(mat); - this.baseTexLocation = baseTexLocation; - } + public BlockCarvableLayered(Material mat, String baseTexLocation) { + super(mat); + this.baseTexLocation = baseTexLocation; + } - @Override - public void registerBlockIcons(IIconRegister register) { - super.registerBlockIcons(register); - baseTexture = register.registerIcon(Chisel.MOD_ID + ":" + baseTexLocation); - } + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); + baseTexture = register.registerIcon(Chisel.MOD_ID + ":" + baseTexLocation); + } - public IIcon getBaseTex() { - return baseTexture; - } + public IIcon getBaseTex() { + return baseTexture; + } - @Override - public int getRenderType() { - return Chisel.renderLayeredId; - } + @Override + public int getRenderType() { + return Chisel.renderLayeredId; + } } diff --git a/src/main/java/team/chisel/block/BlockCarvablePackedIce.java b/src/main/java/team/chisel/block/BlockCarvablePackedIce.java index 22c97afe..08448faf 100644 --- a/src/main/java/team/chisel/block/BlockCarvablePackedIce.java +++ b/src/main/java/team/chisel/block/BlockCarvablePackedIce.java @@ -3,11 +3,6 @@ package team.chisel.block; import java.util.List; import java.util.Random; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.CarvableHelper; -import com.cricketcraft.chisel.api.carving.IVariationInfo; -import com.cricketcraft.chisel.api.rendering.ClientUtils; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -20,64 +15,69 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.IVariationInfo; +import com.cricketcraft.chisel.api.rendering.ClientUtils; + public class BlockCarvablePackedIce extends Block implements ICarvable { - public CarvableHelper carverHelper; + public CarvableHelper carverHelper; - public BlockCarvablePackedIce() { - super(Material.ice); - carverHelper = new CarvableHelper(this); - this.slipperiness = Blocks.packed_ice.slipperiness; - } + public BlockCarvablePackedIce() { + super(Material.ice); + carverHelper = new CarvableHelper(this); + this.slipperiness = Blocks.packed_ice.slipperiness; + } - @Override - public int getRenderType() { - return ClientUtils.renderCTMId; - } + @Override + public int getRenderType() { + return ClientUtils.renderCTMId; + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public int quantityDropped(int meta, int fortune, Random random) { - return 0; - } + @Override + public int quantityDropped(int meta, int fortune, Random random) { + return 0; + } - @Override - public void registerBlockIcons(IIconRegister register) { - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public void registerBlockIcons(IIconRegister register) { + carverHelper.registerBlockIcons("Chisel", this, register); + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item item, CreativeTabs tabs, List list) { - carverHelper.registerSubBlocks(this, tabs, list); - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { - super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + @Override + public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { + super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); - par2EntityPlayer.addExhaustion(0.025F); + par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + par2EntityPlayer.addExhaustion(0.025F); - /* - * if(this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) { ItemStack itemstack = - * this.createStackedBlock(par6); - * - * if(itemstack != null) { this.dropBlockAsItem(par1World, par3, par4, par5, itemstack); } } - */ - } + /* + * if(this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && + * EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) { ItemStack itemstack = + * this.createStackedBlock(par6); if(itemstack != null) { this.dropBlockAsItem(par1World, par3, par4, par5, + * itemstack); } } + */ + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } } diff --git a/src/main/java/team/chisel/block/BlockCarvablePackedIceStairs.java b/src/main/java/team/chisel/block/BlockCarvablePackedIceStairs.java index 794cb619..4768662d 100644 --- a/src/main/java/team/chisel/block/BlockCarvablePackedIceStairs.java +++ b/src/main/java/team/chisel/block/BlockCarvablePackedIceStairs.java @@ -2,44 +2,45 @@ package team.chisel.block; import java.util.Random; -import com.cricketcraft.chisel.api.carving.CarvableHelper; - -import team.chisel.init.ChiselBlocks; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; +import team.chisel.init.ChiselBlocks; + +import com.cricketcraft.chisel.api.carving.CarvableHelper; + public class BlockCarvablePackedIceStairs extends BlockCarvableStairs { - public BlockCarvablePackedIceStairs(Block block, int meta, CarvableHelper helper) { - super(block, meta, helper); + public BlockCarvablePackedIceStairs(Block block, int meta, CarvableHelper helper) { + super(block, meta, helper); - slipperiness = 0.98F; - setTickRandomly(true); - } + slipperiness = 0.98F; + setTickRandomly(true); + } - @Override - public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { - ChiselBlocks.packedice.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - } + @Override + public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { + ChiselBlocks.packedice.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + } - @Override - public int quantityDropped(Random par1Random) { - return ChiselBlocks.packedice.quantityDropped(par1Random); - } + @Override + public int quantityDropped(Random par1Random) { + return ChiselBlocks.packedice.quantityDropped(par1Random); + } - @Override - public int damageDropped(int i) { - return 0; - } + @Override + public int damageDropped(int i) { + return 0; + } - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - ChiselBlocks.packedice.updateTick(par1World, par2, par3, par4, par5Random); - } + @Override + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { + ChiselBlocks.packedice.updateTick(par1World, par2, par3, par4, par5Random); + } - @Override - public int getMobilityFlag() { - return 0; - } + @Override + public int getMobilityFlag() { + return 0; + } } diff --git a/src/main/java/team/chisel/block/BlockCarvablePane.java b/src/main/java/team/chisel/block/BlockCarvablePane.java index 2494d3fa..ea8b5e20 100644 --- a/src/main/java/team/chisel/block/BlockCarvablePane.java +++ b/src/main/java/team/chisel/block/BlockCarvablePane.java @@ -2,12 +2,6 @@ package team.chisel.block; import java.util.List; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.CarvableHelper; -import com.cricketcraft.chisel.api.carving.IVariationInfo; - -import team.chisel.client.render.RendererCTMPane; -import com.cricketcraft.chisel.api.ChiselTabs; import net.minecraft.block.BlockPane; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -15,66 +9,74 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; + +import team.chisel.client.render.RendererCTMPane; + +import com.cricketcraft.chisel.api.ChiselTabs; +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.IVariationInfo; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockCarvablePane extends BlockPane implements ICarvable { - public CarvableHelper carverHelper; - public boolean isAlpha; + public CarvableHelper carverHelper; + public boolean isAlpha; - public BlockCarvablePane(Material material, boolean drops) { - super("", "", material, drops); + public BlockCarvablePane(Material material, boolean drops) { + super("", "", material, drops); - carverHelper = new CarvableHelper(this); + carverHelper = new CarvableHelper(this); - setCreativeTab(ChiselTabs.tabOtherChiselBlocks); - } + setCreativeTab(ChiselTabs.tabOtherChiselBlocks); + } - public BlockCarvablePane setStained(boolean a) { - this.isAlpha = a; - return this; - } + public BlockCarvablePane setStained(boolean a) { + this.isAlpha = a; + return this; + } - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return isAlpha ? 1 : 0; - } + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return isAlpha ? 1 : 0; + } - @Override - public int getRenderType() { - return RendererCTMPane.id; - } + @Override + public int getRenderType() { + return RendererCTMPane.id; + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public int damageDropped(int i) { - return i; - } + @Override + public int damageDropped(int i) { + return i; + } - @Override - public void registerBlockIcons(IIconRegister register) { - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public void registerBlockIcons(IIconRegister register) { + carverHelper.registerBlockIcons("Chisel", this, register); + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item item, CreativeTabs tabs, List list) { - carverHelper.registerSubBlocks(this, tabs, list); - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } } diff --git a/src/main/java/team/chisel/block/BlockCarvablePowered.java b/src/main/java/team/chisel/block/BlockCarvablePowered.java index b6f7fa43..417886ce 100644 --- a/src/main/java/team/chisel/block/BlockCarvablePowered.java +++ b/src/main/java/team/chisel/block/BlockCarvablePowered.java @@ -5,25 +5,26 @@ import net.minecraft.world.IBlockAccess; public class BlockCarvablePowered extends BlockCarvable { - public BlockCarvablePowered(Material m) { - super(m); - } + public BlockCarvablePowered(Material m) { + super(m); + } - /** - * Can this block provide power. Only wire currently seems to have this change based on its state. - */ - @Override - public boolean canProvidePower() { - return true; - } + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + @Override + public boolean canProvidePower() { + return true; + } - /** - * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube returns true, standard redstone propagation rules will apply instead and this will - * not be called. Args: World, X, Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. - */ - @Override - public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return 15; - } + /** + * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube + * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, + * Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. + */ + @Override + public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return 15; + } } diff --git a/src/main/java/team/chisel/block/BlockCarvablePumpkin.java b/src/main/java/team/chisel/block/BlockCarvablePumpkin.java index 5af4e17b..7f832fda 100644 --- a/src/main/java/team/chisel/block/BlockCarvablePumpkin.java +++ b/src/main/java/team/chisel/block/BlockCarvablePumpkin.java @@ -1,11 +1,5 @@ package team.chisel.block; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.CarvableHelper; -import com.cricketcraft.chisel.api.carving.IVariationInfo; - -import team.chisel.Chisel; -import team.chisel.entity.EntityChiselSnowman; import net.minecraft.block.Block; import net.minecraft.block.BlockPumpkin; import net.minecraft.client.renderer.texture.IIconRegister; @@ -15,111 +9,132 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + +import team.chisel.Chisel; +import team.chisel.entity.EntityChiselSnowman; + +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.IVariationInfo; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable { - public CarvableHelper carverHelper; + public CarvableHelper carverHelper; - @SideOnly(Side.CLIENT) - private IIcon top, face; + @SideOnly(Side.CLIENT) + private IIcon top, face; - private String faceLocation; + private String faceLocation; - public BlockCarvablePumpkin(boolean isOn) { - super(isOn); - this.setStepSound(Block.soundTypeWood); - if (isOn) - setLightLevel(10.0F); - carverHelper = new CarvableHelper(this); - } + public BlockCarvablePumpkin(boolean isOn) { + super(isOn); + this.setStepSound(Block.soundTypeWood); + if (isOn) setLightLevel(10.0F); + carverHelper = new CarvableHelper(this); + } - @Override - public void onBlockAdded(World world, int x, int y, int z) { - if (world.getBlock(x, y - 1, z) == Blocks.snow && world.getBlock(x, y - 2, z) == Blocks.snow) { - if (!world.isRemote) { - // Let's grab the pumpkin before we start - ItemStack pumpkin = new ItemStack(world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); + @Override + public void onBlockAdded(World world, int x, int y, int z) { + if (world.getBlock(x, y - 1, z) == Blocks.snow && world.getBlock(x, y - 2, z) == Blocks.snow) { + if (!world.isRemote) { + // Let's grab the pumpkin before we start + ItemStack pumpkin = new ItemStack(world.getBlock(x, y, z), world.getBlockMetadata(x, y, z)); - world.setBlock(x, y, z, Blocks.air, 0, 2); - world.setBlock(x, y - 1, z, Blocks.air, 0, 2); - world.setBlock(x, y - 2, z, Blocks.air, 0, 2); - EntityChiselSnowman snowman = new EntityChiselSnowman(world); - snowman.setCurrentItemOrArmor(2, pumpkin); - snowman.setLocationAndAngles(x + 0.5D, y - 1.95D, z + 0.5D, 0.0F, 0.0F); - world.spawnEntityInWorld(snowman); - world.notifyBlockChange(x, y, z, Blocks.air); - world.notifyBlockChange(x, y - 1, z, Blocks.air); - world.notifyBlockChange(x, y - 2, z, Blocks.air); - } + world.setBlock(x, y, z, Blocks.air, 0, 2); + world.setBlock(x, y - 1, z, Blocks.air, 0, 2); + world.setBlock(x, y - 2, z, Blocks.air, 0, 2); + EntityChiselSnowman snowman = new EntityChiselSnowman(world); + snowman.setCurrentItemOrArmor(2, pumpkin); + snowman.setLocationAndAngles(x + 0.5D, y - 1.95D, z + 0.5D, 0.0F, 0.0F); + world.spawnEntityInWorld(snowman); + world.notifyBlockChange(x, y, z, Blocks.air); + world.notifyBlockChange(x, y - 1, z, Blocks.air); + world.notifyBlockChange(x, y - 2, z, Blocks.air); + } - // Spawn some lovely particles - for (int c = 0; c < 120; ++c) { - world.spawnParticle("snowshovel", x + world.rand.nextDouble(), y - 2 + world.rand.nextDouble() * 2.5D, z + world.rand.nextDouble(), 0.0D, 0.0D, 0.0D); - } - } else if (world.getBlock(x, y - 1, z) == Blocks.iron_block || world.getBlock(x, y - 2, z) == Blocks.iron_block) { - boolean flag = world.getBlock(x - 1, y - 1, z) == Blocks.iron_block && world.getBlock(x + 1, y - 1, z) == Blocks.iron_block; - boolean flag1 = world.getBlock(x, y - 1, z - 1) == Blocks.iron_block && world.getBlock(x, y - 1, z + 1) == Blocks.iron_block; + // Spawn some lovely particles + for (int c = 0; c < 120; ++c) { + world.spawnParticle( + "snowshovel", + x + world.rand.nextDouble(), + y - 2 + world.rand.nextDouble() * 2.5D, + z + world.rand.nextDouble(), + 0.0D, + 0.0D, + 0.0D); + } + } else + if (world.getBlock(x, y - 1, z) == Blocks.iron_block || world.getBlock(x, y - 2, z) == Blocks.iron_block) { + boolean flag = world.getBlock(x - 1, y - 1, z) == Blocks.iron_block + && world.getBlock(x + 1, y - 1, z) == Blocks.iron_block; + boolean flag1 = world.getBlock(x, y - 1, z - 1) == Blocks.iron_block + && world.getBlock(x, y - 1, z + 1) == Blocks.iron_block; - if (flag || flag1) { - world.setBlock(x, y, z, Blocks.air, 0, 2); - world.setBlock(x, y - 1, z, Blocks.air, 0, 2); - world.setBlock(x, y - 2, z, Blocks.air, 0, 2); + if (flag || flag1) { + world.setBlock(x, y, z, Blocks.air, 0, 2); + world.setBlock(x, y - 1, z, Blocks.air, 0, 2); + world.setBlock(x, y - 2, z, Blocks.air, 0, 2); - if (flag) { - world.setBlock(x - 1, y - 1, z, Blocks.air, 0, 2); - world.setBlock(x + 1, y - 1, z, Blocks.air, 0, 2); - } else { - world.setBlock(x, y - 1, z - 1, Blocks.air, 0, 2); - world.setBlock(x, y - 1, z + 1, Blocks.air, 0, 2); - } + if (flag) { + world.setBlock(x - 1, y - 1, z, Blocks.air, 0, 2); + world.setBlock(x + 1, y - 1, z, Blocks.air, 0, 2); + } else { + world.setBlock(x, y - 1, z - 1, Blocks.air, 0, 2); + world.setBlock(x, y - 1, z + 1, Blocks.air, 0, 2); + } - EntityIronGolem ironGolem = new EntityIronGolem(world); - ironGolem.setPlayerCreated(true); - ironGolem.setLocationAndAngles(x + 0.5D, y - 1.95D, z + 0.5D, 0.0F, 0.0F); - world.spawnEntityInWorld(ironGolem); + EntityIronGolem ironGolem = new EntityIronGolem(world); + ironGolem.setPlayerCreated(true); + ironGolem.setLocationAndAngles(x + 0.5D, y - 1.95D, z + 0.5D, 0.0F, 0.0F); + world.spawnEntityInWorld(ironGolem); - world.notifyBlockChange(x, y, z, Blocks.air); - world.notifyBlockChange(x, y - 1, z, Blocks.air); - world.notifyBlockChange(x, y - 2, z, Blocks.air); + world.notifyBlockChange(x, y, z, Blocks.air); + world.notifyBlockChange(x, y - 1, z, Blocks.air); + world.notifyBlockChange(x, y - 2, z, Blocks.air); - if (flag) { - world.notifyBlockChange(x - 1, y - 1, z, Blocks.air); - world.notifyBlockChange(x + 1, y - 1, z, Blocks.air); - } else { - world.notifyBlockChange(x, y - 1, z - 1, Blocks.air); - world.notifyBlockChange(x, y - 1, z + 1, Blocks.air); - } - } - } - } + if (flag) { + world.notifyBlockChange(x - 1, y - 1, z, Blocks.air); + world.notifyBlockChange(x + 1, y - 1, z, Blocks.air); + } else { + world.notifyBlockChange(x, y - 1, z - 1, Blocks.air); + world.notifyBlockChange(x, y - 1, z + 1, Blocks.air); + } + } + } + } - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) { - return side == 1 ? top : (side == 0 ? top : (meta == 2 && side == 2 ? face : (meta == 3 && side == 5 ? face - : (meta == 0 && side == 3 ? face : (meta == 1 && side == 4 ? face : this.blockIcon))))); - } + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return side == 1 ? top + : (side == 0 ? top + : (meta == 2 && side == 2 ? face + : (meta == 3 && side == 5 ? face + : (meta == 0 && side == 3 ? face + : (meta == 1 && side == 4 ? face : this.blockIcon))))); + } - @Override - public void registerBlockIcons(IIconRegister icon) { - top = icon.registerIcon(Chisel.MOD_ID + ":pumpkin/pumpkin_top"); - face = icon.registerIcon(Chisel.MOD_ID + ":" + faceLocation); - this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":pumpkin/pumpkin_side"); - } + @Override + public void registerBlockIcons(IIconRegister icon) { + top = icon.registerIcon(Chisel.MOD_ID + ":pumpkin/pumpkin_top"); + face = icon.registerIcon(Chisel.MOD_ID + ":" + faceLocation); + this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":pumpkin/pumpkin_side"); + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } - public void setInformation(String textureLocation) { - this.faceLocation = textureLocation; - } + public void setInformation(String textureLocation) { + this.faceLocation = textureLocation; + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableSand.java b/src/main/java/team/chisel/block/BlockCarvableSand.java index 5bf33cbb..c3bebd4b 100644 --- a/src/main/java/team/chisel/block/BlockCarvableSand.java +++ b/src/main/java/team/chisel/block/BlockCarvableSand.java @@ -2,13 +2,6 @@ package team.chisel.block; import java.util.List; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.CarvableHelper; -import com.cricketcraft.chisel.api.carving.IVariationInfo; -import com.cricketcraft.chisel.api.rendering.ClientUtils; - -import team.chisel.Chisel; -import com.cricketcraft.chisel.api.ChiselTabs; import net.minecraft.block.Block; import net.minecraft.block.BlockSand; import net.minecraft.client.renderer.texture.IIconRegister; @@ -16,158 +9,154 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; + +import team.chisel.Chisel; + +import com.cricketcraft.chisel.api.ChiselTabs; +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.IVariationInfo; +import com.cricketcraft.chisel.api.rendering.ClientUtils; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockCarvableSand extends BlockSand implements ICarvable { - public CarvableHelper carverHelper; - private boolean isAlpha; + public CarvableHelper carverHelper; + private boolean isAlpha; - public BlockCarvableSand() { - super(); - carverHelper = new CarvableHelper(this); - setCreativeTab(ChiselTabs.tabOtherChiselBlocks); - } + public BlockCarvableSand() { + super(); + carverHelper = new CarvableHelper(this); + setCreativeTab(ChiselTabs.tabOtherChiselBlocks); + } - public BlockCarvableSand setStained(boolean a) { - this.isAlpha = a; - return this; - } + public BlockCarvableSand setStained(boolean a) { + this.isAlpha = a; + return this; + } - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return isAlpha ? 1 : 0; - } + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return isAlpha ? 1 : 0; + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - return carverHelper.getIcon(world, x, y, z, side); - } + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return carverHelper.getIcon(world, x, y, z, side); + } - @Override - public int damageDropped(int i) { - return i; - } + @Override + public int damageDropped(int i) { + return i; + } - @Override - public void registerBlockIcons(IIconRegister register) { - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public void registerBlockIcons(IIconRegister register) { + carverHelper.registerBlockIcons("Chisel", this, register); + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item item, CreativeTabs tabs, List list) { - carverHelper.registerSubBlocks(this, tabs, list); - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - public int getRenderType() { - return ClientUtils.renderCTMId; - } + @Override + public int getRenderType() { + return ClientUtils.renderCTMId; + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } - public static class SoundType extends Block.SoundType { + public static class SoundType extends Block.SoundType { - public final String soundNameStep; - public final String soundNameBreak; - public final String soundNamePlace; + public final String soundNameStep; + public final String soundNameBreak; + public final String soundNamePlace; - /** - * Creates a SoundType with automatic names for step and break sounds. Sound names dig.soundName and step.soundName must be specified in the sounds.json - * - * @param soundName - * block of the sound. Will automatically be expanded to "mod:dig.soundName" and "mod:step.soundName" respectively) - * @param volume - * default 1.0f - * @param frequency - * default 1.0f - */ - public SoundType(String soundName, float volume, float frequency) { - super(soundName, volume, frequency); - this.soundNameStep = null; - this.soundNameBreak = null; - this.soundNamePlace = null; - } + /** + * Creates a SoundType with automatic names for step and break sounds. Sound names dig.soundName and + * step.soundName must be specified in the sounds.json + * + * @param soundName block of the sound. Will automatically be expanded to "mod:dig.soundName" and + * "mod:step.soundName" respectively) + * @param volume default 1.0f + * @param frequency default 1.0f + */ + public SoundType(String soundName, float volume, float frequency) { + super(soundName, volume, frequency); + this.soundNameStep = null; + this.soundNameBreak = null; + this.soundNamePlace = null; + } - /** - * Creates a SoundType with manual names for step and break sounds. Sound names must be specified in the sounds.json - * - * @param soundNameBreak - * block break sound - * @param soundNameStep - * block step sound - * @param volume - * default 1.0f - * @param frequency - * default 1.0f - */ - public SoundType(String soundNameBreak, String soundNameStep, float volume, float frequency) { - super(soundNameStep, volume, frequency); - this.soundNameStep = soundNameStep; - this.soundNameBreak = soundNameBreak; - this.soundNamePlace = null; - } + /** + * Creates a SoundType with manual names for step and break sounds. Sound names must be specified in the + * sounds.json + * + * @param soundNameBreak block break sound + * @param soundNameStep block step sound + * @param volume default 1.0f + * @param frequency default 1.0f + */ + public SoundType(String soundNameBreak, String soundNameStep, float volume, float frequency) { + super(soundNameStep, volume, frequency); + this.soundNameStep = soundNameStep; + this.soundNameBreak = soundNameBreak; + this.soundNamePlace = null; + } - /** - * Creates a SoundType with manual names for step, break and place sounds. Sound names must be specified in the sounds.json - * - * @param soundNameBreak - * block break sound - * @param soundNameStep - * block step sound - * @param soundNamePlace - * block place sound - * @param volume - * default 1.0f - * @param frequency - * default 1.0f - */ - public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume, float frequency) { - super(soundNameStep, volume, frequency); - this.soundNameStep = soundNameStep; - this.soundNameBreak = soundNameBreak; - this.soundNamePlace = soundNamePlace; - } + /** + * Creates a SoundType with manual names for step, break and place sounds. Sound names must be specified in the + * sounds.json + * + * @param soundNameBreak block break sound + * @param soundNameStep block step sound + * @param soundNamePlace block place sound + * @param volume default 1.0f + * @param frequency default 1.0f + */ + public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume, + float frequency) { + super(soundNameStep, volume, frequency); + this.soundNameStep = soundNameStep; + this.soundNameBreak = soundNameBreak; + this.soundNamePlace = soundNamePlace; + } - @Override - public String getBreakSound() { - if (soundNameBreak == null) - return Chisel.MOD_ID + ":dig." + this.soundName; - else - return this.soundNameBreak; - } + @Override + public String getBreakSound() { + if (soundNameBreak == null) return Chisel.MOD_ID + ":dig." + this.soundName; + else return this.soundNameBreak; + } - @Override - public String getStepResourcePath() { - if (soundNameStep == null) - return Chisel.MOD_ID + ":step." + this.soundName; - else - return this.soundNameStep; - } + @Override + public String getStepResourcePath() { + if (soundNameStep == null) return Chisel.MOD_ID + ":step." + this.soundName; + else return this.soundNameStep; + } - @Override - public String func_150496_b() { - if (soundNamePlace == null) - return getBreakSound(); - else - return this.soundNamePlace; - } - } + @Override + public String func_150496_b() { + if (soundNamePlace == null) return getBreakSound(); + else return this.soundNamePlace; + } + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableSlab.java b/src/main/java/team/chisel/block/BlockCarvableSlab.java index 0014cea6..1105e93a 100644 --- a/src/main/java/team/chisel/block/BlockCarvableSlab.java +++ b/src/main/java/team/chisel/block/BlockCarvableSlab.java @@ -1,5 +1,7 @@ package team.chisel.block; +import static net.minecraftforge.common.util.ForgeDirection.UP; + import java.util.List; import java.util.Random; @@ -14,126 +16,121 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import static net.minecraftforge.common.util.ForgeDirection.UP; public class BlockCarvableSlab extends BlockCarvable { - public Block master; - public BlockCarvableSlab bottom; - public BlockCarvableSlab top; - public boolean isBottom; + public Block master; + public BlockCarvableSlab bottom; + public BlockCarvableSlab top; + public boolean isBottom; - public BlockCarvableSlab(BlockCarvable marble) { - opaque = true; + public BlockCarvableSlab(BlockCarvable marble) { + opaque = true; - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); - master = marble; - bottom = this; - top = new BlockCarvableSlab(this); + master = marble; + bottom = this; + top = new BlockCarvableSlab(this); - isBottom = true; - } + isBottom = true; + } - public BlockCarvableSlab(BlockCarvableSlab bottomBlock) { - super(); - setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); - master = bottomBlock.master; - bottom = bottomBlock; - top = this; + public BlockCarvableSlab(BlockCarvableSlab bottomBlock) { + super(); + setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + master = bottomBlock.master; + bottom = bottomBlock; + top = this; - carverHelper = bottomBlock.carverHelper; - isBottom = false; - } + carverHelper = bottomBlock.carverHelper; + isBottom = false; + } - @Override - public Block setBlockName(String p_149663_1_) { - if (this != top) { - top.setBlockName(p_149663_1_); - } - return super.setBlockName(p_149663_1_); - } + @Override + public Block setBlockName(String p_149663_1_) { + if (this != top) { + top.setBlockName(p_149663_1_); + } + return super.setBlockName(p_149663_1_); + } - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - if (isBottom) { - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); - } else { - setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); - } - } + @Override + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + if (isBottom) { + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } else { + setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } - @Override - public void setBlockBoundsForItemRender() { - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); - } + @Override + public void setBlockBoundsForItemRender() { + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } - @SuppressWarnings("rawtypes") - @Override - public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { - setBlockBoundsBasedOnState(par1World, par2, par3, par4); - super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } + @SuppressWarnings("rawtypes") + @Override + public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, + List par6List, Entity par7Entity) { + setBlockBoundsBasedOnState(par1World, par2, par3, par4); + super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + } - @Override - public boolean isOpaqueCube() { - return false; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public int damageDropped(int meta) { - return meta; - } + @Override + public int damageDropped(int meta) { + return meta; + } - @Override - public Item getItemDropped(int par1, Random par2Random, int par3) { - return Item.getItemFromBlock(bottom); - } + @Override + public Item getItemDropped(int par1, Random par2Random, int par3) { + return Item.getItemFromBlock(bottom); + } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - @SideOnly(Side.CLIENT) - public ItemStack getPickBlock(MovingObjectPosition mop, World world, int x, int y, int z) { - return new ItemStack(bottom, 1, world.getBlockMetadata(x, y, z)); - } + @Override + @SideOnly(Side.CLIENT) + public ItemStack getPickBlock(MovingObjectPosition mop, World world, int x, int y, int z) { + return new ItemStack(bottom, 1, world.getBlockMetadata(x, y, z)); + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - // return master.getIcon(side, metadata); - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + // return master.getIcon(side, metadata); + } - @SuppressWarnings("rawtypes") - @Override - public void getSubBlocks(Item block, CreativeTabs tabs, List list) { - if (isBottom) - super.getSubBlocks(block, tabs, list); - } + @SuppressWarnings("rawtypes") + @Override + public void getSubBlocks(Item block, CreativeTabs tabs, List list) { + if (isBottom) super.getSubBlocks(block, tabs, list); + } - /** - * Checks if the block is a solid face on the given side, used by placement logic. - * - * @param world - * The current world - * @param x - * X Position - * @param y - * Y position - * @param z - * Z position - * @param side - * The side to check - * @return True if the block is solid on the specified side. - */ - @Override - public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) { - return !isBottom && (side == UP); - } + /** + * Checks if the block is a solid face on the given side, used by placement logic. + * + * @param world The current world + * @param x X Position + * @param y Y position + * @param z Z position + * @param side The side to check + * @return True if the block is solid on the specified side. + */ + @Override + public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) { + return !isBottom && (side == UP); + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableStairs.java b/src/main/java/team/chisel/block/BlockCarvableStairs.java index 48d23e36..41b04c13 100644 --- a/src/main/java/team/chisel/block/BlockCarvableStairs.java +++ b/src/main/java/team/chisel/block/BlockCarvableStairs.java @@ -2,11 +2,6 @@ package team.chisel.block; import java.util.List; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.CarvableHelper; -import com.cricketcraft.chisel.api.carving.IVariationInfo; - -import team.chisel.client.render.RendererStairs; import net.minecraft.block.Block; import net.minecraft.block.BlockStairs; import net.minecraft.client.renderer.texture.IIconRegister; @@ -19,75 +14,81 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import team.chisel.client.render.RendererStairs; + +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.IVariationInfo; + public class BlockCarvableStairs extends BlockStairs implements ICarvable { - CarvableHelper carverHelper; - int blockMeta; + CarvableHelper carverHelper; + int blockMeta; - public BlockCarvableStairs(Block block, int meta, CarvableHelper helper) { - super(block, meta); + public BlockCarvableStairs(Block block, int meta, CarvableHelper helper) { + super(block, meta); - this.useNeighborBrightness = true; - carverHelper = helper; - blockMeta = meta; - } + this.useNeighborBrightness = true; + carverHelper = helper; + blockMeta = meta; + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, blockMeta + metadata / 8); - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, blockMeta + metadata / 8); + } - @Override - public int damageDropped(int i) { - return i / 8; - } + @Override + public int damageDropped(int i) { + return i / 8; + } - @Override - public void registerBlockIcons(IIconRegister register) { - if (blockMeta == 0) - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public void registerBlockIcons(IIconRegister register) { + if (blockMeta == 0) carverHelper.registerBlockIcons("Chisel", this, register); + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item block, CreativeTabs tabs, List list) { - list.add(new ItemStack(block, 1, 0)); - list.add(new ItemStack(block, 1, 8)); - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item block, CreativeTabs tabs, List list) { + list.add(new ItemStack(block, 1, 0)); + list.add(new ItemStack(block, 1, 8)); + } - @Override - public int getRenderType() { - return RendererStairs.id; - } + @Override + public int getRenderType() { + return RendererStairs.id; + } - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) { - int meta = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, + ItemStack par6ItemStack) { + int meta = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - // 0->2 2->3 3->0 1->1 - meta = meta == 0 ? 2 : meta == 2 ? 3 : meta == 3 ? 0 : 1; + // 0->2 2->3 3->0 1->1 + meta = meta == 0 ? 2 : meta == 2 ? 3 : meta == 3 ? 0 : 1; - meta += par1World.getBlockMetadata(par2, par3, par4) % 8; // add upside-down-ness + meta += par1World.getBlockMetadata(par2, par3, par4) % 8; // add upside-down-ness - if (par6ItemStack.getItemDamage() >= 8) { - meta += 8; - } + if (par6ItemStack.getItemDamage() >= 8) { + meta += 8; + } - par1World.setBlockMetadataWithNotify(par2, par3, par4, meta, 2); - } + par1World.setBlockMetadataWithNotify(par2, par3, par4, meta, 2); + } - @Override - public int onBlockPlaced(World world, int x, int y, int z, int side, float hx, float hy, float hz, int damage) { - return side != 0 && (side == 1 || hy <= 0.5D) ? damage : damage + 4; - } + @Override + public int onBlockPlaced(World world, int x, int y, int z, int side, float hx, float hy, float hz, int damage) { + return side != 0 && (side == 1 || hy <= 0.5D) ? damage : damage + 4; + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(blockMeta + (metadata / 8)); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(blockMeta + (metadata / 8)); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(blockMeta + (meta / 8)); - } + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(blockMeta + (meta / 8)); + } } diff --git a/src/main/java/team/chisel/block/BlockCarvableTorch.java b/src/main/java/team/chisel/block/BlockCarvableTorch.java index 7f1b441c..afdcad32 100644 --- a/src/main/java/team/chisel/block/BlockCarvableTorch.java +++ b/src/main/java/team/chisel/block/BlockCarvableTorch.java @@ -2,83 +2,86 @@ package team.chisel.block; import java.util.Random; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.CarvableHelper; -import com.cricketcraft.chisel.api.carving.IVariationInfo; - -import team.chisel.Chisel; -import com.cricketcraft.chisel.api.ChiselTabs; import net.minecraft.block.BlockTorch; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + +import team.chisel.Chisel; + +import com.cricketcraft.chisel.api.ChiselTabs; +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.IVariationInfo; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockCarvableTorch extends BlockTorch implements ICarvable { - public CarvableHelper carverHelper; - private String texLocation; - protected boolean emitsParticles = true; - public int idx; + public CarvableHelper carverHelper; + private String texLocation; + protected boolean emitsParticles = true; + public int idx; - public BlockCarvableTorch(int idx, String tex) { - super(); - carverHelper = new CarvableHelper(this); - setCreativeTab(ChiselTabs.tabOtherChiselBlocks); - setLightLevel(0.9375F); - setBlockName("torch"); - this.idx = idx; - this.texLocation = tex; - } + public BlockCarvableTorch(int idx, String tex) { + super(); + carverHelper = new CarvableHelper(this); + setCreativeTab(ChiselTabs.tabOtherChiselBlocks); + setLightLevel(0.9375F); + setBlockName("torch"); + this.idx = idx; + this.texLocation = tex; + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } - @Override - public void registerBlockIcons(IIconRegister icon) { - this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":torch/" + texLocation); - } + @Override + public void registerBlockIcons(IIconRegister icon) { + this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":torch/" + texLocation); + } - public BlockCarvableTorch disableParticles() { - this.emitsParticles = false; - return this; - } + public BlockCarvableTorch disableParticles() { + this.emitsParticles = false; + return this; + } - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { - if (emitsParticles) { - int l = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_); - double d0 = p_149734_2_ + 0.5F; - double d1 = p_149734_3_ + 0.7F; - double d2 = p_149734_4_ + 0.5F; - double d3 = 0.2199999988079071D; - double d4 = 0.27000001072883606D; + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, + Random p_149734_5_) { + if (emitsParticles) { + int l = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_); + double d0 = p_149734_2_ + 0.5F; + double d1 = p_149734_3_ + 0.7F; + double d2 = p_149734_4_ + 0.5F; + double d3 = 0.2199999988079071D; + double d4 = 0.27000001072883606D; - if (l == 1) { - p_149734_1_.spawnParticle("smoke", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); - p_149734_1_.spawnParticle("flame", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); - } else if (l == 2) { - p_149734_1_.spawnParticle("smoke", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); - p_149734_1_.spawnParticle("flame", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); - } else if (l == 3) { - p_149734_1_.spawnParticle("smoke", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D); - p_149734_1_.spawnParticle("flame", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D); - } else if (l == 4) { - p_149734_1_.spawnParticle("smoke", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D); - p_149734_1_.spawnParticle("flame", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D); - } else { - p_149734_1_.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D); - p_149734_1_.spawnParticle("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D); - } - } - } -} \ No newline at end of file + if (l == 1) { + p_149734_1_.spawnParticle("smoke", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); + } else if (l == 2) { + p_149734_1_.spawnParticle("smoke", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); + } else if (l == 3) { + p_149734_1_.spawnParticle("smoke", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D); + } else if (l == 4) { + p_149734_1_.spawnParticle("smoke", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D); + } else { + p_149734_1_.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D); + } + } + } +} diff --git a/src/main/java/team/chisel/block/BlockCarvableWall.java b/src/main/java/team/chisel/block/BlockCarvableWall.java index ae89959a..327556a8 100644 --- a/src/main/java/team/chisel/block/BlockCarvableWall.java +++ b/src/main/java/team/chisel/block/BlockCarvableWall.java @@ -2,8 +2,6 @@ package team.chisel.block; import java.util.List; -import com.cricketcraft.chisel.api.carving.CarvableHelper; - import net.minecraft.block.Block; import net.minecraft.block.BlockWall; import net.minecraft.client.renderer.texture.IIconRegister; @@ -11,34 +9,36 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.util.IIcon; +import com.cricketcraft.chisel.api.carving.CarvableHelper; + public class BlockCarvableWall extends BlockWall { - CarvableHelper carverHelper; + CarvableHelper carverHelper; - public BlockCarvableWall(Block block) { - super(block); + public BlockCarvableWall(Block block) { + super(block); - carverHelper = new CarvableHelper(this); - } + carverHelper = new CarvableHelper(this); + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public int damageDropped(int i) { - return i; - } + @Override + public int damageDropped(int i) { + return i; + } - @Override - public void registerBlockIcons(IIconRegister register) { - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public void registerBlockIcons(IIconRegister register) { + carverHelper.registerBlockIcons("Chisel", this, register); + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item block, CreativeTabs tabs, List list) { - carverHelper.registerSubBlocks(this, tabs, list); - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item block, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } } diff --git a/src/main/java/team/chisel/block/BlockCloud.java b/src/main/java/team/chisel/block/BlockCloud.java index 928c5cdd..086cfb16 100644 --- a/src/main/java/team/chisel/block/BlockCloud.java +++ b/src/main/java/team/chisel/block/BlockCloud.java @@ -2,7 +2,6 @@ package team.chisel.block; import java.util.Random; -import team.chisel.config.Configurations; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -10,65 +9,67 @@ import net.minecraft.item.Item; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + +import team.chisel.config.Configurations; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockCloud extends BlockCarvable { - public BlockCloud() { - super(Material.ice); - useNeighborBrightness = true; - } + public BlockCloud() { + super(Material.ice); + useNeighborBrightness = true; + } - @Override - public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity) { - entity.fallDistance = 0.0F; + @Override + public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity) { + entity.fallDistance = 0.0F; - if (entity.motionY < 0.0D) { - entity.motionY *= 0.0050000000000000001D; - } else if (entity.motionY > 0) { - entity.motionY += 0.0285; - } - } + if (entity.motionY < 0.0D) { + entity.motionY *= 0.0050000000000000001D; + } else if (entity.motionY > 0) { + entity.motionY += 0.0285; + } + } - @Override - public boolean isOpaqueCube() { - return false; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public int getRenderBlockPass() { - return Configurations.ghostCloud ? 1 : 0; - } + @Override + public int getRenderBlockPass() { + return Configurations.ghostCloud ? 1 : 0; + } - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { - Block block = world.getBlock(x, y, z); - if (block == this) { - return false; - } + @Override + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { + Block block = world.getBlock(x, y, z); + if (block == this) { + return false; + } - return super.shouldSideBeRendered(world, x, y, z, side); - } + return super.shouldSideBeRendered(world, x, y, z, side); + } - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) { - return AxisAlignedBB.getBoundingBox(i + 0.2, j, k + 0.2, i + 0.8, j + 0.2, k + 0.8); - } + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) { + return AxisAlignedBB.getBoundingBox(i + 0.2, j, k + 0.2, i + 0.8, j + 0.2, k + 0.8); + } - @Override - public Item getItemDropped(int par1, Random rand, int par3) { - return Item.getItemFromBlock(this); - } + @Override + public Item getItemDropped(int par1, Random rand, int par3) { + return Item.getItemFromBlock(this); + } - @Override - public int quantityDropped(Random rand) { - return rand.nextInt(2); - } + @Override + public int quantityDropped(Random rand) { + return rand.nextInt(2); + } - @Override - public int damageDropped(int meta) { - return meta; - } + @Override + public int damageDropped(int meta) { + return meta; + } } diff --git a/src/main/java/team/chisel/block/BlockConcrete.java b/src/main/java/team/chisel/block/BlockConcrete.java index f29723b8..85b852da 100644 --- a/src/main/java/team/chisel/block/BlockConcrete.java +++ b/src/main/java/team/chisel/block/BlockConcrete.java @@ -6,6 +6,7 @@ import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.util.MathHelper; import net.minecraft.util.MovementInput; import net.minecraft.util.MovementInputFromOptions; + import team.chisel.config.Configurations; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -16,30 +17,35 @@ import cpw.mods.fml.relauncher.SideOnly; public class BlockConcrete extends BlockCarvable { - public BlockConcrete() { - super(); - FMLCommonHandler.instance().bus().register(this); - } + public BlockConcrete() { + super(); + FMLCommonHandler.instance().bus().register(this); + } - @SideOnly(Side.CLIENT) - private static MovementInput manualInputCheck; + @SideOnly(Side.CLIENT) + private static MovementInput manualInputCheck; - @SubscribeEvent - @SideOnly(Side.CLIENT) - public void speedupPlayer(PlayerTickEvent event) { - if (event.phase == Phase.START && event.side.isClient() && event.player.onGround && event.player instanceof EntityPlayerSP) { - if (manualInputCheck == null) { - manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings); - } - EntityPlayerSP player = (EntityPlayerSP) event.player; - Block below = player.worldObj.getBlock(MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY) - 2, MathHelper.floor_double(player.posZ)); - if (below == this) { - manualInputCheck.updatePlayerMoveState(); - if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) { - player.motionX *= Configurations.concreteVelocityMult + 0.05; - player.motionZ *= Configurations.concreteVelocityMult + 0.05; - } - } - } - } + @SubscribeEvent + @SideOnly(Side.CLIENT) + public void speedupPlayer(PlayerTickEvent event) { + if (event.phase == Phase.START && event.side.isClient() + && event.player.onGround + && event.player instanceof EntityPlayerSP) { + if (manualInputCheck == null) { + manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings); + } + EntityPlayerSP player = (EntityPlayerSP) event.player; + Block below = player.worldObj.getBlock( + MathHelper.floor_double(player.posX), + MathHelper.floor_double(player.posY) - 2, + MathHelper.floor_double(player.posZ)); + if (below == this) { + manualInputCheck.updatePlayerMoveState(); + if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) { + player.motionX *= Configurations.concreteVelocityMult + 0.05; + player.motionZ *= Configurations.concreteVelocityMult + 0.05; + } + } + } + } } diff --git a/src/main/java/team/chisel/block/BlockEldritch.java b/src/main/java/team/chisel/block/BlockEldritch.java index 9063b2fa..d9874df1 100644 --- a/src/main/java/team/chisel/block/BlockEldritch.java +++ b/src/main/java/team/chisel/block/BlockEldritch.java @@ -4,13 +4,13 @@ import team.chisel.Chisel; public class BlockEldritch extends BlockCarvable { - public BlockEldritch() { - super(); - } + public BlockEldritch() { + super(); + } - @Override - public int getRenderType() { - return Chisel.renderEldritchId; - } + @Override + public int getRenderType() { + return Chisel.renderEldritchId; + } } diff --git a/src/main/java/team/chisel/block/BlockGrimstone.java b/src/main/java/team/chisel/block/BlockGrimstone.java index 14f6b597..54823d66 100644 --- a/src/main/java/team/chisel/block/BlockGrimstone.java +++ b/src/main/java/team/chisel/block/BlockGrimstone.java @@ -2,33 +2,33 @@ package team.chisel.block; import java.util.Random; -import team.chisel.Chisel; -import team.chisel.client.GeneralChiselClient; -import team.chisel.utils.General; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import team.chisel.Chisel; +import team.chisel.client.GeneralChiselClient; +import team.chisel.utils.General; + public class BlockGrimstone extends BlockCarvable { - public IIcon iconStar; + public IIcon iconStar; - public BlockGrimstone(Material m) { - super(m); - } + public BlockGrimstone(Material m) { + super(m); + } - @Override - public void randomDisplayTick(World world, int x, int y, int z, Random random) { - if (General.rand.nextInt(4) == 0 && world.isRemote) - GeneralChiselClient.spawnGrimstoneFX(world, this, x, y, z); - } + @Override + public void randomDisplayTick(World world, int x, int y, int z, Random random) { + if (General.rand.nextInt(4) == 0 && world.isRemote) GeneralChiselClient.spawnGrimstoneFX(world, this, x, y, z); + } - @Override - public void registerBlockIcons(IIconRegister register) { - super.registerBlockIcons(register); + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); - iconStar = register.registerIcon(Chisel.MOD_ID + ":grimstone/particles/star"); - } + iconStar = register.registerIcon(Chisel.MOD_ID + ":grimstone/particles/star"); + } } diff --git a/src/main/java/team/chisel/block/BlockHolystone.java b/src/main/java/team/chisel/block/BlockHolystone.java index 652e8029..7b3d8f91 100644 --- a/src/main/java/team/chisel/block/BlockHolystone.java +++ b/src/main/java/team/chisel/block/BlockHolystone.java @@ -2,34 +2,34 @@ package team.chisel.block; import java.util.Random; -import team.chisel.client.GeneralChiselClient; -import team.chisel.utils.General; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import team.chisel.client.GeneralChiselClient; +import team.chisel.utils.General; + public class BlockHolystone extends BlockCarvable { - public IIcon iconStar; + public IIcon iconStar; - public BlockHolystone(Material m) { - super(m); + public BlockHolystone(Material m) { + super(m); - this.setLightLevel(0.25F); - } + this.setLightLevel(0.25F); + } - @Override - public void randomDisplayTick(World world, int x, int y, int z, Random random) { - if (General.rand.nextInt(4) == 0 && world.isRemote) - GeneralChiselClient.spawnHolystoneFX(world, this, x, y, z); - } + @Override + public void randomDisplayTick(World world, int x, int y, int z, Random random) { + if (General.rand.nextInt(4) == 0 && world.isRemote) GeneralChiselClient.spawnHolystoneFX(world, this, x, y, z); + } - @Override - public void registerBlockIcons(IIconRegister register) { - super.registerBlockIcons(register); + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); - iconStar = register.registerIcon("Chisel:holystone/particles/star"); - } + iconStar = register.registerIcon("Chisel:holystone/particles/star"); + } } diff --git a/src/main/java/team/chisel/block/BlockLavastone.java b/src/main/java/team/chisel/block/BlockLavastone.java index e7740042..8cee4584 100644 --- a/src/main/java/team/chisel/block/BlockLavastone.java +++ b/src/main/java/team/chisel/block/BlockLavastone.java @@ -2,26 +2,26 @@ package team.chisel.block; import java.util.Random; -import team.chisel.client.GeneralChiselClient; import net.minecraft.block.material.Material; import net.minecraft.world.World; +import team.chisel.client.GeneralChiselClient; + public class BlockLavastone extends BlockMultiLayer { - public BlockLavastone(Material mat, String baseIcon) { - super(mat, baseIcon); - setLightLevel(1F); - } + public BlockLavastone(Material mat, String baseIcon) { + super(mat, baseIcon); + setLightLevel(1F); + } - @Override - public void randomDisplayTick(World world, int x, int y, int z, Random random) { - if (random.nextInt(8) == 0 && world.isRemote) - GeneralChiselClient.spawnLavastoneFX(world, this, x, y, z); - } + @Override + public void randomDisplayTick(World world, int x, int y, int z, Random random) { + if (random.nextInt(8) == 0 && world.isRemote) GeneralChiselClient.spawnLavastoneFX(world, this, x, y, z); + } - @Override - public boolean renderAsNormalBlock() { - return true; - } + @Override + public boolean renderAsNormalBlock() { + return true; + } } diff --git a/src/main/java/team/chisel/block/BlockLeaf.java b/src/main/java/team/chisel/block/BlockLeaf.java index ea523fd1..93107faf 100644 --- a/src/main/java/team/chisel/block/BlockLeaf.java +++ b/src/main/java/team/chisel/block/BlockLeaf.java @@ -5,12 +5,12 @@ import net.minecraft.init.Blocks; public class BlockLeaf extends BlockCarvable { - public BlockLeaf(Material material) { - super(material); - } + public BlockLeaf(Material material) { + super(material); + } - @Override - public boolean isOpaqueCube() { - return Blocks.leaves.isOpaqueCube(); - } + @Override + public boolean isOpaqueCube() { + return Blocks.leaves.isOpaqueCube(); + } } diff --git a/src/main/java/team/chisel/block/BlockMultiLayer.java b/src/main/java/team/chisel/block/BlockMultiLayer.java index 3161dd68..258b0426 100644 --- a/src/main/java/team/chisel/block/BlockMultiLayer.java +++ b/src/main/java/team/chisel/block/BlockMultiLayer.java @@ -2,10 +2,6 @@ package team.chisel.block; import java.util.List; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.CarvableHelper; -import com.cricketcraft.chisel.api.carving.IVariationInfo; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -14,52 +10,56 @@ import net.minecraft.item.Item; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.IVariationInfo; + public class BlockMultiLayer extends BlockMultiLayerBase implements ICarvable { - public CarvableHelper carverHelper; + public CarvableHelper carverHelper; - public BlockMultiLayer(Material mat, String baseIcon) { - super(mat, baseIcon); + public BlockMultiLayer(Material mat, String baseIcon) { + super(mat, baseIcon); - carverHelper = new CarvableHelper(this); - } + carverHelper = new CarvableHelper(this); + } - public BlockMultiLayer(Material mat, Block block) { - super(mat, block); + public BlockMultiLayer(Material mat, Block block) { + super(mat, block); - carverHelper = new CarvableHelper(this); - } + carverHelper = new CarvableHelper(this); + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public int damageDropped(int i) { - return i; - } + @Override + public int damageDropped(int i) { + return i; + } - @Override - public void registerBlockIcons(IIconRegister register) { - super.registerBlockIcons(register); + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); - carverHelper.registerBlockIcons("Chisel", this, register); - } + carverHelper.registerBlockIcons("Chisel", this, register); + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item block, CreativeTabs tabs, List list) { - carverHelper.registerSubBlocks(this, tabs, list); - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item block, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } } diff --git a/src/main/java/team/chisel/block/BlockMultiLayerBase.java b/src/main/java/team/chisel/block/BlockMultiLayerBase.java index 45dd2a6e..c95ada21 100644 --- a/src/main/java/team/chisel/block/BlockMultiLayerBase.java +++ b/src/main/java/team/chisel/block/BlockMultiLayerBase.java @@ -1,55 +1,55 @@ package team.chisel.block; -import team.chisel.client.render.RendererMultiLayer; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraftforge.client.ForgeHooksClient; +import team.chisel.client.render.RendererMultiLayer; + public abstract class BlockMultiLayerBase extends Block { - public Block base; - public IIcon icon; - String iconFile; + public Block base; + public IIcon icon; + String iconFile; - public BlockMultiLayerBase(Material mat, Block base) { - super(mat); + public BlockMultiLayerBase(Material mat, Block base) { + super(mat); - this.base = base; - } + this.base = base; + } - public BlockMultiLayerBase(Material mat, String iconFile) { - super(mat); + public BlockMultiLayerBase(Material mat, String iconFile) { + super(mat); - this.iconFile = iconFile; - } + this.iconFile = iconFile; + } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - public int getRenderType() { - return RendererMultiLayer.id; - } + @Override + public int getRenderType() { + return RendererMultiLayer.id; + } - @Override - public int getRenderBlockPass() { - return 1; - } + @Override + public int getRenderBlockPass() { + return 1; + } - @Override - public boolean canRenderInPass(int pass) { - ForgeHooksClient.setRenderPass(pass); - return pass == 1 || pass == 0; - } + @Override + public boolean canRenderInPass(int pass) { + ForgeHooksClient.setRenderPass(pass); + return pass == 1 || pass == 0; + } - @Override - public void registerBlockIcons(IIconRegister register) { - if (iconFile != null) - icon = register.registerIcon(iconFile); - } + @Override + public void registerBlockIcons(IIconRegister register) { + if (iconFile != null) icon = register.registerIcon(iconFile); + } } diff --git a/src/main/java/team/chisel/block/BlockPresent.java b/src/main/java/team/chisel/block/BlockPresent.java index fa1ec268..9f98f7b5 100644 --- a/src/main/java/team/chisel/block/BlockPresent.java +++ b/src/main/java/team/chisel/block/BlockPresent.java @@ -2,12 +2,6 @@ package team.chisel.block; import java.util.List; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.CarvableHelper; -import com.cricketcraft.chisel.api.carving.IVariationInfo; - -import team.chisel.Chisel; -import team.chisel.block.tileentity.TileEntityPresent; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -24,206 +18,226 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + +import team.chisel.Chisel; +import team.chisel.block.tileentity.TileEntityPresent; + +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.CarvableHelper; +import com.cricketcraft.chisel.api.carving.IVariationInfo; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockPresent extends Block implements ICarvable { - public CarvableHelper carverHelper; + public CarvableHelper carverHelper; - private float minX, minY, minZ, maxX, maxY, maxZ; + private float minX, minY, minZ, maxX, maxY, maxZ; - public BlockPresent() { - super(Material.wood); - carverHelper = new CarvableHelper(this); - minX = 0.0625F; - minZ = 0.0625F; - maxX = 0.9375F; - maxY = 0.875F; - maxZ = 0.9375F; - setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ); - } + public BlockPresent() { + super(Material.wood); + carverHelper = new CarvableHelper(this); + minX = 0.0625F; + minZ = 0.0625F; + maxX = 0.9375F; + maxY = 0.875F; + maxZ = 0.9375F; + setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ); + } - public String getModelTexture(int type) { - return "textures/blocks/present/presentChest" + type; - } + public String getModelTexture(int type) { + return "textures/blocks/present/presentChest" + type; + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item item, CreativeTabs tab, List list) { - for (int i = 0; i < 16; i++) { - list.add(new ItemStack(item, 1, i)); - } - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < 16; i++) { + list.add(new ItemStack(item, 1, i)); + } + } - @Override - public boolean isOpaqueCube() { - return false; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - public int getRenderType() { - return -1; - } + @Override + public int getRenderType() { + return -1; + } - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) { - super.onBlockPlacedBy(world, x, y, z, player, stack); - int heading = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - TileEntityPresent te = (TileEntityPresent) world.getTileEntity(x, y, z); - world.setBlockMetadataWithNotify(x, y, z, stack.getItemDamage(), 3); - te.setRotation(heading); - te.findConnections(); - if (te.isConnected()) { - TileEntityPresent other = te.getConnection(); - other.setRotation(heading); - } - world.markBlockForUpdate(x, y, z); - } + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) { + super.onBlockPlacedBy(world, x, y, z, player, stack); + int heading = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntityPresent te = (TileEntityPresent) world.getTileEntity(x, y, z); + world.setBlockMetadataWithNotify(x, y, z, stack.getItemDamage(), 3); + te.setRotation(heading); + te.findConnections(); + if (te.isConnected()) { + TileEntityPresent other = te.getConnection(); + other.setRotation(heading); + } + world.markBlockForUpdate(x, y, z); + } - @Override - public void breakBlock(World world, int x, int y, int z, Block present, int meta) { + @Override + public void breakBlock(World world, int x, int y, int z, Block present, int meta) { - TileEntityPresent tileEntityPresent = (TileEntityPresent) world.getTileEntity(x, y, z); + TileEntityPresent tileEntityPresent = (TileEntityPresent) world.getTileEntity(x, y, z); - if (tileEntityPresent != null) { - for (int c = 0; c < tileEntityPresent.getTrueSizeInventory(); c++) { - ItemStack itemStack = tileEntityPresent.getTrueStackInSlot(c); + if (tileEntityPresent != null) { + for (int c = 0; c < tileEntityPresent.getTrueSizeInventory(); c++) { + ItemStack itemStack = tileEntityPresent.getTrueStackInSlot(c); - if (itemStack != null) { - dropBlockAsItem(world, x, y, z, itemStack); - } - } + if (itemStack != null) { + dropBlockAsItem(world, x, y, z, itemStack); + } + } - world.func_147453_f(x, y, z, this); - } + world.func_147453_f(x, y, z, this); + } - super.breakBlock(world, x, y, z, this, meta); - } + super.breakBlock(world, x, y, z, this, meta); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int hitX, float hitY, float hitZ, float p_149727_9_) { - if (!world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)) { - if (!world.isRemote) { - player.openGui(Chisel.instance, 2, world, x, y, z); - } - return true; - } - return false; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int hitX, float hitY, + float hitZ, float p_149727_9_) { + if (!world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)) { + if (!world.isRemote) { + player.openGui(Chisel.instance, 2, world, x, y, z); + } + return true; + } + return false; + } - @Override - public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { - if (world.getTileEntity(x, y, z) instanceof TileEntityPresent) - return getBoundingBox((TileEntityPresent) world.getTileEntity(x, y, z)); - else - return null; - } + @Override + public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { + if (world.getTileEntity(x, y, z) instanceof TileEntityPresent) + return getBoundingBox((TileEntityPresent) world.getTileEntity(x, y, z)); + else return null; + } - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { - if (world.getTileEntity(x, y, z) instanceof TileEntityPresent) - return getBoundingBox((TileEntityPresent) world.getTileEntity(x, y, z)); - else - return null; - } + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { + if (world.getTileEntity(x, y, z) instanceof TileEntityPresent) + return getBoundingBox((TileEntityPresent) world.getTileEntity(x, y, z)); + else return null; + } - public AxisAlignedBB getBoundingBox(TileEntityPresent me) { - if (me == null) { - return AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ); - } - int x = me.xCoord, y = me.yCoord, z = me.zCoord; - if (me.isConnected()) { - ForgeDirection dir = me.getConnectionDir(); - // warning: magic below! Do not change this conditional - if (dir == ForgeDirection.EAST || (me.isParent() && dir == ForgeDirection.SOUTH) || (!me.isParent() && dir == ForgeDirection.SOUTH)) { - return AxisAlignedBB.getBoundingBox(x + minX, y + minY, z + minZ, x + maxX + dir.offsetX, y + maxY, z + maxZ + dir.offsetZ); - } else { - return AxisAlignedBB.getBoundingBox(x + dir.offsetX + minX, y + minY, z + dir.offsetZ + minZ, x + maxX, y + maxY, z + maxZ); - } - } - return AxisAlignedBB.getBoundingBox(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ); - } + public AxisAlignedBB getBoundingBox(TileEntityPresent me) { + if (me == null) { + return AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ); + } + int x = me.xCoord, y = me.yCoord, z = me.zCoord; + if (me.isConnected()) { + ForgeDirection dir = me.getConnectionDir(); + // warning: magic below! Do not change this conditional + if (dir == ForgeDirection.EAST || (me.isParent() && dir == ForgeDirection.SOUTH) + || (!me.isParent() && dir == ForgeDirection.SOUTH)) { + return AxisAlignedBB.getBoundingBox( + x + minX, + y + minY, + z + minZ, + x + maxX + dir.offsetX, + y + maxY, + z + maxZ + dir.offsetZ); + } else { + return AxisAlignedBB.getBoundingBox( + x + dir.offsetX + minX, + y + minY, + z + dir.offsetZ + minZ, + x + maxX, + y + maxY, + z + maxZ); + } + } + return AxisAlignedBB.getBoundingBox(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ); + } - @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { - TileEntityPresent te = (TileEntityPresent) world.getTileEntity(x, y, z); - if (!te.isConnected()) { - setBlockBounds(0.0625F, 0, 0.0625F, 0.9375F, 0.875F, 0.9365F); - } else { - ForgeDirection dir = te.getConnectionDir(); - switch (dir) { - case EAST: - setBlockBounds(0.0625F, 0, 0.0625F, 1, 0.875F, 0.9365F); - break; - case NORTH: - setBlockBounds(0.0625F, 0, 0, 0.9375F, 0.875F, 0.9365F); - break; - case SOUTH: - setBlockBounds(0.0625F, 0, 0.0625F, 0.9375F, 0.875F, 1); - break; - case WEST: - setBlockBounds(0, 0, 0.0625F, 0.9375F, 0.875F, 0.9365F); - break; - default: - setBlockBounds(0.0625F, 0, 0.0625F, 0.9375F, 0.875F, 0.9365F); - break; - } - } - } + @Override + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntityPresent te = (TileEntityPresent) world.getTileEntity(x, y, z); + if (!te.isConnected()) { + setBlockBounds(0.0625F, 0, 0.0625F, 0.9375F, 0.875F, 0.9365F); + } else { + ForgeDirection dir = te.getConnectionDir(); + switch (dir) { + case EAST: + setBlockBounds(0.0625F, 0, 0.0625F, 1, 0.875F, 0.9365F); + break; + case NORTH: + setBlockBounds(0.0625F, 0, 0, 0.9375F, 0.875F, 0.9365F); + break; + case SOUTH: + setBlockBounds(0.0625F, 0, 0.0625F, 0.9375F, 0.875F, 1); + break; + case WEST: + setBlockBounds(0, 0, 0.0625F, 0.9375F, 0.875F, 0.9365F); + break; + default: + setBlockBounds(0.0625F, 0, 0.0625F, 0.9375F, 0.875F, 0.9365F); + break; + } + } + } - @Override - public boolean hasTileEntity(int metadata) { - return true; - } + @Override + public boolean hasTileEntity(int metadata) { + return true; + } - @Override - public TileEntity createTileEntity(World world, int metadata) { - return new TileEntityPresent(); - } + @Override + public TileEntity createTileEntity(World world, int metadata) { + return new TileEntityPresent(); + } - @Override - public boolean hasComparatorInputOverride() { - return true; - } + @Override + public boolean hasComparatorInputOverride() { + return true; + } - @Override - public int getComparatorInputOverride(World world, int x, int y, int z, int strength) { - TileEntity te = world.getTileEntity(x, y, z); - if (te instanceof TileEntityPresent) { - return Container.calcRedstoneFromInventory((TileEntityPresent) te); - } - return 0; - } + @Override + public int getComparatorInputOverride(World world, int x, int y, int z, int strength) { + TileEntity te = world.getTileEntity(x, y, z); + if (te instanceof TileEntityPresent) { + return Container.calcRedstoneFromInventory((TileEntityPresent) te); + } + return 0; + } - @Override - public int damageDropped(int meta) { - return meta; - } + @Override + public int damageDropped(int meta) { + return meta; + } - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - return new ItemStack(this, 1, world.getBlockMetadata(x, y, z)); - } + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { + return new ItemStack(this, 1, world.getBlockMetadata(x, y, z)); + } - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister register) { - this.blockIcon = register.registerIcon("planks_oak"); - } + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister register) { + this.blockIcon = register.registerIcon("planks_oak"); + } - @Override - public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) { + return carverHelper.getVariation(metadata); + } - @Override - public IVariationInfo getManager(int meta) { - return carverHelper.getVariation(meta); - } -} \ No newline at end of file + @Override + public IVariationInfo getManager(int meta) { + return carverHelper.getVariation(meta); + } +} diff --git a/src/main/java/team/chisel/block/BlockRoadLine.java b/src/main/java/team/chisel/block/BlockRoadLine.java index 09366bda..eebf99f1 100644 --- a/src/main/java/team/chisel/block/BlockRoadLine.java +++ b/src/main/java/team/chisel/block/BlockRoadLine.java @@ -1,7 +1,5 @@ package team.chisel.block; -import team.chisel.Chisel; -import team.chisel.config.Configurations; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -10,83 +8,86 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + +import team.chisel.Chisel; +import team.chisel.config.Configurations; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockRoadLine extends BlockCarvable { - public IIcon aloneIcon[] = new IIcon[4]; - public IIcon halfLineIcon[] = new IIcon[4]; - public IIcon fullLineIcon[] = new IIcon[4]; + public IIcon aloneIcon[] = new IIcon[4]; + public IIcon halfLineIcon[] = new IIcon[4]; + public IIcon fullLineIcon[] = new IIcon[4]; - public BlockRoadLine() { - super(Material.circuits); + public BlockRoadLine() { + super(Material.circuits); - if (Configurations.useRoadLineTool) { - this.setHarvestLevel(Configurations.getRoadLineTool, Configurations.roadLineToolLevel); - } - this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.00390625f, 1.0f); - // this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); - } + if (Configurations.useRoadLineTool) { + this.setHarvestLevel(Configurations.getRoadLineTool, Configurations.roadLineToolLevel); + } + this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.00390625f, 1.0f); + // this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + } - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } - @Override - public boolean isOpaqueCube() { - return false; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - public int getRenderType() { - return Chisel.roadLineId; - } + @Override + public int getRenderType() { + return Chisel.roadLineId; + } - @Override - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { - return World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) || par1World.getBlock(par2, par3 - 1, par4).equals(Blocks.glowstone); - } + @Override + public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { + return World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) + || par1World.getBlock(par2, par3 - 1, par4).equals(Blocks.glowstone); + } - @Override - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block block) { - if (par1World.isRemote) - return; + @Override + public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block block) { + if (par1World.isRemote) return; - if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); - par1World.setBlockToAir(par2, par3, par4); - } + if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { + this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); + par1World.setBlockToAir(par2, par3, par4); + } - super.onNeighborBlockChange(par1World, par2, par3, par4, block); - } + super.onNeighborBlockChange(par1World, par2, par3, par4, block); + } - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister reg) { - for (int i = 0; i < 4; i++) { - String[] texNames = { "white", "yellow", "double-white", "double-yellow" }; - aloneIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-center"); - halfLineIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-side"); - fullLineIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-long"); - } - } + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) { + for (int i = 0; i < 4; i++) { + String[] texNames = { "white", "yellow", "double-white", "double-yellow" }; + aloneIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-center"); + halfLineIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-side"); + fullLineIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-long"); + } + } - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int metadata) { - return aloneIcon[metadata % aloneIcon.length]; - } + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) { + return aloneIcon[metadata % aloneIcon.length]; + } - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - return getIcon(side, world.getBlockMetadata(x, y, z)); - } + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return getIcon(side, world.getBlockMetadata(x, y, z)); + } } diff --git a/src/main/java/team/chisel/block/BlockSnakestone.java b/src/main/java/team/chisel/block/BlockSnakestone.java index b2e25408..22f34eef 100644 --- a/src/main/java/team/chisel/block/BlockSnakestone.java +++ b/src/main/java/team/chisel/block/BlockSnakestone.java @@ -2,7 +2,6 @@ package team.chisel.block; import java.util.List; -import team.chisel.client.render.RendererSnakeStone; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -14,533 +13,516 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import team.chisel.client.render.RendererSnakeStone; + public class BlockSnakestone extends Block { - static final int SEC_HEAD = 0; - static final int SEC_DOWN = 4; - static final int SEC_UP = 8; - static final int SEC_HOR = 12; - - static final int SIDE_B = 0; - static final int SIDE_T = 1; - static final int SIDE_N = 2; - static final int SIDE_S = 3; - static final int SIDE_W = 4; - static final int SIDE_E = 5; - - String iconPrefix; - IIcon iconFaceLeft; - IIcon iconFaceRight; - IIcon iconCross; - IIcon iconFace; - IIcon iconTopTip; - IIcon iconTopSide; - IIcon iconBottom; - IIcon iconBottomSide; - IIcon iconBottomTip; - IIcon iconLeftDown; - IIcon iconRightDown; - IIcon iconLeftUp; - IIcon iconRightUp; - IIcon iconLeftTip; - IIcon iconSide; - IIcon iconRightTip; - IIcon iconTop; - - public boolean flipTopTextures; - - public BlockSnakestone(String iconPrefix) { - super(Material.rock); - setHardness(1.5F); - setResistance(10.0F); - setStepSound(Block.soundTypeStone); - flipTopTextures = false; - - this.iconPrefix = iconPrefix; - } - - @Override - public int getRenderType() { - return RendererSnakeStone.id; - } - - static final int[] rotRemap = { 0, 3, 1, 2 }; - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { - int meta = world.getBlockMetadata(x, y, z); - if (meta > 3) - return; - - if (rotateHead(world, x, y, z) != -1) - return; - - int rot = rotRemap[(MathHelper.floor_double(entity.rotationYaw * 4.0 / 360.0 + 0.5)) & 3]; - - world.setBlockMetadataWithNotify(x, y, z, rot, 3); - } - - @Override - public int onBlockPlaced(World world, int x, int y, int z, int side, float hx, float hy, float hz, int meta) { - if (meta <= 3) - return meta; - - if (rotateBodyPart(world, x, y, z)) { - return world.getBlockMetadata(x, y, z); - } - - if (side == 0 || side == 1) - meta = 14; - if (side == 2 || side == 3) - meta = 13; - if (side == 4 || side == 5) - meta = 12; - - world.setBlockMetadataWithNotify(x, y, z, meta, 2); - - return meta; - } - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - int kind = world.getBlockMetadata(x, y, z) & 0xC; - - if (kind == 0) { - rotateHead(world, x, y, z); - } else { - rotateBodyPart(world, x, y, z); - } - } - - public int[] getConnections(World world, int ox, int oy, int oz) { - int index = 0; - int[] res = { -1, -1, -1, -1, -1, -1, -1 }; - - for (int direction = 0; direction < 6; direction++) { - int x = ox, y = oy, z = oz; - switch (direction) { - case 0: - z--; - break; - case 1: - z++; - break; - case 2: - x--; - break; - case 3: - x++; - break; - case 4: - y--; - break; - case 5: - y++; - break; - } - - if (!world.getBlock(x, y, z).equals(this)) - continue; - boolean match = false; - - int px1 = x, px2 = x; - int py1 = y, py2 = y; - int pz1 = z, pz2 = z; - - int meta = world.getBlockMetadata(x, y, z); - if ((meta & 0xc) == 4 || (meta & 0xc) == 8) { - if ((meta & 4) == 4) - py1--; - else - py1++; - - switch (meta & 3) { - case 0: - pz2--; - break; - case 1: - pz2++; - break; - case 2: - px2--; - break; - case 3: - px2++; - break; - } - } else if (meta == 12) { - px1--; - px2++; - } else if (meta == 13) { - pz1--; - pz2++; - } else if (meta == 14) { - py1--; - py2++; - } else if (meta == 15) { - match = true; - } else if (meta < 4) { - match = true; - } - - if (!match) { - Block b1 = world.getBlock(px1, py1, pz1); - Block b2 = world.getBlock(px2, py2, pz2); - - if (b1 != this || b2 != this) - match = true; - - if (ox == px1 && oy == py1 && oz == pz1) - match = true; - - if (ox == px2 && oy == py2 && oz == pz2) - match = true; - } - - if (match) - res[index++] = direction; - } - - if (index != 5) - res[index] = -1; - - return res; - } - - public boolean rotateBodyPart(World world, int x, int y, int z) { - int[] con = getConnections(world, x, y, z); - int blockMeta = world.getBlockMetadata(x, y, z); - - if (con[1] == -1) - return false; - if (con[2] != -1) - return false; - - int meta = 15; - - if (con[0] == 2 && con[1] == 3) { - meta = 12; - } else if (con[0] == 0 && con[1] == 1) { - meta = 13; - } else if (con[0] == 4 && con[1] == 5) { - meta = 14; - } else if (con[1] == 4) { - meta = SEC_DOWN | con[0]; - } else if (con[1] == 5) { - meta = SEC_UP | con[0]; - } - - if (blockMeta != meta) - world.setBlockMetadataWithNotify(x, y, z, meta, 3); - - return true; - } - - public int rotateHead(World world, int x, int y, int z) { - int[] con = getConnections(world, x, y, z); - - if (con[1] >= 0 && con[1] < 4) - return -1; - - int meta = -1; - switch (con[0]) { - case 0: - meta = 1; - break; - case 1: - meta = 0; - break; - case 2: - meta = 3; - break; - case 3: - meta = 2; - break; - } - - if (meta == -1) - return -1; - - world.setBlock(x, y, z, this, meta, 3); - return meta; - } - - public boolean connectedTo(World par1World, int x, int y, int z, int direction) { - switch (direction) { - case 0: - return par1World.getBlock(x, y, z - 1).equals(this); - case 1: - return par1World.getBlock(x, y, z + 1).equals(this); - case 2: - return par1World.getBlock(x - 1, y, z).equals(this); - case 3: - return par1World.getBlock(x + 1, y, z).equals(this); - case 4: - return par1World.getBlock(x, y - 1, z).equals(this); - case 5: - return par1World.getBlock(x, y + 1, z).equals(this); - } - - return false; - } - - @Override - public IIcon getIcon(int side, int meta) { - - switch (meta | (side << 4)) { - - case (SEC_HOR | 0 | (SIDE_B << 4)): - return iconBottomTip; - case (SEC_HOR | 0 | (SIDE_T << 4)): - return iconTopSide; - case (SEC_HOR | 0 | (SIDE_N << 4)): - return iconSide; - case (SEC_HOR | 0 | (SIDE_S << 4)): - return iconSide; - case (SEC_HOR | 0 | (SIDE_W << 4)): - return iconCross; - case (SEC_HOR | 0 | (SIDE_E << 4)): - return iconCross; - - case (SEC_HOR | 1 | (SIDE_B << 4)): - return iconBottomTip; - case (SEC_HOR | 1 | (SIDE_T << 4)): - return iconTopSide; - case (SEC_HOR | 1 | (SIDE_N << 4)): - return iconCross; - case (SEC_HOR | 1 | (SIDE_S << 4)): - return iconCross; - case (SEC_HOR | 1 | (SIDE_W << 4)): - return iconSide; - case (SEC_HOR | 1 | (SIDE_E << 4)): - return iconSide; - - case (SEC_HOR | 2 | (SIDE_B << 4)): - return iconCross; - case (SEC_HOR | 2 | (SIDE_T << 4)): - return iconCross; - case (SEC_HOR | 2 | (SIDE_N << 4)): - return iconSide; - case (SEC_HOR | 2 | (SIDE_S << 4)): - return iconSide; - case (SEC_HOR | 2 | (SIDE_W << 4)): - return iconSide; - case (SEC_HOR | 2 | (SIDE_E << 4)): - return iconSide; - - case (SEC_HOR | 3 | (SIDE_B << 4)): - return iconBottom; - case (SEC_HOR | 3 | (SIDE_T << 4)): - return iconTop; - case (SEC_HOR | 3 | (SIDE_N << 4)): - return iconSide; - case (SEC_HOR | 3 | (SIDE_S << 4)): - return iconSide; - case (SEC_HOR | 3 | (SIDE_W << 4)): - return iconSide; - case (SEC_HOR | 3 | (SIDE_E << 4)): - return iconSide; - - case (SEC_DOWN | 0 | (SIDE_B << 4)): - return iconCross; - case (SEC_DOWN | 0 | (SIDE_T << 4)): - return iconTopTip; - case (SEC_DOWN | 0 | (SIDE_N << 4)): - return iconCross; - case (SEC_DOWN | 0 | (SIDE_S << 4)): - return iconRightTip; - case (SEC_DOWN | 0 | (SIDE_W << 4)): - return iconLeftDown; - case (SEC_DOWN | 0 | (SIDE_E << 4)): - return iconRightDown; - - case (SEC_DOWN | 1 | (SIDE_B << 4)): - return iconCross; - case (SEC_DOWN | 1 | (SIDE_T << 4)): - return iconTopTip; - case (SEC_DOWN | 1 | (SIDE_N << 4)): - return iconLeftTip; - case (SEC_DOWN | 1 | (SIDE_S << 4)): - return iconCross; - case (SEC_DOWN | 1 | (SIDE_W << 4)): - return iconRightDown; - case (SEC_DOWN | 1 | (SIDE_E << 4)): - return iconLeftDown; - - case (SEC_DOWN | 2 | (SIDE_B << 4)): - return iconCross; - case (SEC_DOWN | 2 | (SIDE_T << 4)): - return iconTopTip; - case (SEC_DOWN | 2 | (SIDE_N << 4)): - return iconRightDown; - case (SEC_DOWN | 2 | (SIDE_S << 4)): - return iconLeftDown; - case (SEC_DOWN | 2 | (SIDE_W << 4)): - return iconCross; - case (SEC_DOWN | 2 | (SIDE_E << 4)): - return iconLeftTip; - - case (SEC_DOWN | 3 | (SIDE_B << 4)): - return iconCross; - case (SEC_DOWN | 3 | (SIDE_T << 4)): - return iconTopTip; - case (SEC_DOWN | 3 | (SIDE_N << 4)): - return iconLeftDown; - case (SEC_DOWN | 3 | (SIDE_S << 4)): - return iconRightDown; - case (SEC_DOWN | 3 | (SIDE_W << 4)): - return iconRightTip; - case (SEC_DOWN | 3 | (SIDE_E << 4)): - return iconCross; - - case (SEC_UP | 0 | (SIDE_B << 4)): - return iconBottomSide; - case (SEC_UP | 0 | (SIDE_T << 4)): - return iconCross; - case (SEC_UP | 0 | (SIDE_N << 4)): - return iconCross; - case (SEC_UP | 0 | (SIDE_S << 4)): - return iconLeftTip; - case (SEC_UP | 0 | (SIDE_W << 4)): - return iconLeftUp; - case (SEC_UP | 0 | (SIDE_E << 4)): - return iconRightUp; - - case (SEC_UP | 1 | (SIDE_B << 4)): - return iconBottomSide; - case (SEC_UP | 1 | (SIDE_T << 4)): - return iconCross; - case (SEC_UP | 1 | (SIDE_N << 4)): - return iconRightTip; - case (SEC_UP | 1 | (SIDE_S << 4)): - return iconCross; - case (SEC_UP | 1 | (SIDE_W << 4)): - return iconRightUp; - case (SEC_UP | 1 | (SIDE_E << 4)): - return iconLeftUp; - - case (SEC_UP | 2 | (SIDE_B << 4)): - return iconBottomSide; - case (SEC_UP | 2 | (SIDE_T << 4)): - return iconCross; - case (SEC_UP | 2 | (SIDE_N << 4)): - return iconRightUp; - case (SEC_UP | 2 | (SIDE_S << 4)): - return iconLeftUp; - case (SEC_UP | 2 | (SIDE_W << 4)): - return iconCross; - case (SEC_UP | 2 | (SIDE_E << 4)): - return iconRightTip; - - case (SEC_UP | 3 | (SIDE_B << 4)): - return iconBottomSide; - case (SEC_UP | 3 | (SIDE_T << 4)): - return iconCross; - case (SEC_UP | 3 | (SIDE_N << 4)): - return iconLeftUp; - case (SEC_UP | 3 | (SIDE_S << 4)): - return iconRightUp; - case (SEC_UP | 3 | (SIDE_W << 4)): - return iconLeftTip; - case (SEC_UP | 3 | (SIDE_E << 4)): - return iconCross; - - case (SEC_HEAD | 0 | (SIDE_B << 4)): - return iconBottomSide; - case (SEC_HEAD | 0 | (SIDE_T << 4)): - return iconTopTip; - case (SEC_HEAD | 0 | (SIDE_N << 4)): - return iconFace; - case (SEC_HEAD | 0 | (SIDE_S << 4)): - return iconCross; - case (SEC_HEAD | 0 | (SIDE_W << 4)): - return iconFaceLeft; - case (SEC_HEAD | 0 | (SIDE_E << 4)): - return iconFaceRight; - - case (SEC_HEAD | 1 | (SIDE_B << 4)): - return iconBottomSide; - case (SEC_HEAD | 1 | (SIDE_T << 4)): - return iconTopTip; - case (SEC_HEAD | 1 | (SIDE_N << 4)): - return iconCross; - case (SEC_HEAD | 1 | (SIDE_S << 4)): - return iconFace; - case (SEC_HEAD | 1 | (SIDE_W << 4)): - return iconFaceRight; - case (SEC_HEAD | 1 | (SIDE_E << 4)): - return iconFaceLeft; - - case (SEC_HEAD | 2 | (SIDE_B << 4)): - return iconBottomSide; - case (SEC_HEAD | 2 | (SIDE_T << 4)): - return iconTopTip; - case (SEC_HEAD | 2 | (SIDE_N << 4)): - return iconFaceRight; - case (SEC_HEAD | 2 | (SIDE_S << 4)): - return iconFaceLeft; - case (SEC_HEAD | 2 | (SIDE_W << 4)): - return iconFace; - case (SEC_HEAD | 2 | (SIDE_E << 4)): - return iconCross; - - case (SEC_HEAD | 3 | (SIDE_B << 4)): - return iconBottomSide; - case (SEC_HEAD | 3 | (SIDE_T << 4)): - return iconTopTip; - case (SEC_HEAD | 3 | (SIDE_N << 4)): - return iconFaceLeft; - case (SEC_HEAD | 3 | (SIDE_S << 4)): - return iconFaceRight; - case (SEC_HEAD | 3 | (SIDE_W << 4)): - return iconCross; - case (SEC_HEAD | 3 | (SIDE_E << 4)): - return iconFace; - - } - - return iconCross; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubBlocks(Item item, CreativeTabs tabs, List list) { - list.add(new ItemStack(item, 1, 1)); - list.add(new ItemStack(item, 1, 13)); - } - - @Override - public int damageDropped(int meta) { - if (meta < 4) { - return 1; - } - - return 13; - } - - @Override - public void registerBlockIcons(IIconRegister register) { - iconFaceLeft = register.registerIcon(iconPrefix + "face-left"); - iconFaceRight = register.registerIcon(iconPrefix + "face-right"); - iconFace = register.registerIcon(iconPrefix + "face"); - - iconLeftUp = register.registerIcon(iconPrefix + "left-up"); - iconLeftDown = register.registerIcon(iconPrefix + "left-down"); - iconLeftTip = register.registerIcon(iconPrefix + "left-tip"); - - iconRightUp = register.registerIcon(iconPrefix + "right-up"); - iconRightDown = register.registerIcon(iconPrefix + "right-down"); - iconRightTip = register.registerIcon(iconPrefix + "right-tip"); - - iconTop = register.registerIcon(iconPrefix + "top"); - iconTopTip = register.registerIcon(iconPrefix + "top-tip"); - iconTopSide = register.registerIcon(iconPrefix + "top-side"); - - iconBottom = register.registerIcon(iconPrefix + "bot"); - iconBottomTip = register.registerIcon(iconPrefix + "bot-tip"); - iconBottomSide = register.registerIcon(iconPrefix + "bot-side"); - - iconCross = register.registerIcon(iconPrefix + "crosssection"); - iconSide = register.registerIcon(iconPrefix + "side"); - } -} \ No newline at end of file + static final int SEC_HEAD = 0; + static final int SEC_DOWN = 4; + static final int SEC_UP = 8; + static final int SEC_HOR = 12; + + static final int SIDE_B = 0; + static final int SIDE_T = 1; + static final int SIDE_N = 2; + static final int SIDE_S = 3; + static final int SIDE_W = 4; + static final int SIDE_E = 5; + + String iconPrefix; + IIcon iconFaceLeft; + IIcon iconFaceRight; + IIcon iconCross; + IIcon iconFace; + IIcon iconTopTip; + IIcon iconTopSide; + IIcon iconBottom; + IIcon iconBottomSide; + IIcon iconBottomTip; + IIcon iconLeftDown; + IIcon iconRightDown; + IIcon iconLeftUp; + IIcon iconRightUp; + IIcon iconLeftTip; + IIcon iconSide; + IIcon iconRightTip; + IIcon iconTop; + + public boolean flipTopTextures; + + public BlockSnakestone(String iconPrefix) { + super(Material.rock); + setHardness(1.5F); + setResistance(10.0F); + setStepSound(Block.soundTypeStone); + flipTopTextures = false; + + this.iconPrefix = iconPrefix; + } + + @Override + public int getRenderType() { + return RendererSnakeStone.id; + } + + static final int[] rotRemap = { 0, 3, 1, 2 }; + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { + int meta = world.getBlockMetadata(x, y, z); + if (meta > 3) return; + + if (rotateHead(world, x, y, z) != -1) return; + + int rot = rotRemap[(MathHelper.floor_double(entity.rotationYaw * 4.0 / 360.0 + 0.5)) & 3]; + + world.setBlockMetadataWithNotify(x, y, z, rot, 3); + } + + @Override + public int onBlockPlaced(World world, int x, int y, int z, int side, float hx, float hy, float hz, int meta) { + if (meta <= 3) return meta; + + if (rotateBodyPart(world, x, y, z)) { + return world.getBlockMetadata(x, y, z); + } + + if (side == 0 || side == 1) meta = 14; + if (side == 2 || side == 3) meta = 13; + if (side == 4 || side == 5) meta = 12; + + world.setBlockMetadataWithNotify(x, y, z, meta, 2); + + return meta; + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { + int kind = world.getBlockMetadata(x, y, z) & 0xC; + + if (kind == 0) { + rotateHead(world, x, y, z); + } else { + rotateBodyPart(world, x, y, z); + } + } + + public int[] getConnections(World world, int ox, int oy, int oz) { + int index = 0; + int[] res = { -1, -1, -1, -1, -1, -1, -1 }; + + for (int direction = 0; direction < 6; direction++) { + int x = ox, y = oy, z = oz; + switch (direction) { + case 0: + z--; + break; + case 1: + z++; + break; + case 2: + x--; + break; + case 3: + x++; + break; + case 4: + y--; + break; + case 5: + y++; + break; + } + + if (!world.getBlock(x, y, z).equals(this)) continue; + boolean match = false; + + int px1 = x, px2 = x; + int py1 = y, py2 = y; + int pz1 = z, pz2 = z; + + int meta = world.getBlockMetadata(x, y, z); + if ((meta & 0xc) == 4 || (meta & 0xc) == 8) { + if ((meta & 4) == 4) py1--; + else py1++; + + switch (meta & 3) { + case 0: + pz2--; + break; + case 1: + pz2++; + break; + case 2: + px2--; + break; + case 3: + px2++; + break; + } + } else if (meta == 12) { + px1--; + px2++; + } else if (meta == 13) { + pz1--; + pz2++; + } else if (meta == 14) { + py1--; + py2++; + } else if (meta == 15) { + match = true; + } else if (meta < 4) { + match = true; + } + + if (!match) { + Block b1 = world.getBlock(px1, py1, pz1); + Block b2 = world.getBlock(px2, py2, pz2); + + if (b1 != this || b2 != this) match = true; + + if (ox == px1 && oy == py1 && oz == pz1) match = true; + + if (ox == px2 && oy == py2 && oz == pz2) match = true; + } + + if (match) res[index++] = direction; + } + + if (index != 5) res[index] = -1; + + return res; + } + + public boolean rotateBodyPart(World world, int x, int y, int z) { + int[] con = getConnections(world, x, y, z); + int blockMeta = world.getBlockMetadata(x, y, z); + + if (con[1] == -1) return false; + if (con[2] != -1) return false; + + int meta = 15; + + if (con[0] == 2 && con[1] == 3) { + meta = 12; + } else if (con[0] == 0 && con[1] == 1) { + meta = 13; + } else if (con[0] == 4 && con[1] == 5) { + meta = 14; + } else if (con[1] == 4) { + meta = SEC_DOWN | con[0]; + } else if (con[1] == 5) { + meta = SEC_UP | con[0]; + } + + if (blockMeta != meta) world.setBlockMetadataWithNotify(x, y, z, meta, 3); + + return true; + } + + public int rotateHead(World world, int x, int y, int z) { + int[] con = getConnections(world, x, y, z); + + if (con[1] >= 0 && con[1] < 4) return -1; + + int meta = -1; + switch (con[0]) { + case 0: + meta = 1; + break; + case 1: + meta = 0; + break; + case 2: + meta = 3; + break; + case 3: + meta = 2; + break; + } + + if (meta == -1) return -1; + + world.setBlock(x, y, z, this, meta, 3); + return meta; + } + + public boolean connectedTo(World par1World, int x, int y, int z, int direction) { + switch (direction) { + case 0: + return par1World.getBlock(x, y, z - 1).equals(this); + case 1: + return par1World.getBlock(x, y, z + 1).equals(this); + case 2: + return par1World.getBlock(x - 1, y, z).equals(this); + case 3: + return par1World.getBlock(x + 1, y, z).equals(this); + case 4: + return par1World.getBlock(x, y - 1, z).equals(this); + case 5: + return par1World.getBlock(x, y + 1, z).equals(this); + } + + return false; + } + + @Override + public IIcon getIcon(int side, int meta) { + + switch (meta | (side << 4)) { + + case (SEC_HOR | 0 | (SIDE_B << 4)): + return iconBottomTip; + case (SEC_HOR | 0 | (SIDE_T << 4)): + return iconTopSide; + case (SEC_HOR | 0 | (SIDE_N << 4)): + return iconSide; + case (SEC_HOR | 0 | (SIDE_S << 4)): + return iconSide; + case (SEC_HOR | 0 | (SIDE_W << 4)): + return iconCross; + case (SEC_HOR | 0 | (SIDE_E << 4)): + return iconCross; + + case (SEC_HOR | 1 | (SIDE_B << 4)): + return iconBottomTip; + case (SEC_HOR | 1 | (SIDE_T << 4)): + return iconTopSide; + case (SEC_HOR | 1 | (SIDE_N << 4)): + return iconCross; + case (SEC_HOR | 1 | (SIDE_S << 4)): + return iconCross; + case (SEC_HOR | 1 | (SIDE_W << 4)): + return iconSide; + case (SEC_HOR | 1 | (SIDE_E << 4)): + return iconSide; + + case (SEC_HOR | 2 | (SIDE_B << 4)): + return iconCross; + case (SEC_HOR | 2 | (SIDE_T << 4)): + return iconCross; + case (SEC_HOR | 2 | (SIDE_N << 4)): + return iconSide; + case (SEC_HOR | 2 | (SIDE_S << 4)): + return iconSide; + case (SEC_HOR | 2 | (SIDE_W << 4)): + return iconSide; + case (SEC_HOR | 2 | (SIDE_E << 4)): + return iconSide; + + case (SEC_HOR | 3 | (SIDE_B << 4)): + return iconBottom; + case (SEC_HOR | 3 | (SIDE_T << 4)): + return iconTop; + case (SEC_HOR | 3 | (SIDE_N << 4)): + return iconSide; + case (SEC_HOR | 3 | (SIDE_S << 4)): + return iconSide; + case (SEC_HOR | 3 | (SIDE_W << 4)): + return iconSide; + case (SEC_HOR | 3 | (SIDE_E << 4)): + return iconSide; + + case (SEC_DOWN | 0 | (SIDE_B << 4)): + return iconCross; + case (SEC_DOWN | 0 | (SIDE_T << 4)): + return iconTopTip; + case (SEC_DOWN | 0 | (SIDE_N << 4)): + return iconCross; + case (SEC_DOWN | 0 | (SIDE_S << 4)): + return iconRightTip; + case (SEC_DOWN | 0 | (SIDE_W << 4)): + return iconLeftDown; + case (SEC_DOWN | 0 | (SIDE_E << 4)): + return iconRightDown; + + case (SEC_DOWN | 1 | (SIDE_B << 4)): + return iconCross; + case (SEC_DOWN | 1 | (SIDE_T << 4)): + return iconTopTip; + case (SEC_DOWN | 1 | (SIDE_N << 4)): + return iconLeftTip; + case (SEC_DOWN | 1 | (SIDE_S << 4)): + return iconCross; + case (SEC_DOWN | 1 | (SIDE_W << 4)): + return iconRightDown; + case (SEC_DOWN | 1 | (SIDE_E << 4)): + return iconLeftDown; + + case (SEC_DOWN | 2 | (SIDE_B << 4)): + return iconCross; + case (SEC_DOWN | 2 | (SIDE_T << 4)): + return iconTopTip; + case (SEC_DOWN | 2 | (SIDE_N << 4)): + return iconRightDown; + case (SEC_DOWN | 2 | (SIDE_S << 4)): + return iconLeftDown; + case (SEC_DOWN | 2 | (SIDE_W << 4)): + return iconCross; + case (SEC_DOWN | 2 | (SIDE_E << 4)): + return iconLeftTip; + + case (SEC_DOWN | 3 | (SIDE_B << 4)): + return iconCross; + case (SEC_DOWN | 3 | (SIDE_T << 4)): + return iconTopTip; + case (SEC_DOWN | 3 | (SIDE_N << 4)): + return iconLeftDown; + case (SEC_DOWN | 3 | (SIDE_S << 4)): + return iconRightDown; + case (SEC_DOWN | 3 | (SIDE_W << 4)): + return iconRightTip; + case (SEC_DOWN | 3 | (SIDE_E << 4)): + return iconCross; + + case (SEC_UP | 0 | (SIDE_B << 4)): + return iconBottomSide; + case (SEC_UP | 0 | (SIDE_T << 4)): + return iconCross; + case (SEC_UP | 0 | (SIDE_N << 4)): + return iconCross; + case (SEC_UP | 0 | (SIDE_S << 4)): + return iconLeftTip; + case (SEC_UP | 0 | (SIDE_W << 4)): + return iconLeftUp; + case (SEC_UP | 0 | (SIDE_E << 4)): + return iconRightUp; + + case (SEC_UP | 1 | (SIDE_B << 4)): + return iconBottomSide; + case (SEC_UP | 1 | (SIDE_T << 4)): + return iconCross; + case (SEC_UP | 1 | (SIDE_N << 4)): + return iconRightTip; + case (SEC_UP | 1 | (SIDE_S << 4)): + return iconCross; + case (SEC_UP | 1 | (SIDE_W << 4)): + return iconRightUp; + case (SEC_UP | 1 | (SIDE_E << 4)): + return iconLeftUp; + + case (SEC_UP | 2 | (SIDE_B << 4)): + return iconBottomSide; + case (SEC_UP | 2 | (SIDE_T << 4)): + return iconCross; + case (SEC_UP | 2 | (SIDE_N << 4)): + return iconRightUp; + case (SEC_UP | 2 | (SIDE_S << 4)): + return iconLeftUp; + case (SEC_UP | 2 | (SIDE_W << 4)): + return iconCross; + case (SEC_UP | 2 | (SIDE_E << 4)): + return iconRightTip; + + case (SEC_UP | 3 | (SIDE_B << 4)): + return iconBottomSide; + case (SEC_UP | 3 | (SIDE_T << 4)): + return iconCross; + case (SEC_UP | 3 | (SIDE_N << 4)): + return iconLeftUp; + case (SEC_UP | 3 | (SIDE_S << 4)): + return iconRightUp; + case (SEC_UP | 3 | (SIDE_W << 4)): + return iconLeftTip; + case (SEC_UP | 3 | (SIDE_E << 4)): + return iconCross; + + case (SEC_HEAD | 0 | (SIDE_B << 4)): + return iconBottomSide; + case (SEC_HEAD | 0 | (SIDE_T << 4)): + return iconTopTip; + case (SEC_HEAD | 0 | (SIDE_N << 4)): + return iconFace; + case (SEC_HEAD | 0 | (SIDE_S << 4)): + return iconCross; + case (SEC_HEAD | 0 | (SIDE_W << 4)): + return iconFaceLeft; + case (SEC_HEAD | 0 | (SIDE_E << 4)): + return iconFaceRight; + + case (SEC_HEAD | 1 | (SIDE_B << 4)): + return iconBottomSide; + case (SEC_HEAD | 1 | (SIDE_T << 4)): + return iconTopTip; + case (SEC_HEAD | 1 | (SIDE_N << 4)): + return iconCross; + case (SEC_HEAD | 1 | (SIDE_S << 4)): + return iconFace; + case (SEC_HEAD | 1 | (SIDE_W << 4)): + return iconFaceRight; + case (SEC_HEAD | 1 | (SIDE_E << 4)): + return iconFaceLeft; + + case (SEC_HEAD | 2 | (SIDE_B << 4)): + return iconBottomSide; + case (SEC_HEAD | 2 | (SIDE_T << 4)): + return iconTopTip; + case (SEC_HEAD | 2 | (SIDE_N << 4)): + return iconFaceRight; + case (SEC_HEAD | 2 | (SIDE_S << 4)): + return iconFaceLeft; + case (SEC_HEAD | 2 | (SIDE_W << 4)): + return iconFace; + case (SEC_HEAD | 2 | (SIDE_E << 4)): + return iconCross; + + case (SEC_HEAD | 3 | (SIDE_B << 4)): + return iconBottomSide; + case (SEC_HEAD | 3 | (SIDE_T << 4)): + return iconTopTip; + case (SEC_HEAD | 3 | (SIDE_N << 4)): + return iconFaceLeft; + case (SEC_HEAD | 3 | (SIDE_S << 4)): + return iconFaceRight; + case (SEC_HEAD | 3 | (SIDE_W << 4)): + return iconCross; + case (SEC_HEAD | 3 | (SIDE_E << 4)): + return iconFace; + + } + + return iconCross; + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + list.add(new ItemStack(item, 1, 1)); + list.add(new ItemStack(item, 1, 13)); + } + + @Override + public int damageDropped(int meta) { + if (meta < 4) { + return 1; + } + + return 13; + } + + @Override + public void registerBlockIcons(IIconRegister register) { + iconFaceLeft = register.registerIcon(iconPrefix + "face-left"); + iconFaceRight = register.registerIcon(iconPrefix + "face-right"); + iconFace = register.registerIcon(iconPrefix + "face"); + + iconLeftUp = register.registerIcon(iconPrefix + "left-up"); + iconLeftDown = register.registerIcon(iconPrefix + "left-down"); + iconLeftTip = register.registerIcon(iconPrefix + "left-tip"); + + iconRightUp = register.registerIcon(iconPrefix + "right-up"); + iconRightDown = register.registerIcon(iconPrefix + "right-down"); + iconRightTip = register.registerIcon(iconPrefix + "right-tip"); + + iconTop = register.registerIcon(iconPrefix + "top"); + iconTopTip = register.registerIcon(iconPrefix + "top-tip"); + iconTopSide = register.registerIcon(iconPrefix + "top-side"); + + iconBottom = register.registerIcon(iconPrefix + "bot"); + iconBottomTip = register.registerIcon(iconPrefix + "bot-tip"); + iconBottomSide = register.registerIcon(iconPrefix + "bot-side"); + + iconCross = register.registerIcon(iconPrefix + "crosssection"); + iconSide = register.registerIcon(iconPrefix + "side"); + } +} diff --git a/src/main/java/team/chisel/block/BlockSnakestoneObsidian.java b/src/main/java/team/chisel/block/BlockSnakestoneObsidian.java index a81cb56b..f3c710ed 100644 --- a/src/main/java/team/chisel/block/BlockSnakestoneObsidian.java +++ b/src/main/java/team/chisel/block/BlockSnakestoneObsidian.java @@ -2,34 +2,35 @@ package team.chisel.block; import java.util.Random; -import team.chisel.client.GeneralChiselClient; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import team.chisel.client.GeneralChiselClient; + public class BlockSnakestoneObsidian extends BlockSnakestone { - public static IIcon[] particles = new IIcon[8]; + public static IIcon[] particles = new IIcon[8]; - public BlockSnakestoneObsidian(String iconPrefix) { - super(iconPrefix); + public BlockSnakestoneObsidian(String iconPrefix) { + super(iconPrefix); - flipTopTextures = true; + flipTopTextures = true; - } + } - @Override - public void randomDisplayTick(World world, int x, int y, int z, Random random) { - GeneralChiselClient.spawnSnakestoneObsidianFX(world, this, x, y, z); - } + @Override + public void randomDisplayTick(World world, int x, int y, int z, Random random) { + GeneralChiselClient.spawnSnakestoneObsidianFX(world, this, x, y, z); + } - @Override - public void registerBlockIcons(IIconRegister register) { - super.registerBlockIcons(register); + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); - for (int i = 0; i < particles.length; i++) { - particles[i] = register.registerIcon(iconPrefix + "particles/" + i); - } - } + for (int i = 0; i < particles.length; i++) { + particles[i] = register.registerIcon(iconPrefix + "particles/" + i); + } + } } diff --git a/src/main/java/team/chisel/block/BlockWaterstone.java b/src/main/java/team/chisel/block/BlockWaterstone.java index c17d73c8..87db930e 100644 --- a/src/main/java/team/chisel/block/BlockWaterstone.java +++ b/src/main/java/team/chisel/block/BlockWaterstone.java @@ -4,12 +4,12 @@ import net.minecraft.block.material.Material; public class BlockWaterstone extends BlockMultiLayer { - public BlockWaterstone(Material mat, String baseIcon) { - super(mat, baseIcon); - } + public BlockWaterstone(Material mat, String baseIcon) { + super(mat, baseIcon); + } - @Override - public boolean renderAsNormalBlock() { - return true; - } + @Override + public boolean renderAsNormalBlock() { + return true; + } } diff --git a/src/main/java/team/chisel/block/CarvableStairsMaker.java b/src/main/java/team/chisel/block/CarvableStairsMaker.java index c061f7a9..94f1ef69 100644 --- a/src/main/java/team/chisel/block/CarvableStairsMaker.java +++ b/src/main/java/team/chisel/block/CarvableStairsMaker.java @@ -2,41 +2,48 @@ package team.chisel.block; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; + import team.chisel.carving.Carving; import team.chisel.item.ItemCarvable; import com.cricketcraft.chisel.api.ChiselTabs; import com.cricketcraft.chisel.api.carving.CarvableHelper; import com.cricketcraft.chisel.api.carving.CarvingUtils; - import cpw.mods.fml.common.registry.GameRegistry; public class CarvableStairsMaker { - public final CarvableHelper carverHelper; - private Block blockBase; + public final CarvableHelper carverHelper; + private Block blockBase; - public CarvableStairsMaker(Block base) { - blockBase = base; - carverHelper = new CarvableHelper(base); - } + public CarvableStairsMaker(Block base) { + blockBase = base; + carverHelper = new CarvableHelper(base); + } - public void create(String name, Block[] blocks) { - create(null, name, blocks); - } + public void create(String name, Block[] blocks) { + create(null, name, blocks); + } - public void create(IStairsCreator creator, String name, Block[] blocks) { - for (int i = 0; i < blocks.length; i++) { - String n = name + "." + i; - blocks[i] = creator == null ? new BlockCarvableStairs(blockBase, i * 2, carverHelper) : creator.create(blockBase, i * 2, carverHelper); + public void create(IStairsCreator creator, String name, Block[] blocks) { + for (int i = 0; i < blocks.length; i++) { + String n = name + "." + i; + blocks[i] = creator == null ? new BlockCarvableStairs(blockBase, i * 2, carverHelper) + : creator.create(blockBase, i * 2, carverHelper); - blocks[i].setBlockName("chisel." + n).setCreativeTab(ChiselTabs.tabStairChiselBlocks); - GameRegistry.registerBlock(blocks[i], ItemCarvable.class, n); + blocks[i].setBlockName("chisel." + n).setCreativeTab(ChiselTabs.tabStairChiselBlocks); + GameRegistry.registerBlock(blocks[i], ItemCarvable.class, n); - for (int meta = 0; meta < 2 && i * 2 + meta < carverHelper.infoList.size(); meta++) { - Carving.chisel.addVariation(name, CarvingUtils.getDefaultVariationFor(blocks[i], meta * 8, i)); - GameRegistry.addRecipe(new ItemStack(blocks[i], 4, meta * 8), "* ", "** ", "***", '*', new ItemStack(blockBase, 1, i * 2 + meta)); - } - } - } + for (int meta = 0; meta < 2 && i * 2 + meta < carverHelper.infoList.size(); meta++) { + Carving.chisel.addVariation(name, CarvingUtils.getDefaultVariationFor(blocks[i], meta * 8, i)); + GameRegistry.addRecipe( + new ItemStack(blocks[i], 4, meta * 8), + "* ", + "** ", + "***", + '*', + new ItemStack(blockBase, 1, i * 2 + meta)); + } + } + } } diff --git a/src/main/java/team/chisel/block/IStairsCreator.java b/src/main/java/team/chisel/block/IStairsCreator.java index 160b9a35..76656507 100644 --- a/src/main/java/team/chisel/block/IStairsCreator.java +++ b/src/main/java/team/chisel/block/IStairsCreator.java @@ -1,10 +1,10 @@ package team.chisel.block; -import com.cricketcraft.chisel.api.carving.CarvableHelper; - import net.minecraft.block.Block; +import com.cricketcraft.chisel.api.carving.CarvableHelper; + public interface IStairsCreator { - public BlockCarvableStairs create(Block block, int meta, CarvableHelper helper); + public BlockCarvableStairs create(Block block, int meta, CarvableHelper helper); } diff --git a/src/main/java/team/chisel/block/tileentity/IDoubleChest.java b/src/main/java/team/chisel/block/tileentity/IDoubleChest.java index 12083d26..491a44c9 100644 --- a/src/main/java/team/chisel/block/tileentity/IDoubleChest.java +++ b/src/main/java/team/chisel/block/tileentity/IDoubleChest.java @@ -4,26 +4,23 @@ import net.minecraft.item.ItemStack; public interface IDoubleChest { - /** - * @return The size of this specific chest's inventory. Does not account for the connection. - */ - int getTrueSizeInventory(); + /** + * @return The size of this specific chest's inventory. Does not account for the connection. + */ + int getTrueSizeInventory(); - /** - * @param slot - * The true slot index. - * @return The actual stack in this chest's slot. Does not account for the connection. - */ - ItemStack getTrueStackInSlot(int slot); + /** + * @param slot The true slot index. + * @return The actual stack in this chest's slot. Does not account for the connection. + */ + ItemStack getTrueStackInSlot(int slot); - /** - * Puts a stack in this chest's real slot at the given true index. - * - * @param slot - * The true slot index. - * @param stack - * The ItemStack to place in the slot. - */ - void putStackInTrueSlot(int slot, ItemStack stack); + /** + * Puts a stack in this chest's real slot at the given true index. + * + * @param slot The true slot index. + * @param stack The ItemStack to place in the slot. + */ + void putStackInTrueSlot(int slot, ItemStack stack); } diff --git a/src/main/java/team/chisel/block/tileentity/TileEntityAutoChisel.java b/src/main/java/team/chisel/block/tileentity/TileEntityAutoChisel.java index bf625ee0..65fbf653 100644 --- a/src/main/java/team/chisel/block/tileentity/TileEntityAutoChisel.java +++ b/src/main/java/team/chisel/block/tileentity/TileEntityAutoChisel.java @@ -14,6 +14,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; + import team.chisel.Features; import team.chisel.carving.Carving; import team.chisel.client.GeneralChiselClient; @@ -30,437 +31,450 @@ import cpw.mods.fml.relauncher.SideOnly; public class TileEntityAutoChisel extends TileEntity implements ISidedInventory { - public enum Upgrade { - SPEED, - AUTOMATION, - STACK, - REVERSION; - - public String getUnlocalizedName() { - if (Features.AUTO_CHISEL_UPGRADES.enabled()) { - return "item.upgrade_" + this.name().toLowerCase(); - } - return "chisel.autochisel.upgrade.disabled"; - } - - public String getLocalizedName() { - String ret = StatCollector.translateToLocal("autochisel.slot." + this.name().toLowerCase() + ".tooltip"); - if (!Features.AUTO_CHISEL_UPGRADES.enabled()) { - ret = EnumChatFormatting.RED.toString().concat(ret); - } - return ret; - } - } - - public static final int BASE = 0, TARGET = 1, OUTPUT = 2, CHISEL = 3, MIN_UPGRADE = 4; - private static final int FAST_SPEED = 1, SLOW_SPEED = 4; - - private int progress = 0; - - private static EntityItem ghostItem; - boolean equal = false; - private ItemStack[] inventory = new ItemStack[8]; - private String name = "autoChisel"; - - // client animation fields - - // used for floating target - public float xRot, yRot, zRot; - - // used for chisel item rotation - public static final int maxRot = 60; - public static final int rotAmnt = 15; - public float chiselRot; - public boolean chiseling = false, breakChisel = false;; - public int toChisel = 1; - - private ItemStack lastBase; - - @Override - public boolean canUpdate() { - return true; - } - - @Override - public ItemStack decrStackSize(int slot, int size) { - if (inventory[slot] != null) { - ItemStack is; - if (inventory[slot].stackSize <= size) { - is = inventory[slot]; - inventory[slot] = null; - return is; - } else { - is = inventory[slot].splitStack(size); - if (inventory[slot].stackSize == 0) - inventory[slot] = null; - return is; - } - } else { - return null; - } - } - - @Override - public void readFromNBT(NBTTagCompound nbt) { - super.readFromNBT(nbt); - NBTTagList tags = nbt.getTagList("Items", 10); - inventory = new ItemStack[getSizeInventory()]; - - for (int i = 0; i < tags.tagCount(); i++) { - NBTTagCompound data = tags.getCompoundTagAt(i); - int j = data.getByte("Slot") & 255; - - if (j >= 0 && j < inventory.length) { - inventory[j] = ItemStack.loadItemStackFromNBT(data); - } - } - - if (nbt.hasKey("CustomName", 8)) { - this.name = nbt.getString("CustomName"); - } - } - - @Override - public void updateEntity() { - - ItemStack base = inventory[BASE], target = getTarget(), output = inventory[OUTPUT]; - - if (!worldObj.isRemote && hasChisel() && base != null && target != null) { - if (canBeMadeFrom(base, target)) { - if (progress >= (hasUpgrade(Upgrade.SPEED) ? FAST_SPEED : SLOW_SPEED)) { - - // reset progress - progress = 0; - - // the max possible for this craft - int canBeMade = target.getMaxStackSize(); - - // if there are items in the output, they count towards the max we can make - if (output != null) { - canBeMade -= output.stackSize; - } - - // can't make more than we have - canBeMade = Math.min(base.stackSize, canBeMade); - - // if we can't make any, forget it - if (canBeMade <= 0) { - return; - } - - // result will always be a copy of the target - ItemStack chiseled = target.copy(); - - // if we have the stack upgrade, boost the stack size to the max possible, otherwise just one - chiseled.stackSize = hasUpgrade(Upgrade.STACK) ? canBeMade : 1; - - if (canChisel(chiseled)) { - // if our output is empty, just use the current result - if (output == null) { - setInventorySlotContents(OUTPUT, chiseled); - } else { - // otherwise just add our result to the existing stack - inventory[OUTPUT].stackSize += chiseled.stackSize; - slotChanged(OUTPUT); - } - - chiselItem(chiseled.stackSize, target); - - // remove what we made from the stack - base.stackSize -= chiseled.stackSize; - if (base.stackSize <= 0) { - setInventorySlotContents(BASE, null); // clear out 0 size itemstacks - } - } - } else if (worldObj.getTotalWorldTime() % 10 == 0) { - progress++; - } - } - } else if (worldObj.isRemote) { - if (chiseling) { - chiselRot += rotAmnt; - if (chiselRot >= maxRot) { - chiselItem(0, getTarget()); - } - } else { - chiselRot = Math.max(chiselRot - rotAmnt, 0); - } - } - } - - private ItemStack getTarget() { - if (inventory[BASE] != null && hasUpgrade(Upgrade.REVERSION)) { - // if we have a reversion upgrade, use that for the target - List possible = Carving.chisel.getItemsForChiseling(inventory[BASE]); - return possible.isEmpty() ? null : possible.get(0); - } else { - return inventory[TARGET]; - } - } - - // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target - private boolean canBeMadeFrom(ItemStack from, ItemStack to) { - List results = Carving.chisel.getItemsForChiseling(from); - for (ItemStack s : results) { - if (s.getItem() == to.getItem() && s.getItemDamage() == to.getItemDamage()) { - return true; - } - } - return false; - } - - private boolean canChisel(ItemStack toMerge) { - // if the output slot is empty we can merge without checking - if (inventory[OUTPUT] == null) { - return true; - } - - // need to check NBT as well as item - if (!toMerge.isItemEqual(inventory[OUTPUT]) || !ItemStack.areItemStackTagsEqual(toMerge, inventory[OUTPUT])) { - return false; - } - - // we only care about metadata if the item has subtypes - if (toMerge.getHasSubtypes() && toMerge.getItemDamage() != inventory[OUTPUT].getItemDamage()) { - return false; - } - - return ((IChiselItem) inventory[CHISEL].getItem()).canChisel(worldObj, inventory[CHISEL], General.getVariation(getTarget())); - } - - private boolean hasChisel() { - return inventory[CHISEL] != null && inventory[CHISEL].getItem() instanceof IChiselItem && inventory[CHISEL].stackSize >= 1; - } - - /** Calls IChiselItem#onChisel() and sends the chisel packet for sound/animation */ - private void chiselItem(int chiseled, ItemStack target) { - if (!worldObj.isRemote) { - boolean breakChisel = false; - if (((IChiselItem) inventory[CHISEL].getItem()).onChisel(worldObj, inventory[CHISEL], General.getVariation(target))) { - inventory[CHISEL].setItemDamage(inventory[CHISEL].getItemDamage() + 1); - if (inventory[CHISEL].getItemDamage() >= inventory[CHISEL].getMaxDamage()) { - setInventorySlotContents(CHISEL, null); - breakChisel = true; - } - } - PacketHandler.INSTANCE.sendToDimension(new MessageAutoChisel(this, chiseled, true, breakChisel), worldObj.provider.dimensionId); - } else { - if (breakChisel) { - worldObj.playSound(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "random.break", 0.8F, 0.8F + worldObj.rand.nextFloat() * 0.4F, false); - } - GeneralChiselClient.spawnAutoChiselFX(this, lastBase != null ? lastBase : inventory[BASE]); - chiseling = false; - if (lastBase != null) { - lastBase.stackSize -= toChisel; - if (lastBase.stackSize <= 0) { - lastBase = null; - } - } - } - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); - NBTTagList tags = new NBTTagList(); - - for (int i = 0; i < inventory.length; i++) { - if (inventory[i] != null) { - NBTTagCompound data = new NBTTagCompound(); - data.setByte("Slot", (byte) i); - inventory[i].writeToNBT(data); - tags.appendTag(data); - } - } - - nbt.setTag("Items", tags); - - if (this.hasCustomInventoryName()) { - nbt.setString("CustomName", this.name); - } - } - - @Override - public int getSizeInventory() { - return inventory.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return inventory[slot]; - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - if (inventory[slot] != null) { - ItemStack is = inventory[slot]; - inventory[slot] = null; - return is; - } else - return null; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory[slot] = stack; - - if (stack != null && stack.stackSize > getInventoryStackLimit()) { - stack.stackSize = getInventoryStackLimit(); - } - - if (worldObj.isRemote && slot == BASE && stack != null) { - lastBase = stack.copy(); - } - - if (!worldObj.isRemote) { - slotChanged(slot); - } - } - - private void slotChanged(int slot) { - PacketHandler.INSTANCE.sendToDimension(new MessageSlotUpdate(this, slot, inventory[slot]), worldObj.provider.dimensionId); - markDirty(); - } - - @Override - public String getInventoryName() { - return name; - } - - @Override - public final boolean isUseableByPlayer(EntityPlayer player) { - return true; - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return new int[] { BASE, TARGET, OUTPUT, CHISEL }; - } - - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemStack) { - if (itemStack == null) { - return false; - } - - switch (slot) { - case BASE: - case TARGET: - return !Carving.chisel.getItemsForChiseling(itemStack).isEmpty(); - case OUTPUT: - return false; - case CHISEL: - return itemStack.getItem() instanceof IChiselItem; - default: - return Features.AUTO_CHISEL_UPGRADES.enabled() && itemStack.getItem() == ChiselItems.upgrade && Upgrade.values()[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage(); - } - } - - @Override - public boolean canInsertItem(int slot, ItemStack itemStack, int side) { - return hasUpgrade(Upgrade.AUTOMATION) && (slot == BASE || slot == TARGET || slot == CHISEL); - } - - @Override - public boolean canExtractItem(int slot, ItemStack itemStack, int side) { - return hasUpgrade(Upgrade.AUTOMATION) && slot == OUTPUT; - } - - @Override - public void openInventory() { - ; - } - - @Override - public void closeInventory() { - ; - } - - @SideOnly(Side.CLIENT) - public EntityItem getItemForRendering(int slot) { - if (ghostItem == null) { - ghostItem = new EntityItem(worldObj); - ghostItem.hoverStart = 0.0F; - } - - if (slot == BASE && lastBase != null) { - ghostItem.setEntityItemStack(lastBase.copy()); - return ghostItem; - } else if (slot == TARGET) { - ItemStack target = getTarget(); - if (target != null) { - ghostItem.setEntityItemStack(target); - return ghostItem; - } - return null; - } else if (inventory[slot] == null) { - return null; - } else { - ghostItem.setEntityItemStack(inventory[slot].copy()); - return ghostItem; - } - } - - @Override - public Packet getDescriptionPacket() { - NBTTagCompound tag = new NBTTagCompound(); - writeToNBT(tag); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { - readFromNBT(packet.func_148857_g()); - } - - public boolean hasUpgrade(Upgrade upgrade) { - if (Features.AUTO_CHISEL_UPGRADES.enabled()) { - ItemStack stack = inventory[MIN_UPGRADE + upgrade.ordinal()]; - if (stack != null) { - return stack.getItem() == ChiselItems.upgrade && stack.getItemDamage() == upgrade.ordinal(); - } - return false; - } - - return upgrade == Upgrade.REVERSION ? false : true; - } - - public String getSlotTooltipUnloc(int slotNumber) { - String base = "autochisel.slot.%s.tooltip"; - String name = null; - if (slotNumber < MIN_UPGRADE) { - if (slotNumber == TARGET) { - name = "target"; - } else if (slotNumber == CHISEL) { - name = "chisel"; - } - String unloc = name == null ? null : String.format(base, name); - return StatCollector.translateToLocal(unloc); - } else { - return Upgrade.values()[slotNumber - MIN_UPGRADE].getLocalizedName(); - } - } - - public void doChiselAnim(ItemStack lastChiseled, int chiseled, boolean playSound, boolean breakChisel) { - this.lastBase = lastChiseled == null ? null : lastChiseled.copy(); - this.toChisel = chiseled; - if (playSound) { - this.chiseling = true; - } - this.breakChisel = breakChisel; - } - - public ItemStack getLastBase() { - return lastBase == null ? null : lastBase.copy(); - } + public enum Upgrade { + + SPEED, + AUTOMATION, + STACK, + REVERSION; + + public String getUnlocalizedName() { + if (Features.AUTO_CHISEL_UPGRADES.enabled()) { + return "item.upgrade_" + this.name().toLowerCase(); + } + return "chisel.autochisel.upgrade.disabled"; + } + + public String getLocalizedName() { + String ret = StatCollector.translateToLocal("autochisel.slot." + this.name().toLowerCase() + ".tooltip"); + if (!Features.AUTO_CHISEL_UPGRADES.enabled()) { + ret = EnumChatFormatting.RED.toString().concat(ret); + } + return ret; + } + } + + public static final int BASE = 0, TARGET = 1, OUTPUT = 2, CHISEL = 3, MIN_UPGRADE = 4; + private static final int FAST_SPEED = 1, SLOW_SPEED = 4; + + private int progress = 0; + + private static EntityItem ghostItem; + boolean equal = false; + private ItemStack[] inventory = new ItemStack[8]; + private String name = "autoChisel"; + + // client animation fields + + // used for floating target + public float xRot, yRot, zRot; + + // used for chisel item rotation + public static final int maxRot = 60; + public static final int rotAmnt = 15; + public float chiselRot; + public boolean chiseling = false, breakChisel = false;; + public int toChisel = 1; + + private ItemStack lastBase; + + @Override + public boolean canUpdate() { + return true; + } + + @Override + public ItemStack decrStackSize(int slot, int size) { + if (inventory[slot] != null) { + ItemStack is; + if (inventory[slot].stackSize <= size) { + is = inventory[slot]; + inventory[slot] = null; + return is; + } else { + is = inventory[slot].splitStack(size); + if (inventory[slot].stackSize == 0) inventory[slot] = null; + return is; + } + } else { + return null; + } + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + NBTTagList tags = nbt.getTagList("Items", 10); + inventory = new ItemStack[getSizeInventory()]; + + for (int i = 0; i < tags.tagCount(); i++) { + NBTTagCompound data = tags.getCompoundTagAt(i); + int j = data.getByte("Slot") & 255; + + if (j >= 0 && j < inventory.length) { + inventory[j] = ItemStack.loadItemStackFromNBT(data); + } + } + + if (nbt.hasKey("CustomName", 8)) { + this.name = nbt.getString("CustomName"); + } + } + + @Override + public void updateEntity() { + + ItemStack base = inventory[BASE], target = getTarget(), output = inventory[OUTPUT]; + + if (!worldObj.isRemote && hasChisel() && base != null && target != null) { + if (canBeMadeFrom(base, target)) { + if (progress >= (hasUpgrade(Upgrade.SPEED) ? FAST_SPEED : SLOW_SPEED)) { + + // reset progress + progress = 0; + + // the max possible for this craft + int canBeMade = target.getMaxStackSize(); + + // if there are items in the output, they count towards the max we can make + if (output != null) { + canBeMade -= output.stackSize; + } + + // can't make more than we have + canBeMade = Math.min(base.stackSize, canBeMade); + + // if we can't make any, forget it + if (canBeMade <= 0) { + return; + } + + // result will always be a copy of the target + ItemStack chiseled = target.copy(); + + // if we have the stack upgrade, boost the stack size to the max possible, otherwise just one + chiseled.stackSize = hasUpgrade(Upgrade.STACK) ? canBeMade : 1; + + if (canChisel(chiseled)) { + // if our output is empty, just use the current result + if (output == null) { + setInventorySlotContents(OUTPUT, chiseled); + } else { + // otherwise just add our result to the existing stack + inventory[OUTPUT].stackSize += chiseled.stackSize; + slotChanged(OUTPUT); + } + + chiselItem(chiseled.stackSize, target); + + // remove what we made from the stack + base.stackSize -= chiseled.stackSize; + if (base.stackSize <= 0) { + setInventorySlotContents(BASE, null); // clear out 0 size itemstacks + } + } + } else if (worldObj.getTotalWorldTime() % 10 == 0) { + progress++; + } + } + } else if (worldObj.isRemote) { + if (chiseling) { + chiselRot += rotAmnt; + if (chiselRot >= maxRot) { + chiselItem(0, getTarget()); + } + } else { + chiselRot = Math.max(chiselRot - rotAmnt, 0); + } + } + } + + private ItemStack getTarget() { + if (inventory[BASE] != null && hasUpgrade(Upgrade.REVERSION)) { + // if we have a reversion upgrade, use that for the target + List possible = Carving.chisel.getItemsForChiseling(inventory[BASE]); + return possible.isEmpty() ? null : possible.get(0); + } else { + return inventory[TARGET]; + } + } + + // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target + private boolean canBeMadeFrom(ItemStack from, ItemStack to) { + List results = Carving.chisel.getItemsForChiseling(from); + for (ItemStack s : results) { + if (s.getItem() == to.getItem() && s.getItemDamage() == to.getItemDamage()) { + return true; + } + } + return false; + } + + private boolean canChisel(ItemStack toMerge) { + // if the output slot is empty we can merge without checking + if (inventory[OUTPUT] == null) { + return true; + } + + // need to check NBT as well as item + if (!toMerge.isItemEqual(inventory[OUTPUT]) || !ItemStack.areItemStackTagsEqual(toMerge, inventory[OUTPUT])) { + return false; + } + + // we only care about metadata if the item has subtypes + if (toMerge.getHasSubtypes() && toMerge.getItemDamage() != inventory[OUTPUT].getItemDamage()) { + return false; + } + + return ((IChiselItem) inventory[CHISEL].getItem()) + .canChisel(worldObj, inventory[CHISEL], General.getVariation(getTarget())); + } + + private boolean hasChisel() { + return inventory[CHISEL] != null && inventory[CHISEL].getItem() instanceof IChiselItem + && inventory[CHISEL].stackSize >= 1; + } + + /** Calls IChiselItem#onChisel() and sends the chisel packet for sound/animation */ + private void chiselItem(int chiseled, ItemStack target) { + if (!worldObj.isRemote) { + boolean breakChisel = false; + if (((IChiselItem) inventory[CHISEL].getItem()) + .onChisel(worldObj, inventory[CHISEL], General.getVariation(target))) { + inventory[CHISEL].setItemDamage(inventory[CHISEL].getItemDamage() + 1); + if (inventory[CHISEL].getItemDamage() >= inventory[CHISEL].getMaxDamage()) { + setInventorySlotContents(CHISEL, null); + breakChisel = true; + } + } + PacketHandler.INSTANCE.sendToDimension( + new MessageAutoChisel(this, chiseled, true, breakChisel), + worldObj.provider.dimensionId); + } else { + if (breakChisel) { + worldObj.playSound( + xCoord + 0.5, + yCoord + 0.5, + zCoord + 0.5, + "random.break", + 0.8F, + 0.8F + worldObj.rand.nextFloat() * 0.4F, + false); + } + GeneralChiselClient.spawnAutoChiselFX(this, lastBase != null ? lastBase : inventory[BASE]); + chiseling = false; + if (lastBase != null) { + lastBase.stackSize -= toChisel; + if (lastBase.stackSize <= 0) { + lastBase = null; + } + } + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + NBTTagList tags = new NBTTagList(); + + for (int i = 0; i < inventory.length; i++) { + if (inventory[i] != null) { + NBTTagCompound data = new NBTTagCompound(); + data.setByte("Slot", (byte) i); + inventory[i].writeToNBT(data); + tags.appendTag(data); + } + } + + nbt.setTag("Items", tags); + + if (this.hasCustomInventoryName()) { + nbt.setString("CustomName", this.name); + } + } + + @Override + public int getSizeInventory() { + return inventory.length; + } + + @Override + public ItemStack getStackInSlot(int slot) { + return inventory[slot]; + } + + @Override + public ItemStack getStackInSlotOnClosing(int slot) { + if (inventory[slot] != null) { + ItemStack is = inventory[slot]; + inventory[slot] = null; + return is; + } else return null; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + inventory[slot] = stack; + + if (stack != null && stack.stackSize > getInventoryStackLimit()) { + stack.stackSize = getInventoryStackLimit(); + } + + if (worldObj.isRemote && slot == BASE && stack != null) { + lastBase = stack.copy(); + } + + if (!worldObj.isRemote) { + slotChanged(slot); + } + } + + private void slotChanged(int slot) { + PacketHandler.INSTANCE + .sendToDimension(new MessageSlotUpdate(this, slot, inventory[slot]), worldObj.provider.dimensionId); + markDirty(); + } + + @Override + public String getInventoryName() { + return name; + } + + @Override + public final boolean isUseableByPlayer(EntityPlayer player) { + return true; + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int[] getAccessibleSlotsFromSide(int side) { + return new int[] { BASE, TARGET, OUTPUT, CHISEL }; + } + + @Override + public boolean isItemValidForSlot(int slot, ItemStack itemStack) { + if (itemStack == null) { + return false; + } + + switch (slot) { + case BASE: + case TARGET: + return !Carving.chisel.getItemsForChiseling(itemStack).isEmpty(); + case OUTPUT: + return false; + case CHISEL: + return itemStack.getItem() instanceof IChiselItem; + default: + return Features.AUTO_CHISEL_UPGRADES.enabled() && itemStack.getItem() == ChiselItems.upgrade + && Upgrade.values()[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage(); + } + } + + @Override + public boolean canInsertItem(int slot, ItemStack itemStack, int side) { + return hasUpgrade(Upgrade.AUTOMATION) && (slot == BASE || slot == TARGET || slot == CHISEL); + } + + @Override + public boolean canExtractItem(int slot, ItemStack itemStack, int side) { + return hasUpgrade(Upgrade.AUTOMATION) && slot == OUTPUT; + } + + @Override + public void openInventory() { + ; + } + + @Override + public void closeInventory() { + ; + } + + @SideOnly(Side.CLIENT) + public EntityItem getItemForRendering(int slot) { + if (ghostItem == null) { + ghostItem = new EntityItem(worldObj); + ghostItem.hoverStart = 0.0F; + } + + if (slot == BASE && lastBase != null) { + ghostItem.setEntityItemStack(lastBase.copy()); + return ghostItem; + } else if (slot == TARGET) { + ItemStack target = getTarget(); + if (target != null) { + ghostItem.setEntityItemStack(target); + return ghostItem; + } + return null; + } else if (inventory[slot] == null) { + return null; + } else { + ghostItem.setEntityItemStack(inventory[slot].copy()); + return ghostItem; + } + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound tag = new NBTTagCompound(); + writeToNBT(tag); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { + readFromNBT(packet.func_148857_g()); + } + + public boolean hasUpgrade(Upgrade upgrade) { + if (Features.AUTO_CHISEL_UPGRADES.enabled()) { + ItemStack stack = inventory[MIN_UPGRADE + upgrade.ordinal()]; + if (stack != null) { + return stack.getItem() == ChiselItems.upgrade && stack.getItemDamage() == upgrade.ordinal(); + } + return false; + } + + return upgrade == Upgrade.REVERSION ? false : true; + } + + public String getSlotTooltipUnloc(int slotNumber) { + String base = "autochisel.slot.%s.tooltip"; + String name = null; + if (slotNumber < MIN_UPGRADE) { + if (slotNumber == TARGET) { + name = "target"; + } else if (slotNumber == CHISEL) { + name = "chisel"; + } + String unloc = name == null ? null : String.format(base, name); + return StatCollector.translateToLocal(unloc); + } else { + return Upgrade.values()[slotNumber - MIN_UPGRADE].getLocalizedName(); + } + } + + public void doChiselAnim(ItemStack lastChiseled, int chiseled, boolean playSound, boolean breakChisel) { + this.lastBase = lastChiseled == null ? null : lastChiseled.copy(); + this.toChisel = chiseled; + if (playSound) { + this.chiseling = true; + } + this.breakChisel = breakChisel; + } + + public ItemStack getLastBase() { + return lastBase == null ? null : lastBase.copy(); + } } diff --git a/src/main/java/team/chisel/block/tileentity/TileEntityCarvableBeacon.java b/src/main/java/team/chisel/block/tileentity/TileEntityCarvableBeacon.java index ec52c06f..706176f8 100644 --- a/src/main/java/team/chisel/block/tileentity/TileEntityCarvableBeacon.java +++ b/src/main/java/team/chisel/block/tileentity/TileEntityCarvableBeacon.java @@ -2,14 +2,15 @@ package team.chisel.block.tileentity; import net.minecraft.tileentity.TileEntityBeacon; import net.minecraft.util.AxisAlignedBB; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class TileEntityCarvableBeacon extends TileEntityBeacon { - @Override - @SideOnly(Side.CLIENT) - public AxisAlignedBB getRenderBoundingBox() { - return INFINITE_EXTENT_AABB; - } + @Override + @SideOnly(Side.CLIENT) + public AxisAlignedBB getRenderBoundingBox() { + return INFINITE_EXTENT_AABB; + } } diff --git a/src/main/java/team/chisel/block/tileentity/TileEntityPresent.java b/src/main/java/team/chisel/block/tileentity/TileEntityPresent.java index 09bce79e..e798d729 100644 --- a/src/main/java/team/chisel/block/tileentity/TileEntityPresent.java +++ b/src/main/java/team/chisel/block/tileentity/TileEntityPresent.java @@ -1,8 +1,5 @@ package team.chisel.block.tileentity; -import team.chisel.init.ChiselBlocks; -import team.chisel.network.PacketHandler; -import team.chisel.network.message.MessagePresentConnect; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -17,349 +14,358 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import team.chisel.init.ChiselBlocks; +import team.chisel.network.PacketHandler; +import team.chisel.network.message.MessagePresentConnect; + public class TileEntityPresent extends TileEntity implements IInventory, IDoubleChest { - private TileEntityPresent connection = null; - // If cachedDir is non-null, but connection is null, this present must be - // connected to an unloaded present. This is handled appropriately. - private ForgeDirection cachedDir = null; - private boolean isParent; - private final ItemStack[] inventory = new ItemStack[27]; - private int rotation; - private boolean autoSearch = true; + private TileEntityPresent connection = null; + // If cachedDir is non-null, but connection is null, this present must be + // connected to an unloaded present. This is handled appropriately. + private ForgeDirection cachedDir = null; + private boolean isParent; + private final ItemStack[] inventory = new ItemStack[27]; + private int rotation; + private boolean autoSearch = true; - @Override - public void updateEntity() { - if (!isConnected() && autoSearch && worldObj != null /* ugh */) { - if (cachedDir != null) { - connectTo(cachedDir); - } else if (!worldObj.isRemote) { - findConnections(); - } - autoSearch = false; - } - } + @Override + public void updateEntity() { + if (!isConnected() && autoSearch && worldObj != null /* ugh */) { + if (cachedDir != null) { + connectTo(cachedDir); + } else if (!worldObj.isRemote) { + findConnections(); + } + autoSearch = false; + } + } - public boolean isConnected() { - return connection != null; - } + public boolean isConnected() { + return connection != null; + } - private boolean connectTo(TileEntityPresent present, ForgeDirection dir) { - if (present.getBlockMetadata() == getBlockMetadata() && !present.isConnected() && (present.cachedDir == null || present.cachedDir == dir.getOpposite()) - && Math.abs(present.xCoord - xCoord + present.yCoord - yCoord + present.zCoord - zCoord) == 1) { - connection = present; - connection.connection = this; - connection.cachedDir = dir.getOpposite(); - connection.markDirty(); - cachedDir = dir; - isParent = !present.isParent; - markDirty(); - PacketHandler.INSTANCE.sendToDimension(new MessagePresentConnect(this, dir, true), worldObj.provider.dimensionId); - return true; - } - return false; - } + private boolean connectTo(TileEntityPresent present, ForgeDirection dir) { + if (present.getBlockMetadata() == getBlockMetadata() && !present.isConnected() + && (present.cachedDir == null || present.cachedDir == dir.getOpposite()) + && Math.abs(present.xCoord - xCoord + present.yCoord - yCoord + present.zCoord - zCoord) == 1) { + connection = present; + connection.connection = this; + connection.cachedDir = dir.getOpposite(); + connection.markDirty(); + cachedDir = dir; + isParent = !present.isParent; + markDirty(); + PacketHandler.INSTANCE + .sendToDimension(new MessagePresentConnect(this, dir, true), worldObj.provider.dimensionId); + return true; + } + return false; + } - public boolean connectTo(ForgeDirection dir) { - int x = xCoord + dir.offsetX, y = yCoord + dir.offsetY, z = zCoord + dir.offsetZ; - TileEntity te = getTileSafe(x, y, z); - if (te instanceof TileEntityPresent) { - return connectTo((TileEntityPresent) te, dir); - } - return !exists(x, y, z); - } + public boolean connectTo(ForgeDirection dir) { + int x = xCoord + dir.offsetX, y = yCoord + dir.offsetY, z = zCoord + dir.offsetZ; + TileEntity te = getTileSafe(x, y, z); + if (te instanceof TileEntityPresent) { + return connectTo((TileEntityPresent) te, dir); + } + return !exists(x, y, z); + } - /** - * @param preserveDir - * If true, this is only a virtual disconnect, meaning the other chest still exists, but is still loaded, so maintain a cachedDir for reconnection upon chunk load. - */ - public void disconnect(boolean preserveDir) { - if (isConnected()) { - if (!preserveDir) { - this.connection.cachedDir = null; - this.cachedDir = null; - } - this.connection.connection = null; - this.connection.markDirty(); - this.connection = null; - this.markDirty(); - PacketHandler.INSTANCE.sendToDimension(new MessagePresentConnect(this, ForgeDirection.UNKNOWN, false, preserveDir), worldObj.provider.dimensionId); - } - } + /** + * @param preserveDir If true, this is only a virtual disconnect, meaning the other chest still exists, but is still + * loaded, so maintain a cachedDir for reconnection upon chunk load. + */ + public void disconnect(boolean preserveDir) { + if (isConnected()) { + if (!preserveDir) { + this.connection.cachedDir = null; + this.cachedDir = null; + } + this.connection.connection = null; + this.connection.markDirty(); + this.connection = null; + this.markDirty(); + PacketHandler.INSTANCE.sendToDimension( + new MessagePresentConnect(this, ForgeDirection.UNKNOWN, false, preserveDir), + worldObj.provider.dimensionId); + } + } - public TileEntityPresent getConnection() { - return connection; - } + public TileEntityPresent getConnection() { + return connection; + } - public ForgeDirection getConnectionDir() { - return cachedDir == null ? ForgeDirection.UNKNOWN : cachedDir; - } + public ForgeDirection getConnectionDir() { + return cachedDir == null ? ForgeDirection.UNKNOWN : cachedDir; + } - public boolean isParent() { - return isParent || !isConnected(); - } + public boolean isParent() { + return isParent || !isConnected(); + } - public int getRotation() { - return rotation; - } + public int getRotation() { + return rotation; + } - public void setRotation(int rot) { - this.rotation = rot; - } + public void setRotation(int rot) { + this.rotation = rot; + } - public void findConnections() { - if (!isConnected()) { - if (cachedDir != null) { - if (connectTo(cachedDir)) { - return; - } - } - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - if (dir != ForgeDirection.UP && dir != ForgeDirection.DOWN) { - if (connectTo(dir)) { - return; - } - } - } - } - } + public void findConnections() { + if (!isConnected()) { + if (cachedDir != null) { + if (connectTo(cachedDir)) { + return; + } + } + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + if (dir != ForgeDirection.UP && dir != ForgeDirection.DOWN) { + if (connectTo(dir)) { + return; + } + } + } + } + } - public TileEntityPresent getParent() { - return isParent || connection == null ? this : connection; - } + public TileEntityPresent getParent() { + return isParent || connection == null ? this : connection; + } - @Override - public AxisAlignedBB getRenderBoundingBox() { - return ChiselBlocks.present.getBoundingBox(this); - } + @Override + public AxisAlignedBB getRenderBoundingBox() { + return ChiselBlocks.present.getBoundingBox(this); + } - @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); - NBTTagList nbttaglist = new NBTTagList(); + @Override + public void writeToNBT(NBTTagCompound tag) { + super.writeToNBT(tag); + NBTTagList nbttaglist = new NBTTagList(); - for (int i = 0; i < getTrueSizeInventory(); ++i) { - if (inventory[i] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - inventory[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); - } - } + for (int i = 0; i < getTrueSizeInventory(); ++i) { + if (inventory[i] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + inventory[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } - tag.setTag("Items", nbttaglist); - tag.setBoolean("isParent", isParent); - tag.setInteger("rotation", rotation); - if (cachedDir != null) { - tag.setInteger("conDir", cachedDir.ordinal()); - } - } + tag.setTag("Items", nbttaglist); + tag.setBoolean("isParent", isParent); + tag.setInteger("rotation", rotation); + if (cachedDir != null) { + tag.setInteger("conDir", cachedDir.ordinal()); + } + } - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); - NBTTagList nbttaglist = tag.getTagList("Items", 10); + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + NBTTagList nbttaglist = tag.getTagList("Items", 10); - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - int j = nbttagcompound1.getByte("Slot") & 255; + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound1.getByte("Slot") & 255; - if (j >= 0 && j < getTrueSizeInventory()) { - inventory[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - } - } + if (j >= 0 && j < getTrueSizeInventory()) { + inventory[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } - this.isParent = tag.getBoolean("isParent"); + this.isParent = tag.getBoolean("isParent"); - this.rotation = tag.getInteger("rotation"); - if (tag.hasKey("conDir")) { - cachedDir = ForgeDirection.values()[tag.getInteger("conDir")]; - } - autoSearch = true; - } + this.rotation = tag.getInteger("rotation"); + if (tag.hasKey("conDir")) { + cachedDir = ForgeDirection.values()[tag.getInteger("conDir")]; + } + autoSearch = true; + } - @Override - public Packet getDescriptionPacket() { - NBTTagCompound tag = new NBTTagCompound(); - writeToNBT(tag); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); - } + @Override + public Packet getDescriptionPacket() { + NBTTagCompound tag = new NBTTagCompound(); + writeToNBT(tag); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); + } - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { - readFromNBT(packet.func_148857_g()); - } + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { + readFromNBT(packet.func_148857_g()); + } - @Override - public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) { - // prevent losing TE data when in-world chiseling - return oldBlock != newBlock; - } + @Override + public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, + int z) { + // prevent losing TE data when in-world chiseling + return oldBlock != newBlock; + } - @Override - public void invalidate() { - super.invalidate(); - if (isConnected()) { - disconnect(false); - } - } + @Override + public void invalidate() { + super.invalidate(); + if (isConnected()) { + disconnect(false); + } + } - @Override - public void onChunkUnload() { - super.onChunkUnload(); - if (isConnected()) { - disconnect(true); - } - } + @Override + public void onChunkUnload() { + super.onChunkUnload(); + if (isConnected()) { + disconnect(true); + } + } - private int getAdjustedSlot(int slot) { - slot %= getSizeInventory(); - if (isConnected() && !isParent) { - slot = (slot + getTrueSizeInventory()) % getSizeInventory(); - } - return slot; - } + private int getAdjustedSlot(int slot) { + slot %= getSizeInventory(); + if (isConnected() && !isParent) { + slot = (slot + getTrueSizeInventory()) % getSizeInventory(); + } + return slot; + } - private TileEntity getTileSafe(int x, int y, int z) { - if (exists(x, y, z)) { - return worldObj.getTileEntity(x, y, z); - } - return null; - } + private TileEntity getTileSafe(int x, int y, int z) { + if (exists(x, y, z)) { + return worldObj.getTileEntity(x, y, z); + } + return null; + } - // private Block getBlockSafe(int x, int y, int z) { - // if (exists(x, y, z)) { - // return worldObj.getBlock(x, y, z); - // } - // return null; - // } - // - // private int getMetaSafe(int x, int y, int z) { - // if (exists(x, y, z)) { - // return worldObj.getBlockMetadata(x, y, z); - // } - // return 0; - // } - // - private boolean exists(int x, int y, int z) { - return worldObj.blockExists(x, y, z); - } + // private Block getBlockSafe(int x, int y, int z) { + // if (exists(x, y, z)) { + // return worldObj.getBlock(x, y, z); + // } + // return null; + // } + // + // private int getMetaSafe(int x, int y, int z) { + // if (exists(x, y, z)) { + // return worldObj.getBlockMetadata(x, y, z); + // } + // return 0; + // } + // + private boolean exists(int x, int y, int z) { + return worldObj.blockExists(x, y, z); + } - /* IInventory */ + /* IInventory */ - @Override - public int getSizeInventory() { - return isConnected() ? getTrueSizeInventory() + connection.getTrueSizeInventory() : getTrueSizeInventory(); - } + @Override + public int getSizeInventory() { + return isConnected() ? getTrueSizeInventory() + connection.getTrueSizeInventory() : getTrueSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int slot) { - slot = getAdjustedSlot(slot); - if (slot >= getTrueSizeInventory()) { - return isConnected() ? connection.inventory[slot % getTrueSizeInventory()] : null; - } else { - return inventory[slot]; - } - } + @Override + public ItemStack getStackInSlot(int slot) { + slot = getAdjustedSlot(slot); + if (slot >= getTrueSizeInventory()) { + return isConnected() ? connection.inventory[slot % getTrueSizeInventory()] : null; + } else { + return inventory[slot]; + } + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - slot = getAdjustedSlot(slot); - ItemStack[] inv = inventory; - if (isConnected() && slot >= getTrueSizeInventory()) { - inv = connection.inventory; - slot %= getTrueSizeInventory(); - connection.markDirty(); - } + @Override + public ItemStack decrStackSize(int slot, int amount) { + slot = getAdjustedSlot(slot); + ItemStack[] inv = inventory; + if (isConnected() && slot >= getTrueSizeInventory()) { + inv = connection.inventory; + slot %= getTrueSizeInventory(); + connection.markDirty(); + } - if (inv[slot] != null) { - ItemStack itemstack; + if (inv[slot] != null) { + ItemStack itemstack; - if (inv[slot].stackSize <= amount) { - itemstack = inv[slot]; - inv[slot] = null; - this.markDirty(); - return itemstack; - } else { - itemstack = inv[slot].splitStack(amount); + if (inv[slot].stackSize <= amount) { + itemstack = inv[slot]; + inv[slot] = null; + this.markDirty(); + return itemstack; + } else { + itemstack = inv[slot].splitStack(amount); - if (inv[slot].stackSize == 0) { - inv[slot] = null; - } + if (inv[slot].stackSize == 0) { + inv[slot] = null; + } - this.markDirty(); - return itemstack; - } - } else { - return null; - } - } + this.markDirty(); + return itemstack; + } + } else { + return null; + } + } - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - return getStackInSlot(slot); - } + @Override + public ItemStack getStackInSlotOnClosing(int slot) { + return getStackInSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - slot = getAdjustedSlot(slot); - if (slot < getTrueSizeInventory()) { - inventory[slot] = stack; - } else if (isConnected()) { - connection.inventory[slot % getTrueSizeInventory()] = stack; - connection.markDirty(); - } - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + slot = getAdjustedSlot(slot); + if (slot < getTrueSizeInventory()) { + inventory[slot] = stack; + } else if (isConnected()) { + connection.inventory[slot % getTrueSizeInventory()] = stack; + connection.markDirty(); + } + } - @Override - public String getInventoryName() { - return "chisel.present"; - } + @Override + public String getInventoryName() { + return "chisel.present"; + } - @Override - public boolean hasCustomInventoryName() { - return false; - } + @Override + public boolean hasCustomInventoryName() { + return false; + } - @Override - public int getInventoryStackLimit() { - return 64; - } + @Override + public int getInventoryStackLimit() { + return 64; + } - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return true; - } + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { + return true; + } - @Override - public void openInventory() { - ; - } + @Override + public void openInventory() { + ; + } - @Override - public void closeInventory() { - ; - } + @Override + public void closeInventory() { + ; + } - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return true; - } + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { + return true; + } - /* IDoubleChest */ + /* IDoubleChest */ - @Override - public int getTrueSizeInventory() { - return inventory.length; - } + @Override + public int getTrueSizeInventory() { + return inventory.length; + } - @Override - public ItemStack getTrueStackInSlot(int slot) { - return inventory[slot % getTrueSizeInventory()]; - } + @Override + public ItemStack getTrueStackInSlot(int slot) { + return inventory[slot % getTrueSizeInventory()]; + } - @Override - public void putStackInTrueSlot(int slot, ItemStack stack) { - inventory[slot % getTrueSizeInventory()] = stack; - } + @Override + public void putStackInTrueSlot(int slot, ItemStack stack) { + inventory[slot % getTrueSizeInventory()] = stack; + } } diff --git a/src/main/java/team/chisel/carving/Carving.java b/src/main/java/team/chisel/carving/Carving.java index 9e6aad01..5df23731 100644 --- a/src/main/java/team/chisel/carving/Carving.java +++ b/src/main/java/team/chisel/carving/Carving.java @@ -2,214 +2,212 @@ package team.chisel.carving; import java.util.*; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import team.chisel.Chisel; + import com.cricketcraft.chisel.api.carving.CarvingUtils; import com.cricketcraft.chisel.api.carving.ICarvingGroup; import com.cricketcraft.chisel.api.carving.ICarvingRegistry; import com.cricketcraft.chisel.api.carving.ICarvingVariation; -import team.chisel.Chisel; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - public class Carving implements ICarvingRegistry { - GroupList groups = new GroupList(); + GroupList groups = new GroupList(); - public static final ICarvingRegistry chisel = new Carving(); - public static final Carving needle = new Carving(); + public static final ICarvingRegistry chisel = new Carving(); + public static final Carving needle = new Carving(); - static { - CarvingUtils.chisel = chisel; - } + static { + CarvingUtils.chisel = chisel; + } - public static void construct() { - /* do nothing */ - } + public static void construct() { + /* do nothing */ + } - private Carving() { - /* do nothing */ - } + private Carving() { + /* do nothing */ + } - @Override - public ICarvingVariation getVariation(Block block, int metadata) { - ICarvingGroup g = getGroup(block, metadata); - if (g != null) { - for (ICarvingVariation v : g.getVariations()) { - if (v.getBlock() == block && v.getBlockMeta() == metadata) { - return v; - } - } - } - return null; - } + @Override + public ICarvingVariation getVariation(Block block, int metadata) { + ICarvingGroup g = getGroup(block, metadata); + if (g != null) { + for (ICarvingVariation v : g.getVariations()) { + if (v.getBlock() == block && v.getBlockMeta() == metadata) { + return v; + } + } + } + return null; + } - @Override - public List getGroupVariations(Block block, int metadata) { - ICarvingGroup group = getGroup(block, metadata); - if (group == null) - return Collections.emptyList(); + @Override + public List getGroupVariations(Block block, int metadata) { + ICarvingGroup group = getGroup(block, metadata); + if (group == null) return Collections.emptyList(); - return group.getVariations(); - } + return group.getVariations(); + } - @Override - public String getOreName(Block block, int metadata) { - ICarvingGroup group = getGroup(block, metadata); - if (group == null) - return null; + @Override + public String getOreName(Block block, int metadata) { + ICarvingGroup group = getGroup(block, metadata); + if (group == null) return null; - return group.getOreName(); - } + return group.getOreName(); + } - @Override - public List getItemsForChiseling(ItemStack chiseledItem) { - ArrayList items = new ArrayList<>(); + @Override + public List getItemsForChiseling(ItemStack chiseledItem) { + ArrayList items = new ArrayList<>(); - ICarvingGroup group = null; + ICarvingGroup group = null; - int[] oreIDs = OreDictionary.getOreIDs(chiseledItem); - for (int i : oreIDs) { - group = groups.getGroupByOre(OreDictionary.getOreName(i)); - if (group != null) { - break; - } - } + int[] oreIDs = OreDictionary.getOreIDs(chiseledItem); + for (int i : oreIDs) { + group = groups.getGroupByOre(OreDictionary.getOreName(i)); + if (group != null) { + break; + } + } - if (group == null) { - group = getGroup(Block.getBlockFromItem(chiseledItem.getItem()), chiseledItem.getItemDamage()); - } + if (group == null) { + group = getGroup(Block.getBlockFromItem(chiseledItem.getItem()), chiseledItem.getItemDamage()); + } - if (group == null) - return items; + if (group == null) return items; - HashSet mapping = new HashSet<>(); + HashSet mapping = new HashSet<>(); - List variations = group.getVariations(); + List variations = group.getVariations(); - for (ICarvingVariation v : variations) { - String key = Block.getIdFromBlock(v.getBlock()) + "|" + v.getItemMeta(); - if (mapping.add(key)) items.add(new ItemStack(v.getBlock(), 1, v.getItemMeta())); - } + for (ICarvingVariation v : variations) { + String key = Block.getIdFromBlock(v.getBlock()) + "|" + v.getItemMeta(); + if (mapping.add(key)) items.add(new ItemStack(v.getBlock(), 1, v.getItemMeta())); + } - String oreName = group.getOreName(); - if (oreName != null) { - ArrayList ores = OreDictionary.getOres(oreName); - for (ItemStack stack : ores) { - String key = Item.getIdFromItem(stack.getItem()) + "|" + stack.getItemDamage(); - if (mapping.add(key)) items.add(stack); - } - } + String oreName = group.getOreName(); + if (oreName != null) { + ArrayList ores = OreDictionary.getOres(oreName); + for (ItemStack stack : ores) { + String key = Item.getIdFromItem(stack.getItem()) + "|" + stack.getItemDamage(); + if (mapping.add(key)) items.add(stack); + } + } - return items; - } + return items; + } - @Override - public ICarvingGroup getGroup(Block block, int metadata) { - int[] ids = OreDictionary.getOreIDs(new ItemStack(block, 1, metadata)); - if (ids.length > 0) { - for (int id : ids) { - ICarvingGroup oreGroup = groups.getGroupByOre(OreDictionary.getOreName(id)); - if (oreGroup != null) { - return oreGroup; - } - } - } + @Override + public ICarvingGroup getGroup(Block block, int metadata) { + int[] ids = OreDictionary.getOreIDs(new ItemStack(block, 1, metadata)); + if (ids.length > 0) { + for (int id : ids) { + ICarvingGroup oreGroup = groups.getGroupByOre(OreDictionary.getOreName(id)); + if (oreGroup != null) { + return oreGroup; + } + } + } - return groups.getGroup(block, metadata); - } + return groups.getGroup(block, metadata); + } - @Override - public ICarvingGroup getGroup(String name) { - return groups.getGroupByName(name); - } + @Override + public ICarvingGroup getGroup(String name) { + return groups.getGroupByName(name); + } - @Override - public ICarvingGroup removeGroup(String groupName) { - ICarvingGroup g = groups.getGroupByName(groupName); - return groups.remove(g) ? g : null; - } + @Override + public ICarvingGroup removeGroup(String groupName) { + ICarvingGroup g = groups.getGroupByName(groupName); + return groups.remove(g) ? g : null; + } - @Override - public ICarvingVariation removeVariation(Block block, int metadata) { - return removeVariation(block, metadata, null); - } + @Override + public ICarvingVariation removeVariation(Block block, int metadata) { + return removeVariation(block, metadata, null); + } - @Override - public ICarvingVariation removeVariation(Block block, int metadata, String group) { - return groups.removeVariation(block, metadata, group); - } + @Override + public ICarvingVariation removeVariation(Block block, int metadata, String group) { + return groups.removeVariation(block, metadata, group); + } - @Override - public void addVariation(String groupName, Block block, int metadata, int order) { - if (block == null) { - throw new NullPointerException("Cannot add variation in group " + groupName + " for null block."); - } + @Override + public void addVariation(String groupName, Block block, int metadata, int order) { + if (block == null) { + throw new NullPointerException("Cannot add variation in group " + groupName + " for null block."); + } - ICarvingVariation variation = CarvingUtils.getDefaultVariationFor(block, metadata, order); - addVariation(groupName, variation); - } + ICarvingVariation variation = CarvingUtils.getDefaultVariationFor(block, metadata, order); + addVariation(groupName, variation); + } - @Override - public void addVariation(String groupName, ICarvingVariation variation) { - if (groupName == null) { - throw new NullPointerException("Cannot add variation to null group name."); - } else if (variation == null) { - throw new NullPointerException("Cannot add variation in group " + groupName + " for null variation."); - } + @Override + public void addVariation(String groupName, ICarvingVariation variation) { + if (groupName == null) { + throw new NullPointerException("Cannot add variation to null group name."); + } else if (variation == null) { + throw new NullPointerException("Cannot add variation in group " + groupName + " for null variation."); + } - ICarvingGroup group = groups.getGroupByName(groupName); + ICarvingGroup group = groups.getGroupByName(groupName); - if (group == null) { - group = CarvingUtils.getDefaultGroupFor(groupName); - addGroup(group); - } + if (group == null) { + group = CarvingUtils.getDefaultGroupFor(groupName); + addGroup(group); + } - groups.addVariation(groupName, variation); - } + groups.addVariation(groupName, variation); + } - @Override - public void addGroup(ICarvingGroup group) { - groups.add(group); - } + @Override + public void addGroup(ICarvingGroup group) { + groups.add(group); + } - @Override - public void registerOre(String name, String oreName) { - ICarvingGroup group = groups.getGroupByName(name); - if (group != null) { - group.setOreName(oreName); - } else { - throw new NullPointerException("Cannot register ore name for group " + name + ", as it does not exist."); - } - } + @Override + public void registerOre(String name, String oreName) { + ICarvingGroup group = groups.getGroupByName(name); + if (group != null) { + group.setOreName(oreName); + } else { + throw new NullPointerException("Cannot register ore name for group " + name + ", as it does not exist."); + } + } - @Override - public void setVariationSound(String name, String sound) { - ICarvingGroup group = groups.getGroupByName(name); - if (group != null) { - group.setSound(sound); - } else { - throw new NullPointerException("Cannot set sound for group " + name + ", as it does not exist."); - } - } + @Override + public void setVariationSound(String name, String sound) { + ICarvingGroup group = groups.getGroupByName(name); + if (group != null) { + group.setSound(sound); + } else { + throw new NullPointerException("Cannot set sound for group " + name + ", as it does not exist."); + } + } - @Override - public String getVariationSound(Block block, int metadata) { - return getVariationSound(Item.getItemFromBlock(block), metadata); - } + @Override + public String getVariationSound(Block block, int metadata) { + return getVariationSound(Item.getItemFromBlock(block), metadata); + } - @Override - public String getVariationSound(Item item, int metadata) { - ICarvingGroup group = groups.getGroup(Block.getBlockFromItem(item), metadata); - String sound = group == null ? null : group.getSound(); - return sound == null ? Chisel.MOD_ID + ":chisel.fallback" : sound; - } + @Override + public String getVariationSound(Item item, int metadata) { + ICarvingGroup group = groups.getGroup(Block.getBlockFromItem(item), metadata); + String sound = group == null ? null : group.getSound(); + return sound == null ? Chisel.MOD_ID + ":chisel.fallback" : sound; + } - @Override - public List getSortedGroupNames() { - List names = new ArrayList<>(groups.getNames()); - Collections.sort(names); - return names; - } + @Override + public List getSortedGroupNames() { + List names = new ArrayList<>(groups.getNames()); + Collections.sort(names); + return names; + } } diff --git a/src/main/java/team/chisel/carving/GroupList.java b/src/main/java/team/chisel/carving/GroupList.java index aede0369..e1df6720 100644 --- a/src/main/java/team/chisel/carving/GroupList.java +++ b/src/main/java/team/chisel/carving/GroupList.java @@ -17,229 +17,231 @@ import com.google.common.collect.Maps; public class GroupList implements Set { - private class VariationWrapper { + private class VariationWrapper { - private ICarvingVariation v; + private ICarvingVariation v; - private VariationWrapper(ICarvingVariation v) { - this.v = v; - } + private VariationWrapper(ICarvingVariation v) { + this.v = v; + } - @Override - public boolean equals(Object obj) { - if (obj instanceof ICarvingVariation) { - ICarvingVariation v2 = (ICarvingVariation) obj; - return v.getBlock() == v2.getBlock() && (v.getBlockMeta() == v2.getBlockMeta() || v.getItemMeta() == v2.getItemMeta()); - } else if (obj instanceof VariationWrapper) { - return equals(((VariationWrapper) obj).v); - } - return false; - } + @Override + public boolean equals(Object obj) { + if (obj instanceof ICarvingVariation) { + ICarvingVariation v2 = (ICarvingVariation) obj; + return v.getBlock() == v2.getBlock() + && (v.getBlockMeta() == v2.getBlockMeta() || v.getItemMeta() == v2.getItemMeta()); + } else if (obj instanceof VariationWrapper) { + return equals(((VariationWrapper) obj).v); + } + return false; + } - @Override - public int hashCode() { - return v.getBlock().hashCode(); - } - } + @Override + public int hashCode() { + return v.getBlock().hashCode(); + } + } - private class VariationKey implements ICarvingVariation { + private class VariationKey implements ICarvingVariation { - Pair data; + Pair data; - private VariationKey(Block block, int blockMeta) { - data = Pair.of(block, blockMeta); - } + private VariationKey(Block block, int blockMeta) { + data = Pair.of(block, blockMeta); + } - @Override - public Block getBlock() { - return data.getLeft(); - } + @Override + public Block getBlock() { + return data.getLeft(); + } - @Override - public int getBlockMeta() { - return data.getRight(); - } + @Override + public int getBlockMeta() { + return data.getRight(); + } - @Override - public int getItemMeta() { - return data.getRight(); - } + @Override + public int getItemMeta() { + return data.getRight(); + } - @Override - public int getOrder() { - return 0; - } + @Override + public int getOrder() { + return 0; + } - @Override - public String toString() { - return data.toString(); - } - } + @Override + public String toString() { + return data.toString(); + } + } - private HashMap groups = Maps.newHashMap(); - private HashMap lookup = Maps.newHashMap(); + private HashMap groups = Maps.newHashMap(); + private HashMap lookup = Maps.newHashMap(); - @Override - public int size() { - return groups.size(); - } + @Override + public int size() { + return groups.size(); + } - @Override - public boolean isEmpty() { - return groups.isEmpty(); - } + @Override + public boolean isEmpty() { + return groups.isEmpty(); + } - @Override - public boolean contains(Object o) { - if (o instanceof ICarvingGroup) { - return groups.containsKey(((ICarvingGroup) o).getName()); - } - return false; - } + @Override + public boolean contains(Object o) { + if (o instanceof ICarvingGroup) { + return groups.containsKey(((ICarvingGroup) o).getName()); + } + return false; + } - @Override - public Iterator iterator() { - return groups.values().iterator(); - } + @Override + public Iterator iterator() { + return groups.values().iterator(); + } - @Override - public Object[] toArray() { - return groups.values().toArray(); - } + @Override + public Object[] toArray() { + return groups.values().toArray(); + } - @Override - public T[] toArray(T[] arr) { - return groups.values().toArray(arr); - } + @Override + public T[] toArray(T[] arr) { + return groups.values().toArray(arr); + } - @Override - public boolean add(ICarvingGroup group) { - String key = group.getName(); - if (groups.containsKey(key)) { - return false; - } - for (ICarvingVariation v : group.getVariations()) { - ICarvingGroup g = lookup.get(v); - if (g == null) { - lookup.put(new VariationWrapper(v), group); - } - } - groups.put(key, group); - return true; - } + @Override + public boolean add(ICarvingGroup group) { + String key = group.getName(); + if (groups.containsKey(key)) { + return false; + } + for (ICarvingVariation v : group.getVariations()) { + ICarvingGroup g = lookup.get(v); + if (g == null) { + lookup.put(new VariationWrapper(v), group); + } + } + groups.put(key, group); + return true; + } - @Override - public boolean remove(Object o) { - if (o instanceof ICarvingGroup) { - List toRemove = Lists.newArrayList(); - for (VariationWrapper v : lookup.keySet()) { - if (lookup.get(v).getName().equals(((ICarvingGroup) o).getName())) { - toRemove.add(v); - } - } - for (VariationWrapper v : toRemove) { - lookup.remove(v); - } - return groups.remove(((ICarvingGroup) o).getName()) != null; - } - return false; - } + @Override + public boolean remove(Object o) { + if (o instanceof ICarvingGroup) { + List toRemove = Lists.newArrayList(); + for (VariationWrapper v : lookup.keySet()) { + if (lookup.get(v).getName().equals(((ICarvingGroup) o).getName())) { + toRemove.add(v); + } + } + for (VariationWrapper v : toRemove) { + lookup.remove(v); + } + return groups.remove(((ICarvingGroup) o).getName()) != null; + } + return false; + } - @Override - public boolean containsAll(Collection c) { - for (Object o : c) { - if (!(o instanceof ICarvingGroup)) { - return false; - } - if (!groups.containsKey(((ICarvingGroup) o).getName())) { - return false; - } - } - return true; - } + @Override + public boolean containsAll(Collection c) { + for (Object o : c) { + if (!(o instanceof ICarvingGroup)) { + return false; + } + if (!groups.containsKey(((ICarvingGroup) o).getName())) { + return false; + } + } + return true; + } - @Override - public boolean addAll(Collection c) { - boolean ret = false; - for (ICarvingGroup g : c) { - ret |= add(g); - } - return ret; - } + @Override + public boolean addAll(Collection c) { + boolean ret = false; + for (ICarvingGroup g : c) { + ret |= add(g); + } + return ret; + } - @Override - public boolean removeAll(Collection c) { - boolean ret = false; - for (Object o : c) { - ret |= remove(o); - } - return ret; - } + @Override + public boolean removeAll(Collection c) { + boolean ret = false; + for (Object o : c) { + ret |= remove(o); + } + return ret; + } - @Override - public boolean retainAll(Collection c) { - throw new UnsupportedOperationException(); // not using it, not gonna bother - } + @Override + public boolean retainAll(Collection c) { + throw new UnsupportedOperationException(); // not using it, not gonna bother + } - @Override - public void clear() { - groups.clear(); - } + @Override + public void clear() { + groups.clear(); + } - public ICarvingGroup getGroup(Block block, int metadata) { - return lookup.get(new VariationWrapper(new VariationKey(block, metadata))); - } + public ICarvingGroup getGroup(Block block, int metadata) { + return lookup.get(new VariationWrapper(new VariationKey(block, metadata))); + } - public void addVariation(String name, ICarvingVariation variation) { - ICarvingGroup g = groups.get(name); - if (g == null) { - throw new NullPointerException("No group exists for name " + name); - } - g.addVariation(variation); - lookup.put(new VariationWrapper(variation), g); - } + public void addVariation(String name, ICarvingVariation variation) { + ICarvingGroup g = groups.get(name); + if (g == null) { + throw new NullPointerException("No group exists for name " + name); + } + g.addVariation(variation); + lookup.put(new VariationWrapper(variation), g); + } - public ICarvingGroup getGroupByName(String groupName) { - return groups.get(groupName); - } + public ICarvingGroup getGroupByName(String groupName) { + return groups.get(groupName); + } - public ICarvingGroup getGroupByOre(String oreName) { - for (ICarvingGroup group : groups.values()) { - if (oreName.equals(group.getOreName())) { - return group; - } - } - return null; - } + public ICarvingGroup getGroupByOre(String oreName) { + for (ICarvingGroup group : groups.values()) { + if (oreName.equals(group.getOreName())) { + return group; + } + } + return null; + } - public Collection getNames() { - return groups.keySet(); - } + public Collection getNames() { + return groups.keySet(); + } - public ICarvingVariation removeVariation(Block block, int metadata, String group) { - ICarvingGroup g = null; - if (group != null) { - g = groups.get(group); - if (g == null) { - throw new IllegalArgumentException("No such group " + group); - } - groups.remove(g.getName()); - } - List toRemove = Lists.newArrayList(); - for (VariationWrapper v : lookup.keySet()) { - if ((g == null || lookup.get(v).getName().equals(g.getName())) && v.equals(new VariationWrapper(new VariationKey(block, metadata)))) { - lookup.get(v).removeVariation(v.v); - toRemove.add(v); - } - } - for (VariationWrapper v : toRemove) { - lookup.remove(v); - } - return toRemove.isEmpty() ? null : toRemove.get(0).v; - } + public ICarvingVariation removeVariation(Block block, int metadata, String group) { + ICarvingGroup g = null; + if (group != null) { + g = groups.get(group); + if (g == null) { + throw new IllegalArgumentException("No such group " + group); + } + groups.remove(g.getName()); + } + List toRemove = Lists.newArrayList(); + for (VariationWrapper v : lookup.keySet()) { + if ((g == null || lookup.get(v).getName().equals(g.getName())) + && v.equals(new VariationWrapper(new VariationKey(block, metadata)))) { + lookup.get(v).removeVariation(v.v); + toRemove.add(v); + } + } + for (VariationWrapper v : toRemove) { + lookup.remove(v); + } + return toRemove.isEmpty() ? null : toRemove.get(0).v; + } - @Override - public String toString() { - return groups.toString(); - } + @Override + public String toString() { + return groups.toString(); + } } diff --git a/src/main/java/team/chisel/client/GeneralChiselClient.java b/src/main/java/team/chisel/client/GeneralChiselClient.java index 5cc2f71a..d5625957 100644 --- a/src/main/java/team/chisel/client/GeneralChiselClient.java +++ b/src/main/java/team/chisel/client/GeneralChiselClient.java @@ -9,6 +9,7 @@ import net.minecraft.client.particle.EntityDiggingFX; import net.minecraft.client.particle.EntityLavaFX; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import team.chisel.block.BlockGrimstone; import team.chisel.block.BlockHolystone; import team.chisel.block.BlockLavastone; @@ -24,226 +25,269 @@ import team.chisel.utils.GeneralClient; public class GeneralChiselClient { - public static Random rand = new Random(); - public static int tick = 0; + public static Random rand = new Random(); + public static int tick = 0; - public static void spawnLavastoneFX(World world, BlockLavastone block, int x, int y, int z) { - if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0) - return; + public static void spawnLavastoneFX(World world, BlockLavastone block, int x, int y, int z) { + if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0 + || Minecraft.getMinecraft().gameSettings.particleSetting != 0) + return; - float f = 0.15F; - double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F) + f + block.getBlockBoundsMinX(); - double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F) + f + block.getBlockBoundsMinY(); - double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F) + f + block.getBlockBoundsMinZ(); + float f = 0.15F; + double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F) + + f + + block.getBlockBoundsMinX(); + double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F) + + f + + block.getBlockBoundsMinY(); + double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F) + + f + + block.getBlockBoundsMinZ(); - switch (rand.nextInt(6)) { - case 0: - y1 = y + block.getBlockBoundsMinY() - f; - y--; - break; - case 1: - y1 = y + block.getBlockBoundsMaxY() + f; - y++; - break; - case 2: - z1 = z + block.getBlockBoundsMinZ() - f; - z--; - break; - case 3: - z1 = z + block.getBlockBoundsMaxZ() + f; - z++; - break; - case 4: - x1 = x + block.getBlockBoundsMinX() - f; - x--; - break; - case 5: - x1 = x + block.getBlockBoundsMaxX() + f; - x++; - break; - } + switch (rand.nextInt(6)) { + case 0: + y1 = y + block.getBlockBoundsMinY() - f; + y--; + break; + case 1: + y1 = y + block.getBlockBoundsMaxY() + f; + y++; + break; + case 2: + z1 = z + block.getBlockBoundsMinZ() - f; + z--; + break; + case 3: + z1 = z + block.getBlockBoundsMaxZ() + f; + z++; + break; + case 4: + x1 = x + block.getBlockBoundsMinX() - f; + x--; + break; + case 5: + x1 = x + block.getBlockBoundsMaxX() + f; + x++; + break; + } - if (world.getBlock(x, y, z).isOpaqueCube()) - return; + if (world.getBlock(x, y, z).isOpaqueCube()) return; - EntityLavaFX res = new EntityLavaFX(world, x1, y1, z1); - double multiplier = 0.45; - res.motionX = -multiplier * (x1 - x - 0.5); - res.motionY = multiplier * (y1 - y - 0.5); - res.motionZ = -multiplier * (z1 - z - 0.5); + EntityLavaFX res = new EntityLavaFX(world, x1, y1, z1); + double multiplier = 0.45; + res.motionX = -multiplier * (x1 - x - 0.5); + res.motionY = multiplier * (y1 - y - 0.5); + res.motionZ = -multiplier * (z1 - z - 0.5); - Minecraft.getMinecraft().effectRenderer.addEffect(res); - } + Minecraft.getMinecraft().effectRenderer.addEffect(res); + } - public static void spawnHolystoneFX(World world, BlockHolystone block, int x, int y, int z) { - if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0) - return; + public static void spawnHolystoneFX(World world, BlockHolystone block, int x, int y, int z) { + if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0 + || Minecraft.getMinecraft().gameSettings.particleSetting != 0) + return; - float f = 0.15F; - double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F) + f + block.getBlockBoundsMinX(); - double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F) + f + block.getBlockBoundsMinY(); - double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F) + f + block.getBlockBoundsMinZ(); + float f = 0.15F; + double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F) + + f + + block.getBlockBoundsMinX(); + double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F) + + f + + block.getBlockBoundsMinY(); + double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F) + + f + + block.getBlockBoundsMinZ(); - switch (rand.nextInt(6)) { - case 0: - y1 = y + block.getBlockBoundsMinY() - f; - y--; - break; - case 1: - y1 = y + block.getBlockBoundsMaxY() + f; - y++; - break; - case 2: - z1 = z + block.getBlockBoundsMinZ() - f; - z--; - break; - case 3: - z1 = z + block.getBlockBoundsMaxZ() + f; - z++; - break; - case 4: - x1 = x + block.getBlockBoundsMinX() - f; - x--; - break; - case 5: - x1 = x + block.getBlockBoundsMaxX() + f; - x++; - break; - } + switch (rand.nextInt(6)) { + case 0: + y1 = y + block.getBlockBoundsMinY() - f; + y--; + break; + case 1: + y1 = y + block.getBlockBoundsMaxY() + f; + y++; + break; + case 2: + z1 = z + block.getBlockBoundsMinZ() - f; + z--; + break; + case 3: + z1 = z + block.getBlockBoundsMaxZ() + f; + z++; + break; + case 4: + x1 = x + block.getBlockBoundsMinX() - f; + x--; + break; + case 5: + x1 = x + block.getBlockBoundsMaxX() + f; + x++; + break; + } - if (world.getBlock(x, y, z).isOpaqueCube()) - return; + if (world.getBlock(x, y, z).isOpaqueCube()) return; - EntityHolystoneFX res = new EntityHolystoneFX(world, block, x1, y1, z1); - Minecraft.getMinecraft().effectRenderer.addEffect(res); - } + EntityHolystoneFX res = new EntityHolystoneFX(world, block, x1, y1, z1); + Minecraft.getMinecraft().effectRenderer.addEffect(res); + } - public static void spawnGrimstoneFX(World world, BlockGrimstone block, int x, int y, int z) { - if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0) - return; + public static void spawnGrimstoneFX(World world, BlockGrimstone block, int x, int y, int z) { + if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0) return; - float f = 0.15F; - double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F) + f + block.getBlockBoundsMinX(); - double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F) + f + block.getBlockBoundsMinY(); - double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F) + f + block.getBlockBoundsMinZ(); + float f = 0.15F; + double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F) + + f + + block.getBlockBoundsMinX(); + double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F) + + f + + block.getBlockBoundsMinY(); + double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F) + + f + + block.getBlockBoundsMinZ(); - switch (rand.nextInt(6)) { - case 0: - y1 = y + block.getBlockBoundsMinY() - f; - y--; - break; - case 1: - y1 = y + block.getBlockBoundsMaxY() + f; - y++; - break; - case 2: - z1 = z + block.getBlockBoundsMinZ() - f; - z--; - break; - case 3: - z1 = z + block.getBlockBoundsMaxZ() + f; - z++; - break; - case 4: - x1 = x + block.getBlockBoundsMinX() - f; - x--; - break; - case 5: - x1 = x + block.getBlockBoundsMaxX() + f; - x++; - break; - } + switch (rand.nextInt(6)) { + case 0: + y1 = y + block.getBlockBoundsMinY() - f; + y--; + break; + case 1: + y1 = y + block.getBlockBoundsMaxY() + f; + y++; + break; + case 2: + z1 = z + block.getBlockBoundsMinZ() - f; + z--; + break; + case 3: + z1 = z + block.getBlockBoundsMaxZ() + f; + z++; + break; + case 4: + x1 = x + block.getBlockBoundsMinX() - f; + x--; + break; + case 5: + x1 = x + block.getBlockBoundsMaxX() + f; + x++; + break; + } - if (world.getBlock(x, y, z).isOpaqueCube()) - return; + if (world.getBlock(x, y, z).isOpaqueCube()) return; - EntityGrimstoneFX res = new EntityGrimstoneFX(world, block, x1, y1, z1); - Minecraft.getMinecraft().effectRenderer.addEffect(res); - } + EntityGrimstoneFX res = new EntityGrimstoneFX(world, block, x1, y1, z1); + Minecraft.getMinecraft().effectRenderer.addEffect(res); + } - public static void spawnSnakestoneObsidianFX(World world, BlockSnakestoneObsidian block, int x, int y, int z) { - if (Configurations.particlesTickrate != 0 || tick++ % Configurations.particlesTickrate != 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0) { - EntitySnakestoneObsidianFX res = new EntitySnakestoneObsidianFX(world, block, x, y, z); - Minecraft.getMinecraft().effectRenderer.addEffect(res); - } - } + public static void spawnSnakestoneObsidianFX(World world, BlockSnakestoneObsidian block, int x, int y, int z) { + if (Configurations.particlesTickrate != 0 || tick++ % Configurations.particlesTickrate != 0 + || Minecraft.getMinecraft().gameSettings.particleSetting != 0) { + EntitySnakestoneObsidianFX res = new EntitySnakestoneObsidianFX(world, block, x, y, z); + Minecraft.getMinecraft().effectRenderer.addEffect(res); + } + } - public static void spawnBallOMossFX(World world, double x, double y, double z) { - if (Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0) { - EntityBallOMossFX res = new EntityBallOMossFX(world, x, y, z); - Minecraft.getMinecraft().effectRenderer.addEffect(res); - } - } + public static void spawnBallOMossFX(World world, double x, double y, double z) { + if (Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0 + || Minecraft.getMinecraft().gameSettings.particleSetting != 0) { + EntityBallOMossFX res = new EntityBallOMossFX(world, x, y, z); + Minecraft.getMinecraft().effectRenderer.addEffect(res); + } + } - public static EntityDiggingFX addBlockHitEffects(World world, int x, int y, int z, int side) { - Block block = world.getBlock(x, y, z); - if (block.isAir(world, x, y, z) || Minecraft.getMinecraft().gameSettings.particleSetting != 0) - return null; + public static EntityDiggingFX addBlockHitEffects(World world, int x, int y, int z, int side) { + Block block = world.getBlock(x, y, z); + if (block.isAir(world, x, y, z) || Minecraft.getMinecraft().gameSettings.particleSetting != 0) return null; - EffectRenderer renderer = Minecraft.getMinecraft().effectRenderer; + EffectRenderer renderer = Minecraft.getMinecraft().effectRenderer; - float f = 0.1F; - double d0 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F) + f + block.getBlockBoundsMinX(); - double d1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F) + f + block.getBlockBoundsMinY(); - double d2 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F) + f + block.getBlockBoundsMinZ(); + float f = 0.1F; + double d0 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F) + + f + + block.getBlockBoundsMinX(); + double d1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F) + + f + + block.getBlockBoundsMinY(); + double d2 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F) + + f + + block.getBlockBoundsMinZ(); - switch (side) { - case 0: - d1 = y + block.getBlockBoundsMinY() - f; - break; - case 1: - d1 = y + block.getBlockBoundsMaxY() + f; - break; - case 2: - d2 = z + block.getBlockBoundsMinZ() - f; - break; - case 3: - d2 = z + block.getBlockBoundsMaxZ() + f; - break; - case 4: - d0 = x + block.getBlockBoundsMinX() - f; - break; - case 5: - d0 = x + block.getBlockBoundsMaxX() + f; - break; - } + switch (side) { + case 0: + d1 = y + block.getBlockBoundsMinY() - f; + break; + case 1: + d1 = y + block.getBlockBoundsMaxY() + f; + break; + case 2: + d2 = z + block.getBlockBoundsMinZ() - f; + break; + case 3: + d2 = z + block.getBlockBoundsMaxZ() + f; + break; + case 4: + d0 = x + block.getBlockBoundsMinX() - f; + break; + case 5: + d0 = x + block.getBlockBoundsMaxX() + f; + break; + } - EntityDiggingFX res = new EntityDiggingFX(world, d0, d1, d2, 0.0D, 0.0D, 0.0D, block, world.getBlockMetadata(x, y, z), side); - res.motionX = d0 - (x + 0.5); - res.motionY = d1 - (y + 0.5); - res.motionZ = d2 - (z + 0.5); + EntityDiggingFX res = new EntityDiggingFX( + world, + d0, + d1, + d2, + 0.0D, + 0.0D, + 0.0D, + block, + world.getBlockMetadata(x, y, z), + side); + res.motionX = d0 - (x + 0.5); + res.motionY = d1 - (y + 0.5); + res.motionZ = d2 - (z + 0.5); - renderer.addEffect(res); + renderer.addEffect(res); - return res; - } + return res; + } - public static void spawnChiselEffect(int x, int y, int z, String sound) { - World world = Minecraft.getMinecraft().theWorld; - for (int side = 0; side < 6; side++) { - for (int j = 0; j < 16; j++) { - EntityDiggingFX fx = addBlockHitEffects(Minecraft.getMinecraft().theWorld, x, y, z, side); - if (fx == null) - return; + public static void spawnChiselEffect(int x, int y, int z, String sound) { + World world = Minecraft.getMinecraft().theWorld; + for (int side = 0; side < 6; side++) { + for (int j = 0; j < 16; j++) { + EntityDiggingFX fx = addBlockHitEffects(Minecraft.getMinecraft().theWorld, x, y, z, side); + if (fx == null) return; - fx.multipleParticleScaleBy(0.25f + 0.5f * rand.nextFloat()); - fx.multiplyVelocity(0.3f * rand.nextFloat()); - } - } + fx.multipleParticleScaleBy(0.25f + 0.5f * rand.nextFloat()); + fx.multiplyVelocity(0.3f * rand.nextFloat()); + } + } - GeneralClient.playChiselSound(world, x, y, z, sound); - } + GeneralClient.playChiselSound(world, x, y, z, sound); + } - public static void spawnAutoChiselFX(TileEntityAutoChisel te, ItemStack base) { - if (base != null && Minecraft.getMinecraft().gameSettings.particleSetting == 0) { - for (int i = 0; i < 10; i++) { - EntityDiggingFX particle = new EntityDiggingFX(te.getWorldObj(), te.xCoord + 0.5, te.yCoord + 0.95, te.zCoord + 0.5, 0, 0, 0, Block.getBlockFromItem(base.getItem()), - base.getItemDamage()); - particle.setVelocity((te.getWorldObj().rand.nextDouble() / 4) - 0.125, te.getWorldObj().rand.nextDouble() / 8, (te.getWorldObj().rand.nextDouble() / 4) - 0.125); - Minecraft.getMinecraft().effectRenderer.addEffect(particle); - } - String sound = Carving.chisel.getVariationSound(base.getItem(), base.getItemDamage()); - GeneralClient.playChiselSound(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, sound); - } - } + public static void spawnAutoChiselFX(TileEntityAutoChisel te, ItemStack base) { + if (base != null && Minecraft.getMinecraft().gameSettings.particleSetting == 0) { + for (int i = 0; i < 10; i++) { + EntityDiggingFX particle = new EntityDiggingFX( + te.getWorldObj(), + te.xCoord + 0.5, + te.yCoord + 0.95, + te.zCoord + 0.5, + 0, + 0, + 0, + Block.getBlockFromItem(base.getItem()), + base.getItemDamage()); + particle.setVelocity( + (te.getWorldObj().rand.nextDouble() / 4) - 0.125, + te.getWorldObj().rand.nextDouble() / 8, + (te.getWorldObj().rand.nextDouble() / 4) - 0.125); + Minecraft.getMinecraft().effectRenderer.addEffect(particle); + } + String sound = Carving.chisel.getVariationSound(base.getItem(), base.getItemDamage()); + GeneralClient.playChiselSound(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, sound); + } + } } diff --git a/src/main/java/team/chisel/client/gui/GuiAutoChisel.java b/src/main/java/team/chisel/client/gui/GuiAutoChisel.java index 020ceb26..4264463e 100644 --- a/src/main/java/team/chisel/client/gui/GuiAutoChisel.java +++ b/src/main/java/team/chisel/client/gui/GuiAutoChisel.java @@ -18,66 +18,74 @@ import com.google.common.collect.Lists; public class GuiAutoChisel extends GuiContainer { - private static final ResourceLocation gui = new ResourceLocation("chisel:textures/autochisel-gui.png"); + private static final ResourceLocation gui = new ResourceLocation("chisel:textures/autochisel-gui.png"); - private TileEntityAutoChisel autochisel; + private TileEntityAutoChisel autochisel; - public GuiAutoChisel(InventoryPlayer inventoryPlayer, TileEntityAutoChisel tileEntityAutoChisel) { - super(new ContainerAutoChisel(inventoryPlayer, tileEntityAutoChisel)); - autochisel = tileEntityAutoChisel; - } + public GuiAutoChisel(InventoryPlayer inventoryPlayer, TileEntityAutoChisel tileEntityAutoChisel) { + super(new ContainerAutoChisel(inventoryPlayer, tileEntityAutoChisel)); + autochisel = tileEntityAutoChisel; + } - @Override - protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - super.drawGuiContainerForegroundLayer(mouseX, mouseY); - } - - @SuppressWarnings("unchecked") - @Override - public void drawScreen(int mouseX, int mouseY, float partialTick) { - super.drawScreen(mouseX, mouseY, partialTick); + @Override + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { + super.drawGuiContainerForegroundLayer(mouseX, mouseY); + } - int x = (this.width - this.xSize) / 2; - int y = (this.height - this.ySize) / 2; + @SuppressWarnings("unchecked") + @Override + public void drawScreen(int mouseX, int mouseY, float partialTick) { + super.drawScreen(mouseX, mouseY, partialTick); - for (Slot slot : (List) inventorySlots.inventorySlots) { - if (!slot.getHasStack() && mouseInside(slot, mouseX - x, mouseY - y)) { - if (slot.slotNumber < autochisel.getSizeInventory()) { - String tt = autochisel.getSlotTooltipUnloc(slot.slotNumber); - if (!Strings.isNullOrEmpty(tt)) { - this.func_146283_a(Lists.newArrayList(tt), mouseX, mouseY); - } - } - } - } - RenderHelper.enableGUIStandardItemLighting(); - } + int x = (this.width - this.xSize) / 2; + int y = (this.height - this.ySize) / 2; - private boolean mouseInside(Slot slot, int x, int y) { - return x >= slot.xDisplayPosition && x <= slot.xDisplayPosition + 16 && y >= slot.yDisplayPosition && y <= slot.yDisplayPosition + 16; - } + for (Slot slot : (List) inventorySlots.inventorySlots) { + if (!slot.getHasStack() && mouseInside(slot, mouseX - x, mouseY - y)) { + if (slot.slotNumber < autochisel.getSizeInventory()) { + String tt = autochisel.getSlotTooltipUnloc(slot.slotNumber); + if (!Strings.isNullOrEmpty(tt)) { + this.func_146283_a(Lists.newArrayList(tt), mouseX, mouseY); + } + } + } + } + RenderHelper.enableGUIStandardItemLighting(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(gui); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + private boolean mouseInside(Slot slot, int x, int y) { + return x >= slot.xDisplayPosition && x <= slot.xDisplayPosition + 16 + && y >= slot.yDisplayPosition + && y <= slot.yDisplayPosition + 16; + } - for (int i = TileEntityAutoChisel.BASE; i < TileEntityAutoChisel.CHISEL; i++) { - if (autochisel.getStackInSlot(i) == null) { - drawSlotOverlay(this, x, y, inventorySlots.getSlot(i), xSize, 0, 8); - } - } + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture(gui); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - if (autochisel.getStackInSlot(TileEntityAutoChisel.CHISEL) == null) { - drawSlotOverlay(this, x, y, inventorySlots.getSlot(TileEntityAutoChisel.CHISEL), xSize, 24, 0); - } - } + for (int i = TileEntityAutoChisel.BASE; i < TileEntityAutoChisel.CHISEL; i++) { + if (autochisel.getStackInSlot(i) == null) { + drawSlotOverlay(this, x, y, inventorySlots.getSlot(i), xSize, 0, 8); + } + } - public static void drawSlotOverlay(GuiContainer gui, int x, int y, Slot slot, int u, int v, int padding) { - padding /= 2; - gui.drawTexturedModalRect(x + (slot.xDisplayPosition - padding), y + (slot.yDisplayPosition - padding), u, v, 18 + padding, 18 + padding); - } + if (autochisel.getStackInSlot(TileEntityAutoChisel.CHISEL) == null) { + drawSlotOverlay(this, x, y, inventorySlots.getSlot(TileEntityAutoChisel.CHISEL), xSize, 24, 0); + } + } + + public static void drawSlotOverlay(GuiContainer gui, int x, int y, Slot slot, int u, int v, int padding) { + padding /= 2; + gui.drawTexturedModalRect( + x + (slot.xDisplayPosition - padding), + y + (slot.yDisplayPosition - padding), + u, + v, + 18 + padding, + 18 + padding); + } } diff --git a/src/main/java/team/chisel/client/gui/GuiChisel.java b/src/main/java/team/chisel/client/gui/GuiChisel.java index bc7dc54f..10d57f87 100644 --- a/src/main/java/team/chisel/client/gui/GuiChisel.java +++ b/src/main/java/team/chisel/client/gui/GuiChisel.java @@ -1,10 +1,7 @@ package team.chisel.client.gui; -import com.cricketcraft.chisel.api.IAdvancedChisel; -import com.cricketcraft.chisel.api.IChiselItem; -import com.cricketcraft.chisel.api.carving.IChiselMode; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import static team.chisel.Chisel.MOD_ID; + import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; @@ -13,8 +10,10 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; + import team.chisel.client.gui.widgets.GuiButtonChiselMode; import team.chisel.inventory.ContainerChisel; import team.chisel.inventory.InventoryChiselSelection; @@ -24,12 +23,19 @@ import team.chisel.network.PacketHandler; import team.chisel.network.message.MessageChiselMode; import team.chisel.utils.General; -import static team.chisel.Chisel.MOD_ID; +import com.cricketcraft.chisel.api.IAdvancedChisel; +import com.cricketcraft.chisel.api.IChiselItem; +import com.cricketcraft.chisel.api.carving.IChiselMode; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiChisel extends GuiContainer { - public static final ResourceLocation TEXTURE_RESOURCE_LOCATION = new ResourceLocation(MOD_ID, "textures/chisel2GuiScroll.png"); + public static final ResourceLocation TEXTURE_RESOURCE_LOCATION = new ResourceLocation( + MOD_ID, + "textures/chisel2GuiScroll.png"); public static final int TEXTURE_WIDTH = 266; public static final int TEXTURE_HEIGHT = 250; public static final int GUI_WIDTH = 266; @@ -84,8 +90,7 @@ public class GuiChisel extends GuiContainer { } private boolean showMode() { - return container.chisel != null - && container.chisel.getItem() instanceof IChiselItem + return container.chisel != null && container.chisel.getItem() instanceof IChiselItem && ((IChiselItem) container.chisel.getItem()).hasModes(container.chisel); } @@ -94,11 +99,16 @@ public class GuiChisel extends GuiContainer { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); final String titleText = I18n.format(container.inventory.getInventoryName() + ".title"); - fontRendererObj.drawSplitString(titleText, 50 - fontRendererObj.getStringWidth(titleText) / 2, 60, 40, 0x404040); + fontRendererObj + .drawSplitString(titleText, 50 - fontRendererObj.getStringWidth(titleText) / 2, 60, 40, 0x404040); if (showMode()) { final String modeText = I18n.format(container.inventory.getInventoryName() + ".mode"); - fontRendererObj.drawString(modeText, 12 + (GuiButtonChiselMode.BUTTON_WIDTH - fontRendererObj.getStringWidth(modeText)) / 2, 122, 0x404040); + fontRendererObj.drawString( + modeText, + 12 + (GuiButtonChiselMode.BUTTON_WIDTH - fontRendererObj.getStringWidth(modeText)) / 2, + 122, + 0x404040); } scrollBar.draw(this); @@ -115,7 +125,15 @@ public class GuiChisel extends GuiContainer { Slot main = (Slot) container.inventorySlots.get(InventoryChiselSelection.normalSlots); if (main.getStack() == null) { - func_146110_a(guiLeft + 8, guiTop + 8, 0, GUI_HEIGHT, CHISEL_INPUT_SIZE, CHISEL_INPUT_SIZE, TEXTURE_WIDTH, TEXTURE_HEIGHT); + func_146110_a( + guiLeft + 8, + guiTop + 8, + 0, + GUI_HEIGHT, + CHISEL_INPUT_SIZE, + CHISEL_INPUT_SIZE, + TEXTURE_WIDTH, + TEXTURE_HEIGHT); } } diff --git a/src/main/java/team/chisel/client/gui/GuiChiselConfig.java b/src/main/java/team/chisel/client/gui/GuiChiselConfig.java index 818c1282..c6ac72ee 100644 --- a/src/main/java/team/chisel/client/gui/GuiChiselConfig.java +++ b/src/main/java/team/chisel/client/gui/GuiChiselConfig.java @@ -1,17 +1,24 @@ package team.chisel.client.gui; -import team.chisel.Chisel; -import team.chisel.config.Configurations; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.ConfigElement; import net.minecraftforge.common.config.Configuration; + +import team.chisel.Chisel; +import team.chisel.config.Configurations; import cpw.mods.fml.client.config.GuiConfig; public class GuiChiselConfig extends GuiConfig { - public GuiChiselConfig(GuiScreen parent) { - super(parent, new ConfigElement(Configurations.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), Chisel.MOD_ID, false, false, GuiConfig - .getAbridgedConfigPath(Configurations.config.toString())); - } + public GuiChiselConfig(GuiScreen parent) { + super( + parent, + new ConfigElement(Configurations.config.getCategory(Configuration.CATEGORY_GENERAL)) + .getChildElements(), + Chisel.MOD_ID, + false, + false, + GuiConfig.getAbridgedConfigPath(Configurations.config.toString())); + } } diff --git a/src/main/java/team/chisel/client/gui/GuiFactory.java b/src/main/java/team/chisel/client/gui/GuiFactory.java index f5b2464c..e27bfcd8 100644 --- a/src/main/java/team/chisel/client/gui/GuiFactory.java +++ b/src/main/java/team/chisel/client/gui/GuiFactory.java @@ -4,27 +4,28 @@ import java.util.Set; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; + import cpw.mods.fml.client.IModGuiFactory; public class GuiFactory implements IModGuiFactory { - @Override - public void initialize(Minecraft minecraftInstance) { + @Override + public void initialize(Minecraft minecraftInstance) { - } + } - @Override - public Class mainConfigGuiClass() { - return GuiChiselConfig.class; - } + @Override + public Class mainConfigGuiClass() { + return GuiChiselConfig.class; + } - @Override - public Set runtimeGuiCategories() { - return null; - } + @Override + public Set runtimeGuiCategories() { + return null; + } - @Override - public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { - return null; - } -} \ No newline at end of file + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { + return null; + } +} diff --git a/src/main/java/team/chisel/client/gui/GuiPresent.java b/src/main/java/team/chisel/client/gui/GuiPresent.java index 6b31b054..56dd394d 100644 --- a/src/main/java/team/chisel/client/gui/GuiPresent.java +++ b/src/main/java/team/chisel/client/gui/GuiPresent.java @@ -11,22 +11,22 @@ import team.chisel.inventory.ContainerPresent; public class GuiPresent extends GuiContainer { - private static final ResourceLocation gui = new ResourceLocation("chisel:textures/present-gui.png"); - private int rows; + private static final ResourceLocation gui = new ResourceLocation("chisel:textures/present-gui.png"); + private int rows; - public GuiPresent(InventoryPlayer inventoryPlayer, TileEntityPresent tileEntityPresent) { - super(new ContainerPresent(inventoryPlayer, tileEntityPresent)); - rows = tileEntityPresent.getSizeInventory() / 9; - this.ySize = 114 + rows * 18; - } + public GuiPresent(InventoryPlayer inventoryPlayer, TileEntityPresent tileEntityPresent) { + super(new ContainerPresent(inventoryPlayer, tileEntityPresent)); + rows = tileEntityPresent.getSizeInventory() / 9; + this.ySize = 114 + rows * 18; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(gui); - int x = (this.width - this.xSize) / 2; - int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.rows * 18 + 17); - this.drawTexturedModalRect(x, y + this.rows * 18 + 17, 0, 126, this.xSize, 96); - } + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(gui); + int x = (this.width - this.xSize) / 2; + int y = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.rows * 18 + 17); + this.drawTexturedModalRect(x, y + this.rows * 18 + 17, 0, 126, this.xSize, 96); + } } diff --git a/src/main/java/team/chisel/client/gui/GuiScrollbar.java b/src/main/java/team/chisel/client/gui/GuiScrollbar.java index 7854f983..fe4fc668 100644 --- a/src/main/java/team/chisel/client/gui/GuiScrollbar.java +++ b/src/main/java/team/chisel/client/gui/GuiScrollbar.java @@ -1,13 +1,18 @@ package team.chisel.client.gui; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; + import team.chisel.inventory.ContainerChisel; import team.chisel.network.PacketHandler; import team.chisel.network.message.MessageScrollUpdate; public class GuiScrollbar { - public static final ResourceLocation TEXTURE_RESOURCE_LOCATION = new ResourceLocation("minecraft", "textures/gui/container/creative_inventory/tabs.png"); + + public static final ResourceLocation TEXTURE_RESOURCE_LOCATION = new ResourceLocation( + "minecraft", + "textures/gui/container/creative_inventory/tabs.png"); private int displayX = 0; private int displayY = 0; @@ -21,7 +26,8 @@ public class GuiScrollbar { private ContainerChisel container; public void draw(GuiChisel g) { - // chisel2GuiScroll scroll button texture coordinates work strange (maybe because of alignment) so taking vanilla one + // chisel2GuiScroll scroll button texture coordinates work strange (maybe because of alignment) so taking + // vanilla one g.mc.getTextureManager().bindTexture(TEXTURE_RESOURCE_LOCATION); GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); diff --git a/src/main/java/team/chisel/client/gui/widgets/GuiButtonChiselMode.java b/src/main/java/team/chisel/client/gui/widgets/GuiButtonChiselMode.java index e9291953..11622dec 100644 --- a/src/main/java/team/chisel/client/gui/widgets/GuiButtonChiselMode.java +++ b/src/main/java/team/chisel/client/gui/widgets/GuiButtonChiselMode.java @@ -1,106 +1,119 @@ package team.chisel.client.gui.widgets; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import org.lwjgl.opengl.GL11; -import team.chisel.client.gui.GuiChisel; -import team.chisel.item.chisel.ChiselMode; - import static team.chisel.client.gui.GuiChisel.*; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; + +import org.lwjgl.opengl.GL11; + +import team.chisel.client.gui.GuiChisel; +import team.chisel.item.chisel.ChiselMode; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class GuiButtonChiselMode extends GuiButton { - public static final int BUTTON_WIDTH = 48; - public static final int BUTTON_HEIGHT = 48; - private static final float BUTTON_BACKGROUND_U = 48; - private static final float BUTTON_BACKGROUND_V = 202; - private static final float MODE_VIGNETTE_U = BUTTON_BACKGROUND_U + 2 * BUTTON_WIDTH + 3; - private static final float MODE_VIGNETTE_V = BUTTON_BACKGROUND_V + 3; - private static final int MODE_VIGNETTE_WIDTH = 14; - private static final int MODE_VIGNETTE_ROW_WIDTH = 3 * MODE_VIGNETTE_WIDTH; - private static final int MODE_VIGNETTE_HEIGHT = 14; - private static final int MODE_VIGNETTE_COL_HEIGHT = 3 * MODE_VIGNETTE_HEIGHT; - private final GuiChisel guiChisel; - public GuiButtonChiselMode(int id, int x, int y, GuiChisel guiChisel) { - super(id, x, y, BUTTON_WIDTH, BUTTON_HEIGHT, ""); - this.guiChisel = guiChisel; - } + public static final int BUTTON_WIDTH = 48; + public static final int BUTTON_HEIGHT = 48; + private static final float BUTTON_BACKGROUND_U = 48; + private static final float BUTTON_BACKGROUND_V = 202; + private static final float MODE_VIGNETTE_U = BUTTON_BACKGROUND_U + 2 * BUTTON_WIDTH + 3; + private static final float MODE_VIGNETTE_V = BUTTON_BACKGROUND_V + 3; + private static final int MODE_VIGNETTE_WIDTH = 14; + private static final int MODE_VIGNETTE_ROW_WIDTH = 3 * MODE_VIGNETTE_WIDTH; + private static final int MODE_VIGNETTE_HEIGHT = 14; + private static final int MODE_VIGNETTE_COL_HEIGHT = 3 * MODE_VIGNETTE_HEIGHT; + private final GuiChisel guiChisel; - /** - * Draws this button to the screen. - * - * @param mc The Minecraft instance - * @param mouseX The horizontal location of the mouse within the GuiScreen - * @param mouseY The vertical location of the mouse relative to the GuiScreen - */ - @Override - public void drawButton(final Minecraft mc, final int mouseX, final int mouseY) { - if (this.visible) { - mc.getTextureManager().bindTexture(TEXTURE_RESOURCE_LOCATION); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - // Mouse Hover State - this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; - drawButtonBackgroundLayer(); - drawButtonForegroundLayer(); - } - } + public GuiButtonChiselMode(int id, int x, int y, GuiChisel guiChisel) { + super(id, x, y, BUTTON_WIDTH, BUTTON_HEIGHT, ""); + this.guiChisel = guiChisel; + } - private void drawButtonBackgroundLayer() { - final float u = BUTTON_BACKGROUND_U + (this.field_146123_n ? BUTTON_WIDTH : 0); - // drawModalRectWithCustomSizedTexture: x, y, u, v, width, height, textureWidth, textureHeight - func_146110_a(this.xPosition, this.yPosition, u, BUTTON_BACKGROUND_V, this.width, this.height, TEXTURE_WIDTH, TEXTURE_HEIGHT); - } + /** + * Draws this button to the screen. + * + * @param mc The Minecraft instance + * @param mouseX The horizontal location of the mouse within the GuiScreen + * @param mouseY The vertical location of the mouse relative to the GuiScreen + */ + @Override + public void drawButton(final Minecraft mc, final int mouseX, final int mouseY) { + if (this.visible) { + mc.getTextureManager().bindTexture(TEXTURE_RESOURCE_LOCATION); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + // Mouse Hover State + this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition + && mouseX < this.xPosition + this.width + && mouseY < this.yPosition + this.height; + drawButtonBackgroundLayer(); + drawButtonForegroundLayer(); + } + } - private void drawButtonForegroundLayer() { - final int xBase = this.xPosition + 3; - final int yBase = this.yPosition + 3; - final float uBase = MODE_VIGNETTE_U + (this.field_146123_n ? BUTTON_WIDTH : 0); - final float u; - final float v; - final int w; - final int h; - final int x; - final int y; - switch ((ChiselMode) guiChisel.getCurrentMode()) { - case SINGLE: - x = xBase + MODE_VIGNETTE_WIDTH; - y = yBase + MODE_VIGNETTE_HEIGHT; - u = uBase + MODE_VIGNETTE_WIDTH; - v = MODE_VIGNETTE_V + MODE_VIGNETTE_HEIGHT; - w = MODE_VIGNETTE_WIDTH; - h = MODE_VIGNETTE_HEIGHT; - break; - case ROW: - x = xBase; - y = yBase + MODE_VIGNETTE_HEIGHT; - u = uBase; - v = MODE_VIGNETTE_V + MODE_VIGNETTE_HEIGHT; - w = MODE_VIGNETTE_ROW_WIDTH; - h = MODE_VIGNETTE_HEIGHT; - break; - case COLUMN: - x = xBase + MODE_VIGNETTE_WIDTH; - y = yBase; - u = uBase + MODE_VIGNETTE_WIDTH; - v = MODE_VIGNETTE_V; - w = MODE_VIGNETTE_WIDTH; - h = MODE_VIGNETTE_COL_HEIGHT; - break; - case PANEL: - x = xBase; - y = yBase; - u = uBase; - v = MODE_VIGNETTE_V; - w = MODE_VIGNETTE_ROW_WIDTH; - h = MODE_VIGNETTE_COL_HEIGHT; - break; - default: - return; - } - // drawModalRectWithCustomSizedTexture: x, y, u, v, width, height, textureWidth, textureHeight - func_146110_a(x, y, u, v, w, h, TEXTURE_WIDTH, TEXTURE_HEIGHT); - } + private void drawButtonBackgroundLayer() { + final float u = BUTTON_BACKGROUND_U + (this.field_146123_n ? BUTTON_WIDTH : 0); + // drawModalRectWithCustomSizedTexture: x, y, u, v, width, height, textureWidth, textureHeight + func_146110_a( + this.xPosition, + this.yPosition, + u, + BUTTON_BACKGROUND_V, + this.width, + this.height, + TEXTURE_WIDTH, + TEXTURE_HEIGHT); + } + + private void drawButtonForegroundLayer() { + final int xBase = this.xPosition + 3; + final int yBase = this.yPosition + 3; + final float uBase = MODE_VIGNETTE_U + (this.field_146123_n ? BUTTON_WIDTH : 0); + final float u; + final float v; + final int w; + final int h; + final int x; + final int y; + switch ((ChiselMode) guiChisel.getCurrentMode()) { + case SINGLE: + x = xBase + MODE_VIGNETTE_WIDTH; + y = yBase + MODE_VIGNETTE_HEIGHT; + u = uBase + MODE_VIGNETTE_WIDTH; + v = MODE_VIGNETTE_V + MODE_VIGNETTE_HEIGHT; + w = MODE_VIGNETTE_WIDTH; + h = MODE_VIGNETTE_HEIGHT; + break; + case ROW: + x = xBase; + y = yBase + MODE_VIGNETTE_HEIGHT; + u = uBase; + v = MODE_VIGNETTE_V + MODE_VIGNETTE_HEIGHT; + w = MODE_VIGNETTE_ROW_WIDTH; + h = MODE_VIGNETTE_HEIGHT; + break; + case COLUMN: + x = xBase + MODE_VIGNETTE_WIDTH; + y = yBase; + u = uBase + MODE_VIGNETTE_WIDTH; + v = MODE_VIGNETTE_V; + w = MODE_VIGNETTE_WIDTH; + h = MODE_VIGNETTE_COL_HEIGHT; + break; + case PANEL: + x = xBase; + y = yBase; + u = uBase; + v = MODE_VIGNETTE_V; + w = MODE_VIGNETTE_ROW_WIDTH; + h = MODE_VIGNETTE_COL_HEIGHT; + break; + default: + return; + } + // drawModalRectWithCustomSizedTexture: x, y, u, v, width, height, textureWidth, textureHeight + func_146110_a(x, y, u, v, w, h, TEXTURE_WIDTH, TEXTURE_HEIGHT); + } } diff --git a/src/main/java/team/chisel/client/render/RenderBlocksEldritch.java b/src/main/java/team/chisel/client/render/RenderBlocksEldritch.java index 44a48ac0..3bd8ed0e 100644 --- a/src/main/java/team/chisel/client/render/RenderBlocksEldritch.java +++ b/src/main/java/team/chisel/client/render/RenderBlocksEldritch.java @@ -7,288 +7,296 @@ import net.minecraft.util.IIcon; public class RenderBlocksEldritch extends RenderBlocks { - RenderBlocksEldritch() { - super(); - } + RenderBlocksEldritch() { + super(); + } - static double displacementMap[] = { +0.1165, -0.0352, -0.1208, +0.0906, -0.0295, +0.0302, -0.0973, +0.0548, -0.1077, +0.0662, -0.0932, -0.0925, -0.1161, +0.0073, -0.1084, +0.1136, +0.0307, - +0.0316, -0.1066, -0.0237, +0.0614, -0.0864, +0.0837, +0.1218, +0.0502, -0.0529, -0.0942, +0.1209, -0.0418, +0.1035, +0.0066, -0.0255, +0.0830, -0.0361, +0.0965, +0.0646, +0.1124, - +0.0890, -0.0037, +0.0467, +0.1025, +0.1161, +0.0014, +0.0365, +0.0755, -0.0025, +0.0739, +0.0656, +0.0571, -0.0813, -0.0062, -0.0904, -0.0005, +0.0612, -0.0227, +0.0138, -0.0899, - -0.0019, -0.1047, +0.1191, -0.1197, -0.1123, +0.0999, +0.0638, +0.0865, +0.0029, -0.0084, +0.1132, -0.0433, +0.0115, +0.0850, +0.0439, +0.0748, +0.0460, -0.0441, +0.0839, +0.0162, - -0.0229, +0.0774, -0.0647, -0.0636, -0.0709, -0.0719, -0.0194, +0.1070, -0.0466, -0.1200, -0.0996, -0.0298, -0.1035, -0.0006, +0.0530, -0.0939, -0.1210, +0.0176, +0.0924, +0.0343, - -0.0777, +0.1050, -0.0729, -0.0062, -0.1107, -0.0434, -0.0042, +0.0232, +0.0269, +0.0709, -0.0388, +0.0342, +0.0240, -0.0192, +0.0491, +0.0017, -0.1240, +0.0687, -0.1160, +0.1123, - -0.0332, -0.0260, +0.0476, -0.0049, -0.0893, -0.0243, -0.0371, -0.0230, +0.0656, +0.1080, +0.0781, -0.0648, +0.0082, -0.1086, -0.0451, -0.0594, -0.1155, -0.0623, -0.0152, +0.0131, - -0.0754, +0.0607, +0.0876, -0.0657, +0.0366, -0.0981, +0.1164, -0.0623, +0.0181, -0.0475, +0.0722, -0.0293, +0.0486, -0.0195, +0.1041, +0.1011, +0.0042, -0.0045, -0.1031, +0.0110, - +0.0058, +0.0083, -0.0782, -0.1003, -0.0082, -0.0304, -0.0971, -0.0097, -0.0208, -0.1059, -0.0239, -0.0385, +0.0505, +0.0537, -0.1098, -0.0022, -0.0165, -0.0027, -0.0208, +0.0305, - +0.0592, +0.0301, +0.0055, +0.1138, -0.0338, -0.0901, +0.1015, +0.0061, +0.0861, -0.1057, -0.0889, -0.0972, +0.0783, -0.1052, -0.0932, -0.1103, +0.0497, +0.1222, -0.0146, +0.0632, - -0.0240, -0.0193, +0.0676, -0.1128, -0.0886, +0.0926, +0.0538, -0.0175, -0.0966, -0.0369, +0.1124, -0.0820, -0.1013, -0.0836, -0.0981, -0.0502, +0.0573, +0.0616, -0.0458, +0.0294, - +0.0108, -0.0782, +0.0692, +0.0234, -0.0178, -0.0171, -0.0505, -0.0313, +0.0538, +0.0462, -0.0758, +0.0556, -0.0023, -0.1086, -0.0100, -0.0897, -0.0409, -0.1161, +0.0212, +0.1229, - -0.0945, +0.0341, +0.1238, +0.0893, -0.1189, -0.1098, -0.0125, +0.1137, -0.0202, +0.0239, -0.0408, +0.0920, +0.0777, -0.0085, -0.0572, -0.0293, -0.0131, +0.0272, +0.0991, }; + static double displacementMap[] = { +0.1165, -0.0352, -0.1208, +0.0906, -0.0295, +0.0302, -0.0973, +0.0548, -0.1077, + +0.0662, -0.0932, -0.0925, -0.1161, +0.0073, -0.1084, +0.1136, +0.0307, +0.0316, -0.1066, -0.0237, +0.0614, + -0.0864, +0.0837, +0.1218, +0.0502, -0.0529, -0.0942, +0.1209, -0.0418, +0.1035, +0.0066, -0.0255, +0.0830, + -0.0361, +0.0965, +0.0646, +0.1124, +0.0890, -0.0037, +0.0467, +0.1025, +0.1161, +0.0014, +0.0365, +0.0755, + -0.0025, +0.0739, +0.0656, +0.0571, -0.0813, -0.0062, -0.0904, -0.0005, +0.0612, -0.0227, +0.0138, -0.0899, + -0.0019, -0.1047, +0.1191, -0.1197, -0.1123, +0.0999, +0.0638, +0.0865, +0.0029, -0.0084, +0.1132, -0.0433, + +0.0115, +0.0850, +0.0439, +0.0748, +0.0460, -0.0441, +0.0839, +0.0162, -0.0229, +0.0774, -0.0647, -0.0636, + -0.0709, -0.0719, -0.0194, +0.1070, -0.0466, -0.1200, -0.0996, -0.0298, -0.1035, -0.0006, +0.0530, -0.0939, + -0.1210, +0.0176, +0.0924, +0.0343, -0.0777, +0.1050, -0.0729, -0.0062, -0.1107, -0.0434, -0.0042, +0.0232, + +0.0269, +0.0709, -0.0388, +0.0342, +0.0240, -0.0192, +0.0491, +0.0017, -0.1240, +0.0687, -0.1160, +0.1123, + -0.0332, -0.0260, +0.0476, -0.0049, -0.0893, -0.0243, -0.0371, -0.0230, +0.0656, +0.1080, +0.0781, -0.0648, + +0.0082, -0.1086, -0.0451, -0.0594, -0.1155, -0.0623, -0.0152, +0.0131, -0.0754, +0.0607, +0.0876, -0.0657, + +0.0366, -0.0981, +0.1164, -0.0623, +0.0181, -0.0475, +0.0722, -0.0293, +0.0486, -0.0195, +0.1041, +0.1011, + +0.0042, -0.0045, -0.1031, +0.0110, +0.0058, +0.0083, -0.0782, -0.1003, -0.0082, -0.0304, -0.0971, -0.0097, + -0.0208, -0.1059, -0.0239, -0.0385, +0.0505, +0.0537, -0.1098, -0.0022, -0.0165, -0.0027, -0.0208, +0.0305, + +0.0592, +0.0301, +0.0055, +0.1138, -0.0338, -0.0901, +0.1015, +0.0061, +0.0861, -0.1057, -0.0889, -0.0972, + +0.0783, -0.1052, -0.0932, -0.1103, +0.0497, +0.1222, -0.0146, +0.0632, -0.0240, -0.0193, +0.0676, -0.1128, + -0.0886, +0.0926, +0.0538, -0.0175, -0.0966, -0.0369, +0.1124, -0.0820, -0.1013, -0.0836, -0.0981, -0.0502, + +0.0573, +0.0616, -0.0458, +0.0294, +0.0108, -0.0782, +0.0692, +0.0234, -0.0178, -0.0171, -0.0505, -0.0313, + +0.0538, +0.0462, -0.0758, +0.0556, -0.0023, -0.1086, -0.0100, -0.0897, -0.0409, -0.1161, +0.0212, +0.1229, + -0.0945, +0.0341, +0.1238, +0.0893, -0.1189, -0.1098, -0.0125, +0.1137, -0.0202, +0.0239, -0.0408, +0.0920, + +0.0777, -0.0085, -0.0572, -0.0293, -0.0131, +0.0272, +0.0991, }; - static int dmap1 = displacementMap.length * 1 / 6; - static int dmap2 = displacementMap.length * 2 / 6; - static int dmap3 = displacementMap.length * 3 / 6; - static int dmap4 = displacementMap.length * 4 / 6; - static int dmap5 = displacementMap.length * 5 / 6; - static int dmap = displacementMap.length; + static int dmap1 = displacementMap.length * 1 / 6; + static int dmap2 = displacementMap.length * 2 / 6; + static int dmap3 = displacementMap.length * 3 / 6; + static int dmap4 = displacementMap.length * 4 / 6; + static int dmap5 = displacementMap.length * 5 / 6; + static int dmap = displacementMap.length; - Tessellator tessellator; - double[] X = new double[14]; - double[] Y = new double[14]; - double[] Z = new double[14]; - double[] U = new double[14]; - double[] V = new double[14]; - int[] L = new int[14]; - float[] R = new float[14]; - float[] G = new float[14]; - float[] B = new float[14]; + Tessellator tessellator; + double[] X = new double[14]; + double[] Y = new double[14]; + double[] Z = new double[14]; + double[] U = new double[14]; + double[] V = new double[14]; + int[] L = new int[14]; + float[] R = new float[14]; + float[] G = new float[14]; + float[] B = new float[14]; - @Override - public boolean renderStandardBlock(Block block, int x, int y, int z) { - int index = x + y * 34573 + z * 32465781; - if (index < 0) - index = -index; + @Override + public boolean renderStandardBlock(Block block, int x, int y, int z) { + int index = x + y * 34573 + z * 32465781; + if (index < 0) index = -index; - X[0] = x; - Z[0] = z; - Y[0] = y; + X[0] = x; + Z[0] = z; + Y[0] = y; - X[1] = x; - Z[1] = z; - Y[1] = y + 1; + X[1] = x; + Z[1] = z; + Y[1] = y + 1; - X[2] = x + 1; - Z[2] = z; - Y[2] = y + 1; + X[2] = x + 1; + Z[2] = z; + Y[2] = y + 1; - X[3] = x + 1; - Z[3] = z; - Y[3] = y; + X[3] = x + 1; + Z[3] = z; + Y[3] = y; - X[4] = x; - Z[4] = z + 1; - Y[4] = y; + X[4] = x; + Z[4] = z + 1; + Y[4] = y; - X[5] = x; - Z[5] = z + 1; - Y[5] = y + 1; + X[5] = x; + Z[5] = z + 1; + Y[5] = y + 1; - X[6] = x + 1; - Z[6] = z + 1; - Y[6] = y + 1; + X[6] = x + 1; + Z[6] = z + 1; + Y[6] = y + 1; - X[7] = x + 1; - Z[7] = z + 1; - Y[7] = y; + X[7] = x + 1; + Z[7] = z + 1; + Y[7] = y; - X[8] = x + 0.5 + displacementMap[(index + 0) % dmap]; - Z[8] = z - displacementMap[(index + 10) % dmap]; - Y[8] = y + 0.5 + displacementMap[(index + 20) % dmap]; + X[8] = x + 0.5 + displacementMap[(index + 0) % dmap]; + Z[8] = z - displacementMap[(index + 10) % dmap]; + Y[8] = y + 0.5 + displacementMap[(index + 20) % dmap]; - X[9] = x - displacementMap[(index + 0 + dmap1) % dmap]; - Z[9] = z + 0.5 + displacementMap[(index + 10 + dmap1) % dmap]; - Y[9] = y + 0.5 + displacementMap[(index + 20 + dmap1) % dmap]; + X[9] = x - displacementMap[(index + 0 + dmap1) % dmap]; + Z[9] = z + 0.5 + displacementMap[(index + 10 + dmap1) % dmap]; + Y[9] = y + 0.5 + displacementMap[(index + 20 + dmap1) % dmap]; - X[10] = x + 0.5 + displacementMap[(index + 0 + dmap2) % dmap]; - Z[10] = z + 1 + displacementMap[(index + 10 + dmap2) % dmap]; - Y[10] = y + 0.5 + displacementMap[(index + 20 + dmap2) % dmap]; + X[10] = x + 0.5 + displacementMap[(index + 0 + dmap2) % dmap]; + Z[10] = z + 1 + displacementMap[(index + 10 + dmap2) % dmap]; + Y[10] = y + 0.5 + displacementMap[(index + 20 + dmap2) % dmap]; - X[11] = x + 1 + displacementMap[(index + 0 + dmap3) % dmap]; - Z[11] = z + 0.5 + displacementMap[(index + 10 + dmap3) % dmap]; - Y[11] = y + 0.5 + displacementMap[(index + 20 + dmap3) % dmap]; + X[11] = x + 1 + displacementMap[(index + 0 + dmap3) % dmap]; + Z[11] = z + 0.5 + displacementMap[(index + 10 + dmap3) % dmap]; + Y[11] = y + 0.5 + displacementMap[(index + 20 + dmap3) % dmap]; - X[12] = x + 0.5 + displacementMap[(index + 0 + dmap4) % dmap]; - Z[12] = z + 0.5 + displacementMap[(index + 10 + dmap4) % dmap]; - Y[12] = y + 1;// +displacementMap[(index+20+dmap4)%dmap]; + X[12] = x + 0.5 + displacementMap[(index + 0 + dmap4) % dmap]; + Z[12] = z + 0.5 + displacementMap[(index + 10 + dmap4) % dmap]; + Y[12] = y + 1;// +displacementMap[(index+20+dmap4)%dmap]; - X[13] = x + 0.5 + displacementMap[(index + 0 + dmap5) % dmap]; - Z[13] = z + 0.5 + displacementMap[(index + 10 + dmap5) % dmap]; - Y[13] = y + 0;// +displacementMap[(index+20+dmap5)%dmap]; + X[13] = x + 0.5 + displacementMap[(index + 0 + dmap5) % dmap]; + Z[13] = z + 0.5 + displacementMap[(index + 10 + dmap5) % dmap]; + Y[13] = y + 0;// +displacementMap[(index+20+dmap5)%dmap]; - tessellator = Tessellator.instance; - tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + tessellator = Tessellator.instance; + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); - return super.renderStandardBlock(block, x, y, z); - } + return super.renderStandardBlock(block, x, y, z); + } - void setupSides(IIcon icon, int a, int b, int c, int d, int e, int ta, int tb, int tc, int td) { - L[a] = brightnessBottomLeft; - L[b] = brightnessBottomRight; - L[c] = brightnessTopRight; - L[d] = brightnessTopLeft; - L[e] = (brightnessBottomLeft + brightnessTopLeft + brightnessTopRight + brightnessBottomRight) / 4; + void setupSides(IIcon icon, int a, int b, int c, int d, int e, int ta, int tb, int tc, int td) { + L[a] = brightnessBottomLeft; + L[b] = brightnessBottomRight; + L[c] = brightnessTopRight; + L[d] = brightnessTopLeft; + L[e] = (brightnessBottomLeft + brightnessTopLeft + brightnessTopRight + brightnessBottomRight) / 4; - R[a] = colorRedBottomLeft; - R[b] = colorRedBottomRight; - R[c] = colorRedTopRight; - R[d] = colorRedTopLeft; - R[e] = (colorRedBottomLeft + colorRedTopLeft + colorRedTopRight + colorRedBottomRight) / 4; + R[a] = colorRedBottomLeft; + R[b] = colorRedBottomRight; + R[c] = colorRedTopRight; + R[d] = colorRedTopLeft; + R[e] = (colorRedBottomLeft + colorRedTopLeft + colorRedTopRight + colorRedBottomRight) / 4; - G[a] = colorGreenBottomLeft; - G[b] = colorGreenBottomRight; - G[c] = colorGreenTopRight; - G[d] = colorGreenTopLeft; - G[e] = (colorGreenBottomLeft + colorGreenTopLeft + colorGreenTopRight + colorGreenBottomRight) / 4; + G[a] = colorGreenBottomLeft; + G[b] = colorGreenBottomRight; + G[c] = colorGreenTopRight; + G[d] = colorGreenTopLeft; + G[e] = (colorGreenBottomLeft + colorGreenTopLeft + colorGreenTopRight + colorGreenBottomRight) / 4; - B[a] = colorBlueBottomLeft; - B[b] = colorBlueBottomRight; - B[c] = colorBlueTopRight; - B[d] = colorBlueTopLeft; - B[e] = (colorBlueBottomLeft + colorBlueTopLeft + colorBlueTopRight + colorBlueBottomRight) / 4; + B[a] = colorBlueBottomLeft; + B[b] = colorBlueBottomRight; + B[c] = colorBlueTopRight; + B[d] = colorBlueTopLeft; + B[e] = (colorBlueBottomLeft + colorBlueTopLeft + colorBlueTopRight + colorBlueBottomRight) / 4; - double u0 = icon.getMaxU(); - double u1 = icon.getMinU(); - double v0 = icon.getMaxV(); - double v1 = icon.getMinV(); + double u0 = icon.getMaxU(); + double u1 = icon.getMinU(); + double v0 = icon.getMaxV(); + double v1 = icon.getMinV(); - U[ta] = u0; - U[tb] = u0; - U[tc] = u1; - U[td] = u1; - U[e] = icon.getInterpolatedU(8.0D); + U[ta] = u0; + U[tb] = u0; + U[tc] = u1; + U[td] = u1; + U[e] = icon.getInterpolatedU(8.0D); - V[ta] = v0; - V[tb] = v1; - V[tc] = v1; - V[td] = v0; - V[e] = icon.getInterpolatedV(8.0D); - } + V[ta] = v0; + V[tb] = v1; + V[tc] = v1; + V[td] = v0; + V[e] = icon.getInterpolatedV(8.0D); + } - void vert(int index) { - if (enableAO) { - tessellator.setColorOpaque_F(R[index], G[index], B[index]); - tessellator.setBrightness(L[index]); - } + void vert(int index) { + if (enableAO) { + tessellator.setColorOpaque_F(R[index], G[index], B[index]); + tessellator.setBrightness(L[index]); + } - tessellator.addVertexWithUV(X[index], Y[index], Z[index], U[index], V[index]); - } + tessellator.addVertexWithUV(X[index], Y[index], Z[index], U[index], V[index]); + } - @Override - public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) { - setupSides(icon, 1, 0, 4, 5, 9, 4, 5, 1, 0); - vert(1); - vert(0); - vert(9); - vert(9); - vert(0); - vert(4); - vert(9); - vert(9); - vert(4); - vert(5); - vert(9); - vert(9); - vert(5); - vert(1); - vert(9); - vert(9); - } + @Override + public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) { + setupSides(icon, 1, 0, 4, 5, 9, 4, 5, 1, 0); + vert(1); + vert(0); + vert(9); + vert(9); + vert(0); + vert(4); + vert(9); + vert(9); + vert(4); + vert(5); + vert(9); + vert(9); + vert(5); + vert(1); + vert(9); + vert(9); + } - @Override - public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) { - setupSides(icon, 3, 2, 6, 7, 11, 3, 2, 6, 7); - vert(6); - vert(7); - vert(11); - vert(11); - vert(7); - vert(3); - vert(11); - vert(11); - vert(3); - vert(2); - vert(11); - vert(11); - vert(2); - vert(6); - vert(11); - vert(11); + @Override + public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) { + setupSides(icon, 3, 2, 6, 7, 11, 3, 2, 6, 7); + vert(6); + vert(7); + vert(11); + vert(11); + vert(7); + vert(3); + vert(11); + vert(11); + vert(3); + vert(2); + vert(11); + vert(11); + vert(2); + vert(6); + vert(11); + vert(11); - } + } - @Override - public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) { - setupSides(icon, 2, 3, 0, 1, 8, 0, 1, 2, 3); - vert(0); - vert(1); - vert(8); - vert(8); - vert(1); - vert(2); - vert(8); - vert(8); - vert(2); - vert(3); - vert(8); - vert(8); - vert(3); - vert(0); - vert(8); - vert(8); - } + @Override + public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) { + setupSides(icon, 2, 3, 0, 1, 8, 0, 1, 2, 3); + vert(0); + vert(1); + vert(8); + vert(8); + vert(1); + vert(2); + vert(8); + vert(8); + vert(2); + vert(3); + vert(8); + vert(8); + vert(3); + vert(0); + vert(8); + vert(8); + } - @Override - public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) { - setupSides(icon, 4, 7, 6, 5, 10, 7, 6, 5, 4); - vert(5); - vert(4); - vert(10); - vert(10); - vert(6); - vert(5); - vert(10); - vert(10); - vert(7); - vert(6); - vert(10); - vert(10); - vert(4); - vert(7); - vert(10); - vert(10); - } + @Override + public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) { + setupSides(icon, 4, 7, 6, 5, 10, 7, 6, 5, 4); + vert(5); + vert(4); + vert(10); + vert(10); + vert(6); + vert(5); + vert(10); + vert(10); + vert(7); + vert(6); + vert(10); + vert(10); + vert(4); + vert(7); + vert(10); + vert(10); + } - @Override - public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) { - setupSides(icon, 0, 3, 7, 4, 13, 0, 3, 7, 4); - vert(0); - vert(3); - vert(13); - vert(13); - vert(3); - vert(7); - vert(13); - vert(13); - vert(7); - vert(4); - vert(13); - vert(13); - vert(4); - vert(0); - vert(13); - vert(13); - } + @Override + public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) { + setupSides(icon, 0, 3, 7, 4, 13, 0, 3, 7, 4); + vert(0); + vert(3); + vert(13); + vert(13); + vert(3); + vert(7); + vert(13); + vert(13); + vert(7); + vert(4); + vert(13); + vert(13); + vert(4); + vert(0); + vert(13); + vert(13); + } - @Override - public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) { - setupSides(icon, 2, 1, 5, 6, 12, 2, 1, 5, 6); + @Override + public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) { + setupSides(icon, 2, 1, 5, 6, 12, 2, 1, 5, 6); - vert(2); - vert(1); - vert(12); - vert(12); - vert(1); - vert(5); - vert(12); - vert(12); - vert(5); - vert(6); - vert(12); - vert(12); - vert(6); - vert(2); - vert(12); - vert(12); - } + vert(2); + vert(1); + vert(12); + vert(12); + vert(1); + vert(5); + vert(12); + vert(12); + vert(5); + vert(6); + vert(12); + vert(12); + vert(6); + vert(2); + vert(12); + vert(12); + } } diff --git a/src/main/java/team/chisel/client/render/RenderChiselSnowman.java b/src/main/java/team/chisel/client/render/RenderChiselSnowman.java index 9471f3dd..f1c4badf 100644 --- a/src/main/java/team/chisel/client/render/RenderChiselSnowman.java +++ b/src/main/java/team/chisel/client/render/RenderChiselSnowman.java @@ -1,5 +1,8 @@ package team.chisel.client.render; +import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED; +import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D; + import net.minecraft.block.Block; import net.minecraft.client.model.ModelSnowMan; import net.minecraft.client.renderer.RenderBlocks; @@ -15,53 +18,52 @@ import net.minecraftforge.client.MinecraftForgeClient; import org.lwjgl.opengl.GL11; import team.chisel.entity.EntityChiselSnowman; -import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED; -import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D; public class RenderChiselSnowman extends RenderLiving { - private static final ResourceLocation snowManTextures = new ResourceLocation("textures/entity/snowman.png"); - private ModelSnowMan snowMan; + private static final ResourceLocation snowManTextures = new ResourceLocation("textures/entity/snowman.png"); + private ModelSnowMan snowMan; - public RenderChiselSnowman() { - super(new ModelSnowMan(), 0.5F); - snowMan = (ModelSnowMan) super.mainModel; - setRenderPassModel(this.snowMan); - } + public RenderChiselSnowman() { + super(new ModelSnowMan(), 0.5F); + snowMan = (ModelSnowMan) super.mainModel; + setRenderPassModel(this.snowMan); + } - @Override - protected void renderEquippedItems(EntityLivingBase entityLivingBase, float size) { - this.renderEquippedItems((EntityChiselSnowman) entityLivingBase, size); - } + @Override + protected void renderEquippedItems(EntityLivingBase entityLivingBase, float size) { + this.renderEquippedItems((EntityChiselSnowman) entityLivingBase, size); + } - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - return this.getEntityTexture((EntityChiselSnowman) entity); - } + @Override + protected ResourceLocation getEntityTexture(Entity entity) { + return this.getEntityTexture((EntityChiselSnowman) entity); + } - protected ResourceLocation getEntityTexture(EntityChiselSnowman snowman) { - return snowManTextures; - } + protected ResourceLocation getEntityTexture(EntityChiselSnowman snowman) { + return snowManTextures; + } - protected void renderEquippedItems(EntityChiselSnowman snowman, float size) { - super.renderEquippedItems(snowman, size); - ItemStack itemStack = snowman.getEquipmentInSlot(2); + protected void renderEquippedItems(EntityChiselSnowman snowman, float size) { + super.renderEquippedItems(snowman, size); + ItemStack itemStack = snowman.getEquipmentInSlot(2); - if (itemStack.getItem() instanceof ItemBlock) { - GL11.glPushMatrix(); - this.snowMan.head.postRender(0.0625F); + if (itemStack.getItem() instanceof ItemBlock) { + GL11.glPushMatrix(); + this.snowMan.head.postRender(0.0625F); - IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, EQUIPPED); - boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemStack, BLOCK_3D)); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, EQUIPPED); + boolean is3D = (customRenderer != null + && customRenderer.shouldUseRenderHelper(EQUIPPED, itemStack, BLOCK_3D)); - if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemStack.getItem()).getRenderType())) { - float f1 = 0.625F; - GL11.glTranslatef(0.0F, -0.34375F, 0.0F); - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(f1, -f1, f1); - } - this.renderManager.itemRenderer.renderItem(snowman, itemStack, 0); - GL11.glPopMatrix(); - } - } + if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemStack.getItem()).getRenderType())) { + float f1 = 0.625F; + GL11.glTranslatef(0.0F, -0.34375F, 0.0F); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(f1, -f1, f1); + } + this.renderManager.itemRenderer.renderItem(snowman, itemStack, 0); + GL11.glPopMatrix(); + } + } } diff --git a/src/main/java/team/chisel/client/render/RendererCTM.java b/src/main/java/team/chisel/client/render/RendererCTM.java index c3f41744..0cc6c7f5 100644 --- a/src/main/java/team/chisel/client/render/RendererCTM.java +++ b/src/main/java/team/chisel/client/render/RendererCTM.java @@ -3,13 +3,12 @@ package team.chisel.client.render; import team.chisel.ctmlib.CTMRenderer; import com.cricketcraft.chisel.api.rendering.ClientUtils; - import cpw.mods.fml.client.registry.RenderingRegistry; public class RendererCTM extends CTMRenderer { - public RendererCTM() { - super(RenderingRegistry.getNextAvailableRenderId()); - ClientUtils.renderCTMId = getRenderId(); - } + public RendererCTM() { + super(RenderingRegistry.getNextAvailableRenderId()); + ClientUtils.renderCTMId = getRenderId(); + } } diff --git a/src/main/java/team/chisel/client/render/RendererCTMPane.java b/src/main/java/team/chisel/client/render/RendererCTMPane.java index 86f31e59..5fc44815 100644 --- a/src/main/java/team/chisel/client/render/RendererCTMPane.java +++ b/src/main/java/team/chisel/client/render/RendererCTMPane.java @@ -16,308 +16,312 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class RendererCTMPane implements ISimpleBlockRenderingHandler { - public static int id; + public static int id; - public RendererCTMPane() { - id = RenderingRegistry.getNextAvailableRenderId(); - } + public RendererCTMPane() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - @Override - public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - GL11.glScalef(1.25f, 1.25f, 1.25f); - renderer.setRenderBounds(0.0f, 0.0f, 0.5f - 0.0625f, 1.0f, 1.0f, 0.5f + 0.0625f); - Drawing.drawBlock(block, meta, renderer); - } + @Override + public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + GL11.glScalef(1.25f, 1.25f, 1.25f); + renderer.setRenderBounds(0.0f, 0.0f, 0.5f - 0.0625f, 1.0f, 1.0f, 0.5f + 0.0625f); + Drawing.drawBlock(block, meta, renderer); + } - class PaneRenderer { + class PaneRenderer { - Tessellator tessellator; + Tessellator tessellator; - double i0u0; - double i0uh; - double i0u1; - double i0v0; - double i0v1; + double i0u0; + double i0uh; + double i0u1; + double i0v0; + double i0v1; - double i1u0; - double i1u1; - double i1v0; - double i1vh; - double i1v1; - double i1v; + double i1u0; + double i1u1; + double i1v0; + double i1vh; + double i1v1; + double i1v; - double i2u0; - double i2u1; - double i2v0; - double i2v1; - double i2v; + double i2u0; + double i2u1; + double i2v0; + double i2v1; + double i2v; - double x0; - double xh; - double x1; - double xp0; - double xp1; + double x0; + double xh; + double x1; + double xp0; + double xp1; - double z0; - double zh; - double z1; - double zp0; - double zp1; + double z0; + double zh; + double z1; + double zp0; + double zp1; - double y0; - double y1; + double y0; + double y1; - void set(double x, double y, double z, IIcon icon, IIcon icon1, IIcon icon2) { - tessellator = Tessellator.instance; + void set(double x, double y, double z, IIcon icon, IIcon icon1, IIcon icon2) { + tessellator = Tessellator.instance; - i0u0 = icon.getMinU(); - i0uh = icon.getInterpolatedU(8.0D); - i0u1 = icon.getMaxU(); - i0v0 = icon.getMinV(); - i0v1 = icon.getMaxV(); + i0u0 = icon.getMinU(); + i0uh = icon.getInterpolatedU(8.0D); + i0u1 = icon.getMaxU(); + i0v0 = icon.getMinV(); + i0v1 = icon.getMaxV(); - i1u0 = icon1.getInterpolatedU(7.0D); - i1u1 = icon1.getInterpolatedU(9.0D); - i1v0 = icon1.getMinV(); - i1vh = icon1.getInterpolatedV(8.0D); - i1v1 = icon1.getMaxV(); - i1v = i1v1 - i1v0; + i1u0 = icon1.getInterpolatedU(7.0D); + i1u1 = icon1.getInterpolatedU(9.0D); + i1v0 = icon1.getMinV(); + i1vh = icon1.getInterpolatedV(8.0D); + i1v1 = icon1.getMaxV(); + i1v = i1v1 - i1v0; - i2u0 = icon2.getInterpolatedU(7.0D); - i2u1 = icon2.getInterpolatedU(9.0D); - i2v0 = icon2.getMinV(); - i2v1 = icon2.getMaxV(); - i2v = i2v1 - i2v0; + i2u0 = icon2.getInterpolatedU(7.0D); + i2u1 = icon2.getInterpolatedU(9.0D); + i2v0 = icon2.getMinV(); + i2v1 = icon2.getMaxV(); + i2v = i2v1 - i2v0; - x0 = x; - xh = x0 + 0.5D; - x1 = x + 1; - xp0 = x0 + 0.5D - 0.0625D; - xp1 = x0 + 0.5D + 0.0625D; + x0 = x; + xh = x0 + 0.5D; + x1 = x + 1; + xp0 = x0 + 0.5D - 0.0625D; + xp1 = x0 + 0.5D + 0.0625D; - z0 = z; - zh = z0 + 0.5D; - z1 = z + 1; - zp0 = z0 + 0.5D - 0.0625D; - zp1 = z0 + 0.5D + 0.0625D; + z0 = z; + zh = z0 + 0.5D; + z1 = z + 1; + zp0 = z0 + 0.5D - 0.0625D; + zp1 = z0 + 0.5D + 0.0625D; - y0 = y; - y1 = y + 1; - } + y0 = y; + y1 = y + 1; + } - public void renderNorthPane() { - tessellator.addVertexWithUV(xh, y1, z0, i0uh, i0v0); - tessellator.addVertexWithUV(xh, y0, z0, i0uh, i0v1); - tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1); - tessellator.addVertexWithUV(xh, y1, zh, i0u0, i0v0); - tessellator.addVertexWithUV(xh, y1, zh, i0u0, i0v0); - tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1); - tessellator.addVertexWithUV(xh, y0, z0, i0uh, i0v1); - tessellator.addVertexWithUV(xh, y1, z0, i0uh, i0v0); - } + public void renderNorthPane() { + tessellator.addVertexWithUV(xh, y1, z0, i0uh, i0v0); + tessellator.addVertexWithUV(xh, y0, z0, i0uh, i0v1); + tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1); + tessellator.addVertexWithUV(xh, y1, zh, i0u0, i0v0); + tessellator.addVertexWithUV(xh, y1, zh, i0u0, i0v0); + tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1); + tessellator.addVertexWithUV(xh, y0, z0, i0uh, i0v1); + tessellator.addVertexWithUV(xh, y1, z0, i0uh, i0v0); + } - public void renderSouthPane() { - tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0); - tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1); - tessellator.addVertexWithUV(xh, y0, z1, i0uh, i0v1); - tessellator.addVertexWithUV(xh, y1, z1, i0uh, i0v0); - tessellator.addVertexWithUV(xh, y1, z1, i0uh, i0v0); - tessellator.addVertexWithUV(xh, y0, z1, i0uh, i0v1); - tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1); - tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0); - } + public void renderSouthPane() { + tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0); + tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1); + tessellator.addVertexWithUV(xh, y0, z1, i0uh, i0v1); + tessellator.addVertexWithUV(xh, y1, z1, i0uh, i0v0); + tessellator.addVertexWithUV(xh, y1, z1, i0uh, i0v0); + tessellator.addVertexWithUV(xh, y0, z1, i0uh, i0v1); + tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1); + tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0); + } - public void renderWestPane() { - tessellator.addVertexWithUV(x0, y1, zh, i0uh, i0v0); - tessellator.addVertexWithUV(x0, y0, zh, i0uh, i0v1); - tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1); - tessellator.addVertexWithUV(xh, y1, zh, i0u0, i0v0); - tessellator.addVertexWithUV(xh, y1, zh, i0u0, i0v0); - tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1); - tessellator.addVertexWithUV(x0, y0, zh, i0uh, i0v1); - tessellator.addVertexWithUV(x0, y1, zh, i0uh, i0v0); - } + public void renderWestPane() { + tessellator.addVertexWithUV(x0, y1, zh, i0uh, i0v0); + tessellator.addVertexWithUV(x0, y0, zh, i0uh, i0v1); + tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1); + tessellator.addVertexWithUV(xh, y1, zh, i0u0, i0v0); + tessellator.addVertexWithUV(xh, y1, zh, i0u0, i0v0); + tessellator.addVertexWithUV(xh, y0, zh, i0u0, i0v1); + tessellator.addVertexWithUV(x0, y0, zh, i0uh, i0v1); + tessellator.addVertexWithUV(x0, y1, zh, i0uh, i0v0); + } - public void renderEastPane() { - tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0); - tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1); - tessellator.addVertexWithUV(x1, y0, zh, i0uh, i0v1); - tessellator.addVertexWithUV(x1, y1, zh, i0uh, i0v0); - tessellator.addVertexWithUV(x1, y1, zh, i0uh, i0v0); - tessellator.addVertexWithUV(x1, y0, zh, i0uh, i0v1); - tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1); - tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0); - } + public void renderEastPane() { + tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0); + tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1); + tessellator.addVertexWithUV(x1, y0, zh, i0uh, i0v1); + tessellator.addVertexWithUV(x1, y1, zh, i0uh, i0v0); + tessellator.addVertexWithUV(x1, y1, zh, i0uh, i0v0); + tessellator.addVertexWithUV(x1, y0, zh, i0uh, i0v1); + tessellator.addVertexWithUV(xh, y0, zh, i0u1, i0v1); + tessellator.addVertexWithUV(xh, y1, zh, i0u1, i0v0); + } - public void renderVerticalNS(double y, double zoff0, double zoff1, double v0, double v1) { - tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff0, i1u0, i1v0 + i1v * v0); - tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff1, i1u0, i1v0 + i1v * v1); - tessellator.addVertexWithUV(xp1, y0 + y, z0 + zoff1, i1u1, i1v0 + i1v * v1); - tessellator.addVertexWithUV(xp1, y0 + y, z0 + zoff0, i1u1, i1v0 + i1v * v0); - tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff1, i1u0, i1v0 + i1v * v1); - tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff0, i1u0, i1v0 + i1v * v0); - tessellator.addVertexWithUV(xp1, y0 + y, z0 + zoff0, i1u1, i1v0 + i1v * v0); - tessellator.addVertexWithUV(xp1, y0 + y, z0 + zoff1, i1u1, i1v0 + i1v * v1); - } + public void renderVerticalNS(double y, double zoff0, double zoff1, double v0, double v1) { + tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff0, i1u0, i1v0 + i1v * v0); + tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff1, i1u0, i1v0 + i1v * v1); + tessellator.addVertexWithUV(xp1, y0 + y, z0 + zoff1, i1u1, i1v0 + i1v * v1); + tessellator.addVertexWithUV(xp1, y0 + y, z0 + zoff0, i1u1, i1v0 + i1v * v0); + tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff1, i1u0, i1v0 + i1v * v1); + tessellator.addVertexWithUV(xp0, y0 + y, z0 + zoff0, i1u0, i1v0 + i1v * v0); + tessellator.addVertexWithUV(xp1, y0 + y, z0 + zoff0, i1u1, i1v0 + i1v * v0); + tessellator.addVertexWithUV(xp1, y0 + y, z0 + zoff1, i1u1, i1v0 + i1v * v1); + } - public void renderVerticalWE(double y, double xoff0, double xoff1, double v0, double v1) { - tessellator.addVertexWithUV(x0 + xoff0, y0 + y, zp1, i1u1, i1v0 + i1v * v0); - tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp1, i1u1, i1v0 + i1v * v1); - tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp0, i1u0, i1v0 + i1v * v1); - tessellator.addVertexWithUV(x0 + xoff0, y0 + y, zp0, i1u0, i1v0 + i1v * v0); - tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp1, i1u1, i1v0 + i1v * v1); - tessellator.addVertexWithUV(x0 + xoff0, y0 + y, zp1, i1u1, i1v0 + i1v * v0); - tessellator.addVertexWithUV(x0 + xoff0, y0 + y, zp0, i1u0, i1v0 + i1v * v0); - tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp0, i1u0, i1v0 + i1v * v1); - } + public void renderVerticalWE(double y, double xoff0, double xoff1, double v0, double v1) { + tessellator.addVertexWithUV(x0 + xoff0, y0 + y, zp1, i1u1, i1v0 + i1v * v0); + tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp1, i1u1, i1v0 + i1v * v1); + tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp0, i1u0, i1v0 + i1v * v1); + tessellator.addVertexWithUV(x0 + xoff0, y0 + y, zp0, i1u0, i1v0 + i1v * v0); + tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp1, i1u1, i1v0 + i1v * v1); + tessellator.addVertexWithUV(x0 + xoff0, y0 + y, zp1, i1u1, i1v0 + i1v * v0); + tessellator.addVertexWithUV(x0 + xoff0, y0 + y, zp0, i1u0, i1v0 + i1v * v0); + tessellator.addVertexWithUV(x0 + xoff1, y0 + y, zp0, i1u0, i1v0 + i1v * v1); + } - public void renderHorizontalNS(double zoff, double v0, double v1) { - tessellator.addVertexWithUV(xp0, y1, z0 + zoff, i2u0, i2v0 + i2v * v1); - tessellator.addVertexWithUV(xp0, y0, z0 + zoff, i2u0, i2v0 + i2v * v0); - tessellator.addVertexWithUV(xp1, y0, z0 + zoff, i2u1, i2v0 + i2v * v0); - tessellator.addVertexWithUV(xp1, y1, z0 + zoff, i2u1, i2v0 + i2v * v1); - tessellator.addVertexWithUV(xp1, y1, z0 + zoff, i2u1, i2v0 + i2v * v1); - tessellator.addVertexWithUV(xp1, y0, z0 + zoff, i2u1, i2v0 + i2v * v0); - tessellator.addVertexWithUV(xp0, y0, z0 + zoff, i2u0, i2v0 + i2v * v0); - tessellator.addVertexWithUV(xp0, y1, z0 + zoff, i2u0, i2v0 + i2v * v1); + public void renderHorizontalNS(double zoff, double v0, double v1) { + tessellator.addVertexWithUV(xp0, y1, z0 + zoff, i2u0, i2v0 + i2v * v1); + tessellator.addVertexWithUV(xp0, y0, z0 + zoff, i2u0, i2v0 + i2v * v0); + tessellator.addVertexWithUV(xp1, y0, z0 + zoff, i2u1, i2v0 + i2v * v0); + tessellator.addVertexWithUV(xp1, y1, z0 + zoff, i2u1, i2v0 + i2v * v1); + tessellator.addVertexWithUV(xp1, y1, z0 + zoff, i2u1, i2v0 + i2v * v1); + tessellator.addVertexWithUV(xp1, y0, z0 + zoff, i2u1, i2v0 + i2v * v0); + tessellator.addVertexWithUV(xp0, y0, z0 + zoff, i2u0, i2v0 + i2v * v0); + tessellator.addVertexWithUV(xp0, y1, z0 + zoff, i2u0, i2v0 + i2v * v1); - } + } - public void renderHorizontalWE(double xoff, double v0, double v1) { - tessellator.addVertexWithUV(x0 + xoff, y1, zp0, i2u0, i2v0 + i2v * v1); - tessellator.addVertexWithUV(x0 + xoff, y0, zp0, i2u0, i2v0 + i2v * v0); - tessellator.addVertexWithUV(x0 + xoff, y0, zp1, i2u1, i2v0 + i2v * v0); - tessellator.addVertexWithUV(x0 + xoff, y1, zp1, i2u1, i2v0 + i2v * v1); - tessellator.addVertexWithUV(x0 + xoff, y1, zp1, i2u1, i2v0 + i2v * v1); - tessellator.addVertexWithUV(x0 + xoff, y0, zp1, i2u1, i2v0 + i2v * v0); - tessellator.addVertexWithUV(x0 + xoff, y0, zp0, i2u0, i2v0 + i2v * v0); - tessellator.addVertexWithUV(x0 + xoff, y1, zp0, i2u0, i2v0 + i2v * v1); - } - } + public void renderHorizontalWE(double xoff, double v0, double v1) { + tessellator.addVertexWithUV(x0 + xoff, y1, zp0, i2u0, i2v0 + i2v * v1); + tessellator.addVertexWithUV(x0 + xoff, y0, zp0, i2u0, i2v0 + i2v * v0); + tessellator.addVertexWithUV(x0 + xoff, y0, zp1, i2u1, i2v0 + i2v * v0); + tessellator.addVertexWithUV(x0 + xoff, y1, zp1, i2u1, i2v0 + i2v * v1); + tessellator.addVertexWithUV(x0 + xoff, y1, zp1, i2u1, i2v0 + i2v * v1); + tessellator.addVertexWithUV(x0 + xoff, y0, zp1, i2u1, i2v0 + i2v * v0); + tessellator.addVertexWithUV(x0 + xoff, y0, zp0, i2u0, i2v0 + i2v * v0); + tessellator.addVertexWithUV(x0 + xoff, y1, zp0, i2u0, i2v0 + i2v * v1); + } + } - PaneRenderer paneRenderer = new PaneRenderer(); + PaneRenderer paneRenderer = new PaneRenderer(); - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks renderer) { - BlockPane block = (BlockPane) b; - Tessellator tessellator = Tessellator.instance; + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId, + RenderBlocks renderer) { + BlockPane block = (BlockPane) b; + Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - float f = 1.0F; - int i1 = block.colorMultiplier(world, x, y, z); - float f1 = (i1 >> 16 & 255) / 255.0F; - float f2 = (i1 >> 8 & 255) / 255.0F; - float f3 = (i1 & 255) / 255.0F; + float f = 1.0F; + int i1 = block.colorMultiplier(world, x, y, z); + float f1 = (i1 >> 16 & 255) / 255.0F; + float f2 = (i1 >> 8 & 255) / 255.0F; + float f3 = (i1 & 255) / 255.0F; - if (EntityRenderer.anaglyphEnable) { - float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; - float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; - float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; - f1 = f4; - f2 = f5; - f3 = f6; - } - tessellator.setColorOpaque_F(f * f1, f * f2, f * f3); + if (EntityRenderer.anaglyphEnable) { + float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; + float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; + float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; + f1 = f4; + f2 = f5; + f3 = f6; + } + tessellator.setColorOpaque_F(f * f1, f * f2, f * f3); - int meta = world.getBlockMetadata(x, y, z); - IIcon iconPane = block.getIcon(2, meta); - IIcon iconTop = block.getIcon(1, meta); - IIcon iconSide = block.getIcon(0, meta); - if (iconPane == null || iconTop == null || iconSide == null) - return false; + int meta = world.getBlockMetadata(x, y, z); + IIcon iconPane = block.getIcon(2, meta); + IIcon iconTop = block.getIcon(1, meta); + IIcon iconSide = block.getIcon(0, meta); + if (iconPane == null || iconTop == null || iconSide == null) return false; - if (renderer.hasOverrideBlockTexture()) { - paneRenderer.set(x, y, z, renderer.overrideBlockTexture, renderer.overrideBlockTexture, renderer.overrideBlockTexture); - } else { - paneRenderer.set(x, y, z, iconPane, iconTop, iconSide); - } + if (renderer.hasOverrideBlockTexture()) { + paneRenderer.set( + x, + y, + z, + renderer.overrideBlockTexture, + renderer.overrideBlockTexture, + renderer.overrideBlockTexture); + } else { + paneRenderer.set(x, y, z, iconPane, iconTop, iconSide); + } - boolean connectsNorth = block.canPaneConnectToBlock(world.getBlock(x, y, z - 1)); - boolean connectsSouth = block.canPaneConnectToBlock(world.getBlock(x, y, z + 1)); - boolean connectsWest = block.canPaneConnectToBlock(world.getBlock(x - 1, y, z)); - boolean connectsEast = block.canPaneConnectToBlock(world.getBlock(x + 1, y, z)); - boolean connectsTop = block.canPaneConnectToBlock(world.getBlock(x, y + 1, z)); - boolean connectsBottom = block.canPaneConnectToBlock(world.getBlock(x, y - 1, z)); + boolean connectsNorth = block.canPaneConnectToBlock(world.getBlock(x, y, z - 1)); + boolean connectsSouth = block.canPaneConnectToBlock(world.getBlock(x, y, z + 1)); + boolean connectsWest = block.canPaneConnectToBlock(world.getBlock(x - 1, y, z)); + boolean connectsEast = block.canPaneConnectToBlock(world.getBlock(x + 1, y, z)); + boolean connectsTop = block.canPaneConnectToBlock(world.getBlock(x, y + 1, z)); + boolean connectsBottom = block.canPaneConnectToBlock(world.getBlock(x, y - 1, z)); - boolean connectsTopNorth = block.canPaneConnectToBlock(world.getBlock(x, y + 1, z - 1)); - boolean connectsTopSouth = block.canPaneConnectToBlock(world.getBlock(x, y + 1, z + 1)); - boolean connectsTopWest = block.canPaneConnectToBlock(world.getBlock(x - 1, y + 1, z)); - boolean connectsTopEast = block.canPaneConnectToBlock(world.getBlock(x + 1, y + 1, z)); + boolean connectsTopNorth = block.canPaneConnectToBlock(world.getBlock(x, y + 1, z - 1)); + boolean connectsTopSouth = block.canPaneConnectToBlock(world.getBlock(x, y + 1, z + 1)); + boolean connectsTopWest = block.canPaneConnectToBlock(world.getBlock(x - 1, y + 1, z)); + boolean connectsTopEast = block.canPaneConnectToBlock(world.getBlock(x + 1, y + 1, z)); - boolean connectsBottomNorth = block.canPaneConnectToBlock(world.getBlock(x, y - 1, z - 1)); - boolean connectsBottomSouth = block.canPaneConnectToBlock(world.getBlock(x, y - 1, z + 1)); - boolean connectsBottomWest = block.canPaneConnectToBlock(world.getBlock(x - 1, y - 1, z)); - boolean connectsBottomEast = block.canPaneConnectToBlock(world.getBlock(x + 1, y - 1, z)); + boolean connectsBottomNorth = block.canPaneConnectToBlock(world.getBlock(x, y - 1, z - 1)); + boolean connectsBottomSouth = block.canPaneConnectToBlock(world.getBlock(x, y - 1, z + 1)); + boolean connectsBottomWest = block.canPaneConnectToBlock(world.getBlock(x - 1, y - 1, z)); + boolean connectsBottomEast = block.canPaneConnectToBlock(world.getBlock(x + 1, y - 1, z)); - boolean isolatedTop = !connectsTopNorth && !connectsTopSouth && !connectsTopWest && !connectsTopEast; - boolean isolatedBottom = !connectsBottomNorth && !connectsBottomSouth && !connectsBottomWest && !connectsBottomEast; + boolean isolatedTop = !connectsTopNorth && !connectsTopSouth && !connectsTopWest && !connectsTopEast; + boolean isolatedBottom = !connectsBottomNorth && !connectsBottomSouth + && !connectsBottomWest + && !connectsBottomEast; - if (!connectsNorth && !connectsSouth && !connectsWest && !connectsEast) { - connectsNorth = connectsSouth = connectsWest = connectsEast = true; - } + if (!connectsNorth && !connectsSouth && !connectsWest && !connectsEast) { + connectsNorth = connectsSouth = connectsWest = connectsEast = true; + } - int connections = 0; - if (connectsNorth) { - paneRenderer.renderNorthPane(); - if (!connectsBottom || !connectsBottomNorth && !isolatedBottom) - paneRenderer.renderVerticalNS(-0.0003, 0.0, 0.5, 0.5, 0.0); - if (!connectsTop || !connectsTopNorth && !isolatedTop) - paneRenderer.renderVerticalNS(+1.0003, 0.0, 0.5, 0.5, 0.0); - connections++; - } - if (connectsSouth) { - paneRenderer.renderSouthPane(); - if (!connectsBottom || !connectsBottomSouth && !isolatedBottom) - paneRenderer.renderVerticalNS(-0.0004, 0.5, 1.0, 1.0, 0.5); - if (!connectsTop || !connectsTopSouth && !isolatedTop) - paneRenderer.renderVerticalNS(+1.0004, 0.5, 1.0, 1.0, 0.5); - connections++; - } - if (connectsWest) { - paneRenderer.renderWestPane(); - if (!connectsBottom || !connectsBottomWest && !isolatedBottom) - paneRenderer.renderVerticalWE(-0.0001, 0.0, 0.5, 0.5, 0.0); - if (!connectsTop || !connectsTopWest && !isolatedTop) - paneRenderer.renderVerticalWE(+1.0001, 0.0, 0.5, 0.5, 0.0); - connections++; - } - if (connectsEast) { - paneRenderer.renderEastPane(); - if (!connectsBottom || !connectsBottomEast && !isolatedBottom) - paneRenderer.renderVerticalWE(-0.0002, 0.5, 1.0, 1.0, 0.5); - if (!connectsTop || !connectsTopEast && !isolatedTop) - paneRenderer.renderVerticalWE(+1.0002, 0.5, 1.0, 1.0, 0.5); - connections++; - } + int connections = 0; + if (connectsNorth) { + paneRenderer.renderNorthPane(); + if (!connectsBottom || !connectsBottomNorth && !isolatedBottom) + paneRenderer.renderVerticalNS(-0.0003, 0.0, 0.5, 0.5, 0.0); + if (!connectsTop || !connectsTopNorth && !isolatedTop) + paneRenderer.renderVerticalNS(+1.0003, 0.0, 0.5, 0.5, 0.0); + connections++; + } + if (connectsSouth) { + paneRenderer.renderSouthPane(); + if (!connectsBottom || !connectsBottomSouth && !isolatedBottom) + paneRenderer.renderVerticalNS(-0.0004, 0.5, 1.0, 1.0, 0.5); + if (!connectsTop || !connectsTopSouth && !isolatedTop) + paneRenderer.renderVerticalNS(+1.0004, 0.5, 1.0, 1.0, 0.5); + connections++; + } + if (connectsWest) { + paneRenderer.renderWestPane(); + if (!connectsBottom || !connectsBottomWest && !isolatedBottom) + paneRenderer.renderVerticalWE(-0.0001, 0.0, 0.5, 0.5, 0.0); + if (!connectsTop || !connectsTopWest && !isolatedTop) + paneRenderer.renderVerticalWE(+1.0001, 0.0, 0.5, 0.5, 0.0); + connections++; + } + if (connectsEast) { + paneRenderer.renderEastPane(); + if (!connectsBottom || !connectsBottomEast && !isolatedBottom) + paneRenderer.renderVerticalWE(-0.0002, 0.5, 1.0, 1.0, 0.5); + if (!connectsTop || !connectsTopEast && !isolatedTop) + paneRenderer.renderVerticalWE(+1.0002, 0.5, 1.0, 1.0, 0.5); + connections++; + } - if (connections == 1) { - if (connectsNorth) - paneRenderer.renderHorizontalNS(0.5, 1.0, 0.0); - if (connectsSouth) - paneRenderer.renderHorizontalNS(0.5, 0.0, 1.0); - if (connectsEast) - paneRenderer.renderHorizontalWE(0.5, 0.0, 1.0); - if (connectsWest) - paneRenderer.renderHorizontalWE(0.5, 1.0, 0.0); - } else if (connections == 4) { - paneRenderer.renderHorizontalNS(0.0, 1.0, 0.0); - paneRenderer.renderHorizontalNS(1.0, 0.0, 1.0); - paneRenderer.renderHorizontalWE(0.0, 0.0, 1.0); - paneRenderer.renderHorizontalWE(1.0, 1.0, 0.0); - } + if (connections == 1) { + if (connectsNorth) paneRenderer.renderHorizontalNS(0.5, 1.0, 0.0); + if (connectsSouth) paneRenderer.renderHorizontalNS(0.5, 0.0, 1.0); + if (connectsEast) paneRenderer.renderHorizontalWE(0.5, 0.0, 1.0); + if (connectsWest) paneRenderer.renderHorizontalWE(0.5, 1.0, 0.0); + } else if (connections == 4) { + paneRenderer.renderHorizontalNS(0.0, 1.0, 0.0); + paneRenderer.renderHorizontalNS(1.0, 0.0, 1.0); + paneRenderer.renderHorizontalWE(0.0, 0.0, 1.0); + paneRenderer.renderHorizontalWE(1.0, 1.0, 0.0); + } - return true; - } + return true; + } - @Override - public boolean shouldRender3DInInventory(int renderId) { - return false; - } + @Override + public boolean shouldRender3DInInventory(int renderId) { + return false; + } - @Override - public int getRenderId() { - return id; - } + @Override + public int getRenderId() { + return id; + } } diff --git a/src/main/java/team/chisel/client/render/RendererEldritch.java b/src/main/java/team/chisel/client/render/RendererEldritch.java index 3454a0aa..72843a26 100644 --- a/src/main/java/team/chisel/client/render/RendererEldritch.java +++ b/src/main/java/team/chisel/client/render/RendererEldritch.java @@ -13,76 +13,63 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class RendererEldritch implements ISimpleBlockRenderingHandler { - public RendererEldritch() { - Chisel.renderEldritchId = RenderingRegistry.getNextAvailableRenderId(); - } + public RendererEldritch() { + Chisel.renderEldritchId = RenderingRegistry.getNextAvailableRenderId(); + } - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - Drawing.drawBlock(block, metadata, renderer); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + Drawing.drawBlock(block, metadata, renderer); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } - RenderBlocksEldritch renderer = new RenderBlocksEldritch(); + RenderBlocksEldritch renderer = new RenderBlocksEldritch(); - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks rendererOld) { + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks rendererOld) { - // tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, - // y, z)); - /* - * double d0 = 0.4000000059604645D; double d1 = 0.5D - d0; double d2 = 0.20000000298023224D; - */ - // renderer.renderTorchAtAngle(Block.torchWood, x - d1, y + d2, z, -d0, - // 0.0D, 0); - /* - * Icon icon = block.getIcon(2, meta); double u0 = icon.getMinU(); double v0 = icon.getMaxV(); double u1 = icon.getMaxU(); double v1 = icon.getMinV(); double uu = icon.getInterpolatedU(8.0D); - * double vv = icon.getInterpolatedV(8.0D); - * - * - * int lyp=block.getMixedBrightnessForBlock(world, x, y+1, z); int lym=block.getMixedBrightnessForBlock(world, x, y-1, z); int lxp=block.getMixedBrightnessForBlock(world, x+1, y, z); int - * lxm=block.getMixedBrightnessForBlock(world, x-1, y, z); int lzp=block.getMixedBrightnessForBlock(world, x, y, z+1); int lzm=block.getMixedBrightnessForBlock(world, x, y, z-1); - * - * - * - * - * - * - * - * - * - * - * - * - * icon = block.getIcon(0, meta); u0 = icon.getMinU(); v0 = icon.getMinV(); u1 = icon.getMaxU(); v1 = icon.getMaxV(); vertex(1,u0,v0); vertex(5,u1,v0); vertex(6,u1,v1); vertex(2,u0,v1); - * - * icon = block.getIcon(1, meta); u0 = icon.getMinU(); v0 = icon.getMinV(); u1 = icon.getMaxU(); v1 = icon.getMaxV(); vertex(0,u0,v0); vertex(3,u0,v1); vertex(7,u1,v1); vertex(4,u1,v0); - */ + // tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, + // y, z)); + /* + * double d0 = 0.4000000059604645D; double d1 = 0.5D - d0; double d2 = 0.20000000298023224D; + */ + // renderer.renderTorchAtAngle(Block.torchWood, x - d1, y + d2, z, -d0, + // 0.0D, 0); + /* + * Icon icon = block.getIcon(2, meta); double u0 = icon.getMinU(); double v0 = icon.getMaxV(); double u1 = + * icon.getMaxU(); double v1 = icon.getMinV(); double uu = icon.getInterpolatedU(8.0D); double vv = + * icon.getInterpolatedV(8.0D); int lyp=block.getMixedBrightnessForBlock(world, x, y+1, z); int + * lym=block.getMixedBrightnessForBlock(world, x, y-1, z); int lxp=block.getMixedBrightnessForBlock(world, x+1, + * y, z); int lxm=block.getMixedBrightnessForBlock(world, x-1, y, z); int + * lzp=block.getMixedBrightnessForBlock(world, x, y, z+1); int lzm=block.getMixedBrightnessForBlock(world, x, y, + * z-1); icon = block.getIcon(0, meta); u0 = icon.getMinU(); v0 = icon.getMinV(); u1 = icon.getMaxU(); v1 = + * icon.getMaxV(); vertex(1,u0,v0); vertex(5,u1,v0); vertex(6,u1,v1); vertex(2,u0,v1); icon = block.getIcon(1, + * meta); u0 = icon.getMinU(); v0 = icon.getMinV(); u1 = icon.getMaxU(); v1 = icon.getMaxV(); vertex(0,u0,v0); + * vertex(3,u0,v1); vertex(7,u1,v1); vertex(4,u1,v0); + */ - renderer.blockAccess = world; - renderer.renderMaxX = 1.0; - renderer.renderMaxY = 1.0; - renderer.renderMaxZ = 1.0; - renderer.renderStandardBlock(block, x, y, z); + renderer.blockAccess = world; + renderer.renderMaxX = 1.0; + renderer.renderMaxY = 1.0; + renderer.renderMaxZ = 1.0; + renderer.renderStandardBlock(block, x, y, z); - return true; - /* - * - * boolean flag = renderer.renderStandardBlock(block, x, y, z); - * - * return flag; - */ - } + return true; + /* + * boolean flag = renderer.renderStandardBlock(block, x, y, z); return flag; + */ + } - @Override - public boolean shouldRender3DInInventory(int renderId) { - return true; - } + @Override + public boolean shouldRender3DInInventory(int renderId) { + return true; + } - @Override - public int getRenderId() { - return Chisel.renderEldritchId; - } + @Override + public int getRenderId() { + return Chisel.renderEldritchId; + } } diff --git a/src/main/java/team/chisel/client/render/RendererLayeredGlow.java b/src/main/java/team/chisel/client/render/RendererLayeredGlow.java index f5201604..eb61e276 100644 --- a/src/main/java/team/chisel/client/render/RendererLayeredGlow.java +++ b/src/main/java/team/chisel/client/render/RendererLayeredGlow.java @@ -17,38 +17,39 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class RendererLayeredGlow implements ISimpleBlockRenderingHandler { - public RendererLayeredGlow() { - Chisel.renderGlowId = RenderingRegistry.getNextAvailableRenderId(); - } + public RendererLayeredGlow() { + Chisel.renderGlowId = RenderingRegistry.getNextAvailableRenderId(); + } - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - GeneralClient.setGLColorFromInt(Configurations.configColors[metadata]); - GL11.glDisable(GL11.GL_LIGHTING); - Drawing.drawBlock(block, ((BlockCarvableGlow) block).getGlowTexture(), renderer); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glColor3f(1, 1, 1); - Drawing.drawBlock(block, metadata, renderer); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + GeneralClient.setGLColorFromInt(Configurations.configColors[metadata]); + GL11.glDisable(GL11.GL_LIGHTING); + Drawing.drawBlock(block, ((BlockCarvableGlow) block).getGlowTexture(), renderer); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glColor3f(1, 1, 1); + Drawing.drawBlock(block, metadata, renderer); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - Tessellator.instance.setColorOpaque_I(Configurations.configColors[world.getBlockMetadata(x, y, z)]); - Tessellator.instance.setBrightness(0xF000F0); - Drawing.renderAllFaces(renderer, block, x, y, z, ((BlockCarvableGlow) block).getGlowTexture()); - renderer.renderStandardBlock(block, x, y, z); - return true; - } + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { + Tessellator.instance.setColorOpaque_I(Configurations.configColors[world.getBlockMetadata(x, y, z)]); + Tessellator.instance.setBrightness(0xF000F0); + Drawing.renderAllFaces(renderer, block, x, y, z, ((BlockCarvableGlow) block).getGlowTexture()); + renderer.renderStandardBlock(block, x, y, z); + return true; + } - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } - @Override - public int getRenderId() { - return Chisel.renderGlowId; - } + @Override + public int getRenderId() { + return Chisel.renderGlowId; + } } diff --git a/src/main/java/team/chisel/client/render/RendererMultiLayer.java b/src/main/java/team/chisel/client/render/RendererMultiLayer.java index 1b050f61..f27bf89f 100644 --- a/src/main/java/team/chisel/client/render/RendererMultiLayer.java +++ b/src/main/java/team/chisel/client/render/RendererMultiLayer.java @@ -1,81 +1,82 @@ package team.chisel.client.render; -import team.chisel.block.BlockMultiLayerBase; -import team.chisel.ctmlib.Drawing; +import static org.lwjgl.opengl.GL11.*; + import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.init.Blocks; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.MinecraftForgeClient; + +import team.chisel.block.BlockMultiLayerBase; +import team.chisel.ctmlib.Drawing; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -import static org.lwjgl.opengl.GL11.*; public class RendererMultiLayer implements ISimpleBlockRenderingHandler { - float bot = -0.001f, top = 1.0f - bot; - public static int id; + float bot = -0.001f, top = 1.0f - bot; + public static int id; - public RendererMultiLayer() { - id = RenderingRegistry.getNextAvailableRenderId(); - } + public RendererMultiLayer() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - @Override - public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) { - if (blck == null || !(blck instanceof BlockMultiLayerBase)) - return; + @Override + public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) { + if (blck == null || !(blck instanceof BlockMultiLayerBase)) return; - BlockMultiLayerBase block = (BlockMultiLayerBase) blck; + BlockMultiLayerBase block = (BlockMultiLayerBase) blck; - if (block.icon != null) { - renderer.overrideBlockTexture = block.icon; - renderer.renderBlockAsItem(Blocks.stone, meta, 1.0f); - renderer.overrideBlockTexture = null; - } else if (block.base != null) { - renderer.renderBlockAsItem(block.base, meta, 1.0f); - } + if (block.icon != null) { + renderer.overrideBlockTexture = block.icon; + renderer.renderBlockAsItem(Blocks.stone, meta, 1.0f); + renderer.overrideBlockTexture = null; + } else if (block.base != null) { + renderer.renderBlockAsItem(block.base, meta, 1.0f); + } - glPushMatrix(); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - renderer.setRenderBounds(bot, bot, bot, top, top, top); - glTranslatef(-0.5F, -0.5F, -0.5F); - Drawing.drawBlock(block, meta, renderer); - glDisable(GL_BLEND); - glPopMatrix(); - } + glPushMatrix(); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + renderer.setRenderBounds(bot, bot, bot, top, top, top); + glTranslatef(-0.5F, -0.5F, -0.5F); + Drawing.drawBlock(block, meta, renderer); + glDisable(GL_BLEND); + glPopMatrix(); + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) { - if (blck == null || !(blck instanceof BlockMultiLayerBase)) - return false; - BlockMultiLayerBase block = (BlockMultiLayerBase) blck; + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, + RenderBlocks renderer) { + if (blck == null || !(blck instanceof BlockMultiLayerBase)) return false; + BlockMultiLayerBase block = (BlockMultiLayerBase) blck; - if (MinecraftForgeClient.getRenderPass() == 0) { - if (block.icon != null) { - renderer.overrideBlockTexture = block.icon; - renderer.renderStandardBlock(block, x, y, z); - renderer.overrideBlockTexture = null; - return true; - } else if (block.base != null) { - renderer.renderBlockByRenderType(block.base, x, y, z); - return true; - } - } else { - renderer.setRenderBounds(0, 0, 0, 1, 1, 1); - return renderer.renderStandardBlock(block, x, y, z); - } + if (MinecraftForgeClient.getRenderPass() == 0) { + if (block.icon != null) { + renderer.overrideBlockTexture = block.icon; + renderer.renderStandardBlock(block, x, y, z); + renderer.overrideBlockTexture = null; + return true; + } else if (block.base != null) { + renderer.renderBlockByRenderType(block.base, x, y, z); + return true; + } + } else { + renderer.setRenderBounds(0, 0, 0, 1, 1, 1); + return renderer.renderStandardBlock(block, x, y, z); + } - return false; - } + return false; + } - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } - @Override - public int getRenderId() { - return id; - } + @Override + public int getRenderId() { + return id; + } } diff --git a/src/main/java/team/chisel/client/render/RendererRoadLine.java b/src/main/java/team/chisel/client/render/RendererRoadLine.java index 1433ca26..120225ed 100644 --- a/src/main/java/team/chisel/client/render/RendererRoadLine.java +++ b/src/main/java/team/chisel/client/render/RendererRoadLine.java @@ -1,120 +1,122 @@ package team.chisel.client.render; -import team.chisel.Chisel; -import team.chisel.block.BlockRoadLine; -import team.chisel.ctmlib.Drawing; import net.minecraft.block.Block; import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; + +import team.chisel.Chisel; +import team.chisel.block.BlockRoadLine; +import team.chisel.ctmlib.Drawing; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; public class RendererRoadLine implements ISimpleBlockRenderingHandler { - public RendererRoadLine() { - Chisel.roadLineId = RenderingRegistry.getNextAvailableRenderId(); - } + public RendererRoadLine() { + Chisel.roadLineId = RenderingRegistry.getNextAvailableRenderId(); + } - @Override - public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { - renderer.setRenderBoundsFromBlock(block); - Drawing.drawBlock(block, meta, renderer); - } + @Override + public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { + renderer.setRenderBoundsFromBlock(block); + Drawing.drawBlock(block, meta, renderer); + } - public void renderTopFace(double y, IIcon icon) { - Tessellator tessellator = Tessellator.instance; + public void renderTopFace(double y, IIcon icon) { + Tessellator tessellator = Tessellator.instance; - tessellator.addVertexWithUV(1, y, 0, icon.getMaxU(), icon.getMinV()); - tessellator.addVertexWithUV(0, y, 0, icon.getMinU(), icon.getMinV()); - tessellator.addVertexWithUV(0, y, 1, icon.getMinU(), icon.getMaxV()); - tessellator.addVertexWithUV(1, y, 1, icon.getMaxU(), icon.getMaxV()); - } + tessellator.addVertexWithUV(1, y, 0, icon.getMaxU(), icon.getMinV()); + tessellator.addVertexWithUV(0, y, 0, icon.getMinU(), icon.getMinV()); + tessellator.addVertexWithUV(0, y, 1, icon.getMinU(), icon.getMaxV()); + tessellator.addVertexWithUV(1, y, 1, icon.getMaxU(), icon.getMaxV()); + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks renderer) { - int meta = world.getBlockMetadata(x, y, z); - BlockRoadLine block = (BlockRoadLine) b; - Tessellator tessellator = Tessellator.instance; + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId, + RenderBlocks renderer) { + int meta = world.getBlockMetadata(x, y, z); + BlockRoadLine block = (BlockRoadLine) b; + Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - float f = 1.0F; - int i1 = block.colorMultiplier(world, x, y, z); - float f1 = (i1 >> 16 & 255) / 255.0F; - float f2 = (i1 >> 8 & 255) / 255.0F; - float f3 = (i1 & 255) / 255.0F; + float f = 1.0F; + int i1 = block.colorMultiplier(world, x, y, z); + float f1 = (i1 >> 16 & 255) / 255.0F; + float f2 = (i1 >> 8 & 255) / 255.0F; + float f3 = (i1 & 255) / 255.0F; - if (EntityRenderer.anaglyphEnable) { - float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; - float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; - float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; - f1 = f4; - f2 = f5; - f3 = f6; - } - tessellator.setColorOpaque_F(f * f1, f * f2, f * f3); + if (EntityRenderer.anaglyphEnable) { + float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; + float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; + float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; + f1 = f4; + f2 = f5; + f3 = f6; + } + tessellator.setColorOpaque_F(f * f1, f * f2, f * f3); - boolean N = world.getBlock(x, y, z - 1).equals(block) && world.getBlockMetadata(x, y, z - 1) == meta; - boolean S = world.getBlock(x, y, z + 1).equals(block) && world.getBlockMetadata(x, y, z + 1) == meta; - boolean W = world.getBlock(x - 1, y, z).equals(block) && world.getBlockMetadata(x - 1, y, z) == meta; - boolean E = world.getBlock(x + 1, y, z).equals(block) && world.getBlockMetadata(x + 1, y, z) == meta; + boolean N = world.getBlock(x, y, z - 1).equals(block) && world.getBlockMetadata(x, y, z - 1) == meta; + boolean S = world.getBlock(x, y, z + 1).equals(block) && world.getBlockMetadata(x, y, z + 1) == meta; + boolean W = world.getBlock(x - 1, y, z).equals(block) && world.getBlockMetadata(x - 1, y, z) == meta; + boolean E = world.getBlock(x + 1, y, z).equals(block) && world.getBlockMetadata(x + 1, y, z) == meta; - if (!N && !S && !W && !E) { - renderer.renderStandardBlock(block, x, y, z); - return true; - } + if (!N && !S && !W && !E) { + renderer.renderStandardBlock(block, x, y, z); + return true; + } - if (N && S) { - renderer.uvRotateTop = 0; - renderer.overrideBlockTexture = block.fullLineIcon[meta]; - renderer.renderStandardBlock(block, x, y, z); + if (N && S) { + renderer.uvRotateTop = 0; + renderer.overrideBlockTexture = block.fullLineIcon[meta]; + renderer.renderStandardBlock(block, x, y, z); - } else { - if (N) { - renderer.uvRotateTop = 0; - renderer.overrideBlockTexture = block.halfLineIcon[meta]; - renderer.renderStandardBlock(block, x, y, z); - } - if (S) { - renderer.uvRotateTop = 3; - renderer.overrideBlockTexture = block.halfLineIcon[meta]; - renderer.renderStandardBlock(block, x, y, z); - } + } else { + if (N) { + renderer.uvRotateTop = 0; + renderer.overrideBlockTexture = block.halfLineIcon[meta]; + renderer.renderStandardBlock(block, x, y, z); + } + if (S) { + renderer.uvRotateTop = 3; + renderer.overrideBlockTexture = block.halfLineIcon[meta]; + renderer.renderStandardBlock(block, x, y, z); + } - } + } - if (E && W) { - renderer.uvRotateTop = 1; - renderer.overrideBlockTexture = block.fullLineIcon[meta]; - renderer.renderStandardBlock(block, x, y, z); - } else { - if (E) { - renderer.uvRotateTop = 1; - renderer.overrideBlockTexture = block.halfLineIcon[meta]; - renderer.renderStandardBlock(block, x, y, z); - } - if (W) { - renderer.uvRotateTop = 2; - renderer.overrideBlockTexture = block.halfLineIcon[meta]; - renderer.renderStandardBlock(block, x, y, z); - } - } + if (E && W) { + renderer.uvRotateTop = 1; + renderer.overrideBlockTexture = block.fullLineIcon[meta]; + renderer.renderStandardBlock(block, x, y, z); + } else { + if (E) { + renderer.uvRotateTop = 1; + renderer.overrideBlockTexture = block.halfLineIcon[meta]; + renderer.renderStandardBlock(block, x, y, z); + } + if (W) { + renderer.uvRotateTop = 2; + renderer.overrideBlockTexture = block.halfLineIcon[meta]; + renderer.renderStandardBlock(block, x, y, z); + } + } - renderer.uvRotateTop = 0; - renderer.overrideBlockTexture = null; - return true; - } + renderer.uvRotateTop = 0; + renderer.overrideBlockTexture = null; + return true; + } - @Override - public boolean shouldRender3DInInventory(int renderId) { - return false; - } + @Override + public boolean shouldRender3DInInventory(int renderId) { + return false; + } - @Override - public int getRenderId() { - return Chisel.roadLineId; - } + @Override + public int getRenderId() { + return Chisel.roadLineId; + } } diff --git a/src/main/java/team/chisel/client/render/RendererSimpleLayered.java b/src/main/java/team/chisel/client/render/RendererSimpleLayered.java index 06f36731..8a3989e3 100644 --- a/src/main/java/team/chisel/client/render/RendererSimpleLayered.java +++ b/src/main/java/team/chisel/client/render/RendererSimpleLayered.java @@ -14,36 +14,37 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class RendererSimpleLayered implements ISimpleBlockRenderingHandler { - public RendererSimpleLayered() { - Chisel.renderLayeredId = RenderingRegistry.getNextAvailableRenderId(); - } + public RendererSimpleLayered() { + Chisel.renderLayeredId = RenderingRegistry.getNextAvailableRenderId(); + } - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - GL11.glDisable(GL11.GL_LIGHTING); - Drawing.drawBlock(block, ((BlockCarvableLayered) block).getBaseTex(), renderer); - GL11.glEnable(GL11.GL_LIGHTING); - Drawing.drawBlock(block, metadata, renderer); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + GL11.glDisable(GL11.GL_LIGHTING); + Drawing.drawBlock(block, ((BlockCarvableLayered) block).getBaseTex(), renderer); + GL11.glEnable(GL11.GL_LIGHTING); + Drawing.drawBlock(block, metadata, renderer); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - renderer.setOverrideBlockTexture(((BlockCarvableLayered) block).getBaseTex()); - renderer.renderStandardBlock(block, x, y, z); - renderer.clearOverrideBlockTexture(); - renderer.renderStandardBlock(block, x, y, z); - return true; - } + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { + renderer.setOverrideBlockTexture(((BlockCarvableLayered) block).getBaseTex()); + renderer.renderStandardBlock(block, x, y, z); + renderer.clearOverrideBlockTexture(); + renderer.renderStandardBlock(block, x, y, z); + return true; + } - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } - @Override - public int getRenderId() { - return Chisel.renderLayeredId; - } + @Override + public int getRenderId() { + return Chisel.renderLayeredId; + } } diff --git a/src/main/java/team/chisel/client/render/RendererSnakeStone.java b/src/main/java/team/chisel/client/render/RendererSnakeStone.java index 08a6585b..583eaa96 100644 --- a/src/main/java/team/chisel/client/render/RendererSnakeStone.java +++ b/src/main/java/team/chisel/client/render/RendererSnakeStone.java @@ -13,113 +13,114 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class RendererSnakeStone implements ISimpleBlockRenderingHandler { - public static int id; + public static int id; - public RendererSnakeStone() { - id = RenderingRegistry.getNextAvailableRenderId(); - } + public RendererSnakeStone() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - @Override - public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { - setRenderRotate(renderer, (BlockSnakestone) block, meta); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - Drawing.drawBlock(block, meta, renderer); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - restoreRendererRotate(renderer); - } + @Override + public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { + setRenderRotate(renderer, (BlockSnakestone) block, meta); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + Drawing.drawBlock(block, meta, renderer); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + restoreRendererRotate(renderer); + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - int meta = world.getBlockMetadata(x, y, z); + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { + int meta = world.getBlockMetadata(x, y, z); - setRenderRotate(renderer, (BlockSnakestone) block, meta); - boolean didRender = renderer.renderStandardBlock(block, x, y, z); - restoreRendererRotate(renderer); + setRenderRotate(renderer, (BlockSnakestone) block, meta); + boolean didRender = renderer.renderStandardBlock(block, x, y, z); + restoreRendererRotate(renderer); - return didRender; - } + return didRender; + } - private void restoreRendererRotate(RenderBlocks renderer) { - renderer.uvRotateSouth = 0; - renderer.uvRotateEast = 0; - renderer.uvRotateWest = 0; - renderer.uvRotateNorth = 0; - renderer.uvRotateTop = 0; - renderer.uvRotateBottom = 0; - } + private void restoreRendererRotate(RenderBlocks renderer) { + renderer.uvRotateSouth = 0; + renderer.uvRotateEast = 0; + renderer.uvRotateWest = 0; + renderer.uvRotateNorth = 0; + renderer.uvRotateTop = 0; + renderer.uvRotateBottom = 0; + } - private void setRenderRotate(RenderBlocks renderer, BlockSnakestone block, int meta) { - int type = meta & 0xC; - int orient = meta & 0x3; + private void setRenderRotate(RenderBlocks renderer, BlockSnakestone block, int meta) { + int type = meta & 0xC; + int orient = meta & 0x3; - if (type == 0) { - switch (orient) { - case 0: - renderer.uvRotateTop = 1; - renderer.uvRotateBottom = 2; - break; - case 1: - renderer.uvRotateTop = 1; - renderer.uvRotateBottom = 1; - break; - case 2: - renderer.uvRotateTop = 0; - renderer.uvRotateBottom = 3; - break; - case 3: - renderer.uvRotateTop = 0; - renderer.uvRotateBottom = 0; - } + if (type == 0) { + switch (orient) { + case 0: + renderer.uvRotateTop = 1; + renderer.uvRotateBottom = 2; + break; + case 1: + renderer.uvRotateTop = 1; + renderer.uvRotateBottom = 1; + break; + case 2: + renderer.uvRotateTop = 0; + renderer.uvRotateBottom = 3; + break; + case 3: + renderer.uvRotateTop = 0; + renderer.uvRotateBottom = 0; + } - } else if ((type == 4) || (type == 8)) { - switch (orient) { - case 0: - renderer.uvRotateTop = block.flipTopTextures ? 1 : 2; - renderer.uvRotateBottom = 1; - renderer.uvRotateWest = 2; - break; - case 1: - renderer.uvRotateTop = 1; - renderer.uvRotateBottom = 1; - renderer.uvRotateEast = 2; - break; - case 2: - renderer.uvRotateTop = block.flipTopTextures ? 0 : 3; - renderer.uvRotateBottom = 0; - renderer.uvRotateSouth = 2; - break; - case 3: - renderer.uvRotateTop = 0; - renderer.uvRotateBottom = 0; - renderer.uvRotateNorth = 2; - } + } else if ((type == 4) || (type == 8)) { + switch (orient) { + case 0: + renderer.uvRotateTop = block.flipTopTextures ? 1 : 2; + renderer.uvRotateBottom = 1; + renderer.uvRotateWest = 2; + break; + case 1: + renderer.uvRotateTop = 1; + renderer.uvRotateBottom = 1; + renderer.uvRotateEast = 2; + break; + case 2: + renderer.uvRotateTop = block.flipTopTextures ? 0 : 3; + renderer.uvRotateBottom = 0; + renderer.uvRotateSouth = 2; + break; + case 3: + renderer.uvRotateTop = 0; + renderer.uvRotateBottom = 0; + renderer.uvRotateNorth = 2; + } - } else if (type == 12) { - switch (orient) { - case 0: - renderer.uvRotateTop = 0; - renderer.uvRotateBottom = 0; - break; - case 1: - renderer.uvRotateTop = 1; - renderer.uvRotateBottom = 1; - break; - case 2: - renderer.uvRotateNorth = 2; - renderer.uvRotateSouth = 2; - renderer.uvRotateEast = 2; - renderer.uvRotateWest = 2; - } - } - } + } else if (type == 12) { + switch (orient) { + case 0: + renderer.uvRotateTop = 0; + renderer.uvRotateBottom = 0; + break; + case 1: + renderer.uvRotateTop = 1; + renderer.uvRotateBottom = 1; + break; + case 2: + renderer.uvRotateNorth = 2; + renderer.uvRotateSouth = 2; + renderer.uvRotateEast = 2; + renderer.uvRotateWest = 2; + } + } + } - @Override - public boolean shouldRender3DInInventory(int renderId) { - return true; - } + @Override + public boolean shouldRender3DInInventory(int renderId) { + return true; + } - @Override - public int getRenderId() { - return id; - } -} \ No newline at end of file + @Override + public int getRenderId() { + return id; + } +} diff --git a/src/main/java/team/chisel/client/render/RendererStairs.java b/src/main/java/team/chisel/client/render/RendererStairs.java index 9853beba..73ba4861 100644 --- a/src/main/java/team/chisel/client/render/RendererStairs.java +++ b/src/main/java/team/chisel/client/render/RendererStairs.java @@ -13,44 +13,44 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class RendererStairs implements ISimpleBlockRenderingHandler { - public static int id; + public static int id; - public RendererStairs() { - id = RenderingRegistry.getNextAvailableRenderId(); - } + public RendererStairs() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - @Override - public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F); - Drawing.drawBlock(block, meta, renderer); - renderer.setRenderBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F); - Drawing.drawBlock(block, meta, renderer); - } + @Override + public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F); + Drawing.drawBlock(block, meta, renderer); + renderer.setRenderBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F); + Drawing.drawBlock(block, meta, renderer); + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) { - if (blck == null || !(blck instanceof BlockCarvableStairs)) - return false; - BlockCarvableStairs block = (BlockCarvableStairs) blck; + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, + RenderBlocks renderer) { + if (blck == null || !(blck instanceof BlockCarvableStairs)) return false; + BlockCarvableStairs block = (BlockCarvableStairs) blck; - renderer.renderBlockStairs(block, x, y, z); + renderer.renderBlockStairs(block, x, y, z); - return true; - } + return true; + } - @Override - public boolean shouldRender3DInInventory(int renderId) { - return true; - } + @Override + public boolean shouldRender3DInInventory(int renderId) { + return true; + } - @Override - public int getRenderId() { - return id; - } + @Override + public int getRenderId() { + return id; + } - public int getRenderBlockPass() { - return 1; - } + public int getRenderBlockPass() { + return 1; + } } diff --git a/src/main/java/team/chisel/client/render/SubmapManagerAntiblock.java b/src/main/java/team/chisel/client/render/SubmapManagerAntiblock.java index cec1bd11..eb9ca91d 100644 --- a/src/main/java/team/chisel/client/render/SubmapManagerAntiblock.java +++ b/src/main/java/team/chisel/client/render/SubmapManagerAntiblock.java @@ -1,11 +1,5 @@ package team.chisel.client.render; -import org.lwjgl.opengl.GL11; - -import team.chisel.ctmlib.Drawing; -import team.chisel.ctmlib.RenderBlocksCTM; -import team.chisel.ctmlib.TextureSubmap; -import team.chisel.init.ChiselBlocks; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.texture.IIconRegister; @@ -13,94 +7,104 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.client.IItemRenderer; + +import org.lwjgl.opengl.GL11; + +import team.chisel.ctmlib.Drawing; +import team.chisel.ctmlib.RenderBlocksCTM; +import team.chisel.ctmlib.TextureSubmap; +import team.chisel.init.ChiselBlocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class SubmapManagerAntiblock extends SubmapManagerBase { - - @SideOnly(Side.CLIENT) - public static class AntiblockItemRenderer implements IItemRenderer { - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return true; - } + @SideOnly(Side.CLIENT) + public static class AntiblockItemRenderer implements IItemRenderer { - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + return true; + } - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - GL11.glDisable(GL11.GL_LIGHTING); - Drawing.drawBlock(ChiselBlocks.antiBlock, ChiselBlocks.antiBlock.getIcon(0, item.getItemDamage()), (RenderBlocks) data[0]); - GL11.glEnable(GL11.GL_LIGHTING); - } - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } - @SideOnly(Side.CLIENT) - private static class RenderBlocksCTMFullbright extends RenderBlocksCTM { + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + GL11.glDisable(GL11.GL_LIGHTING); + Drawing.drawBlock( + ChiselBlocks.antiBlock, + ChiselBlocks.antiBlock.getIcon(0, item.getItemDamage()), + (RenderBlocks) data[0]); + GL11.glEnable(GL11.GL_LIGHTING); + } + } - @Override - protected void fillLightmap(int bottomLeft, int bottomRight, int topRight, int topLeft) { - ao(); - int maxLight = 0xF000F0; - super.fillLightmap(maxLight, maxLight, maxLight, maxLight); - } + @SideOnly(Side.CLIENT) + private static class RenderBlocksCTMFullbright extends RenderBlocksCTM { - @Override - protected void fillColormap(float bottomLeft, float bottomRight, float topRight, float topLeft, float[][] map) { - ao(); - int color = 0xFFFFFF; - super.fillColormap(color, color, color, color, map); - } - - @Override - public boolean renderStandardBlock(Block block, int x, int y, int z) { - boolean ret = super.renderStandardBlock(block, x, y, z); - this.enableAO = false; - return ret; - } - - private void ao() { - if (this.inWorld) { - this.enableAO = true; - } - } - }; + @Override + protected void fillLightmap(int bottomLeft, int bottomRight, int topRight, int topLeft) { + ao(); + int maxLight = 0xF000F0; + super.fillLightmap(maxLight, maxLight, maxLight, maxLight); + } - @SideOnly(Side.CLIENT) - private static RenderBlocksCTMFullbright rb; + @Override + protected void fillColormap(float bottomLeft, float bottomRight, float topRight, float topLeft, float[][] map) { + ao(); + int color = 0xFFFFFF; + super.fillColormap(color, color, color, color, map); + } - private String color; - private TextureSubmap submap, submapSmall; + @Override + public boolean renderStandardBlock(Block block, int x, int y, int z) { + boolean ret = super.renderStandardBlock(block, x, y, z); + this.enableAO = false; + return ret; + } - public SubmapManagerAntiblock(String color) { - this.color = color; - } + private void ao() { + if (this.inWorld) { + this.enableAO = true; + } + } + }; - @Override - public IIcon getIcon(int side, int meta) { - return submapSmall.getBaseIcon(); - } + @SideOnly(Side.CLIENT) + private static RenderBlocksCTMFullbright rb; - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(String modName, Block block, IIconRegister register) { - submap = new TextureSubmap(register.registerIcon(modName + ":antiblock/" + color + "-antiBlock-ctm"), 4, 4); - submapSmall = new TextureSubmap(register.registerIcon(modName + ":antiblock/" + color + "-antiBlock"), 2, 2); - } + private String color; + private TextureSubmap submap, submapSmall; - @Override - @SideOnly(Side.CLIENT) - public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { - if (rb == null) { - rb = new RenderBlocksCTMFullbright(); - } - rb.setRenderBoundsFromBlock(block); - rb.submap = submap; - rb.submapSmall = submapSmall; - return rb; - } + public SubmapManagerAntiblock(String color) { + this.color = color; + } + + @Override + public IIcon getIcon(int side, int meta) { + return submapSmall.getBaseIcon(); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(String modName, Block block, IIconRegister register) { + submap = new TextureSubmap(register.registerIcon(modName + ":antiblock/" + color + "-antiBlock-ctm"), 4, 4); + submapSmall = new TextureSubmap(register.registerIcon(modName + ":antiblock/" + color + "-antiBlock"), 2, 2); + } + + @Override + @SideOnly(Side.CLIENT) + public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { + if (rb == null) { + rb = new RenderBlocksCTMFullbright(); + } + rb.setRenderBoundsFromBlock(block); + rb.submap = submap; + rb.submapSmall = submapSmall; + return rb; + } } diff --git a/src/main/java/team/chisel/client/render/SubmapManagerBase.java b/src/main/java/team/chisel/client/render/SubmapManagerBase.java index ac8de3d7..9e9bad4b 100644 --- a/src/main/java/team/chisel/client/render/SubmapManagerBase.java +++ b/src/main/java/team/chisel/client/render/SubmapManagerBase.java @@ -1,34 +1,33 @@ package team.chisel.client.render; -import team.chisel.ctmlib.ISubmapManager; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; + +import team.chisel.ctmlib.ISubmapManager; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public abstract class SubmapManagerBase implements ISubmapManager { - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - return getIcon(side, world.getBlockMetadata(x, y, z)); - } + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return getIcon(side, world.getBlockMetadata(x, y, z)); + } - @Override - @SideOnly(Side.CLIENT) - public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { - return null; - } + @Override + @SideOnly(Side.CLIENT) + public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { + return null; + } - @Override - @SideOnly(Side.CLIENT) - public void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { - } + @Override + @SideOnly(Side.CLIENT) + public void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) {} - @Override - @SideOnly(Side.CLIENT) - public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { - } + @Override + @SideOnly(Side.CLIENT) + public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) {} } diff --git a/src/main/java/team/chisel/client/render/SubmapManagerCarpetFloor.java b/src/main/java/team/chisel/client/render/SubmapManagerCarpetFloor.java index 3e3b54c1..7b5b1d57 100644 --- a/src/main/java/team/chisel/client/render/SubmapManagerCarpetFloor.java +++ b/src/main/java/team/chisel/client/render/SubmapManagerCarpetFloor.java @@ -1,55 +1,56 @@ package team.chisel.client.render; -import team.chisel.ctmlib.RenderBlocksCTM; -import team.chisel.ctmlib.TextureSubmap; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; + +import team.chisel.ctmlib.RenderBlocksCTM; +import team.chisel.ctmlib.TextureSubmap; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class SubmapManagerCarpetFloor extends SubmapManagerBase { - @SideOnly(Side.CLIENT) - private static RenderBlocksCTM rb; + @SideOnly(Side.CLIENT) + private static RenderBlocksCTM rb; - private TextureSubmap submap; - private TextureSubmap submapSmall; - private String color; + private TextureSubmap submap; + private TextureSubmap submapSmall; + private String color; - public SubmapManagerCarpetFloor(String color) { - this.color = color; - } + public SubmapManagerCarpetFloor(String color) { + this.color = color; + } - @Override - public IIcon getIcon(int side, int meta) { - return submapSmall.getBaseIcon(); - } + @Override + public IIcon getIcon(int side, int meta) { + return submapSmall.getBaseIcon(); + } - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - return getIcon(side, world.getBlockMetadata(x, y, z)); - } + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return getIcon(side, world.getBlockMetadata(x, y, z)); + } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(String modName, Block block, IIconRegister register) { - String path = modName + ":carpet/" + color; - submap = new TextureSubmap(register.registerIcon(path + "-ctm"), 4, 4); - submapSmall = new TextureSubmap(register.registerIcon(path), 2, 2); - } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(String modName, Block block, IIconRegister register) { + String path = modName + ":carpet/" + color; + submap = new TextureSubmap(register.registerIcon(path + "-ctm"), 4, 4); + submapSmall = new TextureSubmap(register.registerIcon(path), 2, 2); + } - @Override - @SideOnly(Side.CLIENT) - public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { - if (rb == null) { - rb = new RenderBlocksCTM(); - } - rb.setRenderBoundsFromBlock(block); - rb.submap = submap; - rb.submapSmall = submapSmall; - return rb; - } + @Override + @SideOnly(Side.CLIENT) + public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { + if (rb == null) { + rb = new RenderBlocksCTM(); + } + rb.setRenderBoundsFromBlock(block); + rb.submap = submap; + rb.submapSmall = submapSmall; + return rb; + } } diff --git a/src/main/java/team/chisel/client/render/SubmapManagerCombinedCTM.java b/src/main/java/team/chisel/client/render/SubmapManagerCombinedCTM.java index e43d60a0..3c3850a1 100644 --- a/src/main/java/team/chisel/client/render/SubmapManagerCombinedCTM.java +++ b/src/main/java/team/chisel/client/render/SubmapManagerCombinedCTM.java @@ -22,133 +22,141 @@ import cpw.mods.fml.relauncher.SideOnly; public class SubmapManagerCombinedCTM extends SubmapManagerBase { - @SideOnly(Side.CLIENT) - private class RenderBlocksCombinedCTM extends RenderBlocksCTM { + @SideOnly(Side.CLIENT) + private class RenderBlocksCombinedCTM extends RenderBlocksCTM { - @Override - public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) { - setIcons(rType, x, y, z, ForgeDirection.WEST); - super.renderFaceXNeg(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); - } + @Override + public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) { + setIcons(rType, x, y, z, ForgeDirection.WEST); + super.renderFaceXNeg(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); + } - @Override - public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) { - setIcons(rType, x, y, z, ForgeDirection.EAST); - super.renderFaceXPos(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); - } + @Override + public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) { + setIcons(rType, x, y, z, ForgeDirection.EAST); + super.renderFaceXPos(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); + } - @Override - public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) { - setIcons(rType, x, y, z, ForgeDirection.DOWN); - super.renderFaceYNeg(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); - } + @Override + public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) { + setIcons(rType, x, y, z, ForgeDirection.DOWN); + super.renderFaceYNeg(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); + } - @Override - public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) { - setIcons(rType, x, y, z, ForgeDirection.UP); - super.renderFaceYPos(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); - } + @Override + public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) { + setIcons(rType, x, y, z, ForgeDirection.UP); + super.renderFaceYPos(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); + } - @Override - public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) { - setIcons(rType, x, y, z, ForgeDirection.NORTH); - super.renderFaceZNeg(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); - } + @Override + public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) { + setIcons(rType, x, y, z, ForgeDirection.NORTH); + super.renderFaceZNeg(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); + } - @Override - public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) { - setIcons(rType, x, y, z, ForgeDirection.SOUTH); - super.renderFaceZPos(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); - } + @Override + public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) { + setIcons(rType, x, y, z, ForgeDirection.SOUTH); + super.renderFaceZPos(block, x, y, z, inWorld ? submapSmall.getSubIcon(0, 0) : icon); + } - private void setIcons(TextureType type, double x, double y, double z, ForgeDirection side) { - int ix = MathHelper.floor_double(x); - int iy = MathHelper.floor_double(y); - int iz = MathHelper.floor_double(z); - if (type == TextureType.V4 || type == TextureType.V9) { - submap = (TextureSubmap) TextureType.getVIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal()); - submapSmall = (TextureSubmap) TextureType.getVIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal()); - } else { - submap = (TextureSubmap) TextureType.getRIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal()); - submapSmall = (TextureSubmap) TextureType.getRIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal()); - } - } - } + private void setIcons(TextureType type, double x, double y, double z, ForgeDirection side) { + int ix = MathHelper.floor_double(x); + int iy = MathHelper.floor_double(y); + int iz = MathHelper.floor_double(z); + if (type == TextureType.V4 || type == TextureType.V9) { + submap = (TextureSubmap) TextureType + .getVIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal()); + submapSmall = (TextureSubmap) TextureType + .getVIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal()); + } else { + submap = (TextureSubmap) TextureType + .getRIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal()); + submapSmall = (TextureSubmap) TextureType + .getRIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal()); + } + } + } - private class Submap extends TextureSubmap { + private class Submap extends TextureSubmap { - private TextureSubmap[][] submap; + private TextureSubmap[][] submap; - public Submap(IIcon base, int wh, TextureSubmap[][] submap) { - super(base, wh, wh); - this.submap = submap; - } + public Submap(IIcon base, int wh, TextureSubmap[][] submap) { + super(base, wh, wh); + this.submap = submap; + } - @Override - public void texturesStitched() { - for (int i = 0; i < icons.length; i++) { - for (int j = 0; j < icons[i].length; j++) { - icons[i][j] = submap[i][j]; - submap[i][j].texturesStitched(); - } - } - } - } + @Override + public void texturesStitched() { + for (int i = 0; i < icons.length; i++) { + for (int j = 0; j < icons[i].length; j++) { + icons[i][j] = submap[i][j]; + submap[i][j].texturesStitched(); + } + } + } + } - @SideOnly(Side.CLIENT) - private RenderBlocksCTM rb; + @SideOnly(Side.CLIENT) + private RenderBlocksCTM rb; - private TextureSubmap submap, smallSubmap; - private int size; - private String texturePath; - private int meta; - private IIcon defaultIcon; - private TextureType rType; + private TextureSubmap submap, smallSubmap; + private int size; + private String texturePath; + private int meta; + private IIcon defaultIcon; + private TextureType rType; - public SubmapManagerCombinedCTM(int meta, String texturePath, TextureType rType) { - assert rType == TextureType.R16 || rType == TextureType.R9 || rType == TextureType.R4 || rType == TextureType.V4 || rType == TextureType.V9 : "Not a valid random type!"; + public SubmapManagerCombinedCTM(int meta, String texturePath, TextureType rType) { + assert rType == TextureType.R16 || rType == TextureType.R9 + || rType == TextureType.R4 + || rType == TextureType.V4 + || rType == TextureType.V9 : "Not a valid random type!"; - this.meta = meta; - this.texturePath = texturePath; - this.size = Integer.parseInt(rType.name().substring(1, rType.name().length())); // >.> - this.rType = rType; - } + this.meta = meta; + this.texturePath = texturePath; + this.size = Integer.parseInt(rType.name().substring(1, rType.name().length())); // >.> + this.rType = rType; + } - @Override - public IIcon getIcon(int side, int meta) { - return defaultIcon; - } + @Override + public IIcon getIcon(int side, int meta) { + return defaultIcon; + } - @Override - @SideOnly(Side.CLIENT) - public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { - if (rb == null) { - rb = new RenderBlocksCombinedCTM(); - } - rb.setRenderBoundsFromBlock(block); - return rb; - } + @Override + @SideOnly(Side.CLIENT) + public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { + if (rb == null) { + rb = new RenderBlocksCombinedCTM(); + } + rb.setRenderBoundsFromBlock(block); + return rb; + } - @SuppressWarnings("unchecked") - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(String modName, Block block, IIconRegister register) { - IIcon base = register.registerIcon(modName + ":" + texturePath); - int wh = (int) Math.sqrt(size); - TextureSubmap[][] submaps = new TextureSubmap[wh][wh]; - TextureSubmap[][] submapsSmall = new TextureSubmap[wh][wh]; - for (int i = 0; i < size; i++) { - AbstractSubmapManager manager = (AbstractSubmapManager) TextureType.CTMX.createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texturePath + "-" + i); - manager.registerIcons(modName, block, register); - Object cached = manager.getCachedObject(); - Triple triple = (Triple) cached; - submaps[i % wh][i / wh] = triple.getMiddle(); - submapsSmall[i % wh][i / wh] = triple.getRight(); - if (i == 0) { - defaultIcon = triple.getRight().getBaseIcon(); - } - } - submap = new Submap(base, wh, submaps); - smallSubmap = new Submap(base, wh, submapsSmall); - } + @SuppressWarnings("unchecked") + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(String modName, Block block, IIconRegister register) { + IIcon base = register.registerIcon(modName + ":" + texturePath); + int wh = (int) Math.sqrt(size); + TextureSubmap[][] submaps = new TextureSubmap[wh][wh]; + TextureSubmap[][] submapsSmall = new TextureSubmap[wh][wh]; + for (int i = 0; i < size; i++) { + AbstractSubmapManager manager = (AbstractSubmapManager) TextureType.CTMX + .createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texturePath + "-" + i); + manager.registerIcons(modName, block, register); + Object cached = manager.getCachedObject(); + Triple triple = (Triple) cached; + submaps[i % wh][i / wh] = triple.getMiddle(); + submapsSmall[i % wh][i / wh] = triple.getRight(); + if (i == 0) { + defaultIcon = triple.getRight().getBaseIcon(); + } + } + submap = new Submap(base, wh, submaps); + smallSubmap = new Submap(base, wh, submapsSmall); + } } diff --git a/src/main/java/team/chisel/client/render/SubmapManagerFakeController.java b/src/main/java/team/chisel/client/render/SubmapManagerFakeController.java index f65f1cc8..7a56b76a 100644 --- a/src/main/java/team/chisel/client/render/SubmapManagerFakeController.java +++ b/src/main/java/team/chisel/client/render/SubmapManagerFakeController.java @@ -1,68 +1,71 @@ package team.chisel.client.render; -import team.chisel.Chisel; -import team.chisel.ctmlib.CTM; -import team.chisel.ctmlib.TextureSubmap; -import team.chisel.init.ChiselBlocks; +import static team.chisel.ctmlib.Dir.*; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -import com.google.common.base.Optional; +import team.chisel.Chisel; +import team.chisel.ctmlib.CTM; +import team.chisel.ctmlib.TextureSubmap; +import team.chisel.init.ChiselBlocks; -import static team.chisel.ctmlib.Dir.*; +import com.google.common.base.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class SubmapManagerFakeController extends SubmapManagerBase { - private TextureSubmap map; - private CTM ctm = CTM.getInstance(); - private int meta; - private String texturePath; + private TextureSubmap map; + private CTM ctm = CTM.getInstance(); + private int meta; + private String texturePath; - public SubmapManagerFakeController(int meta, String texture) { - ctm.disableObscuredFaceCheck = Optional.of(true); - this.meta = meta; - texturePath = texture; - } + public SubmapManagerFakeController(int meta, String texture) { + ctm.disableObscuredFaceCheck = Optional.of(true); + this.meta = meta; + texturePath = texture; + } - public SubmapManagerFakeController(int meta) { - ctm.disableObscuredFaceCheck = Optional.of(true); - this.meta = meta; - } + public SubmapManagerFakeController(int meta) { + ctm.disableObscuredFaceCheck = Optional.of(true); + this.meta = meta; + } - @Override - public IIcon getIcon(int side, int meta) { - return map.getSubIcon(0, 0); - } + @Override + public IIcon getIcon(int side, int meta) { + return map.getSubIcon(0, 0); + } - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - ctm.buildConnectionMap(world, x, y, z, side, ChiselBlocks.futura, meta); + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + ctm.buildConnectionMap(world, x, y, z, side, ChiselBlocks.futura, meta); - if (ctm.connectedAnd(TOP, TOP_RIGHT, RIGHT, BOTTOM_RIGHT, BOTTOM, BOTTOM_LEFT, LEFT, TOP_LEFT)) { - return map.getSubIcon(1, 1); - } else if (ctm.connectedAnd(TOP, BOTTOM)) { - return map.getSubIcon(0, 1); - } else if (ctm.connectedAnd(LEFT, RIGHT)) { - return map.getSubIcon(1, 0); - } else { - return map.getSubIcon(0, 0); - } - } + if (ctm.connectedAnd(TOP, TOP_RIGHT, RIGHT, BOTTOM_RIGHT, BOTTOM, BOTTOM_LEFT, LEFT, TOP_LEFT)) { + return map.getSubIcon(1, 1); + } else if (ctm.connectedAnd(TOP, BOTTOM)) { + return map.getSubIcon(0, 1); + } else if (ctm.connectedAnd(LEFT, RIGHT)) { + return map.getSubIcon(1, 0); + } else { + return map.getSubIcon(0, 0); + } + } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(String modName, Block block, IIconRegister register) { + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(String modName, Block block, IIconRegister register) { - if (texturePath != null) { - map = new TextureSubmap(register.registerIcon(modName + ":" + texturePath), 2, 2); - } else { - Chisel.logger.info("SubmapManagerFakeController was called on block " + block.getUnlocalizedName() + " without declaring texture, using a default texture instead."); - map = new TextureSubmap(register.registerIcon(modName + ":futura/WIP/controller"), 2, 2); - } - } + if (texturePath != null) { + map = new TextureSubmap(register.registerIcon(modName + ":" + texturePath), 2, 2); + } else { + Chisel.logger.info( + "SubmapManagerFakeController was called on block " + block.getUnlocalizedName() + + " without declaring texture, using a default texture instead."); + map = new TextureSubmap(register.registerIcon(modName + ":futura/WIP/controller"), 2, 2); + } + } } diff --git a/src/main/java/team/chisel/client/render/SubmapManagerLeaves.java b/src/main/java/team/chisel/client/render/SubmapManagerLeaves.java index 91b4b2c5..2f9a0dc0 100644 --- a/src/main/java/team/chisel/client/render/SubmapManagerLeaves.java +++ b/src/main/java/team/chisel/client/render/SubmapManagerLeaves.java @@ -7,21 +7,21 @@ import net.minecraft.util.IIcon; public class SubmapManagerLeaves extends SubmapManagerBase { - private String name; - private IIcon normal, opaque; + private String name; + private IIcon normal, opaque; - public SubmapManagerLeaves(String name) { - this.name = name; - } + public SubmapManagerLeaves(String name) { + this.name = name; + } - @Override - public IIcon getIcon(int side, int meta) { - return Blocks.leaves.isOpaqueCube() ? opaque : normal; - } + @Override + public IIcon getIcon(int side, int meta) { + return Blocks.leaves.isOpaqueCube() ? opaque : normal; + } - @Override - public void registerIcons(String modName, Block block, IIconRegister register) { - this.normal = register.registerIcon(modName + ":" + name); - this.opaque = register.registerIcon(modName + ":" + name + "_opaque"); - } + @Override + public void registerIcons(String modName, Block block, IIconRegister register) { + this.normal = register.registerIcon(modName + ":" + name); + this.opaque = register.registerIcon(modName + ":" + name + "_opaque"); + } } diff --git a/src/main/java/team/chisel/client/render/SubmapManagerSlab.java b/src/main/java/team/chisel/client/render/SubmapManagerSlab.java index 208b0fd0..4ee38cdd 100644 --- a/src/main/java/team/chisel/client/render/SubmapManagerSlab.java +++ b/src/main/java/team/chisel/client/render/SubmapManagerSlab.java @@ -1,81 +1,82 @@ package team.chisel.client.render; -import team.chisel.ctmlib.ISubmapManager; -import team.chisel.ctmlib.RenderBlocksCTM; -import team.chisel.ctmlib.TextureSubmap; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; + +import team.chisel.ctmlib.ISubmapManager; +import team.chisel.ctmlib.RenderBlocksCTM; +import team.chisel.ctmlib.TextureSubmap; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class SubmapManagerSlab implements ISubmapManager { - @SideOnly(Side.CLIENT) - private static RenderBlocksCTM rb; + @SideOnly(Side.CLIENT) + private static RenderBlocksCTM rb; - private TextureSubmap submap; - private TextureSubmap submapSmall; - private IIcon sideTexture; - private String texture; + private TextureSubmap submap; + private TextureSubmap submapSmall; + private IIcon sideTexture; + private String texture; - public SubmapManagerSlab(String texture) { - this.texture = texture; - } + public SubmapManagerSlab(String texture) { + this.texture = texture; + } - @Override - public IIcon getIcon(int side, int meta) { - return submapSmall.getBaseIcon(); - } + @Override + public IIcon getIcon(int side, int meta) { + return submapSmall.getBaseIcon(); + } - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - return getIcon(side, world.getBlockMetadata(x, y, z)); - } + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return getIcon(side, world.getBlockMetadata(x, y, z)); + } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(String modName, Block block, IIconRegister register) { - String path = modName + ":" + texture; - submap = new TextureSubmap(register.registerIcon(path + "-ctm"), 4, 4); - submapSmall = new TextureSubmap(register.registerIcon(path), 2, 2); - sideTexture = register.registerIcon(path + "-side"); - } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(String modName, Block block, IIconRegister register) { + String path = modName + ":" + texture; + submap = new TextureSubmap(register.registerIcon(path + "-ctm"), 4, 4); + submapSmall = new TextureSubmap(register.registerIcon(path), 2, 2); + sideTexture = register.registerIcon(path + "-side"); + } - @Override - @SideOnly(Side.CLIENT) - public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { - if (rb == null) { - rb = new RenderBlocksCTM(); - } - rb.setRenderBoundsFromBlock(block); - rb.submap = submap; - rb.submapSmall = submapSmall; - return rb; - } + @Override + @SideOnly(Side.CLIENT) + public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { + if (rb == null) { + rb = new RenderBlocksCTM(); + } + rb.setRenderBoundsFromBlock(block); + rb.submap = submap; + rb.submapSmall = submapSmall; + return rb; + } - private boolean hadOverride = false; + private boolean hadOverride = false; - @Override - @SideOnly(Side.CLIENT) - public void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { - RenderBlocksCTM rbctm = (RenderBlocksCTM) renderer; - if (side.ordinal() < 2 && !rbctm.rendererOld.hasOverrideBlockTexture()) { - rbctm.rendererOld.setOverrideBlockTexture(sideTexture); - hadOverride = false; - } else { - hadOverride = true; - } - } + @Override + @SideOnly(Side.CLIENT) + public void preRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { + RenderBlocksCTM rbctm = (RenderBlocksCTM) renderer; + if (side.ordinal() < 2 && !rbctm.rendererOld.hasOverrideBlockTexture()) { + rbctm.rendererOld.setOverrideBlockTexture(sideTexture); + hadOverride = false; + } else { + hadOverride = true; + } + } - @Override - @SideOnly(Side.CLIENT) - public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { - if (!hadOverride) { - ((RenderBlocksCTM) renderer).rendererOld.clearOverrideBlockTexture(); - } - } + @Override + @SideOnly(Side.CLIENT) + public void postRenderSide(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, ForgeDirection side) { + if (!hadOverride) { + ((RenderBlocksCTM) renderer).rendererOld.clearOverrideBlockTexture(); + } + } } diff --git a/src/main/java/team/chisel/client/render/SubmapManagerVoidstone.java b/src/main/java/team/chisel/client/render/SubmapManagerVoidstone.java index 2c22c430..f8997319 100644 --- a/src/main/java/team/chisel/client/render/SubmapManagerVoidstone.java +++ b/src/main/java/team/chisel/client/render/SubmapManagerVoidstone.java @@ -1,8 +1,5 @@ package team.chisel.client.render; -import team.chisel.ctmlib.ISubmapManager; -import team.chisel.ctmlib.RenderBlocksCTM; -import team.chisel.ctmlib.TextureSubmap; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.texture.IIconRegister; @@ -11,6 +8,10 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; +import team.chisel.ctmlib.ISubmapManager; +import team.chisel.ctmlib.RenderBlocksCTM; +import team.chisel.ctmlib.TextureSubmap; + import com.cricketcraft.chisel.api.carving.CarvingUtils; import com.cricketcraft.chisel.api.rendering.TextureType; @@ -19,112 +20,119 @@ import cpw.mods.fml.relauncher.SideOnly; public class SubmapManagerVoidstone extends SubmapManagerBase { - // TODO there must be a better more generic way to do this... - @SideOnly(Side.CLIENT) - private class RenderBlocksVoidstone extends RenderBlocksCTM { + // TODO there must be a better more generic way to do this... + @SideOnly(Side.CLIENT) + private class RenderBlocksVoidstone extends RenderBlocksCTM { - @Override - public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) { - super.renderFaceXNeg(block, x, y, z, icon); - renderMinX += 0.001; - setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.WEST.ordinal())); - super.renderFaceXNeg(block, x, y, z, null); - clearOverrideBlockTexture(); - } + @Override + public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceXNeg(block, x, y, z, icon); + renderMinX += 0.001; + setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.WEST.ordinal())); + super.renderFaceXNeg(block, x, y, z, null); + clearOverrideBlockTexture(); + } - @Override - public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) { - super.renderFaceXPos(block, x, y, z, icon); - setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.EAST.ordinal())); - renderMaxX -= 0.001; - super.renderFaceXPos(block, x, y, z, null); - clearOverrideBlockTexture(); - } + @Override + public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceXPos(block, x, y, z, icon); + setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.EAST.ordinal())); + renderMaxX -= 0.001; + super.renderFaceXPos(block, x, y, z, null); + clearOverrideBlockTexture(); + } - @Override - public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) { - super.renderFaceYNeg(block, x, y, z, icon); - setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.DOWN.ordinal())); - renderMinY += 0.001; - super.renderFaceYNeg(block, x, y, z, null); - clearOverrideBlockTexture(); - } + @Override + public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceYNeg(block, x, y, z, icon); + setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.DOWN.ordinal())); + renderMinY += 0.001; + super.renderFaceYNeg(block, x, y, z, null); + clearOverrideBlockTexture(); + } - @Override - public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) { - super.renderFaceYPos(block, x, y, z, icon); - setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.UP.ordinal())); - renderMaxY -= 0.001; - super.renderFaceYPos(block, x, y, z, null); - clearOverrideBlockTexture(); - } + @Override + public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceYPos(block, x, y, z, icon); + setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.UP.ordinal())); + renderMaxY -= 0.001; + super.renderFaceYPos(block, x, y, z, null); + clearOverrideBlockTexture(); + } - @Override - public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) { - super.renderFaceZNeg(block, x, y, z, icon); - setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.NORTH.ordinal())); - renderMinZ += 0.001; - super.renderFaceZNeg(block, x, y, z, null); - clearOverrideBlockTexture(); - } + @Override + public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceZNeg(block, x, y, z, icon); + setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.NORTH.ordinal())); + renderMinZ += 0.001; + super.renderFaceZNeg(block, x, y, z, null); + clearOverrideBlockTexture(); + } - @Override - public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) { - super.renderFaceZPos(block, x, y, z, icon); - setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.SOUTH.ordinal())); - renderMaxZ -= 0.001; - super.renderFaceZPos(block, x, y, z, null); - clearOverrideBlockTexture(); - } - } + @Override + public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceZPos(block, x, y, z, icon); + setOverrideBlockTexture(getBase(x, y, z, ForgeDirection.SOUTH.ordinal())); + renderMaxZ -= 0.001; + super.renderFaceZPos(block, x, y, z, null); + clearOverrideBlockTexture(); + } + } - @SideOnly(Side.CLIENT) - private RenderBlocksVoidstone rb; + @SideOnly(Side.CLIENT) + private RenderBlocksVoidstone rb; - private ISubmapManager overlay; - private TextureSubmap base; + private ISubmapManager overlay; + private TextureSubmap base; - private IIcon getBase(double x, double y, double z, int side) { - return TextureType.getVIcon(TextureType.V4, base, MathHelper.floor_double(x), MathHelper.floor_double(y), MathHelper.floor_double(z), side); - } + private IIcon getBase(double x, double y, double z, int side) { + return TextureType.getVIcon( + TextureType.V4, + base, + MathHelper.floor_double(x), + MathHelper.floor_double(y), + MathHelper.floor_double(z), + side); + } - private String texture; - private int meta; + private String texture; + private int meta; - public SubmapManagerVoidstone(String texture, int meta) { - this.texture = texture; - this.meta = meta; - } + public SubmapManagerVoidstone(String texture, int meta) { + this.texture = texture; + this.meta = meta; + } - @Override - public IIcon getIcon(int side, int meta) { - return overlay.getIcon(side, meta); - } + @Override + public IIcon getIcon(int side, int meta) { + return overlay.getIcon(side, meta); + } - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - return overlay.getIcon(world, x, y, z, side); - } + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return overlay.getIcon(world, x, y, z, side); + } - @Override - public void registerIcons(String modName, Block block, IIconRegister register) { - overlay = TextureType.getTypeFor(null, modName, texture).createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texture); - overlay.registerIcons(modName, block, register); - base = new TextureSubmap(register.registerIcon(modName + ":" + "animations/hadesX32"), 2, 2); - } + @Override + public void registerIcons(String modName, Block block, IIconRegister register) { + overlay = TextureType.getTypeFor(null, modName, texture) + .createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texture); + overlay.registerIcons(modName, block, register); + base = new TextureSubmap(register.registerIcon(modName + ":" + "animations/hadesX32"), 2, 2); + } - @Override - @SideOnly(Side.CLIENT) - public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { - if (rb == null) { - rb = new RenderBlocksVoidstone(); - } - RenderBlocks ctx = overlay.createRenderContext(rendererOld, block, world); - rb.setRenderBoundsFromBlock(block); - if (ctx instanceof RenderBlocksCTM) { - rb.submap = ((RenderBlocksCTM) ctx).submap; - rb.submapSmall = ((RenderBlocksCTM) ctx).submapSmall; - } - return rb; - } + @Override + @SideOnly(Side.CLIENT) + public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { + if (rb == null) { + rb = new RenderBlocksVoidstone(); + } + RenderBlocks ctx = overlay.createRenderContext(rendererOld, block, world); + rb.setRenderBoundsFromBlock(block); + if (ctx instanceof RenderBlocksCTM) { + rb.submap = ((RenderBlocksCTM) ctx).submap; + rb.submapSmall = ((RenderBlocksCTM) ctx).submapSmall; + } + return rb; + } } diff --git a/src/main/java/team/chisel/client/render/item/ItemChiselRenderer.java b/src/main/java/team/chisel/client/render/item/ItemChiselRenderer.java index 772d34d3..05a5aa40 100644 --- a/src/main/java/team/chisel/client/render/item/ItemChiselRenderer.java +++ b/src/main/java/team/chisel/client/render/item/ItemChiselRenderer.java @@ -10,39 +10,50 @@ import org.lwjgl.opengl.GL11; public class ItemChiselRenderer implements IItemRenderer { - RenderBlocks renderBlock = new RenderBlocks(); - RenderItem renderItem = new RenderItem(); + RenderBlocks renderBlock = new RenderBlocks(); + RenderItem renderItem = new RenderItem(); - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return type == IItemRenderer.ItemRenderType.INVENTORY; - } + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + return type == IItemRenderer.ItemRenderType.INVENTORY; + } - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return false; - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return false; + } - @Override - public void renderItem(ItemRenderType type, ItemStack stack, Object... data) { - GL11.glPushMatrix(); - - // Fixes potential render bug with blocks that draw this item - renderItem.zLevel = 10f; - renderItem.renderItemIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().renderEngine, stack, 0, 0); + @Override + public void renderItem(ItemRenderType type, ItemStack stack, Object... data) { + GL11.glPushMatrix(); - if (stack.stackTagCompound != null) { + // Fixes potential render bug with blocks that draw this item + renderItem.zLevel = 10f; + renderItem.renderItemIntoGUI( + Minecraft.getMinecraft().fontRenderer, + Minecraft.getMinecraft().renderEngine, + stack, + 0, + 0); - ItemStack chiselTarget = ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("chiselTarget")); - if (chiselTarget != null) { + if (stack.stackTagCompound != null) { - GL11.glScalef(0.65f, 0.65f, 0.65f); - GL11.glTranslatef(-8f, -8f, 0.0f); + ItemStack chiselTarget = ItemStack + .loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("chiselTarget")); + if (chiselTarget != null) { - renderItem.renderItemIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().renderEngine, chiselTarget, 8, 8); - } - } - GL11.glPopMatrix(); - } + GL11.glScalef(0.65f, 0.65f, 0.65f); + GL11.glTranslatef(-8f, -8f, 0.0f); + + renderItem.renderItemIntoGUI( + Minecraft.getMinecraft().fontRenderer, + Minecraft.getMinecraft().renderEngine, + chiselTarget, + 8, + 8); + } + } + GL11.glPopMatrix(); + } } diff --git a/src/main/java/team/chisel/client/render/tile/RenderAutoChisel.java b/src/main/java/team/chisel/client/render/tile/RenderAutoChisel.java index f4a82a39..0f5b23fc 100644 --- a/src/main/java/team/chisel/client/render/tile/RenderAutoChisel.java +++ b/src/main/java/team/chisel/client/render/tile/RenderAutoChisel.java @@ -1,9 +1,9 @@ package team.chisel.client.render.tile; +import static org.lwjgl.opengl.GL11.*; + import java.util.Random; -import team.chisel.Chisel; -import team.chisel.block.tileentity.TileEntityAutoChisel; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; @@ -24,169 +24,187 @@ import net.minecraftforge.client.model.obj.GroupObject; import net.minecraftforge.client.model.obj.TextureCoordinate; import net.minecraftforge.client.model.obj.Vertex; import net.minecraftforge.client.model.obj.WavefrontObject; + +import team.chisel.Chisel; +import team.chisel.block.tileentity.TileEntityAutoChisel; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -import static org.lwjgl.opengl.GL11.*; public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler, IItemRenderer { - private static final WavefrontObject model = new WavefrontObject(new ResourceLocation(Chisel.MOD_ID, "models/autoChisel/autoChisel.obj")); - private static final ResourceLocation texture = new ResourceLocation(Chisel.MOD_ID, "textures/blocks/autoChisel/autoChisel.png"); + private static final WavefrontObject model = new WavefrontObject( + new ResourceLocation(Chisel.MOD_ID, "models/autoChisel/autoChisel.obj")); + private static final ResourceLocation texture = new ResourceLocation( + Chisel.MOD_ID, + "textures/blocks/autoChisel/autoChisel.png"); - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return true; - } + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + return true; + } - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return helper == ItemRendererHelper.INVENTORY_BLOCK || helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION; - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return helper == ItemRendererHelper.INVENTORY_BLOCK || helper == ItemRendererHelper.ENTITY_BOBBING + || helper == ItemRendererHelper.ENTITY_ROTATION; + } - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - switch (type) { - case ENTITY: - glTranslatef(-0.5f, 0, 0.5f); - break; - case EQUIPPED: - glRotatef(20, 0, 1, 0); - glRotatef(-15, 1, 0, -1); - glScalef(0.65f, 0.65f, 0.65f); - glTranslatef(0.75f, -0.5f, 1.25f); - break; - case EQUIPPED_FIRST_PERSON: - glRotatef(20, 0, 0, 1); - glRotatef(30, 0, 1, 0); - glTranslatef(0.2f, 0, -0.1f); - glScalef(0.5f, 0.5f, 0.5f); - break; - case FIRST_PERSON_MAP: - break; - case INVENTORY: - glTranslatef(-0.5f, -0.5f, 0.5f); - break; - } + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + switch (type) { + case ENTITY: + glTranslatef(-0.5f, 0, 0.5f); + break; + case EQUIPPED: + glRotatef(20, 0, 1, 0); + glRotatef(-15, 1, 0, -1); + glScalef(0.65f, 0.65f, 0.65f); + glTranslatef(0.75f, -0.5f, 1.25f); + break; + case EQUIPPED_FIRST_PERSON: + glRotatef(20, 0, 0, 1); + glRotatef(30, 0, 1, 0); + glTranslatef(0.2f, 0, -0.1f); + glScalef(0.5f, 0.5f, 0.5f); + break; + case FIRST_PERSON_MAP: + break; + case INVENTORY: + glTranslatef(-0.5f, -0.5f, 0.5f); + break; + } - Minecraft.getMinecraft().renderEngine.bindTexture(texture); - model.renderAll(); - } + Minecraft.getMinecraft().renderEngine.bindTexture(texture); + model.renderAll(); + } - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - ; - } + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + ; + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - Tessellator tes = Tessellator.instance; - IIcon icon = renderer.hasOverrideBlockTexture() ? renderer.overrideBlockTexture : block.getIcon(0, 0); - tes.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - tes.setColorOpaque_F(1, 1, 1); - tes.addTranslation(x, y, z + 1); - for (GroupObject go : model.groupObjects) { - for (Face f : go.faces) { - Vertex n = f.faceNormal; - tes.setNormal(n.x, n.y, n.z); - for (int i = 0; i < f.vertices.length; i++) { - Vertex vert = f.vertices[i]; - TextureCoordinate t = f.textureCoordinates[i]; - if (!renderer.hasOverrideBlockTexture()) { - tes.addVertexWithUV(vert.x, vert.y, vert.z, icon.getInterpolatedU(t.u * 16), icon.getInterpolatedV(t.v * 16)); - } else { - tes.addVertexWithUV(vert.x, vert.y, vert.z, icon.getInterpolatedU((t.u * 64) % 16), icon.getInterpolatedV((t.v * 64) % 16)); - } - } - } - } - tes.addTranslation(-x, -y, -z - 1); - return true; - } + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { + Tessellator tes = Tessellator.instance; + IIcon icon = renderer.hasOverrideBlockTexture() ? renderer.overrideBlockTexture : block.getIcon(0, 0); + tes.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + tes.setColorOpaque_F(1, 1, 1); + tes.addTranslation(x, y, z + 1); + for (GroupObject go : model.groupObjects) { + for (Face f : go.faces) { + Vertex n = f.faceNormal; + tes.setNormal(n.x, n.y, n.z); + for (int i = 0; i < f.vertices.length; i++) { + Vertex vert = f.vertices[i]; + TextureCoordinate t = f.textureCoordinates[i]; + if (!renderer.hasOverrideBlockTexture()) { + tes.addVertexWithUV( + vert.x, + vert.y, + vert.z, + icon.getInterpolatedU(t.u * 16), + icon.getInterpolatedV(t.v * 16)); + } else { + tes.addVertexWithUV( + vert.x, + vert.y, + vert.z, + icon.getInterpolatedU((t.u * 64) % 16), + icon.getInterpolatedV((t.v * 64) % 16)); + } + } + } + } + tes.addTranslation(-x, -y, -z - 1); + return true; + } - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } - @Override - public int getRenderId() { - return Chisel.renderAutoChiselId; - } + @Override + public int getRenderId() { + return Chisel.renderAutoChiselId; + } - private final RenderItem renderItem; + private final RenderItem renderItem; - public RenderAutoChisel() { - Chisel.renderAutoChiselId = RenderingRegistry.getNextAvailableRenderId(); + public RenderAutoChisel() { + Chisel.renderAutoChiselId = RenderingRegistry.getNextAvailableRenderId(); - renderItem = new RenderItem() { + renderItem = new RenderItem() { - @Override - public boolean shouldBob() { - return false; - } - }; - renderItem.setRenderManager(RenderManager.instance); - } + @Override + public boolean shouldBob() { + return false; + } + }; + renderItem.setRenderManager(RenderManager.instance); + } - private static final Random rand = new Random(); + private static final Random rand = new Random(); - @Override - public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float scale) { + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float scale) { - // Render Blocks - TileEntityAutoChisel autoChisel = (TileEntityAutoChisel) tile; - EntityItem item = autoChisel.getItemForRendering(TileEntityAutoChisel.TARGET); + // Render Blocks + TileEntityAutoChisel autoChisel = (TileEntityAutoChisel) tile; + EntityItem item = autoChisel.getItemForRendering(TileEntityAutoChisel.TARGET); - rand.setSeed(tile.xCoord + tile.yCoord + tile.zCoord); - rand.nextBoolean(); + rand.setSeed(tile.xCoord + tile.yCoord + tile.zCoord); + rand.nextBoolean(); - float max = 0.35f; + float max = 0.35f; - if (!Minecraft.getMinecraft().isGamePaused()) { - autoChisel.xRot += (rand.nextFloat() * max) - (max / 2); - autoChisel.yRot += (rand.nextFloat() * max) - (max / 2); - autoChisel.zRot += (rand.nextFloat() * max) - (max / 2); - } + if (!Minecraft.getMinecraft().isGamePaused()) { + autoChisel.xRot += (rand.nextFloat() * max) - (max / 2); + autoChisel.yRot += (rand.nextFloat() * max) - (max / 2); + autoChisel.zRot += (rand.nextFloat() * max) - (max / 2); + } - if (item != null) { - glPushMatrix(); - glPushAttrib(GL_ALL_ATTRIB_BITS); - glTranslated(x + 0.5, y + 1.5, z + 0.5); - glRotatef(autoChisel.xRot, 1, 0, 0); - glRotatef(autoChisel.yRot, 0, 1, 0); - glRotatef(autoChisel.zRot, 0, 0, 1); - glEnable(GL_BLEND); - glDepthMask(false); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA); - renderItem.doRender(item, 0, 0, 0, 0, 0); - glPopMatrix(); - glPopAttrib(); - } + if (item != null) { + glPushMatrix(); + glPushAttrib(GL_ALL_ATTRIB_BITS); + glTranslated(x + 0.5, y + 1.5, z + 0.5); + glRotatef(autoChisel.xRot, 1, 0, 0); + glRotatef(autoChisel.yRot, 0, 1, 0); + glRotatef(autoChisel.zRot, 0, 0, 1); + glEnable(GL_BLEND); + glDepthMask(false); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA); + renderItem.doRender(item, 0, 0, 0, 0, 0); + glPopMatrix(); + glPopAttrib(); + } - item = autoChisel.getItemForRendering(TileEntityAutoChisel.BASE); - if (item != null) { - glPushMatrix(); - glTranslated(x + 0.35, y + 0.934, z + 0.5); - item.getEntityItem().stackSize = autoChisel.getLastBase() == null ? 1 : autoChisel.getLastBase().stackSize; - renderItem.doRender(item, 0, 0, 0, 0, 0); - glPopMatrix(); - } + item = autoChisel.getItemForRendering(TileEntityAutoChisel.BASE); + if (item != null) { + glPushMatrix(); + glTranslated(x + 0.35, y + 0.934, z + 0.5); + item.getEntityItem().stackSize = autoChisel.getLastBase() == null ? 1 : autoChisel.getLastBase().stackSize; + renderItem.doRender(item, 0, 0, 0, 0, 0); + glPopMatrix(); + } - GameSettings settings = Minecraft.getMinecraft().gameSettings; - item = autoChisel.getItemForRendering(TileEntityAutoChisel.CHISEL); - if (item != null) { - glPushMatrix(); - glTranslated(x + 0.7, y + 1.01, z + 0.5); - float rot = autoChisel.chiselRot == 0 ? 0 : autoChisel.chiseling ? autoChisel.chiselRot + (TileEntityAutoChisel.rotAmnt * scale) : autoChisel.chiselRot - - (TileEntityAutoChisel.rotAmnt * scale); - glRotatef(rot, 0, 0, 1); - glTranslated(-0.12, 0, 0); - glScalef(0.9f, 0.9f, 0.9f); - boolean was = settings.fancyGraphics; - settings.fancyGraphics = true; - renderItem.doRender(item, 0, 0, 0, 0, 0); - settings.fancyGraphics = was; - glPopMatrix(); - } - } + GameSettings settings = Minecraft.getMinecraft().gameSettings; + item = autoChisel.getItemForRendering(TileEntityAutoChisel.CHISEL); + if (item != null) { + glPushMatrix(); + glTranslated(x + 0.7, y + 1.01, z + 0.5); + float rot = autoChisel.chiselRot == 0 ? 0 + : autoChisel.chiseling ? autoChisel.chiselRot + (TileEntityAutoChisel.rotAmnt * scale) + : autoChisel.chiselRot - (TileEntityAutoChisel.rotAmnt * scale); + glRotatef(rot, 0, 0, 1); + glTranslated(-0.12, 0, 0); + glScalef(0.9f, 0.9f, 0.9f); + boolean was = settings.fancyGraphics; + settings.fancyGraphics = true; + renderItem.doRender(item, 0, 0, 0, 0, 0); + settings.fancyGraphics = was; + glPopMatrix(); + } + } } diff --git a/src/main/java/team/chisel/client/render/tile/RenderCarvableBeacon.java b/src/main/java/team/chisel/client/render/tile/RenderCarvableBeacon.java index cdef1538..8c3925c9 100644 --- a/src/main/java/team/chisel/client/render/tile/RenderCarvableBeacon.java +++ b/src/main/java/team/chisel/client/render/tile/RenderCarvableBeacon.java @@ -24,162 +24,163 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class RenderCarvableBeacon extends TileEntityBeaconRenderer implements ISimpleBlockRenderingHandler { - private static final ResourceLocation texture = new ResourceLocation("textures/entity/beacon_beam.png"); + private static final ResourceLocation texture = new ResourceLocation("textures/entity/beacon_beam.png"); - private int renderId; + private int renderId; - public RenderCarvableBeacon() { - this.renderId = RenderingRegistry.getNextAvailableRenderId(); - } + public RenderCarvableBeacon() { + this.renderId = RenderingRegistry.getNextAvailableRenderId(); + } - public void renderTileEntityAt(TileEntityCarvableBeacon beacon, double x, double y, double z, float partialTicks) { - float f1 = beacon.func_146002_i(); - if (f1 > 0.1F) { - renderBeam(f1, beacon.getWorldObj(), x, y, z, beacon.getBlockMetadata(), partialTicks); - } - } - - private void renderBeam(float f1, World world, double x, double y, double z, int meta, float partialTicks) { - GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); - Color color; - if (meta < 15) { - color = new Color(ItemDye.field_150922_c[meta]); - } else { - float hue = ((float) world.getTotalWorldTime() % 256) / 256; - color = new Color(Color.HSBtoRGB(hue + (partialTicks / 256), 1, 1)); - } - - Tessellator tessellator = Tessellator.instance; - this.bindTexture(texture); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - OpenGlHelper.glBlendFunc(770, 1, 1, 0); - float f2 = world.getTotalWorldTime() + partialTicks; - float f3 = -f2 * 0.2F - MathHelper.floor_float(-f2 * 0.1F); - byte b0 = 1; - double d3 = f2 * 0.025D * (1.0D - (b0 & 1) * 2.5D); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(color.getRed(), color.getGreen(), color.getBlue(), 32); - double d5 = b0 * 0.2D; - double d7 = 0.5D + Math.cos(d3 + 2.356194490192345D) * d5; - double d9 = 0.5D + Math.sin(d3 + 2.356194490192345D) * d5; - double d11 = 0.5D + Math.cos(d3 + (Math.PI / 4D)) * d5; - double d13 = 0.5D + Math.sin(d3 + (Math.PI / 4D)) * d5; - double d15 = 0.5D + Math.cos(d3 + 3.9269908169872414D) * d5; - double d17 = 0.5D + Math.sin(d3 + 3.9269908169872414D) * d5; - double d19 = 0.5D + Math.cos(d3 + 5.497787143782138D) * d5; - double d21 = 0.5D + Math.sin(d3 + 5.497787143782138D) * d5; - double d23 = 256.0F * f1; - double d25 = 0.0D; - double d27 = 1.0D; - double d28 = -1.0F + f3; - double d29 = 256.0F * f1 * (0.5D / d5) + d28; - tessellator.addVertexWithUV(x + d7, y + d23, z + d9, d27, d29); - tessellator.addVertexWithUV(x + d7, y, z + d9, d27, d28); - tessellator.addVertexWithUV(x + d11, y, z + d13, d25, d28); - tessellator.addVertexWithUV(x + d11, y + d23, z + d13, d25, d29); - tessellator.addVertexWithUV(x + d19, y + d23, z + d21, d27, d29); - tessellator.addVertexWithUV(x + d19, y, z + d21, d27, d28); - tessellator.addVertexWithUV(x + d15, y, z + d17, d25, d28); - tessellator.addVertexWithUV(x + d15, y + d23, z + d17, d25, d29); - tessellator.addVertexWithUV(x + d11, y + d23, z + d13, d27, d29); - tessellator.addVertexWithUV(x + d11, y, z + d13, d27, d28); - tessellator.addVertexWithUV(x + d19, y, z + d21, d25, d28); - tessellator.addVertexWithUV(x + d19, y + d23, z + d21, d25, d29); - tessellator.addVertexWithUV(x + d15, y + d23, z + d17, d27, d29); - tessellator.addVertexWithUV(x + d15, y, z + d17, d27, d28); - tessellator.addVertexWithUV(x + d7, y, z + d9, d25, d28); - tessellator.addVertexWithUV(x + d7, y + d23, z + d9, d25, d29); - tessellator.draw(); - GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.glBlendFunc(770, 771, 1, 0); - GL11.glDepthMask(false); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(color.getRed(), color.getGreen(), color.getBlue(), 32); - double d30 = 0.2D; - double d4 = 0.2D; - double d6 = 0.8D; - double d8 = 0.2D; - double d10 = 0.2D; - double d12 = 0.8D; - double d14 = 0.8D; - double d16 = 0.8D; - double d18 = 256.0F * f1; - double d20 = 0.0D; - double d22 = 1.0D; - double d24 = -1.0F + f3; - double d26 = 256.0F * f1 + d24; - tessellator.addVertexWithUV(x + d30, y + d18, z + d4, d22, d26); - tessellator.addVertexWithUV(x + d30, y, z + d4, d22, d24); - tessellator.addVertexWithUV(x + d6, y, z + d8, d20, d24); - tessellator.addVertexWithUV(x + d6, y + d18, z + d8, d20, d26); - tessellator.addVertexWithUV(x + d14, y + d18, z + d16, d22, d26); - tessellator.addVertexWithUV(x + d14, y, z + d16, d22, d24); - tessellator.addVertexWithUV(x + d10, y, z + d12, d20, d24); - tessellator.addVertexWithUV(x + d10, y + d18, z + d12, d20, d26); - tessellator.addVertexWithUV(x + d6, y + d18, z + d8, d22, d26); - tessellator.addVertexWithUV(x + d6, y, z + d8, d22, d24); - tessellator.addVertexWithUV(x + d14, y, z + d16, d20, d24); - tessellator.addVertexWithUV(x + d14, y + d18, z + d16, d20, d26); - tessellator.addVertexWithUV(x + d10, y + d18, z + d12, d22, d26); - tessellator.addVertexWithUV(x + d10, y, z + d12, d22, d24); - tessellator.addVertexWithUV(x + d30, y, z + d4, d20, d24); - tessellator.addVertexWithUV(x + d30, y + d18, z + d4, d20, d26); - tessellator.draw(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - } + public void renderTileEntityAt(TileEntityCarvableBeacon beacon, double x, double y, double z, float partialTicks) { + float f1 = beacon.func_146002_i(); + if (f1 > 0.1F) { + renderBeam(f1, beacon.getWorldObj(), x, y, z, beacon.getBlockMetadata(), partialTicks); + } + } - @Override - public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) { - this.renderTileEntityAt((TileEntityCarvableBeacon) tile, x, y, z, partialTicks); - } + private void renderBeam(float f1, World world, double x, double y, double z, int meta, float partialTicks) { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + Color color; + if (meta < 15) { + color = new Color(ItemDye.field_150922_c[meta]); + } else { + float hue = ((float) world.getTotalWorldTime() % 256) / 256; + color = new Color(Color.HSBtoRGB(hue + (partialTicks / 256), 1, 1)); + } - @Override - public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { - renderer.renderBlockAsItem(Blocks.beacon, 0, 1); - GL11.glPushMatrix(); - GL11.glTranslatef(-0.5f, 0, -0.5f); - renderBeam(0.00195f, Minecraft.getMinecraft().theWorld, 0, 0, 0, metadata, 0); - GL11.glPopMatrix(); - } + Tessellator tessellator = Tessellator.instance; + this.bindTexture(texture); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + float f2 = world.getTotalWorldTime() + partialTicks; + float f3 = -f2 * 0.2F - MathHelper.floor_float(-f2 * 0.1F); + byte b0 = 1; + double d3 = f2 * 0.025D * (1.0D - (b0 & 1) * 2.5D); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(color.getRed(), color.getGreen(), color.getBlue(), 32); + double d5 = b0 * 0.2D; + double d7 = 0.5D + Math.cos(d3 + 2.356194490192345D) * d5; + double d9 = 0.5D + Math.sin(d3 + 2.356194490192345D) * d5; + double d11 = 0.5D + Math.cos(d3 + (Math.PI / 4D)) * d5; + double d13 = 0.5D + Math.sin(d3 + (Math.PI / 4D)) * d5; + double d15 = 0.5D + Math.cos(d3 + 3.9269908169872414D) * d5; + double d17 = 0.5D + Math.sin(d3 + 3.9269908169872414D) * d5; + double d19 = 0.5D + Math.cos(d3 + 5.497787143782138D) * d5; + double d21 = 0.5D + Math.sin(d3 + 5.497787143782138D) * d5; + double d23 = 256.0F * f1; + double d25 = 0.0D; + double d27 = 1.0D; + double d28 = -1.0F + f3; + double d29 = 256.0F * f1 * (0.5D / d5) + d28; + tessellator.addVertexWithUV(x + d7, y + d23, z + d9, d27, d29); + tessellator.addVertexWithUV(x + d7, y, z + d9, d27, d28); + tessellator.addVertexWithUV(x + d11, y, z + d13, d25, d28); + tessellator.addVertexWithUV(x + d11, y + d23, z + d13, d25, d29); + tessellator.addVertexWithUV(x + d19, y + d23, z + d21, d27, d29); + tessellator.addVertexWithUV(x + d19, y, z + d21, d27, d28); + tessellator.addVertexWithUV(x + d15, y, z + d17, d25, d28); + tessellator.addVertexWithUV(x + d15, y + d23, z + d17, d25, d29); + tessellator.addVertexWithUV(x + d11, y + d23, z + d13, d27, d29); + tessellator.addVertexWithUV(x + d11, y, z + d13, d27, d28); + tessellator.addVertexWithUV(x + d19, y, z + d21, d25, d28); + tessellator.addVertexWithUV(x + d19, y + d23, z + d21, d25, d29); + tessellator.addVertexWithUV(x + d15, y + d23, z + d17, d27, d29); + tessellator.addVertexWithUV(x + d15, y, z + d17, d27, d28); + tessellator.addVertexWithUV(x + d7, y, z + d9, d25, d28); + tessellator.addVertexWithUV(x + d7, y + d23, z + d9, d25, d29); + tessellator.draw(); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glDepthMask(false); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(color.getRed(), color.getGreen(), color.getBlue(), 32); + double d30 = 0.2D; + double d4 = 0.2D; + double d6 = 0.8D; + double d8 = 0.2D; + double d10 = 0.2D; + double d12 = 0.8D; + double d14 = 0.8D; + double d16 = 0.8D; + double d18 = 256.0F * f1; + double d20 = 0.0D; + double d22 = 1.0D; + double d24 = -1.0F + f3; + double d26 = 256.0F * f1 + d24; + tessellator.addVertexWithUV(x + d30, y + d18, z + d4, d22, d26); + tessellator.addVertexWithUV(x + d30, y, z + d4, d22, d24); + tessellator.addVertexWithUV(x + d6, y, z + d8, d20, d24); + tessellator.addVertexWithUV(x + d6, y + d18, z + d8, d20, d26); + tessellator.addVertexWithUV(x + d14, y + d18, z + d16, d22, d26); + tessellator.addVertexWithUV(x + d14, y, z + d16, d22, d24); + tessellator.addVertexWithUV(x + d10, y, z + d12, d20, d24); + tessellator.addVertexWithUV(x + d10, y + d18, z + d12, d20, d26); + tessellator.addVertexWithUV(x + d6, y + d18, z + d8, d22, d26); + tessellator.addVertexWithUV(x + d6, y, z + d8, d22, d24); + tessellator.addVertexWithUV(x + d14, y, z + d16, d20, d24); + tessellator.addVertexWithUV(x + d14, y + d18, z + d16, d20, d26); + tessellator.addVertexWithUV(x + d10, y + d18, z + d12, d22, d26); + tessellator.addVertexWithUV(x + d10, y, z + d12, d22, d24); + tessellator.addVertexWithUV(x + d30, y, z + d4, d20, d24); + tessellator.addVertexWithUV(x + d30, y + d18, z + d4, d20, d26); + tessellator.draw(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - float f = 0.1875F; - boolean breaking = renderer.hasOverrideBlockTexture(); - if (!breaking) { - renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.glass)); - } - renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1); - renderer.renderAllFaces = true; - if (!breaking) { - renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.obsidian)); - } - renderer.setRenderBounds(0.125D, 0.00625D, 0.125D, 0.875D, f, 0.875D); - renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1); - if (!breaking) { - renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.beacon)); - } - renderer.setRenderBounds(0.1875D, f, 0.1875D, 0.8125D, 0.875D, 0.8125D); - renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1); - renderer.renderAllFaces = false; - renderer.clearOverrideBlockTexture(); - return true; - } + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) { + this.renderTileEntityAt((TileEntityCarvableBeacon) tile, x, y, z, partialTicks); + } - @Override - public boolean shouldRender3DInInventory(int modelId) { - return true; - } + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + renderer.renderBlockAsItem(Blocks.beacon, 0, 1); + GL11.glPushMatrix(); + GL11.glTranslatef(-0.5f, 0, -0.5f); + renderBeam(0.00195f, Minecraft.getMinecraft().theWorld, 0, 0, 0, metadata, 0); + GL11.glPopMatrix(); + } - @Override - public int getRenderId() { - return renderId; - } + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { + float f = 0.1875F; + boolean breaking = renderer.hasOverrideBlockTexture(); + if (!breaking) { + renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.glass)); + } + renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1); + renderer.renderAllFaces = true; + if (!breaking) { + renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.obsidian)); + } + renderer.setRenderBounds(0.125D, 0.00625D, 0.125D, 0.875D, f, 0.875D); + renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1); + if (!breaking) { + renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.beacon)); + } + renderer.setRenderBounds(0.1875D, f, 0.1875D, 0.8125D, 0.875D, 0.8125D); + renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1); + renderer.renderAllFaces = false; + renderer.clearOverrideBlockTexture(); + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return renderId; + } } diff --git a/src/main/java/team/chisel/client/render/tile/RenderPresent.java b/src/main/java/team/chisel/client/render/tile/RenderPresent.java index 3bd0977a..8296e71c 100644 --- a/src/main/java/team/chisel/client/render/tile/RenderPresent.java +++ b/src/main/java/team/chisel/client/render/tile/RenderPresent.java @@ -19,127 +19,130 @@ import team.chisel.block.tileentity.TileEntityPresent; import team.chisel.init.ChiselBlocks; import com.google.common.collect.Maps; - import cpw.mods.fml.client.FMLClientHandler; public class RenderPresent extends TileEntitySpecialRenderer implements IItemRenderer { - private ModelChest smallChest = new ModelChest(); - private ModelChest largeChest = new ModelLargeChest(); + private ModelChest smallChest = new ModelChest(); + private ModelChest largeChest = new ModelLargeChest(); - private HashMap textureCache = Maps.newHashMap(); + private HashMap textureCache = Maps.newHashMap(); - public void renderTileEntityAt(TileEntityPresent present, double x, double y, double z, float partialTicks) { - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glTranslatef((float) x, (float) y + 1.0F, (float) z + 1.0F); - GL11.glScalef(1.0F, -1.0F, -1.0F); - int rotation = present.getRotation(); - bindTexture(present); - if (!present.isConnected()) { - GL11.glRotatef(90 * rotation + 180, 0, 1, 0); - switch (rotation) { - case 0: - GL11.glTranslatef(-1, 0, -1); - break; - case 1: - GL11.glTranslatef(0, 0, -1); - break; - case 3: - GL11.glTranslatef(-1, 0, 0); - break; - } - smallChest.renderAll(); - } else if (present.isParent()) { - ForgeDirection dir = present.getConnectionDir(); - switch (dir) { - case NORTH: - GL11.glRotatef(-90, 0, 1, 0); - GL11.glTranslatef(0, 0, -1); - break; - case SOUTH: - GL11.glRotatef(-90, 0, 1, 0); - GL11.glTranslatef(-1, 0, -1); - break; - case WEST: - GL11.glTranslatef(-1, 0, 0); - break; - default: - break; - } - if (rotation == 0 || rotation == 3) { - GL11.glRotatef(180, 0, 1, 0); - GL11.glTranslatef(-2, 0, -1); - } - largeChest.renderAll(); - } - GL11.glPopMatrix(); - } + public void renderTileEntityAt(TileEntityPresent present, double x, double y, double z, float partialTicks) { + GL11.glPushMatrix(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glTranslatef((float) x, (float) y + 1.0F, (float) z + 1.0F); + GL11.glScalef(1.0F, -1.0F, -1.0F); + int rotation = present.getRotation(); + bindTexture(present); + if (!present.isConnected()) { + GL11.glRotatef(90 * rotation + 180, 0, 1, 0); + switch (rotation) { + case 0: + GL11.glTranslatef(-1, 0, -1); + break; + case 1: + GL11.glTranslatef(0, 0, -1); + break; + case 3: + GL11.glTranslatef(-1, 0, 0); + break; + } + smallChest.renderAll(); + } else if (present.isParent()) { + ForgeDirection dir = present.getConnectionDir(); + switch (dir) { + case NORTH: + GL11.glRotatef(-90, 0, 1, 0); + GL11.glTranslatef(0, 0, -1); + break; + case SOUTH: + GL11.glRotatef(-90, 0, 1, 0); + GL11.glTranslatef(-1, 0, -1); + break; + case WEST: + GL11.glTranslatef(-1, 0, 0); + break; + default: + break; + } + if (rotation == 0 || rotation == 3) { + GL11.glRotatef(180, 0, 1, 0); + GL11.glTranslatef(-2, 0, -1); + } + largeChest.renderAll(); + } + GL11.glPopMatrix(); + } - private void bindTexture(TileEntityPresent present) { - int idx = present.getWorldObj().getBlockMetadata(present.xCoord, present.yCoord, present.zCoord) + (present.isConnected() ? 0 : 16); - ResourceLocation rl = textureCache.get(idx); - if (rl == null) { - String res = ChiselBlocks.present.getModelTexture(idx % 16); - res += present.isConnected() ? "_double.png" : ".png"; - rl = new ResourceLocation("chisel", res); - textureCache.put(idx, rl); - } - bindTexture(rl); - } + private void bindTexture(TileEntityPresent present) { + int idx = present.getWorldObj().getBlockMetadata(present.xCoord, present.yCoord, present.zCoord) + + (present.isConnected() ? 0 : 16); + ResourceLocation rl = textureCache.get(idx); + if (rl == null) { + String res = ChiselBlocks.present.getModelTexture(idx % 16); + res += present.isConnected() ? "_double.png" : ".png"; + rl = new ResourceLocation("chisel", res); + textureCache.put(idx, rl); + } + bindTexture(rl); + } - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) { - this.renderTileEntityAt((TileEntityPresent) tileEntity, x, y, z, partialTicks); - } + @Override + public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) { + this.renderTileEntityAt((TileEntityPresent) tileEntity, x, y, z, partialTicks); + } - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return type != ItemRenderType.FIRST_PERSON_MAP; - } + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + return type != ItemRenderType.FIRST_PERSON_MAP; + } - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Chisel.MOD_ID, ChiselBlocks.present.getModelTexture(item.getItemDamage()) + ".png")); - switch (type) { - case ENTITY: - renderBlock(0.0F, 1.0F, 0.0F); - break; - case EQUIPPED: - renderBlock(0.5F, 1.5F, 0.5F); - break; - case EQUIPPED_FIRST_PERSON: - renderBlock(0.5F, 1.0F, 0.5F); - break; - case INVENTORY: - renderInventory(1.0F, 1.0F, 1.0F); - break; - default: - break; - } - } + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + FMLClientHandler.instance().getClient().renderEngine.bindTexture( + new ResourceLocation( + Chisel.MOD_ID, + ChiselBlocks.present.getModelTexture(item.getItemDamage()) + ".png")); + switch (type) { + case ENTITY: + renderBlock(0.0F, 1.0F, 0.0F); + break; + case EQUIPPED: + renderBlock(0.5F, 1.5F, 0.5F); + break; + case EQUIPPED_FIRST_PERSON: + renderBlock(0.5F, 1.0F, 0.5F); + break; + case INVENTORY: + renderInventory(1.0F, 1.0F, 1.0F); + break; + default: + break; + } + } - private void renderBlock(float x, float y, float z) { - GL11.glPushMatrix(); - GL11.glTranslatef(x, y, z); - GL11.glScaled(-1, -1, 1); - smallChest.renderAll(); - GL11.glPopMatrix(); - } + private void renderBlock(float x, float y, float z) { + GL11.glPushMatrix(); + GL11.glTranslatef(x, y, z); + GL11.glScaled(-1, -1, 1); + smallChest.renderAll(); + GL11.glPopMatrix(); + } - private void renderInventory(float x, float y, float z) { - GL11.glPushMatrix(); - GL11.glTranslatef(x, y, z); - GL11.glRotatef(180F, 1F, 0, 0); - GL11.glRotatef(-90F, 0, 1F, 0); - GL11.glScalef(1.0F, 1.0F, 1.0F); - smallChest.renderAll(); - GL11.glPopMatrix(); - } + private void renderInventory(float x, float y, float z) { + GL11.glPushMatrix(); + GL11.glTranslatef(x, y, z); + GL11.glRotatef(180F, 1F, 0, 0); + GL11.glRotatef(-90F, 0, 1F, 0); + GL11.glScalef(1.0F, 1.0F, 1.0F); + smallChest.renderAll(); + GL11.glPopMatrix(); + } } diff --git a/src/main/java/team/chisel/compat/Compatibility.java b/src/main/java/team/chisel/compat/Compatibility.java index 0832b77c..a0be2aab 100644 --- a/src/main/java/team/chisel/compat/Compatibility.java +++ b/src/main/java/team/chisel/compat/Compatibility.java @@ -5,13 +5,13 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import codechicken.nei.api.GuiInfo; -import cpw.mods.fml.relauncher.Side; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; + import team.chisel.carving.Carving; import team.chisel.client.gui.GuiChisel; import team.chisel.utils.RecipeUtil; +import codechicken.nei.api.GuiInfo; import com.cricketcraft.chisel.api.carving.ICarvingGroup; import com.cricketcraft.chisel.api.carving.ICarvingVariation; @@ -21,268 +21,270 @@ import com.pahimar.ee3.api.exchange.RecipeRegistryProxy; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; public class Compatibility { - public static String[] rockColorNames = { "gray", "lightgray", "brown", "tan", "reddish", "bluish", "greenish" }; + public static String[] rockColorNames = { "gray", "lightgray", "brown", "tan", "reddish", "bluish", "greenish" }; - public static Map tconMap = Maps.newHashMap(); + public static Map tconMap = Maps.newHashMap(); - static { - tconMap.put(0, "obsidian"); - tconMap.put(1, "sandstone"); - tconMap.put(2, "netherrack"); - tconMap.put(3, "stonebricksmooth"); - tconMap.put(12, "end_stone"); - } + static { + tconMap.put(0, "obsidian"); + tconMap.put(1, "sandstone"); + tconMap.put(2, "netherrack"); + tconMap.put(3, "stonebricksmooth"); + tconMap.put(12, "end_stone"); + } - public static void init(FMLPostInitializationEvent event) { + public static void init(FMLPostInitializationEvent event) { - /* Proj Red */ - addSupport("ProjRed|Exploration", "projectred.exploration.stone", "marble", 0, 99); - addSupport("ProjRed|Exploration", "projectred.exploration.stone", "marble", 1, 99); + /* Proj Red */ + addSupport("ProjRed|Exploration", "projectred.exploration.stone", "marble", 0, 99); + addSupport("ProjRed|Exploration", "projectred.exploration.stone", "marble", 1, 99); - /* Bluepower */ - addSupport("bluepower", "marble", "marble", 0, 99); + /* Bluepower */ + addSupport("bluepower", "marble", "marble", 0, 99); - /* Artifice */ - addSupport("Artifice", "artifice.marble", "marble", 0, 99); - addSupport("Artifice", "artifice.marble.slab", "marble_slab", 0, 99); - for (String s : rockColorNames) { - addSupport("Artifice", "artifice.limestone." + s, "limestone", 0, 99); - } + /* Artifice */ + addSupport("Artifice", "artifice.marble", "marble", 0, 99); + addSupport("Artifice", "artifice.marble.slab", "marble_slab", 0, 99); + for (String s : rockColorNames) { + addSupport("Artifice", "artifice.limestone." + s, "limestone", 0, 99); + } - /* Mariculture */ - Block block = GameRegistry.findBlock("mariculture", "limestone"); - if (block != null) { - for (int i = 0; i < 16; i++) { - addSupport("limestone", block, i, 99); - } - } + /* Mariculture */ + Block block = GameRegistry.findBlock("mariculture", "limestone"); + if (block != null) { + for (int i = 0; i < 16; i++) { + addSupport("limestone", block, i, 99); + } + } - /* Geologica */ - addSupport("PFAAGeologica", "strongStone", "marble", 5, 99); - addSupport("PFAAGeologica", "strongStoneSlab", "marbleSlab", 5, 99); - addSupport("PFAAGeologica", "strongStoneBrickStairs.marble", "marbleStairs", 0, 99); - addSupport("PFAAGeologica", "mediumStone", "limestone", 0, 99); - addSupport("PFAAGeologica", "mediumStoneSlab", "limestoneSlab", 0, 99); - addSupport("PFAAGeologica", "mediumStoneBrickStairs.limestone", "limestoneStairs", 0, 99); - addSupport("PFAAGeologica", "strongStoneBrick", "stoneBrick", 3, 99); - addSupport("PFAAGeologica", "strongCobble", "cobblestone", 3, 99); + /* Geologica */ + addSupport("PFAAGeologica", "strongStone", "marble", 5, 99); + addSupport("PFAAGeologica", "strongStoneSlab", "marbleSlab", 5, 99); + addSupport("PFAAGeologica", "strongStoneBrickStairs.marble", "marbleStairs", 0, 99); + addSupport("PFAAGeologica", "mediumStone", "limestone", 0, 99); + addSupport("PFAAGeologica", "mediumStoneSlab", "limestoneSlab", 0, 99); + addSupport("PFAAGeologica", "mediumStoneBrickStairs.limestone", "limestoneStairs", 0, 99); + addSupport("PFAAGeologica", "strongStoneBrick", "stoneBrick", 3, 99); + addSupport("PFAAGeologica", "strongCobble", "cobblestone", 3, 99); - /* Thaumcraft TODO There is probably a cleaner way of doing this */ - if (Loader.isModLoaded("Thaumcraft")) { - loadThaumcraftAspects(); - } + /* Thaumcraft TODO There is probably a cleaner way of doing this */ + if (Loader.isModLoaded("Thaumcraft")) { + loadThaumcraftAspects(); + } - for (Integer i : tconMap.keySet()) { - addSupport("TConstruct", "decoration.multibrick", tconMap.get(i), i, 99); - addSupport("TConstruct", "decoration.multibrickfancy", tconMap.get(i), i, 99); - } + for (Integer i : tconMap.keySet()) { + addSupport("TConstruct", "decoration.multibrick", tconMap.get(i), i, 99); + addSupport("TConstruct", "decoration.multibrickfancy", tconMap.get(i), i, 99); + } - addSupport("TConstruct", "decoration.multibrickfancy", "stonebricksmooth", 14, 99); - addSupport("TConstruct", "decoration.multibrickfancy", "stonebricksmooth", 15, 99); + addSupport("TConstruct", "decoration.multibrickfancy", "stonebricksmooth", 14, 99); + addSupport("TConstruct", "decoration.multibrickfancy", "stonebricksmooth", 15, 99); - addSupport("Botania", "endStoneBrick", "end_stone", 0, 0); - addSupport("Botania", "endStoneBrick", "end_stone", 1, 0); + addSupport("Botania", "endStoneBrick", "end_stone", 0, 0); + addSupport("Botania", "endStoneBrick", "end_stone", 1, 0); - if (Loader.isModLoaded("EE3")) { - loadEE3Values(); - } - if (Loader.isModLoaded("NotEnoughItems") && event.getSide() == Side.CLIENT) { - // disable chiseling by scrolling over itemstack - GuiInfo.customSlotGuis.add(GuiChisel.class); - } - } + if (Loader.isModLoaded("EE3")) { + loadEE3Values(); + } + if (Loader.isModLoaded("NotEnoughItems") && event.getSide() == Side.CLIENT) { + // disable chiseling by scrolling over itemstack + GuiInfo.customSlotGuis.add(GuiChisel.class); + } + } + public static void addSupport(String modname, String blockname, String name, int metadata, int order) { + if (Loader.isModLoaded(modname) && GameRegistry.findBlock(modname, blockname) != null) { + addSupport(name, GameRegistry.findBlock(modname, blockname), metadata, order); + } + } - public static void addSupport(String modname, String blockname, String name, int metadata, int order) { - if (Loader.isModLoaded(modname) && GameRegistry.findBlock(modname, blockname) != null) { - addSupport(name, GameRegistry.findBlock(modname, blockname), metadata, order); - } - } + public static void addSupport(String name, Block block, int metadata, int order) { + Carving.chisel.addVariation(name, block, metadata, order); + } - public static void addSupport(String name, Block block, int metadata, int order) { - Carving.chisel.addVariation(name, block, metadata, order); - } + private static void loadThaumcraftAspects() { + // ThaumcraftApi.registerObjectTag(new ItemStack(ChiselBlocks.cobblestone, 1, OreDictionary.WILDCARD_VALUE), + // (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1)); + // ThaumcraftApi.registerObjectTag(new ItemStack(ChiselBlocks.cobblestoneWall, 1, OreDictionary.WILDCARD_VALUE), + // (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1)); + } - private static void loadThaumcraftAspects() { - // ThaumcraftApi.registerObjectTag(new ItemStack(ChiselBlocks.cobblestone, 1, OreDictionary.WILDCARD_VALUE), (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1)); - // ThaumcraftApi.registerObjectTag(new ItemStack(ChiselBlocks.cobblestoneWall, 1, OreDictionary.WILDCARD_VALUE), (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1)); - } - - private static void loadEE3Values() { - for (String groupName : Carving.chisel.getSortedGroupNames()){ - ICarvingGroup group = Carving.chisel.getGroup(groupName); - List baseStacks = new ArrayList(); - for (ICarvingVariation variation : group.getVariations()){ - if (RecipeUtil.isCreatable(new ItemStack(variation.getBlock(), 1, variation.getBlockMeta()))){ - baseStacks.add(new ItemStack(variation.getBlock(), 1, variation.getBlockMeta())); - } - } - for (ICarvingVariation variation : group.getVariations()){ - ItemStack stack = new ItemStack(variation.getBlock(), 1, variation.getBlockMeta()); - for (ItemStack baseStack : baseStacks) { -// if (baseStack==null){ -// Chisel.logger.error("Base Stack is null"); -// if (stack!=null){ -// Chisel.logger.info("Non base for base stack is "+stack); -// } -// continue; -// } -// if (stack==null){ -// Chisel.logger.error("Non Base stack is null"); -// Chisel.logger.info("Base stack for null stack is "+baseStack); -// continue; -// } - //Chisel.logger.info("Adding emc recipe for "+baseStack+" to "+stack); - RecipeRegistryProxy.addRecipe(stack, Arrays.asList(baseStack)); - } - } - } -// FMLLog.log(Chisel.MOD_ID, Level.INFO, "[Chisel 2] Oooh is that Equivalent Exchange I see?"); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselItems.ballomoss, 1), 16); -// -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.sand_snakestone, 1, 1), 8); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.sand_snakestone, 1, 13), 8); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cloud, 1, 0), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cloud, 1, 1), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cloud, 1, 2), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cloud, 1, 3), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cloud, 1, 4), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 1), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 2), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 3), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 4), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 12), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 13), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 14), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 15), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.present, 1, 4), 80); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.road_line, 1, 0), 24); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.road_line, 1, 1), 24); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.road_line, 1, 2), 24); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.road_line, 1, 3), 24); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical2, 1, 0), 24); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical2, 1, 1), 24); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical2, 1, 2), 24); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical2, 1, 3), 24); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass2, 1), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical2, 1, 0), 32); -// -// for (int x = 0; x < ChiselBlocks.pumpkin.length; x++) { -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.pumpkin[x], 1), 144); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.jackolantern[x], 1), 153); -// } -// -// for (int x = 0; x < ChiselBlocks.torches.length; x++) { -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.torches[x], 1), 9); -// } -// -// for (int x = 0; x < 10; x++) { -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.valentines, 1, x), 3); -// } -// -// for (int x = 0; x < 16; x++) { -// if (x <= 10) -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.concrete, 1, x), 8); -// if (x <= 14) -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.grimstone, 1, x), 5); -// if (x < 14) -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.grimstone, 1, x), 7); -// if (x < 12) -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.dirt, 1, x), 1); -// if (x < 5) { -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.rebel, 1, x), 39); -// } -// -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.fantasyblock, 1, x), 29444); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.fantasyblock, 1, x), 31444); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.limestone, 1, x), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.marble, 1, x), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.marble_pillar, 1, x), 8); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.marble_pillar_slab, 1, x), 4); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.sandstone_scribbles, 1, x), 4); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.stonebricksmooth, 1, x), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.templeblock, 1, x), 108); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.mossy_templeblock, 1, x), 108); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glowstone, 1, x), 1536); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.ice, 1, x), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.woolen_clay, 1, x), 153); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.factoryblock, 1, x), 32); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.hexPlating, 1, x), 37); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.gold_block, 1, x), 18432); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.iron_block, 1, x), 2304); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.laboratoryblock, 1, x), 33); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical, 1, x), 32); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.tyrian, 1, x), 33); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.hexLargePlating, 1, x), 37); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.circuits, 1, x), 37); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.factoryblock2, 1, x), 32); -// -// if (x < 15) -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.warningSign, 1, x), 6); -// -// if (x < 4) -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.factoryblock2, 1, x), 32); -// -// for (int c = 0; c < ChiselBlocks.stainedGlass.length; c++) { -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.stainedGlass[c], 1, x), 1); -// } -// -// for (int c = 0; c < ChiselBlocks.stainedGlassPane.length; c++) { -// if (x <= 13) -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.stainedGlassPane[c], 1, x), 1); -// } -// -// if (x > 0) { -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cobblestone, 1, x), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.mossy_cobblestone, 1, x), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.netherrack, 1, x), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.obsidian, 1, x), 64); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.sandstone, 1, x), 4); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.voidstonerunic, 1, x), 160); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass, 1, x), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.redstone_block, 1, x), 288); -// if (x <= 8) -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.bookshelf, 1, x), 528); -// if (x <= 12) { -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.diamond_block, 1, x), 73728); -// if (x != 12) -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.emerald_block, 1, x), 73728); -// } -// -// for (int c = 0; c < ChiselBlocks.planks.length; c++) { -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.planks[c], 1, x), 8); -// } -// } -// } -// -// for (int x = 0; x <= 6; x++) { -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.andesite, 1, x), 129); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.diorite, 1, x), 257); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.granite, 1, x), 513); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.lavastone, 1, x), 9); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.lavastone, 1, 7), 9); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.voidstone, 1, x), 160); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.voidstone, 1, 7), 160); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.voidstone2, 1, x), 256); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.voidstone2, 1, 7), 256); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.waterstone, 1, x), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.ice_pillar, 1, x), 1); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.iron_bars, 1, x), 96); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.iron_bars, 1, 7), 96); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.iron_bars, 1, 8), 96); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.iron_bars, 1, 9), 96); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall, 1, x), 32); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall, 1, 7), 32); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall, 1, 8), 32); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall_block, 1, x), 32); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall_block, 1, 7), 32); -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall_block, 1, 8), 32); -// if (x > 0) { -// EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.brickCustom, 1, x), 256); -// } -// } - } + private static void loadEE3Values() { + for (String groupName : Carving.chisel.getSortedGroupNames()) { + ICarvingGroup group = Carving.chisel.getGroup(groupName); + List baseStacks = new ArrayList(); + for (ICarvingVariation variation : group.getVariations()) { + if (RecipeUtil.isCreatable(new ItemStack(variation.getBlock(), 1, variation.getBlockMeta()))) { + baseStacks.add(new ItemStack(variation.getBlock(), 1, variation.getBlockMeta())); + } + } + for (ICarvingVariation variation : group.getVariations()) { + ItemStack stack = new ItemStack(variation.getBlock(), 1, variation.getBlockMeta()); + for (ItemStack baseStack : baseStacks) { + // if (baseStack==null){ + // Chisel.logger.error("Base Stack is null"); + // if (stack!=null){ + // Chisel.logger.info("Non base for base stack is "+stack); + // } + // continue; + // } + // if (stack==null){ + // Chisel.logger.error("Non Base stack is null"); + // Chisel.logger.info("Base stack for null stack is "+baseStack); + // continue; + // } + // Chisel.logger.info("Adding emc recipe for "+baseStack+" to "+stack); + RecipeRegistryProxy.addRecipe(stack, Arrays.asList(baseStack)); + } + } + } + // FMLLog.log(Chisel.MOD_ID, Level.INFO, "[Chisel 2] Oooh is that Equivalent Exchange I see?"); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselItems.ballomoss, 1), 16); + // + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.sand_snakestone, 1, 1), 8); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.sand_snakestone, 1, 13), 8); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cloud, 1, 0), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cloud, 1, 1), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cloud, 1, 2), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cloud, 1, 3), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cloud, 1, 4), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 1), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 2), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 3), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 4), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 12), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 13), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 14), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass_pane, 1, 15), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.present, 1, 4), 80); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.road_line, 1, 0), 24); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.road_line, 1, 1), 24); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.road_line, 1, 2), 24); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.road_line, 1, 3), 24); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical2, 1, 0), 24); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical2, 1, 1), 24); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical2, 1, 2), 24); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical2, 1, 3), 24); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass2, 1), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical2, 1, 0), 32); + // + // for (int x = 0; x < ChiselBlocks.pumpkin.length; x++) { + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.pumpkin[x], 1), 144); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.jackolantern[x], 1), 153); + // } + // + // for (int x = 0; x < ChiselBlocks.torches.length; x++) { + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.torches[x], 1), 9); + // } + // + // for (int x = 0; x < 10; x++) { + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.valentines, 1, x), 3); + // } + // + // for (int x = 0; x < 16; x++) { + // if (x <= 10) + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.concrete, 1, x), 8); + // if (x <= 14) + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.grimstone, 1, x), 5); + // if (x < 14) + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.grimstone, 1, x), 7); + // if (x < 12) + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.dirt, 1, x), 1); + // if (x < 5) { + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.rebel, 1, x), 39); + // } + // + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.fantasyblock, 1, x), 29444); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.fantasyblock, 1, x), 31444); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.limestone, 1, x), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.marble, 1, x), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.marble_pillar, 1, x), 8); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.marble_pillar_slab, 1, x), 4); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.sandstone_scribbles, 1, x), 4); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.stonebricksmooth, 1, x), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.templeblock, 1, x), 108); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.mossy_templeblock, 1, x), 108); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glowstone, 1, x), 1536); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.ice, 1, x), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.woolen_clay, 1, x), 153); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.factoryblock, 1, x), 32); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.hexPlating, 1, x), 37); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.gold_block, 1, x), 18432); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.iron_block, 1, x), 2304); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.laboratoryblock, 1, x), 33); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical, 1, x), 32); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.tyrian, 1, x), 33); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.hexLargePlating, 1, x), 37); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.circuits, 1, x), 37); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.factoryblock2, 1, x), 32); + // + // if (x < 15) + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.warningSign, 1, x), 6); + // + // if (x < 4) + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.factoryblock2, 1, x), 32); + // + // for (int c = 0; c < ChiselBlocks.stainedGlass.length; c++) { + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.stainedGlass[c], 1, x), 1); + // } + // + // for (int c = 0; c < ChiselBlocks.stainedGlassPane.length; c++) { + // if (x <= 13) + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.stainedGlassPane[c], 1, x), 1); + // } + // + // if (x > 0) { + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cobblestone, 1, x), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.mossy_cobblestone, 1, x), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.netherrack, 1, x), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.obsidian, 1, x), 64); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.sandstone, 1, x), 4); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.voidstonerunic, 1, x), 160); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass, 1, x), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.redstone_block, 1, x), 288); + // if (x <= 8) + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.bookshelf, 1, x), 528); + // if (x <= 12) { + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.diamond_block, 1, x), 73728); + // if (x != 12) + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.emerald_block, 1, x), 73728); + // } + // + // for (int c = 0; c < ChiselBlocks.planks.length; c++) { + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.planks[c], 1, x), 8); + // } + // } + // } + // + // for (int x = 0; x <= 6; x++) { + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.andesite, 1, x), 129); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.diorite, 1, x), 257); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.granite, 1, x), 513); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.lavastone, 1, x), 9); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.lavastone, 1, 7), 9); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.voidstone, 1, x), 160); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.voidstone, 1, 7), 160); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.voidstone2, 1, x), 256); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.voidstone2, 1, 7), 256); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.waterstone, 1, x), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.ice_pillar, 1, x), 1); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.iron_bars, 1, x), 96); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.iron_bars, 1, 7), 96); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.iron_bars, 1, 8), 96); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.iron_bars, 1, 9), 96); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall, 1, x), 32); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall, 1, 7), 32); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall, 1, 8), 32); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall_block, 1, x), 32); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall_block, 1, 7), 32); + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall_block, 1, 8), 32); + // if (x > 0) { + // EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.brickCustom, 1, x), 256); + // } + // } + } } diff --git a/src/main/java/team/chisel/compat/IMCHandler.java b/src/main/java/team/chisel/compat/IMCHandler.java index 1349b408..d9d87225 100644 --- a/src/main/java/team/chisel/compat/IMCHandler.java +++ b/src/main/java/team/chisel/compat/IMCHandler.java @@ -1,55 +1,59 @@ package team.chisel.compat; -import com.cricketcraft.chisel.api.IMC; -import com.cricketcraft.chisel.api.carving.ICarvingRegistry; +import net.minecraft.block.Block; import team.chisel.Chisel; import team.chisel.carving.Carving; -import net.minecraft.block.Block; + +import com.cricketcraft.chisel.api.IMC; +import com.cricketcraft.chisel.api.carving.ICarvingRegistry; import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; public class IMCHandler { - public static final IMCHandler INSTANCE = new IMCHandler(); + public static final IMCHandler INSTANCE = new IMCHandler(); - private int order = 1000; + private int order = 1000; - private IMCHandler() { - } + private IMCHandler() {} - public void handleMessage(IMCMessage message) { - for (IMC imc : IMC.values()) { - if (imc.key.equals(message.key)) { - handle(message, imc, message.getStringValue()); - } - } - } + public void handleMessage(IMCMessage message) { + for (IMC imc : IMC.values()) { + if (imc.key.equals(message.key)) { + handle(message, imc, message.getStringValue()); + } + } + } - private void handle(IMCMessage message, IMC type, String value) { - ICarvingRegistry reg = Carving.chisel; - String[] data = value.split("\\|"); - try { - switch (type) { - case ADD_VARIATION: - case REMOVE_VARIATION: - Block block = (Block) Block.blockRegistry.getObject(data[1]); - int meta = Short.parseShort(data[2]); - if (type == IMC.ADD_VARIATION) { - reg.addVariation(data[0], block, meta, order++); - } else { - reg.removeVariation(block, meta, data[0]); - } - break; - case REGISTER_GROUP_ORE: - reg.registerOre(data[0], data[1]); - break; - default: - throw new IllegalArgumentException("Invalid IMC constant! How...what...?"); - } - } catch (Exception e) { - Chisel.logger.error("Could not handle data {} for IMC type {}. This was sent from mod {}.\n" + "!! This is a bug in that mod !!\nSwallowing error and continuing...", value, type.name(), - message.getSender()); - e.printStackTrace(); - } - } + private void handle(IMCMessage message, IMC type, String value) { + ICarvingRegistry reg = Carving.chisel; + String[] data = value.split("\\|"); + try { + switch (type) { + case ADD_VARIATION: + case REMOVE_VARIATION: + Block block = (Block) Block.blockRegistry.getObject(data[1]); + int meta = Short.parseShort(data[2]); + if (type == IMC.ADD_VARIATION) { + reg.addVariation(data[0], block, meta, order++); + } else { + reg.removeVariation(block, meta, data[0]); + } + break; + case REGISTER_GROUP_ORE: + reg.registerOre(data[0], data[1]); + break; + default: + throw new IllegalArgumentException("Invalid IMC constant! How...what...?"); + } + } catch (Exception e) { + Chisel.logger.error( + "Could not handle data {} for IMC type {}. This was sent from mod {}.\n" + + "!! This is a bug in that mod !!\nSwallowing error and continuing...", + value, + type.name(), + message.getSender()); + e.printStackTrace(); + } + } } diff --git a/src/main/java/team/chisel/compat/WailaCompat.java b/src/main/java/team/chisel/compat/WailaCompat.java index 910889a7..6262b40b 100644 --- a/src/main/java/team/chisel/compat/WailaCompat.java +++ b/src/main/java/team/chisel/compat/WailaCompat.java @@ -2,12 +2,11 @@ package team.chisel.compat; import java.util.List; -import com.cricketcraft.chisel.api.ICarvable; - import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataProvider; import mcp.mobius.waila.api.IWailaRegistrar; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -15,41 +14,48 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import com.cricketcraft.chisel.api.ICarvable; + public class WailaCompat implements IWailaDataProvider { - private WailaCompat() { - } + private WailaCompat() {} - @Override - public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler configHandler) { - return null; - } + @Override + public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler configHandler) { + return null; + } - @Override - public List getWailaHead(ItemStack stack, List strings, IWailaDataAccessor accessor, IWailaConfigHandler configHandler) { - return strings; - } + @Override + public List getWailaHead(ItemStack stack, List strings, IWailaDataAccessor accessor, + IWailaConfigHandler configHandler) { + return strings; + } - @Override - public List getWailaBody(ItemStack stack, List strings, IWailaDataAccessor accessor, IWailaConfigHandler configHandler) { - if (accessor.getBlock() instanceof ICarvable) { - ICarvable block = (ICarvable) accessor.getBlock(); - MovingObjectPosition pos = accessor.getPosition(); - strings.add(block.getManager(accessor.getWorld(), pos.blockX, pos.blockY, pos.blockZ, accessor.getMetadata()).getDescription()); - } - return strings; - } + @Override + public List getWailaBody(ItemStack stack, List strings, IWailaDataAccessor accessor, + IWailaConfigHandler configHandler) { + if (accessor.getBlock() instanceof ICarvable) { + ICarvable block = (ICarvable) accessor.getBlock(); + MovingObjectPosition pos = accessor.getPosition(); + strings.add( + block.getManager(accessor.getWorld(), pos.blockX, pos.blockY, pos.blockZ, accessor.getMetadata()) + .getDescription()); + } + return strings; + } - @Override - public List getWailaTail(ItemStack stack, List strings, IWailaDataAccessor accessor, IWailaConfigHandler configHandler) { - return strings; - } + @Override + public List getWailaTail(ItemStack stack, List strings, IWailaDataAccessor accessor, + IWailaConfigHandler configHandler) { + return strings; + } - public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) { - return tag; - } + public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, + int y, int z) { + return tag; + } - public static void register(IWailaRegistrar registrar) { - registrar.registerBodyProvider(new WailaCompat(), ICarvable.class); - } + public static void register(IWailaRegistrar registrar) { + registrar.registerBodyProvider(new WailaCompat(), ICarvable.class); + } } diff --git a/src/main/java/team/chisel/compat/fmp/FMPCompat.java b/src/main/java/team/chisel/compat/fmp/FMPCompat.java index a39af9e6..d8da29e1 100644 --- a/src/main/java/team/chisel/compat/fmp/FMPCompat.java +++ b/src/main/java/team/chisel/compat/fmp/FMPCompat.java @@ -1,8 +1,9 @@ package team.chisel.compat.fmp; -import team.chisel.init.ChiselBlocks; import net.minecraft.block.Block; import net.minecraft.world.World; + +import team.chisel.init.ChiselBlocks; import codechicken.lib.vec.BlockCoord; import codechicken.multipart.MultiPartRegistry; import codechicken.multipart.MultiPartRegistry.IPartConverter; @@ -13,32 +14,32 @@ import com.google.common.collect.Lists; public class FMPCompat implements IPartFactory, IPartConverter { - public void init() { - MultiPartRegistry.registerConverter(this); - MultiPartRegistry.registerParts(this, new String[] { "chisel_torch" }); - } + public void init() { + MultiPartRegistry.registerConverter(this); + MultiPartRegistry.registerParts(this, new String[] { "chisel_torch" }); + } - @Override - public Iterable blockTypes() { - return Lists.newArrayList(ChiselBlocks.torches); - } + @Override + public Iterable blockTypes() { + return Lists.newArrayList(ChiselBlocks.torches); + } - @Override - public TMultiPart convert(World world, BlockCoord bc) { - Block block = world.getBlock(bc.x, bc.y, bc.z); - for (int i = 0; i < ChiselBlocks.torches.length; i++) { - if (block == ChiselBlocks.torches[i]) { - return new PartChiselTorch(i, world.getBlockMetadata(bc.x, bc.y, bc.z)); - } - } - return null; - } + @Override + public TMultiPart convert(World world, BlockCoord bc) { + Block block = world.getBlock(bc.x, bc.y, bc.z); + for (int i = 0; i < ChiselBlocks.torches.length; i++) { + if (block == ChiselBlocks.torches[i]) { + return new PartChiselTorch(i, world.getBlockMetadata(bc.x, bc.y, bc.z)); + } + } + return null; + } - @Override - public TMultiPart createPart(String type, boolean client) { - if (type.equals("chisel_torch")) { - return new PartChiselTorch(); - } - return null; - } + @Override + public TMultiPart createPart(String type, boolean client) { + if (type.equals("chisel_torch")) { + return new PartChiselTorch(); + } + return null; + } } diff --git a/src/main/java/team/chisel/compat/fmp/ItemBlockChiselTorchPart.java b/src/main/java/team/chisel/compat/fmp/ItemBlockChiselTorchPart.java index fb91cdd6..70a9e603 100644 --- a/src/main/java/team/chisel/compat/fmp/ItemBlockChiselTorchPart.java +++ b/src/main/java/team/chisel/compat/fmp/ItemBlockChiselTorchPart.java @@ -1,11 +1,12 @@ package team.chisel.compat.fmp; -import team.chisel.block.BlockCarvableTorch; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + +import team.chisel.block.BlockCarvableTorch; import codechicken.lib.vec.BlockCoord; import codechicken.multipart.TMultiPart; import codechicken.multipart.TileMultipart; @@ -15,54 +16,62 @@ import cpw.mods.fml.relauncher.SideOnly; public class ItemBlockChiselTorchPart extends ItemBlock { - private BlockCarvableTorch torch; + private BlockCarvableTorch torch; - // Blame FML for the duped params, these references will always be the same - public ItemBlockChiselTorchPart(Block block, BlockCarvableTorch torch) { - super(block); - this.torch = torch; - } + // Blame FML for the duped params, these references will always be the same + public ItemBlockChiselTorchPart(Block block, BlockCarvableTorch torch) { + super(block); + this.torch = torch; + } - @Override - @SideOnly(Side.CLIENT) - public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) { - return (placePart(world, new BlockCoord(x, y, z).offset(side), stack, side, false)) || (super.func_150936_a(world, x, y, z, side, player, stack)); - } + @Override + @SideOnly(Side.CLIENT) + public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) { + return (placePart(world, new BlockCoord(x, y, z).offset(side), stack, side, false)) + || (super.func_150936_a(world, x, y, z, side, player, stack)); + } - public TMultiPart createMultiPart(World world, BlockCoord pos, ItemStack item, int side) { - return new PartChiselTorch(torch.idx, TorchPart.sideMetaMap[side ^ 1]); - } + public TMultiPart createMultiPart(World world, BlockCoord pos, ItemStack item, int side) { + return new PartChiselTorch(torch.idx, TorchPart.sideMetaMap[side ^ 1]); + } - public boolean placePart(World world, BlockCoord pos, ItemStack item, int side, boolean doPlace) { - TileMultipart tile = TileMultipart.getOrConvertTile(world, pos); - if (tile == null) { - return false; - } - TMultiPart part = createMultiPart(world, pos, item, side); - if (part == null) { - return false; - } - if (tile.canAddPart(part)) { - if (doPlace) { - TileMultipart.addPart(world, pos, part); - } - return true; - } - return false; - } + public boolean placePart(World world, BlockCoord pos, ItemStack item, int side, boolean doPlace) { + TileMultipart tile = TileMultipart.getOrConvertTile(world, pos); + if (tile == null) { + return false; + } + TMultiPart part = createMultiPart(world, pos, item, side); + if (part == null) { + return false; + } + if (tile.canAddPart(part)) { + if (doPlace) { + TileMultipart.addPart(world, pos, part); + } + return true; + } + return false; + } - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { - Block block = world.getBlock(x, y, z); - BlockCoord pos = new BlockCoord(x, y, z); - if (!block.isReplaceable(world, x, y, z)) { - pos = new BlockCoord(x, y, z).offset(side); - } - if (placePart(world, pos, stack, side, !world.isRemote)) { - world.playSoundEffect(pos.x + 0.5F, pos.y + 0.5F, pos.z + 0.5F, field_150939_a.stepSound.func_150496_b(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); - stack.stackSize -= 1; - return true; - } - return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ); - } + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { + Block block = world.getBlock(x, y, z); + BlockCoord pos = new BlockCoord(x, y, z); + if (!block.isReplaceable(world, x, y, z)) { + pos = new BlockCoord(x, y, z).offset(side); + } + if (placePart(world, pos, stack, side, !world.isRemote)) { + world.playSoundEffect( + pos.x + 0.5F, + pos.y + 0.5F, + pos.z + 0.5F, + field_150939_a.stepSound.func_150496_b(), + (block.stepSound.getVolume() + 1.0F) / 2.0F, + block.stepSound.getPitch() * 0.8F); + stack.stackSize -= 1; + return true; + } + return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ); + } } diff --git a/src/main/java/team/chisel/compat/fmp/PartChiselTorch.java b/src/main/java/team/chisel/compat/fmp/PartChiselTorch.java index 4d89c25b..70a62499 100644 --- a/src/main/java/team/chisel/compat/fmp/PartChiselTorch.java +++ b/src/main/java/team/chisel/compat/fmp/PartChiselTorch.java @@ -1,55 +1,55 @@ package team.chisel.compat.fmp; -import team.chisel.init.ChiselBlocks; import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; + +import team.chisel.init.ChiselBlocks; import codechicken.lib.data.MCDataInput; import codechicken.lib.data.MCDataOutput; import codechicken.multipart.minecraft.TorchPart; public class PartChiselTorch extends TorchPart { - private int idx; + private int idx; - public PartChiselTorch() { - } + public PartChiselTorch() {} - public PartChiselTorch(int idx, int meta) { - super(meta); - this.idx = idx; - } + public PartChiselTorch(int idx, int meta) { + super(meta); + this.idx = idx; + } - @Override - public void writeDesc(MCDataOutput packet) { - super.writeDesc(packet); - packet.writeInt(idx); - } + @Override + public void writeDesc(MCDataOutput packet) { + super.writeDesc(packet); + packet.writeInt(idx); + } - @Override - public void readDesc(MCDataInput packet) { - super.readDesc(packet); - this.idx = packet.readInt(); - } + @Override + public void readDesc(MCDataInput packet) { + super.readDesc(packet); + this.idx = packet.readInt(); + } - @Override - public void save(NBTTagCompound tag) { - super.save(tag); - tag.setInteger("idx", idx); - } + @Override + public void save(NBTTagCompound tag) { + super.save(tag); + tag.setInteger("idx", idx); + } - @Override - public void load(NBTTagCompound tag) { - super.load(tag); - this.idx = tag.getInteger("idx"); - } + @Override + public void load(NBTTagCompound tag) { + super.load(tag); + this.idx = tag.getInteger("idx"); + } - @Override - public Block getBlock() { - return ChiselBlocks.torches[idx]; - } + @Override + public Block getBlock() { + return ChiselBlocks.torches[idx]; + } - @Override - public String getType() { - return "chisel_torch"; - } + @Override + public String getType() { + return "chisel_torch"; + } } diff --git a/src/main/java/team/chisel/compat/nei/NEIChiselConfig.java b/src/main/java/team/chisel/compat/nei/NEIChiselConfig.java index 88a1e1c0..6592bf15 100644 --- a/src/main/java/team/chisel/compat/nei/NEIChiselConfig.java +++ b/src/main/java/team/chisel/compat/nei/NEIChiselConfig.java @@ -1,33 +1,34 @@ package team.chisel.compat.nei; +import net.minecraft.item.ItemStack; + import team.chisel.Chisel; import team.chisel.client.gui.GuiChisel; -import net.minecraft.item.ItemStack; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; import cpw.mods.fml.common.registry.GameRegistry; public class NEIChiselConfig implements IConfigureNEI { - @Override - public String getName() { - return Chisel.MOD_NAME; - } + @Override + public String getName() { + return Chisel.MOD_NAME; + } - @Override - public String getVersion() { - return Chisel.VERSION; - } + @Override + public String getVersion() { + return Chisel.VERSION; + } - @Override - public void loadConfig() { - API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "limestone_slab_top"))); - API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "marble_slab_top"))); - API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "marble_pillar_slab_top"))); + @Override + public void loadConfig() { + API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "limestone_slab_top"))); + API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "marble_slab_top"))); + API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "marble_pillar_slab_top"))); - RecipeHandlerChisel handler = new RecipeHandlerChisel(); - API.registerRecipeHandler(handler); - API.registerUsageHandler(handler); - API.setGuiOffset(GuiChisel.class, -50, 40); - } + RecipeHandlerChisel handler = new RecipeHandlerChisel(); + API.registerRecipeHandler(handler); + API.registerUsageHandler(handler); + API.setGuiOffset(GuiChisel.class, -50, 40); + } } diff --git a/src/main/java/team/chisel/compat/nei/RecipeHandlerChisel.java b/src/main/java/team/chisel/compat/nei/RecipeHandlerChisel.java index 01e47b72..d71bb936 100644 --- a/src/main/java/team/chisel/compat/nei/RecipeHandlerChisel.java +++ b/src/main/java/team/chisel/compat/nei/RecipeHandlerChisel.java @@ -11,10 +11,6 @@ import net.minecraftforge.oredict.OreDictionary; import org.lwjgl.opengl.GL11; -import com.cricketcraft.chisel.api.carving.CarvingUtils; -import com.cricketcraft.chisel.api.carving.ICarvingGroup; -import com.cricketcraft.chisel.api.carving.ICarvingVariation; - import team.chisel.carving.Carving; import team.chisel.client.gui.GuiChisel; import codechicken.lib.gui.GuiDraw; @@ -22,171 +18,179 @@ import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.TemplateRecipeHandler; +import com.cricketcraft.chisel.api.carving.CarvingUtils; +import com.cricketcraft.chisel.api.carving.ICarvingGroup; +import com.cricketcraft.chisel.api.carving.ICarvingVariation; + public class RecipeHandlerChisel extends TemplateRecipeHandler { - private static final int SLOTS_PER_PAGE = 45; + private static final int SLOTS_PER_PAGE = 45; - public class CachedChiselRecipe extends CachedRecipe { + public class CachedChiselRecipe extends CachedRecipe { - private List input = new ArrayList(); - private List outputs = new ArrayList(); - public Point focus; + private List input = new ArrayList(); + private List outputs = new ArrayList(); + public Point focus; - public CachedChiselRecipe(List variations, ItemStack base, ItemStack focus) { - PositionedStack pStack = new PositionedStack(base != null ? base : variations, 74, 4); - pStack.setMaxSize(1); - this.input.add(pStack); + public CachedChiselRecipe(List variations, ItemStack base, ItemStack focus) { + PositionedStack pStack = new PositionedStack(base != null ? base : variations, 74, 4); + pStack.setMaxSize(1); + this.input.add(pStack); - int row = 0; - int col = 0; - for (ItemStack v : variations) { - this.outputs.add(new PositionedStack(v, 3 + 18 * col, 37 + 18 * row)); + int row = 0; + int col = 0; + for (ItemStack v : variations) { + this.outputs.add(new PositionedStack(v, 3 + 18 * col, 37 + 18 * row)); - if (focus != null && NEIServerUtils.areStacksSameTypeCrafting(focus, v)) { - this.focus = new Point(2 + 18 * col, 36 + 18 * row); - } + if (focus != null && NEIServerUtils.areStacksSameTypeCrafting(focus, v)) { + this.focus = new Point(2 + 18 * col, 36 + 18 * row); + } - col++; - if (col > 8) { - col = 0; - row++; - } - } - } + col++; + if (col > 8) { + col = 0; + row++; + } + } + } - public CachedChiselRecipe(List variations) { - this(variations, null, null); - } + public CachedChiselRecipe(List variations) { + this(variations, null, null); + } - @Override - public List getIngredients() { - return this.getCycledIngredients(cycleticks / 20, this.input); - } + @Override + public List getIngredients() { + return this.getCycledIngredients(cycleticks / 20, this.input); + } - @Override - public List getOtherStacks() { - return this.outputs; - } + @Override + public List getOtherStacks() { + return this.outputs; + } - @Override - public PositionedStack getResult() { - return null; - } - } + @Override + public PositionedStack getResult() { + return null; + } + } - @Override - public String getRecipeName() { - return "Chisel"; - } + @Override + public String getRecipeName() { + return "Chisel"; + } - @Override - public String getGuiTexture() { - return "Chisel:textures/chiselNEI.png"; - } + @Override + public String getGuiTexture() { + return "Chisel:textures/chiselNEI.png"; + } - @Override - public Class getGuiClass() { - return GuiChisel.class; - } + @Override + public Class getGuiClass() { + return GuiChisel.class; + } - @Override - public void drawBackground(int recipeIndex) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 166, 130); + @Override + public void drawBackground(int recipeIndex) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.changeTexture(getGuiTexture()); + GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 166, 130); - Point focus = ((CachedChiselRecipe) this.arecipes.get(recipeIndex)).focus; - if (focus != null) { - GuiDraw.drawTexturedModalRect(focus.x, focus.y, 166, 0, 18, 18); - } - } + Point focus = ((CachedChiselRecipe) this.arecipes.get(recipeIndex)).focus; + if (focus != null) { + GuiDraw.drawTexturedModalRect(focus.x, focus.y, 166, 0, 18, 18); + } + } - @Override - public int recipiesPerPage() { - return 1; - } + @Override + public int recipiesPerPage() { + return 1; + } - @Override - public void loadTransferRects() { - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(75, 22, 15, 13), "chisel2.chisel", new Object[0])); - } + @Override + public void loadTransferRects() { + this.transferRects.add( + new TemplateRecipeHandler.RecipeTransferRect( + new Rectangle(75, 22, 15, 13), + "chisel2.chisel", + new Object[0])); + } - @Override - public void loadCraftingRecipes(String outputId, Object... results) { - if (outputId.equals("chisel2.chisel")) { - for (String name : Carving.chisel.getSortedGroupNames()) { - ICarvingGroup g = Carving.chisel.getGroup(name); - if (!g.getVariations().isEmpty()) { - addCached(getVariationStacks(g)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } + @Override + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals("chisel2.chisel")) { + for (String name : Carving.chisel.getSortedGroupNames()) { + ICarvingGroup g = Carving.chisel.getGroup(name); + if (!g.getVariations().isEmpty()) { + addCached(getVariationStacks(g)); + } + } + } else { + super.loadCraftingRecipes(outputId, results); + } + } - @Override - public void loadCraftingRecipes(ItemStack result) { - for (String name : Carving.chisel.getSortedGroupNames()) { - ICarvingGroup g = Carving.chisel.getGroup(name); - List variations = getVariationStacks(g); - for (ItemStack stack : variations) { - if (NEIServerUtils.areStacksSameTypeCrafting(stack, result)) { - addCached(variations, null, result); - } - } - } - } + @Override + public void loadCraftingRecipes(ItemStack result) { + for (String name : Carving.chisel.getSortedGroupNames()) { + ICarvingGroup g = Carving.chisel.getGroup(name); + List variations = getVariationStacks(g); + for (ItemStack stack : variations) { + if (NEIServerUtils.areStacksSameTypeCrafting(stack, result)) { + addCached(variations, null, result); + } + } + } + } - @Override - public void loadUsageRecipes(ItemStack ingredient) { - for (String name : Carving.chisel.getSortedGroupNames()) { - ICarvingGroup g = Carving.chisel.getGroup(name); - List variations = getVariationStacks(g); - for (ItemStack stack : variations) { - if (NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)) { - addCached(variations, ingredient, null); - } - } - } - } + @Override + public void loadUsageRecipes(ItemStack ingredient) { + for (String name : Carving.chisel.getSortedGroupNames()) { + ICarvingGroup g = Carving.chisel.getGroup(name); + List variations = getVariationStacks(g); + for (ItemStack stack : variations) { + if (NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)) { + addCached(variations, ingredient, null); + } + } + } + } - private void addCached(List variations, ItemStack base, ItemStack focus) { - if (variations.size() > SLOTS_PER_PAGE) { - List> parts = new ArrayList>(); - int size = variations.size(); - for (int i = 0; i < size; i += SLOTS_PER_PAGE) { - parts.add(new ArrayList(variations.subList(i, Math.min(size, i + SLOTS_PER_PAGE)))); - } - for (List part : parts) { - this.arecipes.add(new CachedChiselRecipe(part, base, focus)); - } - } else { - this.arecipes.add(new CachedChiselRecipe(variations, base, focus)); - } - } + private void addCached(List variations, ItemStack base, ItemStack focus) { + if (variations.size() > SLOTS_PER_PAGE) { + List> parts = new ArrayList>(); + int size = variations.size(); + for (int i = 0; i < size; i += SLOTS_PER_PAGE) { + parts.add(new ArrayList(variations.subList(i, Math.min(size, i + SLOTS_PER_PAGE)))); + } + for (List part : parts) { + this.arecipes.add(new CachedChiselRecipe(part, base, focus)); + } + } else { + this.arecipes.add(new CachedChiselRecipe(variations, base, focus)); + } + } - private void addCached(List variations) { - addCached(variations, null, null); - } + private void addCached(List variations) { + addCached(variations, null, null); + } - private static List getVariationStacks(ICarvingGroup g) { - List stacks = new ArrayList(); - for (ICarvingVariation v : g.getVariations()) { - stacks.add(CarvingUtils.getStack(v)); - } - String oreName = g.getOreName(); - if (oreName != null) { - check: for (ItemStack ore : OreDictionary.getOres(oreName)) { - for (ItemStack stack : stacks) { - if (NEIServerUtils.areStacksSameTypeCrafting(stack, ore)) { - continue check; - } - } - stacks.add(ore.copy()); - } - } - return stacks; - } + private static List getVariationStacks(ICarvingGroup g) { + List stacks = new ArrayList(); + for (ICarvingVariation v : g.getVariations()) { + stacks.add(CarvingUtils.getStack(v)); + } + String oreName = g.getOreName(); + if (oreName != null) { + check: for (ItemStack ore : OreDictionary.getOres(oreName)) { + for (ItemStack stack : stacks) { + if (NEIServerUtils.areStacksSameTypeCrafting(stack, ore)) { + continue check; + } + } + stacks.add(ore.copy()); + } + } + return stacks; + } } diff --git a/src/main/java/team/chisel/config/Configurations.java b/src/main/java/team/chisel/config/Configurations.java index 21e08982..c29f12f3 100644 --- a/src/main/java/team/chisel/config/Configurations.java +++ b/src/main/java/team/chisel/config/Configurations.java @@ -15,170 +15,301 @@ import team.chisel.ctmlib.CTM; public class Configurations { - public static Configuration config; + public static Configuration config; - public static boolean configExists; + public static boolean configExists; - public static double concreteVelocityMult; - public static boolean ghostCloud; - public static int factoryBlockAmount; - public static boolean allowMossy; - public static boolean allowSmoothStone; - public static boolean chiselRecipe; - public static boolean enableFMP; - public static boolean chiselStoneToCobbleBricks; - public static boolean chiselBackToVanillaLeaves; + public static double concreteVelocityMult; + public static boolean ghostCloud; + public static int factoryBlockAmount; + public static boolean allowMossy; + public static boolean allowSmoothStone; + public static boolean chiselRecipe; + public static boolean enableFMP; + public static boolean chiselStoneToCobbleBricks; + public static boolean chiselBackToVanillaLeaves; - public static int marbleAmount; - public static int limestoneAmount; - public static int graniteAmount; - public static int dioriteAmount; - public static int andesiteAmount; + public static int marbleAmount; + public static int limestoneAmount; + public static int graniteAmount; + public static int dioriteAmount; + public static int andesiteAmount; - public static int particlesTickrate; - public static boolean oldPillars; - public static boolean disableCTM; - public static boolean connectInsideCTM; - public static boolean blockDescriptions; - public static boolean imTooGoodForDescriptions; + public static int particlesTickrate; + public static boolean oldPillars; + public static boolean disableCTM; + public static boolean connectInsideCTM; + public static boolean blockDescriptions; + public static boolean imTooGoodForDescriptions; - public static boolean allowChiselDamage; - public static int ironChiselMaxDamage; - public static int diamondChiselMaxDamage; - public static int obsidianChiselMaxDamage; - public static int netherStarChiselMaxDamage; - public static boolean ironChiselCanLeftClick; - public static boolean ironChiselHasModes; - public static int ironChiselAttackDamage; - public static int diamondChiselAttackDamage; - public static int obsidianChiselAttackDamage; - public static int netherStarChiselAttackDamage; - public static boolean allowChiselCrossColors; + public static boolean allowChiselDamage; + public static int ironChiselMaxDamage; + public static int diamondChiselMaxDamage; + public static int obsidianChiselMaxDamage; + public static int netherStarChiselMaxDamage; + public static boolean ironChiselCanLeftClick; + public static boolean ironChiselHasModes; + public static int ironChiselAttackDamage; + public static int diamondChiselAttackDamage; + public static int obsidianChiselAttackDamage; + public static int netherStarChiselAttackDamage; + public static boolean allowChiselCrossColors; - public static boolean useRoadLineTool; - public static String getRoadLineTool; - public static int roadLineToolLevel; + public static boolean useRoadLineTool; + public static String getRoadLineTool; + public static int roadLineToolLevel; - public static int[] configColors = new int[ItemDye.field_150923_a.length]; + public static int[] configColors = new int[ItemDye.field_150923_a.length]; - public static boolean fullBlockConcrete; + public static boolean fullBlockConcrete; - public static Map features = new HashMap<>(); + public static Map features = new HashMap<>(); - public static boolean refreshConfig() { + public static boolean refreshConfig() { - String category; + String category; - /* general */ - category = "general"; - concreteVelocityMult = config.get(category, "concreteVelocityMult", 1.35, "The factor that concrete increases your velocity. Default is 1.35, set to 1 for no change.").getDouble(); - fullBlockConcrete = config.get(category, "fullBlockConcrete", false, "Should concrete be a full block. This will also unavoidably disable speed increase if set to true.").getBoolean(false); - ghostCloud = config.get(category, "doesCloudRenderLikeGhost", true).getBoolean(true); - factoryBlockAmount = config.get(category, "amountYouGetFromFactoryBlockCrafting", 32).getInt(32); - allowMossy = config.get(category, "allowBrickToMossyInChisel", true, "If true, you can chisel stone brick to mossy stone brick.").getBoolean(true); - allowSmoothStone = config.get(category, "allowSmoothStoneToStoneBricksAndBack", true).getBoolean(true); - chiselRecipe = config.get(category, "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel").getBoolean(false); - enableFMP = config.get(category, "enableFMP", true, "Do you want to enable FMP").getBoolean(true); - chiselStoneToCobbleBricks = config.get(category, "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false); - chiselBackToVanillaLeaves = config - .get(category, "chiselBackToVanillaLeaves", false, "If this is true, you can chisel from the chisel leaves back to vanilla ones. If it is false, you cannot.").getBoolean(false); + /* general */ + category = "general"; + concreteVelocityMult = config + .get( + category, + "concreteVelocityMult", + 1.35, + "The factor that concrete increases your velocity. Default is 1.35, set to 1 for no change.") + .getDouble(); + fullBlockConcrete = config.get( + category, + "fullBlockConcrete", + false, + "Should concrete be a full block. This will also unavoidably disable speed increase if set to true.") + .getBoolean(false); + ghostCloud = config.get(category, "doesCloudRenderLikeGhost", true).getBoolean(true); + factoryBlockAmount = config.get(category, "amountYouGetFromFactoryBlockCrafting", 32).getInt(32); + allowMossy = config.get( + category, + "allowBrickToMossyInChisel", + true, + "If true, you can chisel stone brick to mossy stone brick.").getBoolean(true); + allowSmoothStone = config.get(category, "allowSmoothStoneToStoneBricksAndBack", true).getBoolean(true); + chiselRecipe = config + .get(category, "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel") + .getBoolean(false); + enableFMP = config.get(category, "enableFMP", true, "Do you want to enable FMP").getBoolean(true); + chiselStoneToCobbleBricks = config.get( + category, + "chiselStoneToCobbleBricks", + true, + "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false); + chiselBackToVanillaLeaves = config.get( + category, + "chiselBackToVanillaLeaves", + false, + "If this is true, you can chisel from the chisel leaves back to vanilla ones. If it is false, you cannot.") + .getBoolean(false); - /* worldgen */ - category = "worldgen"; - marbleAmount = config.get(category, "marbleAmount", 7, "Amount of marble to generate in the world; use 0 for none").getInt(7); - limestoneAmount = config.get(category, "limestoneAmount", 8, "Amount of limestone to generate in the world; use 0 for none").getInt(8); - graniteAmount = config.get(category, "graniteAmount", 8, "Amount of granite to generate in the world; use 0 for none.").getInt(8); - dioriteAmount = config.get(category, "dioriteAmount", 8, "Amount of diorite to generate in the world; use 0 for none.").getInt(8); - andesiteAmount = config.get(category, "andesiteAmount", 8, "Amount of andesite to generate in the world; use 0 for none.").getInt(8); + /* worldgen */ + category = "worldgen"; + marbleAmount = config + .get(category, "marbleAmount", 7, "Amount of marble to generate in the world; use 0 for none") + .getInt(7); + limestoneAmount = config + .get(category, "limestoneAmount", 8, "Amount of limestone to generate in the world; use 0 for none") + .getInt(8); + graniteAmount = config + .get(category, "graniteAmount", 8, "Amount of granite to generate in the world; use 0 for none.") + .getInt(8); + dioriteAmount = config + .get(category, "dioriteAmount", 8, "Amount of diorite to generate in the world; use 0 for none.") + .getInt(8); + andesiteAmount = config + .get(category, "andesiteAmount", 8, "Amount of andesite to generate in the world; use 0 for none.") + .getInt(8); - /* client */ - category = "client"; - particlesTickrate = config.get(category, "particleTickrate", 1, "Particle tick rate. Greater value = less particles.").getInt(1); - oldPillars = config.get(category, "pillarOldGraphics", false, "Use old pillar textures").getBoolean(false); - disableCTM = !config.get(category, "connectedTextures", true, "Enable connected textures").getBoolean(true); - CTM.disableObscuredFaceCheckConfig = connectInsideCTM = config.get(category, "connectInsideCTM", false, - "Choose whether the inside corner is disconnected on a CTM block - http://imgur.com/eUywLZ4").getBoolean(false); - blockDescriptions = config.get(category, "tooltipsUseBlockDescriptions", true, "Make variations of blocks have the same name, and use the description in tooltip to distinguish them.") - .getBoolean(true); - imTooGoodForDescriptions = config.get(category, "imTooGoodForBlockDescriptions", false, "For those people who just hate block descriptions on the world gen!").getBoolean(); + /* client */ + category = "client"; + particlesTickrate = config + .get(category, "particleTickrate", 1, "Particle tick rate. Greater value = less particles.").getInt(1); + oldPillars = config.get(category, "pillarOldGraphics", false, "Use old pillar textures").getBoolean(false); + disableCTM = !config.get(category, "connectedTextures", true, "Enable connected textures").getBoolean(true); + CTM.disableObscuredFaceCheckConfig = connectInsideCTM = config + .get( + category, + "connectInsideCTM", + false, + "Choose whether the inside corner is disconnected on a CTM block - http://imgur.com/eUywLZ4") + .getBoolean(false); + blockDescriptions = config.get( + category, + "tooltipsUseBlockDescriptions", + true, + "Make variations of blocks have the same name, and use the description in tooltip to distinguish them.") + .getBoolean(true); + imTooGoodForDescriptions = config.get( + category, + "imTooGoodForBlockDescriptions", + false, + "For those people who just hate block descriptions on the world gen!").getBoolean(); - /* chisel */ - category = "chisel"; - allowChiselDamage = config.get(category, "allowChiselDamage", true, "Should the chisel be damageable and take damage when it chisels something.").getBoolean(); - ironChiselMaxDamage = config.getInt("ironChiselMaxDamage", category, 500, 1, Short.MAX_VALUE, "The max damage of the standard iron chisel."); - diamondChiselMaxDamage = config.getInt("diamondChiselMaxDamage", category, 5000, 1, Short.MAX_VALUE, "The max damage of the diamond chisel."); - obsidianChiselMaxDamage = config.getInt("obsidianChiselMaxDamage", category, 2500, 1, Short.MAX_VALUE, "The max damage of the obsidian chisel."); - netherStarChiselMaxDamage = config.getInt("netherStarChiselMaxDamage", category, 32767, 1, Short.MAX_VALUE, "The max damage of the nether star chisel."); - ironChiselCanLeftClick = config.get(category, "ironChiselCanLeftClick", true, "If this is true, the iron chisel can left click chisel blocks. If false, it cannot.").getBoolean(); - ironChiselHasModes = config.get(category, "ironChiselHasModes", false, "If this is true, the iron chisel can change its chisel mode just as the diamond chisel can.").getBoolean(); - allowChiselCrossColors = config.get(category, "allowChiselCrossColors", true, "Should someone be able to chisel something into a different color.").getBoolean(); + /* chisel */ + category = "chisel"; + allowChiselDamage = config.get( + category, + "allowChiselDamage", + true, + "Should the chisel be damageable and take damage when it chisels something.").getBoolean(); + ironChiselMaxDamage = config.getInt( + "ironChiselMaxDamage", + category, + 500, + 1, + Short.MAX_VALUE, + "The max damage of the standard iron chisel."); + diamondChiselMaxDamage = config.getInt( + "diamondChiselMaxDamage", + category, + 5000, + 1, + Short.MAX_VALUE, + "The max damage of the diamond chisel."); + obsidianChiselMaxDamage = config.getInt( + "obsidianChiselMaxDamage", + category, + 2500, + 1, + Short.MAX_VALUE, + "The max damage of the obsidian chisel."); + netherStarChiselMaxDamage = config.getInt( + "netherStarChiselMaxDamage", + category, + 32767, + 1, + Short.MAX_VALUE, + "The max damage of the nether star chisel."); + ironChiselCanLeftClick = config + .get( + category, + "ironChiselCanLeftClick", + true, + "If this is true, the iron chisel can left click chisel blocks. If false, it cannot.") + .getBoolean(); + ironChiselHasModes = config + .get( + category, + "ironChiselHasModes", + false, + "If this is true, the iron chisel can change its chisel mode just as the diamond chisel can.") + .getBoolean(); + allowChiselCrossColors = config.get( + category, + "allowChiselCrossColors", + true, + "Should someone be able to chisel something into a different color.").getBoolean(); - ironChiselAttackDamage = config - .get(category, "ironChiselAttackDamage", 2, "The extra attack damage points (in half hearts) that the iron chisel inflicts when it is used to attack an entity.").getInt(); - diamondChiselAttackDamage = config.get(category, "diamondChiselAttackDamage", 2, - "The extra attack damage points (in half hearts) that the diamond chisel inflicts when it is used to attack an entity.").getInt(); - obsidianChiselAttackDamage = config.get(category, "obsidianChiselAttackDamage", 4, - "The extra attack damage points (in half hearts) that the obsidian chisel inflicts when it is used to attack an entity.").getInt(); - netherStarChiselAttackDamage = config.get(category, "netherStarChiselAttackDamage", 6, - "The extra attack damage points (in half hearts) that the nether star chisel inflicts when it is used to attack an entity.").getInt(); + ironChiselAttackDamage = config.get( + category, + "ironChiselAttackDamage", + 2, + "The extra attack damage points (in half hearts) that the iron chisel inflicts when it is used to attack an entity.") + .getInt(); + diamondChiselAttackDamage = config.get( + category, + "diamondChiselAttackDamage", + 2, + "The extra attack damage points (in half hearts) that the diamond chisel inflicts when it is used to attack an entity.") + .getInt(); + obsidianChiselAttackDamage = config.get( + category, + "obsidianChiselAttackDamage", + 4, + "The extra attack damage points (in half hearts) that the obsidian chisel inflicts when it is used to attack an entity.") + .getInt(); + netherStarChiselAttackDamage = config.get( + category, + "netherStarChiselAttackDamage", + 6, + "The extra attack damage points (in half hearts) that the nether star chisel inflicts when it is used to attack an entity.") + .getInt(); - /* block */ - category = "block"; - useRoadLineTool = config.get(category, "useRoadLineTool", false, "Should the road line require a tool to break (If false, road lines can be broken in Adventure)").getBoolean(); - getRoadLineTool = config.get(category, "getRoadLineTool", "pickaxe", "The tool that is able to break roadLines (requires useRoadLineTool to be true to take effect)").getString(); - roadLineToolLevel = config.get(category, "roadLineToolLevel", 0, - "The lowest harvest level of the tool able to break the road lines (requires useRoadLineTool to be true to take effect) (0 = Wood/Gold, 1 = Stone, 2 = Iron, 3 = Diamond) Default: 0") - .getInt(); + /* block */ + category = "block"; + useRoadLineTool = config.get( + category, + "useRoadLineTool", + false, + "Should the road line require a tool to break (If false, road lines can be broken in Adventure)") + .getBoolean(); + getRoadLineTool = config + .get( + category, + "getRoadLineTool", + "pickaxe", + "The tool that is able to break roadLines (requires useRoadLineTool to be true to take effect)") + .getString(); + roadLineToolLevel = config.get( + category, + "roadLineToolLevel", + 0, + "The lowest harvest level of the tool able to break the road lines (requires useRoadLineTool to be true to take effect) (0 = Wood/Gold, 1 = Stone, 2 = Iron, 3 = Diamond) Default: 0") + .getInt(); - /* hexColors */ - category = "hexColors"; + /* hexColors */ + category = "hexColors"; - for (int i = 0; i < ItemDye.field_150923_a.length; i++) { - // tterrag... don't kill me over this formatting. - String temp = config.get(category, "hex" + ItemDye.field_150923_a[i], "#" + Integer.toHexString(ItemDye.field_150922_c[i]), - Character.toUpperCase(ItemDye.field_150923_a[i].charAt(0)) + ItemDye.field_150923_a[i].substring(1) + " color for hex block overlay #RRGGBB").getString(); - // Or this - try { - configColors[i] = Integer.decode(temp); - } catch (NumberFormatException e) { - Chisel.logger.warn("Configuration error, " + temp + " was not recognized as a color. Using default: #" + Integer.toHexString(ItemDye.field_150922_c[i])); - configColors[i] = ItemDye.field_150922_c[i]; - } - } + for (int i = 0; i < ItemDye.field_150923_a.length; i++) { + // tterrag... don't kill me over this formatting. + String temp = config.get( + category, + "hex" + ItemDye.field_150923_a[i], + "#" + Integer.toHexString(ItemDye.field_150922_c[i]), + Character.toUpperCase(ItemDye.field_150923_a[i].charAt(0)) + ItemDye.field_150923_a[i].substring(1) + + " color for hex block overlay #RRGGBB") + .getString(); + // Or this + try { + configColors[i] = Integer.decode(temp); + } catch (NumberFormatException e) { + Chisel.logger.warn( + "Configuration error, " + temp + + " was not recognized as a color. Using default: #" + + Integer.toHexString(ItemDye.field_150922_c[i])); + configColors[i] = ItemDye.field_150922_c[i]; + } + } - /* features */ - for (Features feature : Features.values()) { - features.put(featureName(feature), config.get("features", featureName(feature), true).getBoolean(true)); - } + /* features */ + for (Features feature : Features.values()) { + features.put(featureName(feature), config.get("features", featureName(feature), true).getBoolean(true)); + } - if (config.hasChanged()) { - config.save(); - } - return true; - } + if (config.hasChanged()) { + config.save(); + } + return true; + } - public static boolean featureEnabled(Features feature) { - return features.getOrDefault(featureName(feature), false); - } + public static boolean featureEnabled(Features feature) { + return features.getOrDefault(featureName(feature), false); + } - /** - * Makes the old camelCase names from the new CONSTANT_CASE names - */ - public static String featureName(Features feature) { - String[] words = feature.name().toLowerCase(Locale.ENGLISH).split("_"); - if (words.length == 1) { - return words[0]; - } + /** + * Makes the old camelCase names from the new CONSTANT_CASE names + */ + public static String featureName(Features feature) { + String[] words = feature.name().toLowerCase(Locale.ENGLISH).split("_"); + if (words.length == 1) { + return words[0]; + } - String ret = words[0]; - for (int i = 1; i < words.length; i++) { - ret += StringUtils.capitalize(words[i]); - } - return ret; - } + String ret = words[0]; + for (int i = 1; i < words.length; i++) { + ret += StringUtils.capitalize(words[i]); + } + return ret; + } - @Deprecated - public static boolean featureEnabled(String feature) { - return false; - } + @Deprecated + public static boolean featureEnabled(String feature) { + return false; + } } diff --git a/src/main/java/team/chisel/entity/EntityBallOMoss.java b/src/main/java/team/chisel/entity/EntityBallOMoss.java index 5d4ae5a0..8b756786 100644 --- a/src/main/java/team/chisel/entity/EntityBallOMoss.java +++ b/src/main/java/team/chisel/entity/EntityBallOMoss.java @@ -1,9 +1,5 @@ package team.chisel.entity; -import team.chisel.Chisel; -import team.chisel.client.GeneralChiselClient; -import team.chisel.init.ChiselBlocks; -import team.chisel.utils.General; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; @@ -11,98 +7,99 @@ import net.minecraft.init.Blocks; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import team.chisel.Chisel; +import team.chisel.client.GeneralChiselClient; +import team.chisel.init.ChiselBlocks; +import team.chisel.utils.General; + public class EntityBallOMoss extends EntityThrowable { - public EntityBallOMoss(World par1World) { - super(par1World); - } + public EntityBallOMoss(World par1World) { + super(par1World); + } - public EntityBallOMoss(World par1World, EntityLivingBase par2EntityLiving) { - super(par1World, par2EntityLiving); - } + public EntityBallOMoss(World par1World, EntityLivingBase par2EntityLiving) { + super(par1World, par2EntityLiving); + } - public EntityBallOMoss(World par1World, double x, double y, double z) { - super(par1World, x, y, z); - } + public EntityBallOMoss(World par1World, double x, double y, double z) { + super(par1World, x, y, z); + } - @Override - protected void onImpact(MovingObjectPosition movingobjectposition) { - int x = movingobjectposition.blockX; - int y = movingobjectposition.blockY; - int z = movingobjectposition.blockZ; + @Override + protected void onImpact(MovingObjectPosition movingobjectposition) { + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; - switch (movingobjectposition.sideHit) { - case 0: - y--; - break; - case 1: - y++; - break; - case 2: - z--; - break; - case 3: - z++; - break; - case 4: - x--; - break; - case 5: - x++; - break; - } + switch (movingobjectposition.sideHit) { + case 0: + y--; + break; + case 1: + y++; + break; + case 2: + z--; + break; + case 3: + z++; + break; + case 4: + x--; + break; + case 5: + x++; + break; + } - setDead(); + setDead(); - if (worldObj.isRemote) { - worldObj.playSound(x, y, z, Chisel.MOD_ID + ":random.squash", 1.0f, 1.0f, false); + if (worldObj.isRemote) { + worldObj.playSound(x, y, z, Chisel.MOD_ID + ":random.squash", 1.0f, 1.0f, false); - for (int i = 0; i < 32; i++) - GeneralChiselClient.spawnBallOMossFX(worldObj, posX, posY, posZ); + for (int i = 0; i < 32; i++) GeneralChiselClient.spawnBallOMossFX(worldObj, posX, posY, posZ); - return; - } + return; + } - int radius = 5; - int falloff = 3; + int radius = 5; + int falloff = 3; - for (int xx = -radius; xx < radius; xx++) { - for (int yy = -radius; yy < radius; yy++) { - for (int zz = -radius; zz < radius; zz++) { - double dist = (xx < 0 ? -xx : xx) + (yy < 0 ? -yy : yy) + (zz < 0 ? -zz : zz); + for (int xx = -radius; xx < radius; xx++) { + for (int yy = -radius; yy < radius; yy++) { + for (int zz = -radius; zz < radius; zz++) { + double dist = (xx < 0 ? -xx : xx) + (yy < 0 ? -yy : yy) + (zz < 0 ? -zz : zz); - if (!(dist < falloff || General.rand.nextInt(radius * 3 - falloff) >= dist * 2)) - continue; + if (!(dist < falloff || General.rand.nextInt(radius * 3 - falloff) >= dist * 2)) continue; - if (!worldObj.isRemote) - turnToMoss(worldObj, x + xx, y + yy, z + zz); - } - } - } + if (!worldObj.isRemote) turnToMoss(worldObj, x + xx, y + yy, z + zz); + } + } + } - } + } - public static void turnToMoss(World world, int x, int y, int z) { - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - Block resBlock = block; - int resMeta = meta; + public static void turnToMoss(World world, int x, int y, int z) { + Block block = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + Block resBlock = block; + int resMeta = meta; - if (block.equals(Blocks.cobblestone)) { - resBlock = Blocks.mossy_cobblestone; - } else if (block.equals(Blocks.cobblestone_wall) && meta == 0) { - resMeta = 1; - } else if (block.equals(ChiselBlocks.cobblestone)) { - resBlock = ChiselBlocks.mossy_cobblestone; - } else if (block.equals(ChiselBlocks.templeblock)) { - resBlock = ChiselBlocks.mossy_templeblock; - } else if (block.equals(Blocks.stonebrick)) { - resMeta = 1; - } + if (block.equals(Blocks.cobblestone)) { + resBlock = Blocks.mossy_cobblestone; + } else if (block.equals(Blocks.cobblestone_wall) && meta == 0) { + resMeta = 1; + } else if (block.equals(ChiselBlocks.cobblestone)) { + resBlock = ChiselBlocks.mossy_cobblestone; + } else if (block.equals(ChiselBlocks.templeblock)) { + resBlock = ChiselBlocks.mossy_templeblock; + } else if (block.equals(Blocks.stonebrick)) { + resMeta = 1; + } - if (resBlock.equals(block) && resMeta == meta) - return; - world.setBlock(x, y, z, resBlock, resMeta, 3); - } + if (resBlock.equals(block) && resMeta == meta) return; + world.setBlock(x, y, z, resBlock, resMeta, 3); + } } diff --git a/src/main/java/team/chisel/entity/EntityChiselSnowman.java b/src/main/java/team/chisel/entity/EntityChiselSnowman.java index 799037de..26be3f8a 100644 --- a/src/main/java/team/chisel/entity/EntityChiselSnowman.java +++ b/src/main/java/team/chisel/entity/EntityChiselSnowman.java @@ -5,9 +5,9 @@ import net.minecraft.world.World; public class EntityChiselSnowman extends EntitySnowman { - public EntityChiselSnowman(World world) { - super(world); - } + public EntityChiselSnowman(World world) { + super(world); + } - // No special features just needed to get around the hardcoding + // No special features just needed to get around the hardcoding } diff --git a/src/main/java/team/chisel/entity/EntityCloudInABottle.java b/src/main/java/team/chisel/entity/EntityCloudInABottle.java index bbaef2e3..665d369e 100644 --- a/src/main/java/team/chisel/entity/EntityCloudInABottle.java +++ b/src/main/java/team/chisel/entity/EntityCloudInABottle.java @@ -2,110 +2,115 @@ package team.chisel.entity; import java.util.Random; -import team.chisel.init.ChiselBlocks; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import team.chisel.init.ChiselBlocks; + public class EntityCloudInABottle extends EntityThrowable { - Random rand = new Random(); + Random rand = new Random(); - public EntityCloudInABottle(World par1World) { - super(par1World); - } + public EntityCloudInABottle(World par1World) { + super(par1World); + } - public EntityCloudInABottle(World par1World, EntityLivingBase par2EntityLiving) { - super(par1World, par2EntityLiving); - } + public EntityCloudInABottle(World par1World, EntityLivingBase par2EntityLiving) { + super(par1World, par2EntityLiving); + } - public EntityCloudInABottle(World par1World, double x, double y, double z) { - super(par1World, x, y, z); - } + public EntityCloudInABottle(World par1World, double x, double y, double z) { + super(par1World, x, y, z); + } - @Override - protected void onImpact(MovingObjectPosition movingobjectposition) { - if (worldObj.isRemote) - return; + @Override + protected void onImpact(MovingObjectPosition movingobjectposition) { + if (worldObj.isRemote) return; - int x = movingobjectposition.blockX; - int y = movingobjectposition.blockY; - int z = movingobjectposition.blockZ; + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; - switch (movingobjectposition.sideHit) { - case 0: - y--; - break; - case 1: - y++; - break; - case 2: - z--; - break; - case 3: - z++; - break; - case 4: - x--; - break; - case 5: - x++; - break; - } + switch (movingobjectposition.sideHit) { + case 0: + y--; + break; + case 1: + y++; + break; + case 2: + z--; + break; + case 3: + z++; + break; + case 4: + x--; + break; + case 5: + x++; + break; + } - generate(worldObj, rand, x, y, z, 40); + generate(worldObj, rand, x, y, z, 40); - worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), 2); - setDead(); - } + worldObj.playAuxSFX( + 2002, + (int) Math.round(this.posX), + (int) Math.round(this.posY), + (int) Math.round(this.posZ), + 2); + setDead(); + } - public boolean generate(World world, Random random, int gx, int gy, int gz, int numberOfBlocks) { - int X[] = new int[9]; - int Y[] = new int[9]; - int Z[] = new int[9]; + public boolean generate(World world, Random random, int gx, int gy, int gz, int numberOfBlocks) { + int X[] = new int[9]; + int Y[] = new int[9]; + int Z[] = new int[9]; - for (int dir = 0; dir < 9; dir++) { - X[dir] = gx; - Y[dir] = gy; - Z[dir] = gz; - } - int count = 0; - while (count < numberOfBlocks) { - for (int dir = 0; dir < 9; dir++) { - if (count >= numberOfBlocks) - break; + for (int dir = 0; dir < 9; dir++) { + X[dir] = gx; + Y[dir] = gy; + Z[dir] = gz; + } + int count = 0; + while (count < numberOfBlocks) { + for (int dir = 0; dir < 9; dir++) { + if (count >= numberOfBlocks) break; - int dx = dir % 3 - 1; - int dz = dir / 3 - 1; + int dx = dir % 3 - 1; + int dz = dir / 3 - 1; - if (dx == 0 && dz == 0) - continue; + if (dx == 0 && dz == 0) continue; - X[dir] += random.nextInt(3) - 1 + dx; - Z[dir] += random.nextInt(3) - 1 + dz; - Y[dir] += random.nextInt(2) * (random.nextInt(3) - 1); + X[dir] += random.nextInt(3) - 1 + dx; + Z[dir] += random.nextInt(3) - 1 + dz; + Y[dir] += random.nextInt(2) * (random.nextInt(3) - 1); - int x = X[dir]; - int y = Y[dir]; - int z = Z[dir]; + int x = X[dir]; + int y = Y[dir]; + int z = Z[dir]; - for (int j2 = x; j2 < x + random.nextInt(4) + 1; j2++) { - for (int k2 = y; k2 < y + random.nextInt(1) + 2; k2++) { - for (int l2 = z; l2 < z + random.nextInt(4) + 1; l2++) { - if (world.getBlock(j2, k2, l2).isAir(world, j2, k2, l2) && Math.abs(j2 - x) + Math.abs(k2 - y) + Math.abs(l2 - z) < 4 * 1 + random.nextInt(2)) { - world.setBlock(j2, k2, l2, ChiselBlocks.cloud); - count++; - } - } - } - } - } - } + for (int j2 = x; j2 < x + random.nextInt(4) + 1; j2++) { + for (int k2 = y; k2 < y + random.nextInt(1) + 2; k2++) { + for (int l2 = z; l2 < z + random.nextInt(4) + 1; l2++) { + if (world.getBlock(j2, k2, l2).isAir(world, j2, k2, l2) + && Math.abs(j2 - x) + Math.abs(k2 - y) + Math.abs(l2 - z) + < 4 * 1 + random.nextInt(2)) { + world.setBlock(j2, k2, l2, ChiselBlocks.cloud); + count++; + } + } + } + } + } + } - // System.out.println("Created " + count + " cloud blocks."); + // System.out.println("Created " + count + " cloud blocks."); - return true; - } + return true; + } } diff --git a/src/main/java/team/chisel/entity/EntitySmashingRock.java b/src/main/java/team/chisel/entity/EntitySmashingRock.java index 5a8976aa..f92f1ee6 100644 --- a/src/main/java/team/chisel/entity/EntitySmashingRock.java +++ b/src/main/java/team/chisel/entity/EntitySmashingRock.java @@ -1,6 +1,5 @@ package team.chisel.entity; -import team.chisel.utils.General; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; @@ -8,96 +7,95 @@ import net.minecraft.init.Blocks; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import team.chisel.utils.General; + public class EntitySmashingRock extends EntityThrowable { - public EntitySmashingRock(World par1World) { - super(par1World); - } + public EntitySmashingRock(World par1World) { + super(par1World); + } - public EntitySmashingRock(World par1World, EntityLivingBase par2EntityLiving) { - super(par1World, par2EntityLiving); - } + public EntitySmashingRock(World par1World, EntityLivingBase par2EntityLiving) { + super(par1World, par2EntityLiving); + } - public EntitySmashingRock(World par1World, double x, double y, double z) { - super(par1World, x, y, z); - } + public EntitySmashingRock(World par1World, double x, double y, double z) { + super(par1World, x, y, z); + } - @Override - protected void onImpact(MovingObjectPosition movingobjectposition) { - int x = movingobjectposition.blockX; - int y = movingobjectposition.blockY; - int z = movingobjectposition.blockZ; + @Override + protected void onImpact(MovingObjectPosition movingobjectposition) { + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; - switch (movingobjectposition.sideHit) { - case 0: - y--; - break; - case 1: - y++; - break; - case 2: - z--; - break; - case 3: - z++; - break; - case 4: - x--; - break; - case 5: - x++; - break; - } + switch (movingobjectposition.sideHit) { + case 0: + y--; + break; + case 1: + y++; + break; + case 2: + z--; + break; + case 3: + z++; + break; + case 4: + x--; + break; + case 5: + x++; + break; + } - setDead(); + setDead(); - if (worldObj.isRemote) { - worldObj.playSound(x, y, z, "chisel:squash", 1.0f, 1.0f, false); + if (worldObj.isRemote) { + worldObj.playSound(x, y, z, "chisel:squash", 1.0f, 1.0f, false); - // for(int i = 0; i < 32; i++) - // GeneralChiselClient.spawn + // for(int i = 0; i < 32; i++) + // GeneralChiselClient.spawn - return; - } + return; + } - int radius = 5; - int falloff = 3; + int radius = 5; + int falloff = 3; - for (int xx = -radius; xx < radius; xx++) { - for (int yy = -radius; yy < radius; yy++) { - for (int zz = -radius; zz < radius; zz++) { - double dist = (xx < 0 ? -xx : xx) + (yy < 0 ? -yy : yy) + (zz < 0 ? -zz : zz); + for (int xx = -radius; xx < radius; xx++) { + for (int yy = -radius; yy < radius; yy++) { + for (int zz = -radius; zz < radius; zz++) { + double dist = (xx < 0 ? -xx : xx) + (yy < 0 ? -yy : yy) + (zz < 0 ? -zz : zz); - if (!(dist < falloff || General.rand.nextInt(radius * 3 - falloff) >= dist * 2)) - continue; + if (!(dist < falloff || General.rand.nextInt(radius * 3 - falloff) >= dist * 2)) continue; - if (!worldObj.isRemote) - smash(worldObj, x + xx, y + yy, z + zz); - } - } - } + if (!worldObj.isRemote) smash(worldObj, x + xx, y + yy, z + zz); + } + } + } - } + } - public static void smash(World world, int x, int y, int z) { - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - Block resBlock = block; - int resMeta = meta; + public static void smash(World world, int x, int y, int z) { + Block block = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + Block resBlock = block; + int resMeta = meta; - if (block.equals(Blocks.stone)) { - resBlock = Blocks.cobblestone; - } else if (block.equals(Blocks.stonebrick) && meta == 0) { - resMeta = 2; - } else if (block.equals(Blocks.cobblestone)) { - resBlock = Blocks.gravel; - } else if (block.equals(Blocks.gravel)) { - resBlock = Blocks.sand; - } + if (block.equals(Blocks.stone)) { + resBlock = Blocks.cobblestone; + } else if (block.equals(Blocks.stonebrick) && meta == 0) { + resMeta = 2; + } else if (block.equals(Blocks.cobblestone)) { + resBlock = Blocks.gravel; + } else if (block.equals(Blocks.gravel)) { + resBlock = Blocks.sand; + } - if (resBlock.equals(block) && resMeta == meta) - return; - world.setBlock(x, y, z, resBlock, resMeta, 3); - } + if (resBlock.equals(block) && resMeta == meta) return; + world.setBlock(x, y, z, resBlock, resMeta, 3); + } -} \ No newline at end of file +} diff --git a/src/main/java/team/chisel/entity/fx/EntityBallOMossFX.java b/src/main/java/team/chisel/entity/fx/EntityBallOMossFX.java index 33291149..1601fcc5 100644 --- a/src/main/java/team/chisel/entity/fx/EntityBallOMossFX.java +++ b/src/main/java/team/chisel/entity/fx/EntityBallOMossFX.java @@ -15,123 +15,123 @@ import cpw.mods.fml.relauncher.SideOnly; public class EntityBallOMossFX extends EntityFX { - BlockSnakestoneObsidian block; - double tx, ty, tz; - double speed; + BlockSnakestoneObsidian block; + double tx, ty, tz; + double speed; - float u0, u1, v0, v1; - IIcon icon; - IIcon iconPlus = new IIcon() { + float u0, u1, v0, v1; + IIcon icon; + IIcon iconPlus = new IIcon() { - @Override - @SideOnly(Side.CLIENT) - public int getIconWidth() { - return 0; - } + @Override + @SideOnly(Side.CLIENT) + public int getIconWidth() { + return 0; + } - @Override - @SideOnly(Side.CLIENT) - public int getIconHeight() { - return 0; - } + @Override + @SideOnly(Side.CLIENT) + public int getIconHeight() { + return 0; + } - @Override - @SideOnly(Side.CLIENT) - public float getMinU() { - return u0; - } + @Override + @SideOnly(Side.CLIENT) + public float getMinU() { + return u0; + } - @Override - @SideOnly(Side.CLIENT) - public float getMaxU() { - return u1; - } + @Override + @SideOnly(Side.CLIENT) + public float getMaxU() { + return u1; + } - @Override - @SideOnly(Side.CLIENT) - public float getInterpolatedU(double d0) { - return (float) (u0 + d0 * (u1 - u0) / 16.0f); - } + @Override + @SideOnly(Side.CLIENT) + public float getInterpolatedU(double d0) { + return (float) (u0 + d0 * (u1 - u0) / 16.0f); + } - @Override - @SideOnly(Side.CLIENT) - public float getMinV() { - return v0; - } + @Override + @SideOnly(Side.CLIENT) + public float getMinV() { + return v0; + } - @Override - @SideOnly(Side.CLIENT) - public float getMaxV() { - return v1; - } + @Override + @SideOnly(Side.CLIENT) + public float getMaxV() { + return v1; + } - @Override - @SideOnly(Side.CLIENT) - public float getInterpolatedV(double d0) { - return (float) (v0 + d0 * (v1 - v0) / 16.0f); - } + @Override + @SideOnly(Side.CLIENT) + public float getInterpolatedV(double d0) { + return (float) (v0 + d0 * (v1 - v0) / 16.0f); + } - @Override - @SideOnly(Side.CLIENT) - public String getIconName() { - return ""; - } + @Override + @SideOnly(Side.CLIENT) + public String getIconName() { + return ""; + } - }; + }; - public EntityBallOMossFX(World world, double x, double y, double z) { - super(world, x, y + 0.5, z, 0, 0, 0); + public EntityBallOMossFX(World world, double x, double y, double z) { + super(world, x, y + 0.5, z, 0, 0, 0); - particleScale = 0.5f + 0.5f * General.rand.nextFloat(); - speed = 0.4 + 0.4 * General.rand.nextDouble(); + particleScale = 0.5f + 0.5f * General.rand.nextFloat(); + speed = 0.4 + 0.4 * General.rand.nextDouble(); - particleMaxAge = (int) (General.rand.nextDouble() * 10.0) + 5; - if (General.rand.nextInt(10) == 0) - particleMaxAge += General.rand.nextDouble() * 40.0; + particleMaxAge = (int) (General.rand.nextDouble() * 10.0) + 5; + if (General.rand.nextInt(10) == 0) particleMaxAge += General.rand.nextDouble() * 40.0; - motionX = (General.rand.nextDouble() - 0.5) * 0.7; - motionY = (General.rand.nextDouble() * 0.5) * 0.7; - motionZ = (General.rand.nextDouble() - 0.5) * 0.7; - particleGravity = 2.0f; + motionX = (General.rand.nextDouble() - 0.5) * 0.7; + motionY = (General.rand.nextDouble() * 0.5) * 0.7; + motionZ = (General.rand.nextDouble() - 0.5) * 0.7; + particleGravity = 2.0f; - // setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]); + // setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]); - icon = ChiselItems.ballomoss.getIconFromDamage(0); - float width = 4.0f + General.rand.nextFloat() * 8.0f; - float uu = General.rand.nextFloat() * (16.0f - width); - float vv = General.rand.nextFloat() * (16.0f - width); - u0 = icon.getInterpolatedU(uu); - u1 = icon.getInterpolatedU(uu + width); - v0 = icon.getInterpolatedV(vv); - v1 = icon.getInterpolatedV(vv + width); + icon = ChiselItems.ballomoss.getIconFromDamage(0); + float width = 4.0f + General.rand.nextFloat() * 8.0f; + float uu = General.rand.nextFloat() * (16.0f - width); + float vv = General.rand.nextFloat() * (16.0f - width); + u0 = icon.getInterpolatedU(uu); + u1 = icon.getInterpolatedU(uu + width); + v0 = icon.getInterpolatedV(vv); + v1 = icon.getInterpolatedV(vv + width); - setParticleIcon(iconPlus); - } + setParticleIcon(iconPlus); + } - @Override - public int getFXLayer() { - return 2; - } + @Override + public int getFXLayer() { + return 2; + } - @Override - public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) { - GL11.glDepthMask(false); - GL11.glEnable(3042); - GL11.glBlendFunc(770, 771); - super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY); - } + @Override + public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, + float rotYZ, float rotXY) { + GL11.glDepthMask(false); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY); + } - @Override - public void onUpdate() { - super.onUpdate(); + @Override + public void onUpdate() { + super.onUpdate(); - double remaining = particleMaxAge - particleAge; + double remaining = particleMaxAge - particleAge; - if (remaining < 5) { - particleAlpha = (float) (remaining / 5.0); - } else { - particleAlpha = 1.0f; - } - } + if (remaining < 5) { + particleAlpha = (float) (remaining / 5.0); + } else { + particleAlpha = 1.0f; + } + } } diff --git a/src/main/java/team/chisel/entity/fx/EntityGrimstoneFX.java b/src/main/java/team/chisel/entity/fx/EntityGrimstoneFX.java index 585980ee..c396832d 100644 --- a/src/main/java/team/chisel/entity/fx/EntityGrimstoneFX.java +++ b/src/main/java/team/chisel/entity/fx/EntityGrimstoneFX.java @@ -1,60 +1,59 @@ package team.chisel.entity.fx; -import team.chisel.block.BlockGrimstone; -import team.chisel.utils.General; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.World; +import team.chisel.block.BlockGrimstone; +import team.chisel.utils.General; + public class EntityGrimstoneFX extends EntityFX { - float initialScale; - float angleOffset; - static final float fadetime = 20f; + float initialScale; + float angleOffset; + static final float fadetime = 20f; - public EntityGrimstoneFX(World world, BlockGrimstone block, double x, double y, double z) { - super(world, x, y, z, 0, 0, 0); + public EntityGrimstoneFX(World world, BlockGrimstone block, double x, double y, double z) { + super(world, x, y, z, 0, 0, 0); - initialScale = 1.0f + 1.0f * General.rand.nextFloat(); - angleOffset = rand.nextFloat() * 360; + initialScale = 1.0f + 1.0f * General.rand.nextFloat(); + angleOffset = rand.nextFloat() * 360; - particleMaxAge = (int) (Math.random() * 10.0D) + 80; + particleMaxAge = (int) (Math.random() * 10.0D) + 80; - setPosition(x, y, z); - prevPosX = posX; - prevPosY = posY; - prevPosZ = posZ; + setPosition(x, y, z); + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; - noClip = true; + noClip = true; - setParticleIcon(block.iconStar); - } + setParticleIcon(block.iconStar); + } - @Override - public int getFXLayer() { - return 1; - } + @Override + public int getFXLayer() { + return 1; + } - @Override - public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) { - particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f); + @Override + public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, + float rotYZ, float rotXY) { + particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f); - if (particleAge < fadetime) - particleAlpha = particleAge / fadetime; - else if (particleAge + fadetime >= particleMaxAge) - particleAlpha = (particleMaxAge - particleAge) / fadetime; - else - particleAlpha = 1.0f; + if (particleAge < fadetime) particleAlpha = particleAge / fadetime; + else if (particleAge + fadetime >= particleMaxAge) particleAlpha = (particleMaxAge - particleAge) / fadetime; + else particleAlpha = 1.0f; - super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY); + super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY); - } + } - @Override - public void onUpdate() { - if (particleAge++ >= particleMaxAge) { - setDead(); - } + @Override + public void onUpdate() { + if (particleAge++ >= particleMaxAge) { + setDead(); + } - } + } } diff --git a/src/main/java/team/chisel/entity/fx/EntityHolystoneFX.java b/src/main/java/team/chisel/entity/fx/EntityHolystoneFX.java index d2d79c15..e61d814d 100644 --- a/src/main/java/team/chisel/entity/fx/EntityHolystoneFX.java +++ b/src/main/java/team/chisel/entity/fx/EntityHolystoneFX.java @@ -1,60 +1,59 @@ package team.chisel.entity.fx; -import team.chisel.block.BlockHolystone; -import team.chisel.utils.General; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.World; +import team.chisel.block.BlockHolystone; +import team.chisel.utils.General; + public class EntityHolystoneFX extends EntityFX { - float initialScale; - float angleOffset; - static final float fadetime = 20f; + float initialScale; + float angleOffset; + static final float fadetime = 20f; - public EntityHolystoneFX(World world, BlockHolystone block, double x, double y, double z) { - super(world, x, y, z, 0, 0, 0); + public EntityHolystoneFX(World world, BlockHolystone block, double x, double y, double z) { + super(world, x, y, z, 0, 0, 0); - initialScale = 1.0f + 1.0f * General.rand.nextFloat(); - angleOffset = rand.nextFloat() * 360; + initialScale = 1.0f + 1.0f * General.rand.nextFloat(); + angleOffset = rand.nextFloat() * 360; - particleMaxAge = (int) (Math.random() * 10.0D) + 80; + particleMaxAge = (int) (Math.random() * 10.0D) + 80; - setPosition(x, y, z); - prevPosX = posX; - prevPosY = posY; - prevPosZ = posZ; + setPosition(x, y, z); + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; - noClip = true; + noClip = true; - setParticleIcon(block.iconStar); - } + setParticleIcon(block.iconStar); + } - @Override - public int getFXLayer() { - return 1; - } + @Override + public int getFXLayer() { + return 1; + } - @Override - public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) { - particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f); + @Override + public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, + float rotYZ, float rotXY) { + particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f); - if (particleAge < fadetime) - particleAlpha = particleAge / fadetime; - else if (particleAge + fadetime >= particleMaxAge) - particleAlpha = (particleMaxAge - particleAge) / fadetime; - else - particleAlpha = 1.0f; + if (particleAge < fadetime) particleAlpha = particleAge / fadetime; + else if (particleAge + fadetime >= particleMaxAge) particleAlpha = (particleMaxAge - particleAge) / fadetime; + else particleAlpha = 1.0f; - super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY); + super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY); - } + } - @Override - public void onUpdate() { - if (particleAge++ >= particleMaxAge) { - setDead(); - } + @Override + public void onUpdate() { + if (particleAge++ >= particleMaxAge) { + setDead(); + } - } + } } diff --git a/src/main/java/team/chisel/entity/fx/EntitySnakestoneObsidianFX.java b/src/main/java/team/chisel/entity/fx/EntitySnakestoneObsidianFX.java index 43bb7af5..8f40d3d0 100644 --- a/src/main/java/team/chisel/entity/fx/EntitySnakestoneObsidianFX.java +++ b/src/main/java/team/chisel/entity/fx/EntitySnakestoneObsidianFX.java @@ -11,107 +11,109 @@ import team.chisel.utils.General; public class EntitySnakestoneObsidianFX extends EntityFX { - BlockSnakestoneObsidian block; - double tx, ty, tz; - double speed; + BlockSnakestoneObsidian block; + double tx, ty, tz; + double speed; - public EntitySnakestoneObsidianFX(World world, BlockSnakestoneObsidian b, int x, int y, int z) { - super(world, x + 0.5, y + 0.5, z + 0.5, 0, 0, 0); + public EntitySnakestoneObsidianFX(World world, BlockSnakestoneObsidian b, int x, int y, int z) { + super(world, x + 0.5, y + 0.5, z + 0.5, 0, 0, 0); - block = b; + block = b; - particleScale = 0.5f + 0.5f * General.rand.nextFloat(); - speed = 0.04 + 0.04 * General.rand.nextDouble(); + particleScale = 0.5f + 0.5f * General.rand.nextFloat(); + speed = 0.04 + 0.04 * General.rand.nextDouble(); - particleMaxAge = (int) (Math.random() * 10.0D) + 40; + particleMaxAge = (int) (Math.random() * 10.0D) + 40; - tx = x + General.rand.nextDouble(); - ty = y + General.rand.nextDouble(); - tz = z + General.rand.nextDouble(); - switch (General.rand.nextInt(6)) { - case 0: - tx = x; - break; - case 1: - tx = x + 1; - break; - case 2: - ty = y; - break; - case 3: - ty = y + 1; - break; - case 4: - tz = z; - break; - case 5: - tz = z + 1; - break; - } + tx = x + General.rand.nextDouble(); + ty = y + General.rand.nextDouble(); + tz = z + General.rand.nextDouble(); + switch (General.rand.nextInt(6)) { + case 0: + tx = x; + break; + case 1: + tx = x + 1; + break; + case 2: + ty = y; + break; + case 3: + ty = y + 1; + break; + case 4: + tz = z; + break; + case 5: + tz = z + 1; + break; + } - double dx = (tx - posX) * 3; - double dy = (ty - posY) * 3; - double dz = (tz - posZ) * 3; + double dx = (tx - posX) * 3; + double dy = (ty - posY) * 3; + double dz = (tz - posZ) * 3; - setPosition(posX + dx, posY + dy, posZ + dz); - prevPosX = posX; - prevPosY = posY; - prevPosZ = posZ; + setPosition(posX + dx, posY + dy, posZ + dz); + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; - noClip = true; + noClip = true; - setParticleIcon(BlockSnakestoneObsidian.particles[General.rand.nextInt(BlockSnakestoneObsidian.particles.length)]); - } + setParticleIcon( + BlockSnakestoneObsidian.particles[General.rand.nextInt(BlockSnakestoneObsidian.particles.length)]); + } - @Override - public int getFXLayer() { - return 1; - } + @Override + public int getFXLayer() { + return 1; + } - @Override - public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) { - GL11.glDepthMask(false); - GL11.glEnable(3042); - GL11.glBlendFunc(770, 771); - super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY); - } + @Override + public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, + float rotYZ, float rotXY) { + GL11.glDepthMask(false); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY); + } - @Override - public void onUpdate() { - if (particleAge++ >= particleMaxAge) { - setDead(); - return; - } + @Override + public void onUpdate() { + if (particleAge++ >= particleMaxAge) { + setDead(); + return; + } - double dx = tx - posX; - double dy = ty - posY; - double dz = tz - posZ; + double dx = tx - posX; + double dy = ty - posY; + double dz = tz - posZ; - double distance = Math.sqrt(dx * dx + dy * dy + dz * dz); - if (distance == 0) { - setDead(); - return; - } - if (distance < 0.4) { - particleAlpha = (float) (distance / 0.4); - } else if (particleAge < 20) { - particleAlpha = 1.0f * particleAge / 20; - } else { - particleAlpha = 1.0f; - } + double distance = Math.sqrt(dx * dx + dy * dy + dz * dz); + if (distance == 0) { + setDead(); + return; + } + if (distance < 0.4) { + particleAlpha = (float) (distance / 0.4); + } else if (particleAge < 20) { + particleAlpha = 1.0f * particleAge / 20; + } else { + particleAlpha = 1.0f; + } - if (distance < speed) { - speed = distance; - } + if (distance < speed) { + speed = distance; + } - prevPosX = posX; - prevPosY = posY; - prevPosZ = posZ; + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; - double px = posX + dx / distance * speed; - double py = posY + dy / distance * speed; - double pz = posZ + dz / distance * speed; + double px = posX + dx / distance * speed; + double py = posY + dy / distance * speed; + double pz = posZ + dz / distance * speed; - setPosition(px, py, pz); - } + setPosition(px, py, pz); + } } diff --git a/src/main/java/team/chisel/init/ChiselBlocks.java b/src/main/java/team/chisel/init/ChiselBlocks.java index ee625fa2..b9a21deb 100644 --- a/src/main/java/team/chisel/init/ChiselBlocks.java +++ b/src/main/java/team/chisel/init/ChiselBlocks.java @@ -1,135 +1,135 @@ package team.chisel.init; +import net.minecraft.block.Block; + import team.chisel.Chisel; import team.chisel.block.*; -import net.minecraft.block.Block; import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; @ObjectHolder(Chisel.MOD_ID) public final class ChiselBlocks { - public static final Block autoChisel = null; - public static final BlockCarvable antiBlock = null; - public static final BlockCarvableBeacon beacon = null; - public static final BlockCarvable marble = null; - public static final BlockCarvable marble_pillar = null; - public static final BlockCarvable limestone = null; - public static final BlockCarvableSlab marble_slab = null; - public static final BlockCarvableSlab limestone_slab = null; - public static final BlockCarvableSlab marble_pillar_slab = null; - public static final BlockCarvable cobblestone = null; - public static final BlockCarvableWall cobblestoneWall = null; - public static final BlockCarvableGlass glass = null; - public static final BlockCarvableGlass glass2 = null; - public static final BlockCarvablePane glass_pane = null; - public static final BlockCarvable sandstone = null; - public static final BlockCarvable sandstone_scribbles = null; - public static final BlockConcrete concrete = null; - public static final BlockRoadLine road_line = null; - public static final BlockCarvable iron_block = null; - public static final BlockCarvable gold_block = null; - public static final BlockCarvable diamond_block = null; - public static final BlockCarvableGlowstone glowstone = null; - public static final BlockCarvable lapis_block = null; - public static final BlockCarvable emerald_block = null; - public static final BlockCarvable rebel = null; - public static final BlockCarvable nether_brick = null; - public static final BlockCarvable netherrack = null; - public static final BlockCarvable mossy_cobblestone = null; - public static final BlockCarvable stonebricksmooth = null; - public static final BlockCarvablePane iron_bars = null; - public static final BlockCarvableIce ice = null; - public static final BlockCarvableIce ice_pillar = null; - public static final BlockCarvablePackedIce packedice = null; - public static final BlockCarvablePackedIce packedice_pillar = null; - public static final BlockCarvable obsidian = null; - public static final BlockCarvable obsidian2 = null; - public static final BlockCarvablePowered redstone_block = null; - public static final BlockHolystone holystone = null; - public static final BlockGrimstone grimstone = null; - public static final BlockLavastone lavastone = null; - public static final BlockWaterstone waterstone = null; - public static final BlockCarvable leaves = null; - public static final BlockCarvable fantasyblock = null; - public static final BlockCarvable fantasyblock2 = null; - public static final BlockCarvable carpet_block = null; - public static final BlockCarvableCarpet carpet = null; - public static final BlockCarvable bookshelf = null; - public static final BlockCarvable tyrian = null; - public static final BlockCarvable dirt = null; - public static final BlockCloud cloud = null; - public static final BlockCarvable templeblock = null; - public static final BlockCarvable mossy_templeblock = null; - public static final BlockCarvable factoryblock = null; - public static final BlockCarvable factoryblock2 = null; - public static final BlockCarvablePane paperwall = null; - public static final BlockCarvable paperwall_block = null; - public static final BlockCarvable woolen_clay = null; - public static final BlockCarvable laboratoryblock = null; + public static final Block autoChisel = null; + public static final BlockCarvable antiBlock = null; + public static final BlockCarvableBeacon beacon = null; + public static final BlockCarvable marble = null; + public static final BlockCarvable marble_pillar = null; + public static final BlockCarvable limestone = null; + public static final BlockCarvableSlab marble_slab = null; + public static final BlockCarvableSlab limestone_slab = null; + public static final BlockCarvableSlab marble_pillar_slab = null; + public static final BlockCarvable cobblestone = null; + public static final BlockCarvableWall cobblestoneWall = null; + public static final BlockCarvableGlass glass = null; + public static final BlockCarvableGlass glass2 = null; + public static final BlockCarvablePane glass_pane = null; + public static final BlockCarvable sandstone = null; + public static final BlockCarvable sandstone_scribbles = null; + public static final BlockConcrete concrete = null; + public static final BlockRoadLine road_line = null; + public static final BlockCarvable iron_block = null; + public static final BlockCarvable gold_block = null; + public static final BlockCarvable diamond_block = null; + public static final BlockCarvableGlowstone glowstone = null; + public static final BlockCarvable lapis_block = null; + public static final BlockCarvable emerald_block = null; + public static final BlockCarvable rebel = null; + public static final BlockCarvable nether_brick = null; + public static final BlockCarvable netherrack = null; + public static final BlockCarvable mossy_cobblestone = null; + public static final BlockCarvable stonebricksmooth = null; + public static final BlockCarvablePane iron_bars = null; + public static final BlockCarvableIce ice = null; + public static final BlockCarvableIce ice_pillar = null; + public static final BlockCarvablePackedIce packedice = null; + public static final BlockCarvablePackedIce packedice_pillar = null; + public static final BlockCarvable obsidian = null; + public static final BlockCarvable obsidian2 = null; + public static final BlockCarvablePowered redstone_block = null; + public static final BlockHolystone holystone = null; + public static final BlockGrimstone grimstone = null; + public static final BlockLavastone lavastone = null; + public static final BlockWaterstone waterstone = null; + public static final BlockCarvable leaves = null; + public static final BlockCarvable fantasyblock = null; + public static final BlockCarvable fantasyblock2 = null; + public static final BlockCarvable carpet_block = null; + public static final BlockCarvableCarpet carpet = null; + public static final BlockCarvable bookshelf = null; + public static final BlockCarvable tyrian = null; + public static final BlockCarvable dirt = null; + public static final BlockCloud cloud = null; + public static final BlockCarvable templeblock = null; + public static final BlockCarvable mossy_templeblock = null; + public static final BlockCarvable factoryblock = null; + public static final BlockCarvable factoryblock2 = null; + public static final BlockCarvablePane paperwall = null; + public static final BlockCarvable paperwall_block = null; + public static final BlockCarvable woolen_clay = null; + public static final BlockCarvable laboratoryblock = null; - public static final BlockCarvable voidstone = null; - public static final BlockCarvable voidstone2 = null; - public static final BlockCarvable voidstonerunic = null; - public static final BlockCarvable voidstonePillar = null; - public static final BlockCarvable voidstonePillar2 = null; - public static final BlockSnakestone stone_snakestone = null; - public static final BlockSnakestone sand_snakestone = null; - public static final BlockSnakestoneObsidian obsidian_snakestone = null; - public static final BlockCarvable hexPlating = null; - public static final BlockCarvable hexLargePlating = null; - public static final BlockCarvable technical = null; - public static final BlockCarvableGlass technical2 = null; - public static final BlockCarvable futura = null; - public static final BlockCarvable circuits = null; - public static final BlockCarvable brickCustom = null; - public static final BlockCarvableLayered warningSign = null; - public static final BlockCarvable arcane = null; - public static final BlockCarvable thaumium = null; - public static final BlockCarvable tallow = null; + public static final BlockCarvable voidstone = null; + public static final BlockCarvable voidstone2 = null; + public static final BlockCarvable voidstonerunic = null; + public static final BlockCarvable voidstonePillar = null; + public static final BlockCarvable voidstonePillar2 = null; + public static final BlockSnakestone stone_snakestone = null; + public static final BlockSnakestone sand_snakestone = null; + public static final BlockSnakestoneObsidian obsidian_snakestone = null; + public static final BlockCarvable hexPlating = null; + public static final BlockCarvable hexLargePlating = null; + public static final BlockCarvable technical = null; + public static final BlockCarvableGlass technical2 = null; + public static final BlockCarvable futura = null; + public static final BlockCarvable circuits = null; + public static final BlockCarvable brickCustom = null; + public static final BlockCarvableLayered warningSign = null; + public static final BlockCarvable arcane = null; + public static final BlockCarvable thaumium = null; + public static final BlockCarvable tallow = null; - public static final BlockCarvable copperblock = null; - public static final BlockCarvable bronzeblock = null; - public static final BlockCarvable aluminumblock = null; - public static BlockCarvableStairs[] aluminumStairs = new BlockCarvableStairs[3]; - public static final BlockCarvable leadblock = null; - public static final BlockCarvable silverblock = null; - public static final BlockCarvable steelblock = null; - public static final BlockCarvable tinblock = null; - public static final BlockCarvable uraniumblock = null; + public static final BlockCarvable copperblock = null; + public static final BlockCarvable bronzeblock = null; + public static final BlockCarvable aluminumblock = null; + public static BlockCarvableStairs[] aluminumStairs = new BlockCarvableStairs[3]; + public static final BlockCarvable leadblock = null; + public static final BlockCarvable silverblock = null; + public static final BlockCarvable steelblock = null; + public static final BlockCarvable tinblock = null; + public static final BlockCarvable uraniumblock = null; - public static final BlockCarvable bloodRune = null; - public static final BlockCarvable bloodBrick = null; + public static final BlockCarvable bloodRune = null; + public static final BlockCarvable bloodBrick = null; - // Holidays - public static final BlockCarvable valentines = null; - public static final BlockPresent present = null; + // Holidays + public static final BlockCarvable valentines = null; + public static final BlockPresent present = null; - // Arrays can't be final because of how @ObjectHolder works - public static BlockCarvableStairs[] marbleStairs = new BlockCarvableStairs[8]; - public static BlockCarvableStairs[] limestoneStairs = new BlockCarvableStairs[8]; - public static BlockCarvableIceStairs[] iceStairs = new BlockCarvableIceStairs[8]; - public static BlockCarvablePackedIceStairs[] packediceStairs = new BlockCarvablePackedIceStairs[8]; + // Arrays can't be final because of how @ObjectHolder works + public static BlockCarvableStairs[] marbleStairs = new BlockCarvableStairs[8]; + public static BlockCarvableStairs[] limestoneStairs = new BlockCarvableStairs[8]; + public static BlockCarvableIceStairs[] iceStairs = new BlockCarvableIceStairs[8]; + public static BlockCarvablePackedIceStairs[] packediceStairs = new BlockCarvablePackedIceStairs[8]; - public static Block[] torches = new BlockCarvableTorch[16]; + public static Block[] torches = new BlockCarvableTorch[16]; - public static BlockCarvable[] planks = new BlockCarvable[6]; + public static BlockCarvable[] planks = new BlockCarvable[6]; - public static BlockCarvablePumpkin[] pumpkin = new BlockCarvablePumpkin[16]; - public static BlockCarvablePumpkin[] jackolantern = new BlockCarvablePumpkin[16]; + public static BlockCarvablePumpkin[] pumpkin = new BlockCarvablePumpkin[16]; + public static BlockCarvablePumpkin[] jackolantern = new BlockCarvablePumpkin[16]; - // 1.7 - public static BlockCarvableGlass[] stainedGlass = new BlockCarvableGlass[4]; - public static BlockCarvableGlass stainedGlassForestry; - public static BlockCarvablePane[] stainedGlassPane = new BlockCarvablePane[8]; + // 1.7 + public static BlockCarvableGlass[] stainedGlass = new BlockCarvableGlass[4]; + public static BlockCarvableGlass stainedGlassForestry; + public static BlockCarvablePane[] stainedGlassPane = new BlockCarvablePane[8]; - // 1.8 or at least so you think :P - public static final BlockCarvable granite = null; - public static final BlockCarvable diorite = null; - public static final BlockCarvable andesite = null; + // 1.8 or at least so you think :P + public static final BlockCarvable granite = null; + public static final BlockCarvable diorite = null; + public static final BlockCarvable andesite = null; - // 1.9... drull pls - public static final BlockCarvable purpur = null; + // 1.9... drull pls + public static final BlockCarvable purpur = null; - private ChiselBlocks() { - } + private ChiselBlocks() {} } diff --git a/src/main/java/team/chisel/init/ChiselItems.java b/src/main/java/team/chisel/init/ChiselItems.java index 52adbb0f..e5d692d2 100644 --- a/src/main/java/team/chisel/init/ChiselItems.java +++ b/src/main/java/team/chisel/init/ChiselItems.java @@ -11,15 +11,14 @@ import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; @ObjectHolder(Chisel.MOD_ID) public final class ChiselItems { - public static final ItemChisel chisel = null; - public static final ItemChisel diamondChisel = null; - public static final ItemChisel obsidianChisel = null; - public static final ItemChisel netherStarChisel = null; - public static final ItemCloudInABottle cloudinabottle = null; - public static final ItemBallOMoss ballomoss = null; - public static final ItemSmashingRock smashingrock = null; - public static final ItemUpgrade upgrade = null; + public static final ItemChisel chisel = null; + public static final ItemChisel diamondChisel = null; + public static final ItemChisel obsidianChisel = null; + public static final ItemChisel netherStarChisel = null; + public static final ItemCloudInABottle cloudinabottle = null; + public static final ItemBallOMoss ballomoss = null; + public static final ItemSmashingRock smashingrock = null; + public static final ItemUpgrade upgrade = null; - private ChiselItems() { - } + private ChiselItems() {} } diff --git a/src/main/java/team/chisel/init/TabsInit.java b/src/main/java/team/chisel/init/TabsInit.java index 956eb76c..38503093 100644 --- a/src/main/java/team/chisel/init/TabsInit.java +++ b/src/main/java/team/chisel/init/TabsInit.java @@ -1,11 +1,13 @@ package team.chisel.init; -import com.cricketcraft.chisel.api.ChiselTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; + import team.chisel.Features; +import com.cricketcraft.chisel.api.ChiselTabs; + public class TabsInit { private static boolean atLeastOneModIsLoaded = false; @@ -17,30 +19,23 @@ public class TabsInit { public static void postInit() { - if (Features.CHISEL.enabled()) - ChiselTabs.tabChisel.setTabIconItemStack(new ItemStack(ChiselItems.chisel)); - else - ChiselTabs.tabChisel.setTabIconItemStack(new ItemStack(Items.stick)); + if (Features.CHISEL.enabled()) ChiselTabs.tabChisel.setTabIconItemStack(new ItemStack(ChiselItems.chisel)); + else ChiselTabs.tabChisel.setTabIconItemStack(new ItemStack(Items.stick)); if (Features.HOLYSTONE.enabled()) ChiselTabs.tabStoneChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.holystone)); - else - ChiselTabs.tabStoneChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.stonebrick)); + else ChiselTabs.tabStoneChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.stonebrick)); if (Features.WOOD.enabled()) ChiselTabs.tabWoodChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.planks[0], 1, 1)); - else - ChiselTabs.tabWoodChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.planks)); + else ChiselTabs.tabWoodChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.planks)); if (Features.TECHNICAL.enabled()) ChiselTabs.tabMetalChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.technical)); - else - ChiselTabs.tabMetalChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.iron_block)); + else ChiselTabs.tabMetalChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.iron_block)); if (Features.JACKOLANTERN.enabled()) ChiselTabs.tabOtherChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.jackolantern[0])); - else - ChiselTabs.tabOtherChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.lit_pumpkin)); + else ChiselTabs.tabOtherChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.lit_pumpkin)); if (Features.ICE_STAIRS.enabled()) ChiselTabs.tabStairChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.iceStairs[0])); - else - ChiselTabs.tabStairChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.nether_brick_stairs)); + else ChiselTabs.tabStairChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.nether_brick_stairs)); if (atLeastOneModIsLoaded) { if (Features.ARCANE.enabled()) { @@ -50,8 +45,7 @@ public class TabsInit { } else { if (ChiselBlocks.voidstone != null) ChiselTabs.tabModdedChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.voidstone)); - else - ChiselTabs.tabModdedChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.obsidian)); + else ChiselTabs.tabModdedChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.obsidian)); } } } diff --git a/src/main/java/team/chisel/inventory/ContainerAutoChisel.java b/src/main/java/team/chisel/inventory/ContainerAutoChisel.java index 91b906f6..348501e5 100644 --- a/src/main/java/team/chisel/inventory/ContainerAutoChisel.java +++ b/src/main/java/team/chisel/inventory/ContainerAutoChisel.java @@ -1,8 +1,5 @@ package team.chisel.inventory; -import team.chisel.block.tileentity.TileEntityAutoChisel; -import team.chisel.network.PacketHandler; -import team.chisel.network.message.MessageAutoChisel; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -10,191 +7,203 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import team.chisel.block.tileentity.TileEntityAutoChisel; +import team.chisel.network.PacketHandler; +import team.chisel.network.message.MessageAutoChisel; + public class ContainerAutoChisel extends Container { - public TileEntityAutoChisel autoChisel; - public EntityPlayer player; + public TileEntityAutoChisel autoChisel; + public EntityPlayer player; - public ContainerAutoChisel(InventoryPlayer player, TileEntityAutoChisel tileEntityAutoChisel) { + public ContainerAutoChisel(InventoryPlayer player, TileEntityAutoChisel tileEntityAutoChisel) { - this.player = player.player; - autoChisel = tileEntityAutoChisel; + this.player = player.player; + autoChisel = tileEntityAutoChisel; - addSlot(tileEntityAutoChisel, 0, 53, 15); - addSlot(tileEntityAutoChisel, 1, 78, 52); - addSlot(tileEntityAutoChisel, 2, 103, 15); - addSlot(tileEntityAutoChisel, 3, 8, 62); - addSlot(tileEntityAutoChisel, 4, 152, 5); - addSlot(tileEntityAutoChisel, 5, 152, 25); - addSlot(tileEntityAutoChisel, 6, 152, 45); - addSlot(tileEntityAutoChisel, 7, 152, 65); + addSlot(tileEntityAutoChisel, 0, 53, 15); + addSlot(tileEntityAutoChisel, 1, 78, 52); + addSlot(tileEntityAutoChisel, 2, 103, 15); + addSlot(tileEntityAutoChisel, 3, 8, 62); + addSlot(tileEntityAutoChisel, 4, 152, 5); + addSlot(tileEntityAutoChisel, 5, 152, 25); + addSlot(tileEntityAutoChisel, 6, 152, 45); + addSlot(tileEntityAutoChisel, 7, 152, 65); - bindPlayerInventory(player); - } + bindPlayerInventory(player); + } - private void addSlot(IInventory inv, final int id, int x, int y) { - addSlotToContainer(new Slot(inv, id, x, y) { + private void addSlot(IInventory inv, final int id, int x, int y) { + addSlotToContainer(new Slot(inv, id, x, y) { - @Override - public boolean isItemValid(ItemStack arg0) { - return inventory.isItemValidForSlot(id, arg0); - } - }); - } + @Override + public boolean isItemValid(ItemStack arg0) { + return inventory.isItemValidForSlot(id, arg0); + } + }); + } - protected void bindPlayerInventory(InventoryPlayer invPlayer) { - for (int row = 0; row < 3; row++) { - for (int column = 0; column < 9; column++) { - addSlotToContainer(new Slot(invPlayer, column + row * 9 + 9, 8 + column * 18, 84 + row * 18)); - } - } + protected void bindPlayerInventory(InventoryPlayer invPlayer) { + for (int row = 0; row < 3; row++) { + for (int column = 0; column < 9; column++) { + addSlotToContainer(new Slot(invPlayer, column + row * 9 + 9, 8 + column * 18, 84 + row * 18)); + } + } - for (int slotNumber = 0; slotNumber < 9; slotNumber++) { - addSlotToContainer(new Slot(invPlayer, slotNumber, 8 + slotNumber * 18, 142)); - } - } + for (int slotNumber = 0; slotNumber < 9; slotNumber++) { + addSlotToContainer(new Slot(invPlayer, slotNumber, 8 + slotNumber * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return autoChisel.isUseableByPlayer(player); - } + @Override + public boolean canInteractWith(EntityPlayer player) { + return autoChisel.isUseableByPlayer(player); + } - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotNumber) { - ItemStack itemStack = null; - Slot slot = (Slot) this.inventorySlots.get(slotNumber); + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int slotNumber) { + ItemStack itemStack = null; + Slot slot = (Slot) this.inventorySlots.get(slotNumber); - if (slot != null && slot.getHasStack()) { - ItemStack itemStack1 = slot.getStack(); - itemStack = itemStack1.copy(); + if (slot != null && slot.getHasStack()) { + ItemStack itemStack1 = slot.getStack(); + itemStack = itemStack1.copy(); - // if we are in the auto chisel - if (slotNumber <= 7) { - if (!this.mergeItemStack(itemStack1, 8, 42, false)) { - return null; - } - // otherwise just put it in one of the machine slots - } else if (!this.mergeItemStack(itemStack1, 0, 8, false)) { - return null; - } + // if we are in the auto chisel + if (slotNumber <= 7) { + if (!this.mergeItemStack(itemStack1, 8, 42, false)) { + return null; + } + // otherwise just put it in one of the machine slots + } else if (!this.mergeItemStack(itemStack1, 0, 8, false)) { + return null; + } - if (itemStack1.stackSize == 0) { - slot.putStack(null); - } else { - slot.onSlotChanged(); - } + if (itemStack1.stackSize == 0) { + slot.putStack(null); + } else { + slot.onSlotChanged(); + } - if (itemStack1.stackSize == itemStack.stackSize) { - return null; - } + if (itemStack1.stackSize == itemStack.stackSize) { + return null; + } - slot.onPickupFromSlot(player, itemStack1); - } + slot.onPickupFromSlot(player, itemStack1); + } - return itemStack; - } + return itemStack; + } - @Override - public ItemStack slotClick(int slotId, int p_75144_2_, int p_75144_3_, EntityPlayer player) { - if (slotId >= 0 && slotId < this.inventorySlots.size()) { - Slot slot = (Slot) this.inventorySlots.get(slotId); - ItemStack stack = slot.getStack(); - ItemStack ret = super.slotClick(slotId, p_75144_2_, p_75144_3_, player); + @Override + public ItemStack slotClick(int slotId, int p_75144_2_, int p_75144_3_, EntityPlayer player) { + if (slotId >= 0 && slotId < this.inventorySlots.size()) { + Slot slot = (Slot) this.inventorySlots.get(slotId); + ItemStack stack = slot.getStack(); + ItemStack ret = super.slotClick(slotId, p_75144_2_, p_75144_3_, player); - if (!player.worldObj.isRemote && slot.slotNumber == TileEntityAutoChisel.BASE && !ItemStack.areItemStacksEqual(stack, slot.getStack())) { - int chiseled = stack == null ? 0 : slot.getStack() == null ? stack.stackSize : stack.stackSize - slot.getStack().stackSize; - PacketHandler.INSTANCE.sendToDimension(new MessageAutoChisel(autoChisel, chiseled, false, false), player.worldObj.provider.dimensionId); - } + if (!player.worldObj.isRemote && slot.slotNumber == TileEntityAutoChisel.BASE + && !ItemStack.areItemStacksEqual(stack, slot.getStack())) { + int chiseled = stack == null ? 0 + : slot.getStack() == null ? stack.stackSize : stack.stackSize - slot.getStack().stackSize; + PacketHandler.INSTANCE.sendToDimension( + new MessageAutoChisel(autoChisel, chiseled, false, false), + player.worldObj.provider.dimensionId); + } - return ret; - } - return super.slotClick(slotId, p_75144_2_, p_75144_3_, player); - } + return ret; + } + return super.slotClick(slotId, p_75144_2_, p_75144_3_, player); + } - /** - * Added validation of slot input - * - * @author CrazyPants - */ - @Override - protected boolean mergeItemStack(ItemStack par1ItemStack, int fromIndex, int toIndex, boolean reversOrder) { + /** + * Added validation of slot input + * + * @author CrazyPants + */ + @Override + protected boolean mergeItemStack(ItemStack par1ItemStack, int fromIndex, int toIndex, boolean reversOrder) { - boolean result = false; - int checkIndex = fromIndex; + boolean result = false; + int checkIndex = fromIndex; - if (reversOrder) { - checkIndex = toIndex - 1; - } + if (reversOrder) { + checkIndex = toIndex - 1; + } - Slot slot; - ItemStack itemstack1; + Slot slot; + ItemStack itemstack1; - if (par1ItemStack.isStackable()) { + if (par1ItemStack.isStackable()) { - while (par1ItemStack.stackSize > 0 && (!reversOrder && checkIndex < toIndex || reversOrder && checkIndex >= fromIndex)) { - slot = (Slot) this.inventorySlots.get(checkIndex); - itemstack1 = slot.getStack(); + while (par1ItemStack.stackSize > 0 + && (!reversOrder && checkIndex < toIndex || reversOrder && checkIndex >= fromIndex)) { + slot = (Slot) this.inventorySlots.get(checkIndex); + itemstack1 = slot.getStack(); - if (itemstack1 != null && itemstack1.getItem() == par1ItemStack.getItem() && (!par1ItemStack.getHasSubtypes() || par1ItemStack.getItemDamage() == itemstack1.getItemDamage()) - && ItemStack.areItemStackTagsEqual(par1ItemStack, itemstack1) && slot.isItemValid(par1ItemStack)) { + if (itemstack1 != null && itemstack1.getItem() == par1ItemStack.getItem() + && (!par1ItemStack.getHasSubtypes() + || par1ItemStack.getItemDamage() == itemstack1.getItemDamage()) + && ItemStack.areItemStackTagsEqual(par1ItemStack, itemstack1) + && slot.isItemValid(par1ItemStack)) { - int mergedSize = itemstack1.stackSize + par1ItemStack.stackSize; - int maxStackSize = Math.min(par1ItemStack.getMaxStackSize(), slot.getSlotStackLimit()); - if (mergedSize <= maxStackSize) { - par1ItemStack.stackSize = 0; - itemstack1.stackSize = mergedSize; - slot.onSlotChanged(); - result = true; - } else if (itemstack1.stackSize < maxStackSize) { - par1ItemStack.stackSize -= maxStackSize - itemstack1.stackSize; - itemstack1.stackSize = maxStackSize; - slot.onSlotChanged(); - result = true; - } - } + int mergedSize = itemstack1.stackSize + par1ItemStack.stackSize; + int maxStackSize = Math.min(par1ItemStack.getMaxStackSize(), slot.getSlotStackLimit()); + if (mergedSize <= maxStackSize) { + par1ItemStack.stackSize = 0; + itemstack1.stackSize = mergedSize; + slot.onSlotChanged(); + result = true; + } else if (itemstack1.stackSize < maxStackSize) { + par1ItemStack.stackSize -= maxStackSize - itemstack1.stackSize; + itemstack1.stackSize = maxStackSize; + slot.onSlotChanged(); + result = true; + } + } - if (reversOrder) { - --checkIndex; - } else { - ++checkIndex; - } - } - } + if (reversOrder) { + --checkIndex; + } else { + ++checkIndex; + } + } + } - if (par1ItemStack.stackSize > 0) { - if (reversOrder) { - checkIndex = toIndex - 1; - } else { - checkIndex = fromIndex; - } + if (par1ItemStack.stackSize > 0) { + if (reversOrder) { + checkIndex = toIndex - 1; + } else { + checkIndex = fromIndex; + } - while (!reversOrder && checkIndex < toIndex || reversOrder && checkIndex >= fromIndex) { - slot = (Slot) this.inventorySlots.get(checkIndex); - itemstack1 = slot.getStack(); + while (!reversOrder && checkIndex < toIndex || reversOrder && checkIndex >= fromIndex) { + slot = (Slot) this.inventorySlots.get(checkIndex); + itemstack1 = slot.getStack(); - if (itemstack1 == null && slot.isItemValid(par1ItemStack)) { - ItemStack in = par1ItemStack.copy(); - in.stackSize = Math.min(in.stackSize, slot.getSlotStackLimit()); + if (itemstack1 == null && slot.isItemValid(par1ItemStack)) { + ItemStack in = par1ItemStack.copy(); + in.stackSize = Math.min(in.stackSize, slot.getSlotStackLimit()); - slot.putStack(in); - slot.onSlotChanged(); - if (in.stackSize >= par1ItemStack.stackSize) { - par1ItemStack.stackSize = 0; - } else { - par1ItemStack.stackSize -= in.stackSize; - } - result = true; - break; - } + slot.putStack(in); + slot.onSlotChanged(); + if (in.stackSize >= par1ItemStack.stackSize) { + par1ItemStack.stackSize = 0; + } else { + par1ItemStack.stackSize -= in.stackSize; + } + result = true; + break; + } - if (reversOrder) { - --checkIndex; - } else { - ++checkIndex; - } - } - } + if (reversOrder) { + --checkIndex; + } else { + ++checkIndex; + } + } + } - return result; - } + return result; + } } diff --git a/src/main/java/team/chisel/inventory/ContainerChisel.java b/src/main/java/team/chisel/inventory/ContainerChisel.java index 6e3b2f5d..368e85ec 100644 --- a/src/main/java/team/chisel/inventory/ContainerChisel.java +++ b/src/main/java/team/chisel/inventory/ContainerChisel.java @@ -1,156 +1,170 @@ package team.chisel.inventory; -import com.cricketcraft.chisel.api.carving.ICarvingRegistry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import team.chisel.carving.Carving; import team.chisel.item.chisel.ItemChisel; import team.chisel.utils.General; +import com.cricketcraft.chisel.api.carving.ICarvingRegistry; + public class ContainerChisel extends Container { - public final InventoryChiselSelection inventory; - public InventoryPlayer playerInventory; - int chiselSlot; - public ItemStack chisel; - public boolean finished; - public ICarvingRegistry carving; + public final InventoryChiselSelection inventory; + public InventoryPlayer playerInventory; + int chiselSlot; + public ItemStack chisel; + public boolean finished; + public ICarvingRegistry carving; - public ContainerChisel(InventoryPlayer inventoryplayer, InventoryChiselSelection inv) { - inventory = inv; - playerInventory = inventoryplayer; - chiselSlot = playerInventory.currentItem; - inv.container = this; + public ContainerChisel(InventoryPlayer inventoryplayer, InventoryChiselSelection inv) { + inventory = inv; + playerInventory = inventoryplayer; + chiselSlot = playerInventory.currentItem; + inv.container = this; - int top = 8, left = 62; + int top = 8, left = 62; - // selection slots - for (int i = 0; i < InventoryChiselSelection.normalSlots; i++) { - addSlotToContainer(new SlotChiselSelection(this, inventory, inventory, i, left + ((i % 10) * 18), top + ((i / 10) * 18))); - } + // selection slots + for (int i = 0; i < InventoryChiselSelection.normalSlots; i++) { + addSlotToContainer( + new SlotChiselSelection( + this, + inventory, + inventory, + i, + left + ((i % 10) * 18), + top + ((i / 10) * 18))); + } - // main slot - addSlotToContainer(new SlotChiselInput(this, inventory, InventoryChiselSelection.normalSlots, 24, 24)); + // main slot + addSlotToContainer(new SlotChiselInput(this, inventory, InventoryChiselSelection.normalSlots, 24, 24)); - top += 112; - left += 9; - // main inv - for (int i = 0; i < 27; i++) { - addSlotToContainer(new Slot(inventoryplayer, i + 9, left + ((i % 9) * 18), top + (i / 9) * 18)); - } + top += 112; + left += 9; + // main inv + for (int i = 0; i < 27; i++) { + addSlotToContainer(new Slot(inventoryplayer, i + 9, left + ((i % 9) * 18), top + (i / 9) * 18)); + } - top += 58; - for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventoryplayer, i, left + ((i % 9) * 18), top + (i / 9) * 18)); - } + top += 58; + for (int i = 0; i < 9; i++) { + addSlotToContainer(new Slot(inventoryplayer, i, left + ((i % 9) * 18), top + (i / 9) * 18)); + } - chisel = inventoryplayer.getCurrentItem(); - if (chisel != null && chisel.stackTagCompound != null) { - ItemStack stack = ItemStack.loadItemStackFromNBT(chisel.stackTagCompound.getCompoundTag("chiselTarget")); - inventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, stack); - } + chisel = inventoryplayer.getCurrentItem(); + if (chisel != null && chisel.stackTagCompound != null) { + ItemStack stack = ItemStack.loadItemStackFromNBT(chisel.stackTagCompound.getCompoundTag("chiselTarget")); + inventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, stack); + } - Item item = General.getItem(chisel); - carving = item instanceof ItemChisel ? ItemChisel.carving : Carving.chisel; + Item item = General.getItem(chisel); + carving = item instanceof ItemChisel ? ItemChisel.carving : Carving.chisel; - inventory.updateItems(); - } + inventory.updateItems(); + } - @Override - public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) { - // we need to subtract away all the other slots - int clickedSlot = par1 - inventory.getSizeInventory() - 27; + @Override + public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) { + // we need to subtract away all the other slots + int clickedSlot = par1 - inventory.getSizeInventory() - 27; - // if the player has clicked on the chisel or is trying to use a number key to force an itemstack into the slot the chisel is in - if (clickedSlot == chiselSlot || (par3 == 2 && par2 == chiselSlot)) - return null; + // if the player has clicked on the chisel or is trying to use a number key to force an itemstack into the slot + // the chisel is in + if (clickedSlot == chiselSlot || (par3 == 2 && par2 == chiselSlot)) return null; - return super.slotClick(par1, par2, par3, par4EntityPlayer); - } + return super.slotClick(par1, par2, par3, par4EntityPlayer); + } - @Override - public void onContainerClosed(EntityPlayer entityplayer) { - inventory.clearItems(); - super.onContainerClosed(entityplayer); - } + @Override + public void onContainerClosed(EntityPlayer entityplayer) { + inventory.clearItems(); + super.onContainerClosed(entityplayer); + } - @Override - public boolean canInteractWith(EntityPlayer entityplayer) { - return inventory.isUseableByPlayer(entityplayer); - } + @Override + public boolean canInteractWith(EntityPlayer entityplayer) { + return inventory.isUseableByPlayer(entityplayer); + } - @Override - public ItemStack transferStackInSlot(EntityPlayer entity, int slotIdx) { - ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(slotIdx); + @Override + public ItemStack transferStackInSlot(EntityPlayer entity, int slotIdx) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(slotIdx); - if (slot != null && slot.getHasStack()) { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); - if (slotIdx > InventoryChiselSelection.normalSlots) { - if (!this.mergeItemStack(itemstack1, InventoryChiselSelection.normalSlots, InventoryChiselSelection.normalSlots + 1, false)) { - return null; - } - } else { - entity.inventory.setItemStack(itemstack1.copy()); - slot.onPickupFromSlot(entity, itemstack1); - itemstack1 = entity.inventory.getItemStack(); - entity.inventory.setItemStack(null); + if (slotIdx > InventoryChiselSelection.normalSlots) { + if (!this.mergeItemStack( + itemstack1, + InventoryChiselSelection.normalSlots, + InventoryChiselSelection.normalSlots + 1, + false)) { + return null; + } + } else { + entity.inventory.setItemStack(itemstack1.copy()); + slot.onPickupFromSlot(entity, itemstack1); + itemstack1 = entity.inventory.getItemStack(); + entity.inventory.setItemStack(null); - if (!this.mergeItemStack(itemstack1, InventoryChiselSelection.normalSlots + 1, InventoryChiselSelection.normalSlots + 1 + 36, false)) { + if (!this.mergeItemStack( + itemstack1, + InventoryChiselSelection.normalSlots + 1, + InventoryChiselSelection.normalSlots + 1 + 36, + false)) { entity.inventory.setItemStack(itemstack1); - return null; - } - } - slot.onSlotChange(itemstack1, itemstack); + return null; + } + } + slot.onSlotChange(itemstack1, itemstack); - if (itemstack1.stackSize == 0) { - slot.putStack(null); - } else { - slot.putStack(itemstack1); - slot.onSlotChanged(); - } - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } - if (slotIdx >= InventoryChiselSelection.normalSlots) { - slot.onPickupFromSlot(entity, itemstack1); - } - if (itemstack1.stackSize == 0) { - slot.putStack(null); - return null; - } - } - return itemstack; - } + if (itemstack1.stackSize == 0) { + slot.putStack(null); + } else { + slot.putStack(itemstack1); + slot.onSlotChanged(); + } + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } + if (slotIdx >= InventoryChiselSelection.normalSlots) { + slot.onPickupFromSlot(entity, itemstack1); + } + if (itemstack1.stackSize == 0) { + slot.putStack(null); + return null; + } + } + return itemstack; + } - /** - * Added validation of slot input - * Only Chiselable allowed - * - * @author Léa Gris - */ - @Override - protected boolean mergeItemStack(ItemStack par1ItemStack, int fromIndex, int toIndex, boolean reversOrder) { - return ((Slot) this.inventorySlots.get(reversOrder ? toIndex - 1 : fromIndex)).isItemValid(par1ItemStack) - && super.mergeItemStack(par1ItemStack, fromIndex, toIndex, reversOrder); - } + /** + * Added validation of slot input Only Chiselable allowed + * + * @author Léa Gris + */ + @Override + protected boolean mergeItemStack(ItemStack par1ItemStack, int fromIndex, int toIndex, boolean reversOrder) { + return ((Slot) this.inventorySlots.get(reversOrder ? toIndex - 1 : fromIndex)).isItemValid(par1ItemStack) + && super.mergeItemStack(par1ItemStack, fromIndex, toIndex, reversOrder); + } - public void onChiselSlotChanged() { - ItemStack stack = playerInventory.mainInventory[chiselSlot]; - if (stack == null || !stack.isItemEqual(chisel)) - finished = true; + public void onChiselSlotChanged() { + ItemStack stack = playerInventory.mainInventory[chiselSlot]; + if (stack == null || !stack.isItemEqual(chisel)) finished = true; - if (finished) - return; + if (finished) return; - General.setChiselTarget(chisel, inventory.getStackInSpecialSlot()); + General.setChiselTarget(chisel, inventory.getStackInSpecialSlot()); - playerInventory.mainInventory[chiselSlot] = chisel; - } + playerInventory.mainInventory[chiselSlot] = chisel; + } } diff --git a/src/main/java/team/chisel/inventory/ContainerPresent.java b/src/main/java/team/chisel/inventory/ContainerPresent.java index d8339b10..67acbe0d 100644 --- a/src/main/java/team/chisel/inventory/ContainerPresent.java +++ b/src/main/java/team/chisel/inventory/ContainerPresent.java @@ -5,81 +5,80 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import team.chisel.block.tileentity.TileEntityPresent; public class ContainerPresent extends Container { - private IInventory lower; - private int rows; + private IInventory lower; + private int rows; private boolean isContainerValid = true; - public ContainerPresent(IInventory player, IInventory chest) { - lower = chest; - rows = chest.getSizeInventory() / 9; - chest.openInventory(); - int a = (rows - 4) * 18; - for (int d = 0; d < rows; d++) { - for (int e = 0; e < 9; e++) { - addSlotToContainer(new Slot(chest, e + d * 9, 8 + e * 18, 18 + d * 18)); - } - } + public ContainerPresent(IInventory player, IInventory chest) { + lower = chest; + rows = chest.getSizeInventory() / 9; + chest.openInventory(); + int a = (rows - 4) * 18; - for (int d = 0; d < 3; d++) { - for (int e = 0; e < 9; e++) { - addSlotToContainer(new Slot(player, e + d * 9 + 9, 8 + e * 18, 103 + d * 18 + a)); - } - } + for (int d = 0; d < rows; d++) { + for (int e = 0; e < 9; e++) { + addSlotToContainer(new Slot(chest, e + d * 9, 8 + e * 18, 18 + d * 18)); + } + } - for (int d = 0; d < 9; d++) { - addSlotToContainer(new Slot(player, d, 8 + d * 18, 161 + a)); - } - } + for (int d = 0; d < 3; d++) { + for (int e = 0; e < 9; e++) { + addSlotToContainer(new Slot(player, e + d * 9 + 9, 8 + e * 18, 103 + d * 18 + a)); + } + } - public IInventory getLowerPresentInventory() { - return lower; - } + for (int d = 0; d < 9; d++) { + addSlotToContainer(new Slot(player, d, 8 + d * 18, 161 + a)); + } + } - @Override - public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { - - ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(p_82846_2_); - - if (slot != null && slot.getHasStack()) { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - - if (p_82846_2_ < rows * 9) { - if (!this.mergeItemStack(itemstack1, rows * 9, inventorySlots.size(), true)) { - return null; - } - } else if (!this.mergeItemStack(itemstack1, 0, rows * 9, false)) { - return null; - } - - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - } - - return itemstack; - } - - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return isContainerValid; - } + public IInventory getLowerPresentInventory() { + return lower; + } @Override - public void detectAndSendChanges() - { - TileEntityPresent te = (TileEntityPresent)lower; - if( te != null && te.hasWorldObj() && !te.getWorldObj().isRemote) - { - if (te.getWorldObj().getTileEntity(te.xCoord, te.yCoord, te.zCoord) != te) - isContainerValid = false; + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(p_82846_2_); + + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (p_82846_2_ < rows * 9) { + if (!this.mergeItemStack(itemstack1, rows * 9, inventorySlots.size(), true)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 0, rows * 9, false)) { + return null; + } + + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return isContainerValid; + } + + @Override + public void detectAndSendChanges() { + TileEntityPresent te = (TileEntityPresent) lower; + if (te != null && te.hasWorldObj() && !te.getWorldObj().isRemote) { + if (te.getWorldObj().getTileEntity(te.xCoord, te.yCoord, te.zCoord) != te) isContainerValid = false; } super.detectAndSendChanges(); } diff --git a/src/main/java/team/chisel/inventory/InventoryChiselSelection.java b/src/main/java/team/chisel/inventory/InventoryChiselSelection.java index 709f6899..7a0d5387 100644 --- a/src/main/java/team/chisel/inventory/InventoryChiselSelection.java +++ b/src/main/java/team/chisel/inventory/InventoryChiselSelection.java @@ -2,10 +2,6 @@ package team.chisel.inventory; import java.util.List; -import com.cricketcraft.chisel.api.IChiselItem; - -import team.chisel.item.chisel.ItemChisel; -import team.chisel.utils.General; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -13,182 +9,182 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemTool; +import team.chisel.item.chisel.ItemChisel; +import team.chisel.utils.General; + +import com.cricketcraft.chisel.api.IChiselItem; + public class InventoryChiselSelection implements IInventory { - ItemStack chisel; - public final static int normalSlots = 60; - ContainerChisel container; - ItemStack[] inventory; - private int currentScroll = 0; - private int maxScroll = 0; + ItemStack chisel; + public final static int normalSlots = 60; + ContainerChisel container; + ItemStack[] inventory; + private int currentScroll = 0; + private int maxScroll = 0; - public InventoryChiselSelection(ItemStack c) { - super(); + public InventoryChiselSelection(ItemStack c) { + super(); - inventory = new ItemStack[normalSlots + 1]; - chisel = c; - } + inventory = new ItemStack[normalSlots + 1]; + chisel = c; + } - public void setCurrentScroll(int currentScroll) { - if (this.currentScroll != currentScroll) { - this.currentScroll = currentScroll; - updateItems(); - } - } + public void setCurrentScroll(int currentScroll) { + if (this.currentScroll != currentScroll) { + this.currentScroll = currentScroll; + updateItems(); + } + } - public int getCurrentScroll() { - return currentScroll; - } + public int getCurrentScroll() { + return currentScroll; + } - public int getMaxScroll() { - return maxScroll; - } + public int getMaxScroll() { + return maxScroll; + } - public void onInventoryUpdate(int slot) { + public void onInventoryUpdate(int slot) { - } + } - @Override - public int getSizeInventory() { - return normalSlots + 1; - } + @Override + public int getSizeInventory() { + return normalSlots + 1; + } - @Override - public ItemStack getStackInSlot(int var1) { - return inventory[var1]; - } + @Override + public ItemStack getStackInSlot(int var1) { + return inventory[var1]; + } - public void updateInventoryState(int slot) { - onInventoryUpdate(slot); - } + public void updateInventoryState(int slot) { + onInventoryUpdate(slot); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - if (this.inventory[slot] != null) { - ItemStack stack; - if (this.inventory[slot].stackSize <= amount) { - stack = this.inventory[slot]; - this.inventory[slot] = null; - updateInventoryState(slot); - return stack; - } else { - stack = this.inventory[slot].splitStack(amount); + @Override + public ItemStack decrStackSize(int slot, int amount) { + if (this.inventory[slot] != null) { + ItemStack stack; + if (this.inventory[slot].stackSize <= amount) { + stack = this.inventory[slot]; + this.inventory[slot] = null; + updateInventoryState(slot); + return stack; + } else { + stack = this.inventory[slot].splitStack(amount); - if (this.inventory[slot].stackSize == 0) - this.inventory[slot] = null; + if (this.inventory[slot].stackSize == 0) this.inventory[slot] = null; - updateInventoryState(slot); + updateInventoryState(slot); - return stack; - } - } else - return null; - } + return stack; + } + } else return null; + } - @Override - public String getInventoryName() { - return "container.chisel"; - } + @Override + public String getInventoryName() { + return "container.chisel"; + } - @Override - public boolean hasCustomInventoryName() { - return false; - } + @Override + public boolean hasCustomInventoryName() { + return false; + } - @Override - public int getInventoryStackLimit() { - return 64; - } + @Override + public int getInventoryStackLimit() { + return 64; + } - @Override - public void markDirty() { + @Override + public void markDirty() { - } + } - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return true; - } + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return true; + } - public void clearItems() { - for (int i = 0; i < normalSlots; i++) { - inventory[i] = null; - } - maxScroll = 0; - } + public void clearItems() { + for (int i = 0; i < normalSlots; i++) { + inventory[i] = null; + } + maxScroll = 0; + } - public ItemStack getStackInSpecialSlot() { - return inventory[normalSlots]; - } + public ItemStack getStackInSpecialSlot() { + return inventory[normalSlots]; + } - public void updateItems() { - ItemStack chiseledItem = inventory[normalSlots]; - clearItems(); + public void updateItems() { + ItemStack chiseledItem = inventory[normalSlots]; + clearItems(); - if (chiseledItem == null) { - container.onChiselSlotChanged(); - return; - } + if (chiseledItem == null) { + container.onChiselSlotChanged(); + return; + } - Item item = chiseledItem.getItem(); - if (item == null) - return; + Item item = chiseledItem.getItem(); + if (item == null) return; - if (Block.getBlockFromItem(item) == null) - return; + if (Block.getBlockFromItem(item) == null) return; - if (!((IChiselItem) chisel.getItem()).canChisel(container.playerInventory.player.worldObj, chisel, General.getVariation(chiseledItem))) - return; + if (!((IChiselItem) chisel.getItem()) + .canChisel(container.playerInventory.player.worldObj, chisel, General.getVariation(chiseledItem))) + return; - List list = container.carving.getItemsForChiseling(chiseledItem); - maxScroll = list.size(); - int activeVariations = 0; - while (activeVariations < normalSlots && activeVariations + currentScroll < list.size()) { - if (Block.blockRegistry.getNameForObject(Block.getBlockFromItem(list.get(activeVariations + currentScroll).getItem())) != null) { - inventory[activeVariations] = list.get(activeVariations + currentScroll); - activeVariations++; - } - } + List list = container.carving.getItemsForChiseling(chiseledItem); + maxScroll = list.size(); + int activeVariations = 0; + while (activeVariations < normalSlots && activeVariations + currentScroll < list.size()) { + if (Block.blockRegistry.getNameForObject( + Block.getBlockFromItem(list.get(activeVariations + currentScroll).getItem())) != null) { + inventory[activeVariations] = list.get(activeVariations + currentScroll); + activeVariations++; + } + } - container.onChiselSlotChanged(); - } + container.onChiselSlotChanged(); + } - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - ItemStack stack = getStackInSlot(slot); + @Override + public ItemStack getStackInSlotOnClosing(int slot) { + ItemStack stack = getStackInSlot(slot); - if (stack == null) - return null; - inventory[slot] = null; + if (stack == null) return null; + inventory[slot] = null; - updateInventoryState(slot); - return stack; - } + updateInventoryState(slot); + return stack; + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - // we do not want external chisel variant updates - if (slot == normalSlots) { - inventory[slot] = stack; - updateInventoryState(slot); - } - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + // we do not want external chisel variant updates + if (slot == normalSlots) { + inventory[slot] = stack; + updateInventoryState(slot); + } + } - @Override - public void openInventory() { - } + @Override + public void openInventory() {} - @Override - public void closeInventory() { - } + @Override + public void closeInventory() {} - @Override - public boolean isItemValidForSlot(int i, ItemStack stack) { - // Really didn't think people would chisel a shovel - if (stack.getItem() instanceof ItemTool) { - return false; - } + @Override + public boolean isItemValidForSlot(int i, ItemStack stack) { + // Really didn't think people would chisel a shovel + if (stack.getItem() instanceof ItemTool) { + return false; + } - return !(stack != null && (stack.getItem() instanceof ItemChisel)) && i == normalSlots; - } + return !(stack != null && (stack.getItem() instanceof ItemChisel)) && i == normalSlots; + } } diff --git a/src/main/java/team/chisel/inventory/SlotChiselInput.java b/src/main/java/team/chisel/inventory/SlotChiselInput.java index 72a10897..872657ec 100644 --- a/src/main/java/team/chisel/inventory/SlotChiselInput.java +++ b/src/main/java/team/chisel/inventory/SlotChiselInput.java @@ -6,34 +6,32 @@ import net.minecraft.item.ItemStack; public class SlotChiselInput extends Slot { - public SlotChiselInput(ContainerChisel container, InventoryChiselSelection inv, int i, int j, int k) { - super(inv, i, j, k); - selInventory = inv; - this.container = container; - } + public SlotChiselInput(ContainerChisel container, InventoryChiselSelection inv, int i, int j, int k) { + super(inv, i, j, k); + selInventory = inv; + this.container = container; + } - @Override - public boolean isItemValid(ItemStack itemstack) { - return !container.finished - && !container.carving.getItemsForChiseling(itemstack).isEmpty() - && super.isItemValid(itemstack); - } + @Override + public boolean isItemValid(ItemStack itemstack) { + return !container.finished && !container.carving.getItemsForChiseling(itemstack).isEmpty() + && super.isItemValid(itemstack); + } - @Override - public boolean canTakeStack(EntityPlayer par1EntityPlayer) { - return !container.finished && super.canTakeStack(par1EntityPlayer); - } + @Override + public boolean canTakeStack(EntityPlayer par1EntityPlayer) { + return !container.finished && super.canTakeStack(par1EntityPlayer); + } - @Override - public void onSlotChanged() { - if (container.finished) - return; + @Override + public void onSlotChanged() { + if (container.finished) return; - super.onSlotChanged(); - selInventory.setCurrentScroll(0); - selInventory.updateItems(); - } + super.onSlotChanged(); + selInventory.setCurrentScroll(0); + selInventory.updateItems(); + } - ContainerChisel container; - InventoryChiselSelection selInventory; + ContainerChisel container; + InventoryChiselSelection selInventory; } diff --git a/src/main/java/team/chisel/inventory/SlotChiselPlayer.java b/src/main/java/team/chisel/inventory/SlotChiselPlayer.java index 384bb7b0..303c412a 100644 --- a/src/main/java/team/chisel/inventory/SlotChiselPlayer.java +++ b/src/main/java/team/chisel/inventory/SlotChiselPlayer.java @@ -7,33 +7,33 @@ import net.minecraft.item.ItemStack; public class SlotChiselPlayer extends Slot { - public SlotChiselPlayer(ContainerChisel container, InventoryPlayer inv, int i, int j, int k) { - super(inv, i, j, k); + public SlotChiselPlayer(ContainerChisel container, InventoryPlayer inv, int i, int j, int k) { + super(inv, i, j, k); - this.container = container; - selInventory = inv; - } + this.container = container; + selInventory = inv; + } - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - return false; - } + @Override + public boolean isItemValid(ItemStack par1ItemStack) { + return false; + } - @Override - public void onPickupFromSlot(EntityPlayer player, ItemStack itemstack) { - container.finished = true; - } + @Override + public void onPickupFromSlot(EntityPlayer player, ItemStack itemstack) { + container.finished = true; + } - @Override - public boolean getHasStack() { - return false; - } + @Override + public boolean getHasStack() { + return false; + } - @Override - public ItemStack decrStackSize(int i) { - return null; - } + @Override + public ItemStack decrStackSize(int i) { + return null; + } - ContainerChisel container; - InventoryPlayer selInventory; + ContainerChisel container; + InventoryPlayer selInventory; } diff --git a/src/main/java/team/chisel/inventory/SlotChiselSelection.java b/src/main/java/team/chisel/inventory/SlotChiselSelection.java index 56c88745..542d7f53 100644 --- a/src/main/java/team/chisel/inventory/SlotChiselSelection.java +++ b/src/main/java/team/chisel/inventory/SlotChiselSelection.java @@ -1,75 +1,85 @@ package team.chisel.inventory; -import com.cricketcraft.chisel.api.IChiselItem; -import com.cricketcraft.chisel.api.Statistics; - -import team.chisel.carving.Carving; -import team.chisel.utils.General; -import team.chisel.utils.GeneralClient; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; +import team.chisel.carving.Carving; +import team.chisel.utils.General; +import team.chisel.utils.GeneralClient; + +import com.cricketcraft.chisel.api.IChiselItem; +import com.cricketcraft.chisel.api.Statistics; + public class SlotChiselSelection extends Slot { - private final ContainerChisel container; - private final InventoryChiselSelection selInventory; + private final ContainerChisel container; + private final InventoryChiselSelection selInventory; - public SlotChiselSelection(ContainerChisel container, InventoryChiselSelection inv, IInventory iinventory, int i, int j, int k) { - super(iinventory, i, j, k); + public SlotChiselSelection(ContainerChisel container, InventoryChiselSelection inv, IInventory iinventory, int i, + int j, int k) { + super(iinventory, i, j, k); - this.container = container; - selInventory = inv; - } + this.container = container; + selInventory = inv; + } - @Override - public boolean isItemValid(ItemStack itemstack) { - return false; - } + @Override + public boolean isItemValid(ItemStack itemstack) { + return false; + } - @Override - public boolean canTakeStack(EntityPlayer par1EntityPlayer) { - if (container.finished) - return false; + @Override + public boolean canTakeStack(EntityPlayer par1EntityPlayer) { + if (container.finished) return false; - return par1EntityPlayer.inventory.getItemStack() == null; - } + return par1EntityPlayer.inventory.getItemStack() == null; + } - @Override - public void onPickupFromSlot(EntityPlayer player, ItemStack itemstack) { - ItemStack heldStack = player.inventory.getItemStack(); - ItemStack crafted = selInventory.inventory[InventoryChiselSelection.normalSlots]; + @Override + public void onPickupFromSlot(EntityPlayer player, ItemStack itemstack) { + ItemStack heldStack = player.inventory.getItemStack(); + ItemStack crafted = selInventory.inventory[InventoryChiselSelection.normalSlots]; - if (heldStack == null) { - selInventory.decrStackSize(InventoryChiselSelection.normalSlots, 1); - } else { - putStack(itemstack.copy()); + if (heldStack == null) { + selInventory.decrStackSize(InventoryChiselSelection.normalSlots, 1); + } else { + putStack(itemstack.copy()); - player.inventory.setItemStack(null); + player.inventory.setItemStack(null); - if (selInventory.inventory[InventoryChiselSelection.normalSlots] == null) - return; + if (selInventory.inventory[InventoryChiselSelection.normalSlots] == null) return; - player.inventory.setItemStack(new ItemStack(itemstack.getItem(), selInventory.inventory[InventoryChiselSelection.normalSlots].stackSize, itemstack.getItemDamage())); - selInventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, null); - } + player.inventory.setItemStack( + new ItemStack( + itemstack.getItem(), + selInventory.inventory[InventoryChiselSelection.normalSlots].stackSize, + itemstack.getItemDamage())); + selInventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, null); + } - selInventory.updateItems(); + selInventory.updateItems(); - if (((IChiselItem) container.chisel.getItem()).onChisel(player.worldObj, container.chisel, General.getVariation(crafted))) { - container.chisel.damageItem(1, player); - if (container.chisel.stackSize <= 0) { - player.inventory.mainInventory[player.inventory.currentItem] = null; - } - } + if (((IChiselItem) container.chisel.getItem()) + .onChisel(player.worldObj, container.chisel, General.getVariation(crafted))) { + container.chisel.damageItem(1, player); + if (container.chisel.stackSize <= 0) { + player.inventory.mainInventory[player.inventory.currentItem] = null; + } + } - if (player.worldObj.isRemote) { - String sound = Carving.chisel.getVariationSound(crafted.getItem(), crafted.getItemDamage()); - GeneralClient.playChiselSound(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), sound); - } else { - container.playerInventory.player.addStat(Statistics.blocksChiseled, crafted.stackSize); - } - } + if (player.worldObj.isRemote) { + String sound = Carving.chisel.getVariationSound(crafted.getItem(), crafted.getItemDamage()); + GeneralClient.playChiselSound( + player.worldObj, + MathHelper.floor_double(player.posX), + MathHelper.floor_double(player.posY), + MathHelper.floor_double(player.posZ), + sound); + } else { + container.playerInventory.player.addStat(Statistics.blocksChiseled, crafted.stackSize); + } + } } diff --git a/src/main/java/team/chisel/item/BaseItem.java b/src/main/java/team/chisel/item/BaseItem.java index 192ebd85..4dfd6aff 100644 --- a/src/main/java/team/chisel/item/BaseItem.java +++ b/src/main/java/team/chisel/item/BaseItem.java @@ -11,71 +11,67 @@ import net.minecraft.util.StatCollector; public class BaseItem extends Item { - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - getWrappedDesc(list, itemStack); - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { + getWrappedDesc(list, itemStack); + } - public static void getWrappedDesc(List list, ItemStack stack) { - String[] wrappedDesc; - wrappedDesc = wrap(StatCollector.translateToLocal(stack.getUnlocalizedName() + ".desc"), 35); - for (String element : wrappedDesc) - list.add(element.trim()); - } + public static void getWrappedDesc(List list, ItemStack stack) { + String[] wrappedDesc; + wrappedDesc = wrap(StatCollector.translateToLocal(stack.getUnlocalizedName() + ".desc"), 35); + for (String element : wrappedDesc) list.add(element.trim()); + } - public static String[] wrap(String input, int len) { - // return empty array for null text - if (input == null) - return new String[] {}; + public static String[] wrap(String input, int len) { + // return empty array for null text + if (input == null) return new String[] {}; - // return text if len is zero or less - if (len <= 0) - return new String[] { input }; + // return text if len is zero or less + if (len <= 0) return new String[] { input }; - // return text if less than length - if (input.length() <= len) - return new String[] { input }; + // return text if less than length + if (input.length() <= len) return new String[] { input }; - char[] chars = input.toCharArray(); - Vector lines = new Vector(); - StringBuffer line = new StringBuffer(); - StringBuffer word = new StringBuffer(); + char[] chars = input.toCharArray(); + Vector lines = new Vector(); + StringBuffer line = new StringBuffer(); + StringBuffer word = new StringBuffer(); - for (char c : chars) { - word.append(c); + for (char c : chars) { + word.append(c); - if (c == ' ') { - if ((line.length() + word.length()) > len) { - lines.add(line.toString()); - line.delete(0, line.length()); - } + if (c == ' ') { + if ((line.length() + word.length()) > len) { + lines.add(line.toString()); + line.delete(0, line.length()); + } - line.append(word); - word.delete(0, word.length()); - } - } + line.append(word); + word.delete(0, word.length()); + } + } - // handle any extra chars in current word - if (word.length() > 0) { - if ((line.length() + word.length()) > len) { - lines.add(line.toString()); - line.delete(0, line.length()); - } - line.append(word); - } + // handle any extra chars in current word + if (word.length() > 0) { + if ((line.length() + word.length()) > len) { + lines.add(line.toString()); + line.delete(0, line.length()); + } + line.append(word); + } - // handle extra line - if (line.length() > 0) { - lines.add(line.toString()); - } + // handle extra line + if (line.length() > 0) { + lines.add(line.toString()); + } - String[] ret = new String[lines.size()]; - int c = 0; // counter - for (Enumeration e = lines.elements(); e.hasMoreElements(); c++) { - ret[c] = e.nextElement(); - } + String[] ret = new String[lines.size()]; + int c = 0; // counter + for (Enumeration e = lines.elements(); e.hasMoreElements(); c++) { + ret[c] = e.nextElement(); + } - return ret; - } + return ret; + } } diff --git a/src/main/java/team/chisel/item/ItemBallOMoss.java b/src/main/java/team/chisel/item/ItemBallOMoss.java index 1e105bbd..bbf1defa 100644 --- a/src/main/java/team/chisel/item/ItemBallOMoss.java +++ b/src/main/java/team/chisel/item/ItemBallOMoss.java @@ -1,30 +1,31 @@ package team.chisel.item; -import team.chisel.entity.EntityBallOMoss; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import team.chisel.entity.EntityBallOMoss; + public class ItemBallOMoss extends BaseItem { - public ItemBallOMoss() { - super(); - setUnlocalizedName("ballMoss"); - } + public ItemBallOMoss() { + super(); + setUnlocalizedName("ballMoss"); + } - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par3EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + if (!par3EntityPlayer.capabilities.isCreativeMode) { + --par1ItemStack.stackSize; + } - if (par2World.isRemote) - par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + if (par2World.isRemote) par2World + .playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!par2World.isRemote) { - par2World.spawnEntityInWorld(new EntityBallOMoss(par2World, par3EntityPlayer)); - } + if (!par2World.isRemote) { + par2World.spawnEntityInWorld(new EntityBallOMoss(par2World, par3EntityPlayer)); + } - return par1ItemStack; - } + return par1ItemStack; + } } diff --git a/src/main/java/team/chisel/item/ItemBlockPresent.java b/src/main/java/team/chisel/item/ItemBlockPresent.java index 45e20deb..ff94e643 100644 --- a/src/main/java/team/chisel/item/ItemBlockPresent.java +++ b/src/main/java/team/chisel/item/ItemBlockPresent.java @@ -4,12 +4,12 @@ import net.minecraft.block.Block; public class ItemBlockPresent extends ItemCarvable { - public ItemBlockPresent(Block block) { - super(block); - } + public ItemBlockPresent(Block block) { + super(block); + } - @Override - public int getMetadata(int i) { - return 0; - } + @Override + public int getMetadata(int i) { + return 0; + } } diff --git a/src/main/java/team/chisel/item/ItemCarvable.java b/src/main/java/team/chisel/item/ItemCarvable.java index ee5aa126..ae79bfd7 100644 --- a/src/main/java/team/chisel/item/ItemCarvable.java +++ b/src/main/java/team/chisel/item/ItemCarvable.java @@ -2,11 +2,6 @@ package team.chisel.item; import java.util.List; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.api.carving.IVariationInfo; - -import team.chisel.config.Configurations; -import team.chisel.utils.General; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -14,43 +9,45 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import team.chisel.config.Configurations; +import team.chisel.utils.General; + +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.api.carving.IVariationInfo; + public class ItemCarvable extends ItemBlock { - public ItemCarvable(Block block) { - super(block); - setMaxDamage(0); - setHasSubtypes(true); - } + public ItemCarvable(Block block) { + super(block); + setMaxDamage(0); + setHasSubtypes(true); + } - @Override - public int getMetadata(int i) { - return i; - } + @Override + public int getMetadata(int i) { + return i; + } - @Override - public IIcon getIconFromDamage(int damage) { - return Block.getBlockFromItem(this).getIcon(2, damage); - } + @Override + public IIcon getIconFromDamage(int damage) { + return Block.getBlockFromItem(this).getIcon(2, damage); + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { - if (!Configurations.blockDescriptions) - return; + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { + if (!Configurations.blockDescriptions) return; - Item item = General.getItem(stack); - if (item == null) - return; + Item item = General.getItem(stack); + if (item == null) return; - Block block = Block.getBlockFromItem(this); - if (!(block instanceof ICarvable)) - return; + Block block = Block.getBlockFromItem(this); + if (!(block instanceof ICarvable)) return; - ICarvable carvable = (ICarvable) block; - IVariationInfo var = carvable.getManager(stack.getItemDamage()); - if (var == null) - return; + ICarvable carvable = (ICarvable) block; + IVariationInfo var = carvable.getManager(stack.getItemDamage()); + if (var == null) return; - lines.add(var.getDescription()); - } + lines.add(var.getDescription()); + } } diff --git a/src/main/java/team/chisel/item/ItemCarvablePumpkin.java b/src/main/java/team/chisel/item/ItemCarvablePumpkin.java index c105f923..fff8f35f 100644 --- a/src/main/java/team/chisel/item/ItemCarvablePumpkin.java +++ b/src/main/java/team/chisel/item/ItemCarvablePumpkin.java @@ -6,12 +6,12 @@ import net.minecraft.item.ItemStack; public class ItemCarvablePumpkin extends ItemCarvable { - public ItemCarvablePumpkin(Block block) { - super(block); - } + public ItemCarvablePumpkin(Block block) { + super(block); + } - @Override - public boolean isValidArmor(ItemStack itemStack, int armorType, Entity entity) { - return true; - } + @Override + public boolean isValidArmor(ItemStack itemStack, int armorType, Entity entity) { + return true; + } } diff --git a/src/main/java/team/chisel/item/ItemCarvableSlab.java b/src/main/java/team/chisel/item/ItemCarvableSlab.java index dbee69de..12c82e7f 100644 --- a/src/main/java/team/chisel/item/ItemCarvableSlab.java +++ b/src/main/java/team/chisel/item/ItemCarvableSlab.java @@ -1,71 +1,81 @@ package team.chisel.item; -import team.chisel.block.BlockCarvableSlab; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import team.chisel.block.BlockCarvableSlab; + public class ItemCarvableSlab extends ItemCarvable { - public ItemCarvableSlab(Block block) { - super(block); - } + public ItemCarvableSlab(Block block) { + super(block); + } - @Override - public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) { - return true; - } + @Override + public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) { + return true; + } - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hx, float hy, float hz) { - BlockCarvableSlab block = (BlockCarvableSlab) Block.getBlockFromItem(this); - int meta = stack.getItemDamage(); + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hx, + float hy, float hz) { + BlockCarvableSlab block = (BlockCarvableSlab) Block.getBlockFromItem(this); + int meta = stack.getItemDamage(); - ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[side]; - Block clicked = world.getBlock(x, y, z); + ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[side]; + Block clicked = world.getBlock(x, y, z); - // the position of the block that we are attempting to place at - int x2 = x + dir.offsetX; - int y2 = y + dir.offsetY; - int z2 = z + dir.offsetZ; + // the position of the block that we are attempting to place at + int x2 = x + dir.offsetX; + int y2 = y + dir.offsetY; + int z2 = z + dir.offsetZ; - Block at = world.getBlock(x2, y2, z2); + Block at = world.getBlock(x2, y2, z2); - boolean metaEquals = world.getBlockMetadata(x2, y2, z2) == meta; - // if the metadata at the place target matches, and the block there matches either the top of bottom slab, try to fill in the rest of the block - if (metaEquals && ((at == block.top && (hy <= 0.5D || hy == 1.0D)) || (at == block.bottom && (hy > 0.5D || hy == 0)))) { - place(stack, world, x2, y2, z2, block.master, meta); - return true; - } + boolean metaEquals = world.getBlockMetadata(x2, y2, z2) == meta; + // if the metadata at the place target matches, and the block there matches either the top of bottom slab, try + // to fill in the rest of the block + if (metaEquals && ((at == block.top && (hy <= 0.5D || hy == 1.0D)) + || (at == block.bottom && (hy > 0.5D || hy == 0)))) { + place(stack, world, x2, y2, z2, block.master, meta); + return true; + } - // else if the block clicked on is a top or bottom slab of this type, try to fill in that block if possible - boolean clickedMetaEquals = world.getBlockMetadata(x, y, z) == meta; - if (clickedMetaEquals && ((clicked == block.bottom && dir == ForgeDirection.UP) || (clicked == block.top && dir == ForgeDirection.DOWN))) { - place(stack, world, x, y, z, block.master, meta); - return true; - } + // else if the block clicked on is a top or bottom slab of this type, try to fill in that block if possible + boolean clickedMetaEquals = world.getBlockMetadata(x, y, z) == meta; + if (clickedMetaEquals && ((clicked == block.bottom && dir == ForgeDirection.UP) + || (clicked == block.top && dir == ForgeDirection.DOWN))) { + place(stack, world, x, y, z, block.master, meta); + return true; + } - // finally just try to place a normal slab - if (metaEquals || at.isReplaceable(world, x, y, z)) { - boolean top = hy > 0.5D && dir != ForgeDirection.UP || dir == ForgeDirection.DOWN; - Block toPlace = top ? block.top : block.bottom; - // if we can replace the clicked block do so - if (clicked.isReplaceable(world, x, y, z)) { - place(stack, world, x, y, z, toPlace, meta); - } else { - place(stack, world, x2, y2, z2, toPlace, meta); - } - return true; - } - return false; - } + // finally just try to place a normal slab + if (metaEquals || at.isReplaceable(world, x, y, z)) { + boolean top = hy > 0.5D && dir != ForgeDirection.UP || dir == ForgeDirection.DOWN; + Block toPlace = top ? block.top : block.bottom; + // if we can replace the clicked block do so + if (clicked.isReplaceable(world, x, y, z)) { + place(stack, world, x, y, z, toPlace, meta); + } else { + place(stack, world, x2, y2, z2, toPlace, meta); + } + return true; + } + return false; + } - private void place(ItemStack stack, World world, int x, int y, int z, Block toPlace, int metadata) { - world.setBlock(x, y, z, toPlace, metadata, 2); - stack.stackSize -= 1; - world.playSoundEffect(x + 0.5f, y + 0.5f, z + 0.5f, this.field_150939_a.stepSound.func_150496_b(), (this.field_150939_a.stepSound.getVolume() + 1.0F) / 2.0F, - this.field_150939_a.stepSound.getPitch() * 0.8F); - } + private void place(ItemStack stack, World world, int x, int y, int z, Block toPlace, int metadata) { + world.setBlock(x, y, z, toPlace, metadata, 2); + stack.stackSize -= 1; + world.playSoundEffect( + x + 0.5f, + y + 0.5f, + z + 0.5f, + this.field_150939_a.stepSound.func_150496_b(), + (this.field_150939_a.stepSound.getVolume() + 1.0F) / 2.0F, + this.field_150939_a.stepSound.getPitch() * 0.8F); + } } diff --git a/src/main/java/team/chisel/item/ItemCloudInABottle.java b/src/main/java/team/chisel/item/ItemCloudInABottle.java index 51f477fc..8d930fe8 100644 --- a/src/main/java/team/chisel/item/ItemCloudInABottle.java +++ b/src/main/java/team/chisel/item/ItemCloudInABottle.java @@ -1,30 +1,31 @@ package team.chisel.item; -import team.chisel.entity.EntityCloudInABottle; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import team.chisel.entity.EntityCloudInABottle; + public class ItemCloudInABottle extends BaseItem { - public ItemCloudInABottle() { - super(); - setUnlocalizedName("cloudBottle"); - } + public ItemCloudInABottle() { + super(); + setUnlocalizedName("cloudBottle"); + } - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par3EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + if (!par3EntityPlayer.capabilities.isCreativeMode) { + --par1ItemStack.stackSize; + } - if (par2World.isRemote) - par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + if (par2World.isRemote) par2World + .playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!par2World.isRemote) { - par2World.spawnEntityInWorld(new EntityCloudInABottle(par2World, par3EntityPlayer)); - } + if (!par2World.isRemote) { + par2World.spawnEntityInWorld(new EntityCloudInABottle(par2World, par3EntityPlayer)); + } - return par1ItemStack; - } + return par1ItemStack; + } } diff --git a/src/main/java/team/chisel/item/ItemSmashingRock.java b/src/main/java/team/chisel/item/ItemSmashingRock.java index d726db82..3ef3970e 100644 --- a/src/main/java/team/chisel/item/ItemSmashingRock.java +++ b/src/main/java/team/chisel/item/ItemSmashingRock.java @@ -1,30 +1,31 @@ package team.chisel.item; -import team.chisel.entity.EntitySmashingRock; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import team.chisel.entity.EntitySmashingRock; + public class ItemSmashingRock extends BaseItem { - public ItemSmashingRock() { - super(); - setUnlocalizedName("smashingRock"); - } + public ItemSmashingRock() { + super(); + setUnlocalizedName("smashingRock"); + } - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par3EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + if (!par3EntityPlayer.capabilities.isCreativeMode) { + --par1ItemStack.stackSize; + } - if (par2World.isRemote) - par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + if (par2World.isRemote) par2World + .playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - if (!par2World.isRemote) { - par2World.spawnEntityInWorld(new EntitySmashingRock(par2World, par3EntityPlayer)); - } + if (!par2World.isRemote) { + par2World.spawnEntityInWorld(new EntitySmashingRock(par2World, par3EntityPlayer)); + } - return par1ItemStack; - } + return par1ItemStack; + } } diff --git a/src/main/java/team/chisel/item/ItemUpgrade.java b/src/main/java/team/chisel/item/ItemUpgrade.java index 55dd320c..a4d70819 100644 --- a/src/main/java/team/chisel/item/ItemUpgrade.java +++ b/src/main/java/team/chisel/item/ItemUpgrade.java @@ -2,51 +2,52 @@ package team.chisel.item; import java.util.List; -import team.chisel.Chisel; -import team.chisel.block.tileentity.TileEntityAutoChisel.Upgrade; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import team.chisel.Chisel; +import team.chisel.block.tileentity.TileEntityAutoChisel.Upgrade; + public class ItemUpgrade extends BaseItem { - public IIcon[] icons = new IIcon[4]; + public IIcon[] icons = new IIcon[4]; - public ItemUpgrade(String unlocalizedName) { - super(); - this.setUnlocalizedName(unlocalizedName); - this.setCreativeTab(CreativeTabs.tabMaterials); - setHasSubtypes(true); - setMaxStackSize(1); // it's easier this way - } + public ItemUpgrade(String unlocalizedName) { + super(); + this.setUnlocalizedName(unlocalizedName); + this.setCreativeTab(CreativeTabs.tabMaterials); + setHasSubtypes(true); + setMaxStackSize(1); // it's easier this way + } - @Override - public IIcon getIconFromDamage(int meta) { - // using modulo throughout to prevent AIOB - return this.icons[meta % Upgrade.values().length]; - } + @Override + public IIcon getIconFromDamage(int meta) { + // using modulo throughout to prevent AIOB + return this.icons[meta % Upgrade.values().length]; + } - @Override - public void registerIcons(IIconRegister reg) { - Upgrade[] upgrades = Upgrade.values(); - for (int i = 0; i < upgrades.length; i++) { - this.icons[i] = reg.registerIcon(Chisel.MOD_ID + ":upgrade_" + upgrades[i].name().toLowerCase()); - } - } + @Override + public void registerIcons(IIconRegister reg) { + Upgrade[] upgrades = Upgrade.values(); + for (int i = 0; i < upgrades.length; i++) { + this.icons[i] = reg.registerIcon(Chisel.MOD_ID + ":upgrade_" + upgrades[i].name().toLowerCase()); + } + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - for (int i = 0; i < Upgrade.values().length; i++) { - list.add(new ItemStack(item, 1, i)); - } - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void getSubItems(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < Upgrade.values().length; i++) { + list.add(new ItemStack(item, 1, i)); + } + } - @Override - public String getUnlocalizedName(ItemStack stack) { - Upgrade[] upgrades = Upgrade.values(); - return upgrades[stack.getItemDamage() % upgrades.length].getUnlocalizedName(); - } + @Override + public String getUnlocalizedName(ItemStack stack) { + Upgrade[] upgrades = Upgrade.values(); + return upgrades[stack.getItemDamage() % upgrades.length].getUnlocalizedName(); + } } diff --git a/src/main/java/team/chisel/item/chisel/ChiselController.java b/src/main/java/team/chisel/item/chisel/ChiselController.java index 31d096a6..f094f902 100644 --- a/src/main/java/team/chisel/item/chisel/ChiselController.java +++ b/src/main/java/team/chisel/item/chisel/ChiselController.java @@ -12,6 +12,7 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.oredict.OreDictionary; + import team.chisel.Chisel; import team.chisel.carving.Carving; import team.chisel.utils.General; @@ -29,149 +30,147 @@ import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent; public final class ChiselController { - private static class GuiOpen implements Runnable { + private static class GuiOpen implements Runnable { - private EntityPlayer player; - private ItemStack stack; + private EntityPlayer player; + private ItemStack stack; - public GuiOpen(EntityPlayer player, ItemStack stack) { - super(); - this.player = player; - this.stack = stack; - } + public GuiOpen(EntityPlayer player, ItemStack stack) { + super(); + this.player = player; + this.stack = stack; + } - @Override - public void run() { - ItemStack current = player.getCurrentEquippedItem(); - if (current != null) { - if (ItemStack.areItemStacksEqual(stack, current) && ItemStack.areItemStackTagsEqual(stack, current)) { - player.openGui(Chisel.instance, 0, player.worldObj, 0, 0, 0); - } - } - } - } + @Override + public void run() { + ItemStack current = player.getCurrentEquippedItem(); + if (current != null) { + if (ItemStack.areItemStacksEqual(stack, current) && ItemStack.areItemStackTagsEqual(stack, current)) { + player.openGui(Chisel.instance, 0, player.worldObj, 0, 0, 0); + } + } + } + } - public static final ChiselController INSTANCE = new ChiselController(); + public static final ChiselController INSTANCE = new ChiselController(); - private long lastTickClick = 0; - private Queue openQueue = Queues.newArrayDeque(); + private long lastTickClick = 0; + private Queue openQueue = Queues.newArrayDeque(); - private ChiselController() { - } + private ChiselController() {} - public void preInit() { - MinecraftForge.EVENT_BUS.register(this); - FMLCommonHandler.instance().bus().register(this); - } + public void preInit() { + MinecraftForge.EVENT_BUS.register(this); + FMLCommonHandler.instance().bus().register(this); + } - @SubscribeEvent - public void onInteract(PlayerInteractEvent event) { - ItemStack held = event.entityPlayer.getCurrentEquippedItem(); - int slot = event.entityPlayer.inventory.currentItem; + @SubscribeEvent + public void onInteract(PlayerInteractEvent event) { + ItemStack held = event.entityPlayer.getCurrentEquippedItem(); + int slot = event.entityPlayer.inventory.currentItem; - //Prevents a crash when activated from a Battlegear slot. - if(slot > 8 || slot < 0) { - return; - } - - if (held == null || !(held.getItem() instanceof IChiselItem)) { - return; - } + // Prevents a crash when activated from a Battlegear slot. + if (slot > 8 || slot < 0) { + return; + } - IChiselItem chisel = (IChiselItem) held.getItem(); + if (held == null || !(held.getItem() instanceof IChiselItem)) { + return; + } - switch (event.action) { - case LEFT_CLICK_BLOCK: - boolean shifting = event.entityPlayer.isSneaking(); - int x = event.x, - y = event.y, - z = event.z; - Block block = event.world.getBlock(x, y, z); - int metadata = event.world.getBlockMetadata(x, y, z); - ICarvingGroup group = Carving.chisel.getGroup(block, metadata); + IChiselItem chisel = (IChiselItem) held.getItem(); - if (group == null) { - return; - } + switch (event.action) { + case LEFT_CLICK_BLOCK: + boolean shifting = event.entityPlayer.isSneaking(); + int x = event.x, y = event.y, z = event.z; + Block block = event.world.getBlock(x, y, z); + int metadata = event.world.getBlockMetadata(x, y, z); + ICarvingGroup group = Carving.chisel.getGroup(block, metadata); - TileEntity te = event.world.getTileEntity(x, y, z); - if ( te != null) { - // Don't support chiseling tile entities - return; - } + if (group == null) { + return; + } - List list = group.getVariations(); + TileEntity te = event.world.getTileEntity(x, y, z); + if (te != null) { + // Don't support chiseling tile entities + return; + } - main: for (ItemStack stack : OreDictionary.getOres(group.getOreName())) { - ICarvingVariation v = General.getVariation(stack); - for (ICarvingVariation check : list) { - if (check.getBlock() == v.getBlock() && check.getBlockMeta() == v.getBlockMeta()) { - continue main; - } - } - list.add(General.getVariation(stack)); - } + List list = group.getVariations(); - ICarvingVariation[] variations = list.toArray(new ICarvingVariation[] {}); + main: for (ItemStack stack : OreDictionary.getOres(group.getOreName())) { + ICarvingVariation v = General.getVariation(stack); + for (ICarvingVariation check : list) { + if (check.getBlock() == v.getBlock() && check.getBlockMeta() == v.getBlockMeta()) { + continue main; + } + } + list.add(General.getVariation(stack)); + } - if (chisel.canChiselBlock(event.world, event.entityPlayer, x, y, z, block, metadata)) { - ItemStack target = General.getChiselTarget(held); - IChiselMode mode = General.getChiselMode(held); - ForgeDirection sideHit = ForgeDirection.VALID_DIRECTIONS[event.face]; + ICarvingVariation[] variations = list.toArray(new ICarvingVariation[] {}); - if (target != null) { - for (ICarvingVariation v : variations) { - if (v.getBlock() == Block.getBlockFromItem(target.getItem()) && v.getBlockMeta() == target.getItemDamage()) { - mode.chiselAll(event.entityPlayer, event.world, x, y, z, sideHit, v); - } - } - } else { - int idx = 0; - for (int i = 0; i < variations.length; i++) { - ICarvingVariation v = variations[i]; - if (v.getBlock() == block && v.getBlockMeta() == metadata) { - idx = i + variations.length + (shifting ? -1 : 1); - idx %= variations.length; - } - } + if (chisel.canChiselBlock(event.world, event.entityPlayer, x, y, z, block, metadata)) { + ItemStack target = General.getChiselTarget(held); + IChiselMode mode = General.getChiselMode(held); + ForgeDirection sideHit = ForgeDirection.VALID_DIRECTIONS[event.face]; - ICarvingVariation newVar = variations[idx]; - mode.chiselAll(event.entityPlayer, event.world, x, y, z, sideHit, newVar); - event.entityPlayer.inventory.currentItem = slot; - } - } - break; - case RIGHT_CLICK_AIR: - case RIGHT_CLICK_BLOCK: - // Make sure we have not responded this tick - if (event.world.getTotalWorldTime() == lastTickClick) { - break; - } else { - lastTickClick = event.world.getTotalWorldTime(); - } - if (!event.world.isRemote && chisel.canOpenGui(event.world, event.entityPlayer, held)) { - openQueue.add(new GuiOpen(event.entityPlayer, held)); - } - break; - } - } + if (target != null) { + for (ICarvingVariation v : variations) { + if (v.getBlock() == Block.getBlockFromItem(target.getItem()) + && v.getBlockMeta() == target.getItemDamage()) { + mode.chiselAll(event.entityPlayer, event.world, x, y, z, sideHit, v); + } + } + } else { + int idx = 0; + for (int i = 0; i < variations.length; i++) { + ICarvingVariation v = variations[i]; + if (v.getBlock() == block && v.getBlockMeta() == metadata) { + idx = i + variations.length + (shifting ? -1 : 1); + idx %= variations.length; + } + } - // This still shows the block being broken, but it's better than nothing - @SubscribeEvent - public void onBlockBreak(BlockEvent.BreakEvent event) { - ItemStack stack = event.getPlayer().getCurrentEquippedItem(); - if (event.getPlayer().capabilities.isCreativeMode && stack != null && stack.getItem() instanceof IChiselItem) { - event.setCanceled(true); - } - } + ICarvingVariation newVar = variations[idx]; + mode.chiselAll(event.entityPlayer, event.world, x, y, z, sideHit, newVar); + event.entityPlayer.inventory.currentItem = slot; + } + } + break; + case RIGHT_CLICK_AIR: + case RIGHT_CLICK_BLOCK: + // Make sure we have not responded this tick + if (event.world.getTotalWorldTime() == lastTickClick) { + break; + } else { + lastTickClick = event.world.getTotalWorldTime(); + } + if (!event.world.isRemote && chisel.canOpenGui(event.world, event.entityPlayer, held)) { + openQueue.add(new GuiOpen(event.entityPlayer, held)); + } + break; + } + } - @SubscribeEvent - public void openQueuedGui(ServerTickEvent event) { - if (event.phase == Phase.END) { - GuiOpen open = openQueue.poll(); - if (open != null) { - open.run(); - } - } - } + // This still shows the block being broken, but it's better than nothing + @SubscribeEvent + public void onBlockBreak(BlockEvent.BreakEvent event) { + ItemStack stack = event.getPlayer().getCurrentEquippedItem(); + if (event.getPlayer().capabilities.isCreativeMode && stack != null && stack.getItem() instanceof IChiselItem) { + event.setCanceled(true); + } + } + + @SubscribeEvent + public void openQueuedGui(ServerTickEvent event) { + if (event.phase == Phase.END) { + GuiOpen open = openQueue.poll(); + if (open != null) { + open.run(); + } + } + } } diff --git a/src/main/java/team/chisel/item/chisel/ChiselMode.java b/src/main/java/team/chisel/item/chisel/ChiselMode.java index 97686fc5..922bb1ea 100644 --- a/src/main/java/team/chisel/item/chisel/ChiselMode.java +++ b/src/main/java/team/chisel/item/chisel/ChiselMode.java @@ -1,12 +1,5 @@ package team.chisel.item.chisel; -import com.cricketcraft.chisel.api.IChiselItem; -import com.cricketcraft.chisel.api.Statistics; -import com.cricketcraft.chisel.api.carving.ICarvingVariation; -import com.cricketcraft.chisel.api.carving.IChiselMode; - -import team.chisel.network.PacketHandler; -import team.chisel.network.message.MessageChiselSound; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -15,117 +8,131 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import team.chisel.network.PacketHandler; +import team.chisel.network.message.MessageChiselSound; + +import com.cricketcraft.chisel.api.IChiselItem; +import com.cricketcraft.chisel.api.Statistics; +import com.cricketcraft.chisel.api.carving.ICarvingVariation; +import com.cricketcraft.chisel.api.carving.IChiselMode; + public enum ChiselMode implements IChiselMode { - SINGLE { + SINGLE { - @Override - public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, ICarvingVariation variation) { - setVariation(player, world, x, y, z, world.getBlock(x, y, z), world.getBlockMetadata(x, y, z), variation); - } - }, - PANEL { + @Override + public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, + ICarvingVariation variation) { + setVariation(player, world, x, y, z, world.getBlock(x, y, z), world.getBlockMetadata(x, y, z), variation); + } + }, + PANEL { - @Override - public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, ICarvingVariation variation) { - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - for (int dx = -1; dx <= 1; dx++) { - for (int dy = -1; dy <= 1; dy++) { - if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) { - setVariation(player, world, x + dx, y, z + dy, block, meta, variation); - } else if (side == ForgeDirection.EAST || side == ForgeDirection.WEST) { - setVariation(player, world, x, y + dy, z + dx, block, meta, variation); - } else { - setVariation(player, world, x + dx, y + dy, z, block, meta, variation); - } - } - } - } - }, - COLUMN { + @Override + public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, + ICarvingVariation variation) { + Block block = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + for (int dx = -1; dx <= 1; dx++) { + for (int dy = -1; dy <= 1; dy++) { + if (side == ForgeDirection.UP || side == ForgeDirection.DOWN) { + setVariation(player, world, x + dx, y, z + dy, block, meta, variation); + } else if (side == ForgeDirection.EAST || side == ForgeDirection.WEST) { + setVariation(player, world, x, y + dy, z + dx, block, meta, variation); + } else { + setVariation(player, world, x + dx, y + dy, z, block, meta, variation); + } + } + } + } + }, + COLUMN { - @Override - public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, ICarvingVariation variation) { - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - int facing = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - for (int i = -1; i <= 1; i++) { - if (side != ForgeDirection.DOWN && side != ForgeDirection.UP) { - setVariation(player, world, x, y + i, z, block, meta, variation); - } else { - if (facing == 0 || facing == 2) { - setVariation(player, world, x, y, z + i, block, meta, variation); - } else { - setVariation(player, world, x + i, y, z, block, meta, variation); - } - } - } - } - }, - ROW { + @Override + public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, + ICarvingVariation variation) { + Block block = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + int facing = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + for (int i = -1; i <= 1; i++) { + if (side != ForgeDirection.DOWN && side != ForgeDirection.UP) { + setVariation(player, world, x, y + i, z, block, meta, variation); + } else { + if (facing == 0 || facing == 2) { + setVariation(player, world, x, y, z + i, block, meta, variation); + } else { + setVariation(player, world, x + i, y, z, block, meta, variation); + } + } + } + } + }, + ROW { - @Override - public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, ICarvingVariation variation) { - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - int facing = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - for (int i = -1; i <= 1; i++) { - if (side != ForgeDirection.DOWN && side != ForgeDirection.UP) { - if (side == ForgeDirection.EAST || side == ForgeDirection.WEST) { - setVariation(player, world, x, y, z + i, block, meta, variation); - } else { - setVariation(player, world, x + i, y, z, block, meta, variation); - } - } else { - if (facing == 0 || facing == 2) { - setVariation(player, world, x + i, y, z, block, meta, variation); - } else { - setVariation(player, world, x, y, z + i, block, meta, variation); - } - } - } - } - }; + @Override + public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, + ICarvingVariation variation) { + Block block = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + int facing = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + for (int i = -1; i <= 1; i++) { + if (side != ForgeDirection.DOWN && side != ForgeDirection.UP) { + if (side == ForgeDirection.EAST || side == ForgeDirection.WEST) { + setVariation(player, world, x, y, z + i, block, meta, variation); + } else { + setVariation(player, world, x + i, y, z, block, meta, variation); + } + } else { + if (facing == 0 || facing == 2) { + setVariation(player, world, x + i, y, z, block, meta, variation); + } else { + setVariation(player, world, x, y, z + i, block, meta, variation); + } + } + } + } + }; - /** - * Assumes that the player is holding a chisel - */ - private static void setVariation(EntityPlayer player, World world, int x, int y, int z, Block origBlock, int origMeta, ICarvingVariation v) { - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - ItemStack held = player.getCurrentEquippedItem(); - if (block == v.getBlock() && meta == v.getBlockMeta()) { - return; // don't chisel to the same thing - } - if (origBlock != block || origMeta != meta) { - return; // don't chisel if this doesn't match the target block (for the AOE modes) - } + /** + * Assumes that the player is holding a chisel + */ + private static void setVariation(EntityPlayer player, World world, int x, int y, int z, Block origBlock, + int origMeta, ICarvingVariation v) { + Block block = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + ItemStack held = player.getCurrentEquippedItem(); + if (block == v.getBlock() && meta == v.getBlockMeta()) { + return; // don't chisel to the same thing + } + if (origBlock != block || origMeta != meta) { + return; // don't chisel if this doesn't match the target block (for the AOE modes) + } - if (held != null && held.getItem() instanceof IChiselItem) { - if (origBlock == v.getBlock()) { - world.setBlockMetadataWithNotify(x, y, z, v.getBlockMeta(), 3); - } else { - world.setBlock(x, y, z, v.getBlock(), v.getBlockMeta(), 3); - } - player.addStat(Statistics.blocksChiseled, 1); - boolean breakChisel = false; - if (((IChiselItem) player.getCurrentEquippedItem().getItem()).onChisel(world, player.getCurrentEquippedItem(), v)) { - player.getCurrentEquippedItem().damageItem(1, player); - if (player.getCurrentEquippedItem().stackSize <= 0) { - player.inventory.mainInventory[player.inventory.currentItem] = null; - breakChisel = true; - } - } - PacketHandler.INSTANCE.sendTo(new MessageChiselSound(x, y, z, v, breakChisel), (EntityPlayerMP) player); - } - } + if (held != null && held.getItem() instanceof IChiselItem) { + if (origBlock == v.getBlock()) { + world.setBlockMetadataWithNotify(x, y, z, v.getBlockMeta(), 3); + } else { + world.setBlock(x, y, z, v.getBlock(), v.getBlockMeta(), 3); + } + player.addStat(Statistics.blocksChiseled, 1); + boolean breakChisel = false; + if (((IChiselItem) player.getCurrentEquippedItem().getItem()) + .onChisel(world, player.getCurrentEquippedItem(), v)) { + player.getCurrentEquippedItem().damageItem(1, player); + if (player.getCurrentEquippedItem().stackSize <= 0) { + player.inventory.mainInventory[player.inventory.currentItem] = null; + breakChisel = true; + } + } + PacketHandler.INSTANCE.sendTo(new MessageChiselSound(x, y, z, v, breakChisel), (EntityPlayerMP) player); + } + } - public static ChiselMode next(IChiselMode currentMode) { - if (currentMode instanceof ChiselMode) { - ChiselMode[] values = values(); - return values[(((ChiselMode) currentMode).ordinal() + 1) % values.length]; - } - return SINGLE; - } + public static ChiselMode next(IChiselMode currentMode) { + if (currentMode instanceof ChiselMode) { + ChiselMode[] values = values(); + return values[(((ChiselMode) currentMode).ordinal() + 1) % values.length]; + } + return SINGLE; + } } diff --git a/src/main/java/team/chisel/item/chisel/ItemChisel.java b/src/main/java/team/chisel/item/chisel/ItemChisel.java index 99798d35..4beb7264 100644 --- a/src/main/java/team/chisel/item/chisel/ItemChisel.java +++ b/src/main/java/team/chisel/item/chisel/ItemChisel.java @@ -3,9 +3,6 @@ package team.chisel.item.chisel; import java.util.List; import java.util.Locale; -import team.chisel.Chisel; -import team.chisel.carving.Carving; -import team.chisel.config.Configurations; import net.minecraft.block.Block; import net.minecraft.client.resources.I18n; import net.minecraft.entity.EntityLivingBase; @@ -19,6 +16,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; +import team.chisel.Chisel; +import team.chisel.carving.Carving; +import team.chisel.config.Configurations; + import com.cricketcraft.chisel.api.IChiselItem; import com.cricketcraft.chisel.api.carving.ICarvingRegistry; import com.cricketcraft.chisel.api.carving.ICarvingVariation; @@ -27,125 +28,135 @@ import com.google.common.collect.Multimap; public class ItemChisel extends Item implements IChiselItem { - public enum ChiselType { - IRON(Configurations.ironChiselMaxDamage, Configurations.ironChiselAttackDamage), - DIAMOND(Configurations.diamondChiselMaxDamage, Configurations.diamondChiselAttackDamage), - OBSIDIAN(Configurations.obsidianChiselMaxDamage, Configurations.obsidianChiselAttackDamage), - NETHERSTAR(Configurations.netherStarChiselMaxDamage, Configurations.netherStarChiselAttackDamage); + public enum ChiselType { - final int maxDamage; - final int attackDamage; + IRON(Configurations.ironChiselMaxDamage, Configurations.ironChiselAttackDamage), + DIAMOND(Configurations.diamondChiselMaxDamage, Configurations.diamondChiselAttackDamage), + OBSIDIAN(Configurations.obsidianChiselMaxDamage, Configurations.obsidianChiselAttackDamage), + NETHERSTAR(Configurations.netherStarChiselMaxDamage, Configurations.netherStarChiselAttackDamage); - ChiselType(int maxDamage, int attackDamage) { - this.maxDamage = maxDamage; - this.attackDamage = attackDamage; - } - } + final int maxDamage; + final int attackDamage; - public static ICarvingRegistry carving = Carving.chisel; + ChiselType(int maxDamage, int attackDamage) { + this.maxDamage = maxDamage; + this.attackDamage = attackDamage; + } + } - private ChiselType type; + public static ICarvingRegistry carving = Carving.chisel; - public ItemChisel(ChiselType type) { - super(); - this.type = type; - setMaxStackSize(1); - setTextureName(Chisel.MOD_ID + ":chisel_" + type.name().toLowerCase(Locale.ENGLISH)); - if(type == ChiselType.NETHERSTAR && Chisel.gtnhLoaded) { - setUnlocalizedName(Chisel.MOD_ID + ".chisel_" + type.name().toLowerCase() + ".gtnh"); - } else { - setUnlocalizedName(Chisel.MOD_ID + ".chisel_" + type.name().toLowerCase()); - } - MinecraftForge.EVENT_BUS.register(this); - } + private ChiselType type; - @Override - public int getMaxDamage(ItemStack stack) { - if (Configurations.allowChiselDamage) - return type.maxDamage; - return 0; - } + public ItemChisel(ChiselType type) { + super(); + this.type = type; + setMaxStackSize(1); + setTextureName(Chisel.MOD_ID + ":chisel_" + type.name().toLowerCase(Locale.ENGLISH)); + if (type == ChiselType.NETHERSTAR && Chisel.gtnhLoaded) { + setUnlocalizedName(Chisel.MOD_ID + ".chisel_" + type.name().toLowerCase() + ".gtnh"); + } else { + setUnlocalizedName(Chisel.MOD_ID + ".chisel_" + type.name().toLowerCase()); + } + MinecraftForge.EVENT_BUS.register(this); + } - @Override - public boolean isDamageable() { - return Configurations.allowChiselDamage; - } + @Override + public int getMaxDamage(ItemStack stack) { + if (Configurations.allowChiselDamage) return type.maxDamage; + return 0; + } - @Override - public boolean getIsRepairable(ItemStack damagedItem, ItemStack repairMaterial) { - switch (type) { - case DIAMOND: - return repairMaterial.getItem().equals(Items.diamond); - case IRON: - return repairMaterial.getItem().equals(Items.iron_ingot); - case OBSIDIAN: - return repairMaterial.getItem().equals(Item.getItemFromBlock(Blocks.obsidian)); - case NETHERSTAR: - return repairMaterial.getItem().equals(Items.nether_star); - } - return false; - } + @Override + public boolean isDamageable() { + return Configurations.allowChiselDamage; + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean held) { - String base = "item.chisel.chisel.desc."; - String gui = I18n.format(base + "gui"); - String lc1 = I18n.format(base + "lc1"); - String lc2 = I18n.format(base + "lc2"); - String modes = I18n.format(base + "modes"); - list.add(gui); - if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || type == ChiselType.NETHERSTAR || Configurations.ironChiselCanLeftClick) { - list.add(lc1); - list.add(lc2); - } - if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || type == ChiselType.NETHERSTAR || Configurations.ironChiselHasModes) { - list.add(""); - list.add(modes); - } - } + @Override + public boolean getIsRepairable(ItemStack damagedItem, ItemStack repairMaterial) { + switch (type) { + case DIAMOND: + return repairMaterial.getItem().equals(Items.diamond); + case IRON: + return repairMaterial.getItem().equals(Items.iron_ingot); + case OBSIDIAN: + return repairMaterial.getItem().equals(Item.getItemFromBlock(Blocks.obsidian)); + case NETHERSTAR: + return repairMaterial.getItem().equals(Items.nether_star); + } + return false; + } - @Override - public boolean isFull3D() { - return true; - } + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean held) { + String base = "item.chisel.chisel.desc."; + String gui = I18n.format(base + "gui"); + String lc1 = I18n.format(base + "lc1"); + String lc2 = I18n.format(base + "lc2"); + String modes = I18n.format(base + "modes"); + list.add(gui); + if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN + || type == ChiselType.NETHERSTAR + || Configurations.ironChiselCanLeftClick) { + list.add(lc1); + list.add(lc2); + } + if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN + || type == ChiselType.NETHERSTAR + || Configurations.ironChiselHasModes) { + list.add(""); + list.add(modes); + } + } - @SuppressWarnings("rawtypes") - @Override - public Multimap getAttributeModifiers(ItemStack stack) { - Multimap multimap = HashMultimap.create(); - multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Chisel Damage", type.attackDamage, 0)); - return multimap; - } + @Override + public boolean isFull3D() { + return true; + } - @Override - public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { - stack.damageItem(1, attacker); - return super.hitEntity(stack, attacker, target); - } + @SuppressWarnings("rawtypes") + @Override + public Multimap getAttributeModifiers(ItemStack stack) { + Multimap multimap = HashMultimap.create(); + multimap.put( + SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), + new AttributeModifier(field_111210_e, "Chisel Damage", type.attackDamage, 0)); + return multimap; + } - @Override - public boolean canOpenGui(World world, EntityPlayer player, ItemStack chisel) { - return true; - } + @Override + public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { + stack.damageItem(1, attacker); + return super.hitEntity(stack, attacker, target); + } - @Override - public boolean canChisel(World world, ItemStack chisel, ICarvingVariation target) { - return true; - } + @Override + public boolean canOpenGui(World world, EntityPlayer player, ItemStack chisel) { + return true; + } - @Override - public boolean onChisel(World world, ItemStack chisel, ICarvingVariation target) { - return Configurations.allowChiselDamage; - } + @Override + public boolean canChisel(World world, ItemStack chisel, ICarvingVariation target) { + return true; + } - @Override - public boolean canChiselBlock(World world, EntityPlayer player, int x, int y, int z, Block block, int metadata) { - return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || type == ChiselType.NETHERSTAR || Configurations.ironChiselCanLeftClick; - } + @Override + public boolean onChisel(World world, ItemStack chisel, ICarvingVariation target) { + return Configurations.allowChiselDamage; + } - @Override - public boolean hasModes(ItemStack chisel) { - return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || type == ChiselType.NETHERSTAR || Configurations.ironChiselHasModes; - } -} \ No newline at end of file + @Override + public boolean canChiselBlock(World world, EntityPlayer player, int x, int y, int z, Block block, int metadata) { + return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN + || type == ChiselType.NETHERSTAR + || Configurations.ironChiselCanLeftClick; + } + + @Override + public boolean hasModes(ItemStack chisel) { + return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN + || type == ChiselType.NETHERSTAR + || Configurations.ironChiselHasModes; + } +} diff --git a/src/main/java/team/chisel/network/ChiselGuiHandler.java b/src/main/java/team/chisel/network/ChiselGuiHandler.java index bc533c29..e7714535 100644 --- a/src/main/java/team/chisel/network/ChiselGuiHandler.java +++ b/src/main/java/team/chisel/network/ChiselGuiHandler.java @@ -3,6 +3,7 @@ package team.chisel.network; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import team.chisel.block.tileentity.TileEntityAutoChisel; import team.chisel.block.tileentity.TileEntityPresent; import team.chisel.client.gui.GuiAutoChisel; @@ -16,39 +17,41 @@ import cpw.mods.fml.common.network.IGuiHandler; public class ChiselGuiHandler implements IGuiHandler { - @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch (ID) { - case 0: - return new ContainerChisel(player.inventory, new InventoryChiselSelection(player.getCurrentEquippedItem())); - case 1: - TileEntity tileentity = world.getTileEntity(x, y, z); - if (tileentity instanceof TileEntityAutoChisel) - return new ContainerAutoChisel(player.inventory, (TileEntityAutoChisel) tileentity); - case 2: - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity instanceof TileEntityPresent) - return new ContainerPresent(player.inventory, (TileEntityPresent) tileEntity); - default: - return null; - } - } + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + switch (ID) { + case 0: + return new ContainerChisel( + player.inventory, + new InventoryChiselSelection(player.getCurrentEquippedItem())); + case 1: + TileEntity tileentity = world.getTileEntity(x, y, z); + if (tileentity instanceof TileEntityAutoChisel) + return new ContainerAutoChisel(player.inventory, (TileEntityAutoChisel) tileentity); + case 2: + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityPresent) + return new ContainerPresent(player.inventory, (TileEntityPresent) tileEntity); + default: + return null; + } + } - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch (ID) { - case 0: - return new GuiChisel(player.inventory, new InventoryChiselSelection(player.getCurrentEquippedItem())); - case 1: - TileEntity tileentity = world.getTileEntity(x, y, z); - if (tileentity instanceof TileEntityAutoChisel) - return new GuiAutoChisel(player.inventory, (TileEntityAutoChisel) tileentity); - case 2: - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity instanceof TileEntityPresent) - return new GuiPresent(player.inventory, (TileEntityPresent) tileEntity); - default: - return null; - } - } + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + switch (ID) { + case 0: + return new GuiChisel(player.inventory, new InventoryChiselSelection(player.getCurrentEquippedItem())); + case 1: + TileEntity tileentity = world.getTileEntity(x, y, z); + if (tileentity instanceof TileEntityAutoChisel) + return new GuiAutoChisel(player.inventory, (TileEntityAutoChisel) tileentity); + case 2: + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityPresent) + return new GuiPresent(player.inventory, (TileEntityPresent) tileEntity); + default: + return null; + } + } } diff --git a/src/main/java/team/chisel/network/PacketHandler.java b/src/main/java/team/chisel/network/PacketHandler.java index 19e69852..e18f059f 100644 --- a/src/main/java/team/chisel/network/PacketHandler.java +++ b/src/main/java/team/chisel/network/PacketHandler.java @@ -12,16 +12,16 @@ import cpw.mods.fml.relauncher.Side; public class PacketHandler { - public static final SimpleNetworkWrapper INSTANCE = new SimpleNetworkWrapper(Chisel.MOD_ID); + public static final SimpleNetworkWrapper INSTANCE = new SimpleNetworkWrapper(Chisel.MOD_ID); - public static void init() { - int id = 0; + public static void init() { + int id = 0; - INSTANCE.registerMessage(MessageChiselSound.Handler.class, MessageChiselSound.class, id++, Side.CLIENT); - INSTANCE.registerMessage(MessageSlotUpdate.Handler.class, MessageSlotUpdate.class, id++, Side.CLIENT); - INSTANCE.registerMessage(MessageAutoChisel.Handler.class, MessageAutoChisel.class, id++, Side.CLIENT); - INSTANCE.registerMessage(MessageChiselMode.Handler.class, MessageChiselMode.class, id++, Side.SERVER); - INSTANCE.registerMessage(MessagePresentConnect.Handler.class, MessagePresentConnect.class, id++, Side.CLIENT); - INSTANCE.registerMessage(MessageScrollUpdate.Handler.class, MessageScrollUpdate.class, id++, Side.SERVER); - } + INSTANCE.registerMessage(MessageChiselSound.Handler.class, MessageChiselSound.class, id++, Side.CLIENT); + INSTANCE.registerMessage(MessageSlotUpdate.Handler.class, MessageSlotUpdate.class, id++, Side.CLIENT); + INSTANCE.registerMessage(MessageAutoChisel.Handler.class, MessageAutoChisel.class, id++, Side.CLIENT); + INSTANCE.registerMessage(MessageChiselMode.Handler.class, MessageChiselMode.class, id++, Side.SERVER); + INSTANCE.registerMessage(MessagePresentConnect.Handler.class, MessagePresentConnect.class, id++, Side.CLIENT); + INSTANCE.registerMessage(MessageScrollUpdate.Handler.class, MessageScrollUpdate.class, id++, Side.SERVER); + } } diff --git a/src/main/java/team/chisel/network/message/MessageAutoChisel.java b/src/main/java/team/chisel/network/message/MessageAutoChisel.java index b7564561..d52e6fd3 100644 --- a/src/main/java/team/chisel/network/message/MessageAutoChisel.java +++ b/src/main/java/team/chisel/network/message/MessageAutoChisel.java @@ -1,64 +1,65 @@ package team.chisel.network.message; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import team.chisel.block.tileentity.TileEntityAutoChisel; import team.chisel.network.message.base.MessageCoords; -import io.netty.buffer.ByteBuf; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import io.netty.buffer.ByteBuf; public class MessageAutoChisel extends MessageCoords { - public MessageAutoChisel() { - } + public MessageAutoChisel() {} - ItemStack base; - boolean playSound, breakChisel; - int chiseled; + ItemStack base; + boolean playSound, breakChisel; + int chiseled; - public MessageAutoChisel(TileEntityAutoChisel tile, int chiseled, boolean playSound, boolean breakChisel) { - super(tile); - this.base = tile.getStackInSlot(TileEntityAutoChisel.BASE); - if (base != null) { - base = base.copy(); - } - this.playSound = playSound; - this.breakChisel = breakChisel; - this.chiseled = chiseled; - } + public MessageAutoChisel(TileEntityAutoChisel tile, int chiseled, boolean playSound, boolean breakChisel) { + super(tile); + this.base = tile.getStackInSlot(TileEntityAutoChisel.BASE); + if (base != null) { + base = base.copy(); + } + this.playSound = playSound; + this.breakChisel = breakChisel; + this.chiseled = chiseled; + } - @Override - public void toBytes(ByteBuf buf) { - super.toBytes(buf); - buf.writeBoolean(playSound); - buf.writeBoolean(breakChisel); - buf.writeInt(chiseled); - ByteBufUtils.writeItemStack(buf, base); - } + @Override + public void toBytes(ByteBuf buf) { + super.toBytes(buf); + buf.writeBoolean(playSound); + buf.writeBoolean(breakChisel); + buf.writeInt(chiseled); + ByteBufUtils.writeItemStack(buf, base); + } - @Override - public void fromBytes(ByteBuf buf) { - super.fromBytes(buf); - this.playSound = buf.readBoolean(); - this.breakChisel = buf.readBoolean(); - this.chiseled = buf.readInt(); - this.base = ByteBufUtils.readItemStack(buf); - } + @Override + public void fromBytes(ByteBuf buf) { + super.fromBytes(buf); + this.playSound = buf.readBoolean(); + this.breakChisel = buf.readBoolean(); + this.chiseled = buf.readInt(); + this.base = ByteBufUtils.readItemStack(buf); + } - public static class Handler implements IMessageHandler { + public static class Handler implements IMessageHandler { - @Override - public IMessage onMessage(MessageAutoChisel message, MessageContext ctx) { + @Override + public IMessage onMessage(MessageAutoChisel message, MessageContext ctx) { - TileEntity te = message.getTileEntity(ctx); - if (te instanceof TileEntityAutoChisel) { - ((TileEntityAutoChisel) te).doChiselAnim(message.base, message.chiseled, message.playSound, message.breakChisel); - } - return null; - } - } + TileEntity te = message.getTileEntity(ctx); + if (te instanceof TileEntityAutoChisel) { + ((TileEntityAutoChisel) te) + .doChiselAnim(message.base, message.chiseled, message.playSound, message.breakChisel); + } + return null; + } + } } diff --git a/src/main/java/team/chisel/network/message/MessageChiselMode.java b/src/main/java/team/chisel/network/message/MessageChiselMode.java index fd2e1bc9..10ca5208 100644 --- a/src/main/java/team/chisel/network/message/MessageChiselMode.java +++ b/src/main/java/team/chisel/network/message/MessageChiselMode.java @@ -1,52 +1,53 @@ package team.chisel.network.message; +import net.minecraft.item.ItemStack; + +import team.chisel.item.chisel.ChiselMode; +import team.chisel.utils.General; + import com.cricketcraft.chisel.api.IAdvancedChisel; import com.cricketcraft.chisel.api.IChiselItem; import com.cricketcraft.chisel.api.carving.IChiselMode; -import team.chisel.item.chisel.ChiselMode; -import team.chisel.utils.General; -import io.netty.buffer.ByteBuf; -import net.minecraft.item.ItemStack; import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import io.netty.buffer.ByteBuf; public class MessageChiselMode implements IMessage { - public MessageChiselMode() { - } + public MessageChiselMode() {} - private String mode; + private String mode; - public MessageChiselMode(IChiselMode iChiselMode) { - this.mode = iChiselMode.name(); - } + public MessageChiselMode(IChiselMode iChiselMode) { + this.mode = iChiselMode.name(); + } - @Override - public void toBytes(ByteBuf buf) { - ByteBufUtils.writeUTF8String(buf, mode); - } + @Override + public void toBytes(ByteBuf buf) { + ByteBufUtils.writeUTF8String(buf, mode); + } - @Override - public void fromBytes(ByteBuf buf) { - this.mode = ByteBufUtils.readUTF8String(buf); - } + @Override + public void fromBytes(ByteBuf buf) { + this.mode = ByteBufUtils.readUTF8String(buf); + } - public static class Handler implements IMessageHandler { + public static class Handler implements IMessageHandler { - @Override - public IMessage onMessage(MessageChiselMode message, MessageContext ctx) { - ItemStack stack = ctx.getServerHandler().playerEntity.getCurrentEquippedItem(); - if (stack != null && stack.getItem() instanceof IChiselItem) { - if (stack.getItem() instanceof IAdvancedChisel) { - General.setChiselMode(stack, ((IAdvancedChisel) stack.getItem()).getMode(stack, message.mode)); - } else { - General.setChiselMode(stack, ChiselMode.valueOf(message.mode)); - } - } - return null; - } - } + @Override + public IMessage onMessage(MessageChiselMode message, MessageContext ctx) { + ItemStack stack = ctx.getServerHandler().playerEntity.getCurrentEquippedItem(); + if (stack != null && stack.getItem() instanceof IChiselItem) { + if (stack.getItem() instanceof IAdvancedChisel) { + General.setChiselMode(stack, ((IAdvancedChisel) stack.getItem()).getMode(stack, message.mode)); + } else { + General.setChiselMode(stack, ChiselMode.valueOf(message.mode)); + } + } + return null; + } + } } diff --git a/src/main/java/team/chisel/network/message/MessageChiselSound.java b/src/main/java/team/chisel/network/message/MessageChiselSound.java index 1c2db9a7..2a680996 100644 --- a/src/main/java/team/chisel/network/message/MessageChiselSound.java +++ b/src/main/java/team/chisel/network/message/MessageChiselSound.java @@ -1,62 +1,64 @@ package team.chisel.network.message; -import com.cricketcraft.chisel.api.carving.ICarvingVariation; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; import team.chisel.Chisel; import team.chisel.client.GeneralChiselClient; import team.chisel.item.chisel.ItemChisel; import team.chisel.network.message.base.MessageCoords; -import io.netty.buffer.ByteBuf; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; + +import com.cricketcraft.chisel.api.carving.ICarvingVariation; + import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import io.netty.buffer.ByteBuf; public class MessageChiselSound extends MessageCoords { - public MessageChiselSound() { - super(); - } + public MessageChiselSound() { + super(); + } - private int block; - private byte meta; - private boolean breakChisel; + private int block; + private byte meta; + private boolean breakChisel; - public MessageChiselSound(int x, int y, int z, ICarvingVariation v, boolean breakChisel) { - super(x, y, z); - this.block = Block.getIdFromBlock(v.getBlock()); - this.meta = (byte) v.getBlockMeta(); - this.breakChisel = breakChisel; - } + public MessageChiselSound(int x, int y, int z, ICarvingVariation v, boolean breakChisel) { + super(x, y, z); + this.block = Block.getIdFromBlock(v.getBlock()); + this.meta = (byte) v.getBlockMeta(); + this.breakChisel = breakChisel; + } - @Override - public void toBytes(ByteBuf buf) { - super.toBytes(buf); - buf.writeInt(block); - buf.writeByte(meta); - buf.writeBoolean(breakChisel); - } + @Override + public void toBytes(ByteBuf buf) { + super.toBytes(buf); + buf.writeInt(block); + buf.writeByte(meta); + buf.writeBoolean(breakChisel); + } - @Override - public void fromBytes(ByteBuf buf) { - super.fromBytes(buf); - block = buf.readInt(); - meta = buf.readByte(); - breakChisel = buf.readBoolean(); - } + @Override + public void fromBytes(ByteBuf buf) { + super.fromBytes(buf); + block = buf.readInt(); + meta = buf.readByte(); + breakChisel = buf.readBoolean(); + } - public static class Handler implements IMessageHandler { + public static class Handler implements IMessageHandler { - @Override - public IMessage onMessage(MessageChiselSound message, MessageContext ctx) { - String sound = ItemChisel.carving.getVariationSound(Block.getBlockById(message.block), message.meta); - GeneralChiselClient.spawnChiselEffect(message.x, message.y, message.z, sound); - if (message.breakChisel) { - EntityPlayer player = Chisel.proxy.getClientPlayer(); - player.renderBrokenItemStack(player.getCurrentEquippedItem()); - } - return null; - } - } + @Override + public IMessage onMessage(MessageChiselSound message, MessageContext ctx) { + String sound = ItemChisel.carving.getVariationSound(Block.getBlockById(message.block), message.meta); + GeneralChiselClient.spawnChiselEffect(message.x, message.y, message.z, sound); + if (message.breakChisel) { + EntityPlayer player = Chisel.proxy.getClientPlayer(); + player.renderBrokenItemStack(player.getCurrentEquippedItem()); + } + return null; + } + } } diff --git a/src/main/java/team/chisel/network/message/MessagePresentConnect.java b/src/main/java/team/chisel/network/message/MessagePresentConnect.java index b266c28d..450393fd 100644 --- a/src/main/java/team/chisel/network/message/MessagePresentConnect.java +++ b/src/main/java/team/chisel/network/message/MessagePresentConnect.java @@ -1,64 +1,66 @@ package team.chisel.network.message; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import team.chisel.block.tileentity.TileEntityPresent; import team.chisel.network.message.base.MessageCoords; -import io.netty.buffer.ByteBuf; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import io.netty.buffer.ByteBuf; public class MessagePresentConnect extends MessageCoords { - private ForgeDirection dir; - private boolean connect, preserveDir; + private ForgeDirection dir; + private boolean connect, preserveDir; - public MessagePresentConnect() { - super(); - } + public MessagePresentConnect() { + super(); + } - public MessagePresentConnect(TileEntityPresent present, ForgeDirection dir, boolean connecting) { - this(present, dir, connecting, false); - } + public MessagePresentConnect(TileEntityPresent present, ForgeDirection dir, boolean connecting) { + this(present, dir, connecting, false); + } - public MessagePresentConnect(TileEntityPresent present, ForgeDirection dir, boolean connecting, boolean preserveDir) { - super(present); - this.dir = dir; - this.connect = connecting; - this.preserveDir = preserveDir; - } + public MessagePresentConnect(TileEntityPresent present, ForgeDirection dir, boolean connecting, + boolean preserveDir) { + super(present); + this.dir = dir; + this.connect = connecting; + this.preserveDir = preserveDir; + } - @Override - public void toBytes(ByteBuf buf) { - super.toBytes(buf); - buf.writeInt(dir.ordinal()); - buf.writeBoolean(connect); - buf.writeBoolean(preserveDir); - } + @Override + public void toBytes(ByteBuf buf) { + super.toBytes(buf); + buf.writeInt(dir.ordinal()); + buf.writeBoolean(connect); + buf.writeBoolean(preserveDir); + } - @Override - public void fromBytes(ByteBuf buf) { - super.fromBytes(buf); - dir = ForgeDirection.values()[buf.readInt()]; - connect = buf.readBoolean(); - preserveDir = buf.readBoolean(); - } + @Override + public void fromBytes(ByteBuf buf) { + super.fromBytes(buf); + dir = ForgeDirection.values()[buf.readInt()]; + connect = buf.readBoolean(); + preserveDir = buf.readBoolean(); + } - public static class Handler implements IMessageHandler { + public static class Handler implements IMessageHandler { - @Override - public IMessage onMessage(MessagePresentConnect message, MessageContext ctx) { - TileEntity te = message.getTileEntity(ctx); - if (te instanceof TileEntityPresent) { - if (message.connect) { - ((TileEntityPresent) te).connectTo(message.dir); - } else { - ((TileEntityPresent) te).disconnect(message.preserveDir); - } - } - return null; - } - } + @Override + public IMessage onMessage(MessagePresentConnect message, MessageContext ctx) { + TileEntity te = message.getTileEntity(ctx); + if (te instanceof TileEntityPresent) { + if (message.connect) { + ((TileEntityPresent) te).connectTo(message.dir); + } else { + ((TileEntityPresent) te).disconnect(message.preserveDir); + } + } + return null; + } + } } diff --git a/src/main/java/team/chisel/network/message/MessageScrollUpdate.java b/src/main/java/team/chisel/network/message/MessageScrollUpdate.java index f565541a..e25d424d 100644 --- a/src/main/java/team/chisel/network/message/MessageScrollUpdate.java +++ b/src/main/java/team/chisel/network/message/MessageScrollUpdate.java @@ -1,18 +1,18 @@ package team.chisel.network.message; +import net.minecraft.inventory.Container; + +import team.chisel.inventory.ContainerChisel; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; -import net.minecraft.inventory.Container; -import team.chisel.inventory.ContainerChisel; public class MessageScrollUpdate implements IMessage { private int currentScroll; - public MessageScrollUpdate() { - } + public MessageScrollUpdate() {} public MessageScrollUpdate(int scroll) { currentScroll = scroll; diff --git a/src/main/java/team/chisel/network/message/MessageSlotUpdate.java b/src/main/java/team/chisel/network/message/MessageSlotUpdate.java index 0f9cab22..89637797 100644 --- a/src/main/java/team/chisel/network/message/MessageSlotUpdate.java +++ b/src/main/java/team/chisel/network/message/MessageSlotUpdate.java @@ -1,54 +1,54 @@ package team.chisel.network.message; -import team.chisel.Chisel; -import team.chisel.network.message.base.MessageCoords; -import io.netty.buffer.ByteBuf; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; + +import team.chisel.Chisel; +import team.chisel.network.message.base.MessageCoords; import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import io.netty.buffer.ByteBuf; public class MessageSlotUpdate extends MessageCoords { - public MessageSlotUpdate() { - } + public MessageSlotUpdate() {} - private int slot; - private ItemStack stack; + private int slot; + private ItemStack stack; - public MessageSlotUpdate(TileEntity te, int slot, ItemStack stack) { - super(te); - this.slot = slot; - this.stack = stack; - } + public MessageSlotUpdate(TileEntity te, int slot, ItemStack stack) { + super(te); + this.slot = slot; + this.stack = stack; + } - @Override - public void toBytes(ByteBuf buf) { - super.toBytes(buf); - buf.writeInt(slot); - ByteBufUtils.writeItemStack(buf, stack); - } + @Override + public void toBytes(ByteBuf buf) { + super.toBytes(buf); + buf.writeInt(slot); + ByteBufUtils.writeItemStack(buf, stack); + } - @Override - public void fromBytes(ByteBuf buf) { - super.fromBytes(buf); - this.slot = buf.readInt(); - this.stack = ByteBufUtils.readItemStack(buf); - } + @Override + public void fromBytes(ByteBuf buf) { + super.fromBytes(buf); + this.slot = buf.readInt(); + this.stack = ByteBufUtils.readItemStack(buf); + } - public static class Handler implements IMessageHandler { + public static class Handler implements IMessageHandler { - @Override - public IMessage onMessage(MessageSlotUpdate message, MessageContext ctx) { - TileEntity te = Chisel.proxy.getClientWorld().getTileEntity(message.x, message.y, message.z); - if (te != null && te instanceof IInventory) { - ((IInventory) te).setInventorySlotContents(message.slot, message.stack); - } - return null; - } - } + @Override + public IMessage onMessage(MessageSlotUpdate message, MessageContext ctx) { + TileEntity te = Chisel.proxy.getClientWorld().getTileEntity(message.x, message.y, message.z); + if (te != null && te instanceof IInventory) { + ((IInventory) te).setInventorySlotContents(message.slot, message.stack); + } + return null; + } + } } diff --git a/src/main/java/team/chisel/network/message/base/MessageCoords.java b/src/main/java/team/chisel/network/message/base/MessageCoords.java index ed2170b2..c8570c4c 100644 --- a/src/main/java/team/chisel/network/message/base/MessageCoords.java +++ b/src/main/java/team/chisel/network/message/base/MessageCoords.java @@ -1,59 +1,60 @@ package team.chisel.network.message.base; -import team.chisel.Chisel; -import io.netty.buffer.ByteBuf; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + +import team.chisel.Chisel; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import cpw.mods.fml.relauncher.Side; +import io.netty.buffer.ByteBuf; public abstract class MessageCoords implements IMessage { - public int x, y, z; + public int x, y, z; - protected MessageCoords() { - ; - } + protected MessageCoords() { + ; + } - protected MessageCoords(int x, int y, int z) { - this.x = x; - this.y = y; - this.z = z; - } + protected MessageCoords(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } - protected MessageCoords(TileEntity te) { - this(te.xCoord, te.yCoord, te.zCoord); - } + protected MessageCoords(TileEntity te) { + this(te.xCoord, te.yCoord, te.zCoord); + } - @Override - public void toBytes(ByteBuf buf) { - buf.writeInt(x); - buf.writeInt(y); - buf.writeInt(z); - } + @Override + public void toBytes(ByteBuf buf) { + buf.writeInt(x); + buf.writeInt(y); + buf.writeInt(z); + } - @Override - public void fromBytes(ByteBuf buf) { - this.x = buf.readInt(); - this.y = buf.readInt(); - this.z = buf.readInt(); - } + @Override + public void fromBytes(ByteBuf buf) { + this.x = buf.readInt(); + this.y = buf.readInt(); + this.z = buf.readInt(); + } - protected Block getBlock(MessageContext ctx) { - return getWorld(ctx).getBlock(x, y, z); - } + protected Block getBlock(MessageContext ctx) { + return getWorld(ctx).getBlock(x, y, z); + } - protected TileEntity getTileEntity(MessageContext ctx) { - return getWorld(ctx).getTileEntity(x, y, z); - } + protected TileEntity getTileEntity(MessageContext ctx) { + return getWorld(ctx).getTileEntity(x, y, z); + } - protected World getWorld(MessageContext ctx) { - if (ctx.side == Side.CLIENT) { - return Chisel.proxy.getClientWorld(); - } else { - return ctx.getServerHandler().playerEntity.worldObj; - } - } + protected World getWorld(MessageContext ctx) { + if (ctx.side == Side.CLIENT) { + return Chisel.proxy.getClientWorld(); + } else { + return ctx.getServerHandler().playerEntity.worldObj; + } + } } diff --git a/src/main/java/team/chisel/proxy/ClientProxy.java b/src/main/java/team/chisel/proxy/ClientProxy.java index 9c66ad9d..13d2510b 100644 --- a/src/main/java/team/chisel/proxy/ClientProxy.java +++ b/src/main/java/team/chisel/proxy/ClientProxy.java @@ -6,6 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; + import team.chisel.Features; import team.chisel.block.BlockCarvableBeacon; import team.chisel.block.tileentity.TileEntityAutoChisel; @@ -36,72 +37,77 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class ClientProxy extends CommonProxy { - ItemChiselRenderer renderer = new ItemChiselRenderer(); + ItemChiselRenderer renderer = new ItemChiselRenderer(); - @Override - public void preInit() { - } + @Override + public void preInit() {} - @Override - public void init() { - RenderingRegistry.registerBlockHandler(new RendererCTM()); - RenderingRegistry.registerBlockHandler(new RendererStairs()); - RenderingRegistry.registerBlockHandler(new RendererCTMPane()); - RenderingRegistry.registerBlockHandler(new RendererRoadLine()); - RenderingRegistry.registerBlockHandler(new RendererSnakeStone()); - RenderingRegistry.registerBlockHandler(new RendererEldritch()); - RenderingRegistry.registerBlockHandler(new RendererLayeredGlow()); - RenderingRegistry.registerBlockHandler(new RendererSimpleLayered()); - RenderingRegistry.registerBlockHandler(new RendererMultiLayer()); + @Override + public void init() { + RenderingRegistry.registerBlockHandler(new RendererCTM()); + RenderingRegistry.registerBlockHandler(new RendererStairs()); + RenderingRegistry.registerBlockHandler(new RendererCTMPane()); + RenderingRegistry.registerBlockHandler(new RendererRoadLine()); + RenderingRegistry.registerBlockHandler(new RendererSnakeStone()); + RenderingRegistry.registerBlockHandler(new RendererEldritch()); + RenderingRegistry.registerBlockHandler(new RendererLayeredGlow()); + RenderingRegistry.registerBlockHandler(new RendererSimpleLayered()); + RenderingRegistry.registerBlockHandler(new RendererMultiLayer()); - if (Features.AUTO_CHISEL.enabled()) { - RenderAutoChisel rac = new RenderAutoChisel(); - RenderingRegistry.registerBlockHandler(rac); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ChiselBlocks.autoChisel), rac); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAutoChisel.class, rac); - } + if (Features.AUTO_CHISEL.enabled()) { + RenderAutoChisel rac = new RenderAutoChisel(); + RenderingRegistry.registerBlockHandler(rac); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ChiselBlocks.autoChisel), rac); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAutoChisel.class, rac); + } - if (Features.BEACON.enabled()) { - RenderCarvableBeacon rcb = new RenderCarvableBeacon(); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCarvableBeacon.class, rcb); - RenderingRegistry.registerBlockHandler(rcb); - BlockCarvableBeacon.renderId = rcb.getRenderId(); - } + if (Features.BEACON.enabled()) { + RenderCarvableBeacon rcb = new RenderCarvableBeacon(); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCarvableBeacon.class, rcb); + RenderingRegistry.registerBlockHandler(rcb); + BlockCarvableBeacon.renderId = rcb.getRenderId(); + } - if (Features.PRESENT.enabled()) { - RenderPresent rp = new RenderPresent(); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ChiselBlocks.present), rp); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPresent.class, rp); - } + if (Features.PRESENT.enabled()) { + RenderPresent rp = new RenderPresent(); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ChiselBlocks.present), rp); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPresent.class, rp); + } - if (Features.CLOUD.enabled()) { - RenderingRegistry.registerEntityRenderingHandler(EntityCloudInABottle.class, new RenderSnowball(ChiselItems.cloudinabottle)); - } - if (Features.BALL_OF_MOSS.enabled()) { - RenderingRegistry.registerEntityRenderingHandler(EntityBallOMoss.class, new RenderSnowball(ChiselItems.ballomoss)); - } - if (Features.SMASHING_ROCK.enabled()) { - RenderingRegistry.registerEntityRenderingHandler(EntitySmashingRock.class, new RenderSnowball(ChiselItems.smashingrock)); - } - if (Features.PUMPKIN.enabled()) { - RenderingRegistry.registerEntityRenderingHandler(EntityChiselSnowman.class, new RenderChiselSnowman()); - } + if (Features.CLOUD.enabled()) { + RenderingRegistry.registerEntityRenderingHandler( + EntityCloudInABottle.class, + new RenderSnowball(ChiselItems.cloudinabottle)); + } + if (Features.BALL_OF_MOSS.enabled()) { + RenderingRegistry + .registerEntityRenderingHandler(EntityBallOMoss.class, new RenderSnowball(ChiselItems.ballomoss)); + } + if (Features.SMASHING_ROCK.enabled()) { + RenderingRegistry.registerEntityRenderingHandler( + EntitySmashingRock.class, + new RenderSnowball(ChiselItems.smashingrock)); + } + if (Features.PUMPKIN.enabled()) { + RenderingRegistry.registerEntityRenderingHandler(EntityChiselSnowman.class, new RenderChiselSnowman()); + } - if (Features.CHISEL.enabled()) { - MinecraftForgeClient.registerItemRenderer(ChiselItems.chisel, renderer); - MinecraftForgeClient.registerItemRenderer(ChiselItems.diamondChisel, renderer); - } + if (Features.CHISEL.enabled()) { + MinecraftForgeClient.registerItemRenderer(ChiselItems.chisel, renderer); + MinecraftForgeClient.registerItemRenderer(ChiselItems.diamondChisel, renderer); + } -// MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ChiselBlocks.antiBlock), new SubmapManagerAntiblock.AntiblockItemRenderer()); - } + // MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ChiselBlocks.antiBlock), new + // SubmapManagerAntiblock.AntiblockItemRenderer()); + } - @Override - public EntityPlayer getClientPlayer() { - return Minecraft.getMinecraft().thePlayer; - } + @Override + public EntityPlayer getClientPlayer() { + return Minecraft.getMinecraft().thePlayer; + } - @Override - public World getClientWorld() { - return Minecraft.getMinecraft().theWorld; - } + @Override + public World getClientWorld() { + return Minecraft.getMinecraft().theWorld; + } } diff --git a/src/main/java/team/chisel/proxy/CommonProxy.java b/src/main/java/team/chisel/proxy/CommonProxy.java index c50e8ce8..902e1c78 100644 --- a/src/main/java/team/chisel/proxy/CommonProxy.java +++ b/src/main/java/team/chisel/proxy/CommonProxy.java @@ -1,31 +1,30 @@ package team.chisel.proxy; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + import team.chisel.block.tileentity.TileEntityAutoChisel; import team.chisel.block.tileentity.TileEntityCarvableBeacon; import team.chisel.block.tileentity.TileEntityPresent; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; import cpw.mods.fml.common.registry.GameRegistry; public class CommonProxy { - public void registerTileEntities() { - GameRegistry.registerTileEntity(TileEntityAutoChisel.class, "autoChisel"); - GameRegistry.registerTileEntity(TileEntityPresent.class, "tile.chisel.present"); - GameRegistry.registerTileEntity(TileEntityCarvableBeacon.class, "tile.chisel.beacon"); - } + public void registerTileEntities() { + GameRegistry.registerTileEntity(TileEntityAutoChisel.class, "autoChisel"); + GameRegistry.registerTileEntity(TileEntityPresent.class, "tile.chisel.present"); + GameRegistry.registerTileEntity(TileEntityCarvableBeacon.class, "tile.chisel.beacon"); + } - public void preInit() { - } + public void preInit() {} - public void init() { - } + public void init() {} - public EntityPlayer getClientPlayer() { - return null; - } + public EntityPlayer getClientPlayer() { + return null; + } - public World getClientWorld() { - return null; - } + public World getClientWorld() { + return null; + } } diff --git a/src/main/java/team/chisel/utils/General.java b/src/main/java/team/chisel/utils/General.java index 5e5f405d..5f073b68 100644 --- a/src/main/java/team/chisel/utils/General.java +++ b/src/main/java/team/chisel/utils/General.java @@ -2,14 +2,8 @@ package team.chisel.utils; import java.util.Random; -import com.cricketcraft.chisel.api.IAdvancedChisel; -import com.cricketcraft.chisel.api.carving.CarvingUtils; -import com.cricketcraft.chisel.api.carving.ICarvingVariation; -import com.cricketcraft.chisel.api.carving.IChiselMode; - -import team.chisel.carving.Carving; -import team.chisel.item.chisel.ChiselMode; import joptsimple.internal.Strings; + import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -22,135 +16,152 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import team.chisel.carving.Carving; +import team.chisel.item.chisel.ChiselMode; + +import com.cricketcraft.chisel.api.IAdvancedChisel; +import com.cricketcraft.chisel.api.carving.CarvingUtils; +import com.cricketcraft.chisel.api.carving.ICarvingVariation; +import com.cricketcraft.chisel.api.carving.IChiselMode; + public class General { - public static Random rand = new Random(); + public static Random rand = new Random(); - public static void propelTowards(Entity what, Entity whereTo, double force) { - double dx = whereTo.posX - what.posX; - double dy = whereTo.posY - what.posY; - double dz = whereTo.posZ - what.posZ; - double total = Math.sqrt(dx * dx + dy * dy + dz * dz); + public static void propelTowards(Entity what, Entity whereTo, double force) { + double dx = whereTo.posX - what.posX; + double dy = whereTo.posY - what.posY; + double dz = whereTo.posZ - what.posZ; + double total = Math.sqrt(dx * dx + dy * dy + dz * dz); - if (total == 0) { - what.motionX = 0; - what.motionY = 0; - what.motionZ = 0; - } else { - what.motionX = dx / total * force; - what.motionY = dy / total * force; - what.motionZ = dz / total * force; - } - } + if (total == 0) { + what.motionX = 0; + what.motionY = 0; + what.motionZ = 0; + } else { + what.motionX = dx / total * force; + what.motionY = dy / total * force; + what.motionZ = dz / total * force; + } + } - public static boolean isInRange(double distance, double x1, double y1, double z1, double x2, double y2, double z2) { - double x = x1 - x2; - double y = y1 - y2; - double z = z1 - z2; + public static boolean isInRange(double distance, double x1, double y1, double z1, double x2, double y2, double z2) { + double x = x1 - x2; + double y = y1 - y2; + double z = z1 - z2; - return x * x + y * y + z * z < distance * distance; - } + return x * x + y * y + z * z < distance * distance; + } - public static Item getItem(ItemStack stack) { - if (stack == null) - return null; - if (stack.getItem() == null) - return null; + public static Item getItem(ItemStack stack) { + if (stack == null) return null; + if (stack.getItem() == null) return null; - return stack.getItem(); - } + return stack.getItem(); + } - public static String getName(Item item) { - String res = item.getUnlocalizedName(); - return cleanTags(res); - } + public static String getName(Item item) { + String res = item.getUnlocalizedName(); + return cleanTags(res); + } - public static String getName(Block block) { - String res = block.getUnlocalizedName(); - return cleanTags(res); - } + public static String getName(Block block) { + String res = block.getUnlocalizedName(); + return cleanTags(res); + } - public static String cleanTags(String tag) { - return tag.replaceAll("[Cc]hisel\\p{Punct}", "").replaceFirst("^tile\\.", "").replaceFirst("^item\\.", ""); - } + public static String cleanTags(String tag) { + return tag.replaceAll("[Cc]hisel\\p{Punct}", "").replaceFirst("^tile\\.", "").replaceFirst("^item\\.", ""); + } - public static MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3) { - float var4 = 1.0F; - float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4; - float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4; - double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * var4; - double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * var4 + 1.62D - par2EntityPlayer.yOffset; - double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * var4; - // TODO- 1.7.10 fix? - Vec3 var13 = Vec3.createVectorHelper(var7, var9, var11); - float var14 = MathHelper.cos(-var6 * 0.017453292F - (float) Math.PI); - float var15 = MathHelper.sin(-var6 * 0.017453292F - (float) Math.PI); - float var16 = -MathHelper.cos(-var5 * 0.017453292F); - float var17 = MathHelper.sin(-var5 * 0.017453292F); - float var18 = var15 * var16; - float var20 = var14 * var16; - double var21 = 5.0D; + public static MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, + boolean par3) { + float var4 = 1.0F; + float var5 = par2EntityPlayer.prevRotationPitch + + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4; + float var6 = par2EntityPlayer.prevRotationYaw + + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4; + double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * var4; + double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * var4 + + 1.62D + - par2EntityPlayer.yOffset; + double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * var4; + // TODO- 1.7.10 fix? + Vec3 var13 = Vec3.createVectorHelper(var7, var9, var11); + float var14 = MathHelper.cos(-var6 * 0.017453292F - (float) Math.PI); + float var15 = MathHelper.sin(-var6 * 0.017453292F - (float) Math.PI); + float var16 = -MathHelper.cos(-var5 * 0.017453292F); + float var17 = MathHelper.sin(-var5 * 0.017453292F); + float var18 = var15 * var16; + float var20 = var14 * var16; + double var21 = 5.0D; - if (par2EntityPlayer instanceof EntityPlayerMP) { - var21 = ((EntityPlayerMP) par2EntityPlayer).theItemInWorldManager.getBlockReachDistance(); - } + if (par2EntityPlayer instanceof EntityPlayerMP) { + var21 = ((EntityPlayerMP) par2EntityPlayer).theItemInWorldManager.getBlockReachDistance(); + } - Vec3 var23 = var13.addVector(var18 * var21, var17 * var21, var20 * var21); - return par1World.rayTraceBlocks(var13, var23, par3); - } + Vec3 var23 = var13.addVector(var18 * var21, var17 * var21, var20 * var21); + return par1World.rayTraceBlocks(var13, var23, par3); + } - public static ItemStack getChiselTarget(ItemStack chisel) { - return chisel.hasTagCompound() ? ItemStack.loadItemStackFromNBT(chisel.stackTagCompound.getCompoundTag("chiselTarget")) : null; - } + public static ItemStack getChiselTarget(ItemStack chisel) { + return chisel.hasTagCompound() + ? ItemStack.loadItemStackFromNBT(chisel.stackTagCompound.getCompoundTag("chiselTarget")) + : null; + } - public static final String[] sGNames = new String[] { "White", "Orange", "Magenta", "Light Blue", "Yellow", "Lime", "Pink", "Gray", "Light Gray", "Cyan", "Purple", "Blue", "Brown", "Green", - "Red", "Black" }; + public static final String[] sGNames = new String[] { "White", "Orange", "Magenta", "Light Blue", "Yellow", "Lime", + "Pink", "Gray", "Light Gray", "Cyan", "Purple", "Blue", "Brown", "Green", "Red", "Black" }; - public static final String[] featureColors = new String[] { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "darkgray", "lightgray", "cyan", "purple", "blue", "brown", - "green", "red", "black" }; + public static final String[] featureColors = new String[] { "white", "orange", "magenta", "lightblue", "yellow", + "lime", "pink", "darkgray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" }; - public static void setChiselTarget(ItemStack chisel, ItemStack target) { - initTag(chisel); - NBTTagCompound targetTag = new NBTTagCompound(); - if (target != null) { - target.writeToNBT(targetTag); - } - chisel.getTagCompound().setTag("chiselTarget", targetTag); - } + public static void setChiselTarget(ItemStack chisel, ItemStack target) { + initTag(chisel); + NBTTagCompound targetTag = new NBTTagCompound(); + if (target != null) { + target.writeToNBT(targetTag); + } + chisel.getTagCompound().setTag("chiselTarget", targetTag); + } - private static void initTag(ItemStack stack) { - if (!stack.hasTagCompound()) { - stack.setTagCompound(new NBTTagCompound()); - } - } + private static void initTag(ItemStack stack) { + if (!stack.hasTagCompound()) { + stack.setTagCompound(new NBTTagCompound()); + } + } - private static final String MODE_KEY = "chiselMode"; + private static final String MODE_KEY = "chiselMode"; - public static IChiselMode getChiselMode(ItemStack chisel) { - if (chisel == null) { - return ChiselMode.SINGLE; - } + public static IChiselMode getChiselMode(ItemStack chisel) { + if (chisel == null) { + return ChiselMode.SINGLE; + } - if (chisel.stackTagCompound == null || Strings.isNullOrEmpty(chisel.stackTagCompound.getString(MODE_KEY))) { - initTag(chisel); - chisel.stackTagCompound.setString(MODE_KEY, ChiselMode.SINGLE.name()); - } + if (chisel.stackTagCompound == null || Strings.isNullOrEmpty(chisel.stackTagCompound.getString(MODE_KEY))) { + initTag(chisel); + chisel.stackTagCompound.setString(MODE_KEY, ChiselMode.SINGLE.name()); + } - String name = chisel.stackTagCompound.getString(MODE_KEY); - if (chisel.getItem() instanceof IAdvancedChisel) { - return ((IAdvancedChisel) chisel.getItem()).getMode(chisel, name); - } + String name = chisel.stackTagCompound.getString(MODE_KEY); + if (chisel.getItem() instanceof IAdvancedChisel) { + return ((IAdvancedChisel) chisel.getItem()).getMode(chisel, name); + } - return Enum.valueOf(ChiselMode.class, chisel.stackTagCompound.getString(MODE_KEY)); - } + return Enum.valueOf(ChiselMode.class, chisel.stackTagCompound.getString(MODE_KEY)); + } - public static void setChiselMode(ItemStack chisel, IChiselMode mode) { - initTag(chisel); - chisel.stackTagCompound.setString(MODE_KEY, mode.name()); - } + public static void setChiselMode(ItemStack chisel, IChiselMode mode) { + initTag(chisel); + chisel.stackTagCompound.setString(MODE_KEY, mode.name()); + } - public static ICarvingVariation getVariation(ItemStack stack) { - ICarvingVariation v = Carving.chisel.getVariation(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage()); - return v == null ? CarvingUtils.getDefaultVariationFor(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 99) : v; - } + public static ICarvingVariation getVariation(ItemStack stack) { + ICarvingVariation v = Carving.chisel + .getVariation(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage()); + return v == null + ? CarvingUtils + .getDefaultVariationFor(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 99) + : v; + } } diff --git a/src/main/java/team/chisel/utils/GeneralClient.java b/src/main/java/team/chisel/utils/GeneralClient.java index c83aceb4..7a583b81 100644 --- a/src/main/java/team/chisel/utils/GeneralClient.java +++ b/src/main/java/team/chisel/utils/GeneralClient.java @@ -11,29 +11,36 @@ import org.lwjgl.opengl.GL11; public class GeneralClient { - public static Random rand = new Random(); + public static Random rand = new Random(); - public static void playChiselSound(World world, int x, int y, int z, String sound) { - Minecraft.getMinecraft().theWorld.playSound(x + 0.5, y + 0.5, z + 0.5, sound, 0.3f + 0.7f * rand.nextFloat(), 0.6f + 0.4f * rand.nextFloat(), true); - } + public static void playChiselSound(World world, int x, int y, int z, String sound) { + Minecraft.getMinecraft().theWorld.playSound( + x + 0.5, + y + 0.5, + z + 0.5, + sound, + 0.3f + 0.7f * rand.nextFloat(), + 0.6f + 0.4f * rand.nextFloat(), + true); + } - static HashMap resources = new HashMap(); + static HashMap resources = new HashMap(); - public static void bind(String textureName) { - ResourceLocation res = resources.get(textureName); + public static void bind(String textureName) { + ResourceLocation res = resources.get(textureName); - if (res == null) { - res = new ResourceLocation(textureName); - resources.put(textureName, res); - } + if (res == null) { + res = new ResourceLocation(textureName); + resources.put(textureName, res); + } - Minecraft.getMinecraft().getTextureManager().bindTexture(res); - } + Minecraft.getMinecraft().getTextureManager().bindTexture(res); + } - public static void setGLColorFromInt(int color) { - float red = (color >> 16 & 255) / 255.0F; - float green = (color >> 8 & 255) / 255.0F; - float blue = (color & 255) / 255.0F; - GL11.glColor4f(red, green, blue, 1.0F); - } + public static void setGLColorFromInt(int color) { + float red = (color >> 16 & 255) / 255.0F; + float green = (color >> 8 & 255) / 255.0F; + float blue = (color & 255) / 255.0F; + GL11.glColor4f(red, green, blue, 1.0F); + } } diff --git a/src/main/java/team/chisel/utils/RecipeUtil.java b/src/main/java/team/chisel/utils/RecipeUtil.java index 9e30acb5..d907cdec 100644 --- a/src/main/java/team/chisel/utils/RecipeUtil.java +++ b/src/main/java/team/chisel/utils/RecipeUtil.java @@ -1,35 +1,35 @@ package team.chisel.utils; +import java.util.List; + import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.item.crafting.IRecipe; -import java.util.List; - /** * Utility for crafting/recipe things */ public class RecipeUtil { @SuppressWarnings("unchecked") - public static boolean isCraftable(ItemStack stack){ - for (IRecipe recipe : (List)CraftingManager.getInstance().getRecipeList()){ - if (recipe.getRecipeOutput()==null){ + public static boolean isCraftable(ItemStack stack) { + for (IRecipe recipe : (List) CraftingManager.getInstance().getRecipeList()) { + if (recipe.getRecipeOutput() == null) { continue; } - if (stack.isItemEqual(recipe.getRecipeOutput())){ + if (stack.isItemEqual(recipe.getRecipeOutput())) { return true; } } return false; } - public static boolean isSmeltable(ItemStack stack){ + public static boolean isSmeltable(ItemStack stack) { return FurnaceRecipes.smelting().getSmeltingList().containsKey(stack); } - public static boolean isCreatable(ItemStack stack){ + public static boolean isCreatable(ItemStack stack) { return isCraftable(stack) || isSmeltable(stack); } diff --git a/src/main/java/team/chisel/world/GeneratorChisel.java b/src/main/java/team/chisel/world/GeneratorChisel.java index ad5de157..91cdb43e 100644 --- a/src/main/java/team/chisel/world/GeneratorChisel.java +++ b/src/main/java/team/chisel/world/GeneratorChisel.java @@ -9,56 +9,56 @@ import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import com.google.common.collect.Maps; - import cpw.mods.fml.common.IWorldGenerator; public class GeneratorChisel implements IWorldGenerator { - private class WorldGenInfo { + private class WorldGenInfo { - private int amount; - private int minY, maxY; - private double chance; + private int amount; + private int minY, maxY; + private double chance; - private WorldGenInfo(int amount, int minY, int maxY, double chance) { - this.amount = amount; - this.minY = minY; - this.maxY = maxY; - this.chance = chance; - } - } + private WorldGenInfo(int amount, int minY, int maxY, double chance) { + this.amount = amount; + this.minY = minY; + this.maxY = maxY; + this.chance = chance; + } + } - public static final GeneratorChisel INSTANCE = new GeneratorChisel(); + public static final GeneratorChisel INSTANCE = new GeneratorChisel(); - private final Map map = Maps.newHashMap(); + private final Map map = Maps.newHashMap(); - public void addFeature(Block block, int count, int amount) { - addFeature(block, count, amount, 40, 128); - } + public void addFeature(Block block, int count, int amount) { + addFeature(block, count, amount, 40, 128); + } - public void addFeature(Block block, int count, int amount, int minY, int maxY) { - addFeature(block, count, amount, minY, maxY, 1); - } + public void addFeature(Block block, int count, int amount, int minY, int maxY) { + addFeature(block, count, amount, minY, maxY, 1); + } - public void addFeature(Block block, int count, int amount, int minY, int maxY, double chance) { - map.put(new WorldGenMinable(block, count), new WorldGenInfo(amount, minY, maxY, chance)); - } + public void addFeature(Block block, int count, int amount, int minY, int maxY, double chance) { + map.put(new WorldGenMinable(block, count), new WorldGenInfo(amount, minY, maxY, chance)); + } - protected void genStandardOre(WorldGenMinable gen, WorldGenInfo info, World world, Random random, int x, int z) { - for (int l = 0; l < info.amount; ++l) { - if (random.nextDouble() < info.chance) { - int avgX = x + random.nextInt(16); - int avgY = info.minY + random.nextInt(info.maxY - info.minY) + 1; - int avgZ = z + random.nextInt(16); - gen.generate(world, random, avgX, avgY, avgZ); - } - } - } + protected void genStandardOre(WorldGenMinable gen, WorldGenInfo info, World world, Random random, int x, int z) { + for (int l = 0; l < info.amount; ++l) { + if (random.nextDouble() < info.chance) { + int avgX = x + random.nextInt(16); + int avgY = info.minY + random.nextInt(info.maxY - info.minY) + 1; + int avgZ = z + random.nextInt(16); + gen.generate(world, random, avgX, avgY, avgZ); + } + } + } - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { - for (WorldGenMinable gen : map.keySet()) { - genStandardOre(gen, map.get(gen), world, random, chunkX * 16, chunkZ * 16); - } - } + @Override + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, + IChunkProvider chunkProvider) { + for (WorldGenMinable gen : map.keySet()) { + genStandardOre(gen, map.get(gen), world, random, chunkX * 16, chunkZ * 16); + } + } }