diff --git a/src/main/java/com/cricketcraft/chisel/BlockNameConversion.java b/src/main/java/com/cricketcraft/chisel/BlockNameConversion.java index d994313d..d791cd62 100644 --- a/src/main/java/com/cricketcraft/chisel/BlockNameConversion.java +++ b/src/main/java/com/cricketcraft/chisel/BlockNameConversion.java @@ -10,108 +10,101 @@ import com.cricketcraft.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(); +public class BlockNameConversion { - public static class NameConversions - { - public final static int MAX = 5; + static final private HashMap namingConversion = new HashMap(); - 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(); + public static class NameConversions { - 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); - } - } - } + public final static int MAX = 5; - 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"); - } + 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(); - 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)); - } + 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); + } + } + } - return item; - } + 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 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 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 block; - } + 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)); + } + + return block; + } } \ No newline at end of file diff --git a/src/main/java/com/cricketcraft/chisel/Chisel.java b/src/main/java/com/cricketcraft/chisel/Chisel.java index 5b673dcb..78051734 100644 --- a/src/main/java/com/cricketcraft/chisel/Chisel.java +++ b/src/main/java/com/cricketcraft/chisel/Chisel.java @@ -1,10 +1,20 @@ package com.cricketcraft.chisel; +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; + import com.cricketcraft.chisel.block.BlockCarvable; import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel; import com.cricketcraft.chisel.block.tileentity.TileEntityPresent; -import com.cricketcraft.chisel.carving.Carving; -import com.cricketcraft.chisel.carving.CarvingVariation; import com.cricketcraft.chisel.client.gui.GuiAutoChisel; import com.cricketcraft.chisel.client.gui.GuiChisel; import com.cricketcraft.chisel.client.gui.GuiPresent; @@ -20,8 +30,8 @@ import com.cricketcraft.chisel.inventory.ContainerPresent; import com.cricketcraft.chisel.inventory.InventoryChiselSelection; import com.cricketcraft.chisel.proxy.CommonProxy; import com.cricketcraft.chisel.utils.General; -import com.cricketcraft.chisel.utils.GeneralClient; import com.cricketcraft.chisel.world.GeneratorChisel; + import cpw.mods.fml.client.event.ConfigChangedEvent; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLLog; @@ -29,8 +39,12 @@ import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLInterModComms; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent; import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; @@ -38,180 +52,166 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry.Type; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import org.apache.commons.lang3.ArrayUtils; -import java.io.File; -import java.util.ArrayList; -import java.util.List; +@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = Chisel.VERSION, guiFactory = "com.cricketcraft.chisel.client.gui.GuiFactory", dependencies = "after:ForgeMultipart;after:Thaumcraft") +public class Chisel { + public static final List modsSupported = new ArrayList(); + 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 2"; + public static final String VERSION = "2.2.2"; + 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 int RenderEldritchId; + public static int RenderCTMId; + public static int RenderCarpetId; -@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = Chisel.VERSION, guiFactory = "com.cricketcraft.chisel.client.gui.GuiFactory", dependencies = "after:ForgeMultipart;after:Thaumcraft") -public class Chisel -{ - public static final List modsSupported = new ArrayList(); - 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 2"; - public static final String VERSION = "2.2.2"; - 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 int RenderEldritchId; - public static int RenderCTMId; - public static int RenderCarpetId; + @Instance(MOD_ID) + public static Chisel instance; - @Instance(MOD_ID) - public static Chisel instance; + @SidedProxy(clientSide = "com.cricketcraft.chisel.proxy.ClientProxy", serverSide = "com.cricketcraft.chisel.proxy.CommonProxy") + public static CommonProxy proxy; - @SidedProxy(clientSide = "com.cricketcraft.chisel.proxy.ClientProxy", serverSide = "com.cricketcraft.chisel.proxy.CommonProxy") - public static CommonProxy proxy; + @SideOnly(Side.CLIENT) + private static void initModIntegration() { + if (Configurations.enableFMP) { + ModIntegration.addMod(FMPIntegration.class); + } - @SideOnly(Side.CLIENT) - private static void initModIntegration() { - if(Configurations.enableFMP) { - ModIntegration.addMod(FMPIntegration.class); - } + ModIntegration.init(); + } - ModIntegration.init(); - } + @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) { + modsSupported.add("Thaumcraft"); + modsSupported.add("Twilight Forest"); + modsSupported.add("appliedenergistics2"); + modsSupported.add("Railcraft"); + modsSupported.add("AWWayOfTime"); - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modsSupported.add("Thaumcraft"); - modsSupported.add("Twilight Forest"); - modsSupported.add("appliedenergistics2"); - modsSupported.add("Railcraft"); - modsSupported.add("AWWayOfTime"); + File configFile = event.getSuggestedConfigurationFile(); + Configurations.configExists = configFile.exists(); + Configurations.config = new Configuration(configFile); + Configurations.config.load(); + Configurations.refreshConfig(); - File configFile = event.getSuggestedConfigurationFile(); - Configurations.configExists = configFile.exists(); - Configurations.config = new Configuration(configFile); - Configurations.config.load(); - Configurations.refreshConfig(); + PacketHandler.init(); + ModTabs.load(); + ModBlocks.load(); + ModItems.load(); + proxy.preInit(); + } - PacketHandler.init(); - ModTabs.load(); - ModBlocks.load(); - ModItems.load(); - proxy.preInit(); - } + @EventHandler + public void init(FMLInitializationEvent event) { + Crafting.init(); - @EventHandler - public void init(FMLInitializationEvent event) - { - Crafting.init(); + NetworkRegistry.INSTANCE.registerGuiHandler(this, new IGuiHandler() { - NetworkRegistry.INSTANCE.registerGuiHandler(this, new 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(null)); - 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(null)); + 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(null)); - 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(null)); + 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; + } + } + }); + GameRegistry.registerWorldGenerator(new GeneratorChisel(ModBlocks.marble, 32, Configurations.marbleAmount), 1000); + GameRegistry.registerWorldGenerator(new GeneratorChisel(ModBlocks.limestone, 32, Configurations.limestoneAmount), 1000); + GameRegistry.registerWorldGenerator(new GeneratorChisel(ModBlocks.andesite, 32, Configurations.andesiteAmount), 1000); + GameRegistry.registerWorldGenerator(new GeneratorChisel(ModBlocks.granite, 32, Configurations.graniteAmount), 1000); + GameRegistry.registerWorldGenerator(new GeneratorChisel(ModBlocks.diorite, 32, Configurations.dioriteAmount), 1000); - GameRegistry.registerWorldGenerator(new GeneratorChisel(ModBlocks.marble, 32, Configurations.marbleAmount), 1000); - GameRegistry.registerWorldGenerator(new GeneratorChisel(ModBlocks.limestone, 32, Configurations.limestoneAmount), 1000); - GameRegistry.registerWorldGenerator(new GeneratorChisel(ModBlocks.andesite, 32, Configurations.andesiteAmount), 1000); - GameRegistry.registerWorldGenerator(new GeneratorChisel(ModBlocks.granite, 32, Configurations.graniteAmount), 1000); - GameRegistry.registerWorldGenerator(new GeneratorChisel(ModBlocks.diorite, 32, Configurations.dioriteAmount), 1000); + if (event.getSide() == Side.CLIENT) { + initModIntegration(); + } - if (event.getSide() == Side.CLIENT) { - initModIntegration(); - } + 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", "com.cricketcraft.chisel.Waila.register"); + } - FMLInterModComms.sendMessage("Waila", "register", "com.cricketcraft.chisel.Waila.register"); - } + @EventHandler + public void postInit(FMLPostInitializationEvent event) { + ModBlocks.postLoad(); + ModIntegration.postInit(); + Compatibility.init(event); + } - @EventHandler - public void postInit(FMLPostInitializationEvent event) - { - ModBlocks.postLoad(); - ModIntegration.postInit(); - Compatibility.init(event); - } - - @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/com/cricketcraft/chisel/Configurations.java b/src/main/java/com/cricketcraft/chisel/Configurations.java index 241b6a99..082e5ad3 100644 --- a/src/main/java/com/cricketcraft/chisel/Configurations.java +++ b/src/main/java/com/cricketcraft/chisel/Configurations.java @@ -2,62 +2,61 @@ package com.cricketcraft.chisel; import net.minecraftforge.common.config.Configuration; -public class Configurations -{ - public static Configuration config; +public class Configurations { - public static boolean configExists; - public static boolean oldPillars; - public static boolean disableCTM; - public static boolean blockDescriptions; - public static boolean ghostCloud; - public static boolean chiselStoneToCobbleBricks; - public static boolean allowMossy; - public static boolean chiselRecipe; - public static boolean autoChisel; - public static boolean fancy; - public static boolean enableFMP; + public static Configuration config; - public static int factoryBlockAmount; - public static int particlesTickrate; - public static int marbleAmount; - public static int limestoneAmount; - public static int graniteAmount; - public static int dioriteAmount; - public static int andesiteAmount; + public static boolean configExists; + public static boolean oldPillars; + public static boolean disableCTM; + public static boolean blockDescriptions; + public static boolean ghostCloud; + public static boolean chiselStoneToCobbleBricks; + public static boolean allowMossy; + public static boolean chiselRecipe; + public static boolean autoChisel; + public static boolean fancy; + public static boolean enableFMP; - public static double concreteVelocity; + public static int factoryBlockAmount; + public static int particlesTickrate; + public static int marbleAmount; + public static int limestoneAmount; + public static int graniteAmount; + public static int dioriteAmount; + public static int andesiteAmount; - public static boolean refreshConfig() - { - concreteVelocity = config.get("general", "concreteVelocity", 0.45, "Traversing concrete roads, players will acceleration to this velocity. For reference, normal running speed is about 0.28. Set to 0 to disable acceleration.").getDouble(0.45); - particlesTickrate = config.get("client", "particleTickrate", 1, "Particle tick rate. Greater value = less particles.").getInt(1); - oldPillars = config.get("client", "pillarOldGraphics", false, "Use old pillar textures").getBoolean(false); - disableCTM = !config.get("client", "connectedTextures", true, "Enable connected textures").getBoolean(true); - fancy = config.get("client", "fancyLeaves", true, "Enable fancy textures").getBoolean(true); - blockDescriptions = config.get("client", "tooltipsUseBlockDescriptions", true, "Make variations of blocks have the same name, and use the description in tooltip to distinguish them.").getBoolean(true); - ghostCloud = config.get("general", "doesCloudRenderLikeGhost", true).getBoolean(true); - factoryBlockAmount = config.get("general", "amountYouGetFromFactoryBlockCrafting", 32).getInt(32); - allowMossy = config.get("general", "allowCobbleToMossyInChisel", true).getBoolean(true); - marbleAmount = config.get("worldgen", "marbleAmount", 7, "Amount of marble to generate in the world; use 0 for none").getInt(7); - limestoneAmount = config.get("worldgen", "limestoneAmount", 8, "Amount of limestone to generate in the world; use 0 for none").getInt(8); - graniteAmount = config.get("worldgen", "graniteAmount", 8, "Amount of granite to generate in the world; use 0 for none.").getInt(8); - dioriteAmount = config.get("worldgen", "dioriteAmount", 8, "Amount of diorite to generate in the world; use 0 for none.").getInt(8); - andesiteAmount = config.get("worldgen", "andesiteAmount", 8, "Amount of andesite to generate in the world; use 0 for none.").getInt(8); - chiselRecipe = config.get("general", "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel").getBoolean(false); - autoChisel = config.get("general", "autoChisel", true, "Should people be allowed to use the auto chisel").getBoolean(true); - enableFMP = config.get("general", "enableFMP", true, "Do you want to enable FMP").getBoolean(true); - chiselStoneToCobbleBricks = config.get("general", "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false); + public static double concreteVelocity; - if(config.hasChanged()) - { - config.save(); - } - return true; - } + public static boolean refreshConfig() { + concreteVelocity = config.get("general", "concreteVelocity", 0.45, + "Traversing concrete roads, players will acceleration to this velocity. For reference, normal running speed is about 0.28. Set to 0 to disable acceleration.").getDouble(0.45); + particlesTickrate = config.get("client", "particleTickrate", 1, "Particle tick rate. Greater value = less particles.").getInt(1); + oldPillars = config.get("client", "pillarOldGraphics", false, "Use old pillar textures").getBoolean(false); + disableCTM = !config.get("client", "connectedTextures", true, "Enable connected textures").getBoolean(true); + fancy = config.get("client", "fancyLeaves", true, "Enable fancy textures").getBoolean(true); + blockDescriptions = config.get("client", "tooltipsUseBlockDescriptions", true, "Make variations of blocks have the same name, and use the description in tooltip to distinguish them.") + .getBoolean(true); + ghostCloud = config.get("general", "doesCloudRenderLikeGhost", true).getBoolean(true); + factoryBlockAmount = config.get("general", "amountYouGetFromFactoryBlockCrafting", 32).getInt(32); + allowMossy = config.get("general", "allowCobbleToMossyInChisel", true).getBoolean(true); + marbleAmount = config.get("worldgen", "marbleAmount", 7, "Amount of marble to generate in the world; use 0 for none").getInt(7); + limestoneAmount = config.get("worldgen", "limestoneAmount", 8, "Amount of limestone to generate in the world; use 0 for none").getInt(8); + graniteAmount = config.get("worldgen", "graniteAmount", 8, "Amount of granite to generate in the world; use 0 for none.").getInt(8); + dioriteAmount = config.get("worldgen", "dioriteAmount", 8, "Amount of diorite to generate in the world; use 0 for none.").getInt(8); + andesiteAmount = config.get("worldgen", "andesiteAmount", 8, "Amount of andesite to generate in the world; use 0 for none.").getInt(8); + chiselRecipe = config.get("general", "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel").getBoolean(false); + autoChisel = config.get("general", "autoChisel", true, "Should people be allowed to use the auto chisel").getBoolean(true); + enableFMP = config.get("general", "enableFMP", true, "Do you want to enable FMP").getBoolean(true); + chiselStoneToCobbleBricks = config.get("general", "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false); - public static boolean featureEnabled(String feature) - { - return config.get("features", feature, true).getBoolean(true) && refreshConfig(); - } + if (config.hasChanged()) { + config.save(); + } + return true; + } + + public static boolean featureEnabled(String feature) { + return config.get("features", feature, true).getBoolean(true) && refreshConfig(); + } } diff --git a/src/main/java/com/cricketcraft/chisel/Crafting.java b/src/main/java/com/cricketcraft/chisel/Crafting.java index f43d4f5c..77b3f4ee 100644 --- a/src/main/java/com/cricketcraft/chisel/Crafting.java +++ b/src/main/java/com/cricketcraft/chisel/Crafting.java @@ -1,8 +1,5 @@ package com.cricketcraft.chisel; -import com.cricketcraft.chisel.init.ModBlocks; -import com.cricketcraft.chisel.init.ModItems; -import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -13,158 +10,160 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; +import com.cricketcraft.chisel.init.ModBlocks; +import com.cricketcraft.chisel.init.ModItems; + +import cpw.mods.fml.common.registry.GameRegistry; + public class Crafting { + public static void init() { + 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; - public static void init() { - 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; + if (Configurations.featureEnabled("concrete")) + FurnaceRecipes.smelting().func_151393_a(concreteRecipeBlock, new ItemStack(ModBlocks.concrete), 0.1F); + if (Configurations.featureEnabled("sandstoneScribbles")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.sandstoneScribbles, 1), new Object[] { "X", 'X', new ItemStack(ModBlocks.sandstone, 1, 8), }); + for (int meta = 0; meta < 16; meta++) { + if (Configurations.featureEnabled("marble")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.marbleSlab, 6, 0), new Object[] { "***", '*', new ItemStack(ModBlocks.marble, 1, meta) }); + if (Configurations.featureEnabled("limestone")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.limestoneSlab, 6, 0), new Object[] { "***", '*', new ItemStack(ModBlocks.limestone, 1, meta) }); + if (Configurations.featureEnabled("marblePillar")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.marblePillarSlab, 6, 0), new Object[] { "***", '*', new ItemStack(ModBlocks.marblePillar, 1, meta) }); - if(Configurations.featureEnabled("concrete")) - FurnaceRecipes.smelting().func_151393_a(concreteRecipeBlock, new ItemStack(ModBlocks.concrete), 0.1F); - if(Configurations.featureEnabled("sandstoneScribbles")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.sandstoneScribbles, 1), new Object[]{"X", 'X', new ItemStack(ModBlocks.sandstone, 1, 8),}); - for (int meta = 0; meta < 16; meta++) { - if(Configurations.featureEnabled("marble")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.marbleSlab, 6, 0), new Object[]{"***", '*', new ItemStack(ModBlocks.marble, 1, meta)}); - if(Configurations.featureEnabled("limestone")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.limestoneSlab, 6, 0), new Object[]{"***", '*', new ItemStack(ModBlocks.limestone, 1, meta)}); - if(Configurations.featureEnabled("marblePillar")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.marblePillarSlab, 6, 0), new Object[]{"***", '*', new ItemStack(ModBlocks.marblePillar, 1, meta)}); + if (Configurations.featureEnabled("marblePillar")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.marblePillar, 6), new Object[] { "XX", "XX", "XX", 'X', new ItemStack(ModBlocks.marble, 1, meta), }); + if (Configurations.featureEnabled("marble")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.marble, 4), new Object[] { "XX", "XX", 'X', new ItemStack(ModBlocks.marblePillar, 1, meta), }); - if(Configurations.featureEnabled("marblePillar")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.marblePillar, 6), new Object[]{"XX", "XX", "XX", 'X', new ItemStack(ModBlocks.marble, 1, meta),}); - if(Configurations.featureEnabled("marble")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.marble, 4), new Object[]{"XX", "XX", 'X', new ItemStack(ModBlocks.marblePillar, 1, meta),}); + if (Configurations.featureEnabled("icePillar")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.icePillar, 6, 1), new Object[] { "XX", "XX", "XX", 'X', new ItemStack(ModBlocks.ice, 1, meta), }); + if (Configurations.featureEnabled("ice")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.ice, 4, 1), new Object[] { "XX", "XX", 'X', new ItemStack(ModBlocks.icePillar, 1, meta), }); + if (Configurations.featureEnabled("sandstone")) + GameRegistry.addRecipe(new ItemStack(Blocks.sandstone, 1, 1), new Object[] { "X", 'X', new ItemStack(ModBlocks.sandstoneScribbles, 1, meta), }); - if(Configurations.featureEnabled("icePillar")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.icePillar, 6, 1), new Object[]{"XX", "XX", "XX", 'X', new ItemStack(ModBlocks.ice, 1, meta),}); - if(Configurations.featureEnabled("ice")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.ice, 4, 1), new Object[]{"XX", "XX", 'X', new ItemStack(ModBlocks.icePillar, 1, meta),}); - if(Configurations.featureEnabled("sandstone")) - GameRegistry.addRecipe(new ItemStack(Blocks.sandstone, 1, 1), new Object[]{"X", 'X', new ItemStack(ModBlocks.sandstoneScribbles, 1, meta),}); + if (Configurations.featureEnabled("carpet")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.carpet, 8, meta), new Object[] { "YYY", "YXY", "YYY", 'X', new ItemStack(Items.string, 1), 'Y', new ItemStack(Blocks.wool, 1, meta), }); + if (Configurations.featureEnabled("carpetFloor")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.carpetFloor, 3, meta), new Object[] { "XX", 'X', new ItemStack(ModBlocks.carpet, 1, meta), }); + } - if(Configurations.featureEnabled("carpet")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.carpet, 8, meta), new Object[]{"YYY", "YXY", "YYY", 'X', new ItemStack(Items.string, 1), 'Y', new ItemStack(Blocks.wool, 1, meta),}); - if(Configurations.featureEnabled("carpetFloor")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.carpetFloor, 3, meta), new Object[]{"XX", 'X', new ItemStack(ModBlocks.carpet, 1, meta),}); - } + // The following recipe is due to bugs with Chisel 1.5.1 to 1.5.6a + if (Configurations.featureEnabled("sandstone")) + GameRegistry.addRecipe(new ItemStack(Blocks.sandstone, 1, 0), new Object[] { "X", 'X', new ItemStack(ModBlocks.sandstone, 1, 0), }); - // The following recipe is due to bugs with Chisel 1.5.1 to 1.5.6a - if(Configurations.featureEnabled("sandstone")) - GameRegistry.addRecipe(new ItemStack(Blocks.sandstone, 1, 0), new Object[]{"X", 'X', new ItemStack(ModBlocks.sandstone, 1, 0),}); + // The following recipe is due to bug with Chisel 1.5.6b + if (Configurations.featureEnabled("sandstone")) + GameRegistry.addRecipe(new ItemStack(Blocks.sandstone, 1, 1), new Object[] { "X", 'X', new ItemStack(ModBlocks.sandstone, 1, 1), }); - // The following recipe is due to bug with Chisel 1.5.6b - if(Configurations.featureEnabled("sandstone")) - GameRegistry.addRecipe(new ItemStack(Blocks.sandstone, 1, 1), new Object[]{"X", 'X', new ItemStack(ModBlocks.sandstone, 1, 1),}); + if (Configurations.featureEnabled("holystone")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.holystone, 8, 0), new Object[] { "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.feather, 1) }); + if (Configurations.featureEnabled("grimstone")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.grimstone, 8, 0), new Object[] { "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.coal, 1) }); + if (Configurations.featureEnabled("lavastone")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.lavastone, 8, 0), new Object[] { "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.lava_bucket, 1) }); + if (Configurations.featureEnabled("waterstone")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.waterstone, 8, 0), new Object[] { "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.water_bucket, 1) }); + if (Configurations.featureEnabled("fantasy")) { + GameRegistry.addRecipe(new ItemStack(ModBlocks.fantasy, 8, 0), new Object[] { "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.gold_nugget, 1) }); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.fantasy2, 8, 0), new Object[] { "***", "*X*", "***", '*', new ItemStack(ModBlocks.fantasy, 1), 'X', "dyeWhite" })); + } + if (Configurations.featureEnabled("futuristicArmorPlating")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.tyrian, 8, 0), new Object[] { "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.iron_ingot, 1) }); + if (Configurations.featureEnabled("templeBlock")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.temple, 8, 0), new Object[] { "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.dye, 1, 4) }); + if (Configurations.featureEnabled("factory")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.factory, Configurations.factoryBlockAmount, 0), new Object[] { "*X*", "X X", "*X*", '*', new ItemStack(Blocks.stone, 1), 'X', + new ItemStack(Items.iron_ingot, 1) }); + if (Configurations.featureEnabled("voidstone")) { + GameRegistry.addRecipe(new ItemStack(ModBlocks.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(ModBlocks.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) }); + } + if (Configurations.featureEnabled("voidstonePillars")) { + GameRegistry.addRecipe(new ItemStack(ModBlocks.voidstonePillar, 4, 0), new Object[] { "xx", "xx", 'x', new ItemStack(ModBlocks.voidstone, 1) }); + GameRegistry.addRecipe(new ItemStack(ModBlocks.voidstonePillar2, 4, 0), new Object[] { "xx", "xx", 'x', new ItemStack(ModBlocks.voidstone2, 1) }); + } - if(Configurations.featureEnabled("holystone")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.holystone, 8, 0), new Object[]{"***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.feather, 1)}); - if(Configurations.featureEnabled("grimstone")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.grimstone, 8, 0), new Object[]{"***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.coal, 1)}); - if(Configurations.featureEnabled("lavastone")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.lavastone, 8, 0), new Object[]{"***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.lava_bucket, 1)}); - if(Configurations.featureEnabled("waterstone")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.waterstone, 8, 0), new Object[]{"***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.water_bucket, 1)}); - if(Configurations.featureEnabled("fantasy")) - { - GameRegistry.addRecipe(new ItemStack(ModBlocks.fantasy, 8, 0), new Object[]{"***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.gold_nugget, 1)}); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.fantasy2, 8, 0), new Object[]{"***", "*X*", "***", '*', new ItemStack(ModBlocks.fantasy, 1), 'X', "dyeWhite"})); - } - if(Configurations.featureEnabled("futuristicArmorPlating")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.tyrian, 8, 0), new Object[]{"***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.iron_ingot, 1)}); - if(Configurations.featureEnabled("templeBlock")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.temple, 8, 0), new Object[]{"***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.dye, 1, 4)}); - if(Configurations.featureEnabled("factory")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.factory, Configurations.factoryBlockAmount, 0), new Object[]{"*X*", "X X", "*X*", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.iron_ingot, 1)}); - if(Configurations.featureEnabled("voidstone")) - { - GameRegistry.addRecipe(new ItemStack(ModBlocks.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(ModBlocks.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)}); - } - if(Configurations.featureEnabled("voidstonePillars")) - { - GameRegistry.addRecipe(new ItemStack(ModBlocks.voidstonePillar, 4, 0), new Object[]{"xx", "xx", 'x', new ItemStack(ModBlocks.voidstone, 1)}); - GameRegistry.addRecipe(new ItemStack(ModBlocks.voidstonePillar2, 4, 0), new Object[]{"xx", "xx", 'x', new ItemStack(ModBlocks.voidstone2, 1)}); - } + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.roadLine, 8, 0), new Object[] { "wrw", "wrw", "wrw", ('w'), "dyeWhite", ('r'), Items.redstone })); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.roadLine, 8, 0), new Object[]{"wrw", "wrw", "wrw", ('w'), "dyeWhite", ('r'), Items.redstone})); + if (Configurations.chiselRecipe) { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chisel, 1), new Object[] { " YY", " YY", "X ", 'X', Items.stick, 'Y', Items.iron_ingot })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chisel, 1, 1), new Object[] { " YY", " YY", "x ", 'x', "stickWood", 'Y', "ingotIron" })); + } else { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chisel, 1), new Object[] { " Y", "X ", 'X', Items.stick, 'Y', Items.iron_ingot })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chisel, 1, 1), new Object[] { " y", "x ", 'x', "stickWood", 'y', "ingotIron" })); + } - if (Configurations.chiselRecipe) { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chisel, 1), new Object[]{" YY", " YY", "X ", 'X', Items.stick, 'Y', Items.iron_ingot})); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chisel, 1, 1), new Object[]{" YY", " YY", "x ", 'x', "stickWood", 'Y', "ingotIron"})); - } else { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chisel, 1), new Object[]{" Y", "X ", 'X', Items.stick, 'Y', Items.iron_ingot})); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chisel, 1, 1), new Object[]{" y", "x ", 'x', "stickWood", 'y', "ingotIron"})); - } + if (Configurations.featureEnabled("ballOfMoss")) + GameRegistry.addRecipe(new ItemStack(ModItems.itemBallOMoss, 1), new Object[] { "XYX", "YXY", "XYX", 'X', Blocks.vine, 'Y', Items.stick }); + if (Configurations.featureEnabled("cloud")) + GameRegistry.addRecipe(new ItemStack(ModItems.itemCloudInABottle, 1), new Object[] { "X X", "XYX", " X ", 'X', Blocks.glass, 'Y', Items.quartz }); + if (Configurations.featureEnabled("smashingrock")) + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.smashingRock, 16), new Object[] { new ItemStack(Items.stone_pickaxe), new ItemStack(Items.glass_bottle, 1), + new ItemStack(Items.stone_shovel) }); - if (Configurations.featureEnabled("ballOfMoss")) - GameRegistry.addRecipe(new ItemStack(ModItems.itemBallOMoss, 1), new Object[]{"XYX", "YXY", "XYX", 'X', Blocks.vine, 'Y', Items.stick}); - if (Configurations.featureEnabled("cloud")) - GameRegistry.addRecipe(new ItemStack(ModItems.itemCloudInABottle, 1), new Object[]{"X X", "XYX", " X ", 'X', Blocks.glass, 'Y', Items.quartz}); - if (Configurations.featureEnabled("smashingrock")) - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.smashingRock, 16), new Object[]{new ItemStack(Items.stone_pickaxe), new ItemStack(Items.glass_bottle, 1), new ItemStack(Items.stone_shovel)}); + if (Configurations.featureEnabled("paperWall")) + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.paperWall, 8), new Object[] { "ppp", "psp", "ppp", ('p'), Items.paper, ('s'), "stickWood" })); - if(Configurations.featureEnabled("paperWall")) - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.paperWall, 8), new Object[]{"ppp", "psp", "ppp", ('p'), Items.paper, ('s'), "stickWood"})); + String[] sGNames = new String[] { "White", "Orange", "Magenta", "Light Blue", "Yellow", "Lime", "Pink", "Gray", "Light Gray", "Cyan", "Purple", "Blue", "Brown", "Green", "Red", "Black" }; + for (int i = 0; i < 16; i++) { + OreDictionary.registerOre("stainedClay" + sGNames[i].replaceAll(" ", ""), new ItemStack(Blocks.stained_hardened_clay, 1, i)); + OreDictionary.registerOre("blockWool" + sGNames[i].replaceAll(" ", ""), new ItemStack(Blocks.wool, 1, i)); + if (Configurations.featureEnabled("woolenClay")) + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.woolenClay, 2, i), new Object[] { "blockWool" + sGNames[i].replaceAll(" ", ""), + "stainedClay" + sGNames[i].replaceAll(" ", "") })); + } + if (Configurations.featureEnabled("laboratory")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.laboratory, 8, 0), new Object[] { "***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.quartz, 1) }); - String[] sGNames = new String[]{ - "White", "Orange", "Magenta", "Light Blue", - "Yellow", "Lime", "Pink", "Gray", - "Light Gray", "Cyan", "Purple", "Blue", - "Brown", "Green", "Red", "Black" - }; - for (int i = 0; i < 16; i++) { - OreDictionary.registerOre("stainedClay" + sGNames[i].replaceAll(" ", ""), new ItemStack(Blocks.stained_hardened_clay, 1, i)); - OreDictionary.registerOre("blockWool" + sGNames[i].replaceAll(" ", ""), new ItemStack(Blocks.wool, 1, i)); - if(Configurations.featureEnabled("woolenClay")) - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModBlocks.woolenClay, 2, i), new Object[]{"blockWool" + sGNames[i].replaceAll(" ", ""), "stainedClay" + sGNames[i].replaceAll(" ", "")})); - } - if(Configurations.featureEnabled("laboratory")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.laboratory, 8, 0), new Object[]{"***", "*X*", "***", '*', new ItemStack(Blocks.stone, 1), 'X', new ItemStack(Items.quartz, 1)}); + if (Configurations.autoChisel) + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.autoChisel, 1), new Object[] { "XXX", "XYX", "XXX", Character.valueOf('X'), "plankWood", Character.valueOf('Y'), + ModItems.chisel })); - if(Configurations.autoChisel) - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.autoChisel, 1), new Object[]{"XXX", "XYX", "XXX", Character.valueOf('X'), "plankWood", Character.valueOf('Y'), ModItems.chisel})); + if (Configurations.featureEnabled("hexPlating")) + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.hexPlating, 8, 0), new Object[] { "XXX", "XYX", "XXX", 'X', "stone", 'Y', "blockCoal" })); + if (Configurations.featureEnabled("bone")) + GameRegistry.addRecipe(new ItemStack(ModBlocks.bone, 4), new Object[] { "XX", "XX", 'X', Items.bone }); - if(Configurations.featureEnabled("hexPlating")) - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.hexPlating, 8, 0), new Object[]{"XXX", "XYX", "XXX", 'X', "stone", 'Y', "blockCoal"})); - if(Configurations.featureEnabled("bone")) - GameRegistry.addRecipe(new ItemStack(ModBlocks.bone, 4), new Object[]{"XX", "XX", 'X', Items.bone}); + if (Configurations.featureEnabled("pumpkin")) { + for (int x = 0; x < 16; x++) { + GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.jackolantern[x]), + new Object[] { new ItemStack(ModBlocks.pumpkin[x], 1), new ItemStack(Item.getItemFromBlock(Blocks.torch), 1) }); + } + } - if(Configurations.featureEnabled("pumpkin")){ - for(int x = 0; x < 16; x++){ - GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.jackolantern[x]), new Object[]{new ItemStack(ModBlocks.pumpkin[x], 1), new ItemStack(Item.getItemFromBlock(Blocks.torch), 1)}); - } - } + if (Configurations.featureEnabled("technical")) { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.technical, Configurations.factoryBlockAmount, 0), new Object[] { "xyx", "yxy", "xyx", 'x', "stone", 'y', + Items.iron_ingot })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.technical2, Configurations.factoryBlockAmount, 0), new Object[] { "xyx", "yzy", "xyx", 'x', "stone", 'y', "ingotIron", + 'z', Blocks.glass })); + } - if(Configurations.featureEnabled("technical")){ - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.technical, Configurations.factoryBlockAmount, 0), new Object[]{"xyx", "yxy", "xyx", 'x', "stone", 'y', Items.iron_ingot})); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.technical2, Configurations.factoryBlockAmount, 0), new Object[]{"xyx", "yzy", "xyx", 'x', "stone", 'y', "ingotIron", 'z', Blocks.glass})); - } + if (Configurations.featureEnabled("chest")) { + for (int x = 0; x < 16; x++) { + GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.present[x]), new Object[] { new ItemStack(Blocks.chest, 1), new ItemStack(Items.dye, 1, x) }); + } + } - if(Configurations.featureEnabled("chest")){ - for(int x = 0; x < 16; x++){ - GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.present[x]), new Object[]{new ItemStack(Blocks.chest, 1), new ItemStack(Items.dye, 1, x)}); - } - } - - if(Configurations.featureEnabled("warningSign")){ - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.sign, 4, 0), new Object[]{"xxx", "xyx", "xxx", 'x', "stone", 'y', Items.sign})); - } - if(Configurations.featureEnabled("scorching")) - { - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.scorching, 8, 0), new Object[]{"xxx", "xyx", "xxx", 'x', "stone", 'y', Items.blaze_rod})); - } - if(Configurations.featureEnabled("coloredSand")) - { - for(int x = 0; x < 16; x++) - { - String[] dyes = { "Black", "Red", "Green", "Brown", "Blue", - "Purple", "Cyan", "LightGray", "Gray", "Pink", "Lime", - "Yellow", "LightBlue", "Magenta", "Orange", "White" }; - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.coloredSand, 1, x), new Object[]{"sss", "sds", "sss", 's', Blocks.sand, 'd', "dye" + dyes[x]})); - GameRegistry.addSmelting(new ItemStack(ModBlocks.coloredSand, 1, x), new ItemStack(Blocks.stained_glass, 1, x), 0.3F); - } - } - } + if (Configurations.featureEnabled("warningSign")) { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.sign, 4, 0), new Object[] { "xxx", "xyx", "xxx", 'x', "stone", 'y', Items.sign })); + } + if (Configurations.featureEnabled("scorching")) { + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.scorching, 8, 0), new Object[] { "xxx", "xyx", "xxx", 'x', "stone", 'y', Items.blaze_rod })); + } + if (Configurations.featureEnabled("coloredSand")) { + for (int x = 0; x < 16; x++) { + String[] dyes = { "Black", "Red", "Green", "Brown", "Blue", "Purple", "Cyan", "LightGray", "Gray", "Pink", "Lime", "Yellow", "LightBlue", "Magenta", "Orange", "White" }; + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.coloredSand, 1, x), new Object[] { "sss", "sds", "sss", 's', Blocks.sand, 'd', "dye" + dyes[x] })); + GameRegistry.addSmelting(new ItemStack(ModBlocks.coloredSand, 1, x), new ItemStack(Blocks.stained_glass, 1, x), 0.3F); + } + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/PacketHandler.java b/src/main/java/com/cricketcraft/chisel/PacketHandler.java index a6f763f0..9c080f92 100644 --- a/src/main/java/com/cricketcraft/chisel/PacketHandler.java +++ b/src/main/java/com/cricketcraft/chisel/PacketHandler.java @@ -5,12 +5,11 @@ import com.cricketcraft.chisel.item.ItemChisel; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; -public class PacketHandler -{ - public static final SimpleNetworkWrapper INSTANCE = new SimpleNetworkWrapper(Chisel.MOD_ID); - - public static void init() - { - INSTANCE.registerMessage(ItemChisel.PlaySoundHandler.class, ItemChisel.PacketPlaySound.class, 0, Side.CLIENT); - } +public class PacketHandler { + + public static final SimpleNetworkWrapper INSTANCE = new SimpleNetworkWrapper(Chisel.MOD_ID); + + public static void init() { + INSTANCE.registerMessage(ItemChisel.PlaySoundHandler.class, ItemChisel.PacketPlaySound.class, 0, Side.CLIENT); + } } \ No newline at end of file diff --git a/src/main/java/com/cricketcraft/chisel/Waila.java b/src/main/java/com/cricketcraft/chisel/Waila.java index 3fea4565..29c49314 100644 --- a/src/main/java/com/cricketcraft/chisel/Waila.java +++ b/src/main/java/com/cricketcraft/chisel/Waila.java @@ -10,41 +10,34 @@ import net.minecraft.item.ItemStack; import com.cricketcraft.chisel.block.BlockCarvable; -public class Waila implements IWailaDataProvider -{ +public class Waila implements IWailaDataProvider { - @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 BlockCarvable) - { - BlockCarvable block = (BlockCarvable) accessor.getBlock(); - strings.add(block.getVariation(accessor.getMetadata()).description); - } - return strings; - } + @Override + public List getWailaBody(ItemStack stack, List strings, IWailaDataAccessor accessor, IWailaConfigHandler configHandler) { + if (accessor.getBlock() instanceof BlockCarvable) { + BlockCarvable block = (BlockCarvable) accessor.getBlock(); + strings.add(block.getVariation(accessor.getMetadata()).description); + } + 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 static void register(IWailaRegistrar registrar) - { - Waila instance = new Waila(); - registrar.registerBodyProvider(instance, BlockCarvable.class); - } + public static void register(IWailaRegistrar registrar) { + Waila instance = new Waila(); + registrar.registerBodyProvider(instance, BlockCarvable.class); + } } diff --git a/src/main/java/com/cricketcraft/chisel/api/ChiselMode.java b/src/main/java/com/cricketcraft/chisel/api/ChiselMode.java index 585e18e9..8686c0d1 100644 --- a/src/main/java/com/cricketcraft/chisel/api/ChiselMode.java +++ b/src/main/java/com/cricketcraft/chisel/api/ChiselMode.java @@ -1,10 +1,6 @@ package com.cricketcraft.chisel.api; -public enum ChiselMode -{ +public enum ChiselMode { - SINGLE, - CIRCLETHREE, - COLLUM, - SIDEWAYS + SINGLE, CIRCLETHREE, COLLUM, SIDEWAYS } diff --git a/src/main/java/com/cricketcraft/chisel/api/ICarvable.java b/src/main/java/com/cricketcraft/chisel/api/ICarvable.java index 83a370bc..acf6c33f 100644 --- a/src/main/java/com/cricketcraft/chisel/api/ICarvable.java +++ b/src/main/java/com/cricketcraft/chisel/api/ICarvable.java @@ -2,13 +2,17 @@ package com.cricketcraft.chisel.api; import com.cricketcraft.chisel.carving.CarvableVariation; -public interface ICarvable -{ - /** - * This grabs the variations possible - * @param metadata This is the metadata that a block will use and the basis of chisel - * Traditionally you make an instance of CarvableHelper ex. CarvableHelper carverHelper = new CarvableHelper(); - * In this method you return carverHelper.getVariation(metadata) and that should be all you need if you register it correctly. - */ - public CarvableVariation getVariation(int metadata); +public interface ICarvable { + + /** + * This grabs the variations possible + * + * @param metadata + * This is the metadata that a block will use and the basis of + * chisel Traditionally you make an instance of CarvableHelper + * ex. CarvableHelper carverHelper = new CarvableHelper(); In + * this method you return carverHelper.getVariation(metadata) and + * that should be all you need if you register it correctly. + */ + public CarvableVariation getVariation(int metadata); } diff --git a/src/main/java/com/cricketcraft/chisel/api/IChiselMode.java b/src/main/java/com/cricketcraft/chisel/api/IChiselMode.java index 87cc9e43..198f84b3 100644 --- a/src/main/java/com/cricketcraft/chisel/api/IChiselMode.java +++ b/src/main/java/com/cricketcraft/chisel/api/IChiselMode.java @@ -2,7 +2,7 @@ package com.cricketcraft.chisel.api; import net.minecraft.item.ItemStack; -public interface IChiselMode -{ - public ChiselMode getChiselMode(ItemStack itemStack); +public interface IChiselMode { + + public ChiselMode getChiselMode(ItemStack itemStack); } diff --git a/src/main/java/com/cricketcraft/chisel/api/IFacade.java b/src/main/java/com/cricketcraft/chisel/api/IFacade.java index c47c06bf..ed8b5189 100644 --- a/src/main/java/com/cricketcraft/chisel/api/IFacade.java +++ b/src/main/java/com/cricketcraft/chisel/api/IFacade.java @@ -5,8 +5,8 @@ import net.minecraft.world.IBlockAccess; public interface IFacade { - int getFacadeMetadata(IBlockAccess world, int x, int y, int z, int side); - - Block getFacade(IBlockAccess world, int x, int y, int z, int side); - + int getFacadeMetadata(IBlockAccess world, int x, int y, int z, int side); + + Block getFacade(IBlockAccess world, int x, int y, int z, int side); + } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockAutoChisel.java b/src/main/java/com/cricketcraft/chisel/block/BlockAutoChisel.java index 331c2e3f..3910db1e 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockAutoChisel.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockAutoChisel.java @@ -1,15 +1,12 @@ package com.cricketcraft.chisel.block; -import java.util.List; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -17,87 +14,83 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.Chisel; import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel; -import com.cricketcraft.chisel.init.ModBlocks; -import com.cricketcraft.chisel.init.ModItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +public class BlockAutoChisel extends BlockContainer { -public class BlockAutoChisel extends BlockContainer{ - public BlockAutoChisel() { - super(Material.rock); - setHardness(1F); - } + public BlockAutoChisel() { + super(Material.rock); + setHardness(1F); + } - @Override - public int getRenderType() { - return -1; - } + @Override + public int getRenderType() { + return -1; + } - @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) { - Random random = new Random(); - TileEntity tileEntity = world.getTileEntity(x, y, z); + private void dropItems(World world, int x, int y, int z) { + Random random = new Random(); + 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); + for (int c = 0; c < inventory.getSizeInventory(); c++) { + ItemStack stack = inventory.getStackInSlot(c); - if (stack != null && stack.stackSize > 0) { - float rx = random.nextFloat() * 0.8F + 0.1F; - float ry = random.nextFloat() * 0.8F + 0.1F; - float rz = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, stack); + if (stack != null && stack.stackSize > 0) { + float rx = random.nextFloat() * 0.8F + 0.1F; + float ry = random.nextFloat() * 0.8F + 0.1F; + float rz = random.nextFloat() * 0.8F + 0.1F; + EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, stack); - if (stack.hasTagCompound()) { - entityItem.getEntityItem().setTagCompound((NBTTagCompound) stack.getTagCompound().copy()); - } + if (stack.hasTagCompound()) { + entityItem.getEntityItem().setTagCompound((NBTTagCompound) stack.getTagCompound().copy()); + } - float factor = 0.05F; - entityItem.motionX = random.nextGaussian() * factor; - entityItem.motionY = random.nextGaussian() * factor + 0.2F; - entityItem.motionZ = random.nextGaussian() * factor; - world.spawnEntityInWorld(entityItem); - stack.stackSize = 0; - } - } - } + float factor = 0.05F; + entityItem.motionX = random.nextGaussian() * factor; + entityItem.motionY = random.nextGaussian() * factor + 0.2F; + entityItem.motionZ = random.nextGaussian() * factor; + world.spawnEntityInWorld(entityItem); + stack.stackSize = 0; + } + } + } - @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/com/cricketcraft/chisel/block/BlockBeaconBase.java b/src/main/java/com/cricketcraft/chisel/block/BlockBeaconBase.java index 287d5a5f..f3331c43 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockBeaconBase.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockBeaconBase.java @@ -5,12 +5,10 @@ import net.minecraft.world.IBlockAccess; /** * Created by Pokefenn */ -public class BlockBeaconBase extends BlockCarvable -{ +public class BlockBeaconBase extends BlockCarvable { - @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/com/cricketcraft/chisel/block/BlockCarvable.java b/src/main/java/com/cricketcraft/chisel/block/BlockCarvable.java index c775cb28..218e8ee9 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockCarvable.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockCarvable.java @@ -1,12 +1,7 @@ package com.cricketcraft.chisel.block; -import com.cricketcraft.chisel.Chisel; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.carving.CarvableHelper; -import com.cricketcraft.chisel.carving.CarvableVariation; -import com.cricketcraft.chisel.init.ModTabs; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -15,149 +10,169 @@ import net.minecraft.item.Item; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -import java.util.List; +import com.cricketcraft.chisel.Chisel; +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.carving.CarvableHelper; +import com.cricketcraft.chisel.carving.CarvableVariation; +import com.cricketcraft.chisel.init.ModTabs; + +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 BlockCarvable() { - this(Material.rock); - } + public CarvableHelper carverHelper; + private boolean isAlpha; - public BlockCarvable(Material m) { - super(m); - carverHelper = new CarvableHelper(); - setResistance(10.0F); - setHardness(2.0F); - setCreativeTab(ModTabs.tabOtherChiselBlocks); - } + public BlockCarvable() { + this(Material.rock); + } - public BlockCarvable setStained(boolean a) { - this.isAlpha = a; - return this; - } + public BlockCarvable(Material m) { + super(m); + carverHelper = new CarvableHelper(); + setResistance(10.0F); + setHardness(2.0F); + setCreativeTab(ModTabs.tabOtherChiselBlocks); + } - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return isAlpha ? 1 : 0; - } + public BlockCarvable setStained(boolean a) { + this.isAlpha = a; + return this; + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - } + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return isAlpha ? 1 : 0; + } - @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(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public int damageDropped(int i) { - return i; - } + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return carverHelper.getIcon(world, x, y, z, side); + } - @Override - public void registerBlockIcons(IIconRegister register) { - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public int damageDropped(int i) { + return i; + } - @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 int getRenderType() { - return Chisel.RenderCTMId; - } + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - public CarvableVariation getVariation(int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public int getRenderType() { + return Chisel.RenderCTMId; + } + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } - public static class SoundType extends Block.SoundType { - public final String soundNameStep; - public final String soundNameBreak; - public final String soundNamePlace; + public static class SoundType extends Block.SoundType { - /** - * 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; - } + public final String soundNameStep; + public final String soundNameBreak; + public final String soundNamePlace; - /** - * 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 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, 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 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; + } - @Override - public String getBreakSound() { - if (soundNameBreak == null) - return Chisel.MOD_ID + ":dig." + this.soundName; - else - return this.soundNameBreak; - } + /** + * 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 getStepResourcePath() { - if (soundNameStep == null) - return Chisel.MOD_ID + ":step." + this.soundName; - else - return this.soundNameStep; - } + @Override + public String getBreakSound() { + if (soundNameBreak == null) + return Chisel.MOD_ID + ":dig." + this.soundName; + else + return this.soundNameBreak; + } - @Override - public String func_150496_b() { - if (soundNamePlace == null) - return getBreakSound(); - else - return this.soundNamePlace; - } - } + @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; + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockCarvableGlass.java b/src/main/java/com/cricketcraft/chisel/block/BlockCarvableGlass.java index 78239576..3f5214fe 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockCarvableGlass.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockCarvableGlass.java @@ -18,71 +18,61 @@ import com.cricketcraft.chisel.init.ModTabs; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockCarvableGlass extends BlockGlass implements ICarvable -{ - public CarvableHelper carverHelper; - private boolean isAlpha = false; +public class BlockCarvableGlass extends BlockGlass implements ICarvable { - public BlockCarvableGlass() - { - super(Material.glass, false); + public CarvableHelper carverHelper; + private boolean isAlpha = false; - carverHelper = new CarvableHelper(); - setCreativeTab(ModTabs.tabOtherChiselBlocks); - } + public BlockCarvableGlass() { + super(Material.glass, false); - public BlockCarvableGlass setStained(boolean a) - { - this.isAlpha = a; - return this; - } + carverHelper = new CarvableHelper(); + setCreativeTab(ModTabs.tabOtherChiselBlocks); + } - @Override - public boolean renderAsNormalBlock() - { - return false; - } + public BlockCarvableGlass setStained(boolean a) { + this.isAlpha = a; + return this; + } - @Override - public int getRenderType() - { - return Chisel.RenderCTMId; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - public IIcon getIcon(int side, int metadata) - { - return carverHelper.getIcon(side, metadata); - } + @Override + public int getRenderType() { + return Chisel.RenderCTMId; + } - @Override - public int damageDropped(int i) - { - return i; - } + @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 int damageDropped(int i) { + return i; + } - @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 CarvableVariation getVariation(int metadata) - { - return carverHelper.getVariation(metadata); - } + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() - { - return isAlpha ? 1 : 0; - } + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return isAlpha ? 1 : 0; + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePane.java b/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePane.java index 7d3689b0..945445a1 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePane.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePane.java @@ -18,66 +18,57 @@ import com.cricketcraft.chisel.init.ModTabs; 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 class BlockCarvablePane extends BlockPane implements ICarvable { - public BlockCarvablePane(Material material, boolean drops) - { - super("", "", material, drops); + public CarvableHelper carverHelper; + public boolean isAlpha; - carverHelper = new CarvableHelper(); + public BlockCarvablePane(Material material, boolean drops) { + super("", "", material, drops); - setCreativeTab(ModTabs.tabOtherChiselBlocks); - } + carverHelper = new CarvableHelper(); - public BlockCarvablePane setStained(boolean a) - { - this.isAlpha = a; - return this; - } + setCreativeTab(ModTabs.tabOtherChiselBlocks); + } - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() - { - return isAlpha ? 1 : 0; - } + public BlockCarvablePane setStained(boolean a) { + this.isAlpha = a; + return this; + } - @Override - public int getRenderType() - { - return BlockMarblePaneRenderer.id; - } + @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 int getRenderType() { + return BlockMarblePaneRenderer.id; + } - @Override - public int damageDropped(int i) - { - return i; - } + @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 int damageDropped(int i) { + return i; + } - @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 CarvableVariation getVariation(int metadata) - { - return carverHelper.getVariation(metadata); - } + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } + + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePowered.java b/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePowered.java index a6c5ee33..f922b9da 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePowered.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePowered.java @@ -4,29 +4,30 @@ import net.minecraft.block.material.Material; import net.minecraft.world.IBlockAccess; public class BlockCarvablePowered extends BlockCarvable { - 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; - } + public BlockCarvablePowered(Material m) { + super(m); + } - /** - * 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; - } + /** + * 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; + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePumpkin.java b/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePumpkin.java index 5f308ee8..4695c58c 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePumpkin.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockCarvablePumpkin.java @@ -1,49 +1,53 @@ package com.cricketcraft.chisel.block; +import net.minecraft.block.BlockPumpkin; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + import com.cricketcraft.chisel.Chisel; import com.cricketcraft.chisel.api.ICarvable; import com.cricketcraft.chisel.carving.CarvableHelper; import com.cricketcraft.chisel.carving.CarvableVariation; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.BlockPumpkin; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; -public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable{ - public CarvableHelper carverHelper; +public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable { - @SideOnly(Side.CLIENT) - private IIcon top, face; + public CarvableHelper carverHelper; - private String faceLocation; + @SideOnly(Side.CLIENT) + private IIcon top, face; - public BlockCarvablePumpkin(boolean isOn) { - super(isOn); - if(isOn) - setLightLevel(10.0F); - carverHelper = new CarvableHelper(); - } + private String faceLocation; - @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))))); - } + public BlockCarvablePumpkin(boolean isOn) { + super(isOn); + if (isOn) + setLightLevel(10.0F); + carverHelper = new CarvableHelper(); + } - @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 + @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 CarvableVariation getVariation(int metadata) { - return carverHelper.getVariation(metadata); - } + @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"); + } - public void setInformation(String textureLocation){ - this.faceLocation = textureLocation; - } + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } + + public void setInformation(String textureLocation) { + this.faceLocation = textureLocation; + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockCarvableSand.java b/src/main/java/com/cricketcraft/chisel/block/BlockCarvableSand.java index 61b97933..0ffe212d 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockCarvableSand.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockCarvableSand.java @@ -4,7 +4,6 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.BlockSand; -import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; @@ -21,140 +20,153 @@ 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 BlockCarvableSand() { - super(); - carverHelper = new CarvableHelper(); - setCreativeTab(ModTabs.tabOtherChiselBlocks); - } + public CarvableHelper carverHelper; + private boolean isAlpha; - public BlockCarvableSand setStained(boolean a) { - this.isAlpha = a; - return this; - } + public BlockCarvableSand() { + super(); + carverHelper = new CarvableHelper(); + setCreativeTab(ModTabs.tabOtherChiselBlocks); + } - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return isAlpha ? 1 : 0; - } + public BlockCarvableSand setStained(boolean a) { + this.isAlpha = a; + return this; + } - @Override - public IIcon getIcon(int side, int metadata) { - return carverHelper.getIcon(side, metadata); - } + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return isAlpha ? 1 : 0; + } - @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(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public int damageDropped(int i) { - return i; - } + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return carverHelper.getIcon(world, x, y, z, side); + } - @Override - public void registerBlockIcons(IIconRegister register) { - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public int damageDropped(int i) { + return i; + } - @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 int getRenderType() { - return Chisel.RenderCTMId; - } + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - public CarvableVariation getVariation(int metadata) { - return carverHelper.getVariation(metadata); - } + @Override + public int getRenderType() { + return Chisel.RenderCTMId; + } + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } - public static class SoundType extends Block.SoundType { - public final String soundNameStep; - public final String soundNameBreak; - public final String soundNamePlace; + public static class SoundType extends Block.SoundType { - /** - * 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; - } + public final String soundNameStep; + public final String soundNameBreak; + public final String soundNamePlace; - /** - * 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 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, 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 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; + } - @Override - public String getBreakSound() { - if (soundNameBreak == null) - return Chisel.MOD_ID + ":dig." + this.soundName; - else - return this.soundNameBreak; - } + /** + * 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 getStepResourcePath() { - if (soundNameStep == null) - return Chisel.MOD_ID + ":step." + this.soundName; - else - return this.soundNameStep; - } + @Override + public String getBreakSound() { + if (soundNameBreak == null) + return Chisel.MOD_ID + ":dig." + this.soundName; + else + return this.soundNameBreak; + } - @Override - public String func_150496_b() { - if (soundNamePlace == null) - return getBreakSound(); - else - return this.soundNamePlace; - } - } + @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; + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockCloud.java b/src/main/java/com/cricketcraft/chisel/block/BlockCloud.java index aeed065e..1649aa68 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockCloud.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockCloud.java @@ -1,6 +1,5 @@ package com.cricketcraft.chisel.block; - import java.util.Random; import net.minecraft.block.material.Material; @@ -14,56 +13,54 @@ import com.cricketcraft.chisel.Configurations; 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 + public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) { + return super.shouldSideBeRendered(iblockaccess, i, j, k, 1 - l); + } + @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 boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) { - return super.shouldSideBeRendered(iblockaccess, i, j, k, 1 - l); - } + @Override + public Item getItemDropped(int par1, Random rand, int par3) { + return Item.getItemFromBlock(this); + } - @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 int quantityDropped(Random rand) { + return rand.nextInt(2); + } - @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 damageDropped(int meta) { - return meta; - } + @Override + public int damageDropped(int meta) { + return meta; + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockConcrete.java b/src/main/java/com/cricketcraft/chisel/block/BlockConcrete.java index e299913d..f776d912 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockConcrete.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockConcrete.java @@ -10,30 +10,26 @@ import com.cricketcraft.chisel.client.GeneralChiselClient; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; -public class BlockConcrete extends BlockCarvable -{ +public class BlockConcrete extends BlockCarvable { - public BlockConcrete() - { - super(); - } + public BlockConcrete() { + super(); + } - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) - { - float f = 0.125F; - return AxisAlignedBB.getBoundingBox(par2, par3, par4, (par2 + 1), ((par3 + 1) - f), (par4 + 1)); - } + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + float f = 0.125F; + return AxisAlignedBB.getBoundingBox(par2, par3, par4, (par2 + 1), ((par3 + 1) - f), (par4 + 1)); + } - @Override - public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) - { - if(FMLCommonHandler.instance().getEffectiveSide() != Side.CLIENT) - return; - if(Configurations.concreteVelocity == 0) - return; + @Override + public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { + if (FMLCommonHandler.instance().getEffectiveSide() != Side.CLIENT) + return; + if (Configurations.concreteVelocity == 0) + return; - GeneralChiselClient.speedupPlayer(world, entity, Configurations.concreteVelocity); - } + GeneralChiselClient.speedupPlayer(world, entity, Configurations.concreteVelocity); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockEldritch.java b/src/main/java/com/cricketcraft/chisel/block/BlockEldritch.java index 3afe1609..dd53db11 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockEldritch.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockEldritch.java @@ -2,19 +2,15 @@ package com.cricketcraft.chisel.block; import com.cricketcraft.chisel.Chisel; +public class BlockEldritch extends BlockCarvable { -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/com/cricketcraft/chisel/block/BlockGrimstone.java b/src/main/java/com/cricketcraft/chisel/block/BlockGrimstone.java index c2bb1ef9..decf4cdf 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockGrimstone.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockGrimstone.java @@ -9,27 +9,27 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.Chisel; import com.cricketcraft.chisel.client.GeneralChiselClient; -import com.cricketcraft.chisel.init.ModTabs; import com.cricketcraft.chisel.utils.General; public class BlockGrimstone extends BlockCarvable { - public IIcon iconStar; - public BlockGrimstone(Material m) { - super(m); - } + public IIcon iconStar; - @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); - } + public BlockGrimstone(Material m) { + super(m); + } - @Override - public void registerBlockIcons(IIconRegister register) { - super.registerBlockIcons(register); + @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); + } - iconStar = register.registerIcon(Chisel.MOD_ID + ":grimstone/particles/star"); - } + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); + + iconStar = register.registerIcon(Chisel.MOD_ID + ":grimstone/particles/star"); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockHolystone.java b/src/main/java/com/cricketcraft/chisel/block/BlockHolystone.java index e00c344f..4d937ea0 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockHolystone.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockHolystone.java @@ -11,25 +11,26 @@ import com.cricketcraft.chisel.client.GeneralChiselClient; import com.cricketcraft.chisel.utils.General; public class BlockHolystone extends BlockCarvable { - public IIcon iconStar; - public BlockHolystone(Material m) { - super(m); + public IIcon iconStar; - this.setLightLevel(0.25F); - } + public BlockHolystone(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.spawnHolystoneFX(world, this, x, y, z); - } + this.setLightLevel(0.25F); + } - @Override - public void registerBlockIcons(IIconRegister register) { - super.registerBlockIcons(register); + @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); + } - iconStar = register.registerIcon("Chisel:holystone/particles/star"); - } + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); + + iconStar = register.registerIcon("Chisel:holystone/particles/star"); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockLavastone.java b/src/main/java/com/cricketcraft/chisel/block/BlockLavastone.java index dda0a1e8..31839a76 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockLavastone.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockLavastone.java @@ -1,6 +1,5 @@ package com.cricketcraft.chisel.block; - import java.util.Random; import net.minecraft.block.material.Material; @@ -8,25 +7,22 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.client.GeneralChiselClient; -public class BlockLavastone extends BlockMarbleTexturedOre -{ - public BlockLavastone(Material mat, String baseIcon) - { - super(mat, baseIcon); - setLightLevel(1F); - } +public class BlockLavastone extends BlockMarbleTexturedOre { - @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); - } + public BlockLavastone(Material mat, String baseIcon) { + super(mat, baseIcon); + setLightLevel(1F); + } - @Override - public boolean renderAsNormalBlock() - { - return true; - } + @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; + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockLeaf.java b/src/main/java/com/cricketcraft/chisel/block/BlockLeaf.java index 7a47a389..ecb5484e 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockLeaf.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockLeaf.java @@ -4,12 +4,12 @@ import net.minecraft.block.material.Material; public class BlockLeaf extends BlockCarvable { - public BlockLeaf(Material material) { - super(material); - } + public BlockLeaf(Material material) { + super(material); + } - @Override - public boolean isOpaqueCube() { - return false; - } + @Override + public boolean isOpaqueCube() { + return false; + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockLightstoneCarvable.java b/src/main/java/com/cricketcraft/chisel/block/BlockLightstoneCarvable.java index 7fbf95c2..27ab5799 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockLightstoneCarvable.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockLightstoneCarvable.java @@ -8,22 +8,23 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; public class BlockLightstoneCarvable extends BlockCarvable { - public BlockLightstoneCarvable() { - super(Material.glass); - } - @Override - public int quantityDropped(Random random) { - return Blocks.glowstone.quantityDropped(random); - } + public BlockLightstoneCarvable() { + super(Material.glass); + } - @Override - public Item getItemDropped(int i, Random random, int a) { - return Items.glowstone_dust; - } + @Override + public int quantityDropped(Random random) { + return Blocks.glowstone.quantityDropped(random); + } - @Override - public int damageDropped(int i) { - return 0; - } + @Override + public Item getItemDropped(int i, Random random, int a) { + return Items.glowstone_dust; + } + + @Override + public int damageDropped(int i) { + return 0; + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleBookshelf.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleBookshelf.java index 687c4a11..05e01716 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleBookshelf.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleBookshelf.java @@ -11,47 +11,39 @@ import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockMarbleBookshelf extends BlockCarvable -{ +public class BlockMarbleBookshelf extends BlockCarvable { - public BlockMarbleBookshelf() - { - super(); - } + public BlockMarbleBookshelf() { + super(); + } + @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 par1Random) { + return 3; + } - @Override - public int quantityDropped(Random par1Random) - { - return 3; - } + @Override + public Item getItemDropped(int par1, Random par2Random, int par3) { + return Items.book; + } - @Override - public Item getItemDropped(int par1, Random par2Random, int par3) - { - return Items.book; - } - - @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/com/cricketcraft/chisel/block/BlockMarbleCarpet.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleCarpet.java index 208119d9..14d1a331 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleCarpet.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleCarpet.java @@ -14,58 +14,48 @@ import com.cricketcraft.chisel.Chisel; import com.cricketcraft.chisel.api.ICarvable; import com.cricketcraft.chisel.carving.CarvableHelper; import com.cricketcraft.chisel.carving.CarvableVariation; -import com.cricketcraft.chisel.init.ModTabs; -public class BlockMarbleCarpet extends BlockCarpet implements ICarvable -{ - public CarvableHelper carverHelper; +public class BlockMarbleCarpet extends BlockCarpet implements ICarvable { - public BlockMarbleCarpet(Material m) - { - carverHelper = new CarvableHelper(); - } + public CarvableHelper carverHelper; + public BlockMarbleCarpet(Material m) { + carverHelper = new CarvableHelper(); + } - @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); + } - @Override - public void getSubBlocks(Item item, CreativeTabs tabs, List list) - { - carverHelper.registerSubBlocks(this, tabs, list); - } + @Override + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - @Override - public int getRenderType() - { - return Chisel.RenderCarpetId; - } + @Override + public int getRenderType() { + return Chisel.RenderCarpetId; + } - @Override - public CarvableVariation getVariation(int metadata) - { - return carverHelper.getVariation(metadata); - } + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleIce.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleIce.java index 6b982003..f65cd360 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleIce.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleIce.java @@ -15,67 +15,56 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.api.ICarvable; import com.cricketcraft.chisel.carving.CarvableHelper; import com.cricketcraft.chisel.carving.CarvableVariation; -import com.cricketcraft.chisel.init.ModTabs; -public class BlockMarbleIce extends BlockIce implements ICarvable -{ - public CarvableHelper carverHelper; +public class BlockMarbleIce extends BlockIce implements ICarvable { - public BlockMarbleIce() - { - super(); - carverHelper = new CarvableHelper(); - } + public CarvableHelper carverHelper; - @Override - public IIcon getIcon(int side, int metadata) - { - return carverHelper.getIcon(side, metadata); - } + public BlockMarbleIce() { + super(); + carverHelper = new CarvableHelper(); + } - @Override - public int damageDropped(int i) - { - return 0; - } + @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 int damageDropped(int i) { + return 0; + } - @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 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 getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); - par2EntityPlayer.addExhaustion(0.025F); + @Override + public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { + super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -/* - if(this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) - { - ItemStack itemstack = this.createStackedBlock(par6); + par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + par2EntityPlayer.addExhaustion(0.025F); - 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 CarvableVariation getVariation(int metadata) - { - return carverHelper.getVariation(metadata); - } + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleIceStairs.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleIceStairs.java index 0ca59f52..fde458fb 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleIceStairs.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleIceStairs.java @@ -9,43 +9,37 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.carving.CarvableHelper; import com.cricketcraft.chisel.init.ModBlocks; -public class BlockMarbleIceStairs extends BlockMarbleStairs -{ - public BlockMarbleIceStairs(Block block, int meta, CarvableHelper helper) - { - super(block, meta, helper); +public class BlockMarbleIceStairs extends BlockMarbleStairs { - slipperiness = 0.98F; - setTickRandomly(true); - } + public BlockMarbleIceStairs(Block block, int meta, CarvableHelper helper) { + super(block, meta, helper); - @Override - public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) - { - ModBlocks.ice.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - } + slipperiness = 0.98F; + setTickRandomly(true); + } - @Override - public int quantityDropped(Random par1Random) - { - return ModBlocks.ice.quantityDropped(par1Random); - } + @Override + public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { + ModBlocks.ice.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + } - @Override - public int damageDropped(int i) - { - return 0; - } + @Override + public int quantityDropped(Random par1Random) { + return ModBlocks.ice.quantityDropped(par1Random); + } - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) - { - ModBlocks.ice.updateTick(par1World, par2, par3, par4, par5Random); - } + @Override + public int damageDropped(int i) { + return 0; + } - @Override - public int getMobilityFlag() - { - return 0; - } + @Override + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { + ModBlocks.ice.updateTick(par1World, par2, par3, par4, par5Random); + } + + @Override + public int getMobilityFlag() { + return 0; + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleLamp.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleLamp.java index 58ea4340..a7b2f5f4 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleLamp.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleLamp.java @@ -10,76 +10,75 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class BlockMarbleLamp extends BlockCarvable { - BlockMarbleLamp blockUnpowered; - BlockMarbleLamp blockPowered; - boolean powered; - public BlockMarbleLamp() { - super(Material.redstoneLight); + BlockMarbleLamp blockUnpowered; + BlockMarbleLamp blockPowered; + boolean powered; - powered = false; - blockUnpowered = this; - blockPowered = new BlockMarbleLamp(this); + public BlockMarbleLamp() { + super(Material.redstoneLight); - setHardness(0.3F); - } + powered = false; + blockUnpowered = this; + blockPowered = new BlockMarbleLamp(this); - public BlockMarbleLamp(BlockMarbleLamp unpoweredVersion) { - super(Material.redstoneLight); + setHardness(0.3F); + } - carverHelper = unpoweredVersion.carverHelper; + public BlockMarbleLamp(BlockMarbleLamp unpoweredVersion) { + super(Material.redstoneLight); - powered = true; - blockUnpowered = unpoweredVersion; - blockPowered = this; + carverHelper = unpoweredVersion.carverHelper; - setLightLevel(1.0F); - setHardness(0.3F); - } + powered = true; + blockUnpowered = unpoweredVersion; + blockPowered = this; + 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; + /* + * @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); } } + */ - 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/com/cricketcraft/chisel/block/BlockMarblePackedIce.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarblePackedIce.java index 5ebf9493..438470a2 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarblePackedIce.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarblePackedIce.java @@ -3,7 +3,6 @@ package com.cricketcraft.chisel.block; import java.util.List; import net.minecraft.block.Block; -import net.minecraft.block.BlockIce; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -16,67 +15,56 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.api.ICarvable; import com.cricketcraft.chisel.carving.CarvableHelper; import com.cricketcraft.chisel.carving.CarvableVariation; -import com.cricketcraft.chisel.init.ModTabs; -public class BlockMarblePackedIce extends Block implements ICarvable -{ - public CarvableHelper carverHelper; +public class BlockMarblePackedIce extends Block implements ICarvable { - public BlockMarblePackedIce() - { - super(Material.ice); - carverHelper = new CarvableHelper(); - } + public CarvableHelper carverHelper; - @Override - public IIcon getIcon(int side, int metadata) - { - return carverHelper.getIcon(side, metadata); - } + public BlockMarblePackedIce() { + super(Material.ice); + carverHelper = new CarvableHelper(); + } - @Override - public int damageDropped(int i) - { - return 0; - } + @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 int damageDropped(int i) { + return 0; + } - @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 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 getSubBlocks(Item item, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } - par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); - par2EntityPlayer.addExhaustion(0.025F); + @Override + public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { + super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -/* - if(this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) - { - ItemStack itemstack = this.createStackedBlock(par6); + par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + par2EntityPlayer.addExhaustion(0.025F); - 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 CarvableVariation getVariation(int metadata) - { - return carverHelper.getVariation(metadata); - } + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarblePackedIceStairs.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarblePackedIceStairs.java index b7c0d223..8c653ece 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarblePackedIceStairs.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarblePackedIceStairs.java @@ -9,43 +9,37 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.carving.CarvableHelper; import com.cricketcraft.chisel.init.ModBlocks; -public class BlockMarblePackedIceStairs extends BlockMarbleStairs -{ - public BlockMarblePackedIceStairs(Block block, int meta, CarvableHelper helper) - { - super(block, meta, helper); +public class BlockMarblePackedIceStairs extends BlockMarbleStairs { - slipperiness = 0.98F; - setTickRandomly(true); - } + public BlockMarblePackedIceStairs(Block block, int meta, CarvableHelper helper) { + super(block, meta, helper); - @Override - public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) - { - ModBlocks.ice.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - } + slipperiness = 0.98F; + setTickRandomly(true); + } - @Override - public int quantityDropped(Random par1Random) - { - return ModBlocks.ice.quantityDropped(par1Random); - } + @Override + public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { + ModBlocks.ice.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + } - @Override - public int damageDropped(int i) - { - return 0; - } + @Override + public int quantityDropped(Random par1Random) { + return ModBlocks.ice.quantityDropped(par1Random); + } - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) - { - ModBlocks.ice.updateTick(par1World, par2, par3, par4, par5Random); - } + @Override + public int damageDropped(int i) { + return 0; + } - @Override - public int getMobilityFlag() - { - return 0; - } + @Override + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { + ModBlocks.ice.updateTick(par1World, par2, par3, par4, par5Random); + } + + @Override + public int getMobilityFlag() { + return 0; + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarblePillar.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarblePillar.java index 04778a49..d39d9f03 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarblePillar.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarblePillar.java @@ -8,33 +8,36 @@ import com.cricketcraft.chisel.carving.CarvableVariation; import com.cricketcraft.chisel.client.render.BlockMarblePillarRenderer; public class BlockMarblePillar extends BlockCarvable { - public IIcon sides[] = new IIcon[6]; - public BlockMarblePillar(Material m) { - super(m); - } + public IIcon sides[] = new IIcon[6]; - @Override - public int getRenderType() { - return BlockMarblePillarRenderer.id; - } + public BlockMarblePillar(Material m) { + super(m); + } - @Override - public IIcon getIcon(int side, int metadata) { - return sides[side]; - } + @Override + public int getRenderType() { + return BlockMarblePillarRenderer.id; + } - @Override - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { - return sides[side]; - } + @Override + public IIcon getIcon(int side, int metadata) { + return sides[side]; + } - public IIcon getCtmIcon(int index, int metadata) { - CarvableVariation var = carverHelper.variations.get(metadata); + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + return sides[side]; + } - if (index >= 4) return var.iconTop; - if (var.seamsCtmVert == null) return var.icon; - return var.seamsCtmVert.icons[index]; - } + public IIcon getCtmIcon(int index, int metadata) { + CarvableVariation var = carverHelper.variations.get(metadata); + + if (index >= 4) + return var.iconTop; + if (var.seamsCtmVert == null) + return var.icon; + return var.seamsCtmVert.icons[index]; + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleSlab.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleSlab.java index 1c26f357..bf9bb645 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleSlab.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleSlab.java @@ -16,106 +16,92 @@ import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockMarbleSlab extends BlockCarvable -{ - public Block master; - public BlockMarbleSlab bottom; - public BlockMarbleSlab top; - public boolean isBottom; +public class BlockMarbleSlab extends BlockCarvable { - public BlockMarbleSlab(BlockCarvable marble) - { - opaque = true; + public Block master; + public BlockMarbleSlab bottom; + public BlockMarbleSlab top; + public boolean isBottom; - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + public BlockMarbleSlab(BlockCarvable marble) { + opaque = true; - master = marble; - bottom = this; - top = new BlockMarbleSlab(this); + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); - isBottom = true; - } + master = marble; + bottom = this; + top = new BlockMarbleSlab(this); - public BlockMarbleSlab(BlockMarbleSlab bottomBlock) - { - super(); - setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); - master = bottomBlock.master; - bottom = bottomBlock; - top = this; + isBottom = true; + } - carverHelper = bottomBlock.carverHelper; - isBottom = false; - } + public BlockMarbleSlab(BlockMarbleSlab bottomBlock) { + super(); + setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + master = bottomBlock.master; + bottom = bottomBlock; + top = this; - @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); - } - } + carverHelper = bottomBlock.carverHelper; + isBottom = false; + } - @Override - public void setBlockBoundsForItemRender() - { - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 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 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 void setBlockBoundsForItemRender() { + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } - @Override - public boolean isOpaqueCube() - { - return false; - } + @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 int damageDropped(int meta) - { - return meta; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public Item getItemDropped(int par1, Random par2Random, int par3) - { - return Item.getItemFromBlock(bottom); - } + @Override + public int damageDropped(int meta) { + return meta; + } - @Override - public boolean renderAsNormalBlock() - { - return false; - } + @Override + public Item getItemDropped(int par1, Random par2Random, int par3) { + return Item.getItemFromBlock(bottom); + } - @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 boolean renderAsNormalBlock() { + return false; + } - @Override - public IIcon getIcon(int side, int metadata) - { - return carverHelper.getIcon(side, metadata); -// return master.getIcon(side, metadata); - } + @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 void getSubBlocks(Item block, CreativeTabs tabs, List list) - { - if(isBottom) - super.getSubBlocks(block, tabs, list); - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + // return master.getIcon(side, metadata); + } + + @Override + public void getSubBlocks(Item block, CreativeTabs tabs, List list) { + if (isBottom) + super.getSubBlocks(block, tabs, list); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairs.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairs.java index f1f7f59e..59a6525e 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairs.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairs.java @@ -17,93 +17,78 @@ import com.cricketcraft.chisel.api.ICarvable; import com.cricketcraft.chisel.carving.CarvableHelper; import com.cricketcraft.chisel.carving.CarvableVariation; import com.cricketcraft.chisel.client.render.BlockMarbleStairsRenderer; -import com.cricketcraft.chisel.init.ModTabs; -public class BlockMarbleStairs extends BlockStairs implements ICarvable -{ - CarvableHelper carverHelper; - int blockMeta; +public class BlockMarbleStairs extends BlockStairs implements ICarvable { - public BlockMarbleStairs(Block block, int meta, CarvableHelper helper) - { - super(block, meta); + CarvableHelper carverHelper; + int blockMeta; - this.useNeighborBrightness = true; - carverHelper = helper; - blockMeta = meta; - } + public BlockMarbleStairs(Block block, int meta, CarvableHelper helper) { + super(block, meta); - @Override - public IIcon getIcon(int side, int metadata) - { - return carverHelper.getIcon(side, blockMeta + metadata / 8); - } + this.useNeighborBrightness = true; + carverHelper = helper; + blockMeta = meta; + } - @Override - public int damageDropped(int i) - { - return i & 0x8; - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, blockMeta + metadata / 8); + } - @Override - public void registerBlockIcons(IIconRegister register) - { - if(blockMeta == 0) - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public int damageDropped(int i) { + return i & 0x8; + } - @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 void registerBlockIcons(IIconRegister register) { + if (blockMeta == 0) + carverHelper.registerBlockIcons("Chisel", this, register); + } - @Override - public int getRenderType() - { - return BlockMarbleStairsRenderer.id; - } + @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 void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) - { - int l = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - int i1 = par1World.getBlockMetadata(par2, par3, par4) & 4; - int odd = par6ItemStack.getItemDamage(); + @Override + public int getRenderType() { + return BlockMarbleStairsRenderer.id; + } - if(l == 0) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | i1 + odd, 2); - } + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) { + int l = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int i1 = par1World.getBlockMetadata(par2, par3, par4) & 4; + int odd = par6ItemStack.getItemDamage(); - if(l == 1) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | i1 + odd, 2); - } + if (l == 0) { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | i1 + odd, 2); + } - if(l == 2) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | i1 + odd, 2); - } + if (l == 1) { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | i1 + odd, 2); + } - if(l == 3) - { - par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | i1 + odd, 2); - } - } + if (l == 2) { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | i1 + odd, 2); + } + if (l == 3) { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | i1 + odd, 2); + } + } - @Override - public int onBlockPlaced(World world, int x, int y, int z, int side, float hx, float hy, float hz, int damage) - { - // int res=super.onBlockPlaced(); - 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) { + // int res=super.onBlockPlaced(); + return side != 0 && (side == 1 || hy <= 0.5D) ? damage : damage | 4; + } - @Override - public CarvableVariation getVariation(int metadata) - { - return carverHelper.getVariation(metadata); - } + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairsMaker.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairsMaker.java index b0353a4d..1d6441db 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairsMaker.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairsMaker.java @@ -10,52 +10,45 @@ import com.cricketcraft.chisel.item.ItemCarvable; import cpw.mods.fml.common.registry.GameRegistry; -public class BlockMarbleStairsMaker -{ - public CarvableHelper carverHelper; - BlockMarbleStairs blocks[]; +public class BlockMarbleStairsMaker { - //int idStart; - Block blockBase; - String blockName; + public CarvableHelper carverHelper; + BlockMarbleStairs blocks[]; - public BlockMarbleStairsMaker(Block base) - { - carverHelper = new CarvableHelper(); - blockBase = base; - } + // int idStart; + Block blockBase; + String blockName; - public void create(String name) - { - create(null, name); - } + public BlockMarbleStairsMaker(Block base) { + carverHelper = new CarvableHelper(); + blockBase = base; + } - public void create(BlockMarbleStairsMakerCreator creator, String name) - { - blocks = new BlockMarbleStairs[carverHelper.variations.size() / 2]; - for(int i = 0; i < blocks.length; i++) - { - String n = name + "." + i; - blocks[i] = creator == null ? - new BlockMarbleStairs(blockBase, i * 2, carverHelper) : - creator.create(blockBase, i * 2, carverHelper); + public void create(String name) { + create(null, name); + } - blocks[i].setBlockName(n); - GameRegistry.registerBlock(blocks[i], ItemCarvable.class, n); + public void create(BlockMarbleStairsMakerCreator creator, String name) { + blocks = new BlockMarbleStairs[carverHelper.variations.size() / 2]; + for (int i = 0; i < blocks.length; i++) { + String n = name + "." + i; + blocks[i] = creator == null ? new BlockMarbleStairs(blockBase, i * 2, carverHelper) : creator.create(blockBase, i * 2, carverHelper); - for(int meta = 0; meta < 2 && i * 2 + meta < carverHelper.variations.size(); meta++) - { - CarvableVariation variation = carverHelper.variations.get(i * 2 + meta); + blocks[i].setBlockName(n); + GameRegistry.registerBlock(blocks[i], ItemCarvable.class, n); - for(int j = 0; j < 8; j++) - carverHelper.registerVariation(name + ".orientation." + j, variation, blocks[i], j + meta * 8); + for (int meta = 0; meta < 2 && i * 2 + meta < carverHelper.variations.size(); meta++) { + CarvableVariation variation = carverHelper.variations.get(i * 2 + meta); - CraftingManager.getInstance().addRecipe(new ItemStack(blocks[i], 4, meta * 8), new Object[]{"* ", "** ", "***", '*', new ItemStack(blockBase, 1, i * 2 + meta)}); - } + for (int j = 0; j < 8; j++) + carverHelper.registerVariation(name + ".orientation." + j, variation, blocks[i], j + meta * 8); - CarvableHelper.chiselBlocks.add(blocks[i]); - } + CraftingManager.getInstance().addRecipe(new ItemStack(blocks[i], 4, meta * 8), new Object[] { "* ", "** ", "***", '*', new ItemStack(blockBase, 1, i * 2 + meta) }); + } - } + CarvableHelper.chiselBlocks.add(blocks[i]); + } + + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairsMakerCreator.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairsMakerCreator.java index 5f336319..9dccda72 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairsMakerCreator.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleStairsMakerCreator.java @@ -4,7 +4,7 @@ import net.minecraft.block.Block; import com.cricketcraft.chisel.carving.CarvableHelper; -public interface BlockMarbleStairsMakerCreator -{ - public BlockMarbleStairs create(Block block, int meta, CarvableHelper helper); +public interface BlockMarbleStairsMakerCreator { + + public BlockMarbleStairs create(Block block, int meta, CarvableHelper helper); } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleTexturedOre.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleTexturedOre.java index b4a17d00..f19bc00a 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleTexturedOre.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleTexturedOre.java @@ -12,54 +12,47 @@ import net.minecraft.util.IIcon; import com.cricketcraft.chisel.api.ICarvable; import com.cricketcraft.chisel.carving.CarvableHelper; import com.cricketcraft.chisel.carving.CarvableVariation; -import com.cricketcraft.chisel.init.ModTabs; -public class BlockMarbleTexturedOre extends BlockTexturedOre implements ICarvable -{ - public CarvableHelper carverHelper; +public class BlockMarbleTexturedOre extends BlockTexturedOre implements ICarvable { - public BlockMarbleTexturedOre(Material mat, String baseIcon) - { - super(mat, baseIcon); + public CarvableHelper carverHelper; - carverHelper = new CarvableHelper(); - } + public BlockMarbleTexturedOre(Material mat, String baseIcon) { + super(mat, baseIcon); - public BlockMarbleTexturedOre(Material mat, Block block) { - super(mat, block); + carverHelper = new CarvableHelper(); + } - carverHelper = new CarvableHelper(); - } + public BlockMarbleTexturedOre(Material mat, Block block) { + super(mat, block); - @Override - public IIcon getIcon(int side, int metadata) - { - return carverHelper.getIcon(side, metadata); - } + carverHelper = new CarvableHelper(); + } - @Override - public int damageDropped(int i) - { - return i; - } + @Override + public IIcon getIcon(int side, int metadata) { + return carverHelper.getIcon(side, metadata); + } - @Override - public void registerBlockIcons(IIconRegister register) - { - super.registerBlockIcons(register); + @Override + public int damageDropped(int i) { + return i; + } - carverHelper.registerBlockIcons("Chisel", this, register); - } + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); - @Override - public void getSubBlocks(Item block, CreativeTabs tabs, List list) - { - carverHelper.registerSubBlocks(this, tabs, list); - } + carverHelper.registerBlockIcons("Chisel", this, register); + } - @Override - public CarvableVariation getVariation(int metadata) - { - return carverHelper.getVariation(metadata); - } + @Override + public void getSubBlocks(Item block, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } + + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleWall.java b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleWall.java index b106157c..8e425045 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockMarbleWall.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockMarbleWall.java @@ -10,40 +10,34 @@ import net.minecraft.item.Item; import net.minecraft.util.IIcon; import com.cricketcraft.chisel.carving.CarvableHelper; -import com.cricketcraft.chisel.init.ModTabs; -public class BlockMarbleWall extends BlockWall -{ - CarvableHelper carverHelper; +public class BlockMarbleWall extends BlockWall { - public BlockMarbleWall(Block block) - { - super(block); + CarvableHelper carverHelper; - carverHelper = new CarvableHelper(); - } + public BlockMarbleWall(Block block) { + super(block); - @Override - public IIcon getIcon(int side, int metadata) - { - return carverHelper.getIcon(side, metadata); - } + carverHelper = new CarvableHelper(); + } - @Override - public int damageDropped(int i) - { - return i; - } + @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 int damageDropped(int i) { + return i; + } - @Override - public void getSubBlocks(Item block, CreativeTabs tabs, List list) - { - carverHelper.registerSubBlocks(this, tabs, list); - } + @Override + public void registerBlockIcons(IIconRegister register) { + carverHelper.registerBlockIcons("Chisel", this, register); + } + + @Override + public void getSubBlocks(Item block, CreativeTabs tabs, List list) { + carverHelper.registerSubBlocks(this, tabs, list); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockPresent.java b/src/main/java/com/cricketcraft/chisel/block/BlockPresent.java index 99745cad..00509d13 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockPresent.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockPresent.java @@ -1,12 +1,8 @@ package com.cricketcraft.chisel.block; -import com.cricketcraft.chisel.api.ICarvable; -import com.cricketcraft.chisel.block.tileentity.TileEntityPresent; -import com.cricketcraft.chisel.carving.CarvableHelper; -import com.cricketcraft.chisel.carving.CarvableVariation; -import com.cricketcraft.chisel.inventory.InventoryLargePresent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockChest; import net.minecraft.client.renderer.texture.IIconRegister; @@ -25,293 +21,303 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import java.util.Iterator; -import java.util.Random; +import com.cricketcraft.chisel.api.ICarvable; +import com.cricketcraft.chisel.block.tileentity.TileEntityPresent; +import com.cricketcraft.chisel.carving.CarvableHelper; +import com.cricketcraft.chisel.carving.CarvableVariation; +import com.cricketcraft.chisel.inventory.InventoryLargePresent; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockPresent extends BlockChest implements ICarvable { - private final Random random = new Random(); - private int type; - public CarvableHelper carverHelper; - public BlockPresent(int type) { - super(1); - this.type = type; - carverHelper = new CarvableHelper(); - setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0875F, 0.9365F); - } + private final Random random = new Random(); + private int type; + public CarvableHelper carverHelper; - public String getKindOfChest(int type){ - switch (type){ - case 0: - return "textures/blocks/present/presentChest0"; - case 1: - return "textures/blocks/present/presentChest1"; - case 2: - return "textures/blocks/present/presentChest2"; - case 3: - return "textures/blocks/present/presentChest3"; - case 4: - return "textures/blocks/present/presentChest4"; - case 5: - return "textures/blocks/present/presentChest5"; - case 6: - return "textures/blocks/present/presentChest6"; - case 7: - return "textures/blocks/present/presentChest7"; - case 8: - return "textures/blocks/present/presentChest8"; - case 9: - return "textures/blocks/present/presentChest9"; - case 10: - return "textures/blocks/present/presentChest10"; - case 11: - return "textures/blocks/present/presentChest11"; - case 12: - return "textures/blocks/present/presentChest12"; - case 13: - return "textures/blocks/present/presentChest13"; - case 14: - return "textures/blocks/present/presentChest14"; - case 15: - return "textures/blocks/present/presentChest15"; - default: - return null; - } - } + public BlockPresent(int type) { + super(1); + this.type = type; + carverHelper = new CarvableHelper(); + setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0875F, 0.9365F); + } - private static boolean isCatSittingOnMe(World world, int x, int y, int z) { - Iterator iterator = world.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getBoundingBox(x, y + 1, z, x + 1, y + 2, z + 1)).iterator(); - EntityOcelot ocelot; + public String getKindOfChest(int type) { + switch (type) { + case 0: + return "textures/blocks/present/presentChest0"; + case 1: + return "textures/blocks/present/presentChest1"; + case 2: + return "textures/blocks/present/presentChest2"; + case 3: + return "textures/blocks/present/presentChest3"; + case 4: + return "textures/blocks/present/presentChest4"; + case 5: + return "textures/blocks/present/presentChest5"; + case 6: + return "textures/blocks/present/presentChest6"; + case 7: + return "textures/blocks/present/presentChest7"; + case 8: + return "textures/blocks/present/presentChest8"; + case 9: + return "textures/blocks/present/presentChest9"; + case 10: + return "textures/blocks/present/presentChest10"; + case 11: + return "textures/blocks/present/presentChest11"; + case 12: + return "textures/blocks/present/presentChest12"; + case 13: + return "textures/blocks/present/presentChest13"; + case 14: + return "textures/blocks/present/presentChest14"; + case 15: + return "textures/blocks/present/presentChest15"; + default: + return null; + } + } - do { - if (!iterator.hasNext()) { - return false; - } + private static boolean isCatSittingOnMe(World world, int x, int y, int z) { + Iterator iterator = world.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getBoundingBox(x, y + 1, z, x + 1, y + 2, z + 1)).iterator(); + EntityOcelot ocelot; - Entity entity = (Entity) iterator.next(); - ocelot = (EntityOcelot) entity; - } while (!ocelot.isSitting()); + do { + if (!iterator.hasNext()) { + return false; + } - return true; - } + Entity entity = (Entity) iterator.next(); + ocelot = (EntityOcelot) entity; + } while (!ocelot.isSitting()); - @Override - public boolean isOpaqueCube() { - return false; - } + return true; + } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public int getRenderType() { - return -1; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLivingBase, ItemStack itemStack) { - Block front = world.getBlock(x, y, z - 1); - Block back = world.getBlock(x, y, z + 1); - Block left = world.getBlock(x - 1, y, z); - Block right = world.getBlock(x + 1, y, z); - byte metadata = 0; - int rot = MathHelper.floor_double((entityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + @Override + public int getRenderType() { + return -1; + } - if (rot == 0) { - metadata = 2; - } + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLivingBase, ItemStack itemStack) { + Block front = world.getBlock(x, y, z - 1); + Block back = world.getBlock(x, y, z + 1); + Block left = world.getBlock(x - 1, y, z); + Block right = world.getBlock(x + 1, y, z); + byte metadata = 0; + int rot = MathHelper.floor_double((entityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - if (rot == 1) { - metadata = 5; - } + if (rot == 0) { + metadata = 2; + } - if (rot == 2) { - metadata = 3; - } + if (rot == 1) { + metadata = 5; + } - if (rot == 3) { - metadata = 4; - } + if (rot == 2) { + metadata = 3; + } - if (front != this && back != this && left != this && right != this) { - world.setBlockMetadataWithNotify(x, y, z, metadata, 3); - } else { - if ((front == this || back == this) && (metadata == 4 || metadata == 5)) { - if (front == this) { - world.setBlockMetadataWithNotify(x, y, z - 1, metadata, 3); - } else { - world.setBlockMetadataWithNotify(x, y, z + 1, metadata, 3); - } + if (rot == 3) { + metadata = 4; + } - world.setBlockMetadataWithNotify(x, y, z, metadata, 3); - } + if (front != this && back != this && left != this && right != this) { + world.setBlockMetadataWithNotify(x, y, z, metadata, 3); + } else { + if ((front == this || back == this) && (metadata == 4 || metadata == 5)) { + if (front == this) { + world.setBlockMetadataWithNotify(x, y, z - 1, metadata, 3); + } else { + world.setBlockMetadataWithNotify(x, y, z + 1, metadata, 3); + } - if ((left == this || right == this) && (metadata == 2 || metadata == 3)) { - if (left == this) { - world.setBlockMetadataWithNotify(x - 1, y, z, metadata, 3); - } else { - world.setBlockMetadataWithNotify(x + 1, y, z, metadata, 3); - } + world.setBlockMetadataWithNotify(x, y, z, metadata, 3); + } - world.setBlockMetadataWithNotify(x, y, z, metadata, 3); - } - } - } + if ((left == this || right == this) && (metadata == 2 || metadata == 3)) { + if (left == this) { + world.setBlockMetadataWithNotify(x - 1, y, z, metadata, 3); + } else { + world.setBlockMetadataWithNotify(x + 1, y, z, metadata, 3); + } - @Override - public boolean canPlaceBlockAt(World world, int x, int y, int z) { - int l = 0; + world.setBlockMetadataWithNotify(x, y, z, metadata, 3); + } + } + } - if (world.getBlock(x - 1, y, z) == this) { - ++l; - } + @Override + public boolean canPlaceBlockAt(World world, int x, int y, int z) { + int l = 0; - if (world.getBlock(x + 1, y, z) == this) { - ++l; - } + if (world.getBlock(x - 1, y, z) == this) { + ++l; + } - if (world.getBlock(x, y, z - 1) == this) { - ++l; - } + if (world.getBlock(x + 1, y, z) == this) { + ++l; + } - if (world.getBlock(x, y, z + 1) == this) { - ++l; - } + if (world.getBlock(x, y, z - 1) == this) { + ++l; + } - return l > 1 ? false : (areSurroundingBlocksMe(world, x, y - 1, z) ? false : (areSurroundingBlocksMe(world, x, y + 1, z) ? false : (areSurroundingBlocksMe(world, x, y, z - 1) ? false : !areSurroundingBlocksMe(world, x, y, z + 1)))); - } + if (world.getBlock(x, y, z + 1) == this) { + ++l; + } - private boolean areSurroundingBlocksMe(World world, int x, int y, int z) { - return world.getBlock(x, y, z) != this ? false : (world.getBlock(x - 1, y, z) == this ? true : (world.getBlock(x + 1, y, z) == this ? true : (world.getBlock(x, y, z - 1) == this ? true : world.getBlock(x, y, z + 1) == this))); - } + return l > 1 ? false : (areSurroundingBlocksMe(world, x, y - 1, z) ? false : (areSurroundingBlocksMe(world, x, y + 1, z) ? false : (areSurroundingBlocksMe(world, x, y, z - 1) ? false + : !areSurroundingBlocksMe(world, x, y, z + 1)))); + } - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) { - super.onNeighborBlockChange(world, x, y, z, neighbor); - TileEntityPresent tileEntityPresent = (TileEntityPresent) world.getTileEntity(x, y, z); + private boolean areSurroundingBlocksMe(World world, int x, int y, int z) { + return world.getBlock(x, y, z) != this ? false : (world.getBlock(x - 1, y, z) == this ? true : (world.getBlock(x + 1, y, z) == this ? true : (world.getBlock(x, y, z - 1) == this ? true + : world.getBlock(x, y, z + 1) == this))); + } - if (tileEntityPresent != null) { - tileEntityPresent.updateContainingBlockInfo(); - } - } + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) { + super.onNeighborBlockChange(world, x, y, z, neighbor); + TileEntityPresent tileEntityPresent = (TileEntityPresent) world.getTileEntity(x, y, z); - @Override - public void breakBlock(World world, int x, int y, int z, Block present, int meta) { - TileEntityPresent tileEntityPresent = (TileEntityPresent) world.getTileEntity(x, y, z); + if (tileEntityPresent != null) { + tileEntityPresent.updateContainingBlockInfo(); + } + } - if (tileEntityPresent != null) { - for (int c = 0; c < tileEntityPresent.getSizeInventory(); c++) { - ItemStack itemStack = tileEntityPresent.getStackInSlot(c); + @Override + public void breakBlock(World world, int x, int y, int z, Block present, int meta) { + TileEntityPresent tileEntityPresent = (TileEntityPresent) world.getTileEntity(x, y, z); - if (itemStack != null) { - float f = random.nextFloat() * 0.8F + 0.1F; - float f1 = random.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem; + if (tileEntityPresent != null) { + for (int c = 0; c < tileEntityPresent.getSizeInventory(); c++) { + ItemStack itemStack = tileEntityPresent.getStackInSlot(c); - for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemStack.stackSize > 0; world.spawnEntityInWorld(entityItem)) { - int stack = random.nextInt(21) + 10; + if (itemStack != null) { + float f = random.nextFloat() * 0.8F + 0.1F; + float f1 = random.nextFloat() * 0.8F + 0.1F; + EntityItem entityItem; - if (stack > itemStack.stackSize) { - stack = itemStack.stackSize; - } + for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemStack.stackSize > 0; world.spawnEntityInWorld(entityItem)) { + int stack = random.nextInt(21) + 10; - itemStack.stackSize -= stack; - entityItem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemStack.getItem(), stack, itemStack.getItemDamage())); - float motion = 0.05F; - entityItem.motionX = random.nextGaussian() * motion; - entityItem.motionY = random.nextGaussian() * motion + 0.2F; - entityItem.motionZ = random.nextGaussian() * motion; + if (stack > itemStack.stackSize) { + stack = itemStack.stackSize; + } - if (itemStack.hasTagCompound()) { - entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); - } - } - } - } + itemStack.stackSize -= stack; + entityItem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemStack.getItem(), stack, itemStack.getItemDamage())); + float motion = 0.05F; + entityItem.motionX = random.nextGaussian() * motion; + entityItem.motionY = random.nextGaussian() * motion + 0.2F; + entityItem.motionZ = random.nextGaussian() * motion; - world.func_147453_f(x, y, z, this); - } + if (itemStack.hasTagCompound()) { + entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); + } + } + } + } - super.breakBlock(world, x, y, z, this, meta); - } + world.func_147453_f(x, y, z, this); + } - @Override - public TileEntity createNewTileEntity(World world, int par2) { - return new TileEntityPresent(type); - } + super.breakBlock(world, x, y, z, this, meta); + } - @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int strength) { - if (!canProvidePower()) { - return 0; - } else { - int players = ((TileEntityPresent) world.getTileEntity(x, y, z)).numPlayersUsing; - return MathHelper.clamp_int(players, 0, 15); - } - } + @Override + public TileEntity createNewTileEntity(World world, int par2) { + return new TileEntityPresent(type); + } - @Override - public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int strength) { - return strength == 1 ? isProvidingWeakPower(world, x, y, z, strength) : 0; - } + @Override + public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int strength) { + if (!canProvidePower()) { + return 0; + } else { + int players = ((TileEntityPresent) world.getTileEntity(x, y, z)).numPlayersUsing; + return MathHelper.clamp_int(players, 0, 15); + } + } - @Override - public boolean hasComparatorInputOverride() { - return true; - } + @Override + public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int strength) { + return strength == 1 ? isProvidingWeakPower(world, x, y, z, strength) : 0; + } - @Override - public int getComparatorInputOverride(World world, int x, int y, int z, int strength) { - return Container.calcRedstoneFromInventory(getInventory(world, x, y, z)); - } + @Override + public boolean hasComparatorInputOverride() { + return true; + } - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister register) { - this.blockIcon = register.registerIcon("planks_oak"); - } + @Override + public int getComparatorInputOverride(World world, int x, int y, int z, int strength) { + return Container.calcRedstoneFromInventory(getInventory(world, x, y, z)); + } - public IInventory getInventory(World world, int x, int y, int z) { - Object object = world.getTileEntity(x, y, z); + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister register) { + this.blockIcon = register.registerIcon("planks_oak"); + } - if (object == null) { - return null; - } else if (world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)) { - return null; - } else if (isCatSittingOnMe(world, x, y, z)) { - return null; - } else if (world.getBlock(x - 1, y, z) == this && (world.isSideSolid(x - 1, y + 1, z, ForgeDirection.DOWN) || isCatSittingOnMe(world, x, y - 1, z))) { - return null; - } else if (world.getBlock(x + 1, y, z) == this && (world.isSideSolid(x + 1, y + 1, z, ForgeDirection.DOWN) || isCatSittingOnMe(world, x, y + 1, z))) { - return null; - } else if (world.getBlock(x, y, z - 1) == this && (world.isSideSolid(x, y + 1, z - 1, ForgeDirection.DOWN) || isCatSittingOnMe(world, x, y, z - 1))) { - return null; - } else if (world.getBlock(x, y, z + 1) == this && (world.isSideSolid(x, y + 1, z + 1, ForgeDirection.DOWN) || isCatSittingOnMe(world, x, y, z + 1))) { - return null; - } else { - if (world.getBlock(x - 1, y, z) == this) { - object = new InventoryLargePresent("container.chestDouble", (TileEntityPresent) world.getTileEntity(x - 1, y, z), (IInventory) object); - } + public IInventory getInventory(World world, int x, int y, int z) { + Object object = world.getTileEntity(x, y, z); - if (world.getBlock(x + 1, y, z) == this) { - object = new InventoryLargePresent("container.chestDouble", (TileEntityPresent) world.getTileEntity(x + 1, y, z), (IInventory) object); - } + if (object == null) { + return null; + } else if (world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)) { + return null; + } else if (isCatSittingOnMe(world, x, y, z)) { + return null; + } else if (world.getBlock(x - 1, y, z) == this && (world.isSideSolid(x - 1, y + 1, z, ForgeDirection.DOWN) || isCatSittingOnMe(world, x, y - 1, z))) { + return null; + } else if (world.getBlock(x + 1, y, z) == this && (world.isSideSolid(x + 1, y + 1, z, ForgeDirection.DOWN) || isCatSittingOnMe(world, x, y + 1, z))) { + return null; + } else if (world.getBlock(x, y, z - 1) == this && (world.isSideSolid(x, y + 1, z - 1, ForgeDirection.DOWN) || isCatSittingOnMe(world, x, y, z - 1))) { + return null; + } else if (world.getBlock(x, y, z + 1) == this && (world.isSideSolid(x, y + 1, z + 1, ForgeDirection.DOWN) || isCatSittingOnMe(world, x, y, z + 1))) { + return null; + } else { + if (world.getBlock(x - 1, y, z) == this) { + object = new InventoryLargePresent("container.chestDouble", (TileEntityPresent) world.getTileEntity(x - 1, y, z), (IInventory) object); + } - if (world.getBlock(x, y, z - 1) == this) { - object = new InventoryLargePresent("container.chestDouble", (TileEntityPresent) world.getTileEntity(x, y, z - 1), (IInventory) object); - } + if (world.getBlock(x + 1, y, z) == this) { + object = new InventoryLargePresent("container.chestDouble", (TileEntityPresent) world.getTileEntity(x + 1, y, z), (IInventory) object); + } - if (world.getBlock(x, y, z + 1) == this) { - object = new InventoryLargePresent("container.chestDouble", (TileEntityPresent) world.getTileEntity(x, y, z + 1), (IInventory) object); - } + if (world.getBlock(x, y, z - 1) == this) { + object = new InventoryLargePresent("container.chestDouble", (TileEntityPresent) world.getTileEntity(x, y, z - 1), (IInventory) object); + } - return (IInventory) object; - } - } + if (world.getBlock(x, y, z + 1) == this) { + object = new InventoryLargePresent("container.chestDouble", (TileEntityPresent) world.getTileEntity(x, y, z + 1), (IInventory) object); + } - @Override - public CarvableVariation getVariation(int metadata) { - return carverHelper.getVariation(metadata); - } + return (IInventory) object; + } + } + + @Override + public CarvableVariation getVariation(int metadata) { + return carverHelper.getVariation(metadata); + } } \ No newline at end of file diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockRoadLine.java b/src/main/java/com/cricketcraft/chisel/block/BlockRoadLine.java index e2601567..40f0e497 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockRoadLine.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockRoadLine.java @@ -9,72 +9,63 @@ import net.minecraft.util.IIcon; import net.minecraft.world.World; import com.cricketcraft.chisel.client.render.BlockRoadLineRenderer; -import com.cricketcraft.chisel.init.ModTabs; -public class BlockRoadLine extends Block -{ - public IIcon aloneIcon; - public IIcon halfLineIcon; - public IIcon fullLineIcon; +public class BlockRoadLine extends Block { - public BlockRoadLine() - { - super(Material.circuits); + public IIcon aloneIcon; + public IIcon halfLineIcon; + public IIcon fullLineIcon; - 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); - } + public BlockRoadLine() { + super(Material.circuits); - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) - { - return null; - } + 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 boolean isOpaqueCube() - { - return false; - } + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } - @Override - public boolean renderAsNormalBlock() - { - return false; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public int getRenderType() - { - return BlockRoadLineRenderer.id; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @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 int getRenderType() { + return BlockRoadLineRenderer.id; + } - @Override - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block block) - { - if(par1World.isRemote) return; + @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); + } - if(!this.canPlaceBlockAt(par1World, par2, par3, par4)) - { - this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); - par1World.setBlockToAir(par2, par3, par4); - } + @Override + public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block block) { + if (par1World.isRemote) + return; - super.onNeighborBlockChange(par1World, par2, par3, par4, block); - } + if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { + this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); + par1World.setBlockToAir(par2, par3, par4); + } - @Override - public void registerBlockIcons(IIconRegister reg) - { - blockIcon = aloneIcon = reg.registerIcon("Chisel:line-marking/white-center"); - halfLineIcon = reg.registerIcon("Chisel:line-marking/white-side"); - fullLineIcon = reg.registerIcon("Chisel:line-marking/white-long"); - } + super.onNeighborBlockChange(par1World, par2, par3, par4, block); + } + + @Override + public void registerBlockIcons(IIconRegister reg) { + blockIcon = aloneIcon = reg.registerIcon("Chisel:line-marking/white-center"); + halfLineIcon = reg.registerIcon("Chisel:line-marking/white-side"); + fullLineIcon = reg.registerIcon("Chisel:line-marking/white-long"); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockSnakestone.java b/src/main/java/com/cricketcraft/chisel/block/BlockSnakestone.java index 45fb3af8..7048f1f2 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockSnakestone.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockSnakestone.java @@ -14,562 +14,536 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import com.cricketcraft.chisel.client.render.BlockSnakeStoneRenderer; -import com.cricketcraft.chisel.init.ModTabs; - -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 BlockSnakeStoneRenderer.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); - int kind = blockMeta & 0xc; - - 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) - { - int type = meta & 0xc; - int orient = meta & 0x3; - - 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; - } - - @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"); - } + +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 BlockSnakeStoneRenderer.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); + int kind = blockMeta & 0xc; + + 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) { + int type = meta & 0xc; + int orient = meta & 0x3; + + 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; + } + + @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 diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockSnakestoneObsidian.java b/src/main/java/com/cricketcraft/chisel/block/BlockSnakestoneObsidian.java index b36001de..84310e2b 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockSnakestoneObsidian.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockSnakestoneObsidian.java @@ -1,6 +1,5 @@ package com.cricketcraft.chisel.block; - import java.util.Random; import net.minecraft.client.renderer.texture.IIconRegister; @@ -9,33 +8,29 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.client.GeneralChiselClient; -public class BlockSnakestoneObsidian extends BlockSnakestone -{ - public IIcon[] particles = new IIcon[8]; +public class BlockSnakestoneObsidian extends BlockSnakestone { - public BlockSnakestoneObsidian(String iconPrefix) - { - super(iconPrefix); + public IIcon[] particles = new IIcon[8]; - flipTopTextures = true; + public BlockSnakestoneObsidian(String iconPrefix) { + super(iconPrefix); - } + 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 registerBlockIcons(IIconRegister register) - { - super.registerBlockIcons(register); + @Override + public void randomDisplayTick(World world, int x, int y, int z, Random random) { + GeneralChiselClient.spawnSnakestoneObsidianFX(world, this, x, y, z); + } - for(int i = 0; i < particles.length; i++) - { - particles[i] = register.registerIcon(iconPrefix + "particles/" + i); - } - } + @Override + public void registerBlockIcons(IIconRegister register) { + super.registerBlockIcons(register); + + for (int i = 0; i < particles.length; i++) { + particles[i] = register.registerIcon(iconPrefix + "particles/" + i); + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockTexturedOre.java b/src/main/java/com/cricketcraft/chisel/block/BlockTexturedOre.java index 390c9abb..8407a2f6 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockTexturedOre.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockTexturedOre.java @@ -7,58 +7,51 @@ import net.minecraft.util.IIcon; import com.cricketcraft.chisel.client.render.BlockTexturedOreRenderer; -public class BlockTexturedOre extends Block -{ - public int currentPass; - public Block base; - public IIcon icon; - String iconFile; +public class BlockTexturedOre extends Block { - public BlockTexturedOre(Material mat, Block base) - { - super(mat); + public int currentPass; + public Block base; + public IIcon icon; + String iconFile; - this.base = base; - } + public BlockTexturedOre(Material mat, Block base) { + super(mat); - public BlockTexturedOre(Material mat, String iconFile) - { - super(mat); + this.base = base; + } - this.iconFile = iconFile; - } + public BlockTexturedOre(Material mat, String iconFile) { + super(mat); - @Override - public boolean renderAsNormalBlock() - { - return false; - } + this.iconFile = iconFile; + } - @Override - public int getRenderType() - { - return BlockTexturedOreRenderer.id; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - public int getRenderBlockPass() - { - return 1; - } + @Override + public int getRenderType() { + return BlockTexturedOreRenderer.id; + } - @Override - public boolean canRenderInPass(int pass) - { - currentPass = pass; + @Override + public int getRenderBlockPass() { + return 1; + } - return pass == 1 || pass == 0; - } + @Override + public boolean canRenderInPass(int pass) { + currentPass = pass; - @Override - public void registerBlockIcons(IIconRegister register) - { - if(iconFile != null) - icon = register.registerIcon(iconFile); - } + return pass == 1 || pass == 0; + } + + @Override + public void registerBlockIcons(IIconRegister register) { + if (iconFile != null) + icon = register.registerIcon(iconFile); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockVoidstonePillar.java b/src/main/java/com/cricketcraft/chisel/block/BlockVoidstonePillar.java index 5934f1ed..4eaecf77 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockVoidstonePillar.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockVoidstonePillar.java @@ -9,38 +9,36 @@ import com.cricketcraft.chisel.Chisel; import com.cricketcraft.chisel.api.ICarvable; import com.cricketcraft.chisel.carving.CarvableHelper; import com.cricketcraft.chisel.carving.CarvableVariation; -import com.cricketcraft.chisel.init.ModTabs; -public class BlockVoidstonePillar extends Block implements ICarvable{ +public class BlockVoidstonePillar extends Block implements ICarvable { - public static IIcon topBottom, pillarSide; - public CarvableHelper carvableHelper; + public static IIcon topBottom, pillarSide; + public CarvableHelper carvableHelper; - public BlockVoidstonePillar() { - super(Material.rock); - carvableHelper = new CarvableHelper(); - setHardness(5.0F); - setResistance(10.0F); - } + public BlockVoidstonePillar() { + super(Material.rock); + carvableHelper = new CarvableHelper(); + setHardness(5.0F); + setResistance(10.0F); + } - @Override - public IIcon getIcon(int side, int meta){ - if(side == 0 || side == 1){ - return topBottom; - } else { - return pillarSide; - } - } + @Override + public IIcon getIcon(int side, int meta) { + if (side == 0 || side == 1) { + return topBottom; + } else { + return pillarSide; + } + } + @Override + public void registerBlockIcons(IIconRegister icon) { + topBottom = icon.registerIcon(Chisel.MOD_ID + ":voidstone/pillar-top"); + pillarSide = icon.registerIcon(Chisel.MOD_ID + ":voidstone/pillar-side"); + } - @Override - public void registerBlockIcons(IIconRegister icon){ - topBottom = icon.registerIcon(Chisel.MOD_ID + ":voidstone/pillar-top"); - pillarSide = icon.registerIcon(Chisel.MOD_ID + ":voidstone/pillar-side"); - } - - @Override - public CarvableVariation getVariation(int metadata) { - return carvableHelper.getVariation(metadata); - } + @Override + public CarvableVariation getVariation(int metadata) { + return carvableHelper.getVariation(metadata); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockVoidstonePillar2.java b/src/main/java/com/cricketcraft/chisel/block/BlockVoidstonePillar2.java index e7da3d72..9be52f21 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockVoidstonePillar2.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockVoidstonePillar2.java @@ -9,38 +9,36 @@ import com.cricketcraft.chisel.Chisel; import com.cricketcraft.chisel.api.ICarvable; import com.cricketcraft.chisel.carving.CarvableHelper; import com.cricketcraft.chisel.carving.CarvableVariation; -import com.cricketcraft.chisel.init.ModTabs; -public class BlockVoidstonePillar2 extends Block implements ICarvable{ +public class BlockVoidstonePillar2 extends Block implements ICarvable { - public static IIcon topBottom, pillarSide; - public CarvableHelper carvableHelper; + public static IIcon topBottom, pillarSide; + public CarvableHelper carvableHelper; - public BlockVoidstonePillar2() { - super(Material.rock); - carvableHelper = new CarvableHelper(); - setHardness(5.0F); - setResistance(10.0F); - } + public BlockVoidstonePillar2() { + super(Material.rock); + carvableHelper = new CarvableHelper(); + setHardness(5.0F); + setResistance(10.0F); + } - @Override - public IIcon getIcon(int side, int meta){ - if(side == 0 || side == 1){ - return topBottom; - } else { - return pillarSide; - } - } + @Override + public IIcon getIcon(int side, int meta) { + if (side == 0 || side == 1) { + return topBottom; + } else { + return pillarSide; + } + } + @Override + public void registerBlockIcons(IIconRegister icon) { + topBottom = icon.registerIcon(Chisel.MOD_ID + ":voidstone/animated/pillar-top"); + pillarSide = icon.registerIcon(Chisel.MOD_ID + ":voidstone/pillar-side"); + } - @Override - public void registerBlockIcons(IIconRegister icon){ - topBottom = icon.registerIcon(Chisel.MOD_ID + ":voidstone/animated/pillar-top"); - pillarSide = icon.registerIcon(Chisel.MOD_ID + ":voidstone/pillar-side"); - } - - @Override - public CarvableVariation getVariation(int metadata) { - return carvableHelper.getVariation(metadata); - } + @Override + public CarvableVariation getVariation(int metadata) { + return carvableHelper.getVariation(metadata); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockWaterstone.java b/src/main/java/com/cricketcraft/chisel/block/BlockWaterstone.java index aa4386bf..5d5d89c3 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockWaterstone.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockWaterstone.java @@ -3,13 +3,13 @@ package com.cricketcraft.chisel.block; import net.minecraft.block.material.Material; public class BlockWaterstone extends BlockMarbleTexturedOre { - 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/com/cricketcraft/chisel/block/tileentity/TileEntityAutoChisel.java b/src/main/java/com/cricketcraft/chisel/block/tileentity/TileEntityAutoChisel.java index 49dd8e8d..d180d9f0 100644 --- a/src/main/java/com/cricketcraft/chisel/block/tileentity/TileEntityAutoChisel.java +++ b/src/main/java/com/cricketcraft/chisel/block/tileentity/TileEntityAutoChisel.java @@ -1,8 +1,5 @@ package com.cricketcraft.chisel.block.tileentity; -import com.cricketcraft.chisel.init.ModItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; @@ -15,273 +12,278 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; +import com.cricketcraft.chisel.init.ModItems; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class TileEntityAutoChisel extends TileEntity implements ISidedInventory { - private final int BASE = 0, TARGET = 1, OUTPUT = 2, AUTOMATION = 3, STACK = 4, SPEED = 5; - private boolean isAutomated, isStackMode, isFaster; - private static EntityItem ghostItem; - boolean equal = false; - private ItemStack[] inventory = new ItemStack[6]; - private String name = "autoChisel"; + private final int BASE = 0, TARGET = 1, OUTPUT = 2, AUTOMATION = 3, STACK = 4, SPEED = 5; + private boolean isAutomated, isStackMode, isFaster; + private static EntityItem ghostItem; + boolean equal = false; + private ItemStack[] inventory = new ItemStack[6]; + private String name = "autoChisel"; - @Override - public boolean canUpdate() { - return true; - } + @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 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()]; + @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; + 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 (j >= 0 && j < inventory.length) { + inventory[j] = ItemStack.loadItemStackFromNBT(data); + } + } - if (nbt.hasKey("CustomName", 8)) { - this.name = nbt.getString("CustomName"); - } - } + if (nbt.hasKey("CustomName", 8)) { + this.name = nbt.getString("CustomName"); + } + } - @Override - public void updateEntity() { + @Override + public void updateEntity() { - if(inventory[SPEED] == new ItemStack(ModItems.upgrade, 1, 0)){ - isFaster = true; - } else { - isFaster = false; - } + if (inventory[SPEED] == new ItemStack(ModItems.upgrade, 1, 0)) { + isFaster = true; + } else { + isFaster = false; + } - if(inventory[AUTOMATION] == new ItemStack(ModItems.upgrade, 1, 1)){ - isAutomated = true; - } else { - isAutomated = false; - } + if (inventory[AUTOMATION] == new ItemStack(ModItems.upgrade, 1, 1)) { + isAutomated = true; + } else { + isAutomated = false; + } - if(inventory[STACK] == new ItemStack(ModItems.upgrade, 1, 2)){ - isStackMode = true; - } else { - isStackMode = false; - } + if (inventory[STACK] == new ItemStack(ModItems.upgrade, 1, 2)) { + isStackMode = true; + } else { + isStackMode = false; + } - if(isFaster){ - if(!worldObj.isRemote && worldObj.getWorldTime() % 10 == 0){ - if(inventory[BASE] != null && inventory[TARGET] != null){ - if(inventory[BASE].getItem() instanceof ItemBlock && inventory[TARGET].getItem() instanceof ItemBlock){ - if(inventory[BASE].getUnlocalizedName().equalsIgnoreCase(inventory[TARGET].getUnlocalizedName())){ - if(isStackMode){ - if(inventory[BASE].stackSize == inventory[BASE].getMaxStackSize()){ - if(inventory[OUTPUT] == null){ - inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 64, inventory[TARGET].getItemDamage()); - inventory[BASE] = null; - } - } - } else { - if(inventory[OUTPUT] == null){ - inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 1, inventory[TARGET].getItemDamage()); - inventory[BASE].stackSize--; - } else if(inventory[BASE].stackSize != 0){ - inventory[OUTPUT].stackSize++; - inventory[BASE].stackSize--; - } else { - inventory[BASE] = null; - } - } - } - } - } - } - } else { - if(!worldObj.isRemote && worldObj.getWorldTime() % 40 == 0){ - if(inventory[BASE] != null && inventory[TARGET] != null){ - if(inventory[BASE].getItem() instanceof ItemBlock && inventory[TARGET].getItem() instanceof ItemBlock){ - if(inventory[BASE].getUnlocalizedName().equalsIgnoreCase(inventory[TARGET].getUnlocalizedName())){ - if(isStackMode){ - if(inventory[BASE].stackSize == inventory[BASE].getMaxStackSize()){ - if(inventory[OUTPUT] == null){ - inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 64, inventory[TARGET].getItemDamage()); - inventory[BASE] = null; - } - } - } else { - if(inventory[OUTPUT] == null){ - inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 1, inventory[TARGET].getItemDamage()); - inventory[BASE].stackSize--; - } else if(inventory[BASE].stackSize != 0){ - inventory[OUTPUT].stackSize++; - inventory[BASE].stackSize--; - } else { - inventory[BASE] = null; - } - } - } - } - } - } - } + if (isFaster) { + if (!worldObj.isRemote && worldObj.getWorldTime() % 10 == 0) { + if (inventory[BASE] != null && inventory[TARGET] != null) { + if (inventory[BASE].getItem() instanceof ItemBlock && inventory[TARGET].getItem() instanceof ItemBlock) { + if (inventory[BASE].getUnlocalizedName().equalsIgnoreCase(inventory[TARGET].getUnlocalizedName())) { + if (isStackMode) { + if (inventory[BASE].stackSize == inventory[BASE].getMaxStackSize()) { + if (inventory[OUTPUT] == null) { + inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 64, inventory[TARGET].getItemDamage()); + inventory[BASE] = null; + } + } + } else { + if (inventory[OUTPUT] == null) { + inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 1, inventory[TARGET].getItemDamage()); + inventory[BASE].stackSize--; + } else if (inventory[BASE].stackSize != 0) { + inventory[OUTPUT].stackSize++; + inventory[BASE].stackSize--; + } else { + inventory[BASE] = null; + } + } + } + } + } + } + } else { + if (!worldObj.isRemote && worldObj.getWorldTime() % 40 == 0) { + if (inventory[BASE] != null && inventory[TARGET] != null) { + if (inventory[BASE].getItem() instanceof ItemBlock && inventory[TARGET].getItem() instanceof ItemBlock) { + if (inventory[BASE].getUnlocalizedName().equalsIgnoreCase(inventory[TARGET].getUnlocalizedName())) { + if (isStackMode) { + if (inventory[BASE].stackSize == inventory[BASE].getMaxStackSize()) { + if (inventory[OUTPUT] == null) { + inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 64, inventory[TARGET].getItemDamage()); + inventory[BASE] = null; + } + } + } else { + if (inventory[OUTPUT] == null) { + inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 1, inventory[TARGET].getItemDamage()); + inventory[BASE].stackSize--; + } else if (inventory[BASE].stackSize != 0) { + inventory[OUTPUT].stackSize++; + inventory[BASE].stackSize--; + } else { + inventory[BASE] = null; + } + } + } + } + } + } + } - markDirty(); - } + markDirty(); + } - @Override - public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); - NBTTagList tags = new NBTTagList(); + @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); - } - } + 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); + nbt.setTag("Items", tags); - if (this.hasCustomInventoryName()) { - nbt.setString("CustomName", this.name); - } - } + if (this.hasCustomInventoryName()) { + nbt.setString("CustomName", this.name); + } + } - @Override - public int getSizeInventory() { - return inventory.length; - } + @Override + public int getSizeInventory() { + return inventory.length; + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory[slot]; - } + @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 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; + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + inventory[slot] = stack; - if (stack != null && stack.stackSize > getInventoryStackLimit()) { - stack.stackSize = getInventoryStackLimit(); - } - markDirty(); - } + if (stack != null && stack.stackSize > getInventoryStackLimit()) { + stack.stackSize = getInventoryStackLimit(); + } + markDirty(); + } - @Override - public String getInventoryName() { - return name; - } + @Override + public String getInventoryName() { + return name; + } - @Override - public final boolean isUseableByPlayer(EntityPlayer player) { - return true; - } + @Override + public final boolean isUseableByPlayer(EntityPlayer player) { + return true; + } - @Override - public int getInventoryStackLimit() { - return 64; - } + @Override + public int getInventoryStackLimit() { + return 64; + } - @Override - public boolean hasCustomInventoryName() { - return false; - } + @Override + public boolean hasCustomInventoryName() { + return false; + } - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return new int[6]; - } + @Override + public int[] getAccessibleSlotsFromSide(int side) { + return new int[6]; + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemStack) { - return true; - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack itemStack) { + return true; + } - @Override - public boolean canInsertItem(int slot, ItemStack itemStack, int side) { - if(isAutomated){ - if(side != 0 || side != 1 && slot == BASE){ - return true; - } - } - return false; - } + @Override + public boolean canInsertItem(int slot, ItemStack itemStack, int side) { + if (isAutomated) { + if (side != 0 || side != 1 && slot == BASE) { + return true; + } + } + return false; + } - @Override - public boolean canExtractItem(int slot, ItemStack itemStack, int side) { - if(isAutomated){ - if(side == 0 || side == 1 && slot == OUTPUT){ - return true; - } - } - return false; - } + @Override + public boolean canExtractItem(int slot, ItemStack itemStack, int side) { + if (isAutomated) { + if (side == 0 || side == 1 && slot == OUTPUT) { + return true; + } + } + return false; + } - @Override - public void openInventory() { - } + @Override + public void openInventory() { + } - @Override - public void closeInventory() { - NBTTagList tags = new NBTTagList(); - System.out.print(tags); - } + @Override + public void closeInventory() { + NBTTagList tags = new NBTTagList(); + System.out.print(tags); + } - @SideOnly(Side.CLIENT) - public EntityItem getItemForRendering(int slot) { - if (ghostItem == null) { - ghostItem = new EntityItem(worldObj); - ghostItem.hoverStart = 0.0F; - } + @SideOnly(Side.CLIENT) + public EntityItem getItemForRendering(int slot) { + if (ghostItem == null) { + ghostItem = new EntityItem(worldObj); + ghostItem.hoverStart = 0.0F; + } - if (inventory[slot] == null) { - return null; - } else { - ghostItem.setEntityItemStack(new ItemStack(inventory[slot].getItem(), 1, inventory[slot].getItemDamage())); - return ghostItem; - } - } + if (inventory[slot] == null) { + return null; + } else { + ghostItem.setEntityItemStack(new ItemStack(inventory[slot].getItem(), 1, inventory[slot].getItemDamage())); + return ghostItem; + } + } - @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()); + } } diff --git a/src/main/java/com/cricketcraft/chisel/block/tileentity/TileEntityPresent.java b/src/main/java/com/cricketcraft/chisel/block/tileentity/TileEntityPresent.java index 5137688d..80c8d638 100644 --- a/src/main/java/com/cricketcraft/chisel/block/tileentity/TileEntityPresent.java +++ b/src/main/java/com/cricketcraft/chisel/block/tileentity/TileEntityPresent.java @@ -1,125 +1,110 @@ package com.cricketcraft.chisel.block.tileentity; -import com.cricketcraft.chisel.block.BlockPresent; -import com.cricketcraft.chisel.inventory.ContainerPresent; -import com.cricketcraft.chisel.inventory.InventoryLargePresent; -import net.minecraft.block.Block; +import java.util.Iterator; +import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.AxisAlignedBB; -import java.util.Iterator; -import java.util.List; +import com.cricketcraft.chisel.inventory.ContainerPresent; +import com.cricketcraft.chisel.inventory.InventoryLargePresent; public class TileEntityPresent extends TileEntityChest { - public int type; - private int ticksSinceSync; - public TileEntityPresent(int type) { - this.type = type; - } + public int type; + private int ticksSinceSync; - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; - } + public TileEntityPresent(int type) { + this.type = type; + } - @Override - public void updateEntity() { - super.updateEntity(); - this.checkForAdjacentChests(); - ++this.ticksSinceSync; - float f; + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; + } - if (!this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.xCoord + this.yCoord + this.zCoord) % 200 == 0) - { - this.numPlayersUsing = 0; - f = 5.0F; - List list = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox((double)((float)this.xCoord - f), (double)((float)this.yCoord - f), (double)((float)this.zCoord - f), (double)((float)(this.xCoord + 1) + f), (double)((float)(this.yCoord + 1) + f), (double)((float)(this.zCoord + 1) + f))); - Iterator iterator = list.iterator(); + @Override + public void updateEntity() { + super.updateEntity(); + this.checkForAdjacentChests(); + ++this.ticksSinceSync; + float f; - while (iterator.hasNext()) - { - EntityPlayer entityplayer = (EntityPlayer)iterator.next(); + if (!this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.xCoord + this.yCoord + this.zCoord) % 200 == 0) { + this.numPlayersUsing = 0; + f = 5.0F; + List list = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(this.xCoord - f, this.yCoord - f, + this.zCoord - f, this.xCoord + 1 + f, this.yCoord + 1 + f, this.zCoord + 1 + f)); + Iterator iterator = list.iterator(); - if (entityplayer.openContainer instanceof ContainerPresent) - { - IInventory iinventory = ((ContainerChest)entityplayer.openContainer).getLowerChestInventory(); + while (iterator.hasNext()) { + EntityPlayer entityplayer = (EntityPlayer) iterator.next(); - if (iinventory == this || iinventory instanceof InventoryLargePresent && ((InventoryLargePresent)iinventory).isPartOfLargePresent(this)) - { - ++this.numPlayersUsing; - } - } - } - } + if (entityplayer.openContainer instanceof ContainerPresent) { + IInventory iinventory = ((ContainerChest) entityplayer.openContainer).getLowerChestInventory(); - this.prevLidAngle = this.lidAngle; - f = 0.1F; - double d2; + if (iinventory == this || iinventory instanceof InventoryLargePresent && ((InventoryLargePresent) iinventory).isPartOfLargePresent(this)) { + ++this.numPlayersUsing; + } + } + } + } - if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) - { - double d1 = (double)this.xCoord + 0.5D; - d2 = (double)this.zCoord + 0.5D; + this.prevLidAngle = this.lidAngle; + f = 0.1F; + double d2; - if (this.adjacentChestZPos != null) - { - d2 += 0.5D; - } + if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) { + double d1 = this.xCoord + 0.5D; + d2 = this.zCoord + 0.5D; - if (this.adjacentChestXPos != null) - { - d1 += 0.5D; - } + if (this.adjacentChestZPos != null) { + d2 += 0.5D; + } - this.worldObj.playSoundEffect(d1, (double)this.yCoord + 0.5D, d2, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - } + if (this.adjacentChestXPos != null) { + d1 += 0.5D; + } - if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) - { - float f1 = this.lidAngle; + this.worldObj.playSoundEffect(d1, this.yCoord + 0.5D, d2, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } - if (this.numPlayersUsing > 0) - { - this.lidAngle += f; - } - else - { - this.lidAngle -= f; - } + if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) { + float f1 = this.lidAngle; - if (this.lidAngle > 1.0F) - { - this.lidAngle = 1.0F; - } + if (this.numPlayersUsing > 0) { + this.lidAngle += f; + } else { + this.lidAngle -= f; + } - float f2 = 0.5F; + if (this.lidAngle > 1.0F) { + this.lidAngle = 1.0F; + } - if (this.lidAngle < f2 && f1 >= f2 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) - { - d2 = (double)this.xCoord + 0.5D; - double d0 = (double)this.zCoord + 0.5D; + float f2 = 0.5F; - if (this.adjacentChestZPos != null) - { - d0 += 0.5D; - } + if (this.lidAngle < f2 && f1 >= f2 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) { + d2 = this.xCoord + 0.5D; + double d0 = this.zCoord + 0.5D; - if (this.adjacentChestXPos != null) - { - d2 += 0.5D; - } + if (this.adjacentChestZPos != null) { + d0 += 0.5D; + } - this.worldObj.playSoundEffect(d2, (double)this.yCoord + 0.5D, d0, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - } + if (this.adjacentChestXPos != null) { + d2 += 0.5D; + } - if (this.lidAngle < 0.0F) - { - this.lidAngle = 0.0F; - } - } - } + this.worldObj.playSoundEffect(d2, this.yCoord + 0.5D, d0, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.lidAngle < 0.0F) { + this.lidAngle = 0.0F; + } + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/carving/CarvableHelper.java b/src/main/java/com/cricketcraft/chisel/carving/CarvableHelper.java index 644a5ef4..ab1f80d1 100644 --- a/src/main/java/com/cricketcraft/chisel/carving/CarvableHelper.java +++ b/src/main/java/com/cricketcraft/chisel/carving/CarvableHelper.java @@ -1,14 +1,10 @@ package com.cricketcraft.chisel.carving; -import com.cricketcraft.chisel.Chisel; -import com.cricketcraft.chisel.Configurations; -import com.cricketcraft.chisel.block.BlockMarbleSlab; -import com.cricketcraft.chisel.carving.CarvableVariation.CarvableVariationCTM; -import com.cricketcraft.chisel.client.render.CTM; -import com.cricketcraft.chisel.client.render.TextureSubmap; -import com.cricketcraft.chisel.item.ItemCarvable; -import com.cricketcraft.chisel.utils.GeneralClient; -import cpw.mods.fml.common.registry.GameRegistry; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + import net.minecraft.block.Block; import net.minecraft.block.BlockPane; import net.minecraft.block.material.Material; @@ -18,422 +14,384 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import com.cricketcraft.chisel.Chisel; +import com.cricketcraft.chisel.Configurations; +import com.cricketcraft.chisel.block.BlockMarbleSlab; +import com.cricketcraft.chisel.carving.CarvableVariation.CarvableVariationCTM; +import com.cricketcraft.chisel.client.render.CTM; +import com.cricketcraft.chisel.client.render.TextureSubmap; +import com.cricketcraft.chisel.item.ItemCarvable; +import com.cricketcraft.chisel.utils.GeneralClient; -public class CarvableHelper -{ - public static final ArrayList chiselBlocks = new ArrayList(); +import cpw.mods.fml.common.registry.GameRegistry; - public static final int NORMAL = 0; - public static final int TOPSIDE = 1; - public static final int TOPBOTSIDE = 2; - public static final int CTM3 = 3; - public static final int CTMV = 4; - public static final int CTMH = 5; - public static final int V9 = 6; - public static final int V4 = 7; - public static final int CTMX = 8; +public class CarvableHelper { + public static final ArrayList chiselBlocks = new ArrayList(); - public CarvableHelper() - { - } + public static final int NORMAL = 0; + public static final int TOPSIDE = 1; + public static final int TOPBOTSIDE = 2; + public static final int CTM3 = 3; + public static final int CTMV = 4; + public static final int CTMH = 5; + public static final int V9 = 6; + public static final int V4 = 7; + public static final int CTMX = 8; - public ArrayList variations = new ArrayList(); - CarvableVariation[] map = new CarvableVariation[16]; - public boolean forbidChiseling = false; - public String blockName; + public CarvableHelper() { + } - public void addVariation(String description, int metadata, Block bb) - { - addVariation(description, metadata, null, bb, 0); - } + public ArrayList variations = new ArrayList(); + CarvableVariation[] map = new CarvableVariation[16]; + public boolean forbidChiseling = false; + public String blockName; - public void addVariation(String description, int metadata, Block bb, int blockMeta) - { - addVariation(description, metadata, null, bb, blockMeta); - } + public void addVariation(String description, int metadata, Block bb) { + addVariation(description, metadata, null, bb, 0); + } - public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material) - { - addVariation(description, metadata, null, bb, blockMeta); - } + public void addVariation(String description, int metadata, Block bb, int blockMeta) { + addVariation(description, metadata, null, bb, blockMeta); + } - public void addVariation(String description, int metadata, String texture) - { - addVariation(description, metadata, texture, null, 0); - } + public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material) { + addVariation(description, metadata, null, bb, blockMeta); + } - public void addVariation(String description, int metadata, String texture, Block block, int blockMeta) - { - if(variations.size() >= 16) - return; + public void addVariation(String description, int metadata, String texture) { + addVariation(description, metadata, texture, null, 0); + } - if(blockName == null && block != null) - blockName = block.getLocalizedName(); - else if(blockName == null && description != null) - blockName = description; + public void addVariation(String description, int metadata, String texture, Block block, int blockMeta) { + if (variations.size() >= 16) + return; - CarvableVariation variation = new CarvableVariation(); - variation.description = description; - variation.metadata = metadata; - variation.blockName = blockName; + if (blockName == null && block != null) + blockName = block.getLocalizedName(); + else if (blockName == null && description != null) + blockName = description; - if(texture != null) - { - variation.texture = texture; + CarvableVariation variation = new CarvableVariation(); + variation.description = description; + variation.metadata = metadata; + variation.blockName = blockName; - String path = "/assets/" + Chisel.MOD_ID + "/textures/blocks/" + variation.texture; + if (texture != null) { + variation.texture = texture; - boolean any = Chisel.class.getResource(path + ".png") != null; - boolean ctm3 = Chisel.class.getResource(path + "-ctm1.png") != null && Chisel.class.getResource(path + "-ctm2.png") != null && Chisel.class.getResource(path + "-ctm3.png") != null; - boolean ctmv = Chisel.class.getResource(path + "-ctmv.png") != null; - boolean ctmh = Chisel.class.getResource(path + "-ctmh.png") != null; - boolean side = Chisel.class.getResource(path + "-side.png") != null; - boolean top = Chisel.class.getResource(path + "-top.png") != null; - boolean bot = Chisel.class.getResource(path + "-bottom.png") != null; - boolean v9 = Chisel.class.getResource(path + "-v9.png") != null; - boolean v4 = Chisel.class.getResource(path + "-v4.png") != null; - boolean ctmx = Chisel.class.getResource(path + "-ctm.png") != null; + String path = "/assets/" + Chisel.MOD_ID + "/textures/blocks/" + variation.texture; - if(ctm3) - { - variation.kind = 3; - } else if(ctmh && top) - { - variation.kind = 5; - } else if(ctmv && top) - { - variation.kind = CTMV; - } else if(bot && top && side) - { - variation.kind = 2; - } else if(top && side) - { - variation.kind = 1; - } else if(v9) - { - variation.kind = V9; - } else if(v4) - { - variation.kind = V4; - } else if(any && ctmx && !Configurations.disableCTM) - { - variation.kind = CTMX; - } else if(any) - { - variation.kind = 0; - } else - { - throw new RuntimeException("No valid textures found for chisel block variation '" + description + "' (" + variation.texture + ")"); - } - } else - { - variation.block = block; - variation.kind = 2; - variation.blockMeta = blockMeta; - } + boolean any = Chisel.class.getResource(path + ".png") != null; + boolean ctm3 = Chisel.class.getResource(path + "-ctm1.png") != null && Chisel.class.getResource(path + "-ctm2.png") != null && Chisel.class.getResource(path + "-ctm3.png") != null; + boolean ctmv = Chisel.class.getResource(path + "-ctmv.png") != null; + boolean ctmh = Chisel.class.getResource(path + "-ctmh.png") != null; + boolean side = Chisel.class.getResource(path + "-side.png") != null; + boolean top = Chisel.class.getResource(path + "-top.png") != null; + boolean bot = Chisel.class.getResource(path + "-bottom.png") != null; + boolean v9 = Chisel.class.getResource(path + "-v9.png") != null; + boolean v4 = Chisel.class.getResource(path + "-v4.png") != null; + boolean ctmx = Chisel.class.getResource(path + "-ctm.png") != null; - variations.add(variation); - map[metadata] = variation; - } + if (ctm3) { + variation.kind = 3; + } else if (ctmh && top) { + variation.kind = 5; + } else if (ctmv && top) { + variation.kind = CTMV; + } else if (bot && top && side) { + variation.kind = 2; + } else if (top && side) { + variation.kind = 1; + } else if (v9) { + variation.kind = V9; + } else if (v4) { + variation.kind = V4; + } else if (any && ctmx && !Configurations.disableCTM) { + variation.kind = CTMX; + } else if (any) { + variation.kind = 0; + } else { + throw new RuntimeException("No valid textures found for chisel block variation '" + description + "' (" + variation.texture + ")"); + } + } else { + variation.block = block; + variation.kind = 2; + variation.blockMeta = blockMeta; + } - public CarvableVariation getVariation(int metadata) - { - if(metadata < 0 || metadata > 15) - metadata = 0; + variations.add(variation); + map[metadata] = variation; + } - CarvableVariation variation = map[metadata]; - if(variation == null) - return null; + public CarvableVariation getVariation(int metadata) { + if (metadata < 0 || metadata > 15) + metadata = 0; - return variation; - } + CarvableVariation variation = map[metadata]; + if (variation == null) + return null; - public IIcon getIcon(int side, int metadata) - { - if(metadata < 0 || metadata > 15) - metadata = 0; + return variation; + } - CarvableVariation variation = map[metadata]; - if(variation == null) - return GeneralClient.getMissingIcon(); + public IIcon getIcon(int side, int metadata) { + if (metadata < 0 || metadata > 15) + metadata = 0; - switch(variation.kind) - { - case 0: - return variation.icon; - case 1: - if(side == 0 || side == 1) - return variation.iconTop; - else - return variation.icon; - case 2: - if(side == 1) - return variation.iconTop; - else if(side == 0) - return variation.iconBot; - else - return variation.icon; - case 3: - return variation.ctm.seams[0].icons[0]; - case 4: - if(side < 2) - return variation.iconTop; - else - return variation.seamsCtmVert.icons[0]; - case 5: - if(side < 2) - return variation.iconTop; - else - return variation.seamsCtmVert.icons[0]; - case V9: - return variation.variations9.icons[4]; - case V4: - return variation.variations9.icons[0]; - case CTMX: - return variation.icon; - } + CarvableVariation variation = map[metadata]; + if (variation == null) + return GeneralClient.getMissingIcon(); - return GeneralClient.getMissingIcon(); - } + switch (variation.kind) { + case 0: + return variation.icon; + case 1: + if (side == 0 || side == 1) + return variation.iconTop; + else + return variation.icon; + case 2: + if (side == 1) + return variation.iconTop; + else if (side == 0) + return variation.iconBot; + else + return variation.icon; + case 3: + return variation.ctm.seams[0].icons[0]; + case 4: + if (side < 2) + return variation.iconTop; + else + return variation.seamsCtmVert.icons[0]; + case 5: + if (side < 2) + return variation.iconTop; + else + return variation.seamsCtmVert.icons[0]; + case V9: + return variation.variations9.icons[4]; + case V4: + return variation.variations9.icons[0]; + case CTMX: + return variation.icon; + } - public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) - { - int metadata = world.getBlockMetadata(x, y, z); + return GeneralClient.getMissingIcon(); + } - if(metadata < 0 || metadata > 15) - metadata = 0; + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + int metadata = world.getBlockMetadata(x, y, z); - CarvableVariation variation = map[metadata]; - if(variation == null) - return GeneralClient.getMissingIcon(); + if (metadata < 0 || metadata > 15) + metadata = 0; - switch(variation.kind) - { - case 0: - case 1: - case 2: - return getIcon(side, metadata); - case 3: - int tex = CTM.getTexture(world, x, y, z, side); + CarvableVariation variation = map[metadata]; + if (variation == null) + return GeneralClient.getMissingIcon(); - int row = tex / 16; - int col = tex % 16; + switch (variation.kind) { + case 0: + case 1: + case 2: + return getIcon(side, metadata); + case 3: + int tex = CTM.getTexture(world, x, y, z, side); - return variation.ctm.seams[col / 4].icons[col % 4 + row * 4]; - case 4: - { - if(side < 2) - return variation.iconTop; + int row = tex / 16; + int col = tex % 16; - Block block = world.getBlock(x, y, z); - boolean topConnected = block.equals(CTM.getBlockOrFacade(world, x, y + 1, z, side)) && metadata == CTM.getBlockOrFacadeMetadata(world, x, y + 1, z, side); - boolean botConnected = block.equals(CTM.getBlockOrFacade(world, x, y - 1, z, side)) && metadata == CTM.getBlockOrFacadeMetadata(world, x, y - 1, z, side); + return variation.ctm.seams[col / 4].icons[col % 4 + row * 4]; + case 4: { + if (side < 2) + return variation.iconTop; - if(topConnected && botConnected) return variation.seamsCtmVert.icons[2]; - if(topConnected && !botConnected) return variation.seamsCtmVert.icons[3]; - if(!topConnected && botConnected) return variation.seamsCtmVert.icons[1]; - return variation.seamsCtmVert.icons[0]; - } - case 5: - if(side < 2) - return variation.iconTop; + Block block = world.getBlock(x, y, z); + boolean topConnected = block.equals(CTM.getBlockOrFacade(world, x, y + 1, z, side)) && metadata == CTM.getBlockOrFacadeMetadata(world, x, y + 1, z, side); + boolean botConnected = block.equals(CTM.getBlockOrFacade(world, x, y - 1, z, side)) && metadata == CTM.getBlockOrFacadeMetadata(world, x, y - 1, z, side); - Block block = CTM.getBlockOrFacade(world, x, y, z, side); + if (topConnected && botConnected) + return variation.seamsCtmVert.icons[2]; + if (topConnected && !botConnected) + return variation.seamsCtmVert.icons[3]; + if (!topConnected && botConnected) + return variation.seamsCtmVert.icons[1]; + return variation.seamsCtmVert.icons[0]; + } + case 5: + if (side < 2) + return variation.iconTop; - boolean p; - boolean n; - boolean reverse = side == 2 || side == 4; + Block block = CTM.getBlockOrFacade(world, x, y, z, side); - if(side < 4) - { - p = isSame(world, x - 1, y, z, block, metadata, side); - n = isSame(world, x + 1, y, z, block, metadata, side); - } else - { - p = isSame(world, x, y, z + 1, block, metadata, side); - n = isSame(world, x, y, z - 1, block, metadata, side); - } + boolean p; + boolean n; + boolean reverse = side == 2 || side == 4; - if(p && n) return variation.seamsCtmVert.icons[1]; - else if(p) return variation.seamsCtmVert.icons[reverse ? 2 : 3]; - else if(n) return variation.seamsCtmVert.icons[reverse ? 3 : 2]; - return variation.seamsCtmVert.icons[0]; - case V9: - case V4: - int index = x + y * 606731 + z * 571163 + side * 555491; - if(index < 0) index = -index; + if (side < 4) { + p = isSame(world, x - 1, y, z, block, metadata, side); + n = isSame(world, x + 1, y, z, block, metadata, side); + } else { + p = isSame(world, x, y, z + 1, block, metadata, side); + n = isSame(world, x, y, z - 1, block, metadata, side); + } - return variation.variations9.icons[index % ((variation.kind == V9) ? 9 : 4)]; - case CTMX: - return variation.icon; - } + if (p && n) + return variation.seamsCtmVert.icons[1]; + else if (p) + return variation.seamsCtmVert.icons[reverse ? 2 : 3]; + else if (n) + return variation.seamsCtmVert.icons[reverse ? 3 : 2]; + return variation.seamsCtmVert.icons[0]; + case V9: + case V4: + int index = x + y * 606731 + z * 571163 + side * 555491; + if (index < 0) + index = -index; - return GeneralClient.getMissingIcon(); - } + return variation.variations9.icons[index % ((variation.kind == V9) ? 9 : 4)]; + case CTMX: + return variation.icon; + } - public void register(Block block, String name) - { - register(block, name, ItemCarvable.class); - } + return GeneralClient.getMissingIcon(); + } - public void registerBlock(Block block, String name) - { - registerBlock(block, name, ItemCarvable.class); - } + public void register(Block block, String name) { + register(block, name, ItemCarvable.class); + } - void registerBlock(Block block, String name, Class cl) - { - block.setBlockName(name); - GameRegistry.registerBlock(block, cl, name); - chiselBlocks.add(block); - } + public void registerBlock(Block block, String name) { + registerBlock(block, name, ItemCarvable.class); + } - public void register(Block block, String name, Class cl) - { - registerBlock(block, name, cl); + void registerBlock(Block block, String name, Class cl) { + block.setBlockName(name); + GameRegistry.registerBlock(block, cl, name); + chiselBlocks.add(block); + } - if(block instanceof BlockMarbleSlab) - { - BlockMarbleSlab slab = (BlockMarbleSlab) block; - } + public void register(Block block, String name, Class cl) { + registerBlock(block, name, cl); - for(CarvableVariation variation : variations) - { - registerVariation(name, variation, block, variation.metadata); + if (block instanceof BlockMarbleSlab) { + BlockMarbleSlab slab = (BlockMarbleSlab) block; + } - if(block instanceof BlockMarbleSlab && ((BlockMarbleSlab) block).isBottom) - { - BlockMarbleSlab slab = (BlockMarbleSlab) block; + for (CarvableVariation variation : variations) { + registerVariation(name, variation, block, variation.metadata); - if(!forbidChiseling) - { - Carving.chisel.addVariation(name + ".top", slab.top, variation.metadata, 0); - Carving.chisel.setGroupClass(name + ".top", name); - } - } - } - } + if (block instanceof BlockMarbleSlab && ((BlockMarbleSlab) block).isBottom) { + BlockMarbleSlab slab = (BlockMarbleSlab) block; - public void registerVariation(String name, CarvableVariation variation, Block block, int blockMeta) - { - if(forbidChiseling) - return; + if (!forbidChiseling) { + Carving.chisel.addVariation(name + ".top", slab.top, variation.metadata, 0); + Carving.chisel.setGroupClass(name + ".top", name); + } + } + } + } - if(variation.block == null) - { - Carving.chisel.addVariation(name, block, blockMeta, variation.metadata); - } else - { - Carving.chisel.addVariation(name, variation.block, variation.blockMeta, variation.metadata); - } - } + public void registerVariation(String name, CarvableVariation variation, Block block, int blockMeta) { + if (forbidChiseling) + return; - public void registerBlockIcons(String modName, Block block, IIconRegister register) - { - for(CarvableVariation variation : variations) - { - if(variation.block != null) - { - variation.block.registerBlockIcons(register); + if (variation.block == null) { + Carving.chisel.addVariation(name, block, blockMeta, variation.metadata); + } else { + Carving.chisel.addVariation(name, variation.block, variation.blockMeta, variation.metadata); + } + } - if(variation.block instanceof BlockPane) - { - variation.icon = variation.block.getBlockTextureFromSide(2); - variation.iconTop = ((BlockPane) variation.block).getBlockTextureFromSide(0); - variation.iconBot = ((BlockPane) variation.block).getBlockTextureFromSide(0); + public void registerBlockIcons(String modName, Block block, IIconRegister register) { + for (CarvableVariation variation : variations) { + if (variation.block != null) { + variation.block.registerBlockIcons(register); - } else - { - switch(variation.kind) - { - case 0: - variation.icon = variation.block.getIcon(2, variation.blockMeta); - break; - case 1: - variation.icon = variation.block.getIcon(2, variation.blockMeta); - variation.iconTop = variation.block.getIcon(0, variation.blockMeta); - break; - case 2: - variation.icon = variation.block.getIcon(2, variation.blockMeta); - variation.iconTop = variation.block.getIcon(1, variation.blockMeta); - variation.iconBot = variation.block.getIcon(0, variation.blockMeta); - break; - } - } - } else - { - switch(variation.kind) - { - case 0: - variation.icon = register.registerIcon(modName + ":" + variation.texture); - break; - case 1: - variation.icon = register.registerIcon(modName + ":" + variation.texture + "-side"); - variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top"); - break; - case 2: - variation.icon = register.registerIcon(modName + ":" + variation.texture + "-side"); - variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top"); - variation.iconBot = register.registerIcon(modName + ":" + variation.texture + "-bottom"); - break; - case 3: - CarvableVariationCTM ctm = new CarvableVariationCTM(); - ctm.seams[0] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm1"), 4, 4); - ctm.seams[1] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm2"), 4, 4); - ctm.seams[2] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm3"), 4, 4); - variation.ctm = ctm; - break; - case 4: - variation.seamsCtmVert = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctmv"), 2, 2); - variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top"); - break; - case 5: - variation.seamsCtmVert = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctmh"), 2, 2); - variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top"); - break; - case V9: - variation.variations9 = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-v9"), 3, 3); - break; - case V4: - variation.variations9 = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-v4"), 2, 2); - break; - case CTMX: - variation.icon = register.registerIcon(modName + ":" + variation.texture); - variation.submap = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm"), 4, 4); - variation.submapSmall = new TextureSubmap(variation.icon, 2, 2); - break; - } - } - } - } + if (variation.block instanceof BlockPane) { + variation.icon = variation.block.getBlockTextureFromSide(2); + variation.iconTop = ((BlockPane) variation.block).getBlockTextureFromSide(0); + variation.iconBot = ((BlockPane) variation.block).getBlockTextureFromSide(0); - public void registerSubBlocks(Block block, CreativeTabs tabs, List list) - { - for(CarvableVariation variation : variations) - { - list.add(new ItemStack(block, 1, variation.metadata)); - } - } + } else { + switch (variation.kind) { + case 0: + variation.icon = variation.block.getIcon(2, variation.blockMeta); + break; + case 1: + variation.icon = variation.block.getIcon(2, variation.blockMeta); + variation.iconTop = variation.block.getIcon(0, variation.blockMeta); + break; + case 2: + variation.icon = variation.block.getIcon(2, variation.blockMeta); + variation.iconTop = variation.block.getIcon(1, variation.blockMeta); + variation.iconBot = variation.block.getIcon(0, variation.blockMeta); + break; + } + } + } else { + switch (variation.kind) { + case 0: + variation.icon = register.registerIcon(modName + ":" + variation.texture); + break; + case 1: + variation.icon = register.registerIcon(modName + ":" + variation.texture + "-side"); + variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top"); + break; + case 2: + variation.icon = register.registerIcon(modName + ":" + variation.texture + "-side"); + variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top"); + variation.iconBot = register.registerIcon(modName + ":" + variation.texture + "-bottom"); + break; + case 3: + CarvableVariationCTM ctm = new CarvableVariationCTM(); + ctm.seams[0] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm1"), 4, 4); + ctm.seams[1] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm2"), 4, 4); + ctm.seams[2] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm3"), 4, 4); + variation.ctm = ctm; + break; + case 4: + variation.seamsCtmVert = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctmv"), 2, 2); + variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top"); + break; + case 5: + variation.seamsCtmVert = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctmh"), 2, 2); + variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top"); + break; + case V9: + variation.variations9 = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-v9"), 3, 3); + break; + case V4: + variation.variations9 = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-v4"), 2, 2); + break; + case CTMX: + variation.icon = register.registerIcon(modName + ":" + variation.texture); + variation.submap = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm"), 4, 4); + variation.submapSmall = new TextureSubmap(variation.icon, 2, 2); + break; + } + } + } + } - private boolean isSame(IBlockAccess world, int x, int y, int z, Block block, int meta, int side) - { - return CTM.getBlockOrFacade(world, x, y, z, side).equals(block) && CTM.getBlockOrFacadeMetadata(world, x, y, z, side) == meta; - } + public void registerSubBlocks(Block block, CreativeTabs tabs, List list) { + for (CarvableVariation variation : variations) { + list.add(new ItemStack(block, 1, variation.metadata)); + } + } - public void setChiselBlockName(String name) - { - blockName = name; - } + private boolean isSame(IBlockAccess world, int x, int y, int z, Block block, int meta, int side) { + return CTM.getBlockOrFacade(world, x, y, z, side).equals(block) && CTM.getBlockOrFacadeMetadata(world, x, y, z, side) == meta; + } - public static Set getChiselBlockSet() - { - HashSet tools = new HashSet(); - tools.addAll(CarvableHelper.chiselBlocks); - return tools; - } + public void setChiselBlockName(String name) { + blockName = name; + } + + public static Set getChiselBlockSet() { + HashSet tools = new HashSet(); + tools.addAll(CarvableHelper.chiselBlocks); + return tools; + } } diff --git a/src/main/java/com/cricketcraft/chisel/carving/CarvableVariation.java b/src/main/java/com/cricketcraft/chisel/carving/CarvableVariation.java index cb1918df..dc1c47f7 100644 --- a/src/main/java/com/cricketcraft/chisel/carving/CarvableVariation.java +++ b/src/main/java/com/cricketcraft/chisel/carving/CarvableVariation.java @@ -5,31 +5,31 @@ import net.minecraft.util.IIcon; import com.cricketcraft.chisel.client.render.TextureSubmap; -public class CarvableVariation -{ - public String blockName; - public String description; - public int metadata; - public int kind; +public class CarvableVariation { - public Block block; - public int blockMeta; + public String blockName; + public String description; + public int metadata; + public int kind; - public String texture; + public Block block; + public int blockMeta; - public IIcon icon; - public IIcon iconTop; - public IIcon iconBot; + public String texture; - public CarvableVariationCTM ctm; - public TextureSubmap seamsCtmVert; - public TextureSubmap variations9; + public IIcon icon; + public IIcon iconTop; + public IIcon iconBot; - public TextureSubmap submap; - public TextureSubmap submapSmall; + public CarvableVariationCTM ctm; + public TextureSubmap seamsCtmVert; + public TextureSubmap variations9; - static class CarvableVariationCTM - { - TextureSubmap seams[] = new TextureSubmap[3]; - } + public TextureSubmap submap; + public TextureSubmap submapSmall; + + static class CarvableVariationCTM { + + TextureSubmap seams[] = new TextureSubmap[3]; + } } diff --git a/src/main/java/com/cricketcraft/chisel/carving/Carving.java b/src/main/java/com/cricketcraft/chisel/carving/Carving.java index 396066d5..3fb0e5dd 100644 --- a/src/main/java/com/cricketcraft/chisel/carving/Carving.java +++ b/src/main/java/com/cricketcraft/chisel/carving/Carving.java @@ -12,187 +12,171 @@ import net.minecraftforge.oredict.OreDictionary; import com.cricketcraft.chisel.Chisel; -public class Carving -{ - HashMap carvingGroupsByName = new HashMap(); - HashMap carvingGroupsByOre = new HashMap(); - HashMap carvingGroupsByVariation = new HashMap(); +public class Carving { - public static Carving chisel = new Carving(); - public static Carving needle = new Carving(); + HashMap carvingGroupsByName = new HashMap(); + HashMap carvingGroupsByOre = new HashMap(); + HashMap carvingGroupsByVariation = new HashMap(); - String key(Item item, int metadata) - { - return Item.itemRegistry.getNameForObject(item) + "|" + metadata; - } + public static Carving chisel = new Carving(); + public static Carving needle = new Carving(); - String key(Block block, int metadata) - { - return Block.blockRegistry.getNameForObject(block) + "|" + metadata; - } + String key(Item item, int metadata) { + return Item.itemRegistry.getNameForObject(item) + "|" + metadata; + } - public boolean isVariationOfSameClass(Block target, int metadata1, Block block2, int metadata2) - { - CarvingGroup group1 = carvingGroupsByVariation.get(key(target, metadata1)); - if(group1 == null) return false; + String key(Block block, int metadata) { + return Block.blockRegistry.getNameForObject(block) + "|" + metadata; + } - CarvingGroup group2 = carvingGroupsByVariation.get(key(block2, metadata2)); - if(group2 == null) return false; + public boolean isVariationOfSameClass(Block target, int metadata1, Block block2, int metadata2) { + CarvingGroup group1 = carvingGroupsByVariation.get(key(target, metadata1)); + if (group1 == null) + return false; - return group1 == group2 || group1.className.equals(group2.className) && !group1.className.isEmpty(); + CarvingGroup group2 = carvingGroupsByVariation.get(key(block2, metadata2)); + if (group2 == null) + return false; - } + return group1 == group2 || group1.className.equals(group2.className) && !group1.className.isEmpty(); - public CarvingVariation[] getVariations(Block block, int metadata) - { - CarvingGroup group = getGroup(block, metadata); - if(group == null) return null; + } - CarvingVariation[] res = group.variations.toArray(new CarvingVariation[group.variations.size()]); - return res; - } + public CarvingVariation[] getVariations(Block block, int metadata) { + CarvingGroup group = getGroup(block, metadata); + if (group == null) + return null; - public String getOre(Block block, int metadata) - { - CarvingGroup group = getGroup(block, metadata); - if(group == null) - return null; + CarvingVariation[] res = group.variations.toArray(new CarvingVariation[group.variations.size()]); + return res; + } - return group.oreName; - } + public String getOre(Block block, int metadata) { + CarvingGroup group = getGroup(block, metadata); + if (group == null) + return null; - public ArrayList getItems(ItemStack chiseledItem) - { - ArrayList items = new ArrayList(); + return group.oreName; + } - int damage = chiseledItem.getItemDamage(); + public ArrayList getItems(ItemStack chiseledItem) { + ArrayList items = new ArrayList(); - CarvingGroup group = getGroup(Block.getBlockFromItem(chiseledItem.getItem()), damage); - if(group == null) - return items; + int damage = chiseledItem.getItemDamage(); - HashMap mapping = new HashMap(); + CarvingGroup group = getGroup(Block.getBlockFromItem(chiseledItem.getItem()), damage); + if (group == null) + return items; - if(group.variations != null) - { - for(CarvingVariation v : group.variations) - { + HashMap mapping = new HashMap(); - String key = Block.getIdFromBlock(v.block) + "|" + v.damage; - if(mapping.containsKey(key)) continue; - mapping.put(key, 1); + if (group.variations != null) { + for (CarvingVariation v : group.variations) { - items.add(new ItemStack(v.block, 1, v.damage)); - } - } + String key = Block.getIdFromBlock(v.block) + "|" + v.damage; + if (mapping.containsKey(key)) + continue; + mapping.put(key, 1); - ArrayList ores; - if(group.oreName != null && ((ores = OreDictionary.getOres(group.oreName)) != null)) - { - for(ItemStack stack : ores) - { + items.add(new ItemStack(v.block, 1, v.damage)); + } + } - String key = Item.getIdFromItem(stack.getItem()) + "|" + stack.getItemDamage(); - if(mapping.containsKey(key)) continue; - mapping.put(key, 2); + ArrayList ores; + if (group.oreName != null && ((ores = OreDictionary.getOres(group.oreName)) != null)) { + for (ItemStack stack : ores) { - items.add(stack); - } - } + String key = Item.getIdFromItem(stack.getItem()) + "|" + stack.getItemDamage(); + if (mapping.containsKey(key)) + continue; + mapping.put(key, 2); - return items; - } + items.add(stack); + } + } - public CarvingGroup getGroup(Block block, int metadata) - { - if(block.equals(Blocks.stone)) - block = Blocks.stonebrick; + return items; + } - // Check name first - CarvingGroup res; - int i = OreDictionary.getOreID(block.getUnlocalizedName()); - if(i < 1) - return null; - - //get All dictionary names for that block via Ids - //the first one matching with a group is chosen - int[] oreDictIds = OreDictionary.getOreIDs(new ItemStack(block, 1, metadata)); - for (int oreId : oreDictIds) { - String oreDictName = OreDictionary.getOreName(oreId); - if(carvingGroupsByOre.containsKey(oreDictName)) - return carvingGroupsByOre.get(oreDictName); - } - - if((res = carvingGroupsByVariation.get(key(block, metadata))) != null) - return res; + public CarvingGroup getGroup(Block block, int metadata) { + if (block.equals(Blocks.stone)) + block = Blocks.stonebrick; - return null; - } + // Check name first + CarvingGroup res; + int i = OreDictionary.getOreID(block.getUnlocalizedName()); + if (i < 1) + return null; - CarvingGroup getGroup(String name) - { - CarvingGroup group = carvingGroupsByName.get(name); - if(group == null) - { - group = new CarvingGroup(name); - group.className = name; - carvingGroupsByName.put(name, group); - } + // get All dictionary names for that block via Ids + // the first one matching with a group is chosen + int[] oreDictIds = OreDictionary.getOreIDs(new ItemStack(block, 1, metadata)); + for (int oreId : oreDictIds) { + String oreDictName = OreDictionary.getOreName(oreId); + if (carvingGroupsByOre.containsKey(oreDictName)) + return carvingGroupsByOre.get(oreDictName); + } - return group; - } + if ((res = carvingGroupsByVariation.get(key(block, metadata))) != null) + return res; - public CarvingVariation addVariation(String name, Block block, int metadata, int order) - { - CarvingGroup group = getGroup(name); + return null; + } - CarvingGroup blockGroup = carvingGroupsByVariation.get(key(block, metadata)); - if(blockGroup != null || blockGroup == group) - return null; + CarvingGroup getGroup(String name) { + CarvingGroup group = carvingGroupsByName.get(name); + if (group == null) { + group = new CarvingGroup(name); + group.className = name; + carvingGroupsByName.put(name, group); + } - CarvingVariation variation = new CarvingVariation(block, metadata, order); - group.variations.add(variation); - Collections.sort(group.variations); - carvingGroupsByVariation.put(key(block, metadata), group); + return group; + } - return variation; - } + public CarvingVariation addVariation(String name, Block block, int metadata, int order) { + CarvingGroup group = getGroup(name); + CarvingGroup blockGroup = carvingGroupsByVariation.get(key(block, metadata)); + if (blockGroup != null || blockGroup == group) + return null; - public void registerOre(String name, String oreName) - { - CarvingGroup group = getGroup(name); + CarvingVariation variation = new CarvingVariation(block, metadata, order); + group.variations.add(variation); + Collections.sort(group.variations); + carvingGroupsByVariation.put(key(block, metadata), group); - carvingGroupsByOre.put(oreName, group); + return variation; + } - group.oreName = oreName; - } + public void registerOre(String name, String oreName) { + CarvingGroup group = getGroup(name); - public void setGroupClass(String name, String className) - { - CarvingGroup group = getGroup(name); + carvingGroupsByOre.put(oreName, group); - group.className = className; - } + group.oreName = oreName; + } - public void setVariationSound(String name, String sound) - { - CarvingGroup group = getGroup(name); - group.sound = sound; - } + public void setGroupClass(String name, String className) { + CarvingGroup group = getGroup(name); - public String getVariationSound(Block block, int metadata) - { - return getVariationSound(Item.getItemFromBlock(block), metadata); - } + group.className = className; + } - public String getVariationSound(Item item, int metadata) - { - CarvingGroup blockGroup = carvingGroupsByVariation.get(key(item, metadata)); - if(blockGroup == null || blockGroup.sound == null) - return Chisel.MOD_ID+":chisel.fallback"; + public void setVariationSound(String name, String sound) { + CarvingGroup group = getGroup(name); + group.sound = sound; + } - return blockGroup.sound; - } + public String getVariationSound(Block block, int metadata) { + return getVariationSound(Item.getItemFromBlock(block), metadata); + } + + public String getVariationSound(Item item, int metadata) { + CarvingGroup blockGroup = carvingGroupsByVariation.get(key(item, metadata)); + if (blockGroup == null || blockGroup.sound == null) + return Chisel.MOD_ID + ":chisel.fallback"; + + return blockGroup.sound; + } } - diff --git a/src/main/java/com/cricketcraft/chisel/carving/CarvingGroup.java b/src/main/java/com/cricketcraft/chisel/carving/CarvingGroup.java index a5700b74..d90ea6bd 100644 --- a/src/main/java/com/cricketcraft/chisel/carving/CarvingGroup.java +++ b/src/main/java/com/cricketcraft/chisel/carving/CarvingGroup.java @@ -2,17 +2,16 @@ package com.cricketcraft.chisel.carving; import java.util.ArrayList; -public class CarvingGroup -{ - public CarvingGroup(String n) - { - name = n; - } +public class CarvingGroup { - String name; - String className; - String sound; - String oreName; + public CarvingGroup(String n) { + name = n; + } - ArrayList variations = new ArrayList(); + String name; + String className; + String sound; + String oreName; + + ArrayList variations = new ArrayList(); } \ No newline at end of file diff --git a/src/main/java/com/cricketcraft/chisel/carving/CarvingVariation.java b/src/main/java/com/cricketcraft/chisel/carving/CarvingVariation.java index 5526bf4d..e5bac0a9 100644 --- a/src/main/java/com/cricketcraft/chisel/carving/CarvingVariation.java +++ b/src/main/java/com/cricketcraft/chisel/carving/CarvingVariation.java @@ -2,24 +2,22 @@ package com.cricketcraft.chisel.carving; import net.minecraft.block.Block; -public class CarvingVariation implements Comparable -{ - public CarvingVariation(Block block, int metadata, int ord) - { - this.order = ord; - this.block = block; - this.meta = metadata; - this.damage = metadata; - } +public class CarvingVariation implements Comparable { - @Override - public int compareTo(Object a) - { - return order - ((CarvingVariation) a).order; - } + public CarvingVariation(Block block, int metadata, int ord) { + this.order = ord; + this.block = block; + this.meta = metadata; + this.damage = metadata; + } - public int order; - public Block block; - public int meta; - public int damage; + @Override + public int compareTo(Object a) { + return order - ((CarvingVariation) a).order; + } + + public int order; + public Block block; + public int meta; + public int damage; } diff --git a/src/main/java/com/cricketcraft/chisel/client/GeneralChiselClient.java b/src/main/java/com/cricketcraft/chisel/client/GeneralChiselClient.java index 78505c33..d3ea9503 100644 --- a/src/main/java/com/cricketcraft/chisel/client/GeneralChiselClient.java +++ b/src/main/java/com/cricketcraft/chisel/client/GeneralChiselClient.java @@ -22,226 +22,235 @@ import com.cricketcraft.chisel.entity.fx.EntityHolystoneFX; import com.cricketcraft.chisel.entity.fx.EntitySnakestoneObsidianFX; import com.cricketcraft.chisel.utils.GeneralClient; - public class GeneralChiselClient { - 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) return; + public static Random rand = new Random(); + public static int tick = 0; - 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(); + public static void spawnLavastoneFX(World world, BlockLavastone block, int x, int y, int z) { + if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0) + return; - 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; - } + 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(); - if (world.getBlock(x, y, z).isOpaqueCube()) return; + 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; + } - 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); + if (world.getBlock(x, y, z).isOpaqueCube()) + return; - Minecraft.getMinecraft().effectRenderer.addEffect(res); - } + 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); - public static void spawnHolystoneFX(World world, BlockHolystone block, int x, int y, int z) { - if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0) return; + Minecraft.getMinecraft().effectRenderer.addEffect(res); + } - 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(); + public static void spawnHolystoneFX(World world, BlockHolystone block, int x, int y, int z) { + if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0) + return; - 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; - } + 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(); - if (world.getBlock(x, y, z).isOpaqueCube()) return; + 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; + } - EntityHolystoneFX res = new EntityHolystoneFX(world, block, x1, y1, z1); - Minecraft.getMinecraft().effectRenderer.addEffect(res); - } + if (world.getBlock(x, y, z).isOpaqueCube()) + return; - public static void spawnGrimstoneFX(World world, BlockGrimstone block, int x, int y, int z) { - if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0) return; + EntityHolystoneFX res = new EntityHolystoneFX(world, block, x1, y1, z1); + Minecraft.getMinecraft().effectRenderer.addEffect(res); + } - 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(); + public static void spawnGrimstoneFX(World world, BlockGrimstone block, int x, int y, int z) { + if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0) + return; - 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; - } + 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(); - if (world.getBlock(x, y, z).isOpaqueCube()) return; + 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; + } - EntityGrimstoneFX res = new EntityGrimstoneFX(world, block, x1, y1, z1); - Minecraft.getMinecraft().effectRenderer.addEffect(res); - } + if (world.getBlock(x, y, z).isOpaqueCube()) + return; - public static void spawnSnakestoneObsidianFX(World world, BlockSnakestoneObsidian block, int x, int y, int z) { - if (Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0) { - EntitySnakestoneObsidianFX res = new EntitySnakestoneObsidianFX(world, block, x, y, z); - Minecraft.getMinecraft().effectRenderer.addEffect(res); - } - } + EntityGrimstoneFX res = new EntityGrimstoneFX(world, block, x1, y1, z1); + 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) { - EntityBallOMossFX res = new EntityBallOMossFX(world, 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) { + 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) { + 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)) - 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)) + 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 speedupPlayer(World world, Entity entity, double concreteVelocity) { - double velocity = Math.sqrt(entity.motionX * entity.motionX + entity.motionZ * entity.motionZ); + public static void speedupPlayer(World world, Entity entity, double concreteVelocity) { + double velocity = Math.sqrt(entity.motionX * entity.motionX + entity.motionZ * entity.motionZ); - if (!(entity instanceof EntityPlayerSP)) return; - if (velocity == 0) return; - if (velocity >= Configurations.concreteVelocity) return; + if (!(entity instanceof EntityPlayerSP)) + return; + if (velocity == 0) + return; + if (velocity >= Configurations.concreteVelocity) + return; - EntityPlayerSP player = (EntityPlayerSP) entity; + EntityPlayerSP player = (EntityPlayerSP) entity; - if (Math.abs(player.movementInput.moveForward) < 0.75f && Math.abs(player.movementInput.moveStrafe) < 0.75f) - return; + if (Math.abs(player.movementInput.moveForward) < 0.75f && Math.abs(player.movementInput.moveStrafe) < 0.75f) + return; - entity.motionX = Configurations.concreteVelocity * entity.motionX / velocity; - entity.motionZ = Configurations.concreteVelocity * entity.motionZ / velocity; - } + entity.motionX = Configurations.concreteVelocity * entity.motionX / velocity; + entity.motionZ = Configurations.concreteVelocity * entity.motionZ / velocity; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/GuiAutoChisel.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuiAutoChisel.java index b2eb6bbb..8097892d 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuiAutoChisel.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuiAutoChisel.java @@ -11,18 +11,18 @@ import com.cricketcraft.chisel.inventory.ContainerAutoChisel; 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"); - public GuiAutoChisel(InventoryPlayer inventoryPlayer, TileEntityAutoChisel tileEntityAutoChisel){ - super(new ContainerAutoChisel(inventoryPlayer, tileEntityAutoChisel)); - } + public GuiAutoChisel(InventoryPlayer inventoryPlayer, TileEntityAutoChisel tileEntityAutoChisel) { + super(new ContainerAutoChisel(inventoryPlayer, tileEntityAutoChisel)); + } - @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); - } + @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); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/GuiChisel.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuiChisel.java index 8006c9ce..6c5059f8 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuiChisel.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuiChisel.java @@ -11,57 +11,48 @@ import com.cricketcraft.chisel.inventory.ContainerChisel; import com.cricketcraft.chisel.inventory.InventoryChiselSelection; import com.cricketcraft.chisel.utils.GeneralClient; -public class GuiChisel extends GuiContainer -{ - public EntityPlayer player; - public ContainerChisel container; +public class GuiChisel extends GuiContainer { - public GuiChisel(InventoryPlayer iinventory, InventoryChiselSelection menu) - { - super(new ContainerChisel(iinventory, menu)); - player = iinventory.player; - height = 177; + public EntityPlayer player; + public ContainerChisel container; - container = (ContainerChisel) inventorySlots; - } + public GuiChisel(InventoryPlayer iinventory, InventoryChiselSelection menu) { + super(new ContainerChisel(iinventory, menu)); + player = iinventory.player; + height = 177; - @Override - public void onGuiClosed() - { - super.onGuiClosed(); - inventorySlots.onContainerClosed(player); - } + container = (ContainerChisel) inventorySlots; + } - boolean isExtended() - { - return container.inventory.activeVariations > 16; - } + @Override + public void onGuiClosed() { + super.onGuiClosed(); + inventorySlots.onContainerClosed(player); + } - @Override - protected void drawGuiContainerForegroundLayer(int j, int i) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + boolean isExtended() { + return container.inventory.activeVariations > 16; + } - String line = isExtended() ? - I18n.format(this.container.inventory.getInventoryName() + ".titleShort") : - I18n.format(this.container.inventory.getInventoryName() + ".title"); - fontRendererObj.drawString(line, 88 - fontRendererObj.getStringWidth(line) / 2, 13, 0x404040); - } + @Override + protected void drawGuiContainerForegroundLayer(int j, int i) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - @Override - protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) - { - drawDefaultBackground(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + String line = isExtended() ? I18n.format(this.container.inventory.getInventoryName() + ".titleShort") : I18n.format(this.container.inventory.getInventoryName() + ".title"); + fontRendererObj.drawString(line, 88 - fontRendererObj.getStringWidth(line) / 2, 13, 0x404040); + } - int i = width - xSize >> 1; - int j = height - ySize >> 1; + @Override + protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) { + drawDefaultBackground(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - String texture = isExtended() ? - "chisel:textures/chisel-gui-24.png" : - "chisel:textures/chisel-gui.png"; + int i = width - xSize >> 1; + int j = height - ySize >> 1; - GeneralClient.bind(texture); - drawTexturedModalRect(i, j, 0, 0, xSize, ySize); - } + String texture = isExtended() ? "chisel:textures/chisel-gui-24.png" : "chisel:textures/chisel-gui.png"; + + GeneralClient.bind(texture); + drawTexturedModalRect(i, j, 0, 0, xSize, ySize); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/GuiChiselConfig.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuiChiselConfig.java index f4cb4bf7..a0fefb62 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuiChiselConfig.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuiChiselConfig.java @@ -9,11 +9,10 @@ import com.cricketcraft.chisel.Configurations; import cpw.mods.fml.client.config.GuiConfig; -public class GuiChiselConfig extends 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/com/cricketcraft/chisel/client/gui/GuiEdit.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuiEdit.java index fd6d4331..b1a591fc 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuiEdit.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuiEdit.java @@ -2,70 +2,57 @@ package com.cricketcraft.chisel.client.gui; import net.minecraft.client.gui.GuiTextField; -public class GuiEdit extends GuiElement -{ - GuiTextField field; - String tempString = ""; +public class GuiEdit extends GuiElement { - public GuiEdit(int x, int y, int w, int h) - { - super(x, y, w, h); - } + GuiTextField field; + String tempString = ""; - @Override - public void onAdded() - { - field = new GuiTextField(gui.fontRendererObj(), x, y, w, h); - setText(tempString); - } + public GuiEdit(int x, int y, int w, int h) { + super(x, y, w, h); + } - public String getText() - { - if(field == null) - { - return tempString; - } else - { - return field.getText(); - } - } + @Override + public void onAdded() { + field = new GuiTextField(gui.fontRendererObj(), x, y, w, h); + setText(tempString); + } - public void setText(String text) - { - if(field == null) - { - tempString = text; - } else - { - field.setText(text); - } - } + public String getText() { + if (field == null) { + return tempString; + } else { + return field.getText(); + } + } - @Override - public void render() - { - field.drawTextBox(); - } + public void setText(String text) { + if (field == null) { + tempString = text; + } else { + field.setText(text); + } + } - @Override - public void mouseDown(InputMouseEvent ev) - { - field.mouseClicked(ev.x, ev.y, ev.button); + @Override + public void render() { + field.drawTextBox(); + } - if(isMouseOver(ev)) - { - ev.handled = true; - } - } + @Override + public void mouseDown(InputMouseEvent ev) { + field.mouseClicked(ev.x, ev.y, ev.button); - @Override - public void keyPressed(InputKeyboardEvent ev) - { - field.textboxKeyTyped(ev.character, ev.key); + if (isMouseOver(ev)) { + ev.handled = true; + } + } - if(field.isFocused()) - { - ev.handled = true; - } - } + @Override + public void keyPressed(InputKeyboardEvent ev) { + field.textboxKeyTyped(ev.character, ev.key); + + if (field.isFocused()) { + ev.handled = true; + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/GuiElement.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuiElement.java index d6add99a..3ed74a27 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuiElement.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuiElement.java @@ -4,184 +4,150 @@ import java.util.ArrayList; import org.lwjgl.opengl.GL11; -public class GuiElement -{ - public int x; - public int y; - public int w; - public int h; +public class GuiElement { - public GuiScreenPlus gui; - public GuiElement parent, addedParent; - private ArrayList children = null; + public int x; + public int y; + public int w; + public int h; - public GuiElement(int x, int y, int w, int h) - { - this.x = x; - this.y = y; - this.w = w; - this.h = h; - } + public GuiScreenPlus gui; + public GuiElement parent, addedParent; + private ArrayList children = null; - public GuiElement addChild(GuiElement e) - { - if(children == null) - { - children = new ArrayList(); - } + public GuiElement(int x, int y, int w, int h) { + this.x = x; + this.y = y; + this.w = w; + this.h = h; + } - if(e.parent != null) - { - e.parent.removeChild(e); - } + public GuiElement addChild(GuiElement e) { + if (children == null) { + children = new ArrayList(); + } - children.add(e); - e.x += x; - e.y += y; - e.parent = this; - e.gui = gui; - return e; - } + if (e.parent != null) { + e.parent.removeChild(e); + } - public GuiElement removeChild(GuiElement e) - { - if(children == null) - { - return e; - } + children.add(e); + e.x += x; + e.y += y; + e.parent = this; + e.gui = gui; + return e; + } - children.remove(e); - e.x -= x; - e.y -= y; - e.parent = null; - e.gui = null; - return e; - } + public GuiElement removeChild(GuiElement e) { + if (children == null) { + return e; + } - public void onAdded() - { - if(children == null) - { - return; - } + children.remove(e); + e.x -= x; + e.y -= y; + e.parent = null; + e.gui = null; + return e; + } - for(GuiElement e : children) - { - if(e.parent != e.addedParent) - { - e.onAdded(); - } + public void onAdded() { + if (children == null) { + return; + } - e.addedParent = e.parent; - } - } + for (GuiElement e : children) { + if (e.parent != e.addedParent) { + e.onAdded(); + } - boolean isMouseOver(InputMouseEvent ev) - { - return ev.x >= x && ev.x < x + w && ev.y >= y && ev.y < y + h; - } + e.addedParent = e.parent; + } + } - public void mouseDown(InputMouseEvent ev) - { - if(children == null) - { - return; - } + boolean isMouseOver(InputMouseEvent ev) { + return ev.x >= x && ev.x < x + w && ev.y >= y && ev.y < y + h; + } - for(GuiElement e : children) - { - e.mouseDown(ev); + public void mouseDown(InputMouseEvent ev) { + if (children == null) { + return; + } - if(ev.handled) - { - return; - } - } - } + for (GuiElement e : children) { + e.mouseDown(ev); - public void mouseUp(InputMouseEvent ev) - { - if(children == null) - { - return; - } + if (ev.handled) { + return; + } + } + } - for(GuiElement e : children) - { - e.mouseUp(ev); + public void mouseUp(InputMouseEvent ev) { + if (children == null) { + return; + } - if(ev.handled) - { - return; - } - } - } + for (GuiElement e : children) { + e.mouseUp(ev); - public void mouseMove(InputMouseEvent ev) - { - if(children == null) - { - return; - } + if (ev.handled) { + return; + } + } + } - for(GuiElement e : children) - { - e.mouseMove(ev); + public void mouseMove(InputMouseEvent ev) { + if (children == null) { + return; + } - if(ev.handled) - { - return; - } - } - } + for (GuiElement e : children) { + e.mouseMove(ev); - public void mouseWheel(InputMouseEvent ev) - { - if(children == null) - { - return; - } + if (ev.handled) { + return; + } + } + } - for(GuiElement e : children) - { - e.mouseWheel(ev); + public void mouseWheel(InputMouseEvent ev) { + if (children == null) { + return; + } - if(ev.handled) - { - return; - } - } - } + for (GuiElement e : children) { + e.mouseWheel(ev); - public void render() - { - if(children == null) - { - return; - } + if (ev.handled) { + return; + } + } + } - for(GuiElement e : children) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - e.render(); - } - } + public void render() { + if (children == null) { + return; + } - public void keyPressed(InputKeyboardEvent ev) - { - if(children == null) - { - return; - } + for (GuiElement e : children) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + e.render(); + } + } - for(GuiElement e : children) - { - e.keyPressed(ev); + public void keyPressed(InputKeyboardEvent ev) { + if (children == null) { + return; + } - if(ev.handled) - { - return; - } - } - } + for (GuiElement e : children) { + e.keyPressed(ev); + + if (ev.handled) { + return; + } + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/GuiExButton.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuiExButton.java index c40722eb..80d0f3fd 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuiExButton.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuiExButton.java @@ -1,83 +1,74 @@ package com.cricketcraft.chisel.client.gui; -public class GuiExButton extends GuiElement -{ - protected String caption; +public class GuiExButton extends GuiElement { - int u, v, texw, texh; - int borderTop, borderRight, borderBottom, borderLeft; + protected String caption; - boolean over; - public boolean disabled; + int u, v, texw, texh; + int borderTop, borderRight, borderBottom, borderLeft; - public TexturedBox boxDisabled; - public TexturedBox boxNormal; - public TexturedBox boxOver; + boolean over; + public boolean disabled; - public GuiExButton(int x, int y, int w, int h, String caption) - { - this(x, y, w, h, caption, "textures/gui/widgets.png"); - } + public TexturedBox boxDisabled; + public TexturedBox boxNormal; + public TexturedBox boxOver; - public GuiExButton(int x, int y, int w, int h, String caption, String texture) - { - super(x, y, w, h); - this.caption = caption; - disabled = false; - u = 0; - v = 46; - texw = 200; - texh = 20; - borderTop = 2; - borderRight = 2; - borderBottom = 3; - borderLeft = 2; + public GuiExButton(int x, int y, int w, int h, String caption) { + this(x, y, w, h, caption, "textures/gui/widgets.png"); + } - boxDisabled = new TexturedBox(texture, 0, 46, 200, 20, 2, 2, 3, 2); - boxNormal = new TexturedBox(texture, 0, 66, 200, 20, 2, 2, 3, 2); - boxOver = new TexturedBox(texture, 0, 86, 200, 20, 2, 2, 3, 2); + public GuiExButton(int x, int y, int w, int h, String caption, String texture) { + super(x, y, w, h); + this.caption = caption; + disabled = false; + u = 0; + v = 46; + texw = 200; + texh = 20; + borderTop = 2; + borderRight = 2; + borderBottom = 3; + borderLeft = 2; - } + boxDisabled = new TexturedBox(texture, 0, 46, 200, 20, 2, 2, 3, 2); + boxNormal = new TexturedBox(texture, 0, 66, 200, 20, 2, 2, 3, 2); + boxOver = new TexturedBox(texture, 0, 86, 200, 20, 2, 2, 3, 2); - public void onClick() - { - } + } - @Override - public void render() - { - int color = 0xffe0e0e0; - TexturedBox box = boxDisabled; + public void onClick() { + } - if(!disabled && !over) - { - box = boxNormal; - color = 0xffffffff; - } else if(!disabled && over) - { - box = boxOver; - color = 0xffffff70; - } + @Override + public void render() { + int color = 0xffe0e0e0; + TexturedBox box = boxDisabled; - box.render(gui, x, y, w, h); - gui.drawCenteredStringWithShadow(caption, x + w / 2, y + h / 2, color); - } + if (!disabled && !over) { + box = boxNormal; + color = 0xffffffff; + } else if (!disabled && over) { + box = boxOver; + color = 0xffffff70; + } - @Override - public void mouseMove(InputMouseEvent ev) - { - over = isMouseOver(ev); - } + box.render(gui, x, y, w, h); + gui.drawCenteredStringWithShadow(caption, x + w / 2, y + h / 2, color); + } - @Override - public void mouseDown(InputMouseEvent ev) - { - if(!isMouseOver(ev)) - { - return; - } + @Override + public void mouseMove(InputMouseEvent ev) { + over = isMouseOver(ev); + } - gui.playSound("random.click", 1.0f, 1.0f); - onClick(); - } + @Override + public void mouseDown(InputMouseEvent ev) { + if (!isMouseOver(ev)) { + return; + } + + gui.playSound("random.click", 1.0f, 1.0f); + onClick(); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/GuiFactory.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuiFactory.java index 8ed330f9..0aa67d8c 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuiFactory.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuiFactory.java @@ -6,29 +6,25 @@ 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) - { +public class GuiFactory implements IModGuiFactory { - } + @Override + public void initialize(Minecraft minecraftInstance) { - @Override - public Class mainConfigGuiClass() - { - return GuiChiselConfig.class; - } + } - @Override - public Set runtimeGuiCategories() - { - return null; - } + @Override + public Class mainConfigGuiClass() { + return GuiChiselConfig.class; + } - @Override - public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) - { - return null; - } + @Override + public Set runtimeGuiCategories() { + return null; + } + + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { + return null; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/GuiLabel.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuiLabel.java index 922ec5fb..28d16055 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuiLabel.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuiLabel.java @@ -1,23 +1,20 @@ package com.cricketcraft.chisel.client.gui; -public class GuiLabel extends GuiElement -{ - String caption; +public class GuiLabel extends GuiElement { - public GuiLabel(int x, int y, int w, int h, String caption) - { - super(x, y, w, h); - this.caption = caption; - } + String caption; - public GuiLabel(int x, int y, String string) - { - this(x, y, 0, 0, string); - } + public GuiLabel(int x, int y, int w, int h, String caption) { + super(x, y, w, h); + this.caption = caption; + } - @Override - public void render() - { - gui.drawString(caption, x, y, 0x404040); - } + public GuiLabel(int x, int y, String string) { + this(x, y, 0, 0, string); + } + + @Override + public void render() { + gui.drawString(caption, x, y, 0x404040); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/GuiPresent.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuiPresent.java index 6d461699..10f93d52 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuiPresent.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuiPresent.java @@ -11,23 +11,24 @@ import com.cricketcraft.chisel.block.tileentity.TileEntityPresent; import com.cricketcraft.chisel.inventory.ContainerPresent; public class GuiPresent extends GuiContainer { - private static final ResourceLocation gui = new ResourceLocation("chisel:textures/present-gui.png"); - private IInventory upper, lower; - private int rows; - public GuiPresent(InventoryPlayer inventoryPlayer, TileEntityPresent tileEntityPresent) { - super(new ContainerPresent(inventoryPlayer, tileEntityPresent)); - rows = tileEntityPresent.getSizeInventory() / 9; - this.ySize = 114 + rows * 18; - } + private static final ResourceLocation gui = new ResourceLocation("chisel:textures/present-gui.png"); + private IInventory upper, lower; + private int rows; - @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); - } + 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); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/GuiScreenPlus.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuiScreenPlus.java index ff6e8825..46252727 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuiScreenPlus.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuiScreenPlus.java @@ -13,262 +13,223 @@ import org.lwjgl.opengl.GL11; import com.cricketcraft.chisel.utils.DummyContainer; import com.cricketcraft.chisel.utils.GeneralClient; -public class GuiScreenPlus extends GuiContainer -{ - public int screenW; - public int screenH; - public int screenX; - public int screenY; +public class GuiScreenPlus extends GuiContainer { - public GuiElement root; + public int screenW; + public int screenH; + public int screenX; + public int screenY; - String backgroundTexture; + public GuiElement root; - public GuiScreenPlus(Container container, int w, int h, String backgroundTexture) - { - super(container); - root = new GuiElement(0, 0, w, h); - root.gui = this; - this.screenW = w; - this.screenH = h; - this.backgroundTexture = backgroundTexture; - } + String backgroundTexture; - public GuiScreenPlus(int w, int h, String backgroundTexture) - { - this(new DummyContainer(), w, h, backgroundTexture); - } + public GuiScreenPlus(Container container, int w, int h, String backgroundTexture) { + super(container); + root = new GuiElement(0, 0, w, h); + root.gui = this; + this.screenW = w; + this.screenH = h; + this.backgroundTexture = backgroundTexture; + } - @Override - public void initGui() - { - xSize = screenW; - ySize = screenH; - super.initGui(); - screenX = guiLeft; - screenY = guiTop; - root.onAdded(); + public GuiScreenPlus(int w, int h, String backgroundTexture) { + this(new DummyContainer(), w, h, backgroundTexture); + } - Keyboard.enableRepeatEvents(true); - } + @Override + public void initGui() { + xSize = screenW; + ySize = screenH; + super.initGui(); + screenX = guiLeft; + screenY = guiTop; + root.onAdded(); + Keyboard.enableRepeatEvents(true); + } - @Override - public void handleInput() - { - while(Mouse.next()) - { - this.handleMouseInput(); - } + @Override + public void handleInput() { + while (Mouse.next()) { + this.handleMouseInput(); + } - while(Keyboard.next()) - { - this.handleKeyboardInput(); - } - } + while (Keyboard.next()) { + this.handleKeyboardInput(); + } + } - InputMouseEvent mouseEvent = new InputMouseEvent(); - int oldX = -1; - int oldY = -1; + InputMouseEvent mouseEvent = new InputMouseEvent(); + int oldX = -1; + int oldY = -1; - boolean[] downButtons = new boolean[12]; + boolean[] downButtons = new boolean[12]; - @Override - public void handleMouseInput() - { - mouseEvent.handled = false; - mouseEvent.x = Mouse.getEventX() * width / mc.displayWidth - this.screenX; - mouseEvent.y = height - Mouse.getEventY() * height / mc.displayHeight - 1 - this.screenY; + @Override + public void handleMouseInput() { + mouseEvent.handled = false; + mouseEvent.x = Mouse.getEventX() * width / mc.displayWidth - this.screenX; + mouseEvent.y = height - Mouse.getEventY() * height / mc.displayHeight - 1 - this.screenY; - if(oldX == -1) - { - oldX = mouseEvent.x; - oldY = mouseEvent.y; - } + if (oldX == -1) { + oldX = mouseEvent.x; + oldY = mouseEvent.y; + } - mouseEvent.dx = mouseEvent.x - oldX; - mouseEvent.dy = mouseEvent.y - oldY; - oldX = mouseEvent.x; - oldY = mouseEvent.y; - mouseEvent.down = Mouse.getEventButtonState(); - mouseEvent.button = Mouse.getEventButton(); - mouseEvent.wheel = Mouse.getEventDWheel(); + mouseEvent.dx = mouseEvent.x - oldX; + mouseEvent.dy = mouseEvent.y - oldY; + oldX = mouseEvent.x; + oldY = mouseEvent.y; + mouseEvent.down = Mouse.getEventButtonState(); + mouseEvent.button = Mouse.getEventButton(); + mouseEvent.wheel = Mouse.getEventDWheel(); - if(mouseEvent.wheel != 0) - { - if(mouseEvent.wheel < 0) - { - mouseEvent.wheel = -1; - } else - { - mouseEvent.wheel = 1; - } + if (mouseEvent.wheel != 0) { + if (mouseEvent.wheel < 0) { + mouseEvent.wheel = -1; + } else { + mouseEvent.wheel = 1; + } - root.mouseWheel(mouseEvent); - } else if(mouseEvent.button >= 0 && mouseEvent.button < downButtons.length) - { - if(downButtons[mouseEvent.button] != mouseEvent.down) - { - downButtons[mouseEvent.button] = mouseEvent.down; + root.mouseWheel(mouseEvent); + } else if (mouseEvent.button >= 0 && mouseEvent.button < downButtons.length) { + if (downButtons[mouseEvent.button] != mouseEvent.down) { + downButtons[mouseEvent.button] = mouseEvent.down; - if(mouseEvent.down) - { - root.mouseDown(mouseEvent); - } else - { - root.mouseUp(mouseEvent); - } - } else if(mouseEvent.dx != 0 || mouseEvent.dy != 0) - { - root.mouseMove(mouseEvent); - } - } else if(mouseEvent.dx != 0 || mouseEvent.dy != 0) - { - root.mouseMove(mouseEvent); - } + if (mouseEvent.down) { + root.mouseDown(mouseEvent); + } else { + root.mouseUp(mouseEvent); + } + } else if (mouseEvent.dx != 0 || mouseEvent.dy != 0) { + root.mouseMove(mouseEvent); + } + } else if (mouseEvent.dx != 0 || mouseEvent.dy != 0) { + root.mouseMove(mouseEvent); + } - if(!mouseEvent.handled) - { - super.handleMouseInput(); - } - } + if (!mouseEvent.handled) { + super.handleMouseInput(); + } + } - InputKeyboardEvent keyboardEvent = new InputKeyboardEvent(); + InputKeyboardEvent keyboardEvent = new InputKeyboardEvent(); - @Override - public void handleKeyboardInput() - { - keyboardEvent.handled = false; + @Override + public void handleKeyboardInput() { + keyboardEvent.handled = false; - if(Keyboard.getEventKeyState()) - { - keyboardEvent.key = Keyboard.getEventKey(); - keyboardEvent.character = Keyboard.getEventCharacter(); + if (Keyboard.getEventKeyState()) { + keyboardEvent.key = Keyboard.getEventKey(); + keyboardEvent.character = Keyboard.getEventCharacter(); - switch(keyboardEvent.key) - { - case 1: - break; + switch (keyboardEvent.key) { + case 1: + break; - default: - root.keyPressed(keyboardEvent); - } - } + default: + root.keyPressed(keyboardEvent); + } + } - if(!keyboardEvent.handled) - { - super.handleKeyboardInput(); - } - } + if (!keyboardEvent.handled) { + super.handleKeyboardInput(); + } + } - public void close() - { - mc.displayGuiScreen((GuiScreen) null); - mc.setIngameFocus(); - } + public void close() { + mc.displayGuiScreen((GuiScreen) null); + mc.setIngameFocus(); + } - protected void addChild(GuiElement e) - { - root.addChild(e); - } + protected void addChild(GuiElement e) { + root.addChild(e); + } - @Override - protected void drawGuiContainerBackgroundLayer(float f, int bx, int by) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GeneralClient.bind(backgroundTexture); - drawTexturedModalRect(screenX, screenY, 0, 0, screenW, screenH); - } + @Override + protected void drawGuiContainerBackgroundLayer(float f, int bx, int by) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GeneralClient.bind(backgroundTexture); + drawTexturedModalRect(screenX, screenY, 0, 0, screenW, screenH); + } - @Override - protected void drawGuiContainerForegroundLayer(int fx, int fy) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - root.render(); - } + @Override + protected void drawGuiContainerForegroundLayer(int fx, int fy) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + root.render(); + } - public void drawString(String text, int sx, int sy, int color) - { - fontRendererObj.drawString(text, sx, sy, color); - } + public void drawString(String text, int sx, int sy, int color) { + fontRendererObj.drawString(text, sx, sy, color); + } - public void drawCenteredString(String text, int sx, int sy, int color) - { - fontRendererObj.drawString(text, sx - fontRendererObj.getStringWidth(text) / 2, sy - fontRendererObj.FONT_HEIGHT / 2, color); - } + public void drawCenteredString(String text, int sx, int sy, int color) { + fontRendererObj.drawString(text, sx - fontRendererObj.getStringWidth(text) / 2, sy - fontRendererObj.FONT_HEIGHT / 2, color); + } - public void drawStringWithShadow(String text, int sx, int sy, int color) - { - fontRendererObj.drawStringWithShadow(text, sx, sy, color); - } + public void drawStringWithShadow(String text, int sx, int sy, int color) { + fontRendererObj.drawStringWithShadow(text, sx, sy, color); + } - public void drawCenteredStringWithShadow(String text, int sx, int sy, int color) - { - fontRendererObj.drawStringWithShadow(text, sx - fontRendererObj.getStringWidth(text) / 2, sy - fontRendererObj.FONT_HEIGHT / 2, color); - } + public void drawCenteredStringWithShadow(String text, int sx, int sy, int color) { + fontRendererObj.drawStringWithShadow(text, sx - fontRendererObj.getStringWidth(text) / 2, sy - fontRendererObj.FONT_HEIGHT / 2, color); + } - public FontRenderer fontRendererObj() - { - return this.fontRendererObj; - } + public FontRenderer fontRendererObj() { + return this.fontRendererObj; + } - protected void drawRect(int gx, int gy, int gw, int gh, int c1, int c2) - { - drawGradientRect(gx, gy, gx + gw, gy + gh, c1, c2); - } + protected void drawRect(int gx, int gy, int gw, int gh, int c1, int c2) { + drawGradientRect(gx, gy, gx + gw, gy + gh, c1, c2); + } - public void drawTiledRect(int rx, int ry, int rw, int rh, int u, int v, int tw, int th) - { - if(rw == 0 || rh == 0 || tw == 0 || th == 0) return; + public void drawTiledRect(int rx, int ry, int rw, int rh, int u, int v, int tw, int th) { + if (rw == 0 || rh == 0 || tw == 0 || th == 0) + return; - float pixel = 0.00390625f; - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); + float pixel = 0.00390625f; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); - for(int y = 0; y < rh; y += th) - { - for(int x = 0; x < rw; x += tw) - { - int qw = tw; + for (int y = 0; y < rh; y += th) { + for (int x = 0; x < rw; x += tw) { + int qw = tw; - if(x + qw > rw) - { - qw = rw - x; - } + if (x + qw > rw) { + qw = rw - x; + } - int qh = th; + int qh = th; - if(y + qh > rh) - { - qh = rh - y; - } + if (y + qh > rh) { + qh = rh - y; + } - double x1 = rx + x; - double x2 = rx + x + qw; - double y1 = ry + y; - double y2 = ry + y + qh; - double u1 = pixel * (u); - double u2 = pixel * (u + tw); - double v1 = pixel * (v); - double v2 = pixel * (v + th); - tessellator.addVertexWithUV(x1, y2, this.zLevel, u1, v2); - tessellator.addVertexWithUV(x2, y2, this.zLevel, u2, v2); - tessellator.addVertexWithUV(x2, y1, this.zLevel, u2, v1); - tessellator.addVertexWithUV(x1, y1, this.zLevel, u1, v1); - } - } + double x1 = rx + x; + double x2 = rx + x + qw; + double y1 = ry + y; + double y2 = ry + y + qh; + double u1 = pixel * (u); + double u2 = pixel * (u + tw); + double v1 = pixel * (v); + double v2 = pixel * (v + th); + tessellator.addVertexWithUV(x1, y2, this.zLevel, u1, v2); + tessellator.addVertexWithUV(x2, y2, this.zLevel, u2, v2); + tessellator.addVertexWithUV(x2, y1, this.zLevel, u2, v1); + tessellator.addVertexWithUV(x1, y1, this.zLevel, u1, v1); + } + } - tessellator.draw(); - } + tessellator.draw(); + } - public void bindTexture(String tex) - { - GeneralClient.bind(tex); - } + public void bindTexture(String tex) { + GeneralClient.bind(tex); + } - public void playSound(String sound, float volume, float pitch) - { - // TODO - //mc.getSoundHandler().playSoundFX(null, 1.0F, 1.0F); - } + public void playSound(String sound, float volume, float pitch) { + // TODO + // mc.getSoundHandler().playSoundFX(null, 1.0F, 1.0F); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/GuilScrolledBox.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuilScrolledBox.java index 9dee919b..def27bf3 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuilScrolledBox.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuilScrolledBox.java @@ -6,119 +6,107 @@ import net.minecraft.client.renderer.Tessellator; import org.lwjgl.opengl.GL11; -public class GuilScrolledBox extends GuiElement -{ - public int offset = 0; - int contentHeight = 0; - int scrollingStart = -1; +public class GuilScrolledBox extends GuiElement { - public GuilScrolledBox(int x, int y, int w, int h) - { - super(x, y, w, h); - } + public int offset = 0; + int contentHeight = 0; + int scrollingStart = -1; - int x0, x1; + public GuilScrolledBox(int x, int y, int w, int h) { + super(x, y, w, h); + } - protected void overlayBackground(int start, int end, int color, int a1, int a2) - { - Tessellator tessellator = Tessellator.instance; + int x0, x1; - float f = 32.0F; + protected void overlayBackground(int start, int end, int color, int a1, int a2) { + Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.setColorRGBA_I(color, a2); - tessellator.addVertexWithUV(x0, end, 0.0D, 0.0D, end / f); - tessellator.addVertexWithUV(x1, end, 0.0D, gui.width / f, end / f); - tessellator.setColorRGBA_I(color, a1); - tessellator.addVertexWithUV(x1, start, 0.0D, gui.width / f, start / f); - tessellator.addVertexWithUV(x0, start, 0.0D, 0.0D, start / f); - tessellator.draw(); - } + float f = 32.0F; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(color, a2); + tessellator.addVertexWithUV(x0, end, 0.0D, 0.0D, end / f); + tessellator.addVertexWithUV(x1, end, 0.0D, gui.width / f, end / f); + tessellator.setColorRGBA_I(color, a1); + tessellator.addVertexWithUV(x1, start, 0.0D, gui.width / f, start / f); + tessellator.addVertexWithUV(x0, start, 0.0D, 0.0D, start / f); + tessellator.draw(); + } - @Override - public GuiElement addChild(GuiElement e) - { - int childBottom = e.y + e.h - 18; - if(childBottom > contentHeight) - contentHeight = childBottom; + @Override + public GuiElement addChild(GuiElement e) { + int childBottom = e.y + e.h - 18; + if (childBottom > contentHeight) + contentHeight = childBottom; - return super.addChild(e); - } + return super.addChild(e); + } + @Override + public void render() { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(Gui.optionsBackground); + x0 = -gui.screenX; + x1 = -gui.screenX + gui.width; - @Override - public void render() - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - Minecraft.getMinecraft().getTextureManager().bindTexture(Gui.optionsBackground); - x0 = -gui.screenX; - x1 = -gui.screenX + gui.width; + overlayBackground(y, h, 0x202020, 0xff, 0xff); - overlayBackground(y, h, 0x202020, 0xff, 0xff); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0f, offset, 0.0f); + super.render(); + GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0f, offset, 0.0f); - super.render(); - GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glDisable(GL11.GL_TEXTURE_2D); + overlayBackground(y, y + 8, 0x000000, 0xff, 0x00); + overlayBackground(h - 8, h, 0x000000, 0x00, 0xff); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glDisable(GL11.GL_TEXTURE_2D); - overlayBackground(y, y + 8, 0x000000, 0xff, 0x00); - overlayBackground(h - 8, h, 0x000000, 0x00, 0xff); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); + Minecraft.getMinecraft().getTextureManager().bindTexture(Gui.optionsBackground); + overlayBackground(-gui.screenY, y, 0x404040, 0xff, 0xff); + overlayBackground(h, -gui.screenY + gui.height, 0x404040, 0xff, 0xff); + } - Minecraft.getMinecraft().getTextureManager().bindTexture(Gui.optionsBackground); - overlayBackground(-gui.screenY, y, 0x404040, 0xff, 0xff); - overlayBackground(h, -gui.screenY + gui.height, 0x404040, 0xff, 0xff); - } + @Override + public void mouseMove(InputMouseEvent ev) { + if (scrollingStart != -1) { + offset = ev.y - scrollingStart; + if (offset > contentHeight) + offset = contentHeight; + if (offset < -contentHeight) + offset = -contentHeight; + } - @Override - public void mouseMove(InputMouseEvent ev) - { - if(scrollingStart != -1) - { - offset = ev.y - scrollingStart; - if(offset > contentHeight) offset = contentHeight; - if(offset < -contentHeight) offset = -contentHeight; - } + ev.y -= offset; + super.mouseMove(ev); + ev.y += offset; + } - ev.y -= offset; - super.mouseMove(ev); - ev.y += offset; - } + @Override + public void mouseDown(InputMouseEvent ev) { + scrollingStart = ev.y - offset; - @Override - public void mouseDown(InputMouseEvent ev) - { - scrollingStart = ev.y - offset; + if (ev.y >= y && ev.y < y + h) { + ev.y -= offset; + super.mouseDown(ev); + ev.y += offset; + } + } - if(ev.y >= y && ev.y < y + h) - { - ev.y -= offset; - super.mouseDown(ev); - ev.y += offset; - } - } + @Override + public void mouseUp(InputMouseEvent ev) { + scrollingStart = -1; - @Override - public void mouseUp(InputMouseEvent ev) - { - scrollingStart = -1; - - if(ev.y >= y && ev.y < y + h) - { - ev.y -= offset; - super.mouseUp(ev); - ev.y += offset; - } - } + if (ev.y >= y && ev.y < y + h) { + ev.y -= offset; + super.mouseUp(ev); + ev.y += offset; + } + } } - - diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/InputEvent.java b/src/main/java/com/cricketcraft/chisel/client/gui/InputEvent.java index f39e6fcf..6e2bdf5d 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/InputEvent.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/InputEvent.java @@ -1,6 +1,6 @@ package com.cricketcraft.chisel.client.gui; -public class InputEvent -{ - public boolean handled; +public class InputEvent { + + public boolean handled; } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/InputKeyboardEvent.java b/src/main/java/com/cricketcraft/chisel/client/gui/InputKeyboardEvent.java index 84ffb4b7..64db9202 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/InputKeyboardEvent.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/InputKeyboardEvent.java @@ -1,7 +1,7 @@ package com.cricketcraft.chisel.client.gui; -public class InputKeyboardEvent extends InputEvent -{ - public int key; - public char character; +public class InputKeyboardEvent extends InputEvent { + + public int key; + public char character; } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/InputMouseEvent.java b/src/main/java/com/cricketcraft/chisel/client/gui/InputMouseEvent.java index 2ae56522..9d81a770 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/InputMouseEvent.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/InputMouseEvent.java @@ -1,12 +1,12 @@ package com.cricketcraft.chisel.client.gui; -public class InputMouseEvent extends InputEvent -{ - public int x; - public int y; - public int dx; - public int dy; - public int wheel; - public int button; - public boolean down; +public class InputMouseEvent extends InputEvent { + + public int x; + public int y; + public int dx; + public int dy; + public int wheel; + public int button; + public boolean down; } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/Scrollbar.java b/src/main/java/com/cricketcraft/chisel/client/gui/Scrollbar.java index 93693a90..6be1eaeb 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/Scrollbar.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/Scrollbar.java @@ -7,120 +7,103 @@ import org.lwjgl.input.Mouse; import com.cricketcraft.chisel.utils.GeneralClient; -public abstract class Scrollbar extends GuiButton -{ - public boolean active; +public abstract class Scrollbar extends GuiButton { - public float offset; - public float step; + public boolean active; - boolean dragged; + public float offset; + public float step; - int elementHeight = 15; + boolean dragged; - public Scrollbar(int id, int x, int y, int w, int h, String string) - { - super(id, x, y, w, h, string); - offset = 0; - step = 0.025f; - height = h; - active = true; - dragged = false; - } + int elementHeight = 15; - /** - * Returns true if the mouse has been pressed on this control. Equivalent of - * MouseListener.mousePressed(MouseEvent e). - */ - @Override - public boolean mousePressed(Minecraft mc, int x, int y) - { - if(x < xPosition || x >= xPosition + width) - { - return false; - } + public Scrollbar(int id, int x, int y, int w, int h, String string) { + super(id, x, y, w, h, string); + offset = 0; + step = 0.025f; + height = h; + active = true; + dragged = false; + } - if(y < yPosition || y >= yPosition + height) - { - return false; - } + /** + * Returns true if the mouse has been pressed on this control. Equivalent of + * MouseListener.mousePressed(MouseEvent e). + */ + @Override + public boolean mousePressed(Minecraft mc, int x, int y) { + if (x < xPosition || x >= xPosition + width) { + return false; + } - if(active) - { - dragged = true; - } + if (y < yPosition || y >= yPosition + height) { + return false; + } - return true; - } + if (active) { + dragged = true; + } - /** - * Draws this button to the screen. - */ - @Override - public void drawButton(Minecraft mc, int x, int y) - { - if(dragged) - { - float initialOffset = offset; - int off = y - yPosition - elementHeight / 2; - offset = 1.0f * off / (height - elementHeight); + return true; + } - if(offset < 0) - { - offset = 0; - } + /** + * Draws this button to the screen. + */ + @Override + public void drawButton(Minecraft mc, int x, int y) { + if (dragged) { + float initialOffset = offset; + int off = y - yPosition - elementHeight / 2; + offset = 1.0f * off / (height - elementHeight); - if(offset > 1) - { - offset = 1; - } + if (offset < 0) { + offset = 0; + } - if(initialOffset != offset) - { - onScrolled(offset); - } - } + if (offset > 1) { + offset = 1; + } - int bottom = yPosition + height; - GeneralClient.bind("/gui/allitems.png"); - drawTexturedModalRect(xPosition, yPosition + (int) ((height - elementHeight) * offset), active ? 232 : 244, 0, 12, elementHeight); - } + if (initialOffset != offset) { + onScrolled(offset); + } + } - public void handleMouseInput() - { - if(Mouse.getEventButton() == 0 && !Mouse.getEventButtonState()) - { - dragged = false; - } + int bottom = yPosition + height; + GeneralClient.bind("/gui/allitems.png"); + drawTexturedModalRect(xPosition, yPosition + (int) ((height - elementHeight) * offset), active ? 232 : 244, 0, 12, elementHeight); + } - if(!active) - { - return; - } + public void handleMouseInput() { + if (Mouse.getEventButton() == 0 && !Mouse.getEventButtonState()) { + dragged = false; + } - float initialOffset = offset; - int direction = Mouse.getEventDWheel(); + if (!active) { + return; + } - if(direction != 0) - { - offset += direction > 0 ? -step : step; - } + float initialOffset = offset; + int direction = Mouse.getEventDWheel(); - if(offset < 0) - { - offset = 0; - } + if (direction != 0) { + offset += direction > 0 ? -step : step; + } - if(offset > 1) - { - offset = 1; - } + if (offset < 0) { + offset = 0; + } - if(initialOffset != offset) - { - onScrolled(offset); - } - } + if (offset > 1) { + offset = 1; + } - public abstract void onScrolled(float off); + if (initialOffset != offset) { + onScrolled(offset); + } + } + + public abstract void onScrolled(float off); } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/TexturedBox.java b/src/main/java/com/cricketcraft/chisel/client/gui/TexturedBox.java index 6dbdeedc..655d3fc5 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/TexturedBox.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/TexturedBox.java @@ -1,73 +1,69 @@ package com.cricketcraft.chisel.client.gui; -public class TexturedBox -{ - String texture; - int u, v, texw, texh; - int borderTop, borderRight, borderBottom, borderLeft; +public class TexturedBox { - public TexturedBox(String texture, int u, int v, int texw, int texh, int borderTop, int borderRight, int borderBottom, int borderLeft) - { - this.texture = texture; - this.u = u; - this.v = v; - this.texw = texw; - this.texh = texh; - this.borderTop = borderTop; - this.borderRight = borderRight; - this.borderBottom = borderBottom; - this.borderLeft = borderLeft; - } + String texture; + int u, v, texw, texh; + int borderTop, borderRight, borderBottom, borderLeft; - public void render(GuiScreenPlus gui, int x, int y, int w, int h) - { - int x1 = x; - int x2 = x + borderLeft; - int x3 = x + w - borderRight; - int y1 = y; - int y2 = y + borderTop; - int y3 = y + h - borderBottom; - int w1 = borderLeft; - int w2 = w - borderLeft - borderRight; - int w3 = borderRight; - int h1 = borderTop; - int h2 = h - borderTop - borderBottom; - int h3 = borderBottom; - int u1 = u; - int v1 = v; - int tw = texw; + public TexturedBox(String texture, int u, int v, int texw, int texh, int borderTop, int borderRight, int borderBottom, int borderLeft) { + this.texture = texture; + this.u = u; + this.v = v; + this.texw = texw; + this.texh = texh; + this.borderTop = borderTop; + this.borderRight = borderRight; + this.borderBottom = borderBottom; + this.borderLeft = borderLeft; + } - if(tw > w) - { - tw = w; - } + public void render(GuiScreenPlus gui, int x, int y, int w, int h) { + int x1 = x; + int x2 = x + borderLeft; + int x3 = x + w - borderRight; + int y1 = y; + int y2 = y + borderTop; + int y3 = y + h - borderBottom; + int w1 = borderLeft; + int w2 = w - borderLeft - borderRight; + int w3 = borderRight; + int h1 = borderTop; + int h2 = h - borderTop - borderBottom; + int h3 = borderBottom; + int u1 = u; + int v1 = v; + int tw = texw; - int th = texh; + if (tw > w) { + tw = w; + } - if(th > h) - { - th = h; - } + int th = texh; - int u2 = u1 + borderLeft; - int u3 = u1 + texw - borderRight; - int v2 = v1 + borderTop; - int v3 = v1 + texh - borderBottom; - int texw1 = borderLeft; - int texw2 = tw - borderLeft - borderRight; - int texw3 = borderRight; - int texh1 = borderTop; - int texh2 = th - borderTop - borderBottom; - int texh3 = borderBottom; - gui.bindTexture(texture); - gui.drawTexturedModalRect(x1, y1, u1, v1, w1, h1); - gui.drawTiledRect(x2, y1, w2, h1, u2, v1, texw2, texh1); - gui.drawTexturedModalRect(x3, y1, u3, v1, w3, h1); - gui.drawTiledRect(x1, y2, w1, h2, u1, v2, w1, texh2); - gui.drawTiledRect(x2, y2, w2, h2, u2, v2, texw2, texh2); - gui.drawTiledRect(x3, y2, w3, h2, u3, v2, w3, texh2); - gui.drawTexturedModalRect(x1, y3, u1, v3, w1, h3); - gui.drawTiledRect(x2, y3, w2, h3, u2, v3, texw2, texh3); - gui.drawTexturedModalRect(x3, y3, u3, v3, w3, h3); - } + if (th > h) { + th = h; + } + + int u2 = u1 + borderLeft; + int u3 = u1 + texw - borderRight; + int v2 = v1 + borderTop; + int v3 = v1 + texh - borderBottom; + int texw1 = borderLeft; + int texw2 = tw - borderLeft - borderRight; + int texw3 = borderRight; + int texh1 = borderTop; + int texh2 = th - borderTop - borderBottom; + int texh3 = borderBottom; + gui.bindTexture(texture); + gui.drawTexturedModalRect(x1, y1, u1, v1, w1, h1); + gui.drawTiledRect(x2, y1, w2, h1, u2, v1, texw2, texh1); + gui.drawTexturedModalRect(x3, y1, u3, v1, w3, h1); + gui.drawTiledRect(x1, y2, w1, h2, u1, v2, w1, texh2); + gui.drawTiledRect(x2, y2, w2, h2, u2, v2, texw2, texh2); + gui.drawTiledRect(x3, y2, w3, h2, u3, v2, w3, texh2); + gui.drawTexturedModalRect(x1, y3, u1, v3, w1, h3); + gui.drawTiledRect(x2, y3, w2, h3, u2, v3, texw2, texh3); + gui.drawTexturedModalRect(x3, y3, u3, v3, w3, h3); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/model/ModelAutoChisel.java b/src/main/java/com/cricketcraft/chisel/client/model/ModelAutoChisel.java index 7895a0d1..2f9ed16c 100644 --- a/src/main/java/com/cricketcraft/chisel/client/model/ModelAutoChisel.java +++ b/src/main/java/com/cricketcraft/chisel/client/model/ModelAutoChisel.java @@ -4,144 +4,141 @@ import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -public class ModelAutoChisel extends ModelBase -{ - //fields - ModelRenderer Shape1; - ModelRenderer Shape2; - ModelRenderer Shape3; - ModelRenderer Shape4; - ModelRenderer Shape5; - ModelRenderer Shape6; - ModelRenderer Shape7; - ModelRenderer Shape8; - ModelRenderer Shape9; - ModelRenderer Shape10; - ModelRenderer Shape11; - ModelRenderer Shape12; - - public ModelAutoChisel() - { - textureWidth = 64; - textureHeight = 32; - - Shape1 = new ModelRenderer(this, 0, 0); - Shape1.addBox(0F, 0F, 0F, 16, 1, 1); - Shape1.setRotationPoint(-8F, 23F, -8F); - Shape1.setTextureSize(64, 32); - Shape1.mirror = true; - setRotation(Shape1, 0F, 0F, 0F); - Shape2 = new ModelRenderer(this, 0, 0); - Shape2.addBox(0F, 0F, 0F, 1, 1, 15); - Shape2.setRotationPoint(-8F, 23F, -7F); - Shape2.setTextureSize(64, 32); - Shape2.mirror = true; - setRotation(Shape2, 0F, 0F, 0F); - Shape3 = new ModelRenderer(this, 0, 0); - Shape3.addBox(0F, 0F, 0F, 1, 1, 15); - Shape3.setRotationPoint(7F, 23F, -7F); - Shape3.setTextureSize(64, 32); - Shape3.mirror = true; - setRotation(Shape3, 0F, 0F, 0F); - Shape4 = new ModelRenderer(this, 0, 0); - Shape4.addBox(0F, 0F, 0F, 14, 1, 1); - Shape4.setRotationPoint(-7F, 23F, 7F); - Shape4.setTextureSize(64, 32); - Shape4.mirror = true; - setRotation(Shape4, 0F, 0F, 0F); - Shape5 = new ModelRenderer(this, 0, 0); - Shape5.addBox(0F, 0F, 0F, 1, 15, 1); - Shape5.setRotationPoint(-8F, 8F, -8F); - Shape5.setTextureSize(64, 32); - Shape5.mirror = true; - setRotation(Shape5, 0F, 0F, 0F); - Shape6 = new ModelRenderer(this, 0, 0); - Shape6.addBox(0F, 0F, 0F, 1, 15, 1); - Shape6.setRotationPoint(-8F, 8F, 7F); - Shape6.setTextureSize(64, 32); - Shape6.mirror = true; - setRotation(Shape6, 0F, 0F, 0F); - Shape7 = new ModelRenderer(this, 0, 0); - Shape7.addBox(0F, 0F, 0F, 1, 15, 1); - Shape7.setRotationPoint(7F, 8F, -8F); - Shape7.setTextureSize(64, 32); - Shape7.mirror = true; - setRotation(Shape7, 0F, 0F, 0F); - Shape8 = new ModelRenderer(this, 0, 0); - Shape8.addBox(0F, 0F, 0F, 1, 15, 1); - Shape8.setRotationPoint(7F, 8F, 7F); - Shape8.setTextureSize(64, 32); - Shape8.mirror = true; - setRotation(Shape8, 0F, 0F, 0F); - Shape9 = new ModelRenderer(this, 0, 0); - Shape9.addBox(0F, 0F, 0F, 14, 1, 1); - Shape9.setRotationPoint(-7F, 8F, 7F); - Shape9.setTextureSize(64, 32); - Shape9.mirror = true; - setRotation(Shape9, 0F, 0F, 0F); - Shape10 = new ModelRenderer(this, 0, 0); - Shape10.addBox(0F, 0F, 0F, 14, 1, 1); - Shape10.setRotationPoint(-7F, 8F, -8F); - Shape10.setTextureSize(64, 32); - Shape10.mirror = true; - setRotation(Shape10, 0F, 0F, 0F); - Shape11 = new ModelRenderer(this, 0, 0); - Shape11.addBox(0F, 0F, 0F, 1, 1, 14); - Shape11.setRotationPoint(7F, 8F, -7F); - Shape11.setTextureSize(64, 32); - Shape11.mirror = true; - setRotation(Shape11, 0F, 0F, 0F); - Shape12 = new ModelRenderer(this, 0, 0); - Shape12.addBox(0F, 0F, 0F, 1, 1, 14); - Shape12.setRotationPoint(-8F, 8F, -7F); - Shape12.setTextureSize(64, 32); - Shape12.mirror = true; - setRotation(Shape12, 0F, 0F, 0F); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5); - Shape1.render(f5); - Shape2.render(f5); - Shape3.render(f5); - Shape4.render(f5); - Shape5.render(f5); - Shape6.render(f5); - Shape7.render(f5); - Shape8.render(f5); - Shape9.render(f5); - Shape10.render(f5); - Shape11.render(f5); - Shape12.render(f5); - } +public class ModelAutoChisel extends ModelBase { - public void renderAll(){ - Shape1.render(0.0625F); - Shape2.render(0.0625F); - Shape3.render(0.0625F); - Shape4.render(0.0625F); - Shape5.render(0.0625F); - Shape6.render(0.0625F); - Shape7.render(0.0625F); - Shape8.render(0.0625F); - Shape9.render(0.0625F); - Shape10.render(0.0625F); - Shape11.render(0.0625F); - Shape12.render(0.0625F); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, null); - } + // fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape5; + ModelRenderer Shape6; + ModelRenderer Shape7; + ModelRenderer Shape8; + ModelRenderer Shape9; + ModelRenderer Shape10; + ModelRenderer Shape11; + ModelRenderer Shape12; + + public ModelAutoChisel() { + textureWidth = 64; + textureHeight = 32; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(0F, 0F, 0F, 16, 1, 1); + Shape1.setRotationPoint(-8F, 23F, -8F); + Shape1.setTextureSize(64, 32); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 0); + Shape2.addBox(0F, 0F, 0F, 1, 1, 15); + Shape2.setRotationPoint(-8F, 23F, -7F); + Shape2.setTextureSize(64, 32); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 0, 0); + Shape3.addBox(0F, 0F, 0F, 1, 1, 15); + Shape3.setRotationPoint(7F, 23F, -7F); + Shape3.setTextureSize(64, 32); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 0, 0); + Shape4.addBox(0F, 0F, 0F, 14, 1, 1); + Shape4.setRotationPoint(-7F, 23F, 7F); + Shape4.setTextureSize(64, 32); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 0, 0); + Shape5.addBox(0F, 0F, 0F, 1, 15, 1); + Shape5.setRotationPoint(-8F, 8F, -8F); + Shape5.setTextureSize(64, 32); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape6 = new ModelRenderer(this, 0, 0); + Shape6.addBox(0F, 0F, 0F, 1, 15, 1); + Shape6.setRotationPoint(-8F, 8F, 7F); + Shape6.setTextureSize(64, 32); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 0, 0); + Shape7.addBox(0F, 0F, 0F, 1, 15, 1); + Shape7.setRotationPoint(7F, 8F, -8F); + Shape7.setTextureSize(64, 32); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape8 = new ModelRenderer(this, 0, 0); + Shape8.addBox(0F, 0F, 0F, 1, 15, 1); + Shape8.setRotationPoint(7F, 8F, 7F); + Shape8.setTextureSize(64, 32); + Shape8.mirror = true; + setRotation(Shape8, 0F, 0F, 0F); + Shape9 = new ModelRenderer(this, 0, 0); + Shape9.addBox(0F, 0F, 0F, 14, 1, 1); + Shape9.setRotationPoint(-7F, 8F, 7F); + Shape9.setTextureSize(64, 32); + Shape9.mirror = true; + setRotation(Shape9, 0F, 0F, 0F); + Shape10 = new ModelRenderer(this, 0, 0); + Shape10.addBox(0F, 0F, 0F, 14, 1, 1); + Shape10.setRotationPoint(-7F, 8F, -8F); + Shape10.setTextureSize(64, 32); + Shape10.mirror = true; + setRotation(Shape10, 0F, 0F, 0F); + Shape11 = new ModelRenderer(this, 0, 0); + Shape11.addBox(0F, 0F, 0F, 1, 1, 14); + Shape11.setRotationPoint(7F, 8F, -7F); + Shape11.setTextureSize(64, 32); + Shape11.mirror = true; + setRotation(Shape11, 0F, 0F, 0F); + Shape12 = new ModelRenderer(this, 0, 0); + Shape12.addBox(0F, 0F, 0F, 1, 1, 14); + Shape12.setRotationPoint(-8F, 8F, -7F); + Shape12.setTextureSize(64, 32); + Shape12.mirror = true; + setRotation(Shape12, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5); + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + Shape6.render(f5); + Shape7.render(f5); + Shape8.render(f5); + Shape9.render(f5); + Shape10.render(f5); + Shape11.render(f5); + Shape12.render(f5); + } + + public void renderAll() { + Shape1.render(0.0625F); + Shape2.render(0.0625F); + Shape3.render(0.0625F); + Shape4.render(0.0625F); + Shape5.render(0.0625F); + Shape6.render(0.0625F); + Shape7.render(0.0625F); + Shape8.render(0.0625F); + Shape9.render(0.0625F); + Shape10.render(0.0625F); + Shape11.render(0.0625F); + Shape12.render(0.0625F); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) { + super.setRotationAngles(f, f1, f2, f3, f4, f5, null); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/BlockAdvancedMarbleRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/BlockAdvancedMarbleRenderer.java index 53a43fe7..6481eebc 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/BlockAdvancedMarbleRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/BlockAdvancedMarbleRenderer.java @@ -15,74 +15,67 @@ import com.cricketcraft.chisel.utils.Drawing; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -public class BlockAdvancedMarbleRenderer implements ISimpleBlockRenderingHandler -{ - public RenderBlocksCTM rendererCTM = new RenderBlocksCTM(); - RenderBlocksColumn rendererColumn = new RenderBlocksColumn(); +public class BlockAdvancedMarbleRenderer implements ISimpleBlockRenderingHandler { - public BlockAdvancedMarbleRenderer() - { - if(Chisel.RenderCTMId == 0) - { - Chisel.RenderCTMId = RenderingRegistry.getNextAvailableRenderId(); + public RenderBlocksCTM rendererCTM = new RenderBlocksCTM(); + RenderBlocksColumn rendererColumn = new RenderBlocksColumn(); - } - } + public BlockAdvancedMarbleRenderer() { + if (Chisel.RenderCTMId == 0) { + Chisel.RenderCTMId = 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 boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks rendererOld) - { - int meta = world.getBlockMetadata(x, y, z); + @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); + } - CarvableVariation var = ((ICarvable) block).getVariation(meta); + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks rendererOld) { + int meta = world.getBlockMetadata(x, y, z); - switch(var == null ? 0 : var.kind) - { - case CarvableHelper.CTMX: - rendererCTM.blockAccess = world; - rendererCTM.renderMaxX = 1.0; - rendererCTM.renderMaxY = 1.0; - rendererCTM.renderMaxZ = 1.0; + CarvableVariation var = ((ICarvable) block).getVariation(meta); - rendererCTM.submap = var.submap; - rendererCTM.submapSmall = var.submapSmall; + switch (var == null ? 0 : var.kind) { + case CarvableHelper.CTMX: + rendererCTM.blockAccess = world; + rendererCTM.renderMaxX = 1.0; + rendererCTM.renderMaxY = 1.0; + rendererCTM.renderMaxZ = 1.0; - rendererCTM.rendererOld = rendererOld; + rendererCTM.submap = var.submap; + rendererCTM.submapSmall = var.submapSmall; - return rendererCTM.renderStandardBlock(block, x, y, z); - case CarvableHelper.CTMV: - rendererColumn.blockAccess = world; - rendererColumn.renderMaxX = 1.0; - rendererColumn.renderMaxY = 1.0; - rendererColumn.renderMaxZ = 1.0; + rendererCTM.rendererOld = rendererOld; - rendererColumn.submap = var.seamsCtmVert; - rendererColumn.iconTop = var.iconTop; + return rendererCTM.renderStandardBlock(block, x, y, z); + case CarvableHelper.CTMV: + rendererColumn.blockAccess = world; + rendererColumn.renderMaxX = 1.0; + rendererColumn.renderMaxY = 1.0; + rendererColumn.renderMaxZ = 1.0; - return rendererColumn.renderStandardBlock(block, x, y, z); - default: - return rendererOld.renderStandardBlock(block, x, y, z); - } - } + rendererColumn.submap = var.seamsCtmVert; + rendererColumn.iconTop = var.iconTop; - @Override - public boolean shouldRender3DInInventory(int renderId) - { - return true; - } + return rendererColumn.renderStandardBlock(block, x, y, z); + default: + return rendererOld.renderStandardBlock(block, x, y, z); + } + } - @Override - public int getRenderId() - { - return Chisel.RenderCTMId; - } + @Override + public boolean shouldRender3DInInventory(int renderId) { + return true; + } + + @Override + public int getRenderId() { + return Chisel.RenderCTMId; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/BlockCarpetRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/BlockCarpetRenderer.java index fb373678..a1a314c0 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/BlockCarpetRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/BlockCarpetRenderer.java @@ -4,22 +4,18 @@ import com.cricketcraft.chisel.Chisel; import cpw.mods.fml.client.registry.RenderingRegistry; +public class BlockCarpetRenderer extends BlockAdvancedMarbleRenderer { -public class BlockCarpetRenderer extends BlockAdvancedMarbleRenderer -{ + public BlockCarpetRenderer() { + super(); - public BlockCarpetRenderer() - { - super(); + Chisel.RenderCarpetId = RenderingRegistry.getNextAvailableRenderId(); - Chisel.RenderCarpetId = RenderingRegistry.getNextAvailableRenderId(); + rendererCTM = new RenderBlocksCTMCarpet(); + } - rendererCTM = new RenderBlocksCTMCarpet(); - } - - @Override - public int getRenderId() - { - return Chisel.RenderCarpetId; - } + @Override + public int getRenderId() { + return Chisel.RenderCarpetId; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/BlockEldritchRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/BlockEldritchRenderer.java index 8a88ad40..2727d6c4 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/BlockEldritchRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/BlockEldritchRenderer.java @@ -12,105 +12,90 @@ import com.cricketcraft.chisel.utils.Drawing; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -public class BlockEldritchRenderer implements ISimpleBlockRenderingHandler -{ - public BlockEldritchRenderer() - { - Chisel.RenderEldritchId = RenderingRegistry.getNextAvailableRenderId(); - } +public class BlockEldritchRenderer implements ISimpleBlockRenderingHandler { - @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); - } + public BlockEldritchRenderer() { + 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); + } - 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) - { - int meta = world.getBlockMetadata(x, y, z); + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks rendererOld) { + int meta = world.getBlockMetadata(x, y, z); -// tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); -/* - double d0 = 0.4000000059604645D; - double d1 = 0.5D - d0; - double d2 = 0.20000000298023224D; + // 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.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); + 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; + */ + } + @Override + public boolean shouldRender3DInInventory(int renderId) { + return true; + } - - - - - - - - - - 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); - - return true; -/* - - boolean flag = renderer.renderStandardBlock(block, x, y, z); - - return flag;*/ - } - - @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/com/cricketcraft/chisel/client/render/BlockMarblePaneRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/BlockMarblePaneRenderer.java index f500805a..cda75e2c 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/BlockMarblePaneRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/BlockMarblePaneRenderer.java @@ -15,326 +15,307 @@ import com.cricketcraft.chisel.utils.Drawing; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -public class BlockMarblePaneRenderer implements ISimpleBlockRenderingHandler -{ - public static int id; +public class BlockMarblePaneRenderer implements ISimpleBlockRenderingHandler { - public BlockMarblePaneRenderer() - { - id = RenderingRegistry.getNextAvailableRenderId(); - } + public static int id; - @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); - } + public BlockMarblePaneRenderer() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - class PaneRenderer - { - Tessellator tessellator; + @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); + } - double i0u0; - double i0uh; - double i0u1; - double i0v0; - double i0v1; + class PaneRenderer { - double i1u0; - double i1u1; - double i1v0; - double i1vh; - double i1v1; - double i1v; + Tessellator tessellator; - double i2u0; - double i2u1; - double i2v0; - double i2v1; - double i2v; + double i0u0; + double i0uh; + double i0u1; + double i0v0; + double i0v1; - double x0; - double xh; - double x1; - double xp0; - double xp1; + double i1u0; + double i1u1; + double i1v0; + double i1vh; + double i1v1; + double i1v; - double z0; - double zh; - double z1; - double zp0; - double zp1; + double i2u0; + double i2u1; + double i2v0; + double i2v1; + double i2v; - double y0; - double y1; + double x0; + double xh; + double x1; + double xp0; + double xp1; - void set(double x, double y, double z, IIcon icon, IIcon icon1, IIcon icon2) - { - tessellator = Tessellator.instance; + double z0; + double zh; + double z1; + double zp0; + double zp1; - i0u0 = icon.getMinU(); - i0uh = icon.getInterpolatedU(8.0D); - i0u1 = icon.getMaxU(); - i0v0 = icon.getMinV(); - i0v1 = icon.getMaxV(); + double y0; + double y1; - i1u0 = icon1.getInterpolatedU(7.0D); - i1u1 = icon1.getInterpolatedU(9.0D); - i1v0 = icon1.getMinV(); - i1vh = icon1.getInterpolatedV(8.0D); - i1v1 = icon1.getMaxV(); - i1v = i1v1 - i1v0; + void set(double x, double y, double z, IIcon icon, IIcon icon1, IIcon icon2) { + tessellator = Tessellator.instance; - i2u0 = icon2.getInterpolatedU(7.0D); - i2u1 = icon2.getInterpolatedU(9.0D); - i2v0 = icon2.getMinV(); - i2v1 = icon2.getMaxV(); - i2v = i2v1 - i2v0; + i0u0 = icon.getMinU(); + i0uh = icon.getInterpolatedU(8.0D); + i0u1 = icon.getMaxU(); + i0v0 = icon.getMinV(); + i0v1 = icon.getMaxV(); - x0 = x; - xh = x0 + 0.5D; - x1 = x + 1; - xp0 = x0 + 0.5D - 0.0625D; - xp1 = x0 + 0.5D + 0.0625D; + i1u0 = icon1.getInterpolatedU(7.0D); + i1u1 = icon1.getInterpolatedU(9.0D); + i1v0 = icon1.getMinV(); + i1vh = icon1.getInterpolatedV(8.0D); + i1v1 = icon1.getMaxV(); + i1v = i1v1 - i1v0; - z0 = z; - zh = z0 + 0.5D; - z1 = z + 1; - zp0 = z0 + 0.5D - 0.0625D; - zp1 = z0 + 0.5D + 0.0625D; + i2u0 = icon2.getInterpolatedU(7.0D); + i2u1 = icon2.getInterpolatedU(9.0D); + i2v0 = icon2.getMinV(); + i2v1 = icon2.getMaxV(); + i2v = i2v1 - i2v0; - y0 = y; - y1 = y + 1; - } + x0 = x; + xh = x0 + 0.5D; + x1 = x + 1; + xp0 = x0 + 0.5D - 0.0625D; + xp1 = x0 + 0.5D + 0.0625D; - 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); - } + z0 = z; + zh = z0 + 0.5D; + z1 = z + 1; + zp0 = z0 + 0.5D - 0.0625D; + zp1 = z0 + 0.5D + 0.0625D; - 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); - } + y0 = y; + y1 = y + 1; + } - 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 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 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 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 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 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 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 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 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 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 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(); + 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); + } + } - @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; + PaneRenderer paneRenderer = new PaneRenderer(); - int worldHeight = world.getHeight(); - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + @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; - 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; + int worldHeight = world.getHeight(); + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - 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); + 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; - 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 (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); - paneRenderer.set(x, y, z, iconPane, iconTop, iconSide); + 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; - 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)); + paneRenderer.set(x, y, z, iconPane, iconTop, iconSide); - 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 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 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 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 isolatedTop = !connectsTopNorth && !connectsTopSouth && !connectsTopWest && !connectsTopEast; - boolean isolatedBottom = !connectsBottomNorth && !connectsBottomSouth && !connectsBottomWest && !connectsBottomEast; + 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)); - if(!connectsNorth && !connectsSouth && !connectsWest && !connectsEast) - { - connectsNorth = connectsSouth = connectsWest = connectsEast = true; - } + boolean isolatedTop = !connectsTopNorth && !connectsTopSouth && !connectsTopWest && !connectsTopEast; + boolean isolatedBottom = !connectsBottomNorth && !connectsBottomSouth && !connectsBottomWest && !connectsBottomEast; - 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 (!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++; + } - 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/com/cricketcraft/chisel/client/render/BlockMarblePillarRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/BlockMarblePillarRenderer.java index ccc396e8..d0ea436a 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/BlockMarblePillarRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/BlockMarblePillarRenderer.java @@ -13,163 +13,148 @@ import com.cricketcraft.chisel.utils.Drawing; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -public class BlockMarblePillarRenderer implements ISimpleBlockRenderingHandler -{ - public static int id; +public class BlockMarblePillarRenderer implements ISimpleBlockRenderingHandler { - public BlockMarblePillarRenderer() - { - id = RenderingRegistry.getNextAvailableRenderId(); - } + public static int id; - @Override - public void renderInventoryBlock(Block blck, int metadata, int modelID, RenderBlocks renderer) - { - if(!(blck instanceof BlockMarblePillar)) - return; + public BlockMarblePillarRenderer() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - BlockMarblePillar block = (BlockMarblePillar) blck; + @Override + public void renderInventoryBlock(Block blck, int metadata, int modelID, RenderBlocks renderer) { + if (!(blck instanceof BlockMarblePillar)) + return; - block.sides[0] = block.sides[1] = block.getCtmIcon(4, metadata); - block.sides[2] = block.sides[3] = block.sides[4] = block.sides[5] = block.getCtmIcon(0, metadata); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - Drawing.drawBlock(block, metadata, renderer); - } + BlockMarblePillar block = (BlockMarblePillar) blck; - boolean connected(IBlockAccess world, int x, int y, int z, Block block, int meta) - { - return world.getBlock(x, y, z).equals(block) && world.getBlockMetadata(x, y, z) == meta; + block.sides[0] = block.sides[1] = block.getCtmIcon(4, metadata); + block.sides[2] = block.sides[3] = block.sides[4] = block.sides[5] = block.getCtmIcon(0, metadata); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + Drawing.drawBlock(block, metadata, renderer); + } - } + boolean connected(IBlockAccess world, int x, int y, int z, Block block, int meta) { + return world.getBlock(x, y, z).equals(block) && world.getBlockMetadata(x, y, z) == meta; - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) - { - if(!(blck instanceof BlockMarblePillar)) - return false; + } - BlockMarblePillar block = (BlockMarblePillar) blck; + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) { + if (!(blck instanceof BlockMarblePillar)) + return false; - int metadata = world.getBlockMetadata(x, y, z); + BlockMarblePillar block = (BlockMarblePillar) blck; - if(block.carverHelper.variations.get(metadata).kind != CarvableHelper.CTMV) - { - block.sides[0] = block.carverHelper.getIcon(0, metadata); - block.sides[1] = block.carverHelper.getIcon(1, metadata); - block.sides[2] = block.carverHelper.getIcon(2, metadata); - block.sides[3] = block.carverHelper.getIcon(3, metadata); - block.sides[4] = block.carverHelper.getIcon(4, metadata); - block.sides[5] = block.carverHelper.getIcon(5, metadata); + int metadata = world.getBlockMetadata(x, y, z); - return renderer.renderStandardBlock(block, x, y, z); - } + if (block.carverHelper.variations.get(metadata).kind != CarvableHelper.CTMV) { + block.sides[0] = block.carverHelper.getIcon(0, metadata); + block.sides[1] = block.carverHelper.getIcon(1, metadata); + block.sides[2] = block.carverHelper.getIcon(2, metadata); + block.sides[3] = block.carverHelper.getIcon(3, metadata); + block.sides[4] = block.carverHelper.getIcon(4, metadata); + block.sides[5] = block.carverHelper.getIcon(5, metadata); - boolean yp = connected(world, x, y + 1, z, block, metadata); - boolean yn = connected(world, x, y - 1, z, block, metadata); + return renderer.renderStandardBlock(block, x, y, z); + } - if(yp || yn) - { - block.sides[0] = block.getCtmIcon(4, metadata); - block.sides[1] = block.getCtmIcon(4, metadata); + boolean yp = connected(world, x, y + 1, z, block, metadata); + boolean yn = connected(world, x, y - 1, z, block, metadata); - if(yp && yn) - block.sides[2] = block.getCtmIcon(2, metadata); - else if(yp) - block.sides[2] = block.getCtmIcon(3, metadata); - else - block.sides[2] = block.getCtmIcon(1, metadata); + if (yp || yn) { + block.sides[0] = block.getCtmIcon(4, metadata); + block.sides[1] = block.getCtmIcon(4, metadata); - block.sides[3] = block.sides[4] = block.sides[5] = block.sides[2]; - } else - { - boolean xp = connected(world, x + 1, y, z, block, metadata); - boolean xn = connected(world, x - 1, y, z, block, metadata); + if (yp && yn) + block.sides[2] = block.getCtmIcon(2, metadata); + else if (yp) + block.sides[2] = block.getCtmIcon(3, metadata); + else + block.sides[2] = block.getCtmIcon(1, metadata); - if(xp && (connected(world, x + 1, y + 1, z, block, metadata) || connected(world, x + 1, y - 1, z, block, metadata))) - xp = false; - if(xn && (connected(world, x - 1, y + 1, z, block, metadata) || connected(world, x - 1, y - 1, z, block, metadata))) - xn = false; + block.sides[3] = block.sides[4] = block.sides[5] = block.sides[2]; + } else { + boolean xp = connected(world, x + 1, y, z, block, metadata); + boolean xn = connected(world, x - 1, y, z, block, metadata); - if(xp || xn) - { - renderer.uvRotateEast = 2; - renderer.uvRotateWest = 1; - renderer.uvRotateTop = 1; - renderer.uvRotateBottom = 1; + if (xp && (connected(world, x + 1, y + 1, z, block, metadata) || connected(world, x + 1, y - 1, z, block, metadata))) + xp = false; + if (xn && (connected(world, x - 1, y + 1, z, block, metadata) || connected(world, x - 1, y - 1, z, block, metadata))) + xn = false; - block.sides[4] = block.getCtmIcon(4, metadata); - block.sides[5] = block.getCtmIcon(4, metadata); + if (xp || xn) { + renderer.uvRotateEast = 2; + renderer.uvRotateWest = 1; + renderer.uvRotateTop = 1; + renderer.uvRotateBottom = 1; - if(xp && xn) - block.sides[0] = block.getCtmIcon(2, metadata); - else if(xp) - block.sides[0] = block.getCtmIcon(3, metadata); - else - block.sides[0] = block.getCtmIcon(1, metadata); + block.sides[4] = block.getCtmIcon(4, metadata); + block.sides[5] = block.getCtmIcon(4, metadata); - block.sides[1] = block.sides[2] = block.sides[3] = block.sides[0]; - } else - { - boolean zp = connected(world, x, y, z + 1, block, metadata); - boolean zn = connected(world, x, y, z - 1, block, metadata); + if (xp && xn) + block.sides[0] = block.getCtmIcon(2, metadata); + else if (xp) + block.sides[0] = block.getCtmIcon(3, metadata); + else + block.sides[0] = block.getCtmIcon(1, metadata); - if(zp && (connected(world, x, y + 1, z + 1, block, metadata) || connected(world, x, y - 1, z + 1, block, metadata))) - zp = false; - if(zp && (connected(world, x + 1, y, z + 1, block, metadata) || connected(world, x - 1, y, z + 1, block, metadata))) - zp = false; - if(zn && (connected(world, x, y + 1, z - 1, block, metadata) || connected(world, x, y - 1, z - 1, block, metadata))) - zn = false; - if(zn && (connected(world, x + 1, y, z - 1, block, metadata) || connected(world, x - 1, y, z - 1, block, metadata))) - zn = false; + block.sides[1] = block.sides[2] = block.sides[3] = block.sides[0]; + } else { + boolean zp = connected(world, x, y, z + 1, block, metadata); + boolean zn = connected(world, x, y, z - 1, block, metadata); - if(zp || zn) - { - renderer.uvRotateSouth = 1; - renderer.uvRotateNorth = 2; + if (zp && (connected(world, x, y + 1, z + 1, block, metadata) || connected(world, x, y - 1, z + 1, block, metadata))) + zp = false; + if (zp && (connected(world, x + 1, y, z + 1, block, metadata) || connected(world, x - 1, y, z + 1, block, metadata))) + zp = false; + if (zn && (connected(world, x, y + 1, z - 1, block, metadata) || connected(world, x, y - 1, z - 1, block, metadata))) + zn = false; + if (zn && (connected(world, x + 1, y, z - 1, block, metadata) || connected(world, x - 1, y, z - 1, block, metadata))) + zn = false; - block.sides[2] = block.getCtmIcon(4, metadata); - block.sides[3] = block.getCtmIcon(4, metadata); + if (zp || zn) { + renderer.uvRotateSouth = 1; + renderer.uvRotateNorth = 2; - if(zp && zn) - block.sides[0] = block.getCtmIcon(2, metadata); - else if(zp) - block.sides[0] = block.getCtmIcon(1, metadata); - else - block.sides[0] = block.getCtmIcon(3, metadata); + block.sides[2] = block.getCtmIcon(4, metadata); + block.sides[3] = block.getCtmIcon(4, metadata); - block.sides[1] = block.sides[4] = block.sides[5] = block.sides[0]; - } else - { - block.sides[0] = block.sides[1] = block.getCtmIcon(4, metadata); - block.sides[2] = block.sides[3] = block.sides[4] = block.sides[5] = block.getCtmIcon(0, metadata); - } - } - } + if (zp && zn) + block.sides[0] = block.getCtmIcon(2, metadata); + else if (zp) + block.sides[0] = block.getCtmIcon(1, metadata); + else + block.sides[0] = block.getCtmIcon(3, metadata); + block.sides[1] = block.sides[4] = block.sides[5] = block.sides[0]; + } else { + block.sides[0] = block.sides[1] = block.getCtmIcon(4, metadata); + block.sides[2] = block.sides[3] = block.sides[4] = block.sides[5] = block.getCtmIcon(0, metadata); + } + } + } - boolean flag = renderer.renderStandardBlock(block, x, y, z); + boolean flag = renderer.renderStandardBlock(block, x, y, z); - renderer.uvRotateSouth = 0; - renderer.uvRotateEast = 0; - renderer.uvRotateWest = 0; - renderer.uvRotateNorth = 0; - renderer.uvRotateTop = 0; - renderer.uvRotateBottom = 0; + renderer.uvRotateSouth = 0; + renderer.uvRotateEast = 0; + renderer.uvRotateWest = 0; + renderer.uvRotateNorth = 0; + renderer.uvRotateTop = 0; + renderer.uvRotateBottom = 0; - return flag; - } + return flag; + } - @Override - public boolean shouldRender3DInInventory(int renderId) - { - return true; - } - - @Override - public int getRenderId() - { - return id; - } + @Override + public boolean shouldRender3DInInventory(int renderId) { + return true; + } + @Override + public int getRenderId() { + return id; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/BlockMarbleStairsRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/BlockMarbleStairsRenderer.java index b416a28a..ed77218b 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/BlockMarbleStairsRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/BlockMarbleStairsRenderer.java @@ -12,52 +12,46 @@ import com.cricketcraft.chisel.utils.Drawing; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -public class BlockMarbleStairsRenderer implements ISimpleBlockRenderingHandler -{ - public static int id; +public class BlockMarbleStairsRenderer implements ISimpleBlockRenderingHandler { - public BlockMarbleStairsRenderer() - { - id = RenderingRegistry.getNextAvailableRenderId(); - } + public static int id; - @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); - } + public BlockMarbleStairsRenderer() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) - { - if(blck == null || !(blck instanceof BlockMarbleStairs)) - return false; - BlockMarbleStairs block = (BlockMarbleStairs) blck; + @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); + } - renderer.renderBlockStairs(block, x, y, z); + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) { + if (blck == null || !(blck instanceof BlockMarbleStairs)) + return false; + BlockMarbleStairs block = (BlockMarbleStairs) blck; - return true; - } + renderer.renderBlockStairs(block, x, y, z); - @Override - public boolean shouldRender3DInInventory(int renderId) - { - return true; - } + return true; + } - @Override - public int getRenderId() - { - return id; - } + @Override + public boolean shouldRender3DInInventory(int renderId) { + return true; + } - public int getRenderBlockPass() - { - return 1; - } + @Override + public int getRenderId() { + return id; + } + + public int getRenderBlockPass() { + return 1; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/BlockNoCTMRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/BlockNoCTMRenderer.java index 50994d79..44f45dd1 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/BlockNoCTMRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/BlockNoCTMRenderer.java @@ -11,45 +11,41 @@ import com.cricketcraft.chisel.utils.Drawing; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -public class BlockNoCTMRenderer implements ISimpleBlockRenderingHandler -{ - static int id; +public class BlockNoCTMRenderer implements ISimpleBlockRenderingHandler { - public BlockNoCTMRenderer() - { - id = RenderingRegistry.getNextAvailableRenderId(); - } + static int id; - @Override - public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) - { - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - Drawing.drawBlock(block, meta, renderer); - } + public BlockNoCTMRenderer() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - @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 void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + Drawing.drawBlock(block, meta, renderer); + } - if(meta != 0) renderer.overrideBlockTexture = block.getIcon(0, meta); - renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.overrideBlockTexture = null; + @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); - return false; - } + if (meta != 0) + renderer.overrideBlockTexture = block.getIcon(0, meta); + renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.overrideBlockTexture = null; - @Override - public boolean shouldRender3DInInventory(int renderId) - { - return true; - } + return false; + } - @Override - public int getRenderId() - { - return id; - } + @Override + public boolean shouldRender3DInInventory(int renderId) { + return true; + } + + @Override + public int getRenderId() { + return id; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/BlockRoadLineRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/BlockRoadLineRenderer.java index a9e6325d..7cd2a343 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/BlockRoadLineRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/BlockRoadLineRenderer.java @@ -13,127 +13,111 @@ import com.cricketcraft.chisel.utils.Drawing; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -public class BlockRoadLineRenderer implements ISimpleBlockRenderingHandler -{ - public static int id; +public class BlockRoadLineRenderer implements ISimpleBlockRenderingHandler { - public BlockRoadLineRenderer() - { - id = RenderingRegistry.getNextAvailableRenderId(); - } + public static int id; - @Override - public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) - { - renderer.setRenderBoundsFromBlock(block); - Drawing.drawBlock(block, meta, renderer); - } + public BlockRoadLineRenderer() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - public void renderTopFace(double y, IIcon icon) - { - Tessellator tessellator = Tessellator.instance; + @Override + public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { + renderer.setRenderBoundsFromBlock(block); + Drawing.drawBlock(block, meta, renderer); + } - 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()); - } + public void renderTopFace(double y, IIcon icon) { + 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.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.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + @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; - 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; + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - 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); + 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; - boolean N = world.getBlock(x, y, z - 1).equals(block); - boolean S = world.getBlock(x, y, z + 1).equals(block); - boolean W = world.getBlock(x - 1, y, z).equals(block); - boolean E = world.getBlock(x + 1, y, z).equals(block); + 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(!N && !S && !W && !E) - { - renderer.renderStandardBlock(block, x, y, z); - return true; - } + boolean N = world.getBlock(x, y, z - 1).equals(block); + boolean S = world.getBlock(x, y, z + 1).equals(block); + boolean W = world.getBlock(x - 1, y, z).equals(block); + boolean E = world.getBlock(x + 1, y, z).equals(block); - if(N && S) - { - renderer.uvRotateTop = 0; - renderer.overrideBlockTexture = block.fullLineIcon; - renderer.renderStandardBlock(block, x, y, z); + if (!N && !S && !W && !E) { + renderer.renderStandardBlock(block, x, y, z); + return true; + } - } else - { - if(N) - { - renderer.uvRotateTop = 0; - renderer.overrideBlockTexture = block.halfLineIcon; - renderer.renderStandardBlock(block, x, y, z); - } - if(S) - { - renderer.uvRotateTop = 3; - renderer.overrideBlockTexture = block.halfLineIcon; - renderer.renderStandardBlock(block, x, y, z); - } + if (N && S) { + renderer.uvRotateTop = 0; + renderer.overrideBlockTexture = block.fullLineIcon; + renderer.renderStandardBlock(block, x, y, z); - } + } else { + if (N) { + renderer.uvRotateTop = 0; + renderer.overrideBlockTexture = block.halfLineIcon; + renderer.renderStandardBlock(block, x, y, z); + } + if (S) { + renderer.uvRotateTop = 3; + renderer.overrideBlockTexture = block.halfLineIcon; + renderer.renderStandardBlock(block, x, y, z); + } - if(E && W) - { - renderer.uvRotateTop = 1; - renderer.overrideBlockTexture = block.fullLineIcon; - renderer.renderStandardBlock(block, x, y, z); - } else - { - if(E) - { - renderer.uvRotateTop = 1; - renderer.overrideBlockTexture = block.halfLineIcon; - renderer.renderStandardBlock(block, x, y, z); - } - if(W) - { - renderer.uvRotateTop = 2; - renderer.overrideBlockTexture = block.halfLineIcon; - renderer.renderStandardBlock(block, x, y, z); - } - } + } - renderer.uvRotateTop = 0; - renderer.overrideBlockTexture = null; - return true; - } + if (E && W) { + renderer.uvRotateTop = 1; + renderer.overrideBlockTexture = block.fullLineIcon; + renderer.renderStandardBlock(block, x, y, z); + } else { + if (E) { + renderer.uvRotateTop = 1; + renderer.overrideBlockTexture = block.halfLineIcon; + renderer.renderStandardBlock(block, x, y, z); + } + if (W) { + renderer.uvRotateTop = 2; + renderer.overrideBlockTexture = block.halfLineIcon; + renderer.renderStandardBlock(block, x, y, z); + } + } - @Override - public boolean shouldRender3DInInventory(int renderId) - { - return false; - } + renderer.uvRotateTop = 0; + renderer.overrideBlockTexture = null; + return true; + } - @Override - public int getRenderId() - { - return id; - } + @Override + public boolean shouldRender3DInInventory(int renderId) { + return false; + } + + @Override + public int getRenderId() { + return id; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/BlockSnakeStoneRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/BlockSnakeStoneRenderer.java index 4081d6b8..41b043c3 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/BlockSnakeStoneRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/BlockSnakeStoneRenderer.java @@ -12,129 +12,115 @@ import com.cricketcraft.chisel.utils.Drawing; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -public class BlockSnakeStoneRenderer implements ISimpleBlockRenderingHandler -{ - public static int id; +public class BlockSnakeStoneRenderer implements ISimpleBlockRenderingHandler { - public BlockSnakeStoneRenderer() - { - id = RenderingRegistry.getNextAvailableRenderId(); - } + public static int id; - @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); - } + public BlockSnakeStoneRenderer() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - @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 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); + } - setRenderRotate(renderer, (BlockSnakestone) block, meta); - boolean didRender = renderer.renderStandardBlock(block, x, y, z); - 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); - return didRender; - } + setRenderRotate(renderer, (BlockSnakestone) block, meta); + boolean didRender = renderer.renderStandardBlock(block, x, y, z); + restoreRendererRotate(renderer); - private void restoreRendererRotate(RenderBlocks renderer) - { - renderer.uvRotateSouth = 0; - renderer.uvRotateEast = 0; - renderer.uvRotateWest = 0; - renderer.uvRotateNorth = 0; - renderer.uvRotateTop = 0; - renderer.uvRotateBottom = 0; - } + return didRender; + } - private void setRenderRotate(RenderBlocks renderer, BlockSnakestone block, int meta) - { - int type = meta & 0xC; - int orient = meta & 0x3; + 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; - 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; - } + @Override + public int getRenderId() { + return id; + } } \ No newline at end of file diff --git a/src/main/java/com/cricketcraft/chisel/client/render/BlockTexturedOreRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/BlockTexturedOreRenderer.java index 2719d0e2..0739fb69 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/BlockTexturedOreRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/BlockTexturedOreRenderer.java @@ -13,78 +13,67 @@ import com.cricketcraft.chisel.utils.Drawing; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -public class BlockTexturedOreRenderer implements ISimpleBlockRenderingHandler -{ - float bot = -0.001f, top = 1.0f - bot; - public static int id; +public class BlockTexturedOreRenderer implements ISimpleBlockRenderingHandler { - public BlockTexturedOreRenderer() - { - id = RenderingRegistry.getNextAvailableRenderId(); - } + float bot = -0.001f, top = 1.0f - bot; + public static int id; - @Override - public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) - { - if(blck == null || !(blck instanceof BlockTexturedOre)) - return; + public BlockTexturedOreRenderer() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - BlockTexturedOre block = (BlockTexturedOre) blck; + @Override + public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) { + if (blck == null || !(blck instanceof BlockTexturedOre)) + return; - 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); - } + BlockTexturedOre block = (BlockTexturedOre) blck; - GL11.glEnable(3042); - GL11.glBlendFunc(770, 771); - renderer.setRenderBounds(bot, bot, bot, top, top, top); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - Drawing.drawBlock(block, meta, renderer); - GL11.glDisable(3042); - } + 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); + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) - { - if(blck == null || !(blck instanceof BlockTexturedOre)) - return false; - BlockTexturedOre block = (BlockTexturedOre) blck; + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + renderer.setRenderBounds(bot, bot, bot, top, top, top); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + Drawing.drawBlock(block, meta, renderer); + GL11.glDisable(3042); + } - if(block.currentPass == 0) - { - if(block.icon != null) - { - renderer.overrideBlockTexture = block.icon; - renderer.renderStandardBlock(block, x, y, z); - renderer.overrideBlockTexture = null; - } else if(block.base != null) - { - renderer.renderBlockByRenderType(block.base, x, y, z); - } - } else - { - renderer.setRenderBounds(bot, bot, bot, top, top, top); - renderer.renderStandardBlock(block, x, y, z); - } + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) { + if (blck == null || !(blck instanceof BlockTexturedOre)) + return false; + BlockTexturedOre block = (BlockTexturedOre) blck; - return true; - } + if (block.currentPass == 0) { + if (block.icon != null) { + renderer.overrideBlockTexture = block.icon; + renderer.renderStandardBlock(block, x, y, z); + renderer.overrideBlockTexture = null; + } else if (block.base != null) { + renderer.renderBlockByRenderType(block.base, x, y, z); + } + } else { + renderer.setRenderBounds(bot, bot, bot, top, top, top); + renderer.renderStandardBlock(block, x, y, z); + } - @Override - public boolean shouldRender3DInInventory(int modelId) - { - return true; - } + return true; + } - @Override - public int getRenderId() - { - return id; - } + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return id; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/CTM.java b/src/main/java/com/cricketcraft/chisel/client/render/CTM.java index 9bee8821..293e5d94 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/CTM.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/CTM.java @@ -1,309 +1,236 @@ package com.cricketcraft.chisel.client.render; -import com.cricketcraft.chisel.api.IFacade; import net.minecraft.block.Block; import net.minecraft.world.IBlockAccess; -public class CTM -{ - static int submaps[][] = { - {16, 17, 18, 19}, - {16, 9, 18, 13}, - {8, 9, 12, 13}, - {8, 17, 12, 19}, - {16, 9, 6, 15}, - {8, 17, 14, 7}, - {2, 11, 6, 15}, - {8, 9, 14, 15}, - {10, 1, 14, 15}, - {10, 11, 14, 5}, - {0, 11, 4, 15}, - {0, 1, 14, 15}, - {}, - {}, - {}, - {}, - {16, 17, 6, 7}, - {16, 9, 6, 5}, - {8, 9, 4, 5}, - {8, 17, 4, 7}, - {2, 11, 18, 13}, - {10, 3, 12, 19}, - {10, 11, 12, 13}, - {10, 3, 14, 7}, - {0, 11, 14, 15}, - {10, 11, 4, 15}, - {10, 11, 4, 5}, - {10, 1, 14, 5}, - {}, - {}, - {}, - {}, - {2, 3, 6, 7}, - {2, 1, 6, 5}, - {0, 1, 4, 5}, - {0, 3, 4, 7}, - {2, 11, 6, 5}, - {8, 9, 4, 15}, - {2, 1, 6, 15}, - {8, 9, 14, 5}, - {0, 1, 4, 15}, - {0, 1, 14, 5}, - {10, 1, 4, 15}, - {0, 11, 14, 5}, - {}, - {}, - {}, - {}, - {2, 3, 18, 19}, - {2, 1, 18, 13}, - {0, 1, 12, 13}, - {0, 3, 12, 19}, - {10, 1, 12, 13}, - {0, 3, 14, 7}, - {0, 11, 12, 13}, - {10, 3, 4, 7}, - {0, 11, 4, 5}, - {10, 1, 4, 5}, - {10, 11, 14, 15}, - {0, 1, 4, 5}, - {}, - {}, - {}, - {}, - }; +import com.cricketcraft.chisel.api.IFacade; - public static int[] getSubmapIndices(IBlockAccess world, int x, int y, int z, int side) - { - int index = getTexture(world, x, y, z, side); +public class CTM { - return submaps[index]; - } + static int submaps[][] = { { 16, 17, 18, 19 }, { 16, 9, 18, 13 }, { 8, 9, 12, 13 }, { 8, 17, 12, 19 }, { 16, 9, 6, 15 }, { 8, 17, 14, 7 }, { 2, 11, 6, 15 }, { 8, 9, 14, 15 }, { 10, 1, 14, 15 }, + { 10, 11, 14, 5 }, { 0, 11, 4, 15 }, { 0, 1, 14, 15 }, {}, {}, {}, {}, { 16, 17, 6, 7 }, { 16, 9, 6, 5 }, { 8, 9, 4, 5 }, { 8, 17, 4, 7 }, { 2, 11, 18, 13 }, { 10, 3, 12, 19 }, + { 10, 11, 12, 13 }, { 10, 3, 14, 7 }, { 0, 11, 14, 15 }, { 10, 11, 4, 15 }, { 10, 11, 4, 5 }, { 10, 1, 14, 5 }, {}, {}, {}, {}, { 2, 3, 6, 7 }, { 2, 1, 6, 5 }, { 0, 1, 4, 5 }, + { 0, 3, 4, 7 }, { 2, 11, 6, 5 }, { 8, 9, 4, 15 }, { 2, 1, 6, 15 }, { 8, 9, 14, 5 }, { 0, 1, 4, 15 }, { 0, 1, 14, 5 }, { 10, 1, 4, 15 }, { 0, 11, 14, 5 }, {}, {}, {}, {}, { 2, 3, 18, 19 }, + { 2, 1, 18, 13 }, { 0, 1, 12, 13 }, { 0, 3, 12, 19 }, { 10, 1, 12, 13 }, { 0, 3, 14, 7 }, { 0, 11, 12, 13 }, { 10, 3, 4, 7 }, { 0, 11, 4, 5 }, { 10, 1, 4, 5 }, { 10, 11, 14, 15 }, + { 0, 1, 4, 5 }, {}, {}, {}, {}, }; - public static int getTexture(IBlockAccess world, int x, int y, int z, int side) - { - if(world == null) - return 0; + public static int[] getSubmapIndices(IBlockAccess world, int x, int y, int z, int side) { + int index = getTexture(world, x, y, z, side); - int texture = 0; - Block block = world.getBlock(x, y, z); - int blockMetadata = world.getBlockMetadata(x, y, z); + return submaps[index]; + } - boolean b[] = new boolean[6]; - if(side <= 1) - { - b[0] = isConnected(world, x - 1, y, z, side, block, blockMetadata); - b[1] = isConnected(world, x + 1, y, z, side, block, blockMetadata); - b[2] = isConnected(world, x, y, z + 1, side, block, blockMetadata); - b[3] = isConnected(world, x, y, z - 1, side, block, blockMetadata); - } else if(side == 2) - { - b[0] = isConnected(world, x + 1, y, z, side, block, blockMetadata); - b[1] = isConnected(world, x - 1, y, z, side, block, blockMetadata); - b[2] = isConnected(world, x, y - 1, z, side, block, blockMetadata); - b[3] = isConnected(world, x, y + 1, z, side, block, blockMetadata); - } else if(side == 3) - { - b[0] = isConnected(world, x - 1, y, z, side, block, blockMetadata); - b[1] = isConnected(world, x + 1, y, z, side, block, blockMetadata); - b[2] = isConnected(world, x, y - 1, z, side, block, blockMetadata); - b[3] = isConnected(world, x, y + 1, z, side, block, blockMetadata); - } else if(side == 4) - { - b[0] = isConnected(world, x, y, z - 1, side, block, blockMetadata); - b[1] = isConnected(world, x, y, z + 1, side, block, blockMetadata); - b[2] = isConnected(world, x, y - 1, z, side, block, blockMetadata); - b[3] = isConnected(world, x, y + 1, z, side, block, blockMetadata); - } else if(side == 5) - { - b[0] = isConnected(world, x, y, z + 1, side, block, blockMetadata); - b[1] = isConnected(world, x, y, z - 1, side, block, blockMetadata); - b[2] = isConnected(world, x, y - 1, z, side, block, blockMetadata); - b[3] = isConnected(world, x, y + 1, z, side, block, blockMetadata); - } - if(b[0] & !b[1] & !b[2] & !b[3]) - texture = 3; - else if(!b[0] & b[1] & !b[2] & !b[3]) - texture = 1; - else if(!b[0] & !b[1] & b[2] & !b[3]) - texture = 16; - else if(!b[0] & !b[1] & !b[2] & b[3]) - texture = 48; - else if(b[0] & b[1] & !b[2] & !b[3]) - texture = 2; - else if(!b[0] & !b[1] & b[2] & b[3]) - texture = 32; - else if(b[0] & !b[1] & b[2] & !b[3]) - texture = 19; - else if(b[0] & !b[1] & !b[2] & b[3]) - texture = 51; - else if(!b[0] & b[1] & b[2] & !b[3]) - texture = 17; - else if(!b[0] & b[1] & !b[2] & b[3]) - texture = 49; - else if(!b[0] & b[1] & b[2] & b[3]) - texture = 33; - else if(b[0] & !b[1] & b[2] & b[3]) - texture = 35; - else if(b[0] & b[1] & !b[2] & b[3]) - texture = 50; - else if(b[0] & b[1] & b[2] & !b[3]) - texture = 18; - else if(b[0] & b[1] & b[2] & b[3]) - texture = 34; + public static int getTexture(IBlockAccess world, int x, int y, int z, int side) { + if (world == null) + return 0; - boolean b2[] = new boolean[6]; - if(side <= 1) - { - b2[0] = !isConnected(world, x + 1, y, z + 1, side, block, blockMetadata); - b2[1] = !isConnected(world, x - 1, y, z + 1, side, block, blockMetadata); - b2[2] = !isConnected(world, x + 1, y, z - 1, side, block, blockMetadata); - b2[3] = !isConnected(world, x - 1, y, z - 1, side, block, blockMetadata); - } else if(side == 2) - { - b2[0] = !isConnected(world, x - 1, y - 1, z, side, block, blockMetadata); - b2[1] = !isConnected(world, x + 1, y - 1, z, side, block, blockMetadata); - b2[2] = !isConnected(world, x - 1, y + 1, z, side, block, blockMetadata); - b2[3] = !isConnected(world, x + 1, y + 1, z, side, block, blockMetadata); - } else if(side == 3) - { - b2[0] = !isConnected(world, x + 1, y - 1, z, side, block, blockMetadata); - b2[1] = !isConnected(world, x - 1, y - 1, z, side, block, blockMetadata); - b2[2] = !isConnected(world, x + 1, y + 1, z, side, block, blockMetadata); - b2[3] = !isConnected(world, x - 1, y + 1, z, side, block, blockMetadata); - } else if(side == 4) - { - b2[0] = !isConnected(world, x, y - 1, z + 1, side, block, blockMetadata); - b2[1] = !isConnected(world, x, y - 1, z - 1, side, block, blockMetadata); - b2[2] = !isConnected(world, x, y + 1, z + 1, side, block, blockMetadata); - b2[3] = !isConnected(world, x, y + 1, z - 1, side, block, blockMetadata); - } else if(side == 5) - { - b2[0] = !isConnected(world, x, y - 1, z - 1, side, block, blockMetadata); - b2[1] = !isConnected(world, x, y - 1, z + 1, side, block, blockMetadata); - b2[2] = !isConnected(world, x, y + 1, z - 1, side, block, blockMetadata); - b2[3] = !isConnected(world, x, y + 1, z + 1, side, block, blockMetadata); - } + int texture = 0; + Block block = world.getBlock(x, y, z); + int blockMetadata = world.getBlockMetadata(x, y, z); - if(texture == 17 && b2[0]) - texture = 4; - if(texture == 19 && b2[1]) - texture = 5; - if(texture == 49 && b2[2]) - texture = 20; - if(texture == 51 && b2[3]) - texture = 21; + boolean b[] = new boolean[6]; + if (side <= 1) { + b[0] = isConnected(world, x - 1, y, z, side, block, blockMetadata); + b[1] = isConnected(world, x + 1, y, z, side, block, blockMetadata); + b[2] = isConnected(world, x, y, z + 1, side, block, blockMetadata); + b[3] = isConnected(world, x, y, z - 1, side, block, blockMetadata); + } else if (side == 2) { + b[0] = isConnected(world, x + 1, y, z, side, block, blockMetadata); + b[1] = isConnected(world, x - 1, y, z, side, block, blockMetadata); + b[2] = isConnected(world, x, y - 1, z, side, block, blockMetadata); + b[3] = isConnected(world, x, y + 1, z, side, block, blockMetadata); + } else if (side == 3) { + b[0] = isConnected(world, x - 1, y, z, side, block, blockMetadata); + b[1] = isConnected(world, x + 1, y, z, side, block, blockMetadata); + b[2] = isConnected(world, x, y - 1, z, side, block, blockMetadata); + b[3] = isConnected(world, x, y + 1, z, side, block, blockMetadata); + } else if (side == 4) { + b[0] = isConnected(world, x, y, z - 1, side, block, blockMetadata); + b[1] = isConnected(world, x, y, z + 1, side, block, blockMetadata); + b[2] = isConnected(world, x, y - 1, z, side, block, blockMetadata); + b[3] = isConnected(world, x, y + 1, z, side, block, blockMetadata); + } else if (side == 5) { + b[0] = isConnected(world, x, y, z + 1, side, block, blockMetadata); + b[1] = isConnected(world, x, y, z - 1, side, block, blockMetadata); + b[2] = isConnected(world, x, y - 1, z, side, block, blockMetadata); + b[3] = isConnected(world, x, y + 1, z, side, block, blockMetadata); + } + if (b[0] & !b[1] & !b[2] & !b[3]) + texture = 3; + else if (!b[0] & b[1] & !b[2] & !b[3]) + texture = 1; + else if (!b[0] & !b[1] & b[2] & !b[3]) + texture = 16; + else if (!b[0] & !b[1] & !b[2] & b[3]) + texture = 48; + else if (b[0] & b[1] & !b[2] & !b[3]) + texture = 2; + else if (!b[0] & !b[1] & b[2] & b[3]) + texture = 32; + else if (b[0] & !b[1] & b[2] & !b[3]) + texture = 19; + else if (b[0] & !b[1] & !b[2] & b[3]) + texture = 51; + else if (!b[0] & b[1] & b[2] & !b[3]) + texture = 17; + else if (!b[0] & b[1] & !b[2] & b[3]) + texture = 49; + else if (!b[0] & b[1] & b[2] & b[3]) + texture = 33; + else if (b[0] & !b[1] & b[2] & b[3]) + texture = 35; + else if (b[0] & b[1] & !b[2] & b[3]) + texture = 50; + else if (b[0] & b[1] & b[2] & !b[3]) + texture = 18; + else if (b[0] & b[1] & b[2] & b[3]) + texture = 34; - if(texture == 18 && b2[0] && b2[1]) - texture = 7; - if(texture == 33 && b2[0] && b2[2]) - texture = 6; - if(texture == 35 && b2[3] && b2[1]) - texture = 23; - if(texture == 50 && b2[3] && b2[2]) - texture = 22; + boolean b2[] = new boolean[6]; + if (side <= 1) { + b2[0] = !isConnected(world, x + 1, y, z + 1, side, block, blockMetadata); + b2[1] = !isConnected(world, x - 1, y, z + 1, side, block, blockMetadata); + b2[2] = !isConnected(world, x + 1, y, z - 1, side, block, blockMetadata); + b2[3] = !isConnected(world, x - 1, y, z - 1, side, block, blockMetadata); + } else if (side == 2) { + b2[0] = !isConnected(world, x - 1, y - 1, z, side, block, blockMetadata); + b2[1] = !isConnected(world, x + 1, y - 1, z, side, block, blockMetadata); + b2[2] = !isConnected(world, x - 1, y + 1, z, side, block, blockMetadata); + b2[3] = !isConnected(world, x + 1, y + 1, z, side, block, blockMetadata); + } else if (side == 3) { + b2[0] = !isConnected(world, x + 1, y - 1, z, side, block, blockMetadata); + b2[1] = !isConnected(world, x - 1, y - 1, z, side, block, blockMetadata); + b2[2] = !isConnected(world, x + 1, y + 1, z, side, block, blockMetadata); + b2[3] = !isConnected(world, x - 1, y + 1, z, side, block, blockMetadata); + } else if (side == 4) { + b2[0] = !isConnected(world, x, y - 1, z + 1, side, block, blockMetadata); + b2[1] = !isConnected(world, x, y - 1, z - 1, side, block, blockMetadata); + b2[2] = !isConnected(world, x, y + 1, z + 1, side, block, blockMetadata); + b2[3] = !isConnected(world, x, y + 1, z - 1, side, block, blockMetadata); + } else if (side == 5) { + b2[0] = !isConnected(world, x, y - 1, z - 1, side, block, blockMetadata); + b2[1] = !isConnected(world, x, y - 1, z + 1, side, block, blockMetadata); + b2[2] = !isConnected(world, x, y + 1, z - 1, side, block, blockMetadata); + b2[3] = !isConnected(world, x, y + 1, z + 1, side, block, blockMetadata); + } - if(texture == 18 && !b2[0] && b2[1]) - texture = 39; - if(texture == 33 && b2[0] && !b2[2]) - texture = 38; - if(texture == 35 && !b2[3] && b2[1]) - texture = 53; - if(texture == 50 && b2[3] && !b2[2]) - texture = 52; + if (texture == 17 && b2[0]) + texture = 4; + if (texture == 19 && b2[1]) + texture = 5; + if (texture == 49 && b2[2]) + texture = 20; + if (texture == 51 && b2[3]) + texture = 21; - if(texture == 18 && b2[0] && !b2[1]) - texture = 37; - if(texture == 33 && !b2[0] && b2[2]) - texture = 36; - if(texture == 35 && b2[3] && !b2[1]) - texture = 55; - if(texture == 50 && !b2[3] && b2[2]) - texture = 54; + if (texture == 18 && b2[0] && b2[1]) + texture = 7; + if (texture == 33 && b2[0] && b2[2]) + texture = 6; + if (texture == 35 && b2[3] && b2[1]) + texture = 23; + if (texture == 50 && b2[3] && b2[2]) + texture = 22; + if (texture == 18 && !b2[0] && b2[1]) + texture = 39; + if (texture == 33 && b2[0] && !b2[2]) + texture = 38; + if (texture == 35 && !b2[3] && b2[1]) + texture = 53; + if (texture == 50 && b2[3] && !b2[2]) + texture = 52; - if(texture == 34 && b2[0] && b2[1] && b2[2] && b2[3]) - texture = 58; + if (texture == 18 && b2[0] && !b2[1]) + texture = 37; + if (texture == 33 && !b2[0] && b2[2]) + texture = 36; + if (texture == 35 && b2[3] && !b2[1]) + texture = 55; + if (texture == 50 && !b2[3] && b2[2]) + texture = 54; - if(texture == 34 && !b2[0] && b2[1] && b2[2] && b2[3]) - texture = 9; - if(texture == 34 && b2[0] && !b2[1] && b2[2] && b2[3]) - texture = 25; - if(texture == 34 && b2[0] && b2[1] && !b2[2] && b2[3]) - texture = 8; - if(texture == 34 && b2[0] && b2[1] && b2[2] && !b2[3]) - texture = 24; + if (texture == 34 && b2[0] && b2[1] && b2[2] && b2[3]) + texture = 58; - if(texture == 34 && b2[0] && b2[1] && !b2[2] && !b2[3]) - texture = 11; - if(texture == 34 && !b2[0] && !b2[1] && b2[2] && b2[3]) - texture = 26; - if(texture == 34 && !b2[0] && b2[1] && !b2[2] && b2[3]) - texture = 27; - if(texture == 34 && b2[0] && !b2[1] && b2[2] && !b2[3]) - texture = 10; + if (texture == 34 && !b2[0] && b2[1] && b2[2] && b2[3]) + texture = 9; + if (texture == 34 && b2[0] && !b2[1] && b2[2] && b2[3]) + texture = 25; + if (texture == 34 && b2[0] && b2[1] && !b2[2] && b2[3]) + texture = 8; + if (texture == 34 && b2[0] && b2[1] && b2[2] && !b2[3]) + texture = 24; - if(texture == 34 && b2[0] && !b2[1] && !b2[2] && b2[3]) - texture = 42; - if(texture == 34 && !b2[0] && b2[1] && b2[2] && !b2[3]) - texture = 43; + if (texture == 34 && b2[0] && b2[1] && !b2[2] && !b2[3]) + texture = 11; + if (texture == 34 && !b2[0] && !b2[1] && b2[2] && b2[3]) + texture = 26; + if (texture == 34 && !b2[0] && b2[1] && !b2[2] && b2[3]) + texture = 27; + if (texture == 34 && b2[0] && !b2[1] && b2[2] && !b2[3]) + texture = 10; - if(texture == 34 && b2[0] && !b2[1] && !b2[2] && !b2[3]) - texture = 40; - if(texture == 34 && !b2[0] && b2[1] && !b2[2] && !b2[3]) - texture = 41; - if(texture == 34 && !b2[0] && !b2[1] && b2[2] && !b2[3]) - texture = 56; - if(texture == 34 && !b2[0] && !b2[1] && !b2[2] && b2[3]) - texture = 57; - return texture; - } + if (texture == 34 && b2[0] && !b2[1] && !b2[2] && b2[3]) + texture = 42; + if (texture == 34 && !b2[0] && b2[1] && b2[2] && !b2[3]) + texture = 43; - protected static boolean isConnected(IBlockAccess world, int x, int y, int z, int side, Block block, int meta) - { - int x2 = x, y2 = y, z2 = z; + if (texture == 34 && b2[0] && !b2[1] && !b2[2] && !b2[3]) + texture = 40; + if (texture == 34 && !b2[0] && b2[1] && !b2[2] && !b2[3]) + texture = 41; + if (texture == 34 && !b2[0] && !b2[1] && b2[2] && !b2[3]) + texture = 56; + if (texture == 34 && !b2[0] && !b2[1] && !b2[2] && b2[3]) + texture = 57; + return texture; + } - switch(side) - { - case 0: - y2--; - break; - case 1: - y2++; - break; - case 2: - z2--; - break; - case 3: - z2++; - break; - case 4: - x2--; - break; - case 5: - x2++; - break; - } - if (getBlockOrFacade(world, x2, y2, z2, side) == null || getBlockOrFacade(world, x, y, z, side) == null || block == null) - return false; + protected static boolean isConnected(IBlockAccess world, int x, int y, int z, int side, Block block, int meta) { + int x2 = x, y2 = y, z2 = z; - return getBlockOrFacade(world, x, y, z, side).equals(block) && getBlockOrFacadeMetadata(world, x, y, z, side) == meta && (!getBlockOrFacade(world, x2, y2, z2, side).equals(block) || getBlockOrFacadeMetadata(world, x2, y2, z2, side) != meta); - } + switch (side) { + case 0: + y2--; + break; + case 1: + y2++; + break; + case 2: + z2--; + break; + case 3: + z2++; + break; + case 4: + x2--; + break; + case 5: + x2++; + break; + } + if (getBlockOrFacade(world, x2, y2, z2, side) == null || getBlockOrFacade(world, x, y, z, side) == null || block == null) + return false; - public static int getBlockOrFacadeMetadata(IBlockAccess world, int x, int y, int z, int side) { - Block blk = world.getBlock(x, y, z); - if(blk instanceof IFacade) { - return ((IFacade)blk).getFacadeMetadata(world, x, y, z, side); - } - return world.getBlockMetadata(x, y, z); - } + return getBlockOrFacade(world, x, y, z, side).equals(block) && getBlockOrFacadeMetadata(world, x, y, z, side) == meta + && (!getBlockOrFacade(world, x2, y2, z2, side).equals(block) || getBlockOrFacadeMetadata(world, x2, y2, z2, side) != meta); + } - public static Block getBlockOrFacade(IBlockAccess world, int x, int y, int z, int side) { - Block blk = world.getBlock(x, y, z); - if(blk instanceof IFacade) { - blk = ((IFacade)blk).getFacade(world, x, y, z, side); - } - return blk; - } + public static int getBlockOrFacadeMetadata(IBlockAccess world, int x, int y, int z, int side) { + Block blk = world.getBlock(x, y, z); + if (blk instanceof IFacade) { + return ((IFacade) blk).getFacadeMetadata(world, x, y, z, side); + } + return world.getBlockMetadata(x, y, z); + } + + public static Block getBlockOrFacade(IBlockAccess world, int x, int y, int z, int side) { + Block blk = world.getBlock(x, y, z); + if (blk instanceof IFacade) { + blk = ((IFacade) blk).getFacade(world, x, y, z, side); + } + return blk; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksCTM.java b/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksCTM.java index 1e72abff..4d7e72ff 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksCTM.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksCTM.java @@ -5,423 +5,394 @@ import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.IIcon; -public class RenderBlocksCTM extends RenderBlocks -{ - // globals added to save the JVM some trouble. No need to constantly create and destroy ints if we don't have to - int blockLightBitChannel = 0; - int redBitChannel = 0; - int greenBitChannel = 0; - int blueBitChannel = 0; - int sunlightBitChannel = 0; - - RenderBlocksCTM() - { - super(); - - resetVertices(); - } - - Tessellator tessellator; - double[] X = new double[26]; - double[] Y = new double[26]; - double[] Z = new double[26]; - double[] U = new double[26]; - double[] V = new double[26]; - int[] L = new int[26]; - float[] R = new float[26]; - float[] G = new float[26]; - float[] B = new float[26]; - TextureSubmap submap; - TextureSubmap submapSmall; - RenderBlocks rendererOld; - - int bx, by, bz; - - @Override - public boolean renderStandardBlock(Block block, int x, int y, int z) - { - bx = x; - by = y; - bz = z; - - tessellator = Tessellator.instance; - tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); - - tessellator.addTranslation(x, y, z); - - boolean res = super.renderStandardBlock(block, x, y, z); - - tessellator.addTranslation(-x, -y, -z); - - return res; - } - - void setupSides(int a, int b, int c, int d, int xa, int xb, int xc, int xd, int e) - { - L[a] = brightnessBottomLeft; - L[b] = brightnessBottomRight; - L[c] = brightnessTopRight; - L[d] = brightnessTopLeft; - - // Updated to safely average light and color channels - L[e] = averageBrightnessChannels(brightnessBottomLeft, brightnessTopLeft, brightnessTopRight, brightnessBottomRight); - L[xa] = averageBrightnessChannels(L[a], L[b]); - L[xb] = averageBrightnessChannels(L[b], L[c]); - L[xc] = averageBrightnessChannels(L[c], L[d]); - L[xd] = averageBrightnessChannels(L[d], L[a]); - - R[a] = colorRedBottomLeft; - R[b] = colorRedBottomRight; - R[c] = colorRedTopRight; - R[d] = colorRedTopLeft; - R[e] = (colorRedBottomLeft + colorRedTopLeft + colorRedTopRight + colorRedBottomRight) / 4; - R[xa] = (R[a] + R[b]) / 2; - R[xb] = (R[b] + R[c]) / 2; - R[xc] = (R[c] + R[d]) / 2; - R[xd] = (R[d] + R[a]) / 2; - - G[a] = colorGreenBottomLeft; - G[b] = colorGreenBottomRight; - G[c] = colorGreenTopRight; - G[d] = colorGreenTopLeft; - G[e] = (colorGreenBottomLeft + colorGreenTopLeft + colorGreenTopRight + colorGreenBottomRight) / 4; - G[xa] = (G[a] + G[b]) / 2; - G[xb] = (G[b] + G[c]) / 2; - G[xc] = (G[c] + G[d]) / 2; - G[xd] = (G[d] + G[a]) / 2; - - B[a] = colorBlueBottomLeft; - B[b] = colorBlueBottomRight; - B[c] = colorBlueTopRight; - B[d] = colorBlueTopLeft; - B[e] = (colorBlueBottomLeft + colorBlueTopLeft + colorBlueTopRight + colorBlueBottomRight) / 4; - B[xa] = (B[a] + B[b]) / 2; - B[xb] = (B[b] + B[c]) / 2; - B[xc] = (B[c] + B[d]) / 2; - B[xd] = (B[d] + B[a]) / 2; - } - - /* - * Takes in a variable number of packed light-integers, and computes the average value - * of each 4 bit channel - * - * For vanilla, these look like: - * (S = skylight and L = block light) - * 0000 0000 SSSS 0000 0000 0000 LLLL 0000 - * With the Colored Light Core installed, these look like: - * (B = Blue, G = Green, R = Red) - * 0000 0000 SSSS BBBB GGGG RRRR LLLL 0000 - * - * This method will average all of the values appropriately for the more complex case, - * by separating each color channel into a running total, then it will combine the - * final results together using integer division and a lot of bit-cramming. - * - * While slightly more complex, the runtime should not be drastically effected, and - * the averaging routine remains compatible with vanilla. - * - * Authored: CptSpaceToaster - 12/19/2014 - */ - int averageBrightnessChannels(int ... lightVals) { - blockLightBitChannel = 0; - redBitChannel = 0; - greenBitChannel = 0; - blueBitChannel = 0; - sunlightBitChannel = 0; - - for (int light : lightVals) { - blockLightBitChannel += (light & 0xFF); - redBitChannel += (light & 0xF00); - greenBitChannel += (light & 0xF000); - blueBitChannel += (light & 0xF0000); - sunlightBitChannel += (light & 0xF00000); - } - - return ((blockLightBitChannel/lightVals.length) & 0xFF) | - ((redBitChannel/lightVals.length) & 0xF00) | - ((greenBitChannel/lightVals.length) & 0xF000) | - ((blueBitChannel/lightVals.length) & 0xF0000) | - ((sunlightBitChannel/lightVals.length) & 0xF00000); - } - - void side(int a, int b, int c, int d, int iconIndex, boolean flip) - { - IIcon icon = iconIndex >= 16 ? submapSmall.icons[iconIndex - 16] : submap.icons[iconIndex]; - - double u0 = icon.getMaxU(); - double u1 = icon.getMinU(); - double v0 = icon.getMaxV(); - double v1 = icon.getMinV(); - - U[a] = flip ? u1 : u1; - U[b] = flip ? u0 : u1; - U[c] = flip ? u0 : u0; - U[d] = flip ? u1 : u0; - - V[a] = flip ? v1 : v1; - V[b] = flip ? v1 : v0; - V[c] = flip ? v0 : v0; - V[d] = flip ? v0 : v1; - - vert(a); - vert(b); - vert(c); - vert(d); - } - - 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]); - } - - @Override - public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) - { - if(rendererOld != null && rendererOld.hasOverrideBlockTexture()) - { - IIcon i = rendererOld.overrideBlockTexture; - - tessellator.addVertexWithUV(0.0, 1.0, 0.0, i.getMinU(), i.getMinV()); - tessellator.addVertexWithUV(0.0, 0.0, 0.0, i.getMinU(), i.getMaxV()); - tessellator.addVertexWithUV(0.0, 0.0, 1.0, i.getMaxU(), i.getMaxV()); - tessellator.addVertexWithUV(0.0, 1.0, 1.0, i.getMaxU(), i.getMinV()); - } else - { - int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 4); - - setupSides(1, 0, 4, 5, 14, 19, 17, 23, 9); - side(1, 14, 9, 23, tex[0], false); - side(23, 9, 17, 5, tex[1], false); - side(9, 19, 4, 17, tex[3], false); - side(14, 0, 19, 9, tex[2], false); - } - } - - @Override - public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) - { - if(rendererOld != null && rendererOld.hasOverrideBlockTexture()) - { - IIcon i = rendererOld.overrideBlockTexture; - - tessellator.addVertexWithUV(1.0, 1.0, 1.0, i.getMaxU(), i.getMinV()); - tessellator.addVertexWithUV(1.0, 0.0, 1.0, i.getMaxU(), i.getMaxV()); - tessellator.addVertexWithUV(1.0, 0.0, 0.0, i.getMinU(), i.getMaxV()); - tessellator.addVertexWithUV(1.0, 1.0, 0.0, i.getMinU(), i.getMinV()); - } else - { - int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 5); - - setupSides(3, 2, 6, 7, 15, 25, 16, 21, 11); - side(11, 21, 3, 15, tex[3], false); - side(16, 7, 21, 11, tex[2], false); - side(25, 11, 15, 2, tex[1], false); - side(6, 16, 11, 25, tex[0], false); - } - } - - @Override - public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) - { - if(rendererOld != null && rendererOld.hasOverrideBlockTexture()) - { - IIcon i = rendererOld.overrideBlockTexture; - - tessellator.addVertexWithUV(1.0, 1.0, 0.0, i.getMaxU(), i.getMinV()); - tessellator.addVertexWithUV(1.0, 0.0, 0.0, i.getMaxU(), i.getMaxV()); - tessellator.addVertexWithUV(0.0, 0.0, 0.0, i.getMinU(), i.getMaxV()); - tessellator.addVertexWithUV(0.0, 1.0, 0.0, i.getMinU(), i.getMinV()); - } else - { - int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 2); - - setupSides(2, 3, 0, 1, 15, 18, 14, 22, 8); - side(2, 15, 8, 22, tex[0], false); - side(15, 3, 18, 8, tex[2], false); - side(8, 18, 0, 14, tex[3], false); - side(22, 8, 14, 1, tex[1], false); - } - } - - - @Override - public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) - { - if(rendererOld != null && rendererOld.hasOverrideBlockTexture()) - { - IIcon i = rendererOld.overrideBlockTexture; - - tessellator.addVertexWithUV(0.0, 1.0, 1.0, i.getMinU(), i.getMinV()); - tessellator.addVertexWithUV(0.0, 0.0, 1.0, i.getMinU(), i.getMaxV()); - tessellator.addVertexWithUV(1.0, 0.0, 1.0, i.getMaxU(), i.getMaxV()); - tessellator.addVertexWithUV(1.0, 1.0, 1.0, i.getMaxU(), i.getMinV()); - } else - { - int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 3); - - setupSides(4, 7, 6, 5, 20, 16, 24, 17, 10); - side(17, 4, 20, 10, tex[2], false); - side(5, 17, 10, 24, tex[0], false); - side(24, 10, 16, 6, tex[1], false); - side(10, 20, 7, 16, tex[3], false); - } - } - - @Override - public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) - { - if(rendererOld != null && rendererOld.hasOverrideBlockTexture()) - { - IIcon i = rendererOld.overrideBlockTexture; - - tessellator.addVertexWithUV(0.0, 0.0, 1.0, i.getMinU(), i.getMaxV()); - tessellator.addVertexWithUV(0.0, 0.0, 0.0, i.getMinU(), i.getMinV()); - tessellator.addVertexWithUV(1.0, 0.0, 0.0, i.getMaxU(), i.getMinV()); - tessellator.addVertexWithUV(1.0, 0.0, 1.0, i.getMaxU(), i.getMaxV()); - } else - { - int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 0); - - setupSides(0, 3, 7, 4, 18, 21, 20, 19, 13); - side(13, 21, 7, 20, tex[3], true); - side(19, 13, 20, 4, tex[2], true); - side(0, 18, 13, 19, tex[0], true); - side(18, 3, 21, 13, tex[1], true); - } - } - - @Override - public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) - { - if(rendererOld != null && rendererOld.hasOverrideBlockTexture()) - { - IIcon i = rendererOld.overrideBlockTexture; - - tessellator.addVertexWithUV(0.0, 1.0, 0.0, i.getMinU(), i.getMinV()); - tessellator.addVertexWithUV(0.0, 1.0, 1.0, i.getMinU(), i.getMaxV()); - tessellator.addVertexWithUV(1.0, 1.0, 1.0, i.getMaxU(), i.getMaxV()); - tessellator.addVertexWithUV(1.0, 1.0, 0.0, i.getMaxU(), i.getMinV()); - } else - { - int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 1); - - setupSides(2, 1, 5, 6, 22, 23, 24, 25, 12); - side(12, 24, 6, 25, tex[3], false); - side(22, 12, 25, 2, tex[1], false); - side(1, 23, 12, 22, tex[0], false); - side(23, 5, 24, 12, tex[2], false); - } - } - - void resetVertices() - { - X[0] = 0; - Z[0] = 0; - Y[0] = 0; - - X[1] = 0; - Z[1] = 0; - Y[1] = 1; - - X[2] = 1; - Z[2] = 0; - Y[2] = 1; - - X[3] = 1; - Z[3] = 0; - Y[3] = 0; - - X[4] = 0; - Z[4] = 1; - Y[4] = 0; - - X[5] = 0; - Z[5] = 1; - Y[5] = 1; - - X[6] = 1; - Z[6] = 1; - Y[6] = 1; - - X[7] = 1; - Z[7] = 1; - Y[7] = 0; - - X[8] = 0.5; - Z[8] = 0; - Y[8] = 0.5; - - X[9] = 0; - Z[9] = 0.5; - Y[9] = 0.5; - - X[10] = 0.5; - Z[10] = 1; - Y[10] = 0.5; - - X[11] = 1; - Z[11] = 0.5; - Y[11] = 0.5; - - X[12] = 0.5; - Z[12] = 0.5; - Y[12] = 1; - - X[13] = 0.5; - Z[13] = 0.5; - Y[13] = 0; - - X[14] = 0; - Z[14] = 0; - Y[14] = 0.5; - - X[15] = 1; - Z[15] = 0; - Y[15] = 0.5; - - X[16] = 1; - Z[16] = 1; - Y[16] = 0.5; - - X[17] = 0; - Z[17] = 1; - Y[17] = 0.5; - - X[18] = 0.5; - Z[18] = 0; - Y[18] = 0; - - X[19] = 0; - Z[19] = 0.5; - Y[19] = 0; - - X[20] = 0.5; - Z[20] = 1; - Y[20] = 0; - - X[21] = 1; - Z[21] = 0.5; - Y[21] = 0; - - X[22] = 0.5; - Z[22] = 0; - Y[22] = 1; - - X[23] = 0; - Z[23] = 0.5; - Y[23] = 1; - - X[24] = 0.5; - Z[24] = 1; - Y[24] = 1; - - X[25] = 1; - Z[25] = 0.5; - Y[25] = 1; - } +public class RenderBlocksCTM extends RenderBlocks { + + // globals added to save the JVM some trouble. No need to constantly create + // and destroy ints if we don't have to + int blockLightBitChannel = 0; + int redBitChannel = 0; + int greenBitChannel = 0; + int blueBitChannel = 0; + int sunlightBitChannel = 0; + + RenderBlocksCTM() { + super(); + + resetVertices(); + } + + Tessellator tessellator; + double[] X = new double[26]; + double[] Y = new double[26]; + double[] Z = new double[26]; + double[] U = new double[26]; + double[] V = new double[26]; + int[] L = new int[26]; + float[] R = new float[26]; + float[] G = new float[26]; + float[] B = new float[26]; + TextureSubmap submap; + TextureSubmap submapSmall; + RenderBlocks rendererOld; + + int bx, by, bz; + + @Override + public boolean renderStandardBlock(Block block, int x, int y, int z) { + bx = x; + by = y; + bz = z; + + tessellator = Tessellator.instance; + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + + tessellator.addTranslation(x, y, z); + + boolean res = super.renderStandardBlock(block, x, y, z); + + tessellator.addTranslation(-x, -y, -z); + + return res; + } + + void setupSides(int a, int b, int c, int d, int xa, int xb, int xc, int xd, int e) { + L[a] = brightnessBottomLeft; + L[b] = brightnessBottomRight; + L[c] = brightnessTopRight; + L[d] = brightnessTopLeft; + + // Updated to safely average light and color channels + L[e] = averageBrightnessChannels(brightnessBottomLeft, brightnessTopLeft, brightnessTopRight, brightnessBottomRight); + L[xa] = averageBrightnessChannels(L[a], L[b]); + L[xb] = averageBrightnessChannels(L[b], L[c]); + L[xc] = averageBrightnessChannels(L[c], L[d]); + L[xd] = averageBrightnessChannels(L[d], L[a]); + + R[a] = colorRedBottomLeft; + R[b] = colorRedBottomRight; + R[c] = colorRedTopRight; + R[d] = colorRedTopLeft; + R[e] = (colorRedBottomLeft + colorRedTopLeft + colorRedTopRight + colorRedBottomRight) / 4; + R[xa] = (R[a] + R[b]) / 2; + R[xb] = (R[b] + R[c]) / 2; + R[xc] = (R[c] + R[d]) / 2; + R[xd] = (R[d] + R[a]) / 2; + + G[a] = colorGreenBottomLeft; + G[b] = colorGreenBottomRight; + G[c] = colorGreenTopRight; + G[d] = colorGreenTopLeft; + G[e] = (colorGreenBottomLeft + colorGreenTopLeft + colorGreenTopRight + colorGreenBottomRight) / 4; + G[xa] = (G[a] + G[b]) / 2; + G[xb] = (G[b] + G[c]) / 2; + G[xc] = (G[c] + G[d]) / 2; + G[xd] = (G[d] + G[a]) / 2; + + B[a] = colorBlueBottomLeft; + B[b] = colorBlueBottomRight; + B[c] = colorBlueTopRight; + B[d] = colorBlueTopLeft; + B[e] = (colorBlueBottomLeft + colorBlueTopLeft + colorBlueTopRight + colorBlueBottomRight) / 4; + B[xa] = (B[a] + B[b]) / 2; + B[xb] = (B[b] + B[c]) / 2; + B[xc] = (B[c] + B[d]) / 2; + B[xd] = (B[d] + B[a]) / 2; + } + + /* + * Takes in a variable number of packed light-integers, and computes the + * average value of each 4 bit channel + * + * For vanilla, these look like: (S = skylight and L = block light) 0000 + * 0000 SSSS 0000 0000 0000 LLLL 0000 With the Colored Light Core installed, + * these look like: (B = Blue, G = Green, R = Red) 0000 0000 SSSS BBBB GGGG + * RRRR LLLL 0000 + * + * This method will average all of the values appropriately for the more + * complex case, by separating each color channel into a running total, then + * it will combine the final results together using integer division and a + * lot of bit-cramming. + * + * While slightly more complex, the runtime should not be drastically + * effected, and the averaging routine remains compatible with vanilla. + * + * Authored: CptSpaceToaster - 12/19/2014 + */ + int averageBrightnessChannels(int... lightVals) { + blockLightBitChannel = 0; + redBitChannel = 0; + greenBitChannel = 0; + blueBitChannel = 0; + sunlightBitChannel = 0; + + for (int light : lightVals) { + blockLightBitChannel += (light & 0xFF); + redBitChannel += (light & 0xF00); + greenBitChannel += (light & 0xF000); + blueBitChannel += (light & 0xF0000); + sunlightBitChannel += (light & 0xF00000); + } + + return ((blockLightBitChannel / lightVals.length) & 0xFF) | ((redBitChannel / lightVals.length) & 0xF00) | ((greenBitChannel / lightVals.length) & 0xF000) + | ((blueBitChannel / lightVals.length) & 0xF0000) | ((sunlightBitChannel / lightVals.length) & 0xF00000); + } + + void side(int a, int b, int c, int d, int iconIndex, boolean flip) { + IIcon icon = iconIndex >= 16 ? submapSmall.icons[iconIndex - 16] : submap.icons[iconIndex]; + + double u0 = icon.getMaxU(); + double u1 = icon.getMinU(); + double v0 = icon.getMaxV(); + double v1 = icon.getMinV(); + + U[a] = flip ? u1 : u1; + U[b] = flip ? u0 : u1; + U[c] = flip ? u0 : u0; + U[d] = flip ? u1 : u0; + + V[a] = flip ? v1 : v1; + V[b] = flip ? v1 : v0; + V[c] = flip ? v0 : v0; + V[d] = flip ? v0 : v1; + + vert(a); + vert(b); + vert(c); + vert(d); + } + + 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]); + } + + @Override + public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) { + if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) { + IIcon i = rendererOld.overrideBlockTexture; + + tessellator.addVertexWithUV(0.0, 1.0, 0.0, i.getMinU(), i.getMinV()); + tessellator.addVertexWithUV(0.0, 0.0, 0.0, i.getMinU(), i.getMaxV()); + tessellator.addVertexWithUV(0.0, 0.0, 1.0, i.getMaxU(), i.getMaxV()); + tessellator.addVertexWithUV(0.0, 1.0, 1.0, i.getMaxU(), i.getMinV()); + } else { + int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 4); + + setupSides(1, 0, 4, 5, 14, 19, 17, 23, 9); + side(1, 14, 9, 23, tex[0], false); + side(23, 9, 17, 5, tex[1], false); + side(9, 19, 4, 17, tex[3], false); + side(14, 0, 19, 9, tex[2], false); + } + } + + @Override + public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) { + if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) { + IIcon i = rendererOld.overrideBlockTexture; + + tessellator.addVertexWithUV(1.0, 1.0, 1.0, i.getMaxU(), i.getMinV()); + tessellator.addVertexWithUV(1.0, 0.0, 1.0, i.getMaxU(), i.getMaxV()); + tessellator.addVertexWithUV(1.0, 0.0, 0.0, i.getMinU(), i.getMaxV()); + tessellator.addVertexWithUV(1.0, 1.0, 0.0, i.getMinU(), i.getMinV()); + } else { + int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 5); + + setupSides(3, 2, 6, 7, 15, 25, 16, 21, 11); + side(11, 21, 3, 15, tex[3], false); + side(16, 7, 21, 11, tex[2], false); + side(25, 11, 15, 2, tex[1], false); + side(6, 16, 11, 25, tex[0], false); + } + } + + @Override + public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) { + if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) { + IIcon i = rendererOld.overrideBlockTexture; + + tessellator.addVertexWithUV(1.0, 1.0, 0.0, i.getMaxU(), i.getMinV()); + tessellator.addVertexWithUV(1.0, 0.0, 0.0, i.getMaxU(), i.getMaxV()); + tessellator.addVertexWithUV(0.0, 0.0, 0.0, i.getMinU(), i.getMaxV()); + tessellator.addVertexWithUV(0.0, 1.0, 0.0, i.getMinU(), i.getMinV()); + } else { + int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 2); + + setupSides(2, 3, 0, 1, 15, 18, 14, 22, 8); + side(2, 15, 8, 22, tex[0], false); + side(15, 3, 18, 8, tex[2], false); + side(8, 18, 0, 14, tex[3], false); + side(22, 8, 14, 1, tex[1], false); + } + } + + @Override + public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) { + if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) { + IIcon i = rendererOld.overrideBlockTexture; + + tessellator.addVertexWithUV(0.0, 1.0, 1.0, i.getMinU(), i.getMinV()); + tessellator.addVertexWithUV(0.0, 0.0, 1.0, i.getMinU(), i.getMaxV()); + tessellator.addVertexWithUV(1.0, 0.0, 1.0, i.getMaxU(), i.getMaxV()); + tessellator.addVertexWithUV(1.0, 1.0, 1.0, i.getMaxU(), i.getMinV()); + } else { + int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 3); + + setupSides(4, 7, 6, 5, 20, 16, 24, 17, 10); + side(17, 4, 20, 10, tex[2], false); + side(5, 17, 10, 24, tex[0], false); + side(24, 10, 16, 6, tex[1], false); + side(10, 20, 7, 16, tex[3], false); + } + } + + @Override + public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) { + if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) { + IIcon i = rendererOld.overrideBlockTexture; + + tessellator.addVertexWithUV(0.0, 0.0, 1.0, i.getMinU(), i.getMaxV()); + tessellator.addVertexWithUV(0.0, 0.0, 0.0, i.getMinU(), i.getMinV()); + tessellator.addVertexWithUV(1.0, 0.0, 0.0, i.getMaxU(), i.getMinV()); + tessellator.addVertexWithUV(1.0, 0.0, 1.0, i.getMaxU(), i.getMaxV()); + } else { + int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 0); + + setupSides(0, 3, 7, 4, 18, 21, 20, 19, 13); + side(13, 21, 7, 20, tex[3], true); + side(19, 13, 20, 4, tex[2], true); + side(0, 18, 13, 19, tex[0], true); + side(18, 3, 21, 13, tex[1], true); + } + } + + @Override + public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) { + if (rendererOld != null && rendererOld.hasOverrideBlockTexture()) { + IIcon i = rendererOld.overrideBlockTexture; + + tessellator.addVertexWithUV(0.0, 1.0, 0.0, i.getMinU(), i.getMinV()); + tessellator.addVertexWithUV(0.0, 1.0, 1.0, i.getMinU(), i.getMaxV()); + tessellator.addVertexWithUV(1.0, 1.0, 1.0, i.getMaxU(), i.getMaxV()); + tessellator.addVertexWithUV(1.0, 1.0, 0.0, i.getMaxU(), i.getMinV()); + } else { + int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 1); + + setupSides(2, 1, 5, 6, 22, 23, 24, 25, 12); + side(12, 24, 6, 25, tex[3], false); + side(22, 12, 25, 2, tex[1], false); + side(1, 23, 12, 22, tex[0], false); + side(23, 5, 24, 12, tex[2], false); + } + } + + void resetVertices() { + X[0] = 0; + Z[0] = 0; + Y[0] = 0; + + X[1] = 0; + Z[1] = 0; + Y[1] = 1; + + X[2] = 1; + Z[2] = 0; + Y[2] = 1; + + X[3] = 1; + Z[3] = 0; + Y[3] = 0; + + X[4] = 0; + Z[4] = 1; + Y[4] = 0; + + X[5] = 0; + Z[5] = 1; + Y[5] = 1; + + X[6] = 1; + Z[6] = 1; + Y[6] = 1; + + X[7] = 1; + Z[7] = 1; + Y[7] = 0; + + X[8] = 0.5; + Z[8] = 0; + Y[8] = 0.5; + + X[9] = 0; + Z[9] = 0.5; + Y[9] = 0.5; + + X[10] = 0.5; + Z[10] = 1; + Y[10] = 0.5; + + X[11] = 1; + Z[11] = 0.5; + Y[11] = 0.5; + + X[12] = 0.5; + Z[12] = 0.5; + Y[12] = 1; + + X[13] = 0.5; + Z[13] = 0.5; + Y[13] = 0; + + X[14] = 0; + Z[14] = 0; + Y[14] = 0.5; + + X[15] = 1; + Z[15] = 0; + Y[15] = 0.5; + + X[16] = 1; + Z[16] = 1; + Y[16] = 0.5; + + X[17] = 0; + Z[17] = 1; + Y[17] = 0.5; + + X[18] = 0.5; + Z[18] = 0; + Y[18] = 0; + + X[19] = 0; + Z[19] = 0.5; + Y[19] = 0; + + X[20] = 0.5; + Z[20] = 1; + Y[20] = 0; + + X[21] = 1; + Z[21] = 0.5; + Y[21] = 0; + + X[22] = 0.5; + Z[22] = 0; + Y[22] = 1; + + X[23] = 0; + Z[23] = 0.5; + Y[23] = 1; + + X[24] = 0.5; + Z[24] = 1; + Y[24] = 1; + + X[25] = 1; + Z[25] = 0.5; + Y[25] = 1; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksCTMCarpet.java b/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksCTMCarpet.java index 864c21cc..4d226d3a 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksCTMCarpet.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksCTMCarpet.java @@ -3,47 +3,39 @@ package com.cricketcraft.chisel.client.render; import net.minecraft.block.Block; import net.minecraft.util.IIcon; -public class RenderBlocksCTMCarpet extends RenderBlocksCTM -{ - RenderBlocksCTMCarpet() - { - super(); - } +public class RenderBlocksCTMCarpet extends RenderBlocksCTM { - @Override - void resetVertices() - { - super.resetVertices(); + RenderBlocksCTMCarpet() { + super(); + } - for(int i = 0; i < Y.length; i++) - { - Y[i] /= 16; - } - } + @Override + void resetVertices() { + super.resetVertices(); + for (int i = 0; i < Y.length; i++) { + Y[i] /= 16; + } + } - @Override - public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) - { - rendererOld.renderFaceXNeg(block, 0, 0, 0, submapSmall.icon); - } + @Override + public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) { + rendererOld.renderFaceXNeg(block, 0, 0, 0, submapSmall.icon); + } - @Override - public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) - { - rendererOld.renderFaceXPos(block, 0, 0, 0, submapSmall.icon); - } + @Override + public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) { + rendererOld.renderFaceXPos(block, 0, 0, 0, submapSmall.icon); + } - @Override - public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) - { - rendererOld.renderFaceZNeg(block, 0, 0, 0, submapSmall.icon); - } + @Override + public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) { + rendererOld.renderFaceZNeg(block, 0, 0, 0, submapSmall.icon); + } - @Override - public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) - { - rendererOld.renderFaceZPos(block, 0, 0, 0, submapSmall.icon); - } + @Override + public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) { + rendererOld.renderFaceZPos(block, 0, 0, 0, submapSmall.icon); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksColumn.java b/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksColumn.java index 47cdcd29..0c13c97d 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksColumn.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksColumn.java @@ -5,158 +5,140 @@ import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -public class RenderBlocksColumn extends RenderBlocks -{ - TextureSubmap submap; - IIcon iconTop; - IIcon sides[] = new IIcon[6]; +public class RenderBlocksColumn extends RenderBlocks { - RenderBlocksColumn() - { - super(); - } + TextureSubmap submap; + IIcon iconTop; + IIcon sides[] = new IIcon[6]; - boolean connected(IBlockAccess world, int x, int y, int z, Block block, int meta) - { - return world.getBlock(x, y, z).equals(block) && world.getBlockMetadata(x, y, z) == meta; - } + RenderBlocksColumn() { + super(); + } - @Override - public boolean renderStandardBlock(Block block, int x, int y, int z) - { - int metadata = blockAccess.getBlockMetadata(x, y, z); + boolean connected(IBlockAccess world, int x, int y, int z, Block block, int meta) { + return world.getBlock(x, y, z).equals(block) && world.getBlockMetadata(x, y, z) == meta; + } - boolean yp = connected(blockAccess, x, y + 1, z, block, metadata); - boolean yn = connected(blockAccess, x, y - 1, z, block, metadata); + @Override + public boolean renderStandardBlock(Block block, int x, int y, int z) { + int metadata = blockAccess.getBlockMetadata(x, y, z); - if(yp || yn) - { - sides[0] = iconTop; - sides[1] = iconTop; + boolean yp = connected(blockAccess, x, y + 1, z, block, metadata); + boolean yn = connected(blockAccess, x, y - 1, z, block, metadata); - if(yp && yn) - sides[2] = submap.icons[2]; - else if(yp) - sides[2] = submap.icons[3]; - else - sides[2] = submap.icons[1]; + if (yp || yn) { + sides[0] = iconTop; + sides[1] = iconTop; - sides[3] = sides[4] = sides[5] = sides[2]; - } else - { - boolean xp = connected(blockAccess, x + 1, y, z, block, metadata); - boolean xn = connected(blockAccess, x - 1, y, z, block, metadata); + if (yp && yn) + sides[2] = submap.icons[2]; + else if (yp) + sides[2] = submap.icons[3]; + else + sides[2] = submap.icons[1]; - if(xp && (connected(blockAccess, x + 1, y + 1, z, block, metadata) || connected(blockAccess, x + 1, y - 1, z, block, metadata))) - xp = false; - if(xn && (connected(blockAccess, x - 1, y + 1, z, block, metadata) || connected(blockAccess, x - 1, y - 1, z, block, metadata))) - xn = false; + sides[3] = sides[4] = sides[5] = sides[2]; + } else { + boolean xp = connected(blockAccess, x + 1, y, z, block, metadata); + boolean xn = connected(blockAccess, x - 1, y, z, block, metadata); - if(xp || xn) - { - uvRotateEast = 2; - uvRotateWest = 1; - uvRotateTop = 1; - uvRotateBottom = 1; + if (xp && (connected(blockAccess, x + 1, y + 1, z, block, metadata) || connected(blockAccess, x + 1, y - 1, z, block, metadata))) + xp = false; + if (xn && (connected(blockAccess, x - 1, y + 1, z, block, metadata) || connected(blockAccess, x - 1, y - 1, z, block, metadata))) + xn = false; - sides[4] = iconTop; - sides[5] = iconTop; + if (xp || xn) { + uvRotateEast = 2; + uvRotateWest = 1; + uvRotateTop = 1; + uvRotateBottom = 1; - if(xp && xn) - sides[0] = submap.icons[2]; - else if(xp) - sides[0] = submap.icons[3]; - else - sides[0] = submap.icons[1]; + sides[4] = iconTop; + sides[5] = iconTop; - sides[1] = sides[2] = sides[3] = sides[0]; - } else - { - boolean zp = connected(blockAccess, x, y, z + 1, block, metadata); - boolean zn = connected(blockAccess, x, y, z - 1, block, metadata); + if (xp && xn) + sides[0] = submap.icons[2]; + else if (xp) + sides[0] = submap.icons[3]; + else + sides[0] = submap.icons[1]; - if(zp && (connected(blockAccess, x, y + 1, z + 1, block, metadata) || connected(blockAccess, x, y - 1, z + 1, block, metadata))) - zp = false; - if(zp && (connected(blockAccess, x + 1, y, z + 1, block, metadata) || connected(blockAccess, x - 1, y, z + 1, block, metadata))) - zp = false; - if(zn && (connected(blockAccess, x, y + 1, z - 1, block, metadata) || connected(blockAccess, x, y - 1, z - 1, block, metadata))) - zn = false; - if(zn && (connected(blockAccess, x + 1, y, z - 1, block, metadata) || connected(blockAccess, x - 1, y, z - 1, block, metadata))) - zn = false; + sides[1] = sides[2] = sides[3] = sides[0]; + } else { + boolean zp = connected(blockAccess, x, y, z + 1, block, metadata); + boolean zn = connected(blockAccess, x, y, z - 1, block, metadata); - if(zp || zn) - { - uvRotateSouth = 1; - uvRotateNorth = 2; + if (zp && (connected(blockAccess, x, y + 1, z + 1, block, metadata) || connected(blockAccess, x, y - 1, z + 1, block, metadata))) + zp = false; + if (zp && (connected(blockAccess, x + 1, y, z + 1, block, metadata) || connected(blockAccess, x - 1, y, z + 1, block, metadata))) + zp = false; + if (zn && (connected(blockAccess, x, y + 1, z - 1, block, metadata) || connected(blockAccess, x, y - 1, z - 1, block, metadata))) + zn = false; + if (zn && (connected(blockAccess, x + 1, y, z - 1, block, metadata) || connected(blockAccess, x - 1, y, z - 1, block, metadata))) + zn = false; - sides[2] = iconTop; - sides[3] = iconTop; + if (zp || zn) { + uvRotateSouth = 1; + uvRotateNorth = 2; - if(zp && zn) - sides[0] = submap.icons[2]; - else if(zp) - sides[0] = submap.icons[1]; - else - sides[0] = submap.icons[3]; + sides[2] = iconTop; + sides[3] = iconTop; - sides[1] = sides[4] = sides[5] = sides[0]; - } else - { - sides[0] = sides[1] = iconTop; - sides[2] = sides[3] = sides[4] = sides[5] = submap.icons[0]; - } - } - } + if (zp && zn) + sides[0] = submap.icons[2]; + else if (zp) + sides[0] = submap.icons[1]; + else + sides[0] = submap.icons[3]; + sides[1] = sides[4] = sides[5] = sides[0]; + } else { + sides[0] = sides[1] = iconTop; + sides[2] = sides[3] = sides[4] = sides[5] = submap.icons[0]; + } + } + } - boolean flag = super.renderStandardBlock(block, x, y, z); + boolean flag = super.renderStandardBlock(block, x, y, z); - uvRotateSouth = 0; - uvRotateEast = 0; - uvRotateWest = 0; - uvRotateNorth = 0; - uvRotateTop = 0; - uvRotateBottom = 0; + uvRotateSouth = 0; + uvRotateEast = 0; + uvRotateWest = 0; + uvRotateNorth = 0; + uvRotateTop = 0; + uvRotateBottom = 0; - return flag; - } + return flag; + } + @Override + public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceXNeg(block, x, y, z, sides[4]); + } - @Override - public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) - { - super.renderFaceXNeg(block, x, y, z, sides[4]); - } + @Override + public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceXPos(block, x, y, z, sides[5]); + } - @Override - public void renderFaceXPos(Block block, double x, double y, double z, IIcon icon) - { - super.renderFaceXPos(block, x, y, z, sides[5]); - } + @Override + public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceZNeg(block, x, y, z, sides[2]); + } - @Override - public void renderFaceZNeg(Block block, double x, double y, double z, IIcon icon) - { - super.renderFaceZNeg(block, x, y, z, sides[2]); - } + @Override + public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceZPos(block, x, y, z, sides[3]); + } + @Override + public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceYNeg(block, x, y, z, sides[0]); + } - @Override - public void renderFaceZPos(Block block, double x, double y, double z, IIcon icon) - { - super.renderFaceZPos(block, x, y, z, sides[3]); - } - - @Override - public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon) - { - super.renderFaceYNeg(block, x, y, z, sides[0]); - } - - @Override - public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) - { - super.renderFaceYPos(block, x, y, z, sides[1]); - } + @Override + public void renderFaceYPos(Block block, double x, double y, double z, IIcon icon) { + super.renderFaceYPos(block, x, y, z, sides[1]); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksEldritch.java b/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksEldritch.java index 2bb5e69c..c8e82e0c 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksEldritch.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/RenderBlocksEldritch.java @@ -5,324 +5,290 @@ import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.IIcon; -public class RenderBlocksEldritch extends RenderBlocks -{ +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 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 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); - - 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/com/cricketcraft/chisel/client/render/TextureSubmap.java b/src/main/java/com/cricketcraft/chisel/client/render/TextureSubmap.java index dc270563..cb3e81b0 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/TextureSubmap.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/TextureSubmap.java @@ -5,33 +5,29 @@ import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -public class TextureSubmap -{ - public int width, height; - public IIcon icon; - public IIcon icons[]; +public class TextureSubmap { - public TextureSubmap(IIcon i, int w, int h) - { - icon = i; - width = w; - height = h; - icons = new IIcon[width * height]; + public int width, height; + public IIcon icon; + public IIcon icons[]; - MinecraftForge.EVENT_BUS.register(this); - } + public TextureSubmap(IIcon i, int w, int h) { + icon = i; + width = w; + height = h; + icons = new IIcon[width * height]; - @SubscribeEvent - public void TexturesStitched(TextureStitchEvent.Post event) - { + MinecraftForge.EVENT_BUS.register(this); + } - for(int x = 0; x < width; x++) - { - for(int y = 0; y < height; y++) - { - icons[y * width + x] = new TextureVirtual(icon, width, height, x, y); - } - } - } + @SubscribeEvent + public void TexturesStitched(TextureStitchEvent.Post event) { + + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + icons[y * width + x] = new TextureVirtual(icon, width, height, x, y); + } + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/TextureVirtual.java b/src/main/java/com/cricketcraft/chisel/client/render/TextureVirtual.java index 827f01c2..15b81e5a 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/TextureVirtual.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/TextureVirtual.java @@ -4,89 +4,79 @@ import net.minecraft.util.IIcon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class TextureVirtual implements IIcon -{ - int ox, oy; - float u0, u1, v0, v1; - String name; - IIcon icon; +public class TextureVirtual implements IIcon { - TextureVirtual(IIcon parent, int w, int h, int x, int y) - { - icon = parent; + int ox, oy; + float u0, u1, v0, v1; + String name; + IIcon icon; - u0 = icon.getInterpolatedU(16.0 * (x) / w); - u1 = icon.getInterpolatedU(16.0 * (x + 1) / w); - v0 = icon.getInterpolatedV(16.0 * (y) / h); - v1 = icon.getInterpolatedV(16.0 * (y + 1) / h); + TextureVirtual(IIcon parent, int w, int h, int x, int y) { + icon = parent; - name = icon.getIconName() + "|" + x + "." + y; + u0 = icon.getInterpolatedU(16.0 * (x) / w); + u1 = icon.getInterpolatedU(16.0 * (x + 1) / w); + v0 = icon.getInterpolatedV(16.0 * (y) / h); + v1 = icon.getInterpolatedV(16.0 * (y + 1) / h); - ox = icon.getIconWidth(); - oy = icon.getIconHeight(); - } + name = icon.getIconName() + "|" + x + "." + y; - @Override - @SideOnly(Side.CLIENT) - public float getMinU() - { - return u0; - } + ox = icon.getIconWidth(); + oy = icon.getIconHeight(); + } - @Override - @SideOnly(Side.CLIENT) - public float getMaxU() - { - return u1; - } + @Override + @SideOnly(Side.CLIENT) + public float getMinU() { + return u0; + } - @Override - @SideOnly(Side.CLIENT) - public float getInterpolatedU(double d0) - { - return (float) (u0 + (u1 - u0) * d0 / 16.0); - } + @Override + @SideOnly(Side.CLIENT) + public float getMaxU() { + return u1; + } - @Override - @SideOnly(Side.CLIENT) - public float getMinV() - { - return v0; - } + @Override + @SideOnly(Side.CLIENT) + public float getInterpolatedU(double d0) { + return (float) (u0 + (u1 - u0) * d0 / 16.0); + } - @Override - @SideOnly(Side.CLIENT) - public float getMaxV() - { - return v1; - } + @Override + @SideOnly(Side.CLIENT) + public float getMinV() { + return v0; + } - @Override - @SideOnly(Side.CLIENT) - public float getInterpolatedV(double d0) - { - return (float) (v0 + (v1 - v0) * d0 / 16.0); - } + @Override + @SideOnly(Side.CLIENT) + public float getMaxV() { + return v1; + } - @Override - @SideOnly(Side.CLIENT) - public String getIconName() - { - return name; - } + @Override + @SideOnly(Side.CLIENT) + public float getInterpolatedV(double d0) { + return (float) (v0 + (v1 - v0) * d0 / 16.0); + } - @Override - @SideOnly(Side.CLIENT) - public int getIconWidth() - { - return ox; - } + @Override + @SideOnly(Side.CLIENT) + public String getIconName() { + return name; + } - @Override - @SideOnly(Side.CLIENT) - public int getIconHeight() - { - return oy; - } + @Override + @SideOnly(Side.CLIENT) + public int getIconWidth() { + return ox; + } + + @Override + @SideOnly(Side.CLIENT) + public int getIconHeight() { + return oy; + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/item/ItemAutoChiselRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/item/ItemAutoChiselRenderer.java index a7557526..a76ce31d 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/item/ItemAutoChiselRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/item/ItemAutoChiselRenderer.java @@ -10,74 +10,74 @@ import com.cricketcraft.chisel.client.model.ModelAutoChisel; import cpw.mods.fml.client.FMLClientHandler; -public class ItemAutoChiselRenderer implements IItemRenderer{ +public class ItemAutoChiselRenderer implements IItemRenderer { - private final ModelAutoChisel model = new ModelAutoChisel(); - private ResourceLocation texture; + private final ModelAutoChisel model = new ModelAutoChisel(); + private ResourceLocation texture; - @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) { - switch (item.getItemDamage()){ - case 0: - texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel.png"); - break; - case 1: - texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_speed.png"); - break; - case 2: - texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_automation.png"); - break; - case 3: - texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_stack.png"); - break; - default: - texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel.png"); - break; - } - FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture); - 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(0.0F, 0.625F, 0.0F); - break; - default: - break; - } - } + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + switch (item.getItemDamage()) { + case 0: + texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel.png"); + break; + case 1: + texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_speed.png"); + break; + case 2: + texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_automation.png"); + break; + case 3: + texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_stack.png"); + break; + default: + texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel.png"); + break; + } + FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture); + 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(0.0F, 0.625F, 0.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); - model.renderAll(); - GL11.glPopMatrix(); - } + private void renderBlock(float x, float y, float z) { + GL11.glPushMatrix(); + GL11.glTranslatef(x, y, z); + GL11.glScaled(-1, -1, 1); + model.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(0.8F, 0.8F, 0.8F); - model.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(0.8F, 0.8F, 0.8F); + model.renderAll(); + GL11.glPopMatrix(); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/item/ItemChiselRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/item/ItemChiselRenderer.java index a7ffdb37..3e5e4f47 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/item/ItemChiselRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/item/ItemChiselRenderer.java @@ -9,42 +9,41 @@ import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; -public class ItemChiselRenderer implements IItemRenderer -{ - RenderBlocks renderBlock = new RenderBlocks(); - RenderItem renderItem = new RenderItem(); +public class ItemChiselRenderer implements IItemRenderer { - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) - { - return type == IItemRenderer.ItemRenderType.INVENTORY; - } + RenderBlocks renderBlock = new RenderBlocks(); + RenderItem renderItem = new RenderItem(); - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return false; - } + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + return type == IItemRenderer.ItemRenderType.INVENTORY; + } - @Override - public void renderItem(ItemRenderType type, ItemStack stack, Object... data) - { - RenderHelper.enableGUIStandardItemLighting(); + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return false; + } - renderItem.renderItemIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().renderEngine, stack, 0, 0); + @Override + public void renderItem(ItemRenderType type, ItemStack stack, Object... data) { + RenderHelper.enableGUIStandardItemLighting(); - if(stack.stackTagCompound == null) return; + renderItem.renderItemIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().renderEngine, stack, 0, 0); - ItemStack chiselTarget = ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("chiselTarget")); - if(chiselTarget == null) return; + if (stack.stackTagCompound == null) + return; - GL11.glPushMatrix(); - 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) + return; - renderItem.renderItemIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().renderEngine, chiselTarget, 8, 8); + GL11.glPushMatrix(); + GL11.glScalef(0.65f, 0.65f, 0.65f); + GL11.glTranslatef(-8f, -8f, 0.0f); - GL11.glPopMatrix(); - } + renderItem.renderItemIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().renderEngine, chiselTarget, 8, 8); + + GL11.glPopMatrix(); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/item/ItemPresentRenderer.java b/src/main/java/com/cricketcraft/chisel/client/render/item/ItemPresentRenderer.java index a1c97ce1..bd629928 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/item/ItemPresentRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/item/ItemPresentRenderer.java @@ -1,68 +1,74 @@ package com.cricketcraft.chisel.client.render.item; -import com.cricketcraft.chisel.Chisel; -import com.cricketcraft.chisel.block.BlockPresent; -import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.client.model.ModelChest; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import com.cricketcraft.chisel.Chisel; +import com.cricketcraft.chisel.block.BlockPresent; + +import cpw.mods.fml.client.FMLClientHandler; + public class ItemPresentRenderer implements IItemRenderer { - private final ModelChest model = new ModelChest(); - BlockPresent present; - private int meta; - public ItemPresentRenderer(int type){ - present = new BlockPresent(type); - this.meta = type; - } - @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; - } + private final ModelChest model = new ModelChest(); + BlockPresent present; + private int meta; - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Chisel.MOD_ID, present.getKindOfChest(meta) + ".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; - } - } + public ItemPresentRenderer(int type) { + present = new BlockPresent(type); + this.meta = type; + } - private void renderBlock(float x, float y, float z) { - GL11.glPushMatrix(); - GL11.glTranslatef(x, y, z); - GL11.glScaled(-1, -1, 1); - model.renderAll(); - GL11.glPopMatrix(); - } + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + return type != ItemRenderType.FIRST_PERSON_MAP; + } - 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); - model.renderAll(); - GL11.glPopMatrix(); - } + @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, present.getKindOfChest(meta) + ".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); + model.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); + model.renderAll(); + GL11.glPopMatrix(); + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderAutoChisel.java b/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderAutoChisel.java index 0532e507..9d967de0 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderAutoChisel.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderAutoChisel.java @@ -1,10 +1,5 @@ package com.cricketcraft.chisel.client.render.tile; -import static org.lwjgl.opengl.GL11.glPopMatrix; -import static org.lwjgl.opengl.GL11.glPushMatrix; -import static org.lwjgl.opengl.GL11.glRotatef; -import static org.lwjgl.opengl.GL11.glScalef; -import static org.lwjgl.opengl.GL11.glTranslatef; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -22,108 +17,111 @@ import com.cricketcraft.chisel.client.model.ModelAutoChisel; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import static org.lwjgl.opengl.GL11.*; + public class RenderAutoChisel extends TileEntitySpecialRenderer { - private static EntityItem ghostItem; - private static TileEntityAutoChisel autoChisel; - private final ModelAutoChisel model; - private ResourceLocation texture; - private final RenderItem renderTargetAndChisel, renderBase; + private static EntityItem ghostItem; + private static TileEntityAutoChisel autoChisel; + private final ModelAutoChisel model; + private ResourceLocation texture; + private final RenderItem renderTargetAndChisel, renderBase; - public RenderAutoChisel(){ - model = new ModelAutoChisel(); - renderTargetAndChisel = new RenderItem(){ - @Override - public boolean shouldBob(){ - return false; - } - }; - renderTargetAndChisel.setRenderManager(RenderManager.instance); + public RenderAutoChisel() { + model = new ModelAutoChisel(); + renderTargetAndChisel = new RenderItem() { - renderBase = new RenderItem(){ - @Override - public boolean shouldBob(){ - return true; - } - }; + @Override + public boolean shouldBob() { + return false; + } + }; + renderTargetAndChisel.setRenderManager(RenderManager.instance); - renderBase.setRenderManager(RenderManager.instance); - } + renderBase = new RenderItem() { - @Override - public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float scale) { - switch (tile.getBlockMetadata()){ - case 0: - texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel.png"); - break; - case 1: - texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_speed.png"); - break; - case 2: - texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_automation.png"); - break; - case 3: - texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_stack.png"); - break; - default: - texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel.png"); - break; - } - bindTexture(texture); - glPushMatrix(); - glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - glRotatef(180F, 0.0F, 0.0F, 1.0F); - glScalef(0.89F, 1.0F, 0.89F); - this.model.renderAll(); - glPopMatrix(); + @Override + public boolean shouldBob() { + return true; + } + }; - //Render Blocks - autoChisel = (TileEntityAutoChisel) tile; - EntityItem item = autoChisel.getItemForRendering(1); + renderBase.setRenderManager(RenderManager.instance); + } - if(item != null){ - GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); - GL11.glScaled(3, 3, 3); - renderTargetAndChisel.doRender(item, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float scale) { + switch (tile.getBlockMetadata()) { + case 0: + texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel.png"); + break; + case 1: + texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_speed.png"); + break; + case 2: + texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_automation.png"); + break; + case 3: + texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel_stack.png"); + break; + default: + texture = new ResourceLocation("chisel:textures/blocks/autoChisel/autoChisel.png"); + break; + } + bindTexture(texture); + glPushMatrix(); + glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); + glRotatef(180F, 0.0F, 0.0F, 1.0F); + glScalef(0.89F, 1.0F, 0.89F); + this.model.renderAll(); + glPopMatrix(); - EntityItem item2 = autoChisel.getItemForRendering(0); + // Render Blocks + autoChisel = (TileEntityAutoChisel) tile; + EntityItem item = autoChisel.getItemForRendering(1); - if(item2 != null){ - GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5); - GL11.glScaled(1, 1, 1); - renderBase.doRender(item2, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } + if (item != null) { + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); + GL11.glScaled(3, 3, 3); + renderTargetAndChisel.doRender(item, 0, 0, 0, 0, 0); + GL11.glPopMatrix(); + } - /*EntityItem chisel = getGhostItem(autoChisel.getWorldObj(), new ItemStack(ModItems.chisel)); + EntityItem item2 = autoChisel.getItemForRendering(0); - if(chisel != null){ - GL11.glPushMatrix(); - GL11.glTranslated(x + 1.5, y + 1.5, z + 1.5); - GL11.glScaled(1, 1, 1); - renderTargetAndChisel.doRender(chisel, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - }*/ - } + if (item2 != null) { + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5); + GL11.glScaled(1, 1, 1); + renderBase.doRender(item2, 0, 0, 0, 0, 0); + GL11.glPopMatrix(); + } - @SideOnly(Side.CLIENT) - public EntityItem getGhostItem(World world, ItemStack itemStack){ - if(ghostItem == null){ - ghostItem = new EntityItem(world); - ghostItem.hoverStart = 0.0F; - } + /* + * EntityItem chisel = getGhostItem(autoChisel.getWorldObj(), new + * ItemStack(ModItems.chisel)); + * + * if(chisel != null){ GL11.glPushMatrix(); GL11.glTranslated(x + 1.5, y + * + 1.5, z + 1.5); GL11.glScaled(1, 1, 1); + * renderTargetAndChisel.doRender(chisel, 0, 0, 0, 0, 0); + * GL11.glPopMatrix(); } + */ + } - if(itemStack == null){ - return null; - } else { - ghostItem.setEntityItemStack(itemStack); - return ghostItem; - } - } + @SideOnly(Side.CLIENT) + public EntityItem getGhostItem(World world, ItemStack itemStack) { + if (ghostItem == null) { + ghostItem = new EntityItem(world); + ghostItem.hoverStart = 0.0F; + } + if (itemStack == null) { + return null; + } else { + ghostItem.setEntityItemStack(itemStack); + return ghostItem; + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderPresent.java b/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderPresent.java index 677d1bb5..59d8bac5 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderPresent.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderPresent.java @@ -1,122 +1,126 @@ package com.cricketcraft.chisel.client.render.tile; -import com.cricketcraft.chisel.Chisel; -import com.cricketcraft.chisel.block.BlockPresent; -import com.cricketcraft.chisel.block.tileentity.TileEntityPresent; -import cpw.mods.fml.common.FMLLog; import net.minecraft.block.Block; import net.minecraft.client.model.ModelChest; import net.minecraft.client.model.ModelLargeChest; import net.minecraft.client.renderer.tileentity.TileEntityChestRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import com.cricketcraft.chisel.Chisel; +import com.cricketcraft.chisel.block.BlockPresent; +import com.cricketcraft.chisel.block.tileentity.TileEntityPresent; + +import cpw.mods.fml.common.FMLLog; + public class RenderPresent extends TileEntityChestRenderer { - private ModelChest smallChest = new ModelChest(); - private ModelChest largeChest = new ModelLargeChest(); - public RenderPresent() { - } + private ModelChest smallChest = new ModelChest(); + private ModelChest largeChest = new ModelLargeChest(); - public void renderTileEntityAt(TileEntityPresent present, double x, double y, double z, float partialTicks) { - int i; + public RenderPresent() { + } - if (!present.hasWorldObj()) { - i = 0; - } else { - Block block = present.getBlockType(); - i = present.getBlockMetadata(); + public void renderTileEntityAt(TileEntityPresent present, double x, double y, double z, float partialTicks) { + int i; - if (block instanceof BlockPresent && i == 0) { - try { - ((BlockPresent) block).func_149954_e(present.getWorldObj(), present.xCoord, present.yCoord, present.zCoord); - } catch (ClassCastException e) { - FMLLog.severe("[Chisel 2] Attempted to render a present at %d, %d, %d that was not a present", present.xCoord, present.yCoord, present.zCoord); - } - i = present.getBlockMetadata(); - } + if (!present.hasWorldObj()) { + i = 0; + } else { + Block block = present.getBlockType(); + i = present.getBlockMetadata(); - present.checkForAdjacentChests(); - } + if (block instanceof BlockPresent && i == 0) { + try { + ((BlockPresent) block).func_149954_e(present.getWorldObj(), present.xCoord, present.yCoord, present.zCoord); + } catch (ClassCastException e) { + FMLLog.severe("[Chisel 2] Attempted to render a present at %d, %d, %d that was not a present", present.xCoord, present.yCoord, present.zCoord); + } + i = present.getBlockMetadata(); + } - if (present.adjacentChestZNeg == null && present.adjacentChestXNeg == null) { - BlockPresent blockPresent = (BlockPresent) present.getWorldObj().getBlock(present.xCoord, present.yCoord, present.zCoord); - ModelChest smallOrLargeChest; - if (present.adjacentChestZPos == null && present.adjacentChestXPos == null) { - smallOrLargeChest = smallChest; - this.bindTexture(new ResourceLocation(Chisel.MOD_ID, blockPresent.getKindOfChest(present.type) + ".png")); - } else { - smallOrLargeChest = largeChest; - this.bindTexture(new ResourceLocation(Chisel.MOD_ID, blockPresent.getKindOfChest(present.type) + "_double.png")); - } + present.checkForAdjacentChests(); + } - 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); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - short short1 = 0; + if (present.adjacentChestZNeg == null && present.adjacentChestXNeg == null) { + BlockPresent blockPresent = (BlockPresent) present.getWorldObj().getBlock(present.xCoord, present.yCoord, present.zCoord); + ModelChest smallOrLargeChest; + if (present.adjacentChestZPos == null && present.adjacentChestXPos == null) { + smallOrLargeChest = smallChest; + this.bindTexture(new ResourceLocation(Chisel.MOD_ID, blockPresent.getKindOfChest(present.type) + ".png")); + } else { + smallOrLargeChest = largeChest; + this.bindTexture(new ResourceLocation(Chisel.MOD_ID, blockPresent.getKindOfChest(present.type) + "_double.png")); + } - if (i == 2) { - short1 = 180; - } + 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); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + short short1 = 0; - if (i == 3) { - short1 = 0; - } + if (i == 2) { + short1 = 180; + } - if (i == 4) { - short1 = 90; - } + if (i == 3) { + short1 = 0; + } - if (i == 5) { - short1 = -90; - } + if (i == 4) { + short1 = 90; + } - if (i == 2 && present.adjacentChestXPos != null) { - GL11.glTranslatef(1.0F, 0.0F, 0.0F); - } + if (i == 5) { + short1 = -90; + } - if (i == 5 && present.adjacentChestZPos != null) { - GL11.glTranslatef(0.0F, 0.0F, -1.0F); - } + if (i == 2 && present.adjacentChestXPos != null) { + GL11.glTranslatef(1.0F, 0.0F, 0.0F); + } - GL11.glRotatef((float) short1, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - float f1 = present.prevLidAngle + (present.lidAngle - present.prevLidAngle) * partialTicks; - float f2; + if (i == 5 && present.adjacentChestZPos != null) { + GL11.glTranslatef(0.0F, 0.0F, -1.0F); + } - if (present.adjacentChestZNeg != null) { - f2 = present.adjacentChestZNeg.prevLidAngle + (present.adjacentChestZNeg.lidAngle - present.adjacentChestZNeg.prevLidAngle) * partialTicks; + GL11.glRotatef(short1, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + float f1 = present.prevLidAngle + (present.lidAngle - present.prevLidAngle) * partialTicks; + float f2; - if (f2 > f1) { - f1 = f2; - } - } + if (present.adjacentChestZNeg != null) { + f2 = present.adjacentChestZNeg.prevLidAngle + (present.adjacentChestZNeg.lidAngle - present.adjacentChestZNeg.prevLidAngle) * partialTicks; - if (present.adjacentChestXNeg != null) { - f2 = present.adjacentChestXNeg.prevLidAngle + (present.adjacentChestXNeg.lidAngle - present.adjacentChestXNeg.prevLidAngle) * partialTicks; + if (f2 > f1) { + f1 = f2; + } + } - if (f2 > f1) { - f1 = f2; - } - } + if (present.adjacentChestXNeg != null) { + f2 = present.adjacentChestXNeg.prevLidAngle + (present.adjacentChestXNeg.lidAngle - present.adjacentChestXNeg.prevLidAngle) * partialTicks; - f1 = 1.0F - f1; - f1 = 1.0F - f1 * f1 * f1; - smallOrLargeChest.chestLid.rotateAngleX = -(f1 * (float) Math.PI / 2.0F); - smallOrLargeChest.renderAll(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - } + if (f2 > f1) { + f1 = f2; + } + } - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) { - this.renderTileEntityAt((TileEntityPresent) tileEntity, x, y, z, partialTicks); - } + f1 = 1.0F - f1; + f1 = 1.0F - f1 * f1 * f1; + smallOrLargeChest.chestLid.rotateAngleX = -(f1 * (float) Math.PI / 2.0F); + smallOrLargeChest.renderAll(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) { + this.renderTileEntityAt((TileEntityPresent) tileEntity, x, y, z, partialTicks); + } } diff --git a/src/main/java/com/cricketcraft/chisel/compat/Compatibility.java b/src/main/java/com/cricketcraft/chisel/compat/Compatibility.java index 15b36cd2..bd52e7f5 100644 --- a/src/main/java/com/cricketcraft/chisel/compat/Compatibility.java +++ b/src/main/java/com/cricketcraft/chisel/compat/Compatibility.java @@ -6,30 +6,27 @@ import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; -public class Compatibility -{ - public static void init(FMLPostInitializationEvent event) - { - new MarbleCompatibility().postInit(event); +public class Compatibility { - addSupport("ProjRed|Exploration", "projectred.exploration.stone", "marble", 0, 99); - addSupport("bluepower", "marble", "marble", 0, 99); - - 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); - } + public static void init(FMLPostInitializationEvent event) { + new MarbleCompatibility().postInit(event); - public static void addSupport(String modname, String blockname, String name, int metadata, int order) - { - if(Loader.isModLoaded(modname) && GameRegistry.findBlock(modname, blockname) != null) - { - Carving.chisel.addVariation(name, GameRegistry.findBlock(modname, blockname), metadata, order); - } - } + addSupport("ProjRed|Exploration", "projectred.exploration.stone", "marble", 0, 99); + addSupport("bluepower", "marble", "marble", 0, 99); + + 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); + } + + public static void addSupport(String modname, String blockname, String name, int metadata, int order) { + if (Loader.isModLoaded(modname) && GameRegistry.findBlock(modname, blockname) != null) { + Carving.chisel.addVariation(name, GameRegistry.findBlock(modname, blockname), metadata, order); + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/compat/FMPIntegration.java b/src/main/java/com/cricketcraft/chisel/compat/FMPIntegration.java index 6f44ad6a..ae39b2a0 100644 --- a/src/main/java/com/cricketcraft/chisel/compat/FMPIntegration.java +++ b/src/main/java/com/cricketcraft/chisel/compat/FMPIntegration.java @@ -1,99 +1,103 @@ package com.cricketcraft.chisel.compat; -import com.cricketcraft.chisel.compat.ModIntegration.IModIntegration; -import com.cricketcraft.chisel.init.ModBlocks; -import cpw.mods.fml.common.event.FMLInterModComms; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -public class FMPIntegration implements IModIntegration{ - @Override - public String getModId(){ - return "ForgeMicroblock"; - } +import com.cricketcraft.chisel.compat.ModIntegration.IModIntegration; +import com.cricketcraft.chisel.init.ModBlocks; - @Override - public void onInit(){ - registerMaterial(ModBlocks.marble); - registerMaterial(ModBlocks.limestone); - registerMaterial(ModBlocks.cobblestone, 1, 15); - registerMaterial(ModBlocks.glass, 1, 15); - registerMaterial(ModBlocks.sandstone, 3, 15); - registerMaterial(ModBlocks.sandSnakestone, 1, 1); - registerMaterial(ModBlocks.sandSnakestone, 13, 13); - registerMaterial(ModBlocks.sandstoneScribbles); - registerMaterial(ModBlocks.concrete, 0, 10); - registerMaterial(ModBlocks.iron, 1, 15); - registerMaterial(ModBlocks.gold, 1, 14); - registerMaterial(ModBlocks.diamond, 1, 12); - registerMaterial(ModBlocks.lightstone, 1, 15); //This is glowstone - registerMaterial(ModBlocks.lapis, 1, 8); - registerMaterial(ModBlocks.emerald, 1, 11); - registerMaterial(ModBlocks.netherBrick, 1, 5); - registerMaterial(ModBlocks.netherrack, 1, 14); - registerMaterial(ModBlocks.cobblestoneMossy, 1, 15); - registerMaterial(ModBlocks.stoneBrick, 4, 15); - registerMaterial(ModBlocks.snakestone, 1, 1); - registerMaterial(ModBlocks.snakestone, 13, 13); - registerMaterial(ModBlocks.dirt, 0, 3); - registerMaterial(ModBlocks.dirt, 6, 7); - registerMaterial(ModBlocks.dirt, 11, 11); - registerMaterial(ModBlocks.ice, 1, 15); - registerMaterial(ModBlocks.icePillar); - for(int x = 0; x < 4; x++){ - registerMaterial(ModBlocks.planks[x], 1, 15); // Oak, Spruce, Birch and Jungle - } - //Accacia - registerMaterial(ModBlocks.planks[4], 1, 1); - registerMaterial(ModBlocks.planks[4], 2, 2); - registerMaterial(ModBlocks.planks[4], 6, 6); - registerMaterial(ModBlocks.planks[4], 8, 11); - registerMaterial(ModBlocks.planks[4], 13, 13); +import cpw.mods.fml.common.event.FMLInterModComms; - //Dark Oak - registerMaterial(ModBlocks.planks[5], 1, 1); - registerMaterial(ModBlocks.planks[5], 2, 2); - registerMaterial(ModBlocks.planks[5], 6, 6); - registerMaterial(ModBlocks.planks[5], 8, 11); - registerMaterial(ModBlocks.planks[5], 13, 13); +public class FMPIntegration implements IModIntegration { - registerMaterial(ModBlocks.obsidian, 1, 15); - registerMaterial(ModBlocks.obsidianSnakestone, 1, 1); - registerMaterial(ModBlocks.obsidianSnakestone, 13, 13); - registerMaterial(ModBlocks.redstone, 1, 15); - registerMaterial(ModBlocks.holystone, 0, 13); - registerMaterial(ModBlocks.carpet); - registerMaterial(ModBlocks.lavastone, 0, 6); - registerMaterial(ModBlocks.fantasy, 0, 1); - registerMaterial(ModBlocks.fantasy, 3, 14); - registerMaterial(ModBlocks.tyrian); - registerMaterial(ModBlocks.temple, 1, 2); - registerMaterial(ModBlocks.temple, 4, 15); - registerMaterial(ModBlocks.templeMossy, 1, 2); - registerMaterial(ModBlocks.templeMossy, 4, 15); - registerMaterial(ModBlocks.factory, 0, 12); - registerMaterial(ModBlocks.factory, 14, 14); - registerMaterial(ModBlocks.stainedGlass[0]); //White - registerMaterial(ModBlocks.woolenClay); - registerMaterial(ModBlocks.laboratory, 2, 3); - registerMaterial(ModBlocks.laboratory, 5, 12); - registerMaterial(ModBlocks.voidstone, 0, 3); - registerMaterial(ModBlocks.voidstone, 12, 15); - registerMaterial(ModBlocks.waterstone); - } + @Override + public String getModId() { + return "ForgeMicroblock"; + } - @Override - public void onPostInit(){ + @Override + public void onInit() { + registerMaterial(ModBlocks.marble); + registerMaterial(ModBlocks.limestone); + registerMaterial(ModBlocks.cobblestone, 1, 15); + registerMaterial(ModBlocks.glass, 1, 15); + registerMaterial(ModBlocks.sandstone, 3, 15); + registerMaterial(ModBlocks.sandSnakestone, 1, 1); + registerMaterial(ModBlocks.sandSnakestone, 13, 13); + registerMaterial(ModBlocks.sandstoneScribbles); + registerMaterial(ModBlocks.concrete, 0, 10); + registerMaterial(ModBlocks.iron, 1, 15); + registerMaterial(ModBlocks.gold, 1, 14); + registerMaterial(ModBlocks.diamond, 1, 12); + registerMaterial(ModBlocks.lightstone, 1, 15); // This is glowstone + registerMaterial(ModBlocks.lapis, 1, 8); + registerMaterial(ModBlocks.emerald, 1, 11); + registerMaterial(ModBlocks.netherBrick, 1, 5); + registerMaterial(ModBlocks.netherrack, 1, 14); + registerMaterial(ModBlocks.cobblestoneMossy, 1, 15); + registerMaterial(ModBlocks.stoneBrick, 4, 15); + registerMaterial(ModBlocks.snakestone, 1, 1); + registerMaterial(ModBlocks.snakestone, 13, 13); + registerMaterial(ModBlocks.dirt, 0, 3); + registerMaterial(ModBlocks.dirt, 6, 7); + registerMaterial(ModBlocks.dirt, 11, 11); + registerMaterial(ModBlocks.ice, 1, 15); + registerMaterial(ModBlocks.icePillar); + for (int x = 0; x < 4; x++) { + registerMaterial(ModBlocks.planks[x], 1, 15); // Oak, Spruce, Birch + // and Jungle + } + // Accacia + registerMaterial(ModBlocks.planks[4], 1, 1); + registerMaterial(ModBlocks.planks[4], 2, 2); + registerMaterial(ModBlocks.planks[4], 6, 6); + registerMaterial(ModBlocks.planks[4], 8, 11); + registerMaterial(ModBlocks.planks[4], 13, 13); - } + // Dark Oak + registerMaterial(ModBlocks.planks[5], 1, 1); + registerMaterial(ModBlocks.planks[5], 2, 2); + registerMaterial(ModBlocks.planks[5], 6, 6); + registerMaterial(ModBlocks.planks[5], 8, 11); + registerMaterial(ModBlocks.planks[5], 13, 13); - private void registerMaterial(Block block){ - registerMaterial(block, 0, 15); - } + registerMaterial(ModBlocks.obsidian, 1, 15); + registerMaterial(ModBlocks.obsidianSnakestone, 1, 1); + registerMaterial(ModBlocks.obsidianSnakestone, 13, 13); + registerMaterial(ModBlocks.redstone, 1, 15); + registerMaterial(ModBlocks.holystone, 0, 13); + registerMaterial(ModBlocks.carpet); + registerMaterial(ModBlocks.lavastone, 0, 6); + registerMaterial(ModBlocks.fantasy, 0, 1); + registerMaterial(ModBlocks.fantasy, 3, 14); + registerMaterial(ModBlocks.tyrian); + registerMaterial(ModBlocks.temple, 1, 2); + registerMaterial(ModBlocks.temple, 4, 15); + registerMaterial(ModBlocks.templeMossy, 1, 2); + registerMaterial(ModBlocks.templeMossy, 4, 15); + registerMaterial(ModBlocks.factory, 0, 12); + registerMaterial(ModBlocks.factory, 14, 14); + registerMaterial(ModBlocks.stainedGlass[0]); // White + registerMaterial(ModBlocks.woolenClay); + registerMaterial(ModBlocks.laboratory, 2, 3); + registerMaterial(ModBlocks.laboratory, 5, 12); + registerMaterial(ModBlocks.voidstone, 0, 3); + registerMaterial(ModBlocks.voidstone, 12, 15); + registerMaterial(ModBlocks.waterstone); + } - private void registerMaterial(Block block, int minMeta, int maxMeta){ - for(int c = minMeta; c <= maxMeta; c++){ - FMLInterModComms.sendMessage(getModId(), "microMaterial", new ItemStack(block, 1, c)); - } - } + @Override + public void onPostInit() { + + } + + private void registerMaterial(Block block) { + registerMaterial(block, 0, 15); + } + + private void registerMaterial(Block block, int minMeta, int maxMeta) { + for (int c = minMeta; c <= maxMeta; c++) { + FMLInterModComms.sendMessage(getModId(), "microMaterial", new ItemStack(block, 1, c)); + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/compat/MarbleCompatibility.java b/src/main/java/com/cricketcraft/chisel/compat/MarbleCompatibility.java index 38989be5..0e30635f 100644 --- a/src/main/java/com/cricketcraft/chisel/compat/MarbleCompatibility.java +++ b/src/main/java/com/cricketcraft/chisel/compat/MarbleCompatibility.java @@ -1,169 +1,147 @@ package com.cricketcraft.chisel.compat; -import com.cricketcraft.chisel.carving.Carving; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; import net.minecraft.block.Block; -public class MarbleCompatibility -{ +import com.cricketcraft.chisel.carving.Carving; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; - abstract class ClassCompat - { - Class cl; +public class MarbleCompatibility { - public ClassCompat(String name) - { - try - { - if((cl = Class.forName(name)) != null) - action(); - } catch(ClassNotFoundException e) - { - //e.printStackTrace(); - } catch(IllegalArgumentException e) - { - e.printStackTrace(); - } catch(IllegalAccessException e) - { - e.printStackTrace(); - } catch(NoSuchFieldException e) - { - e.printStackTrace(); - } catch(SecurityException e) - { - e.printStackTrace(); - } catch(Exception e) - { - e.printStackTrace(); - } - } + abstract class ClassCompat { - abstract void action() throws Exception; + Class cl; - abstract class BlockCompat - { - Block block; + public ClassCompat(String name) { + try { + if ((cl = Class.forName(name)) != null) + action(); + } catch (ClassNotFoundException e) { + // e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } catch (SecurityException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + } - public BlockCompat(String variableName) throws Exception - { - block = (Block) ClassCompat.this.cl.getField(variableName).get(null); + abstract void action() throws Exception; - if(block != null) - action(); - } + abstract class BlockCompat { - abstract void action() throws Exception; - } + Block block; - ; - } + public BlockCompat(String variableName) throws Exception { + block = (Block) ClassCompat.this.cl.getField(variableName).get(null); - ; + if (block != null) + action(); + } - abstract class ClassBlockCompat - { - Block block; + abstract void action() throws Exception; + } - ClassBlockCompat(final String className, final String blockName) - { - new ClassCompat(className) - { - @Override - void action() throws Exception - { - new BlockCompat(blockName) - { - @Override - void action() throws Exception - { - ClassBlockCompat.this.doAction(block); - } - }; - } - }; - } + ; + } - void doAction(Block b) - { - block = b; + ; - action(); - } + abstract class ClassBlockCompat { - abstract void action(); - } + Block block; + ClassBlockCompat(final String className, final String blockName) { + new ClassCompat(className) { - public void postInit(FMLPostInitializationEvent event) - { - new ClassBlockCompat("shukaro.artifice.ArtificeBlocks", "marble") - { - @Override - void action() - { - Carving.chisel.addVariation("marble", block, 0, 99); - } - }; + @Override + void action() throws Exception { + new BlockCompat(blockName) { - new ClassCompat("shukaro.artifice.ArtificeBlocks") - { - @Override - void action() throws Exception - { - Block[] blocks = (Block[]) cl.getField("blockLimestones").get(null); + @Override + void action() throws Exception { + ClassBlockCompat.this.doAction(block); + } + }; + } + }; + } - Carving.chisel.addVariation("limestone", blocks[0], 3, 99); - } - }; + void doAction(Block b) { + block = b; - new ClassBlockCompat("com.bluepowermod.init.BPBlocks", "marble") - { - @Override - void action() - { - Carving.chisel.addVariation("marble", block, 0, 99); - } - }; + action(); + } - new ClassBlockCompat("num.numirp.block.ModBlocks", "blockDecor") - { - @Override - void action() - { - Carving.chisel.addVariation("marble", block, 0, 99); - } - }; + abstract void action(); + } - new ClassBlockCompat("mariculture.core.Core", "limestone") - { - @Override - void action() - { - Carving.chisel.addVariation("limestone", block, 0, 99); - } - }; - new ClassBlockCompat("emasher.core.EmasherCore", "limestone") - { - @Override - void action() - { - Carving.chisel.addVariation("limestone", block, 0, 99); - } - }; + public void postInit(FMLPostInitializationEvent event) { + new ClassBlockCompat("shukaro.artifice.ArtificeBlocks", "marble") { - new ClassCompat("Reika.GeoStrata.GeoStrata") - { - @Override - void action() throws Exception - { - Block[] blocks = (Block[]) cl.getField("blocks").get(null); + @Override + void action() { + Carving.chisel.addVariation("marble", block, 0, 99); + } + }; - Carving.chisel.addVariation("marble", blocks[0], 2, 99); + new ClassCompat("shukaro.artifice.ArtificeBlocks") { - Carving.chisel.addVariation("limestone", blocks[0], 3, 99); - } - }; - } + @Override + void action() throws Exception { + Block[] blocks = (Block[]) cl.getField("blockLimestones").get(null); + + Carving.chisel.addVariation("limestone", blocks[0], 3, 99); + } + }; + + new ClassBlockCompat("com.bluepowermod.init.BPBlocks", "marble") { + + @Override + void action() { + Carving.chisel.addVariation("marble", block, 0, 99); + } + }; + + new ClassBlockCompat("num.numirp.block.ModBlocks", "blockDecor") { + + @Override + void action() { + Carving.chisel.addVariation("marble", block, 0, 99); + } + }; + + new ClassBlockCompat("mariculture.core.Core", "limestone") { + + @Override + void action() { + Carving.chisel.addVariation("limestone", block, 0, 99); + } + }; + new ClassBlockCompat("emasher.core.EmasherCore", "limestone") { + + @Override + void action() { + Carving.chisel.addVariation("limestone", block, 0, 99); + } + }; + + new ClassCompat("Reika.GeoStrata.GeoStrata") { + + @Override + void action() throws Exception { + Block[] blocks = (Block[]) cl.getField("blocks").get(null); + + Carving.chisel.addVariation("marble", blocks[0], 2, 99); + + Carving.chisel.addVariation("limestone", blocks[0], 3, 99); + } + }; + } } diff --git a/src/main/java/com/cricketcraft/chisel/compat/ModIntegration.java b/src/main/java/com/cricketcraft/chisel/compat/ModIntegration.java index 2dafb791..b7370d50 100644 --- a/src/main/java/com/cricketcraft/chisel/compat/ModIntegration.java +++ b/src/main/java/com/cricketcraft/chisel/compat/ModIntegration.java @@ -7,43 +7,46 @@ import cpw.mods.fml.common.Loader; public class ModIntegration { - private static List integratedMods = new ArrayList(); + private static List integratedMods = new ArrayList(); - public static void addMod(Class cls){ - try{ - IModIntegration obj = cls.newInstance(); + public static void addMod(Class cls) { + try { + IModIntegration obj = cls.newInstance(); - if(Loader.isModLoaded(obj.getModId())){ - integratedMods.add(obj); - } - } catch(Throwable throwable){ - throwable.printStackTrace(); - } - } + if (Loader.isModLoaded(obj.getModId())) { + integratedMods.add(obj); + } + } catch (Throwable throwable) { + throwable.printStackTrace(); + } + } - public static void init(){ - try{ - for(IModIntegration integration : integratedMods){ - integration.onInit(); - } - } catch (Throwable throwable){ - throwable.printStackTrace(); - } - } + public static void init() { + try { + for (IModIntegration integration : integratedMods) { + integration.onInit(); + } + } catch (Throwable throwable) { + throwable.printStackTrace(); + } + } - public static void postInit(){ - try { - for (IModIntegration integration : integratedMods){ - integration.onPostInit(); - } - } catch (Throwable throwable){ - throwable.printStackTrace(); - } - } + public static void postInit() { + try { + for (IModIntegration integration : integratedMods) { + integration.onPostInit(); + } + } catch (Throwable throwable) { + throwable.printStackTrace(); + } + } - static interface IModIntegration{ - String getModId(); - void onInit(); - void onPostInit(); - } + static interface IModIntegration { + + String getModId(); + + void onInit(); + + void onPostInit(); + } } diff --git a/src/main/java/com/cricketcraft/chisel/entity/EntityBallOMoss.java b/src/main/java/com/cricketcraft/chisel/entity/EntityBallOMoss.java index f5e67d9a..5c5780ad 100644 --- a/src/main/java/com/cricketcraft/chisel/entity/EntityBallOMoss.java +++ b/src/main/java/com/cricketcraft/chisel/entity/EntityBallOMoss.java @@ -12,115 +12,98 @@ import com.cricketcraft.chisel.client.GeneralChiselClient; import com.cricketcraft.chisel.init.ModBlocks; import com.cricketcraft.chisel.utils.General; -public class EntityBallOMoss extends EntityThrowable -{ +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(ModBlocks.cobblestone)) { + resBlock = ModBlocks.cobblestoneMossy; + } else if (block.equals(ModBlocks.temple)) { + resBlock = ModBlocks.templeMossy; + } 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(ModBlocks.cobblestone)) - { - resBlock = ModBlocks.cobblestoneMossy; - } else if(block.equals(ModBlocks.temple)) - { - resBlock = ModBlocks.templeMossy; - } 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/com/cricketcraft/chisel/entity/EntityCloudInABottle.java b/src/main/java/com/cricketcraft/chisel/entity/EntityCloudInABottle.java index 2ca6823f..7d227457 100644 --- a/src/main/java/com/cricketcraft/chisel/entity/EntityCloudInABottle.java +++ b/src/main/java/com/cricketcraft/chisel/entity/EntityCloudInABottle.java @@ -9,117 +9,104 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.init.ModBlocks; -public class EntityCloudInABottle extends EntityThrowable -{ - Random rand = new Random(); +public class EntityCloudInABottle extends EntityThrowable { - public EntityCloudInABottle(World par1World) - { - super(par1World); - } + Random rand = new Random(); - public EntityCloudInABottle(World par1World, EntityLivingBase par2EntityLiving) - { - super(par1World, par2EntityLiving); - } + public EntityCloudInABottle(World par1World) { + super(par1World); + } - public EntityCloudInABottle(World par1World, double x, double y, double z) - { - super(par1World, x, y, z); - } + public EntityCloudInABottle(World par1World, EntityLivingBase par2EntityLiving) { + super(par1World, par2EntityLiving); + } - @Override - protected void onImpact(MovingObjectPosition movingobjectposition) - { - if(worldObj.isRemote) - return; + public EntityCloudInABottle(World par1World, double x, double y, double z) { + super(par1World, x, y, z); + } - int x = movingobjectposition.blockX; - int y = movingobjectposition.blockY; - int z = movingobjectposition.blockZ; + @Override + protected void onImpact(MovingObjectPosition movingobjectposition) { + if (worldObj.isRemote) + return; - 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; - } + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; - generate(worldObj, rand, x, y, z, 40); + 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; + } - worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), 2); - setDead(); - } + generate(worldObj, rand, x, y, z, 40); - 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]; + worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), 2); + setDead(); + } - 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; + 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]; - int dx = dir % 3 - 1; - int dz = dir / 3 - 1; + 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; - if(dx == 0 && dz == 0) - continue; + int dx = dir % 3 - 1; + int dz = dir / 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); + if (dx == 0 && dz == 0) + continue; - int x = X[dir]; - int y = Y[dir]; - int z = Z[dir]; + X[dir] += random.nextInt(3) - 1 + dx; + Z[dir] += random.nextInt(3) - 1 + dz; + Y[dir] += random.nextInt(2) * (random.nextInt(3) - 1); - 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, ModBlocks.cloud); - count++; - } - } - } - } - } - } + int x = X[dir]; + int y = Y[dir]; + int z = Z[dir]; - //System.out.println("Created " + count + " cloud blocks."); + 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, ModBlocks.cloud); + count++; + } + } + } + } + } + } - return true; - } + // System.out.println("Created " + count + " cloud blocks."); + + return true; + } } diff --git a/src/main/java/com/cricketcraft/chisel/entity/EntitySmashingRock.java b/src/main/java/com/cricketcraft/chisel/entity/EntitySmashingRock.java index de8c9e12..11828eed 100644 --- a/src/main/java/com/cricketcraft/chisel/entity/EntitySmashingRock.java +++ b/src/main/java/com/cricketcraft/chisel/entity/EntitySmashingRock.java @@ -9,112 +9,96 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.utils.General; -public class EntitySmashingRock extends EntityThrowable -{ +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/com/cricketcraft/chisel/entity/fx/EntityBallOMossFX.java b/src/main/java/com/cricketcraft/chisel/entity/fx/EntityBallOMossFX.java index 1ee66fc7..a2316b9e 100644 --- a/src/main/java/com/cricketcraft/chisel/entity/fx/EntityBallOMossFX.java +++ b/src/main/java/com/cricketcraft/chisel/entity/fx/EntityBallOMossFX.java @@ -14,141 +14,125 @@ import com.cricketcraft.chisel.utils.General; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class EntityBallOMossFX extends EntityFX -{ - BlockSnakestoneObsidian block; - double tx, ty, tz; - double speed; +public class EntityBallOMossFX extends EntityFX { - float u0, u1, v0, v1; - IIcon icon; - IIcon iconPlus = new IIcon() - { + BlockSnakestoneObsidian block; + double tx, ty, tz; + double speed; - @Override - @SideOnly(Side.CLIENT) - public int getIconWidth() - { - return 0; - } + float u0, u1, v0, v1; + IIcon icon; + IIcon iconPlus = new IIcon() { - @Override - @SideOnly(Side.CLIENT) - public int getIconHeight() - { - return 0; - } + @Override + @SideOnly(Side.CLIENT) + public int getIconWidth() { + return 0; + } - @Override - @SideOnly(Side.CLIENT) - public float getMinU() - { - return u0; - } + @Override + @SideOnly(Side.CLIENT) + public int getIconHeight() { + return 0; + } - @Override - @SideOnly(Side.CLIENT) - public float getMaxU() - { - return u1; - } + @Override + @SideOnly(Side.CLIENT) + public float getMinU() { + return u0; + } - @Override - @SideOnly(Side.CLIENT) - public float getInterpolatedU(double d0) - { - return (float) (u0 + d0 * (u1 - u0) / 16.0f); - } + @Override + @SideOnly(Side.CLIENT) + public float getMaxU() { + return u1; + } - @Override - @SideOnly(Side.CLIENT) - public float getMinV() - { - return v0; - } + @Override + @SideOnly(Side.CLIENT) + public float getInterpolatedU(double d0) { + return (float) (u0 + d0 * (u1 - u0) / 16.0f); + } - @Override - @SideOnly(Side.CLIENT) - public float getMaxV() - { - return v1; - } + @Override + @SideOnly(Side.CLIENT) + public float getMinV() { + return v0; + } - @Override - @SideOnly(Side.CLIENT) - public float getInterpolatedV(double d0) - { - return (float) (v0 + d0 * (v1 - v0) / 16.0f); - } + @Override + @SideOnly(Side.CLIENT) + public float getMaxV() { + return v1; + } - @Override - @SideOnly(Side.CLIENT) - public String getIconName() - { - return ""; - } + @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 ""; + } - 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(); + public EntityBallOMossFX(World world, double x, double y, double z) { + super(world, x, y + 0.5, z, 0, 0, 0); - particleMaxAge = (int) (General.rand.nextDouble() * 10.0) + 5; - if(General.rand.nextInt(10) == 0) - particleMaxAge += General.rand.nextDouble() * 40.0; + particleScale = 0.5f + 0.5f * General.rand.nextFloat(); + speed = 0.4 + 0.4 * General.rand.nextDouble(); - 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; + particleMaxAge = (int) (General.rand.nextDouble() * 10.0) + 5; + if (General.rand.nextInt(10) == 0) + particleMaxAge += General.rand.nextDouble() * 40.0; -// setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]); + 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; - icon = ModItems.itemBallOMoss.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(block.particles[General.rand.nextInt(block.particles.length)]); - setParticleIcon(iconPlus); - } + icon = ModItems.itemBallOMoss.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); - @Override - public int getFXLayer() - { - return 2; - } + setParticleIcon(iconPlus); + } - @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 int getFXLayer() { + return 2; + } - @Override - public void onUpdate() - { - super.onUpdate(); + @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); + } - double remaining = particleMaxAge - particleAge; + @Override + public void onUpdate() { + super.onUpdate(); - if(remaining < 5) - { - particleAlpha = (float) (remaining / 5.0); - } else - { - particleAlpha = 1.0f; - } - } + double remaining = particleMaxAge - particleAge; + + if (remaining < 5) { + particleAlpha = (float) (remaining / 5.0); + } else { + particleAlpha = 1.0f; + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/entity/fx/EntityGrimstoneFX.java b/src/main/java/com/cricketcraft/chisel/entity/fx/EntityGrimstoneFX.java index b00b1619..e44864b2 100644 --- a/src/main/java/com/cricketcraft/chisel/entity/fx/EntityGrimstoneFX.java +++ b/src/main/java/com/cricketcraft/chisel/entity/fx/EntityGrimstoneFX.java @@ -7,60 +7,55 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.block.BlockGrimstone; import com.cricketcraft.chisel.utils.General; -public class EntityGrimstoneFX extends EntityFX -{ - float initialScale; - float angleOffset; - static final float fadetime = 20f; +public class EntityGrimstoneFX extends EntityFX { - public EntityGrimstoneFX(World world, BlockGrimstone block, double x, double y, double z) - { - super(world, x, y, z, 0, 0, 0); + float initialScale; + float angleOffset; + static final float fadetime = 20f; - initialScale = 1.0f + 1.0f * General.rand.nextFloat(); - angleOffset = rand.nextFloat() * 360; + public EntityGrimstoneFX(World world, BlockGrimstone block, double x, double y, double z) { + super(world, x, y, z, 0, 0, 0); - particleMaxAge = (int) (Math.random() * 10.0D) + 80; + initialScale = 1.0f + 1.0f * General.rand.nextFloat(); + angleOffset = rand.nextFloat() * 360; - setPosition(x, y, z); - prevPosX = posX; - prevPosY = posY; - prevPosZ = posZ; + particleMaxAge = (int) (Math.random() * 10.0D) + 80; - noClip = true; + setPosition(x, y, z); + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; - setParticleIcon(block.iconStar); - } + noClip = true; - @Override - public int getFXLayer() - { - return 1; - } + setParticleIcon(block.iconStar); + } - @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 int getFXLayer() { + return 1; + } - if(particleAge < fadetime) - particleAlpha = particleAge / fadetime; - else if(particleAge + fadetime >= particleMaxAge) - particleAlpha = (particleMaxAge - particleAge) / fadetime; - else - particleAlpha = 1.0f; + @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); - super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY); + 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); - @Override - public void onUpdate() - { - if(particleAge++ >= particleMaxAge) - { - setDead(); - } + } - } + @Override + public void onUpdate() { + if (particleAge++ >= particleMaxAge) { + setDead(); + } + + } } diff --git a/src/main/java/com/cricketcraft/chisel/entity/fx/EntityHolystoneFX.java b/src/main/java/com/cricketcraft/chisel/entity/fx/EntityHolystoneFX.java index 2344f67f..5bd79a61 100644 --- a/src/main/java/com/cricketcraft/chisel/entity/fx/EntityHolystoneFX.java +++ b/src/main/java/com/cricketcraft/chisel/entity/fx/EntityHolystoneFX.java @@ -7,60 +7,55 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.block.BlockHolystone; import com.cricketcraft.chisel.utils.General; -public class EntityHolystoneFX extends EntityFX -{ - float initialScale; - float angleOffset; - static final float fadetime = 20f; +public class EntityHolystoneFX extends EntityFX { - public EntityHolystoneFX(World world, BlockHolystone block, double x, double y, double z) - { - super(world, x, y, z, 0, 0, 0); + float initialScale; + float angleOffset; + static final float fadetime = 20f; - initialScale = 1.0f + 1.0f * General.rand.nextFloat(); - angleOffset = rand.nextFloat() * 360; + public EntityHolystoneFX(World world, BlockHolystone block, double x, double y, double z) { + super(world, x, y, z, 0, 0, 0); - particleMaxAge = (int) (Math.random() * 10.0D) + 80; + initialScale = 1.0f + 1.0f * General.rand.nextFloat(); + angleOffset = rand.nextFloat() * 360; - setPosition(x, y, z); - prevPosX = posX; - prevPosY = posY; - prevPosZ = posZ; + particleMaxAge = (int) (Math.random() * 10.0D) + 80; - noClip = true; + setPosition(x, y, z); + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; - setParticleIcon(block.iconStar); - } + noClip = true; - @Override - public int getFXLayer() - { - return 1; - } + setParticleIcon(block.iconStar); + } - @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 int getFXLayer() { + return 1; + } - if(particleAge < fadetime) - particleAlpha = particleAge / fadetime; - else if(particleAge + fadetime >= particleMaxAge) - particleAlpha = (particleMaxAge - particleAge) / fadetime; - else - particleAlpha = 1.0f; + @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); - super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY); + 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); - @Override - public void onUpdate() - { - if(particleAge++ >= particleMaxAge) - { - setDead(); - } + } - } + @Override + public void onUpdate() { + if (particleAge++ >= particleMaxAge) { + setDead(); + } + + } } diff --git a/src/main/java/com/cricketcraft/chisel/entity/fx/EntitySnakestoneObsidianFX.java b/src/main/java/com/cricketcraft/chisel/entity/fx/EntitySnakestoneObsidianFX.java index 5dbb85d5..1b06e566 100644 --- a/src/main/java/com/cricketcraft/chisel/entity/fx/EntitySnakestoneObsidianFX.java +++ b/src/main/java/com/cricketcraft/chisel/entity/fx/EntitySnakestoneObsidianFX.java @@ -9,120 +9,109 @@ import org.lwjgl.opengl.GL11; import com.cricketcraft.chisel.block.BlockSnakestoneObsidian; import com.cricketcraft.chisel.utils.General; -public class EntitySnakestoneObsidianFX extends EntityFX -{ - BlockSnakestoneObsidian block; - double tx, ty, tz; - double speed; +public class EntitySnakestoneObsidianFX extends EntityFX { - 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); + BlockSnakestoneObsidian block; + double tx, ty, tz; + double speed; - block = b; + 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); - particleScale = 0.5f + 0.5f * General.rand.nextFloat(); - speed = 0.04 + 0.04 * General.rand.nextDouble(); + block = b; - particleMaxAge = (int) (Math.random() * 10.0D) + 40; + particleScale = 0.5f + 0.5f * General.rand.nextFloat(); + speed = 0.04 + 0.04 * General.rand.nextDouble(); - 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; - } + particleMaxAge = (int) (Math.random() * 10.0D) + 40; - double dx = (tx - posX) * 3; - double dy = (ty - posY) * 3; - double dz = (tz - posZ) * 3; + 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; + } - setPosition(posX + dx, posY + dy, posZ + dz); - prevPosX = posX; - prevPosY = posY; - prevPosZ = posZ; + double dx = (tx - posX) * 3; + double dy = (ty - posY) * 3; + double dz = (tz - posZ) * 3; - noClip = true; + setPosition(posX + dx, posY + dy, posZ + dz); + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; - setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]); - } + noClip = true; - @Override - public int getFXLayer() - { - return 1; - } + setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]); + } - @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 int getFXLayer() { + return 1; + } - @Override - public void onUpdate() - { - if(particleAge++ >= particleMaxAge) - { - setDead(); - return; - } + @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); + } - double dx = tx - posX; - double dy = ty - posY; - double dz = tz - posZ; + @Override + public void onUpdate() { + if (particleAge++ >= particleMaxAge) { + setDead(); + return; + } - 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 dx = tx - posX; + double dy = ty - posY; + double dz = tz - posZ; - if(distance < speed) - { - speed = distance; - } + 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; + } - prevPosX = posX; - prevPosY = posY; - prevPosZ = posZ; + if (distance < speed) { + speed = distance; + } - double px = posX + dx / distance * speed; - double py = posY + dy / distance * speed; - double pz = posZ + dz / distance * speed; + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; - setPosition(px, py, pz); - } + double px = posX + dx / distance * speed; + double py = posY + dy / distance * speed; + double pz = posZ + dz / distance * speed; + + setPosition(px, py, pz); + } } diff --git a/src/main/java/com/cricketcraft/chisel/init/ModBlocks.java b/src/main/java/com/cricketcraft/chisel/init/ModBlocks.java index c95f9008..dd7a9dea 100644 --- a/src/main/java/com/cricketcraft/chisel/init/ModBlocks.java +++ b/src/main/java/com/cricketcraft/chisel/init/ModBlocks.java @@ -1,15 +1,5 @@ package com.cricketcraft.chisel.init; -import com.cricketcraft.chisel.Chisel; -import com.cricketcraft.chisel.Configurations; -import com.cricketcraft.chisel.block.*; -import com.cricketcraft.chisel.carving.CarvableHelper; -import com.cricketcraft.chisel.carving.CarvableVariation; -import com.cricketcraft.chisel.carving.Carving; -import com.cricketcraft.chisel.item.ItemCarvable; -import com.cricketcraft.chisel.item.ItemMarbleSlab; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; @@ -17,1799 +7,1780 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraftforge.oredict.OreDictionary; +import com.cricketcraft.chisel.Chisel; +import com.cricketcraft.chisel.Configurations; +import com.cricketcraft.chisel.block.BlockAutoChisel; +import com.cricketcraft.chisel.block.BlockBeaconBase; +import com.cricketcraft.chisel.block.BlockCarvable; +import com.cricketcraft.chisel.block.BlockCarvableGlass; +import com.cricketcraft.chisel.block.BlockCarvablePane; +import com.cricketcraft.chisel.block.BlockCarvablePowered; +import com.cricketcraft.chisel.block.BlockCarvablePumpkin; +import com.cricketcraft.chisel.block.BlockCarvableSand; +import com.cricketcraft.chisel.block.BlockCloud; +import com.cricketcraft.chisel.block.BlockConcrete; +import com.cricketcraft.chisel.block.BlockEldritch; +import com.cricketcraft.chisel.block.BlockGrimstone; +import com.cricketcraft.chisel.block.BlockHolystone; +import com.cricketcraft.chisel.block.BlockLavastone; +import com.cricketcraft.chisel.block.BlockLeaf; +import com.cricketcraft.chisel.block.BlockLightstoneCarvable; +import com.cricketcraft.chisel.block.BlockMarbleBookshelf; +import com.cricketcraft.chisel.block.BlockMarbleCarpet; +import com.cricketcraft.chisel.block.BlockMarbleIce; +import com.cricketcraft.chisel.block.BlockMarbleIceStairs; +import com.cricketcraft.chisel.block.BlockMarblePackedIce; +import com.cricketcraft.chisel.block.BlockMarblePackedIceStairs; +import com.cricketcraft.chisel.block.BlockMarblePillar; +import com.cricketcraft.chisel.block.BlockMarbleSlab; +import com.cricketcraft.chisel.block.BlockMarbleStairs; +import com.cricketcraft.chisel.block.BlockMarbleStairsMaker; +import com.cricketcraft.chisel.block.BlockMarbleStairsMakerCreator; +import com.cricketcraft.chisel.block.BlockMarbleTexturedOre; +import com.cricketcraft.chisel.block.BlockMarbleWall; +import com.cricketcraft.chisel.block.BlockPresent; +import com.cricketcraft.chisel.block.BlockRoadLine; +import com.cricketcraft.chisel.block.BlockSnakestone; +import com.cricketcraft.chisel.block.BlockSnakestoneObsidian; +import com.cricketcraft.chisel.block.BlockVoidstonePillar; +import com.cricketcraft.chisel.block.BlockVoidstonePillar2; +import com.cricketcraft.chisel.block.BlockWaterstone; +import com.cricketcraft.chisel.carving.CarvableHelper; +import com.cricketcraft.chisel.carving.CarvableVariation; +import com.cricketcraft.chisel.carving.Carving; +import com.cricketcraft.chisel.item.ItemCarvable; +import com.cricketcraft.chisel.item.ItemMarbleSlab; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; + public class ModBlocks { - public static BlockCarvable marble; - public static BlockCarvable marblePillar; - public static BlockCarvable limestone; - public static BlockMarbleSlab marbleSlab; - public static BlockMarbleSlab limestoneSlab; - public static BlockMarbleSlab marblePillarSlab; - public static BlockCarvable cobblestone; - public static BlockMarbleWall cobblestoneWall; - public static BlockCarvableGlass glass; - public static BlockCarvablePane paneGlass; - public static BlockCarvable sandstone; - public static BlockCarvable sandstoneScribbles; - public static BlockConcrete concrete; - public static BlockRoadLine roadLine; - public static BlockCarvable iron; - public static BlockCarvable gold; - public static BlockCarvable diamond; - public static BlockLightstoneCarvable lightstone; - public static BlockCarvable lapis; - public static BlockCarvable emerald; - public static BlockCarvable netherBrick; - public static BlockCarvable netherrack; - public static BlockCarvable cobblestoneMossy; - public static BlockCarvable stoneBrick; - public static BlockMarbleStairs marbleStairs; - public static BlockMarbleStairs limestoneStairs; - public static BlockCarvablePane paneIron; - public static BlockMarbleIce ice; - public static BlockMarbleIce icePillar; - public static BlockMarblePackedIce packedice; - public static BlockMarblePackedIce packedicePillar; - public static BlockMarbleIceStairs iceStairs; - public static BlockMarblePackedIceStairs packediceStairs; - public static BlockCarvable[] planks = new BlockCarvable[6]; - public static BlockCarvable obsidian; - public static BlockCarvablePowered redstone; - public static BlockHolystone holystone; - public static BlockGrimstone grimstone; - public static BlockLavastone lavastone; - public static BlockWaterstone waterstone; - public static BlockCarvable leaf; - public static BlockCarvable fantasy; - public static BlockCarvable fantasy2; - public static BlockCarvable carpet; - public static BlockMarbleCarpet carpetFloor; - public static BlockCarvable bookshelf; - public static BlockCarvable tyrian; - public static BlockCarvable dirt; - public static BlockCloud cloud; - public static BlockCarvable temple; - public static BlockCarvable templeMossy; - public static BlockCarvable factory; - public static BlockCarvablePane paperWall; - public static BlockCarvable woolenClay; - public static BlockCarvable laboratory; - public static BlockCarvablePumpkin[] pumpkin = new BlockCarvablePumpkin[16]; - public static BlockCarvablePumpkin[] jackolantern = new BlockCarvablePumpkin[16]; - public static BlockCarvable voidstone; - public static BlockMarbleTexturedOre voidstone2; - public static BlockVoidstonePillar voidstonePillar; - public static BlockVoidstonePillar2 voidstonePillar2; - public static Block autoChisel; - public static BlockPresent[] present = new BlockPresent[16]; - public static BlockSnakestone snakestone; - public static BlockSnakestone sandSnakestone; - public static BlockSnakestoneObsidian obsidianSnakestone; - public static BlockCarvable hexPlating; - public static BlockCarvable technical; - public static BlockCarvableGlass technical2; - public static BlockCarvable futura; - public static BlockCarvable bone; - public static BlockCarvable scorching; - public static BlockCarvable brickCustom; - public static BlockCarvable sign; - public static BlockCarvable arcane; - public static BlockCarvable bloodRune; - public static BlockCarvableSand coloredSand; - - // 1.7 - public static BlockCarvableGlass[] stainedGlass = new BlockCarvableGlass[4]; - public static BlockCarvablePane[] stainedGlassPane = new BlockCarvablePane[8]; - - //1.8 or at least so you think :P - public static BlockCarvable granite; - public static BlockCarvable diorite; - public static BlockCarvable andesite; - - private static boolean areChestsReady = false; - - public static void load() - { - if(Configurations.featureEnabled("autoChisel")){ - autoChisel = new BlockAutoChisel().setBlockTextureName("Chisel:autoChisel").setCreativeTab(ModTabs.tabChisel).setBlockName("autoChisel").setBlockTextureName(Chisel.MOD_ID + ":factory/circuit"); - GameRegistry.registerBlock(autoChisel, "autoChisel"); - Chisel.proxy.registerTileEntities(); - } - - if(Configurations.featureEnabled("marble")) - { - marble = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeStone); - marble.carverHelper.setChiselBlockName("Marble"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.0.desc"), 0, "marble"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.1.desc"), 1, "marble/a1-stoneornamental-marblebrick"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.2.desc"), 2, "marble/a1-stoneornamental-marbleclassicpanel"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.3.desc"), 3, "marble/a1-stoneornamental-marbleornate"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.4.desc"), 4, "marble/panel"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.5.desc"), 5, "marble/block"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.6.desc"), 6, "marble/terrain-pistonback-marblecreeperdark"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.7.desc"), 7, "marble/terrain-pistonback-marblecreeperlight"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.8.desc"), 8, "marble/a1-stoneornamental-marblecarved"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.9.desc"), 9, "marble/a1-stoneornamental-marblecarvedradial"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.10.desc"), 10, "marble/terrain-pistonback-marbledent"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.11.desc"), 11, "marble/terrain-pistonback-marbledent-small"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.12.desc"), 12, "marble/marble-bricks"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.13.desc"), 13, "marble/marble-arranged-bricks"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.14.desc"), 14, "marble/marble-fancy-bricks"); - marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.15.desc"), 15, "marble/marble-blocks"); - marble.carverHelper.register(marble, "marble"); - OreDictionary.registerOre("marble", marble); - OreDictionary.registerOre("blockMarble", marble); - Carving.chisel.registerOre("marble", "marble"); - - marbleSlab = (BlockMarbleSlab) new BlockMarbleSlab(marble).setHardness(2.0F).setResistance(10F); - marbleSlab.carverHelper.setChiselBlockName("Marble Slab"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.0.desc"), 0, "marble"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.1.desc"), 1, "marbleslab/a1-stoneornamental-marblebrick"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.2.desc"), 2, "marbleslab/a1-stoneornamental-marbleclassicpanel"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.3.desc"), 3, "marbleslab/a1-stoneornamental-marbleornate"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.4.desc"), 4, "marbleslab/a1-stoneornamental-marblepanel"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.5.desc"), 5, "marbleslab/terrain-pistonback-marble"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.6.desc"), 6, "marbleslab/terrain-pistonback-marblecreeperdark"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.7.desc"), 7, "marbleslab/terrain-pistonback-marblecreeperlight"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.8.desc"), 8, "marbleslab/a1-stoneornamental-marblecarved"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.9.desc"), 9, "marbleslab/a1-stoneornamental-marblecarvedradial"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.10.desc"), 10, "marbleslab/terrain-pistonback-marbledent"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.11.desc"), 11, "marbleslab/terrain-pistonback-marbledent-small"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.12.desc"), 12, "marbleslab/marble-bricks"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.13.desc"), 13, "marbleslab/marble-arranged-bricks"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.14.desc"), 14, "marbleslab/marble-fancy-bricks"); - marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.15.desc"), 15, "marbleslab/marble-blocks"); - marbleSlab.carverHelper.register(marbleSlab, "marble_slab", ItemMarbleSlab.class); - Carving.chisel.registerOre("marble_slab", "marble_slab"); - - if(Configurations.featureEnabled("marblePillar")) - { - if(Configurations.oldPillars) - { - marblePillar = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeStone); - marblePillar.carverHelper.setChiselBlockName("Marble Pillar"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.0.desc"), 0, "marblepillarold/column"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.1.desc"), 1, "marblepillarold/capstone"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.2.desc"), 2, "marblepillarold/base"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.3.desc"), 3, "marblepillarold/small"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.4.desc"), 4, "marblepillarold/pillar-carved"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.5.desc"), 5, "marblepillarold/a1-stoneornamental-marblegreek"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.6.desc"), 6, "marblepillarold/a1-stonepillar-greek"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.7.desc"), 7, "marblepillarold/a1-stonepillar-plain"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.8.desc"), 8, "marblepillarold/a1-stonepillar-greektopplain"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.9.desc"), 9, "marblepillarold/a1-stonepillar-plaintopplain"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.10.desc"), 10, "marblepillarold/a1-stonepillar-greekbottomplain"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.11.desc"), 11, "marblepillarold/a1-stonepillar-plainbottomplain"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.12.desc"), 12, "marblepillarold/a1-stonepillar-greektopgreek"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.13.desc"), 13, "marblepillarold/a1-stonepillar-plaintopgreek"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.14.desc"), 14, "marblepillarold/a1-stonepillar-greekbottomgreek"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.15.desc"), 15, "marblepillarold/a1-stonepillar-plainbottomgreek"); - } else - { - marblePillar = (BlockCarvable) new BlockMarblePillar(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeStone); - marblePillar.carverHelper.setChiselBlockName("Marble Pillar"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.0.desc"), 0, "marblepillar/pillar"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.1.desc"), 1, "marblepillar/default"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.2.desc"), 2, "marblepillar/simple"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.3.desc"), 3, "marblepillar/convex"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.4.desc"), 4, "marblepillar/rough"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.5.desc"), 5, "marblepillar/greekdecor"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.6.desc"), 6, "marblepillar/greekgreek"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.7.desc"), 7, "marblepillar/greekplain"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.8.desc"), 8, "marblepillar/plaindecor"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.9.desc"), 9, "marblepillar/plaingreek"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.10.desc"), 10, "marblepillar/plainplain"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.11.desc"), 11, "marblepillar/widedecor"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.12.desc"), 12, "marblepillar/widegreek"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.13.desc"), 13, "marblepillar/wideplain"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.14.desc"), 14, "marblepillar/carved"); - marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.15.desc"), 15, "marblepillar/ornamental"); - } - marblePillar.carverHelper.register(marblePillar, "marble_pillar"); - Carving.chisel.setGroupClass("marble_pillar", "marble"); - - marblePillarSlab = (BlockMarbleSlab) new BlockMarbleSlab(marblePillar).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeStone); - marblePillarSlab.carverHelper.setChiselBlockName("Marble Pillar Slab"); - if(Configurations.oldPillars) - { - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.0.desc"), 0, "marblepillarslabold/column"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.1.desc"), 1, "marblepillarslabold/capstone"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.2.desc"), 2, "marblepillarslabold/base"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.3.desc"), 3, "marblepillarslabold/small"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.4.desc"), 4, "marblepillarslabold/pillar-carved"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.5.desc"), 5, "marblepillarslabold/a1-stoneornamental-marblegreek"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.6.desc"), 6, "marblepillarslabold/a1-stonepillar-greek"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.7.desc"), 7, "marblepillarslabold/a1-stonepillar-plain"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.8.desc"), 8, "marblepillarslabold/a1-stonepillar-greektopplain"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.9.desc"), 9, "marblepillarslabold/a1-stonepillar-plaintopplain"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.10.desc"), 10, "marblepillarslabold/a1-stonepillar-greekbottomplain"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.11.desc"), 11, "marblepillarslabold/a1-stonepillar-plainbottomplain"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.12.desc"), 12, "marblepillarslabold/a1-stonepillar-greektopgreek"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.13.desc"), 13, "marblepillarslabold/a1-stonepillar-plaintopgreek"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.14.desc"), 14, "marblepillarslabold/a1-stonepillar-greekbottomgreek"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.15.desc"), 15, "marblepillarslabold/a1-stonepillar-plainbottomgreek"); - } else - { - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.0.desc"), 0, "marblepillarslab/pillar"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.1.desc"), 1, "marblepillarslab/default"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.2.desc"), 2, "marblepillarslab/simple"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.3.desc"), 3, "marblepillarslab/convex"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.4.desc"), 4, "marblepillarslab/rough"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.5.desc"), 5, "marblepillarslab/greekdecor"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.6.desc"), 6, "marblepillarslab/greekgreek"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.7.desc"), 7, "marblepillarslab/greekplain"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.8.desc"), 8, "marblepillarslab/plaindecor"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.9.desc"), 9, "marblepillarslab/plaingreek"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.10.desc"), 10, "marblepillarslab/plainplain"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.11.desc"), 11, "marblepillarslab/widedecor"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.12.desc"), 12, "marblepillarslab/widegreek"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.13.desc"), 13, "marblepillarslab/wideplain"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.14.desc"), 14, "marblepillarslab/carved"); - marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.15.desc"), 15, "marblepillarslab/ornamental"); - } - marblePillarSlab.carverHelper.register(marblePillarSlab, "marble_pillar_slab", ItemMarbleSlab.class); - } - - BlockMarbleStairsMaker makerMarbleStairs = new BlockMarbleStairsMaker(marble); - makerMarbleStairs.carverHelper.setChiselBlockName("Marble Stairs"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.0.desc"), 0, "marble"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.6.desc"), 1, "marbleslab/a1-stoneornamental-marblebrick"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.2.desc"), 2, "marbleslab/a1-stoneornamental-marbleclassicpanel"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.3.desc"), 3, "marbleslab/a1-stoneornamental-marbleornate"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.4.desc"), 4, "marbleslab/a1-stoneornamental-marblepanel"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.5.desc"), 5, "marbleslab/terrain-pistonback-marble"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.6.desc"), 6, "marbleslab/terrain-pistonback-marblecreeperdark"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.7.desc"), 7, "marbleslab/terrain-pistonback-marblecreeperlight"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.8.desc"), 8, "marbleslab/a1-stoneornamental-marblecarved"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.9.desc"), 9, "marbleslab/a1-stoneornamental-marblecarvedradial"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.10.desc"), 10, "marbleslab/terrain-pistonback-marbledent"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.11.desc"), 11, "marbleslab/terrain-pistonback-marbledent-small"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.12.desc"), 12, "marbleslab/marble-bricks"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.13.desc"), 13, "marbleslab/marble-arranged-bricks"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.14.desc"), 14, "marbleslab/marble-fancy-bricks"); - makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.15.desc"), 15, "marbleslab/marble-blocks"); - makerMarbleStairs.create("marble_stairs"); - } - - if(Configurations.featureEnabled("limestone")) - { - limestone = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeStone); - limestone.carverHelper.setChiselBlockName("Limestone"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.0.desc"), 0, "limestone"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.1.desc"), 1, "limestone/terrain-cobbsmalltilelight"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.2.desc"), 2, "limestone/terrain-cob-frenchlight"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.3.desc"), 3, "limestone/terrain-cob-french2light"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.4.desc"), 4, "limestone/terrain-cobmoss-creepdungeonlight"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.5.desc"), 5, "limestone/terrain-cob-smallbricklight"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.6.desc"), 6, "limestone/terrain-mossysmalltilelight"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.7.desc"), 7, "limestone/terrain-pistonback-dungeon"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.8.desc"), 8, "limestone/terrain-pistonback-dungeonornate"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.9.desc"), 9, "limestone/terrain-pistonback-dungeonvent"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.10.desc"), 10, "limestone/terrain-pistonback-lightcreeper"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.11.desc"), 11, "limestone/terrain-pistonback-lightdent"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.12.desc"), 12, "limestone/terrain-pistonback-lightemboss"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.13.desc"), 13, "limestone/terrain-pistonback-lightfour"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.14.desc"), 14, "limestone/terrain-pistonback-lightmarker"); - limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.15.desc"), 15, "limestone/terrain-pistonback-lightpanel"); - limestone.carverHelper.register(limestone, "limestone"); - OreDictionary.registerOre("limestone", limestone); - Carving.chisel.registerOre("limestone", "limestone"); - - limestoneSlab = (BlockMarbleSlab) new BlockMarbleSlab(limestone).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); - limestoneSlab.carverHelper.setChiselBlockName("Limestone Slab"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.0.desc"), 0, "limestone"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.1.desc"), 1, "limestone/terrain-cobbsmalltilelight"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.2.desc"), 2, "limestone/terrain-cob-frenchlight"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.3.desc"), 3, "limestone/terrain-cob-french2light"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.4.desc"), 4, "limestone/terrain-cobmoss-creepdungeonlight"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.5.desc"), 5, "limestone/terrain-cob-smallbricklight"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.6.desc"), 6, "limestone/terrain-mossysmalltilelight"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.7.desc"), 7, "limestone/terrain-pistonback-dungeon"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.8.desc"), 8, "limestone/terrain-pistonback-dungeonornate"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.9.desc"), 9, "limestone/terrain-pistonback-dungeonvent"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.10.desc"), 10, "limestone/terrain-pistonback-lightcreeper"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.11.desc"), 11, "limestone/terrain-pistonback-lightdent"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.12.desc"), 12, "limestone/terrain-pistonback-lightemboss"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.13.desc"), 13, "limestone/terrain-pistonback-lightfour"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.14.desc"), 14, "limestone/terrain-pistonback-lightmarker"); - limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.15.desc"), 15, "limestone/terrain-pistonback-lightpanel"); - limestoneSlab.carverHelper.register(limestoneSlab, "limestone_slab", ItemMarbleSlab.class); - Carving.chisel.registerOre("limestone_slab", "limestone_slab"); - - BlockMarbleStairsMaker makerLimestoneStairs = new BlockMarbleStairsMaker(limestone); - makerLimestoneStairs.carverHelper.setChiselBlockName("Limestone Stairs"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.0.desc"), 0, "limestone"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.1.desc"), 1, "limestone/terrain-cobbsmalltilelight"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.2.desc"), 2, "limestone/terrain-cob-frenchlight"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.3.desc"), 3, "limestone/terrain-cob-french2light"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.4.desc"), 4, "limestone/terrain-cobmoss-creepdungeonlight"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.5.desc"), 5, "limestone/terrain-cob-smallbricklight"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.6.desc"), 6, "limestone/terrain-mossysmalltilelight"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.7.desc"), 7, "limestone/terrain-pistonback-dungeon"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.8.desc"), 8, "limestone/terrain-pistonback-dungeonornate"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.9.desc"), 9, "limestone/terrain-pistonback-dungeonvent"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.10.desc"), 10, "limestone/terrain-pistonback-lightcreeper"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.11.desc"), 11, "limestone/terrain-pistonback-lightdent"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.12.desc"), 12, "limestone/terrain-pistonback-lightemboss"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.13.desc"), 13, "limestone/terrain-pistonback-lightfour"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.14.desc"), 14, "limestone/terrain-pistonback-lightmarker"); - makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.15.desc"), 15, "limestone/terrain-pistonback-lightpanel"); - makerLimestoneStairs.create("limestone_stairs"); - Carving.chisel.registerOre("limestone_stairs", "limestone_stairs"); - } - - if(Configurations.featureEnabled("cobblestone")) - { - cobblestone = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("cobblestone", Blocks.cobblestone, 0, 0); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.0.desc"), 1, "cobblestone/terrain-cobb-brickaligned"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.1.desc"), 2, "cobblestone/terrain-cob-detailedbrick"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.2.desc"), 3, "cobblestone/terrain-cob-smallbrick"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.3.desc"), 4, "cobblestone/terrain-cobblargetiledark"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.4.desc"), 5, "cobblestone/terrain-cobbsmalltile"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.5.desc"), 6, "cobblestone/terrain-cob-french"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.6.desc"), 7, "cobblestone/terrain-cob-french2"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.7.desc"), 8, "cobblestone/terrain-cobmoss-creepdungeon"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.8.desc"), 9, "cobblestone/terrain-mossysmalltiledark"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.9.desc"), 10, "cobblestone/terrain-pistonback-dungeontile"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.10.desc"), 11, "cobblestone/terrain-pistonback-darkcreeper"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.11.desc"), 12, "cobblestone/terrain-pistonback-darkdent"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.12.desc"), 13, "cobblestone/terrain-pistonback-darkemboss"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.13.desc"), 14, "cobblestone/terrain-pistonback-darkmarker"); - cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.14.desc"), 15, "cobblestone/terrain-pistonback-darkpanel"); - cobblestone.carverHelper.register(cobblestone, "cobblestone"); - Carving.chisel.registerOre("cobblestone", "cobblestone"); - } - - if(Configurations.featureEnabled("glass")) - { - glass = (BlockCarvableGlass) new BlockCarvableGlass().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.3F).setStepSound(Block.soundTypeGlass); - Carving.chisel.addVariation("glass", Blocks.glass, 0, 0); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.1.desc"), 1, "glass/terrain-glassbubble"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.2.desc"), 2, "glass/terrain-glass-chinese"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.3.desc"), 3, "glass/japanese"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.4.desc"), 4, "glass/terrain-glassdungeon"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.5.desc"), 5, "glass/terrain-glasslight"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.6.desc"), 6, "glass/terrain-glassnoborder"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.7.desc"), 7, "glass/terrain-glass-ornatesteel"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.8.desc"), 8, "glass/terrain-glass-screen"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.9.desc"), 9, "glass/terrain-glassshale"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.10.desc"), 10, "glass/terrain-glass-steelframe"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.11.desc"), 11, "glass/terrain-glassstone"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.12.desc"), 12, "glass/terrain-glassstreak"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.13.desc"), 13, "glass/terrain-glass-thickgrid"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.14.desc"), 14, "glass/terrain-glass-thingrid"); - glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.15.desc"), 15, "glass/a1-glasswindow-ironfencemodern"); - glass.carverHelper.register(glass, "glass"); - Carving.chisel.registerOre("glass", "glass"); - } - - if(Configurations.featureEnabled("sandstone")) - { - sandstone = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone).setHardness(0.8F); - Carving.chisel.addVariation("sandstone", Blocks.sandstone, 0, 0); - Carving.chisel.addVariation("sandstone", Blocks.sandstone, 1, 1); - Carving.chisel.addVariation("sandstone", Blocks.sandstone, 2, 2); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.3.desc"), 3, "sandstone/faded"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.4.desc"), 4, "sandstone/column"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.5.desc"), 5, "sandstone/capstone"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.6.desc"), 6, "sandstone/small"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.7.desc"), 7, "sandstone/base"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.8.desc"), 8, "sandstone/smooth"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.9.desc"), 9, "sandstone/smooth-cap"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.10.desc"), 10, "sandstone/smooth-small"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.11.desc"), 11, "sandstone/smooth-base"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.12.desc"), 12, "sandstone/block"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.13.desc"), 13, "sandstone/blocks"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.14.desc"), 14, "sandstone/mosaic"); - sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.15.desc"), 15, "sandstone/horizontal-tiles"); - sandstone.carverHelper.register(sandstone, "sandstone"); - Carving.chisel.registerOre("sandstone", "sandstone"); - - if(Configurations.featureEnabled("snakeSandstone")) - { - sandSnakestone = (BlockSnakestone) new BlockSnakestone("Chisel:snakestone/sandsnake/").setCreativeTab(ModTabs.tabStoneChiselBlocks).setBlockName("snakestoneSand"); - GameRegistry.registerBlock(sandSnakestone, 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", sandSnakestone, 1, 16); - Carving.chisel.addVariation("sandstone", sandSnakestone, 13, 17); - Carving.chisel.registerOre("sandSnakestone", "sandSnakestone"); - } - } - - if(Configurations.featureEnabled("sandstoneScribbles")) - { - sandstoneScribbles = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone).setHardness(0.8F); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 0, "sandstone-scribbles/scribbles-0"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 1, "sandstone-scribbles/scribbles-1"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 2, "sandstone-scribbles/scribbles-2"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 3, "sandstone-scribbles/scribbles-3"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 4, "sandstone-scribbles/scribbles-4"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 5, "sandstone-scribbles/scribbles-5"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 6, "sandstone-scribbles/scribbles-6"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 7, "sandstone-scribbles/scribbles-7"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 8, "sandstone-scribbles/scribbles-8"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 9, "sandstone-scribbles/scribbles-9"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 10, "sandstone-scribbles/scribbles-10"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 11, "sandstone-scribbles/scribbles-11"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 12, "sandstone-scribbles/scribbles-12"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 13, "sandstone-scribbles/scribbles-13"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 14, "sandstone-scribbles/scribbles-14"); - sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 15, "sandstone-scribbles/scribbles-15"); - sandstoneScribbles.carverHelper.register(sandstoneScribbles, "sandstone_scribbles"); - Carving.chisel.registerOre("sandstone_scribbles", "sandstone_scribbles"); - } - - if(Configurations.featureEnabled("concrete")) - { - concrete = (BlockConcrete) new BlockConcrete().setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(0.5F); - concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.0.desc"), 0, "concrete/default"); - concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.1.desc"), 1, "concrete/block"); - concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.2.desc"), 2, "concrete/doubleslab"); - concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.3.desc"), 3, "concrete/blocks"); - concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.4.desc"), 4, "concrete/weathered"); - concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.5.desc"), 5, "concrete/weathered-block"); - concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.6.desc"), 6, "concrete/weathered-doubleslab"); - concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.7.desc"), 7, "concrete/weathered-blocks"); - concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.8.desc"), 8, "concrete/weathered-half"); - concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.9.desc"), 9, "concrete/weathered-block-half"); - concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.10.desc"), 10, "concrete/asphalt"); - concrete.carverHelper.register(concrete, "concrete"); - OreDictionary.registerOre("concrete", concrete); - Carving.chisel.registerOre("concrete", "concrete"); - } - - if(Configurations.featureEnabled("roadLine")) - { - roadLine = (BlockRoadLine) new BlockRoadLine().setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.01F).setBlockName("roadLine"); - GameRegistry.registerBlock(roadLine, ItemCarvable.class, "road_line"); - Carving.chisel.registerOre("roadLine", "roadLine"); - } - - if(Configurations.featureEnabled("ironBlock")) - { - iron = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(5F).setResistance(10F).setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("iron_block", Blocks.iron_block, 0, 0); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.1.desc"), 1, "iron/terrain-iron-largeingot"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.2.desc"), 2, "iron/terrain-iron-smallingot"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.3.desc"), 3, "iron/terrain-iron-gears"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.4.desc"), 4, "iron/terrain-iron-brick"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.5.desc"), 5, "iron/terrain-iron-plates"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.6.desc"), 6, "iron/terrain-iron-rivets"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.7.desc"), 7, "iron/terrain-iron-coin-heads"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.8.desc"), 8, "iron/terrain-iron-coin-tails"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.9.desc"), 9, "iron/terrain-iron-crate-dark"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.10.desc"), 10, "iron/terrain-iron-crate-light"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.11.desc"), 11, "iron/terrain-iron-moon"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.12.desc"), 12, "iron/terrain-iron-space"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.13.desc"), 13, "iron/terrain-iron-spaceblack"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.14.desc"), 14, "iron/terrain-iron-vents"); - iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.15.desc"), 15, "iron/terrain-iron-simple"); - iron.carverHelper.register(iron, "iron_block"); - Carving.chisel.registerOre("iron_block", "iron"); - } - - if(Configurations.featureEnabled("goldBlock")) - { - gold = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(3F).setResistance(10F).setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("gold_block", Blocks.gold_block, 0, 0); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.1.desc"), 1, "gold/terrain-gold-largeingot"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.2.desc"), 2, "gold/terrain-gold-smallingot"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.3.desc"), 3, "gold/terrain-gold-brick"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.4.desc"), 4, "gold/terrain-gold-cart"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.5.desc"), 5, "gold/terrain-gold-coin-heads"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.6.desc"), 6, "gold/terrain-gold-coin-tails"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.7.desc"), 7, "gold/terrain-gold-crate-dark"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.8.desc"), 8, "gold/terrain-gold-crate-light"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.9.desc"), 9, "gold/terrain-gold-plates"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.10.desc"), 10, "gold/terrain-gold-rivets"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.11.desc"), 11, "gold/terrain-gold-star"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.12.desc"), 12, "gold/terrain-gold-space"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.13.desc"), 13, "gold/terrain-gold-spaceblack"); - gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.14.desc"), 14, "gold/terrain-gold-simple"); - gold.carverHelper.register(gold, "gold_block"); - Carving.chisel.registerOre("gold_block", "gold"); - } - - if(Configurations.featureEnabled("diamondBlock")) - { - diamond = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(5F).setResistance(10F).setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("diamond_block", Blocks.diamond_block, 0, 0); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.1.desc"), 1, "diamond/terrain-diamond-embossed"); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.2.desc"), 2, "diamond/terrain-diamond-gem"); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.3.desc"), 3, "diamond/terrain-diamond-cells"); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.4.desc"), 4, "diamond/terrain-diamond-space"); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.5.desc"), 5, "diamond/terrain-diamond-spaceblack"); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.6.desc"), 6, "diamond/terrain-diamond-simple"); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.7.desc"), 7, "diamond/terrain-diamond-bismuth"); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.8.desc"), 8, "diamond/terrain-diamond-crushed"); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.9.desc"), 9, "diamond/terrain-diamond-four"); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.10.desc"), 10, "diamond/terrain-diamond-fourornate"); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.11.desc"), 11, "diamond/terrain-diamond-zelda"); - diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.12.desc"), 12, "diamond/terrain-diamond-ornatelayer"); - diamond.carverHelper.register(diamond, "diamond_block"); - Carving.chisel.registerOre("diamond_block", "diamond"); - } - - if(Configurations.featureEnabled("glowstone")) - { - lightstone = (BlockLightstoneCarvable) new BlockLightstoneCarvable().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.3F).setLightLevel(1.0F).setStepSound(Block.soundTypeGlass); - Carving.chisel.addVariation("glowstone", Blocks.glowstone, 0, 0); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.1.desc"), 1, "lightstone/terrain-sulphur-cobble"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.2.desc"), 2, "lightstone/terrain-sulphur-corroded"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.3.desc"), 3, "lightstone/terrain-sulphur-glass"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.4.desc"), 4, "lightstone/terrain-sulphur-neon"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.5.desc"), 5, "lightstone/terrain-sulphur-ornate"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.6.desc"), 6, "lightstone/terrain-sulphur-rocky"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.7.desc"), 7, "lightstone/terrain-sulphur-shale"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.8.desc"), 8, "lightstone/terrain-sulphur-tile"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.9.desc"), 9, "lightstone/terrain-sulphur-weavelanternlight"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.10.desc"), 10, "lightstone/a1-glowstone-cobble"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.11.desc"), 11, "lightstone/a1-glowstone-growth"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.12.desc"), 12, "lightstone/a1-glowstone-layers"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.13.desc"), 13, "lightstone/a1-glowstone-tilecorroded"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.14.desc"), 14, "lightstone/glowstone-bismuth"); - lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.15.desc"), 15, "lightstone/glowstone-bismuth-panel"); - lightstone.carverHelper.register(lightstone, "glowstone"); - Carving.chisel.registerOre("glowstone", "glowstone"); - } - - if(Configurations.featureEnabled("lapisBlock")) - { - lapis = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(3F).setResistance(5F).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("lapis_block", Blocks.lapis_block, 0, 0); - lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.1.desc"), 1, "lapis/terrain-lapisblock-chunky"); - lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.2.desc"), 2, "lapis/terrain-lapisblock-panel"); - lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.3.desc"), 3, "lapis/terrain-lapisblock-zelda"); - lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.4.desc"), 4, "lapis/terrain-lapisornate"); - lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.5.desc"), 5, "lapis/terrain-lapistile"); - lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.6.desc"), 6, "lapis/a1-blocklapis-panel"); - lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.7.desc"), 7, "lapis/a1-blocklapis-smooth"); - lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.8.desc"), 8, "lapis/a1-blocklapis-ornatelayer"); - lapis.carverHelper.register(lapis, "lapis_block"); - Carving.chisel.registerOre("lapis_block", "lapis"); - } - - if(Configurations.featureEnabled("emeraldBlock")) - { - emerald = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("emerald_block", Blocks.emerald_block, 0, 0); - emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.1.desc"), 1, "emerald/panel"); - emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.2.desc"), 2, "emerald/panelclassic"); - emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.3.desc"), 3, "emerald/smooth"); - emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.4.desc"), 4, "emerald/chunk"); - emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.5.desc"), 5, "emerald/goldborder"); - emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.6.desc"), 6, "emerald/zelda"); - emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.7.desc"), 7, "emerald/cell"); - emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.8.desc"), 8, "emerald/cellbismuth"); - emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.9.desc"), 9, "emerald/four"); - emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.10.desc"), 10, "emerald/fourornate"); - emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.11.desc"), 11, "emerald/ornate"); - emerald.carverHelper.register(emerald, "emerald_block"); - Carving.chisel.registerOre("emerald_block", "emerald"); - } - - if(Configurations.featureEnabled("netherBrick")) - { - netherBrick = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.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); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.1.desc"), 1, "netherbrick/a1-netherbrick-brinstar"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.2.desc"), 2, "netherbrick/a1-netherbrick-classicspatter"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.3.desc"), 3, "netherbrick/a1-netherbrick-guts"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.4.desc"), 4, "netherbrick/a1-netherbrick-gutsdark"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.5.desc"), 5, "netherbrick/a1-netherbrick-gutssmall"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.6.desc"), 6, "netherbrick/a1-netherbrick-lavabrinstar"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.7.desc"), 7, "netherbrick/a1-netherbrick-lavabrown"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.8.desc"), 8, "netherbrick/a1-netherbrick-lavaobsidian"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.9.desc"), 9, "netherbrick/a1-netherbrick-lavastonedark"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.10.desc"), 10, "netherbrick/a1-netherbrick-meat"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.11.desc"), 11, "netherbrick/a1-netherbrick-meatred"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.12.desc"), 12, "netherbrick/a1-netherbrick-meatredsmall"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.13.desc"), 13, "netherbrick/a1-netherbrick-meatsmall"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.14.desc"), 14, "netherbrick/a1-netherbrick-red"); - netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.15.desc"), 15, "netherbrick/a1-netherbrick-redsmall"); - netherBrick.carverHelper.register(netherBrick, "nether_brick"); - Carving.chisel.registerOre("nether_brick", "nether_brick"); - } - - if(Configurations.featureEnabled("netherRack")) - { - netherrack = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(0.4F).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("netherrack", Blocks.netherrack, 0, 0); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.1.desc"), 1, "netherrack/a1-netherrack-bloodgravel"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.2.desc"), 2, "netherrack/a1-netherrack-bloodrock"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.3.desc"), 3, "netherrack/a1-netherrack-bloodrockgrey"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.4.desc"), 4, "netherrack/a1-netherrack-brinstar"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.5.desc"), 5, "netherrack/a1-netherrack-brinstarshale"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.6.desc"), 6, "netherrack/a1-netherrack-classic"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.7.desc"), 7, "netherrack/a1-netherrack-classicspatter"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.8.desc"), 8, "netherrack/a1-netherrack-guts"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.9.desc"), 9, "netherrack/a1-netherrack-gutsdark"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.10.desc"), 10, "netherrack/a1-netherrack-meat"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.11.desc"), 11, "netherrack/a1-netherrack-meatred"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.12.desc"), 12, "netherrack/a1-netherrack-meatrock"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.13.desc"), 13, "netherrack/a1-netherrack-red"); - netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.14.desc"), 14, "netherrack/a1-netherrack-wells"); - netherrack.carverHelper.register(netherrack, "netherrack"); - Carving.chisel.registerOre("netherrack", "netherrack"); - } - - if(Configurations.featureEnabled("cobblestoneMossy")) - { - cobblestoneMossy = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("mossy_cobblestone", Blocks.mossy_cobblestone, 0, 0); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.1.desc"), 1, "cobblestonemossy/terrain-cobb-brickaligned"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.2.desc"), 2, "cobblestonemossy/terrain-cob-detailedbrick"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.3.desc"), 3, "cobblestonemossy/terrain-cob-smallbrick"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.4.desc"), 4, "cobblestonemossy/terrain-cobblargetiledark"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.5.desc"), 5, "cobblestonemossy/terrain-cobbsmalltile"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.6.desc"), 6, "cobblestonemossy/terrain-cob-french"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.7.desc"), 7, "cobblestonemossy/terrain-cob-french2"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.8.desc"), 8, "cobblestonemossy/terrain-cobmoss-creepdungeon"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.9.desc"), 9, "cobblestonemossy/terrain-mossysmalltiledark"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.10.desc"), 10, "cobblestonemossy/terrain-pistonback-dungeontile"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.11.desc"), 11, "cobblestonemossy/terrain-pistonback-darkcreeper"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.12.desc"), 12, "cobblestonemossy/terrain-pistonback-darkdent"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.13.desc"), 13, "cobblestonemossy/terrain-pistonback-darkemboss"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.14.desc"), 14, "cobblestonemossy/terrain-pistonback-darkmarker"); - cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.15.desc"), 15, "cobblestonemossy/terrain-pistonback-darkpanel"); - cobblestoneMossy.carverHelper.register(cobblestoneMossy, "mossy_cobblestone"); - Carving.chisel.registerOre("mossy_cobblestone", "mossy_cobblestone"); - } - - if(Configurations.featureEnabled("stoneBrick")) - { - stoneBrick = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(1.5F).setResistance(10.0F).setStepSound(Block.soundTypeStone); - for(int i = 0; i < 4; i++) - { - if(i == 1) - { - if(Configurations.allowMossy) - Carving.chisel.addVariation("stonebricksmooth", Blocks.stonebrick, i, i); - } else - Carving.chisel.addVariation("stonebricksmooth", Blocks.stonebrick, i, i); - } - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.4.desc"), 4, "stonebrick/smallbricks"); - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.5.desc"), 5, "stonebrick/largebricks"); - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.6.desc"), 6, "stonebrick/smallchaotic"); - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.7.desc"), 7, "stonebrick/chaoticbricks"); - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.8.desc"), 8, "stonebrick/chaotic"); - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.9.desc"), 9, "stonebrick/fancy"); - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.10.desc"), 10, "stonebrick/ornate"); - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.11.desc"), 11, "stonebrick/largeornate"); - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.12.desc"), 12, "stonebrick/panel-hard"); - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.13.desc"), 13, "stonebrick/sunken"); - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.14.desc"), 14, "stonebrick/ornatepanel"); - stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.15.desc"), 15, "stonebrick/poison"); - stoneBrick.carverHelper.register(stoneBrick, "stonebricksmooth"); - Carving.chisel.registerOre("stonebricksmooth", "stonebricksmooth"); - } - - if(Configurations.featureEnabled("snakestone")) - { - snakestone = (BlockSnakestone) new BlockSnakestone("Chisel:snakestone/snake/").setBlockName("snakestoneStone").setCreativeTab(ModTabs.tabStoneChiselBlocks); - GameRegistry.registerBlock(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", snakestone, 1, 16); - Carving.chisel.addVariation("stonebrick", snakestone, 13, 17); - Carving.chisel.registerOre("snakestoneStone", "snakestoneStone"); - } - - if(Configurations.featureEnabled("dirt")) - { - dirt = (BlockCarvable) new BlockCarvable(Material.ground).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setStepSound(Block.soundTypeGravel).setBlockName("dirt.default"); - Carving.chisel.addVariation("dirt", Blocks.dirt, 0, 0); - dirt.carverHelper.setChiselBlockName("Dirt"); - //dirt.carverHelper.addVariation("Dirt", 0, Blocks.dirt); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.0.desc"), 0, "dirt/bricks"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.1.desc"), 1, "dirt/netherbricks"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.2.desc"), 2, "dirt/bricks3"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.3.desc"), 3, "dirt/cobble"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.4.desc"), 4, "dirt/reinforcedCobbleDirt"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.5.desc"), 5, "dirt/reinforcedDirt"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.6.desc"), 6, "dirt/happy"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.7.desc"), 7, "dirt/bricks2"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.8.desc"), 8, "dirt/bricks+dirt2"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.9.desc"), 9, "dirt/hor"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.10.desc"), 10, "dirt/vert"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.11.desc"), 11, "dirt/layers"); - dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.12.desc"), 12, "dirt/vertical"); - dirt.carverHelper.register(dirt, "dirt"); - dirt.setHarvestLevel("shovel", 0); - OreDictionary.registerOre("dirt", dirt); - Carving.chisel.registerOre("dirt", "dirt"); - } - - if(Configurations.featureEnabled("ice")) - { - ice = (BlockMarbleIce) new BlockMarbleIce().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3).setStepSound(Block.soundTypeGlass); - Carving.chisel.addVariation("ice", Blocks.ice, 0, 0); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.1.desc"), 1, "ice/a1-ice-light"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.2.desc"), 2, "ice/a1-stonecobble-icecobble"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.3.desc"), 3, "ice/a1-netherbrick-ice"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.4.desc"), 4, "ice/a1-stonecobble-icebrick"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.5.desc"), 5, "ice/a1-stonecobble-icebricksmall"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.6.desc"), 6, "ice/a1-stonecobble-icedungeon"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.7.desc"), 7, "ice/a1-stonecobble-icefour"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.8.desc"), 8, "ice/a1-stonecobble-icefrench"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.9.desc"), 9, "ice/sunkentiles"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.10.desc"), 10, "ice/tiles"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.11.desc"), 11, "ice/a1-stonecobble-icepanel"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.12.desc"), 12, "ice/a1-stoneslab-ice"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.13.desc"), 13, "ice/zelda"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.14.desc"), 14, "ice/bismuth"); - ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.15.desc"), 15, "ice/poison"); - ice.carverHelper.register(ice, "ice"); - Carving.chisel.registerOre("ice", "ice"); - - if(Configurations.featureEnabled("icePillar")) - { - icePillar = (BlockMarbleIce) new BlockMarbleIce().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3).setStepSound(Block.soundTypeGlass); - icePillar.carverHelper.setChiselBlockName("Ice Pillar"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.0.desc"), 0, "icepillar/column"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.1.desc"), 1, "icepillar/capstone"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.2.desc"), 2, "icepillar/base"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.3.desc"), 3, "icepillar/small"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.4.desc"), 4, "icepillar/pillar-carved"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.5.desc"), 5, "icepillar/a1-stoneornamental-marblegreek"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.6.desc"), 6, "icepillar/a1-stonepillar-greek"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.7.desc"), 7, "icepillar/a1-stonepillar-plain"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.8.desc"), 8, "icepillar/a1-stonepillar-greektopplain"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.9.desc"), 9, "icepillar/a1-stonepillar-plaintopplain"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.10.desc"), 10, "icepillar/a1-stonepillar-greekbottomplain"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.11.desc"), 11, "icepillar/a1-stonepillar-plainbottomplain"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.12.desc"), 12, "icepillar/a1-stonepillar-greektopgreek"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.13.desc"), 13, "icepillar/a1-stonepillar-plaintopgreek"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.14.desc"), 14, "icepillar/a1-stonepillar-greekbottomgreek"); - icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.15.desc"), 15, "icepillar/a1-stonepillar-plainbottomgreek"); - icePillar.carverHelper.register(icePillar, "ice_pillar"); - Carving.chisel.setGroupClass("ice_pillar", "ice"); - } - - if(Configurations.featureEnabled("iceStairs")) - { - BlockMarbleStairsMaker makerIceStairs = new BlockMarbleStairsMaker(Blocks.ice); - makerIceStairs.carverHelper.setChiselBlockName("Ice Stairs"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.0.desc"), 0, Blocks.ice); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.1.desc"), 1, "ice/a1-ice-light"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.2.desc"), 2, "ice/a1-stonecobble-icecobble"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.3.desc"), 3, "ice/a1-netherbrick-ice"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.4.desc"), 4, "ice/a1-stonecobble-icebrick"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.5.desc"), 5, "ice/a1-stonecobble-icebricksmall"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.6.desc"), 6, "ice/a1-stonecobble-icedungeon"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.7.desc"), 7, "ice/a1-stonecobble-icefour"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.8.desc"), 8, "ice/a1-stonecobble-icefrench"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.9.desc"), 9, "ice/sunkentiles"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.10.desc"), 10, "ice/tiles"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.11.desc"), 11, "ice/a1-stonecobble-icepanel"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.12.desc"), 12, "ice/a1-stoneslab-ice"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.13.desc"), 13, "ice/zelda"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.14.desc"), 14, "ice/bismuth"); - makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.15.desc"), 15, "ice/poison"); - makerIceStairs.create(new BlockMarbleStairsMakerCreator() - { - @Override - public BlockMarbleStairs create(Block block, int meta, CarvableHelper helper) - { - return new BlockMarbleIceStairs(block, meta, helper); - } - }, "ice_stairs"); - Carving.chisel.registerOre("iceStairs", "iceStairs"); - } - } - if(Configurations.featureEnabled("packedice")) - { - packedice = (BlockMarblePackedIce) new BlockMarblePackedIce().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3).setStepSound(Block.soundTypeGlass); - Carving.chisel.addVariation("packedice", Blocks.packed_ice, 0, 0); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.1.desc"), 1, "packedice/a1-ice-light"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.2.desc"), 2, "packedice/a1-stonecobble-icecobble"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.3.desc"), 3, "packedice/a1-netherbrick-ice"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.4.desc"), 4, "packedice/a1-stonecobble-icebrick"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.5.desc"), 5, "packedice/a1-stonecobble-icebricksmall"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.6.desc"), 6, "packedice/a1-stonecobble-icedungeon"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.7.desc"), 7, "packedice/a1-stonecobble-icefour"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.8.desc"), 8, "packedice/a1-stonecobble-icefrench"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.9.desc"), 9, "packedice/sunkentiles"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.10.desc"), 10, "packedice/tiles"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.11.desc"), 11, "packedice/a1-stonecobble-icepanel"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.12.desc"), 12, "packedice/a1-stoneslab-ice"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.13.desc"), 13, "packedice/zelda"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.14.desc"), 14, "packedice/bismuth"); - packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.15.desc"), 15, "packedice/poison"); - packedice.carverHelper.register(packedice, "packedice"); - Carving.chisel.registerOre("packedice", "packedice"); - - if(Configurations.featureEnabled("packedicePillar")) - { - packedicePillar = (BlockMarblePackedIce) new BlockMarblePackedIce().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3).setStepSound(Block.soundTypeGlass); - packedicePillar.carverHelper.setChiselBlockName("Packed Ice Pillar"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.0.desc"), 0, "packedicepillar/column"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.1.desc"), 1, "packedicepillar/capstone"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.2.desc"), 2, "packedicepillar/base"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.3.desc"), 3, "packedicepillar/small"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.4.desc"), 4, "packedicepillar/pillar-carved"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.5.desc"), 5, "packedicepillar/a1-stoneornamental-marblegreek"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.6.desc"), 6, "packedicepillar/a1-stonepillar-greek"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.7.desc"), 7, "packedicepillar/a1-stonepillar-plain"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.8.desc"), 8, "packedicepillar/a1-stonepillar-greektopplain"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.9.desc"), 9, "packedicepillar/a1-stonepillar-plaintopplain"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.10.desc"), 10, "packedicepillar/a1-stonepillar-greekbottomplain"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.11.desc"), 11, "packedicepillar/a1-stonepillar-plainbottomplain"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.12.desc"), 12, "packedicepillar/a1-stonepillar-greektopgreek"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.13.desc"), 13, "packedicepillar/a1-stonepillar-plaintopgreek"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.14.desc"), 14, "packedicepillar/a1-stonepillar-greekbottomgreek"); - packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.15.desc"), 15, "packedicepillar/a1-stonepillar-plainbottomgreek"); - packedicePillar.carverHelper.register(packedicePillar, "packedice_pillar"); - Carving.chisel.setGroupClass("packedice_pillar", "packedice"); - } - - if(Configurations.featureEnabled("packediceStairs")) - { - BlockMarbleStairsMaker makerPackedIceStairs = new BlockMarbleStairsMaker(Blocks.packed_ice); - makerPackedIceStairs.carverHelper.setChiselBlockName("Packed Ice Stairs"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.0.desc"), 0, Blocks.packed_ice); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.1.desc"), 1, "packedice/a1-ice-light"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.2.desc"), 2, "packedice/a1-stonecobble-icecobble"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.3.desc"), 3, "packedice/a1-netherbrick-ice"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.4.desc"), 4, "packedice/a1-stonecobble-icebrick"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.5.desc"), 5, "packedice/a1-stonecobble-icebricksmall"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.6.desc"), 6, "packedice/a1-stonecobble-icedungeon"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.7.desc"), 7, "packedice/a1-stonecobble-icefour"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.8.desc"), 8, "packedice/a1-stonecobble-icefrench"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.9.desc"), 9, "packedice/sunkentiles"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.10.desc"), 10, "packedice/tiles"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.11.desc"), 11, "packedice/a1-stonecobble-icepanel"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.12.desc"), 12, "packedice/a1-stoneslab-ice"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.13.desc"), 13, "packedice/zelda"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.14.desc"), 14, "packedice/bismuth"); - makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.15.desc"), 15, "packedice/poison"); - makerPackedIceStairs.create(new BlockMarbleStairsMakerCreator() - { - @Override - public BlockMarbleStairs create(Block block, int meta, CarvableHelper helper) - { - return new BlockMarblePackedIceStairs(block, meta, helper); - } - }, "packedice_stairs"); - Carving.chisel.registerOre("packedIceStairs", "packedIceStairs"); - } - } - - if(Configurations.featureEnabled("wood")) - { - String[] plank_names = { "oak", "spruce", "birch", "jungle", "acacia", "dark-oak" }; - String[] plank_ucnames = {"Oak", "Spruce", "Birch", "Jungle", "Acacia", "Dark Oak"}; - for(int i = 0; i < 6; i++) - { - String n = plank_names[i]; - String u = plank_ucnames[i]; - final String orename = n.replace('-', '_') + "_planks"; - - planks[i] = (BlockCarvable) (new BlockCarvable(Material.wood)).setCreativeTab(ModTabs.tabWoodChiselBlocks).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood); - planks[i].carverHelper.setChiselBlockName(u + " Wood Planks"); - planks[i].carverHelper.addVariation("Smooth " + n + " wood planks", 1, "planks-" + n + "/clean"); - planks[i].carverHelper.addVariation("Short " + n + " wood planks", 2, "planks-" + n + "/short"); - planks[i].carverHelper.addVariation("Fancy " + n + " wood plank arrangement", 6, "planks-" + n + "/fancy"); - planks[i].carverHelper.addVariation(u + " wood panel", 8, "planks-" + n + "/panel-nails"); - planks[i].carverHelper.addVariation(u + " wood double slab", 9, "planks-" + n + "/double"); - planks[i].carverHelper.addVariation(u + " wood crate", 10, "planks-" + n + "/crate"); - planks[i].carverHelper.addVariation("Fancy " + n + " wood crate", 11, "planks-" + n + "/crate-fancy"); - planks[i].carverHelper.addVariation("Large long " + n + " wood planks", 13, "planks-" + n + "/large"); - planks[i].carverHelper.addVariation("Vertical " + n + " wood planks", 3, "planks-" + n + "/vertical"); - planks[i].carverHelper.addVariation("Vertical uneven " + n + " wood planks", 4, "planks-" + n + "/vertical-uneven"); - planks[i].carverHelper.addVariation(u + " wood parquet", 5, "planks-" + n + "/parquet"); - planks[i].carverHelper.addVariation(u + " wood plank blinds", 7, "planks-" + n + "/blinds"); - planks[i].carverHelper.addVariation(u + " wood scaffold", 12, "planks-" + n + "/crateex"); - planks[i].carverHelper.addVariation(u + " wood planks in disarray", 14, "planks-" + n + "/chaotic-hor"); - planks[i].carverHelper.addVariation("Vertical " + n + " wood planks in disarray", 15, "planks-" + n + "/chaotic"); - planks[i].carverHelper.register(planks[i], orename); - Carving.chisel.addVariation(orename, Blocks.planks, i, 0); - planks[i].setHarvestLevel("axe", 0); - Carving.chisel.registerOre("wood", "wood"); - Carving.chisel.setVariationSound(orename, Chisel.MOD_ID+":chisel.wood"); - } - } - - if(Configurations.featureEnabled("obsidian")) - { - obsidian = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(50.0F).setResistance(2000.0F).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("obsidian", Blocks.obsidian, 0, 0); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.1.desc"), 1, "obsidian/pillar"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.2.desc"), 2, "obsidian/pillar-quartz"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.3.desc"), 3, "obsidian/chiseled"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.4.desc"), 4, "obsidian/panel-shiny"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.5.desc"), 5, "obsidian/panel"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.6.desc"), 6, "obsidian/chunks"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.7.desc"), 7, "obsidian/growth"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.8.desc"), 8, "obsidian/crystal"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.9.desc"), 9, "obsidian/map-a"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.10.desc"), 10, "obsidian/map-b"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.11.desc"), 11, "obsidian/panel-light"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.12.desc"), 12, "obsidian/blocks"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.13.desc"), 13, "obsidian/tiles"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.14.desc"), 14, "obsidian/greek"); - obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.15.desc"), 15, "obsidian/crate"); - obsidian.carverHelper.register(obsidian, "obsidian"); - Carving.chisel.registerOre("obsidian", "obsidian"); - } - - if(Configurations.featureEnabled("snakestoneObsidian")) - { - obsidianSnakestone = (BlockSnakestoneObsidian) new BlockSnakestoneObsidian("Chisel:snakestone/obsidian/").setBlockName("obsidianSnakestone").setHardness(50.0F).setResistance(2000.0F); - GameRegistry.registerBlock(obsidianSnakestone, ItemCarvable.class, "obsidian_snakestone"); - Carving.chisel.addVariation("obsidian", obsidianSnakestone, 1, 16); - Carving.chisel.addVariation("obsidian", obsidianSnakestone, 13, 17); - Carving.chisel.registerOre("obsidianSnakestone", "obsidianSnakestone"); - } - - if(Configurations.featureEnabled("ironBars")) - { - paneIron = (BlockCarvablePane) new BlockCarvablePane(Material.iron, true).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.3F).setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("iron_bars", Blocks.iron_bars, 0, 0); - paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.1.desc"), 1, "ironpane/fenceIron"); - paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.2.desc"), 2, "ironpane/barbedwire"); - paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.3.desc"), 3, "ironpane/cage"); - paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.4.desc"), 4, "ironpane/fenceIronTop"); - paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.5.desc"), 5, "ironpane/terrain-glass-thickgrid"); - paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.6.desc"), 6, "ironpane/terrain-glass-thingrid"); - paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.7.desc"), 7, "ironpane/terrain-glass-ornatesteel"); - paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.8.desc"), 8, "ironpane/bars"); - paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.9.desc"), 9, "ironpane/spikes"); - paneIron.carverHelper.register(paneIron, "iron_bars"); - Carving.chisel.registerOre("iron_bars", "iron_bars"); - } - - if(Configurations.featureEnabled("glassPane")) - { - paneGlass = (BlockCarvablePane) new BlockCarvablePane(Material.glass, false).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.3F).setStepSound(Block.soundTypeGlass); - Carving.chisel.addVariation("glass_pane", Blocks.glass_pane, 0, 0); - paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.1.desc"), 1, "glasspane/terrain-glassbubble"); - paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.2.desc"), 2, "glasspane/terrain-glassnoborder"); - paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.3.desc"), 3, "glasspane/terrain-glass-screen"); - paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.4.desc"), 4, "glasspane/terrain-glassstreak"); - paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.12.desc"), 12, "glasspane/chinese"); - paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.13.desc"), 13, "glasspane/chinese2"); - paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.14.desc"), 14, "glasspane/japanese"); - paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.15.desc"), 15, "glasspane/japanese2"); - paneGlass.carverHelper.register(paneGlass, "glass_pane"); - Carving.chisel.registerOre("glass_pane", "glass_pane"); - } - - if(Configurations.featureEnabled("redstoneBlock")) - { - redstone = (BlockCarvablePowered) (new BlockCarvablePowered(Material.iron)).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal); - Carving.chisel.addVariation("redstone_block", Blocks.redstone_block, 0, 0); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.1.desc"), 1, "redstone/smooth"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.2.desc"), 2, "redstone/block"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.3.desc"), 3, "redstone/blocks"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.4.desc"), 4, "redstone/bricks"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.5.desc"), 5, "redstone/smallbricks"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.6.desc"), 6, "redstone/smallchaotic"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.7.desc"), 7, "redstone/chiseled"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.8.desc"), 8, "redstone/ere"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.9.desc"), 9, "redstone/ornate-tiles"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.10.desc"), 10, "redstone/pillar"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.11.desc"), 11, "redstone/tiles"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.12.desc"), 12, "redstone/circuit"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.13.desc"), 13, "redstone/supaplex"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.14.desc"), 14, "redstone/a1-blockredstone-skullred"); - redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.15.desc"), 15, "redstone/a1-blockredstone-redstonezelda"); - redstone.carverHelper.register(redstone, "redstone_block"); - Carving.chisel.registerOre("redstone_block", "redstone"); - } - - if(Configurations.featureEnabled("holystone")) - { - holystone = (BlockHolystone) new BlockHolystone(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Chisel.soundHolystoneFootstep); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.0.desc"), 0, "holystone/holystone"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.1.desc"), 1, "holystone/smooth"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.2.desc"), 2, "holystone/love"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.3.desc"), 3, "holystone/chiseled"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.4.desc"), 4, "holystone/blocks"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.5.desc"), 5, "holystone/blocks-rough"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.6.desc"), 6, "holystone/brick"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.7.desc"), 7, "holystone/largebricks"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.8.desc"), 8, "holystone/platform"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.9.desc"), 9, "holystone/platform-tiles"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.10.desc"), 10, "holystone/construction"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.11.desc"), 11, "holystone/fancy-tiles"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.12.desc"), 12, "holystone/plate"); - holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.13.desc"), 13, "holystone/plate-rough"); - holystone.carverHelper.register(holystone, "holystone"); - OreDictionary.registerOre("holystone", holystone); - Carving.chisel.registerOre("holystone", "holystone"); - } - - if(Configurations.featureEnabled("lavastone")) - { - lavastone = (BlockLavastone) new BlockLavastone(Material.rock, "lava_flow").setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); - lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.0.desc"), 0, "lavastone/cobble"); - lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.1.desc"), 1, "lavastone/black"); - lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.2.desc"), 2, "lavastone/tiles"); - lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.3.desc"), 3, "lavastone/chaotic"); - lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.4.desc"), 4, "lavastone/creeper"); - lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.5.desc"), 5, "lavastone/panel"); - lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.6.desc"), 6, "lavastone/panel-ornate"); - lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.7.desc"), 7, "lavastone/dark"); - lavastone.carverHelper.register(lavastone, "lavastone"); - OreDictionary.registerOre("lavastone", lavastone); - Carving.chisel.registerOre("lavastone", "lavastone"); - } - - if(Configurations.featureEnabled("fantasy")) - { - fantasy = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); - fantasy.carverHelper.setChiselBlockName("Fantasy Block"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.0.desc"), 0, "fantasy/brick"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.1.desc"), 1, "fantasy/brick-faded"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.2.desc"), 2, "fantasy/brick-wear"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.3.desc"), 3, "fantasy/bricks"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.4.desc"), 4, "fantasy/decor"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.5.desc"), 5, "fantasy/decor-block"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.6.desc"), 6, "fantasy/pillar"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.7.desc"), 7, "fantasy/pillar-decorated"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.8.desc"), 8, "fantasy/gold-decor-1"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.9.desc"), 9, "fantasy/gold-decor-2"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.10.desc"), 10, "fantasy/gold-decor-3"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.11.desc"), 11, "fantasy/gold-decor-4"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.12.desc"), 12, "fantasy/plate"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.13.desc"), 13, "fantasy/block"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.14.desc"), 14, "fantasy/bricks-chaotic"); - fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.15.desc"), 15, "fantasy/bricks-wear"); - fantasy.carverHelper.register(fantasy, "fantasyblock"); - OreDictionary.registerOre("fantasy", fantasy); - Carving.chisel.registerOre("fantasyblock", "fantasy"); - } - - if(Configurations.featureEnabled("carpet")) - { - carpet = (BlockCarvable) new BlockCarvable(Material.cloth).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeCloth); - carpet.carverHelper.setChiselBlockName("Carpet Block"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.0.desc"), 0, "carpet/white"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.1.desc"), 1, "carpet/orange"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.2.desc"), 2, "carpet/lily"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.3.desc"), 3, "carpet/lightblue"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.4.desc"), 4, "carpet/yellow"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.5.desc"), 5, "carpet/lightgreen"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.6.desc"), 6, "carpet/pink"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.7.desc"), 7, "carpet/darkgrey"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.8.desc"), 8, "carpet/grey"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.9.desc"), 9, "carpet/teal"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.10.desc"), 10, "carpet/purple"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.11.desc"), 11, "carpet/darkblue"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.12.desc"), 12, "carpet/brown"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.13.desc"), 13, "carpet/green"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.14.desc"), 14, "carpet/red"); - carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.15.desc"), 15, "carpet/black"); - carpet.carverHelper.forbidChiseling = true; - carpet.carverHelper.register(carpet, "carpet_block"); - OreDictionary.registerOre("carpet", carpet); - Carving.chisel.registerOre("carpet_block", "carpet"); - } - - if(Configurations.featureEnabled("carpetFloor")) - { - carpetFloor = (BlockMarbleCarpet) new BlockMarbleCarpet(Material.cloth).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeCloth); - carpetFloor.carverHelper.setChiselBlockName("Carpet"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.0.desc"), 0, "carpet/white"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.1.desc"), 1, "carpet/orange"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.2.desc"), 2, "carpet/lily"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.3.desc"), 3, "carpet/lightblue"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.4.desc"), 4, "carpet/yellow"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.5.desc"), 5, "carpet/lightgreen"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.6.desc"), 6, "carpet/pink"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.7.desc"), 7, "carpet/darkgrey"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.8.desc"), 8, "carpet/grey"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.9.desc"), 9, "carpet/teal"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.10.desc"), 10, "carpet/purple"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.11.desc"), 11, "carpet/darkblue"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.12.desc"), 12, "carpet/brown"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.13.desc"), 13, "carpet/green"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.14.desc"), 14, "carpet/red"); - carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.15.desc"), 15, "carpet/black"); - carpetFloor.carverHelper.forbidChiseling = true; - carpetFloor.carverHelper.register(carpetFloor, "carpet"); - - for(int i = 0; i < 16; i++) - { - String group = "carpet." + i; - - Carving.needle.addVariation(group, Blocks.carpet, i, 0); - Carving.needle.addVariation(group, carpetFloor, i, 2); - Carving.needle.addVariation(group, carpet, i, 1); - } - - Carving.chisel.registerOre("carpet", "carpet"); - } - - if(Configurations.featureEnabled("bookshelf")) - { - bookshelf = (BlockCarvable) new BlockMarbleBookshelf().setHardness(1.5F).setCreativeTab(ModTabs.tabWoodChiselBlocks).setStepSound(Block.soundTypeWood); - Carving.chisel.addVariation("bookshelf", Blocks.bookshelf, 0, 0); - bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.1.desc"), 1, "bookshelf/rainbow"); - bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.2.desc"), 2, "bookshelf/necromancer-novice"); - bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.3.desc"), 3, "bookshelf/necromancer"); - bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.4.desc"), 4, "bookshelf/redtomes"); - bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.5.desc"), 5, "bookshelf/abandoned"); - bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.6.desc"), 6, "bookshelf/hoarder"); - bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.7.desc"), 7, "bookshelf/brim"); - bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.8.desc"), 8, "bookshelf/historician"); - bookshelf.carverHelper.register(bookshelf, "bookshelf"); - bookshelf.setHarvestLevel("axe", 0); - Carving.chisel.registerOre("bookshelf", "bookshelf"); - } - - if(Configurations.featureEnabled("futuristicArmorPlating")) - { - tyrian = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal); - tyrian.carverHelper.setChiselBlockName("Futuristic Armor Plating Block"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.0.desc"), 0, "tyrian/shining"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.1.desc"), 1, "tyrian/tyrian"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.2.desc"), 2, "tyrian/chaotic"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.3.desc"), 3, "tyrian/softplate"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.4.desc"), 4, "tyrian/rust"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.5.desc"), 5, "tyrian/elaborate"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.6.desc"), 6, "tyrian/routes"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.7.desc"), 7, "tyrian/platform"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.8.desc"), 8, "tyrian/platetiles"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.9.desc"), 9, "tyrian/diagonal"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.10.desc"), 10, "tyrian/dent"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.11.desc"), 11, "tyrian/blueplating"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.12.desc"), 12, "tyrian/black"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.13.desc"), 13, "tyrian/black2"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.14.desc"), 14, "tyrian/opening"); - tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.15.desc"), 15, "tyrian/plate"); - tyrian.carverHelper.register(tyrian, "tyrian"); - OreDictionary.registerOre("tyrian", tyrian); - Carving.chisel.registerOre("tyrian", "tyrian"); - } - - - if(Configurations.featureEnabled("templeBlock")) - { - temple = (BlockCarvable) new BlockEldritch().setHardness(2.0F).setCreativeTab(ModTabs.tabStoneChiselBlocks).setResistance(10F).setStepSound(Chisel.soundTempleFootstep); - temple.carverHelper.setChiselBlockName("Temple Block"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.0.desc"), 0, "temple/cobble"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.1.desc"), 1, "temple/ornate"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.2.desc"), 2, "temple/plate"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.3.desc"), 3, "temple/plate-cracked"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.4.desc"), 4, "temple/bricks"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.5.desc"), 5, "temple/bricks-large"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.6.desc"), 6, "temple/bricks-weared"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.7.desc"), 7, "temple/bricks-disarray"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.8.desc"), 8, "temple/column"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.9.desc"), 9, "temple/stand"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.10.desc"), 10, "temple/stand-mosaic"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.11.desc"), 11, "temple/stand-creeper"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.12.desc"), 12, "temple/tiles"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.13.desc"), 13, "temple/smalltiles"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.14.desc"), 14, "temple/tiles-light"); - temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.15.desc"), 15, "temple/smalltiles-light"); - temple.carverHelper.register(temple, "templeblock"); - Carving.chisel.registerOre("templeblock", "templeblock"); - - if(Configurations.featureEnabled("templeBlockMossy")) - { - templeMossy = (BlockCarvable) new BlockEldritch().setHardness(2.0F).setCreativeTab(ModTabs.tabStoneChiselBlocks).setResistance(10F).setStepSound(Chisel.soundTempleFootstep); - templeMossy.carverHelper.setChiselBlockName("Mossy Temple Block"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.0.desc"), 0, "templemossy/cobble"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.1.desc"), 1, "templemossy/ornate"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.2.desc"), 2, "templemossy/plate"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.3.desc"), 3, "templemossy/plate-cracked"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.4.desc"), 4, "templemossy/bricks"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.5.desc"), 5, "templemossy/bricks-large"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.6.desc"), 6, "templemossy/bricks-weared"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.7.desc"), 7, "templemossy/bricks-disarray"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.8.desc"), 8, "templemossy/column"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.9.desc"), 9, "templemossy/stand"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.10.desc"), 10, "templemossy/stand-mosaic"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.11.desc"), 11, "templemossy/stand-creeper"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.12.desc"), 12, "templemossy/tiles"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.13.desc"), 13, "templemossy/smalltiles"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.14.desc"), 14, "templemossy/tiles-light"); - templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.15.desc"), 15, "templemossy/smalltiles-light"); - templeMossy.carverHelper.register(templeMossy, "mossy_templeblock"); - Carving.chisel.registerOre("mossy_templeblock", "mossy_templeblock"); - } - } - - if(Configurations.featureEnabled("cloud")) - { - cloud = (BlockCloud) new BlockCloud().setHardness(0.2F).setCreativeTab(ModTabs.tabOtherChiselBlocks).setLightOpacity(3).setStepSound(Block.soundTypeCloth); - cloud.carverHelper.addVariation(StatCollector.translateToLocal("tile.cloud.0.desc"), 0, "cloud/cloud"); - cloud.carverHelper.addVariation(StatCollector.translateToLocal("tile.cloud.1.desc"), 1, "cloud/large"); - cloud.carverHelper.addVariation(StatCollector.translateToLocal("tile.cloud.2.desc"), 2, "cloud/small"); - cloud.carverHelper.addVariation(StatCollector.translateToLocal("tile.cloud.3.desc"), 3, "cloud/vertical"); - cloud.carverHelper.addVariation(StatCollector.translateToLocal("tile.cloud.4.desc"), 4, "cloud/grid"); - cloud.carverHelper.register(cloud, "cloud"); - OreDictionary.registerOre("cloud", cloud); - Carving.chisel.registerOre("cloud", "cloud"); - } - - if(Configurations.featureEnabled("factory")) - { - factory = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Chisel.soundMetalFootstep); - factory.carverHelper.setChiselBlockName("factoryblock"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.0.desc"), 0, "factory/dots"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.1.desc"), 1, "factory/rust2"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.2.desc"), 2, "factory/rust"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.3.desc"), 3, "factory/platex"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.4.desc"), 4, "factory/wireframewhite"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.5.desc"), 5, "factory/wireframe"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.6.desc"), 6, "factory/hazard"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.7.desc"), 7, "factory/hazardorange"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.8.desc"), 8, "factory/circuit"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.9.desc"), 9, "factory/metalbox"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.10.desc"), 10, "factory/goldplate"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.11.desc"), 11, "factory/goldplating"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.12.desc"), 12, "factory/grinder"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.13.desc"), 13, "factory/plating"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.14.desc"), 14, "factory/rustplates"); - factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.15.desc"), 15, "factory/column"); - factory.carverHelper.register(factory, "factoryblock"); - Carving.chisel.registerOre("factoryblock", "factoryblock"); - } - - // 1.7! Let's go! Let's go-go! - - String[] sGNames = new String[]{ - "White", "Orange", "Magenta", "Light Blue", - "Yellow", "Lime", "Pink", "Gray", - "Light Gray", "Cyan", "Purple", "Blue", - "Brown", "Green", "Red", "Black" - }; - - if(Configurations.featureEnabled("glassStained")) 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(sGNames[i] + " bubble glass", glassPrefix, texName + "bubble"); - stainedGlass[glassId].carverHelper.addVariation(sGNames[i] + " glass panel", glassPrefix + 1, texName + "panel"); - stainedGlass[glassId].carverHelper.addVariation(sGNames[i] + " fancy glass panel", glassPrefix + 2, texName + "panel-fancy"); - stainedGlass[glassId].carverHelper.addVariation(sGNames[i] + " borderless glass", glassPrefix + 3, texName + "transparent"); - OreDictionary.registerOre(oreName, new ItemStack(Blocks.stained_glass, 1, i)); - Carving.chisel.registerOre(blockName, oreName); - for(CarvableVariation cv : stainedGlass[glassId].carverHelper.variations) - { - if(cv.metadata < glassPrefix || cv.metadata >= glassPrefix + 4) - continue; - stainedGlass[glassId].carverHelper.registerVariation(blockName, cv, stainedGlass[glassId], cv.metadata); - } - } - - if(Configurations.featureEnabled("glassStainedPane")) 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(ModTabs.tabOtherChiselBlocks); - stainedGlassPane[glassId].carverHelper.registerBlock(stainedGlassPane[glassId], blockName); - stainedGlassPane[glassId].carverHelper.blockName = "Stained Glass Pane"; - } - stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " bubble glass", glassPrefix, texName + "bubble"); - stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " glass panel", glassPrefix + 1, texName + "panel"); - stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " fancy glass panel", glassPrefix + 2, texName + "panel-fancy"); - stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " borderless glass", glassPrefix + 3, texName + "transparent"); - stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " quadrant glass", glassPrefix + 4, texName + "quad"); - stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " fancy quadrant glass", glassPrefix + 5, texName + "quad-fancy"); - OreDictionary.registerOre(oreName, new ItemStack(Blocks.stained_glass_pane, 1, i)); - Carving.chisel.registerOre(blockName, oreName); - for(CarvableVariation cv : stainedGlassPane[glassId].carverHelper.variations) - { - if(cv.metadata < glassPrefix || cv.metadata >= glassPrefix + 8) - continue; - stainedGlassPane[glassId].carverHelper.registerVariation(blockName, cv, stainedGlassPane[glassId], cv.metadata); - } - } - - if(Configurations.featureEnabled("paperWall")) - { - paperWall = (BlockCarvablePane) new BlockCarvablePane(Material.ground, true).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setResistance(10F); - paperWall.carverHelper.setChiselBlockName("Paper Wall"); - paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.0.desc"), 0, "paper/box"); - paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.1.desc"), 1, "paper/throughMiddle"); - paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.2.desc"), 2, "paper/cross"); - paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.3.desc"), 3, "paper/sixSections"); - paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.4.desc"), 4, "paper/vertical"); - paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.5.desc"), 5, "paper/horizontal"); - paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.6.desc"), 6, "paper/floral"); - paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.7.desc"), 7, "paper/plain"); - paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.8.desc"), 8, "paper/door"); - - paperWall.carverHelper.register(paperWall, "paperwall"); - Carving.chisel.registerOre("paperwall", "paperwall"); - - } - - if(Configurations.featureEnabled("woolenClay")) - { - woolenClay = (BlockCarvable) new BlockCarvable(Material.clay).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(2F).setResistance(10F); - woolenClay.carverHelper.setChiselBlockName("Woolen Clay"); - - for(int i = 0; i < 16; i++) - woolenClay.carverHelper.addVariation(StatCollector.translateToLocal("tile.woolenClay." + i + ".desc"), i, "woolenClay/" + sGNames[i].replaceAll(" ", "").toLowerCase()); - woolenClay.carverHelper.register(woolenClay, "woolen_clay"); - - Carving.chisel.registerOre("woolen_clay", "woolen_clay"); - } - if(Configurations.featureEnabled("coloredSand")) - { - coloredSand = (BlockCarvableSand) new BlockCarvableSand().setCreativeTab(ModTabs.tabOtherChiselBlocks); - coloredSand.carverHelper.setChiselBlockName("Colored Sand"); - - for(int i = 0; i < 16; i++) - coloredSand.carverHelper.addVariation(StatCollector.translateToLocal("tile.coloredSand." + i + ".desc"), i, "coloredSand/" + sGNames[i].replaceAll(" ", "").toLowerCase()); - coloredSand.carverHelper.register(coloredSand, "colored_sand"); - - Carving.chisel.registerOre("colored_sand", "colored_sand"); - } - - if(Configurations.featureEnabled("laboratory")) - { - laboratory = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Chisel.soundMetalFootstep); - laboratory.carverHelper.setChiselBlockName("laboratoryblock"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.0.desc"), 0, "laboratory/wallpanel"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.1.desc"), 1, "laboratory/dottedpanel"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.2.desc"), 2, "laboratory/largewall"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.3.desc"), 3, "laboratory/roundel"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.4.desc"), 4, "laboratory/wallvents"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.5.desc"), 5, "laboratory/largetile"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.6.desc"), 6, "laboratory/smalltile"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.7.desc"), 7, "laboratory/floortile"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.8.desc"), 8, "laboratory/checkertile"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.9.desc"), 9, "laboratory/clearscreen"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.10.desc"), 10, "laboratory/fuzzscreen"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.11.desc"), 11, "laboratory/largesteel"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.12.desc"), 12, "laboratory/smallsteel"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.13.desc"), 13, "laboratory/directionright"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.14.desc"), 14, "laboratory/directionleft"); - laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.15.desc"), 15, "laboratory/infocon"); - laboratory.carverHelper.register(laboratory, "laboratoryblock"); - Carving.chisel.registerOre("laboratoryblock", "laboratoryblock"); - } - - if(Configurations.featureEnabled("pumpkin")) - { - for(int metadata = 0; metadata < 16; metadata++){ - pumpkin[metadata] = (BlockCarvablePumpkin) new BlockCarvablePumpkin(false).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(1.0F).setBlockName("pumpkin").setCreativeTab(ModTabs.tabOtherChiselBlocks); - pumpkin[metadata].setInformation("pumpkin/pumpkin_face_" + (metadata + 1) + "_off"); - GameRegistry.registerBlock(pumpkin[metadata], "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"); - } - - if(Configurations.featureEnabled("jackolantern")) - { - for(int metadata = 0; metadata < 16; metadata++){ - jackolantern[metadata] = (BlockCarvablePumpkin) new BlockCarvablePumpkin(true).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(1.0F).setBlockName("litpumpkin").setCreativeTab(ModTabs.tabOtherChiselBlocks); - jackolantern[metadata].setInformation("pumpkin/pumpkin_face_" + (metadata + 1) + "_on"); - GameRegistry.registerBlock(jackolantern[metadata], ("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"); - } - - if(Configurations.featureEnabled("leaves")){ - leaf = (BlockLeaf) new BlockLeaf(Material.leaves).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.2F).setStepSound(Block.soundTypeGrass); - 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); - if(Configurations.fancy){ - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.6.desc"), 6, "leaves/dead"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.7.desc"), 7, "leaves/fancy"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.8.desc"), 8, "leaves/pinkpetal"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.9.desc"), 9, "leaves/red_roses"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.10.desc"), 10, "leaves/roses"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.11.desc"), 11, "leaves/christmasBalls"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.12.desc"), 12, "leaves/christmasLights"); - } else { - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.6.desc"), 6, "leaves/dead_opaque"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.7.desc"), 7, "leaves/fancy_opaque"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.8.desc"), 8, "leaves/pinkpetal_opaque"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.9.desc"), 9, "leaves/red_roses_opaque"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.10.desc"), 10, "leaves/roses_opaque"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.11.desc"), 11, "leaves/christmasBalls_opaque"); - leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.12.desc"), 12, "leaves/christmasLights_opaque"); - } - - leaf.carverHelper.register(leaf, "leaves"); - Carving.chisel.registerOre("leaves", "leaves"); - } - - if (areChestsReady) { - for(int x = 0; x < 16; x++){ - present[x] = (BlockPresent) new BlockPresent(x).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(2.0F).setResistance(10.0F).setBlockName("present"); - GameRegistry.registerBlock(present[x], "chest" + x); - Carving.chisel.addVariation("present", present[x], 0, (x + 1)); - } - Carving.chisel.registerOre("chest", "chest"); - } - - if(Configurations.featureEnabled("voidstone")){ - voidstone = (BlockCarvable) new BlockCarvable().setCreativeTab(ModTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F); - voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.0.desc"), 0, "voidstone/raw"); - voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.1.desc"), 1, "voidstone/quarters"); - voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.2.desc"), 2, "voidstone/smooth"); - voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.3.desc"), 3, "voidstone/skulls"); - voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.4.desc"), 4, "voidstone/rune"); - voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.5.desc"), 5, "voidstone/metalborder"); - voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.6.desc"), 6, "voidstone/eye"); - voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.7.desc"), 7, "voidstone/bevel"); - - voidstone.carverHelper.register(voidstone, "voidstone"); - Carving.chisel.registerOre("voidstone", "voidstone"); - - voidstone2 = (BlockMarbleTexturedOre) new BlockMarbleTexturedOre(Material.rock, Chisel.MOD_ID + ":voidstone/animated/void").setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F); - voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.0.desc"), 0, "voidstone/animated/raw"); - voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.1.desc"), 1, "voidstone/animated/quarters"); - voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.2.desc"), 2, "voidstone/animated/smooth"); - voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.3.desc"), 3, "voidstone/animated/skulls"); - voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.4.desc"), 4, "voidstone/animated/rune"); - voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.5.desc"), 5, "voidstone/animated/metalborder"); - voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.6.desc"), 6, "voidstone/animated/eye"); - voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.7.desc"), 7, "voidstone/animated/bevel"); - - voidstone2.carverHelper.register(voidstone2, "voidstone2"); - Carving.chisel.registerOre("voidstone2", "voidstone2"); - } - - if(Configurations.featureEnabled("voidstonePillars")){ - voidstonePillar = (BlockVoidstonePillar) new BlockVoidstonePillar().setCreativeTab(ModTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone); - voidstonePillar.carvableHelper.addVariation(StatCollector.translateToLocal("tile.voidstonePillar.0.desc"), 0, "voidstone/pillar-side"); - voidstonePillar.carvableHelper.register(voidstonePillar, "voidstonePillar"); - Carving.chisel.registerOre("voidstonePillar", "voidstonePillar"); - - voidstonePillar2 = (BlockVoidstonePillar2) new BlockVoidstonePillar2().setStepSound(Block.soundTypeStone); - voidstonePillar2.carvableHelper.addVariation(StatCollector.translateToLocal("tile.voidstonePillar2.0.desc"), 0, "voidstone/pillar-side"); - voidstonePillar2.carvableHelper.register(voidstonePillar2, "voidstonePillar2"); - Carving.chisel.registerOre("voidstonePillar2", "voidstonePillar2"); - } - - if (Configurations.featureEnabled("waterstone")) { - waterstone = (BlockWaterstone) new BlockWaterstone(Material.rock, "water_flow").setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10.0F); - waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.0.desc"), 0, "waterstone/cobble"); - waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.1.desc"), 1, "waterstone/black"); - waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.2.desc"), 2, "waterstone/tiles"); - waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.3.desc"), 3, "waterstone/chaotic"); - waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.4.desc"), 4, "waterstone/creeper"); - waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.5.desc"), 5, "waterstone/panel"); - waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.6.desc"), 6, "waterstone/panel-ornate"); - waterstone.carverHelper.register(waterstone, "waterstone"); - OreDictionary.registerOre("blockWaterstone", waterstone); - Carving.chisel.registerOre("waterstone", "blockWaterstone"); - } - - if(Configurations.featureEnabled("hexPlating")){ - hexPlating = (BlockCarvable) new BlockCarvable().setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10.0F); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.0.desc"), 0, "hexPlating/black"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.1.desc"), 1, "hexPlating/blue"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.2.desc"), 2, "hexPlating/brown"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.3.desc"), 3, "hexPlating/cyan"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.4.desc"), 4, "hexPlating/green"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.5.desc"), 5, "hexPlating/light_blue"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.6.desc"), 6, "hexPlating/light_gray"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.7.desc"), 7, "hexPlating/lime"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.8.desc"), 8, "hexPlating/magenta"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.9.desc"), 9, "hexPlating/orange"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.10.desc"), 10, "hexPlating/pink"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.11.desc"), 11, "hexPlating/purple"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.12.desc"), 12, "hexPlating/red"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.13.desc"), 13, "hexPlating/white"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.14.desc"), 14, "hexPlating/yellow"); - hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.15.desc"), 15, "hexPlating/gray"); - hexPlating.carverHelper.register(hexPlating, "hexPlating"); - Carving.chisel.registerOre("hexPlating", "hexPlating"); - } - - if(Configurations.featureEnabled("fantasy2")){ - fantasy2 = (BlockCarvable) new BlockCarvable().setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.0.desc"), 0, "fantasy2/brick"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.1.desc"), 1, "fantasy2/brick-faded"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.2.desc"), 2, "fantasy2/brick-wear"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.3.desc"), 3, "fantasy2/bricks"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.4.desc"), 4, "fantasy2/decor"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.5.desc"), 5, "fantasy2/decor-block"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.6.desc"), 6, "fantasy2/pillar"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.7.desc"), 7, "fantasy2/pillar-decorated"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.8.desc"), 8, "fantasy2/gold-decor-1"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.9.desc"), 9, "fantasy2/gold-decor-2"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.10.desc"), 10, "fantasy2/gold-decor-3"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.11.desc"), 11, "fantasy2/gold-decor-4"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.12.desc"), 12, "fantasy2/plate"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.13.desc"), 13, "fantasy2/block"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.14.desc"), 14, "fantasy2/bricks-chaotic"); - fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.15.desc"), 15, "fantasy2/bricks-wear"); - fantasy2.carverHelper.register(fantasy2, "fantasyblock2"); - OreDictionary.registerOre("fantasy2", fantasy2); - Carving.chisel.registerOre("fantasyblock2", "fantasy2"); - } - - if(Configurations.featureEnabled("grimstone")){ - grimstone = (BlockGrimstone) new BlockGrimstone(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.0.desc"), 0, "grimstone/grimstone"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.1.desc"), 1, "grimstone/smooth"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.2.desc"), 2, "grimstone/hate"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.3.desc"), 3, "grimstone/chiseled"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.4.desc"), 4, "grimstone/blocks"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.5.desc"), 5, "grimstone/blocks-rough"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.6.desc"), 6, "grimstone/brick"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.7.desc"), 7, "grimstone/largebricks"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.8.desc"), 8, "grimstone/platform"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.9.desc"), 9, "grimstone/platform-tiles"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.10.desc"), 10, "grimstone/construction"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.11.desc"), 11, "grimstone/fancy-tiles"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.12.desc"), 12, "grimstone/plate"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.13.desc"), 13, "grimstone/plate-rough"); - grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.14.desc"), 14, "grimstone/flaky"); - grimstone.carverHelper.register(grimstone, "grimstone"); - Carving.chisel.registerOre("grimstone", "grimstone"); - } - - if(Configurations.featureEnabled("technical")){ - technical = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.0.desc"), 0, "technical/scaffold"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.1.desc"), 1, "technical/cautiontape"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.2.desc"), 2, "technical/industrialrelic"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.3.desc"), 3, "technical/pipesLarge"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.4.desc"), 4, "technical/fanFast"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.5.desc"), 5, "technical/pipesSmall"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.6.desc"), 6, "technical/fanStill"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.7.desc"), 7, "technical/vent"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.8.desc"), 8, "technical/ventGlowing"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.9.desc"), 9, "technical/insulationv2"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.10.desc"), 10, "technical/spinningStuffAnim"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.11.desc"), 11, "technical/cables"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.12.desc"), 12, "technical/rustyBoltedPlates"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.13.desc"), 13, "technical/grate"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.14.desc"), 14, "technical/fanMalfunction"); - technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.15.desc"), 15, "technical/grateRusty"); - technical.carverHelper.register(technical, "technical"); - Carving.chisel.registerOre("technical", "technical"); - - technical2 = (BlockCarvableGlass) new BlockCarvableGlass().setHardness(2.0F).setResistance(10F); - technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.0.desc"), 0, "technical/scaffoldTransparent"); - technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.4.desc"), 1, "technical/fanFastTransparent"); - technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.6.desc"), 2, "technical/fanStillTransparent"); - technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.14.desc"), 3, "technical/fanStillTransparent"); - technical2.carverHelper.register(technical2, "technical2"); - Carving.chisel.registerOre("technical2", "technical2"); - } - - //Once screen overlay is done, remove WIP texs - - if(Configurations.featureEnabled("futura")){ - futura = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); - futura.carverHelper.addVariation(StatCollector.translateToLocal("tile.futura.0.desc"), 0, "futura/screenMetallicWIP"); - futura.carverHelper.addVariation(StatCollector.translateToLocal("tile.futura.1.desc"), 1, "futura/screenCyanWIP"); - futura.carverHelper.addVariation(StatCollector.translateToLocal("tile.futura.2.desc"), 2, "futura/controllerWIP"); - futura.carverHelper.register(futura, "futura"); - Carving.chisel.registerOre("futura", "futura"); - } - - if(Configurations.featureEnabled("brickCustom")) - { - brickCustom = (BlockCarvable) new BlockCarvable(Material.rock).setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabStoneChiselBlocks); - Carving.chisel.addVariation("brickCustom", Blocks.brick_block, 0, 0); - brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.1.desc"), 1, "brickCustom/large"); - brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.2.desc"), 2, "brickCustom/mortarless"); - brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.3.desc"), 3, "brickCustom/varied"); - //brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.4.desc"), 4, "brickCustom/cracked"); - brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.5.desc"), 5, "brickCustom/aged"); - //brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.6.desc"), 6, "brickCustom/mossy"); - brickCustom.carverHelper.register(brickCustom, "brickCustom"); - Carving.chisel.registerOre("brickCustom", "brickCustom"); - } - - if(Configurations.featureEnabled("quartz")) - { - 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"); - } - - //1.8 - if(Configurations.featureEnabled("granite")){ - granite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ModTabs.tabStoneChiselBlocks); - granite.carverHelper.setChiselBlockName("granite"); - granite.carverHelper.addVariation(StatCollector.translateToLocal("tile.granite.0.desc"), 0, "granite/granite"); - granite.carverHelper.addVariation(StatCollector.translateToLocal("tile.granite.1.desc"), 1, "granite/polishedGranite"); - granite.carverHelper.register(granite, "granite"); - Carving.chisel.registerOre("granite", "granite"); - } - - if(Configurations.featureEnabled("diorite")){ - diorite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ModTabs.tabStoneChiselBlocks); - diorite.carverHelper.setChiselBlockName("diorite"); - diorite.carverHelper.addVariation(StatCollector.translateToLocal("tile.diorite.0.desc"), 0, "diorite/diorite"); - diorite.carverHelper.addVariation(StatCollector.translateToLocal("tile.diorite.1.desc"), 1, "diorite/polishedDiorite"); - diorite.carverHelper.register(diorite, "diorite"); - Carving.chisel.registerOre("diorite", "diorite"); - } - - if(Configurations.featureEnabled("andesite")){ - andesite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ModTabs.tabStoneChiselBlocks); - andesite.carverHelper.setChiselBlockName("andesite"); - andesite.carverHelper.addVariation(StatCollector.translateToLocal("tile.andesite.0.desc"), 0, "andesite/andesite"); - andesite.carverHelper.addVariation(StatCollector.translateToLocal("tile.andesite.1.desc"), 1, "andesite/polishedAndesite"); - andesite.carverHelper.register(andesite, "andesite"); - Carving.chisel.registerOre("andesite", "andesite"); - } - } - - public static void postLoad() - { - - //Thaumcraft - if(Configurations.featureEnabled("arcane") && Loader.isModLoaded("Thaumcraft")) - { - arcane = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("arcane", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 6, 0); - Carving.chisel.addVariation("arcane", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 7, 1); - arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.0.desc"), 0, "arcane/moonEngrave"); - arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.1.desc"), 1, "arcane/moonGlowAnim"); - arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.2.desc"), 2, "arcane/arcaneTile"); - arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.3.desc"), 3, "arcane/arcaneRunes"); - arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.4.desc"), 4, "arcane/arcaneRunesGlow"); - arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.5.desc"), 5, "arcane/bigBrick"); - arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.6.desc"), 6, "arcane/conduitGlowAnim"); - arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.7.desc"), 7, "arcane/BorderBrain"); - arcane.carverHelper.register(arcane, "arcane"); - Carving.chisel.registerOre("arcane", "arcane"); - } - - //Blood Magic - if(Configurations.featureEnabled("bloodRune") && Loader.isModLoaded("AWWayOfTime")){ - bloodRune = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); - Carving.chisel.addVariation("bloodRune", GameRegistry.findBlock("AWWayOfTime", "bloodRune.blank"), 0, 0); - bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.0.desc"), 0, "bloodMagic/bloodRuneArranged"); - bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.1.desc"), 1, "bloodMagic/bloodRuneBricks"); - bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.2.desc"), 2, "bloodMagic/bloodRuneCarved"); - bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.3.desc"), 3, "bloodMagic/bloodRuneCarvedRadial"); - bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.4.desc"), 4, "bloodMagic/bloodRuneClassicPanel"); - bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.5.desc"), 5, "bloodMagic/bloodRuneTiles"); - bloodRune.carverHelper.register(bloodRune, "bloodRune"); - Carving.chisel.registerOre("bloodRune", "bloodRune"); - } - - - //Twilight Forest - - if(Configurations.featureEnabled("TFMazestone") && Loader.isModLoaded("TwilightForest")) - { - 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"); - } - - if(Configurations.featureEnabled("TFTowerStone") && Loader.isModLoaded("TwilightForest")) - { - 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"); - } - - if(Configurations.featureEnabled("TFUnderBrick") && Loader.isModLoaded("TwilightForest")) - { - 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"); - } - - //Applied Energistics - - if(Configurations.featureEnabled("AECertusQuartz") && Loader.isModLoaded("appliedenergistics2")) - { - 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"); - } - - if(Configurations.featureEnabled("AESkyStone") && Loader.isModLoaded("appliedenergistics2")) - { - 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"); - } - - //Railcraft - if(Configurations.featureEnabled("RCInfernalStone") && Loader.isModLoaded("Railcraft")) - { - Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 0, 0); - Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 1, 1); - Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 2, 2); - Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 3, 3); - Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 4, 4); - Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 5, 5); - Carving.chisel.registerOre("RCInfernalStone", "RCInfernalStone"); - } - - if(Configurations.featureEnabled("RCSandyStone") && Loader.isModLoaded("Railcraft")) - { - Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 0, 0); - Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 1, 1); - Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 2, 2); - Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 3, 3); - Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 4, 4); - Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 5, 5); - Carving.chisel.registerOre("RCSandyStone", "RCSandyStone"); - } - - if(Configurations.featureEnabled("RCFrostBoundBlock") && Loader.isModLoaded("Railcraft")) - { - Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 0, 0); - Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 1, 1); - Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 2, 2); - Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 3, 3); - Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 4, 4); - Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 5, 5); - Carving.chisel.registerOre("RCFrostBoundBlock", "RCFrostBoundBlock"); - } - - if(Configurations.featureEnabled("RCQuarriedBlock") && Loader.isModLoaded("Railcraft")) { - Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 0, 0); - Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 1, 1); - Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 2, 2); - Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 3, 3); - Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 4, 4); - Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 5, 5); - Carving.chisel.registerOre("RCQuarriedBlock", "RCQuarriedBlock"); - } - - if(Configurations.featureEnabled("RCBleachedBone") && Loader.isModLoaded("Railcraft")) - { - Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 0, 0); - Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 1, 1); - Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 2, 2); - Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 3, 3); - Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 4, 4); - Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 5, 5); - Carving.chisel.registerOre("RCBleachedBone", "RCBleachedBone"); - } - - if(Configurations.featureEnabled("RCBloodStained") && Loader.isModLoaded("Railcraft")) - { - Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 0, 0); - Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 1, 1); - Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 2, 2); - Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 3, 3); - Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 4, 4); - Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 5, 5); - Carving.chisel.registerOre("RCBloodStained", "RCBloodStained"); - } - } + + public static BlockCarvable marble; + public static BlockCarvable marblePillar; + public static BlockCarvable limestone; + public static BlockMarbleSlab marbleSlab; + public static BlockMarbleSlab limestoneSlab; + public static BlockMarbleSlab marblePillarSlab; + public static BlockCarvable cobblestone; + public static BlockMarbleWall cobblestoneWall; + public static BlockCarvableGlass glass; + public static BlockCarvablePane paneGlass; + public static BlockCarvable sandstone; + public static BlockCarvable sandstoneScribbles; + public static BlockConcrete concrete; + public static BlockRoadLine roadLine; + public static BlockCarvable iron; + public static BlockCarvable gold; + public static BlockCarvable diamond; + public static BlockLightstoneCarvable lightstone; + public static BlockCarvable lapis; + public static BlockCarvable emerald; + public static BlockCarvable netherBrick; + public static BlockCarvable netherrack; + public static BlockCarvable cobblestoneMossy; + public static BlockCarvable stoneBrick; + public static BlockMarbleStairs marbleStairs; + public static BlockMarbleStairs limestoneStairs; + public static BlockCarvablePane paneIron; + public static BlockMarbleIce ice; + public static BlockMarbleIce icePillar; + public static BlockMarblePackedIce packedice; + public static BlockMarblePackedIce packedicePillar; + public static BlockMarbleIceStairs iceStairs; + public static BlockMarblePackedIceStairs packediceStairs; + public static BlockCarvable[] planks = new BlockCarvable[6]; + public static BlockCarvable obsidian; + public static BlockCarvablePowered redstone; + public static BlockHolystone holystone; + public static BlockGrimstone grimstone; + public static BlockLavastone lavastone; + public static BlockWaterstone waterstone; + public static BlockCarvable leaf; + public static BlockCarvable fantasy; + public static BlockCarvable fantasy2; + public static BlockCarvable carpet; + public static BlockMarbleCarpet carpetFloor; + public static BlockCarvable bookshelf; + public static BlockCarvable tyrian; + public static BlockCarvable dirt; + public static BlockCloud cloud; + public static BlockCarvable temple; + public static BlockCarvable templeMossy; + public static BlockCarvable factory; + public static BlockCarvablePane paperWall; + public static BlockCarvable woolenClay; + public static BlockCarvable laboratory; + public static BlockCarvablePumpkin[] pumpkin = new BlockCarvablePumpkin[16]; + public static BlockCarvablePumpkin[] jackolantern = new BlockCarvablePumpkin[16]; + public static BlockCarvable voidstone; + public static BlockMarbleTexturedOre voidstone2; + public static BlockVoidstonePillar voidstonePillar; + public static BlockVoidstonePillar2 voidstonePillar2; + public static Block autoChisel; + public static BlockPresent[] present = new BlockPresent[16]; + public static BlockSnakestone snakestone; + public static BlockSnakestone sandSnakestone; + public static BlockSnakestoneObsidian obsidianSnakestone; + public static BlockCarvable hexPlating; + public static BlockCarvable technical; + public static BlockCarvableGlass technical2; + public static BlockCarvable futura; + public static BlockCarvable bone; + public static BlockCarvable scorching; + public static BlockCarvable brickCustom; + public static BlockCarvable sign; + public static BlockCarvable arcane; + public static BlockCarvable bloodRune; + public static BlockCarvableSand coloredSand; + + // 1.7 + public static BlockCarvableGlass[] stainedGlass = new BlockCarvableGlass[4]; + public static BlockCarvablePane[] stainedGlassPane = new BlockCarvablePane[8]; + + // 1.8 or at least so you think :P + public static BlockCarvable granite; + public static BlockCarvable diorite; + public static BlockCarvable andesite; + + private static boolean areChestsReady = false; + + public static void load() { + if (Configurations.featureEnabled("autoChisel")) { + autoChisel = new BlockAutoChisel().setBlockTextureName("Chisel:autoChisel").setCreativeTab(ModTabs.tabChisel).setBlockName("autoChisel") + .setBlockTextureName(Chisel.MOD_ID + ":factory/circuit"); + GameRegistry.registerBlock(autoChisel, "autoChisel"); + Chisel.proxy.registerTileEntities(); + } + + if (Configurations.featureEnabled("marble")) { + marble = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeStone); + marble.carverHelper.setChiselBlockName("Marble"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.0.desc"), 0, "marble"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.1.desc"), 1, "marble/a1-stoneornamental-marblebrick"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.2.desc"), 2, "marble/a1-stoneornamental-marbleclassicpanel"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.3.desc"), 3, "marble/a1-stoneornamental-marbleornate"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.4.desc"), 4, "marble/panel"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.5.desc"), 5, "marble/block"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.6.desc"), 6, "marble/terrain-pistonback-marblecreeperdark"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.7.desc"), 7, "marble/terrain-pistonback-marblecreeperlight"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.8.desc"), 8, "marble/a1-stoneornamental-marblecarved"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.9.desc"), 9, "marble/a1-stoneornamental-marblecarvedradial"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.10.desc"), 10, "marble/terrain-pistonback-marbledent"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.11.desc"), 11, "marble/terrain-pistonback-marbledent-small"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.12.desc"), 12, "marble/marble-bricks"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.13.desc"), 13, "marble/marble-arranged-bricks"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.14.desc"), 14, "marble/marble-fancy-bricks"); + marble.carverHelper.addVariation(StatCollector.translateToLocal("tile.marble.15.desc"), 15, "marble/marble-blocks"); + marble.carverHelper.register(marble, "marble"); + OreDictionary.registerOre("marble", marble); + OreDictionary.registerOre("blockMarble", marble); + Carving.chisel.registerOre("marble", "marble"); + + marbleSlab = (BlockMarbleSlab) new BlockMarbleSlab(marble).setHardness(2.0F).setResistance(10F); + marbleSlab.carverHelper.setChiselBlockName("Marble Slab"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.0.desc"), 0, "marble"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.1.desc"), 1, "marbleslab/a1-stoneornamental-marblebrick"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.2.desc"), 2, "marbleslab/a1-stoneornamental-marbleclassicpanel"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.3.desc"), 3, "marbleslab/a1-stoneornamental-marbleornate"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.4.desc"), 4, "marbleslab/a1-stoneornamental-marblepanel"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.5.desc"), 5, "marbleslab/terrain-pistonback-marble"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.6.desc"), 6, "marbleslab/terrain-pistonback-marblecreeperdark"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.7.desc"), 7, "marbleslab/terrain-pistonback-marblecreeperlight"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.8.desc"), 8, "marbleslab/a1-stoneornamental-marblecarved"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.9.desc"), 9, "marbleslab/a1-stoneornamental-marblecarvedradial"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.10.desc"), 10, "marbleslab/terrain-pistonback-marbledent"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.11.desc"), 11, "marbleslab/terrain-pistonback-marbledent-small"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.12.desc"), 12, "marbleslab/marble-bricks"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.13.desc"), 13, "marbleslab/marble-arranged-bricks"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.14.desc"), 14, "marbleslab/marble-fancy-bricks"); + marbleSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleSlab.15.desc"), 15, "marbleslab/marble-blocks"); + marbleSlab.carverHelper.register(marbleSlab, "marble_slab", ItemMarbleSlab.class); + Carving.chisel.registerOre("marble_slab", "marble_slab"); + + if (Configurations.featureEnabled("marblePillar")) { + if (Configurations.oldPillars) { + marblePillar = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Block.soundTypeStone); + marblePillar.carverHelper.setChiselBlockName("Marble Pillar"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.0.desc"), 0, "marblepillarold/column"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.1.desc"), 1, "marblepillarold/capstone"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.2.desc"), 2, "marblepillarold/base"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.3.desc"), 3, "marblepillarold/small"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.4.desc"), 4, "marblepillarold/pillar-carved"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.5.desc"), 5, "marblepillarold/a1-stoneornamental-marblegreek"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.6.desc"), 6, "marblepillarold/a1-stonepillar-greek"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.7.desc"), 7, "marblepillarold/a1-stonepillar-plain"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.8.desc"), 8, "marblepillarold/a1-stonepillar-greektopplain"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.9.desc"), 9, "marblepillarold/a1-stonepillar-plaintopplain"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.10.desc"), 10, "marblepillarold/a1-stonepillar-greekbottomplain"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.11.desc"), 11, "marblepillarold/a1-stonepillar-plainbottomplain"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.12.desc"), 12, "marblepillarold/a1-stonepillar-greektopgreek"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.13.desc"), 13, "marblepillarold/a1-stonepillar-plaintopgreek"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.14.desc"), 14, "marblepillarold/a1-stonepillar-greekbottomgreek"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarOld.15.desc"), 15, "marblepillarold/a1-stonepillar-plainbottomgreek"); + } else { + marblePillar = (BlockCarvable) new BlockMarblePillar(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Block.soundTypeStone); + marblePillar.carverHelper.setChiselBlockName("Marble Pillar"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.0.desc"), 0, "marblepillar/pillar"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.1.desc"), 1, "marblepillar/default"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.2.desc"), 2, "marblepillar/simple"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.3.desc"), 3, "marblepillar/convex"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.4.desc"), 4, "marblepillar/rough"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.5.desc"), 5, "marblepillar/greekdecor"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.6.desc"), 6, "marblepillar/greekgreek"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.7.desc"), 7, "marblepillar/greekplain"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.8.desc"), 8, "marblepillar/plaindecor"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.9.desc"), 9, "marblepillar/plaingreek"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.10.desc"), 10, "marblepillar/plainplain"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.11.desc"), 11, "marblepillar/widedecor"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.12.desc"), 12, "marblepillar/widegreek"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.13.desc"), 13, "marblepillar/wideplain"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.14.desc"), 14, "marblepillar/carved"); + marblePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillar.15.desc"), 15, "marblepillar/ornamental"); + } + marblePillar.carverHelper.register(marblePillar, "marble_pillar"); + Carving.chisel.setGroupClass("marble_pillar", "marble"); + + marblePillarSlab = (BlockMarbleSlab) new BlockMarbleSlab(marblePillar).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Block.soundTypeStone); + marblePillarSlab.carverHelper.setChiselBlockName("Marble Pillar Slab"); + if (Configurations.oldPillars) { + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.0.desc"), 0, "marblepillarslabold/column"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.1.desc"), 1, "marblepillarslabold/capstone"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.2.desc"), 2, "marblepillarslabold/base"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.3.desc"), 3, "marblepillarslabold/small"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.4.desc"), 4, "marblepillarslabold/pillar-carved"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.5.desc"), 5, "marblepillarslabold/a1-stoneornamental-marblegreek"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.6.desc"), 6, "marblepillarslabold/a1-stonepillar-greek"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.7.desc"), 7, "marblepillarslabold/a1-stonepillar-plain"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.8.desc"), 8, "marblepillarslabold/a1-stonepillar-greektopplain"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.9.desc"), 9, "marblepillarslabold/a1-stonepillar-plaintopplain"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.10.desc"), 10, "marblepillarslabold/a1-stonepillar-greekbottomplain"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.11.desc"), 11, "marblepillarslabold/a1-stonepillar-plainbottomplain"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.12.desc"), 12, "marblepillarslabold/a1-stonepillar-greektopgreek"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.13.desc"), 13, "marblepillarslabold/a1-stonepillar-plaintopgreek"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.14.desc"), 14, "marblepillarslabold/a1-stonepillar-greekbottomgreek"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlabOld.15.desc"), 15, "marblepillarslabold/a1-stonepillar-plainbottomgreek"); + } else { + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.0.desc"), 0, "marblepillarslab/pillar"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.1.desc"), 1, "marblepillarslab/default"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.2.desc"), 2, "marblepillarslab/simple"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.3.desc"), 3, "marblepillarslab/convex"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.4.desc"), 4, "marblepillarslab/rough"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.5.desc"), 5, "marblepillarslab/greekdecor"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.6.desc"), 6, "marblepillarslab/greekgreek"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.7.desc"), 7, "marblepillarslab/greekplain"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.8.desc"), 8, "marblepillarslab/plaindecor"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.9.desc"), 9, "marblepillarslab/plaingreek"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.10.desc"), 10, "marblepillarslab/plainplain"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.11.desc"), 11, "marblepillarslab/widedecor"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.12.desc"), 12, "marblepillarslab/widegreek"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.13.desc"), 13, "marblepillarslab/wideplain"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.14.desc"), 14, "marblepillarslab/carved"); + marblePillarSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.marblePillarSlab.15.desc"), 15, "marblepillarslab/ornamental"); + } + marblePillarSlab.carverHelper.register(marblePillarSlab, "marble_pillar_slab", ItemMarbleSlab.class); + } + + BlockMarbleStairsMaker makerMarbleStairs = new BlockMarbleStairsMaker(marble); + makerMarbleStairs.carverHelper.setChiselBlockName("Marble Stairs"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.0.desc"), 0, "marble"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.6.desc"), 1, "marbleslab/a1-stoneornamental-marblebrick"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.2.desc"), 2, "marbleslab/a1-stoneornamental-marbleclassicpanel"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.3.desc"), 3, "marbleslab/a1-stoneornamental-marbleornate"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.4.desc"), 4, "marbleslab/a1-stoneornamental-marblepanel"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.5.desc"), 5, "marbleslab/terrain-pistonback-marble"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.6.desc"), 6, "marbleslab/terrain-pistonback-marblecreeperdark"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.7.desc"), 7, "marbleslab/terrain-pistonback-marblecreeperlight"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.8.desc"), 8, "marbleslab/a1-stoneornamental-marblecarved"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.9.desc"), 9, "marbleslab/a1-stoneornamental-marblecarvedradial"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.10.desc"), 10, "marbleslab/terrain-pistonback-marbledent"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.11.desc"), 11, "marbleslab/terrain-pistonback-marbledent-small"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.12.desc"), 12, "marbleslab/marble-bricks"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.13.desc"), 13, "marbleslab/marble-arranged-bricks"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.14.desc"), 14, "marbleslab/marble-fancy-bricks"); + makerMarbleStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.marbleStairs.15.desc"), 15, "marbleslab/marble-blocks"); + makerMarbleStairs.create("marble_stairs"); + } + + if (Configurations.featureEnabled("limestone")) { + limestone = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeStone); + limestone.carverHelper.setChiselBlockName("Limestone"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.0.desc"), 0, "limestone"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.1.desc"), 1, "limestone/terrain-cobbsmalltilelight"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.2.desc"), 2, "limestone/terrain-cob-frenchlight"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.3.desc"), 3, "limestone/terrain-cob-french2light"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.4.desc"), 4, "limestone/terrain-cobmoss-creepdungeonlight"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.5.desc"), 5, "limestone/terrain-cob-smallbricklight"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.6.desc"), 6, "limestone/terrain-mossysmalltilelight"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.7.desc"), 7, "limestone/terrain-pistonback-dungeon"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.8.desc"), 8, "limestone/terrain-pistonback-dungeonornate"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.9.desc"), 9, "limestone/terrain-pistonback-dungeonvent"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.10.desc"), 10, "limestone/terrain-pistonback-lightcreeper"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.11.desc"), 11, "limestone/terrain-pistonback-lightdent"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.12.desc"), 12, "limestone/terrain-pistonback-lightemboss"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.13.desc"), 13, "limestone/terrain-pistonback-lightfour"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.14.desc"), 14, "limestone/terrain-pistonback-lightmarker"); + limestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestone.15.desc"), 15, "limestone/terrain-pistonback-lightpanel"); + limestone.carverHelper.register(limestone, "limestone"); + OreDictionary.registerOre("limestone", limestone); + Carving.chisel.registerOre("limestone", "limestone"); + + limestoneSlab = (BlockMarbleSlab) new BlockMarbleSlab(limestone).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); + limestoneSlab.carverHelper.setChiselBlockName("Limestone Slab"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.0.desc"), 0, "limestone"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.1.desc"), 1, "limestone/terrain-cobbsmalltilelight"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.2.desc"), 2, "limestone/terrain-cob-frenchlight"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.3.desc"), 3, "limestone/terrain-cob-french2light"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.4.desc"), 4, "limestone/terrain-cobmoss-creepdungeonlight"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.5.desc"), 5, "limestone/terrain-cob-smallbricklight"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.6.desc"), 6, "limestone/terrain-mossysmalltilelight"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.7.desc"), 7, "limestone/terrain-pistonback-dungeon"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.8.desc"), 8, "limestone/terrain-pistonback-dungeonornate"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.9.desc"), 9, "limestone/terrain-pistonback-dungeonvent"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.10.desc"), 10, "limestone/terrain-pistonback-lightcreeper"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.11.desc"), 11, "limestone/terrain-pistonback-lightdent"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.12.desc"), 12, "limestone/terrain-pistonback-lightemboss"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.13.desc"), 13, "limestone/terrain-pistonback-lightfour"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.14.desc"), 14, "limestone/terrain-pistonback-lightmarker"); + limestoneSlab.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneSlab.15.desc"), 15, "limestone/terrain-pistonback-lightpanel"); + limestoneSlab.carverHelper.register(limestoneSlab, "limestone_slab", ItemMarbleSlab.class); + Carving.chisel.registerOre("limestone_slab", "limestone_slab"); + + BlockMarbleStairsMaker makerLimestoneStairs = new BlockMarbleStairsMaker(limestone); + makerLimestoneStairs.carverHelper.setChiselBlockName("Limestone Stairs"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.0.desc"), 0, "limestone"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.1.desc"), 1, "limestone/terrain-cobbsmalltilelight"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.2.desc"), 2, "limestone/terrain-cob-frenchlight"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.3.desc"), 3, "limestone/terrain-cob-french2light"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.4.desc"), 4, "limestone/terrain-cobmoss-creepdungeonlight"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.5.desc"), 5, "limestone/terrain-cob-smallbricklight"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.6.desc"), 6, "limestone/terrain-mossysmalltilelight"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.7.desc"), 7, "limestone/terrain-pistonback-dungeon"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.8.desc"), 8, "limestone/terrain-pistonback-dungeonornate"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.9.desc"), 9, "limestone/terrain-pistonback-dungeonvent"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.10.desc"), 10, "limestone/terrain-pistonback-lightcreeper"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.11.desc"), 11, "limestone/terrain-pistonback-lightdent"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.12.desc"), 12, "limestone/terrain-pistonback-lightemboss"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.13.desc"), 13, "limestone/terrain-pistonback-lightfour"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.14.desc"), 14, "limestone/terrain-pistonback-lightmarker"); + makerLimestoneStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.limestoneStairs.15.desc"), 15, "limestone/terrain-pistonback-lightpanel"); + makerLimestoneStairs.create("limestone_stairs"); + Carving.chisel.registerOre("limestone_stairs", "limestone_stairs"); + } + + if (Configurations.featureEnabled("cobblestone")) { + cobblestone = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("cobblestone", Blocks.cobblestone, 0, 0); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.0.desc"), 1, "cobblestone/terrain-cobb-brickaligned"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.1.desc"), 2, "cobblestone/terrain-cob-detailedbrick"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.2.desc"), 3, "cobblestone/terrain-cob-smallbrick"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.3.desc"), 4, "cobblestone/terrain-cobblargetiledark"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.4.desc"), 5, "cobblestone/terrain-cobbsmalltile"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.5.desc"), 6, "cobblestone/terrain-cob-french"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.6.desc"), 7, "cobblestone/terrain-cob-french2"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.7.desc"), 8, "cobblestone/terrain-cobmoss-creepdungeon"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.8.desc"), 9, "cobblestone/terrain-mossysmalltiledark"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.9.desc"), 10, "cobblestone/terrain-pistonback-dungeontile"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.10.desc"), 11, "cobblestone/terrain-pistonback-darkcreeper"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.11.desc"), 12, "cobblestone/terrain-pistonback-darkdent"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.12.desc"), 13, "cobblestone/terrain-pistonback-darkemboss"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.13.desc"), 14, "cobblestone/terrain-pistonback-darkmarker"); + cobblestone.carverHelper.addVariation(StatCollector.translateToLocal("tile.cobblestone.14.desc"), 15, "cobblestone/terrain-pistonback-darkpanel"); + cobblestone.carverHelper.register(cobblestone, "cobblestone"); + Carving.chisel.registerOre("cobblestone", "cobblestone"); + } + + if (Configurations.featureEnabled("glass")) { + glass = (BlockCarvableGlass) new BlockCarvableGlass().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.3F).setStepSound(Block.soundTypeGlass); + Carving.chisel.addVariation("glass", Blocks.glass, 0, 0); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.1.desc"), 1, "glass/terrain-glassbubble"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.2.desc"), 2, "glass/terrain-glass-chinese"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.3.desc"), 3, "glass/japanese"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.4.desc"), 4, "glass/terrain-glassdungeon"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.5.desc"), 5, "glass/terrain-glasslight"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.6.desc"), 6, "glass/terrain-glassnoborder"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.7.desc"), 7, "glass/terrain-glass-ornatesteel"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.8.desc"), 8, "glass/terrain-glass-screen"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.9.desc"), 9, "glass/terrain-glassshale"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.10.desc"), 10, "glass/terrain-glass-steelframe"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.11.desc"), 11, "glass/terrain-glassstone"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.12.desc"), 12, "glass/terrain-glassstreak"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.13.desc"), 13, "glass/terrain-glass-thickgrid"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.14.desc"), 14, "glass/terrain-glass-thingrid"); + glass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass.15.desc"), 15, "glass/a1-glasswindow-ironfencemodern"); + glass.carverHelper.register(glass, "glass"); + Carving.chisel.registerOre("glass", "glass"); + } + + if (Configurations.featureEnabled("sandstone")) { + sandstone = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone).setHardness(0.8F); + Carving.chisel.addVariation("sandstone", Blocks.sandstone, 0, 0); + Carving.chisel.addVariation("sandstone", Blocks.sandstone, 1, 1); + Carving.chisel.addVariation("sandstone", Blocks.sandstone, 2, 2); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.3.desc"), 3, "sandstone/faded"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.4.desc"), 4, "sandstone/column"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.5.desc"), 5, "sandstone/capstone"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.6.desc"), 6, "sandstone/small"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.7.desc"), 7, "sandstone/base"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.8.desc"), 8, "sandstone/smooth"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.9.desc"), 9, "sandstone/smooth-cap"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.10.desc"), 10, "sandstone/smooth-small"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.11.desc"), 11, "sandstone/smooth-base"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.12.desc"), 12, "sandstone/block"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.13.desc"), 13, "sandstone/blocks"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.14.desc"), 14, "sandstone/mosaic"); + sandstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstone.15.desc"), 15, "sandstone/horizontal-tiles"); + sandstone.carverHelper.register(sandstone, "sandstone"); + Carving.chisel.registerOre("sandstone", "sandstone"); + + if (Configurations.featureEnabled("snakeSandstone")) { + sandSnakestone = (BlockSnakestone) new BlockSnakestone("Chisel:snakestone/sandsnake/").setCreativeTab(ModTabs.tabStoneChiselBlocks).setBlockName("snakestoneSand"); + GameRegistry.registerBlock(sandSnakestone, 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", sandSnakestone, 1, 16); + Carving.chisel.addVariation("sandstone", sandSnakestone, 13, 17); + Carving.chisel.registerOre("sandSnakestone", "sandSnakestone"); + } + } + + if (Configurations.featureEnabled("sandstoneScribbles")) { + sandstoneScribbles = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone).setHardness(0.8F); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 0, "sandstone-scribbles/scribbles-0"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 1, "sandstone-scribbles/scribbles-1"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 2, "sandstone-scribbles/scribbles-2"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 3, "sandstone-scribbles/scribbles-3"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 4, "sandstone-scribbles/scribbles-4"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 5, "sandstone-scribbles/scribbles-5"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 6, "sandstone-scribbles/scribbles-6"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 7, "sandstone-scribbles/scribbles-7"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 8, "sandstone-scribbles/scribbles-8"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 9, "sandstone-scribbles/scribbles-9"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 10, "sandstone-scribbles/scribbles-10"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 11, "sandstone-scribbles/scribbles-11"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 12, "sandstone-scribbles/scribbles-12"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 13, "sandstone-scribbles/scribbles-13"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 14, "sandstone-scribbles/scribbles-14"); + sandstoneScribbles.carverHelper.addVariation(StatCollector.translateToLocal("tile.sandstoneScribbles.desc"), 15, "sandstone-scribbles/scribbles-15"); + sandstoneScribbles.carverHelper.register(sandstoneScribbles, "sandstone_scribbles"); + Carving.chisel.registerOre("sandstone_scribbles", "sandstone_scribbles"); + } + + if (Configurations.featureEnabled("concrete")) { + concrete = (BlockConcrete) new BlockConcrete().setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(0.5F); + concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.0.desc"), 0, "concrete/default"); + concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.1.desc"), 1, "concrete/block"); + concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.2.desc"), 2, "concrete/doubleslab"); + concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.3.desc"), 3, "concrete/blocks"); + concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.4.desc"), 4, "concrete/weathered"); + concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.5.desc"), 5, "concrete/weathered-block"); + concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.6.desc"), 6, "concrete/weathered-doubleslab"); + concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.7.desc"), 7, "concrete/weathered-blocks"); + concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.8.desc"), 8, "concrete/weathered-half"); + concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.9.desc"), 9, "concrete/weathered-block-half"); + concrete.carverHelper.addVariation(StatCollector.translateToLocal("tile.concrete.10.desc"), 10, "concrete/asphalt"); + concrete.carverHelper.register(concrete, "concrete"); + OreDictionary.registerOre("concrete", concrete); + Carving.chisel.registerOre("concrete", "concrete"); + } + + if (Configurations.featureEnabled("roadLine")) { + roadLine = (BlockRoadLine) new BlockRoadLine().setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.01F).setBlockName("roadLine"); + GameRegistry.registerBlock(roadLine, ItemCarvable.class, "road_line"); + Carving.chisel.registerOre("roadLine", "roadLine"); + } + + if (Configurations.featureEnabled("ironBlock")) { + iron = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(5F).setResistance(10F).setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("iron_block", Blocks.iron_block, 0, 0); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.1.desc"), 1, "iron/terrain-iron-largeingot"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.2.desc"), 2, "iron/terrain-iron-smallingot"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.3.desc"), 3, "iron/terrain-iron-gears"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.4.desc"), 4, "iron/terrain-iron-brick"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.5.desc"), 5, "iron/terrain-iron-plates"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.6.desc"), 6, "iron/terrain-iron-rivets"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.7.desc"), 7, "iron/terrain-iron-coin-heads"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.8.desc"), 8, "iron/terrain-iron-coin-tails"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.9.desc"), 9, "iron/terrain-iron-crate-dark"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.10.desc"), 10, "iron/terrain-iron-crate-light"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.11.desc"), 11, "iron/terrain-iron-moon"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.12.desc"), 12, "iron/terrain-iron-space"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.13.desc"), 13, "iron/terrain-iron-spaceblack"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.14.desc"), 14, "iron/terrain-iron-vents"); + iron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron.15.desc"), 15, "iron/terrain-iron-simple"); + iron.carverHelper.register(iron, "iron_block"); + Carving.chisel.registerOre("iron_block", "iron"); + } + + if (Configurations.featureEnabled("goldBlock")) { + gold = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(3F).setResistance(10F).setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("gold_block", Blocks.gold_block, 0, 0); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.1.desc"), 1, "gold/terrain-gold-largeingot"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.2.desc"), 2, "gold/terrain-gold-smallingot"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.3.desc"), 3, "gold/terrain-gold-brick"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.4.desc"), 4, "gold/terrain-gold-cart"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.5.desc"), 5, "gold/terrain-gold-coin-heads"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.6.desc"), 6, "gold/terrain-gold-coin-tails"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.7.desc"), 7, "gold/terrain-gold-crate-dark"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.8.desc"), 8, "gold/terrain-gold-crate-light"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.9.desc"), 9, "gold/terrain-gold-plates"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.10.desc"), 10, "gold/terrain-gold-rivets"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.11.desc"), 11, "gold/terrain-gold-star"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.12.desc"), 12, "gold/terrain-gold-space"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.13.desc"), 13, "gold/terrain-gold-spaceblack"); + gold.carverHelper.addVariation(StatCollector.translateToLocal("tile.gold.14.desc"), 14, "gold/terrain-gold-simple"); + gold.carverHelper.register(gold, "gold_block"); + Carving.chisel.registerOre("gold_block", "gold"); + } + + if (Configurations.featureEnabled("diamondBlock")) { + diamond = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(5F).setResistance(10F).setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("diamond_block", Blocks.diamond_block, 0, 0); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.1.desc"), 1, "diamond/terrain-diamond-embossed"); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.2.desc"), 2, "diamond/terrain-diamond-gem"); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.3.desc"), 3, "diamond/terrain-diamond-cells"); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.4.desc"), 4, "diamond/terrain-diamond-space"); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.5.desc"), 5, "diamond/terrain-diamond-spaceblack"); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.6.desc"), 6, "diamond/terrain-diamond-simple"); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.7.desc"), 7, "diamond/terrain-diamond-bismuth"); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.8.desc"), 8, "diamond/terrain-diamond-crushed"); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.9.desc"), 9, "diamond/terrain-diamond-four"); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.10.desc"), 10, "diamond/terrain-diamond-fourornate"); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.11.desc"), 11, "diamond/terrain-diamond-zelda"); + diamond.carverHelper.addVariation(StatCollector.translateToLocal("tile.diamond.12.desc"), 12, "diamond/terrain-diamond-ornatelayer"); + diamond.carverHelper.register(diamond, "diamond_block"); + Carving.chisel.registerOre("diamond_block", "diamond"); + } + + if (Configurations.featureEnabled("glowstone")) { + lightstone = (BlockLightstoneCarvable) new BlockLightstoneCarvable().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.3F).setLightLevel(1.0F).setStepSound(Block.soundTypeGlass); + Carving.chisel.addVariation("glowstone", Blocks.glowstone, 0, 0); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.1.desc"), 1, "lightstone/terrain-sulphur-cobble"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.2.desc"), 2, "lightstone/terrain-sulphur-corroded"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.3.desc"), 3, "lightstone/terrain-sulphur-glass"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.4.desc"), 4, "lightstone/terrain-sulphur-neon"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.5.desc"), 5, "lightstone/terrain-sulphur-ornate"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.6.desc"), 6, "lightstone/terrain-sulphur-rocky"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.7.desc"), 7, "lightstone/terrain-sulphur-shale"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.8.desc"), 8, "lightstone/terrain-sulphur-tile"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.9.desc"), 9, "lightstone/terrain-sulphur-weavelanternlight"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.10.desc"), 10, "lightstone/a1-glowstone-cobble"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.11.desc"), 11, "lightstone/a1-glowstone-growth"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.12.desc"), 12, "lightstone/a1-glowstone-layers"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.13.desc"), 13, "lightstone/a1-glowstone-tilecorroded"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.14.desc"), 14, "lightstone/glowstone-bismuth"); + lightstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lightstone.15.desc"), 15, "lightstone/glowstone-bismuth-panel"); + lightstone.carverHelper.register(lightstone, "glowstone"); + Carving.chisel.registerOre("glowstone", "glowstone"); + } + + if (Configurations.featureEnabled("lapisBlock")) { + lapis = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(3F).setResistance(5F).setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("lapis_block", Blocks.lapis_block, 0, 0); + lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.1.desc"), 1, "lapis/terrain-lapisblock-chunky"); + lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.2.desc"), 2, "lapis/terrain-lapisblock-panel"); + lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.3.desc"), 3, "lapis/terrain-lapisblock-zelda"); + lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.4.desc"), 4, "lapis/terrain-lapisornate"); + lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.5.desc"), 5, "lapis/terrain-lapistile"); + lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.6.desc"), 6, "lapis/a1-blocklapis-panel"); + lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.7.desc"), 7, "lapis/a1-blocklapis-smooth"); + lapis.carverHelper.addVariation(StatCollector.translateToLocal("tile.lapis.8.desc"), 8, "lapis/a1-blocklapis-ornatelayer"); + lapis.carverHelper.register(lapis, "lapis_block"); + Carving.chisel.registerOre("lapis_block", "lapis"); + } + + if (Configurations.featureEnabled("emeraldBlock")) { + emerald = (BlockBeaconBase) new BlockBeaconBase().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("emerald_block", Blocks.emerald_block, 0, 0); + emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.1.desc"), 1, "emerald/panel"); + emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.2.desc"), 2, "emerald/panelclassic"); + emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.3.desc"), 3, "emerald/smooth"); + emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.4.desc"), 4, "emerald/chunk"); + emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.5.desc"), 5, "emerald/goldborder"); + emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.6.desc"), 6, "emerald/zelda"); + emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.7.desc"), 7, "emerald/cell"); + emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.8.desc"), 8, "emerald/cellbismuth"); + emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.9.desc"), 9, "emerald/four"); + emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.10.desc"), 10, "emerald/fourornate"); + emerald.carverHelper.addVariation(StatCollector.translateToLocal("tile.emerald.11.desc"), 11, "emerald/ornate"); + emerald.carverHelper.register(emerald, "emerald_block"); + Carving.chisel.registerOre("emerald_block", "emerald"); + } + + if (Configurations.featureEnabled("netherBrick")) { + netherBrick = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.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); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.1.desc"), 1, "netherbrick/a1-netherbrick-brinstar"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.2.desc"), 2, "netherbrick/a1-netherbrick-classicspatter"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.3.desc"), 3, "netherbrick/a1-netherbrick-guts"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.4.desc"), 4, "netherbrick/a1-netherbrick-gutsdark"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.5.desc"), 5, "netherbrick/a1-netherbrick-gutssmall"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.6.desc"), 6, "netherbrick/a1-netherbrick-lavabrinstar"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.7.desc"), 7, "netherbrick/a1-netherbrick-lavabrown"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.8.desc"), 8, "netherbrick/a1-netherbrick-lavaobsidian"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.9.desc"), 9, "netherbrick/a1-netherbrick-lavastonedark"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.10.desc"), 10, "netherbrick/a1-netherbrick-meat"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.11.desc"), 11, "netherbrick/a1-netherbrick-meatred"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.12.desc"), 12, "netherbrick/a1-netherbrick-meatredsmall"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.13.desc"), 13, "netherbrick/a1-netherbrick-meatsmall"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.14.desc"), 14, "netherbrick/a1-netherbrick-red"); + netherBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.netherBrick.15.desc"), 15, "netherbrick/a1-netherbrick-redsmall"); + netherBrick.carverHelper.register(netherBrick, "nether_brick"); + Carving.chisel.registerOre("nether_brick", "nether_brick"); + } + + if (Configurations.featureEnabled("netherRack")) { + netherrack = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(0.4F).setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("netherrack", Blocks.netherrack, 0, 0); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.1.desc"), 1, "netherrack/a1-netherrack-bloodgravel"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.2.desc"), 2, "netherrack/a1-netherrack-bloodrock"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.3.desc"), 3, "netherrack/a1-netherrack-bloodrockgrey"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.4.desc"), 4, "netherrack/a1-netherrack-brinstar"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.5.desc"), 5, "netherrack/a1-netherrack-brinstarshale"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.6.desc"), 6, "netherrack/a1-netherrack-classic"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.7.desc"), 7, "netherrack/a1-netherrack-classicspatter"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.8.desc"), 8, "netherrack/a1-netherrack-guts"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.9.desc"), 9, "netherrack/a1-netherrack-gutsdark"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.10.desc"), 10, "netherrack/a1-netherrack-meat"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.11.desc"), 11, "netherrack/a1-netherrack-meatred"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.12.desc"), 12, "netherrack/a1-netherrack-meatrock"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.13.desc"), 13, "netherrack/a1-netherrack-red"); + netherrack.carverHelper.addVariation(StatCollector.translateToLocal("tile.hellrock.14.desc"), 14, "netherrack/a1-netherrack-wells"); + netherrack.carverHelper.register(netherrack, "netherrack"); + Carving.chisel.registerOre("netherrack", "netherrack"); + } + + if (Configurations.featureEnabled("cobblestoneMossy")) { + cobblestoneMossy = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10.0F).setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("mossy_cobblestone", Blocks.mossy_cobblestone, 0, 0); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.1.desc"), 1, "cobblestonemossy/terrain-cobb-brickaligned"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.2.desc"), 2, "cobblestonemossy/terrain-cob-detailedbrick"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.3.desc"), 3, "cobblestonemossy/terrain-cob-smallbrick"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.4.desc"), 4, "cobblestonemossy/terrain-cobblargetiledark"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.5.desc"), 5, "cobblestonemossy/terrain-cobbsmalltile"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.6.desc"), 6, "cobblestonemossy/terrain-cob-french"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.7.desc"), 7, "cobblestonemossy/terrain-cob-french2"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.8.desc"), 8, "cobblestonemossy/terrain-cobmoss-creepdungeon"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.9.desc"), 9, "cobblestonemossy/terrain-mossysmalltiledark"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.10.desc"), 10, "cobblestonemossy/terrain-pistonback-dungeontile"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.11.desc"), 11, "cobblestonemossy/terrain-pistonback-darkcreeper"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.12.desc"), 12, "cobblestonemossy/terrain-pistonback-darkdent"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.13.desc"), 13, "cobblestonemossy/terrain-pistonback-darkemboss"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.14.desc"), 14, "cobblestonemossy/terrain-pistonback-darkmarker"); + cobblestoneMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneMoss.15.desc"), 15, "cobblestonemossy/terrain-pistonback-darkpanel"); + cobblestoneMossy.carverHelper.register(cobblestoneMossy, "mossy_cobblestone"); + Carving.chisel.registerOre("mossy_cobblestone", "mossy_cobblestone"); + } + + if (Configurations.featureEnabled("stoneBrick")) { + stoneBrick = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(1.5F).setResistance(10.0F).setStepSound(Block.soundTypeStone); + for (int i = 0; i < 4; i++) { + if (i == 1) { + if (Configurations.allowMossy) + Carving.chisel.addVariation("stonebricksmooth", Blocks.stonebrick, i, i); + } else + Carving.chisel.addVariation("stonebricksmooth", Blocks.stonebrick, i, i); + } + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.4.desc"), 4, "stonebrick/smallbricks"); + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.5.desc"), 5, "stonebrick/largebricks"); + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.6.desc"), 6, "stonebrick/smallchaotic"); + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.7.desc"), 7, "stonebrick/chaoticbricks"); + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.8.desc"), 8, "stonebrick/chaotic"); + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.9.desc"), 9, "stonebrick/fancy"); + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.10.desc"), 10, "stonebrick/ornate"); + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.11.desc"), 11, "stonebrick/largeornate"); + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.12.desc"), 12, "stonebrick/panel-hard"); + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.13.desc"), 13, "stonebrick/sunken"); + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.14.desc"), 14, "stonebrick/ornatepanel"); + stoneBrick.carverHelper.addVariation(StatCollector.translateToLocal("tile.stoneBrick.15.desc"), 15, "stonebrick/poison"); + stoneBrick.carverHelper.register(stoneBrick, "stonebricksmooth"); + Carving.chisel.registerOre("stonebricksmooth", "stonebricksmooth"); + } + + if (Configurations.featureEnabled("snakestone")) { + snakestone = (BlockSnakestone) new BlockSnakestone("Chisel:snakestone/snake/").setBlockName("snakestoneStone").setCreativeTab(ModTabs.tabStoneChiselBlocks); + GameRegistry.registerBlock(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", snakestone, 1, 16); + Carving.chisel.addVariation("stonebrick", snakestone, 13, 17); + Carving.chisel.registerOre("snakestoneStone", "snakestoneStone"); + } + + if (Configurations.featureEnabled("dirt")) { + dirt = (BlockCarvable) new BlockCarvable(Material.ground).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setStepSound(Block.soundTypeGravel).setBlockName("dirt.default"); + Carving.chisel.addVariation("dirt", Blocks.dirt, 0, 0); + dirt.carverHelper.setChiselBlockName("Dirt"); + // dirt.carverHelper.addVariation("Dirt", 0, Blocks.dirt); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.0.desc"), 0, "dirt/bricks"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.1.desc"), 1, "dirt/netherbricks"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.2.desc"), 2, "dirt/bricks3"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.3.desc"), 3, "dirt/cobble"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.4.desc"), 4, "dirt/reinforcedCobbleDirt"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.5.desc"), 5, "dirt/reinforcedDirt"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.6.desc"), 6, "dirt/happy"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.7.desc"), 7, "dirt/bricks2"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.8.desc"), 8, "dirt/bricks+dirt2"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.9.desc"), 9, "dirt/hor"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.10.desc"), 10, "dirt/vert"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.11.desc"), 11, "dirt/layers"); + dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.12.desc"), 12, "dirt/vertical"); + dirt.carverHelper.register(dirt, "dirt"); + dirt.setHarvestLevel("shovel", 0); + OreDictionary.registerOre("dirt", dirt); + Carving.chisel.registerOre("dirt", "dirt"); + } + + if (Configurations.featureEnabled("ice")) { + ice = (BlockMarbleIce) new BlockMarbleIce().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3).setStepSound(Block.soundTypeGlass); + Carving.chisel.addVariation("ice", Blocks.ice, 0, 0); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.1.desc"), 1, "ice/a1-ice-light"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.2.desc"), 2, "ice/a1-stonecobble-icecobble"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.3.desc"), 3, "ice/a1-netherbrick-ice"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.4.desc"), 4, "ice/a1-stonecobble-icebrick"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.5.desc"), 5, "ice/a1-stonecobble-icebricksmall"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.6.desc"), 6, "ice/a1-stonecobble-icedungeon"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.7.desc"), 7, "ice/a1-stonecobble-icefour"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.8.desc"), 8, "ice/a1-stonecobble-icefrench"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.9.desc"), 9, "ice/sunkentiles"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.10.desc"), 10, "ice/tiles"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.11.desc"), 11, "ice/a1-stonecobble-icepanel"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.12.desc"), 12, "ice/a1-stoneslab-ice"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.13.desc"), 13, "ice/zelda"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.14.desc"), 14, "ice/bismuth"); + ice.carverHelper.addVariation(StatCollector.translateToLocal("tile.ice.15.desc"), 15, "ice/poison"); + ice.carverHelper.register(ice, "ice"); + Carving.chisel.registerOre("ice", "ice"); + + if (Configurations.featureEnabled("icePillar")) { + icePillar = (BlockMarbleIce) new BlockMarbleIce().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3).setStepSound(Block.soundTypeGlass); + icePillar.carverHelper.setChiselBlockName("Ice Pillar"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.0.desc"), 0, "icepillar/column"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.1.desc"), 1, "icepillar/capstone"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.2.desc"), 2, "icepillar/base"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.3.desc"), 3, "icepillar/small"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.4.desc"), 4, "icepillar/pillar-carved"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.5.desc"), 5, "icepillar/a1-stoneornamental-marblegreek"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.6.desc"), 6, "icepillar/a1-stonepillar-greek"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.7.desc"), 7, "icepillar/a1-stonepillar-plain"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.8.desc"), 8, "icepillar/a1-stonepillar-greektopplain"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.9.desc"), 9, "icepillar/a1-stonepillar-plaintopplain"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.10.desc"), 10, "icepillar/a1-stonepillar-greekbottomplain"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.11.desc"), 11, "icepillar/a1-stonepillar-plainbottomplain"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.12.desc"), 12, "icepillar/a1-stonepillar-greektopgreek"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.13.desc"), 13, "icepillar/a1-stonepillar-plaintopgreek"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.14.desc"), 14, "icepillar/a1-stonepillar-greekbottomgreek"); + icePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.icePillar.15.desc"), 15, "icepillar/a1-stonepillar-plainbottomgreek"); + icePillar.carverHelper.register(icePillar, "ice_pillar"); + Carving.chisel.setGroupClass("ice_pillar", "ice"); + } + + if (Configurations.featureEnabled("iceStairs")) { + BlockMarbleStairsMaker makerIceStairs = new BlockMarbleStairsMaker(Blocks.ice); + makerIceStairs.carverHelper.setChiselBlockName("Ice Stairs"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.0.desc"), 0, Blocks.ice); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.1.desc"), 1, "ice/a1-ice-light"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.2.desc"), 2, "ice/a1-stonecobble-icecobble"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.3.desc"), 3, "ice/a1-netherbrick-ice"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.4.desc"), 4, "ice/a1-stonecobble-icebrick"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.5.desc"), 5, "ice/a1-stonecobble-icebricksmall"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.6.desc"), 6, "ice/a1-stonecobble-icedungeon"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.7.desc"), 7, "ice/a1-stonecobble-icefour"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.8.desc"), 8, "ice/a1-stonecobble-icefrench"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.9.desc"), 9, "ice/sunkentiles"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.10.desc"), 10, "ice/tiles"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.11.desc"), 11, "ice/a1-stonecobble-icepanel"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.12.desc"), 12, "ice/a1-stoneslab-ice"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.13.desc"), 13, "ice/zelda"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.14.desc"), 14, "ice/bismuth"); + makerIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.iceStairs.15.desc"), 15, "ice/poison"); + makerIceStairs.create(new BlockMarbleStairsMakerCreator() { + + @Override + public BlockMarbleStairs create(Block block, int meta, CarvableHelper helper) { + return new BlockMarbleIceStairs(block, meta, helper); + } + }, "ice_stairs"); + Carving.chisel.registerOre("iceStairs", "iceStairs"); + } + } + if (Configurations.featureEnabled("packedice")) { + packedice = (BlockMarblePackedIce) new BlockMarblePackedIce().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3).setStepSound(Block.soundTypeGlass); + Carving.chisel.addVariation("packedice", Blocks.packed_ice, 0, 0); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.1.desc"), 1, "packedice/a1-ice-light"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.2.desc"), 2, "packedice/a1-stonecobble-icecobble"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.3.desc"), 3, "packedice/a1-netherbrick-ice"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.4.desc"), 4, "packedice/a1-stonecobble-icebrick"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.5.desc"), 5, "packedice/a1-stonecobble-icebricksmall"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.6.desc"), 6, "packedice/a1-stonecobble-icedungeon"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.7.desc"), 7, "packedice/a1-stonecobble-icefour"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.8.desc"), 8, "packedice/a1-stonecobble-icefrench"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.9.desc"), 9, "packedice/sunkentiles"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.10.desc"), 10, "packedice/tiles"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.11.desc"), 11, "packedice/a1-stonecobble-icepanel"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.12.desc"), 12, "packedice/a1-stoneslab-ice"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.13.desc"), 13, "packedice/zelda"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.14.desc"), 14, "packedice/bismuth"); + packedice.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedice.15.desc"), 15, "packedice/poison"); + packedice.carverHelper.register(packedice, "packedice"); + Carving.chisel.registerOre("packedice", "packedice"); + + if (Configurations.featureEnabled("packedicePillar")) { + packedicePillar = (BlockMarblePackedIce) new BlockMarblePackedIce().setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3) + .setStepSound(Block.soundTypeGlass); + packedicePillar.carverHelper.setChiselBlockName("Packed Ice Pillar"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.0.desc"), 0, "packedicepillar/column"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.1.desc"), 1, "packedicepillar/capstone"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.2.desc"), 2, "packedicepillar/base"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.3.desc"), 3, "packedicepillar/small"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.4.desc"), 4, "packedicepillar/pillar-carved"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.5.desc"), 5, "packedicepillar/a1-stoneornamental-marblegreek"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.6.desc"), 6, "packedicepillar/a1-stonepillar-greek"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.7.desc"), 7, "packedicepillar/a1-stonepillar-plain"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.8.desc"), 8, "packedicepillar/a1-stonepillar-greektopplain"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.9.desc"), 9, "packedicepillar/a1-stonepillar-plaintopplain"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.10.desc"), 10, "packedicepillar/a1-stonepillar-greekbottomplain"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.11.desc"), 11, "packedicepillar/a1-stonepillar-plainbottomplain"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.12.desc"), 12, "packedicepillar/a1-stonepillar-greektopgreek"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.13.desc"), 13, "packedicepillar/a1-stonepillar-plaintopgreek"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.14.desc"), 14, "packedicepillar/a1-stonepillar-greekbottomgreek"); + packedicePillar.carverHelper.addVariation(StatCollector.translateToLocal("tile.packedicePillar.15.desc"), 15, "packedicepillar/a1-stonepillar-plainbottomgreek"); + packedicePillar.carverHelper.register(packedicePillar, "packedice_pillar"); + Carving.chisel.setGroupClass("packedice_pillar", "packedice"); + } + + if (Configurations.featureEnabled("packediceStairs")) { + BlockMarbleStairsMaker makerPackedIceStairs = new BlockMarbleStairsMaker(Blocks.packed_ice); + makerPackedIceStairs.carverHelper.setChiselBlockName("Packed Ice Stairs"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.0.desc"), 0, Blocks.packed_ice); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.1.desc"), 1, "packedice/a1-ice-light"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.2.desc"), 2, "packedice/a1-stonecobble-icecobble"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.3.desc"), 3, "packedice/a1-netherbrick-ice"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.4.desc"), 4, "packedice/a1-stonecobble-icebrick"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.5.desc"), 5, "packedice/a1-stonecobble-icebricksmall"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.6.desc"), 6, "packedice/a1-stonecobble-icedungeon"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.7.desc"), 7, "packedice/a1-stonecobble-icefour"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.8.desc"), 8, "packedice/a1-stonecobble-icefrench"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.9.desc"), 9, "packedice/sunkentiles"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.10.desc"), 10, "packedice/tiles"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.11.desc"), 11, "packedice/a1-stonecobble-icepanel"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.12.desc"), 12, "packedice/a1-stoneslab-ice"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.13.desc"), 13, "packedice/zelda"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.14.desc"), 14, "packedice/bismuth"); + makerPackedIceStairs.carverHelper.addVariation(StatCollector.translateToLocal("tile.packediceStairs.15.desc"), 15, "packedice/poison"); + makerPackedIceStairs.create(new BlockMarbleStairsMakerCreator() { + + @Override + public BlockMarbleStairs create(Block block, int meta, CarvableHelper helper) { + return new BlockMarblePackedIceStairs(block, meta, helper); + } + }, "packedice_stairs"); + Carving.chisel.registerOre("packedIceStairs", "packedIceStairs"); + } + } + + if (Configurations.featureEnabled("wood")) { + String[] plank_names = { "oak", "spruce", "birch", "jungle", "acacia", "dark-oak" }; + String[] plank_ucnames = { "Oak", "Spruce", "Birch", "Jungle", "Acacia", "Dark Oak" }; + for (int i = 0; i < 6; i++) { + String n = plank_names[i]; + String u = plank_ucnames[i]; + final String orename = n.replace('-', '_') + "_planks"; + + planks[i] = (BlockCarvable) (new BlockCarvable(Material.wood)).setCreativeTab(ModTabs.tabWoodChiselBlocks).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundTypeWood); + planks[i].carverHelper.setChiselBlockName(u + " Wood Planks"); + planks[i].carverHelper.addVariation("Smooth " + n + " wood planks", 1, "planks-" + n + "/clean"); + planks[i].carverHelper.addVariation("Short " + n + " wood planks", 2, "planks-" + n + "/short"); + planks[i].carverHelper.addVariation("Fancy " + n + " wood plank arrangement", 6, "planks-" + n + "/fancy"); + planks[i].carverHelper.addVariation(u + " wood panel", 8, "planks-" + n + "/panel-nails"); + planks[i].carverHelper.addVariation(u + " wood double slab", 9, "planks-" + n + "/double"); + planks[i].carverHelper.addVariation(u + " wood crate", 10, "planks-" + n + "/crate"); + planks[i].carverHelper.addVariation("Fancy " + n + " wood crate", 11, "planks-" + n + "/crate-fancy"); + planks[i].carverHelper.addVariation("Large long " + n + " wood planks", 13, "planks-" + n + "/large"); + planks[i].carverHelper.addVariation("Vertical " + n + " wood planks", 3, "planks-" + n + "/vertical"); + planks[i].carverHelper.addVariation("Vertical uneven " + n + " wood planks", 4, "planks-" + n + "/vertical-uneven"); + planks[i].carverHelper.addVariation(u + " wood parquet", 5, "planks-" + n + "/parquet"); + planks[i].carverHelper.addVariation(u + " wood plank blinds", 7, "planks-" + n + "/blinds"); + planks[i].carverHelper.addVariation(u + " wood scaffold", 12, "planks-" + n + "/crateex"); + planks[i].carverHelper.addVariation(u + " wood planks in disarray", 14, "planks-" + n + "/chaotic-hor"); + planks[i].carverHelper.addVariation("Vertical " + n + " wood planks in disarray", 15, "planks-" + n + "/chaotic"); + planks[i].carverHelper.register(planks[i], orename); + Carving.chisel.addVariation(orename, Blocks.planks, i, 0); + planks[i].setHarvestLevel("axe", 0); + Carving.chisel.registerOre("wood", "wood"); + Carving.chisel.setVariationSound(orename, Chisel.MOD_ID + ":chisel.wood"); + } + } + + if (Configurations.featureEnabled("obsidian")) { + obsidian = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(50.0F).setResistance(2000.0F).setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("obsidian", Blocks.obsidian, 0, 0); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.1.desc"), 1, "obsidian/pillar"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.2.desc"), 2, "obsidian/pillar-quartz"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.3.desc"), 3, "obsidian/chiseled"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.4.desc"), 4, "obsidian/panel-shiny"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.5.desc"), 5, "obsidian/panel"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.6.desc"), 6, "obsidian/chunks"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.7.desc"), 7, "obsidian/growth"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.8.desc"), 8, "obsidian/crystal"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.9.desc"), 9, "obsidian/map-a"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.10.desc"), 10, "obsidian/map-b"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.11.desc"), 11, "obsidian/panel-light"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.12.desc"), 12, "obsidian/blocks"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.13.desc"), 13, "obsidian/tiles"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.14.desc"), 14, "obsidian/greek"); + obsidian.carverHelper.addVariation(StatCollector.translateToLocal("tile.obsidian.15.desc"), 15, "obsidian/crate"); + obsidian.carverHelper.register(obsidian, "obsidian"); + Carving.chisel.registerOre("obsidian", "obsidian"); + } + + if (Configurations.featureEnabled("snakestoneObsidian")) { + obsidianSnakestone = (BlockSnakestoneObsidian) new BlockSnakestoneObsidian("Chisel:snakestone/obsidian/").setBlockName("obsidianSnakestone").setHardness(50.0F).setResistance(2000.0F); + GameRegistry.registerBlock(obsidianSnakestone, ItemCarvable.class, "obsidian_snakestone"); + Carving.chisel.addVariation("obsidian", obsidianSnakestone, 1, 16); + Carving.chisel.addVariation("obsidian", obsidianSnakestone, 13, 17); + Carving.chisel.registerOre("obsidianSnakestone", "obsidianSnakestone"); + } + + if (Configurations.featureEnabled("ironBars")) { + paneIron = (BlockCarvablePane) new BlockCarvablePane(Material.iron, true).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.3F).setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("iron_bars", Blocks.iron_bars, 0, 0); + paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.1.desc"), 1, "ironpane/fenceIron"); + paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.2.desc"), 2, "ironpane/barbedwire"); + paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.3.desc"), 3, "ironpane/cage"); + paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.4.desc"), 4, "ironpane/fenceIronTop"); + paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.5.desc"), 5, "ironpane/terrain-glass-thickgrid"); + paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.6.desc"), 6, "ironpane/terrain-glass-thingrid"); + paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.7.desc"), 7, "ironpane/terrain-glass-ornatesteel"); + paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.8.desc"), 8, "ironpane/bars"); + paneIron.carverHelper.addVariation(StatCollector.translateToLocal("tile.iron_bars.9.desc"), 9, "ironpane/spikes"); + paneIron.carverHelper.register(paneIron, "iron_bars"); + Carving.chisel.registerOre("iron_bars", "iron_bars"); + } + + if (Configurations.featureEnabled("glassPane")) { + paneGlass = (BlockCarvablePane) new BlockCarvablePane(Material.glass, false).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.3F).setStepSound(Block.soundTypeGlass); + Carving.chisel.addVariation("glass_pane", Blocks.glass_pane, 0, 0); + paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.1.desc"), 1, "glasspane/terrain-glassbubble"); + paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.2.desc"), 2, "glasspane/terrain-glassnoborder"); + paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.3.desc"), 3, "glasspane/terrain-glass-screen"); + paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.4.desc"), 4, "glasspane/terrain-glassstreak"); + paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.12.desc"), 12, "glasspane/chinese"); + paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.13.desc"), 13, "glasspane/chinese2"); + paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.14.desc"), 14, "glasspane/japanese"); + paneGlass.carverHelper.addVariation(StatCollector.translateToLocal("tile.glass_pane.15.desc"), 15, "glasspane/japanese2"); + paneGlass.carverHelper.register(paneGlass, "glass_pane"); + Carving.chisel.registerOre("glass_pane", "glass_pane"); + } + + if (Configurations.featureEnabled("redstoneBlock")) { + redstone = (BlockCarvablePowered) (new BlockCarvablePowered(Material.iron)).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(5.0F).setResistance(10.0F) + .setStepSound(Block.soundTypeMetal); + Carving.chisel.addVariation("redstone_block", Blocks.redstone_block, 0, 0); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.1.desc"), 1, "redstone/smooth"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.2.desc"), 2, "redstone/block"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.3.desc"), 3, "redstone/blocks"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.4.desc"), 4, "redstone/bricks"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.5.desc"), 5, "redstone/smallbricks"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.6.desc"), 6, "redstone/smallchaotic"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.7.desc"), 7, "redstone/chiseled"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.8.desc"), 8, "redstone/ere"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.9.desc"), 9, "redstone/ornate-tiles"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.10.desc"), 10, "redstone/pillar"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.11.desc"), 11, "redstone/tiles"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.12.desc"), 12, "redstone/circuit"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.13.desc"), 13, "redstone/supaplex"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.14.desc"), 14, "redstone/a1-blockredstone-skullred"); + redstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.redstone_block.15.desc"), 15, "redstone/a1-blockredstone-redstonezelda"); + redstone.carverHelper.register(redstone, "redstone_block"); + Carving.chisel.registerOre("redstone_block", "redstone"); + } + + if (Configurations.featureEnabled("holystone")) { + holystone = (BlockHolystone) new BlockHolystone(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Chisel.soundHolystoneFootstep); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.0.desc"), 0, "holystone/holystone"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.1.desc"), 1, "holystone/smooth"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.2.desc"), 2, "holystone/love"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.3.desc"), 3, "holystone/chiseled"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.4.desc"), 4, "holystone/blocks"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.5.desc"), 5, "holystone/blocks-rough"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.6.desc"), 6, "holystone/brick"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.7.desc"), 7, "holystone/largebricks"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.8.desc"), 8, "holystone/platform"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.9.desc"), 9, "holystone/platform-tiles"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.10.desc"), 10, "holystone/construction"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.11.desc"), 11, "holystone/fancy-tiles"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.12.desc"), 12, "holystone/plate"); + holystone.carverHelper.addVariation(StatCollector.translateToLocal("tile.holystone.13.desc"), 13, "holystone/plate-rough"); + holystone.carverHelper.register(holystone, "holystone"); + OreDictionary.registerOre("holystone", holystone); + Carving.chisel.registerOre("holystone", "holystone"); + } + + if (Configurations.featureEnabled("lavastone")) { + lavastone = (BlockLavastone) new BlockLavastone(Material.rock, "lava_flow").setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); + lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.0.desc"), 0, "lavastone/cobble"); + lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.1.desc"), 1, "lavastone/black"); + lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.2.desc"), 2, "lavastone/tiles"); + lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.3.desc"), 3, "lavastone/chaotic"); + lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.4.desc"), 4, "lavastone/creeper"); + lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.5.desc"), 5, "lavastone/panel"); + lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.6.desc"), 6, "lavastone/panel-ornate"); + lavastone.carverHelper.addVariation(StatCollector.translateToLocal("tile.lavastone.7.desc"), 7, "lavastone/dark"); + lavastone.carverHelper.register(lavastone, "lavastone"); + OreDictionary.registerOre("lavastone", lavastone); + Carving.chisel.registerOre("lavastone", "lavastone"); + } + + if (Configurations.featureEnabled("fantasy")) { + fantasy = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); + fantasy.carverHelper.setChiselBlockName("Fantasy Block"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.0.desc"), 0, "fantasy/brick"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.1.desc"), 1, "fantasy/brick-faded"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.2.desc"), 2, "fantasy/brick-wear"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.3.desc"), 3, "fantasy/bricks"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.4.desc"), 4, "fantasy/decor"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.5.desc"), 5, "fantasy/decor-block"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.6.desc"), 6, "fantasy/pillar"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.7.desc"), 7, "fantasy/pillar-decorated"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.8.desc"), 8, "fantasy/gold-decor-1"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.9.desc"), 9, "fantasy/gold-decor-2"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.10.desc"), 10, "fantasy/gold-decor-3"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.11.desc"), 11, "fantasy/gold-decor-4"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.12.desc"), 12, "fantasy/plate"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.13.desc"), 13, "fantasy/block"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.14.desc"), 14, "fantasy/bricks-chaotic"); + fantasy.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock.15.desc"), 15, "fantasy/bricks-wear"); + fantasy.carverHelper.register(fantasy, "fantasyblock"); + OreDictionary.registerOre("fantasy", fantasy); + Carving.chisel.registerOre("fantasyblock", "fantasy"); + } + + if (Configurations.featureEnabled("carpet")) { + carpet = (BlockCarvable) new BlockCarvable(Material.cloth).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Block.soundTypeCloth); + carpet.carverHelper.setChiselBlockName("Carpet Block"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.0.desc"), 0, "carpet/white"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.1.desc"), 1, "carpet/orange"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.2.desc"), 2, "carpet/lily"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.3.desc"), 3, "carpet/lightblue"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.4.desc"), 4, "carpet/yellow"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.5.desc"), 5, "carpet/lightgreen"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.6.desc"), 6, "carpet/pink"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.7.desc"), 7, "carpet/darkgrey"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.8.desc"), 8, "carpet/grey"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.9.desc"), 9, "carpet/teal"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.10.desc"), 10, "carpet/purple"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.11.desc"), 11, "carpet/darkblue"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.12.desc"), 12, "carpet/brown"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.13.desc"), 13, "carpet/green"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.14.desc"), 14, "carpet/red"); + carpet.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet_block.15.desc"), 15, "carpet/black"); + carpet.carverHelper.forbidChiseling = true; + carpet.carverHelper.register(carpet, "carpet_block"); + OreDictionary.registerOre("carpet", carpet); + Carving.chisel.registerOre("carpet_block", "carpet"); + } + + if (Configurations.featureEnabled("carpetFloor")) { + carpetFloor = (BlockMarbleCarpet) new BlockMarbleCarpet(Material.cloth).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(2.0F).setResistance(10F) + .setStepSound(Block.soundTypeCloth); + carpetFloor.carverHelper.setChiselBlockName("Carpet"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.0.desc"), 0, "carpet/white"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.1.desc"), 1, "carpet/orange"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.2.desc"), 2, "carpet/lily"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.3.desc"), 3, "carpet/lightblue"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.4.desc"), 4, "carpet/yellow"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.5.desc"), 5, "carpet/lightgreen"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.6.desc"), 6, "carpet/pink"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.7.desc"), 7, "carpet/darkgrey"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.8.desc"), 8, "carpet/grey"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.9.desc"), 9, "carpet/teal"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.10.desc"), 10, "carpet/purple"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.11.desc"), 11, "carpet/darkblue"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.12.desc"), 12, "carpet/brown"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.13.desc"), 13, "carpet/green"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.14.desc"), 14, "carpet/red"); + carpetFloor.carverHelper.addVariation(StatCollector.translateToLocal("tile.carpet.15.desc"), 15, "carpet/black"); + carpetFloor.carverHelper.forbidChiseling = true; + carpetFloor.carverHelper.register(carpetFloor, "carpet"); + + for (int i = 0; i < 16; i++) { + String group = "carpet." + i; + + Carving.needle.addVariation(group, Blocks.carpet, i, 0); + Carving.needle.addVariation(group, carpetFloor, i, 2); + Carving.needle.addVariation(group, carpet, i, 1); + } + + Carving.chisel.registerOre("carpet", "carpet"); + } + + if (Configurations.featureEnabled("bookshelf")) { + bookshelf = (BlockCarvable) new BlockMarbleBookshelf().setHardness(1.5F).setCreativeTab(ModTabs.tabWoodChiselBlocks).setStepSound(Block.soundTypeWood); + Carving.chisel.addVariation("bookshelf", Blocks.bookshelf, 0, 0); + bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.1.desc"), 1, "bookshelf/rainbow"); + bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.2.desc"), 2, "bookshelf/necromancer-novice"); + bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.3.desc"), 3, "bookshelf/necromancer"); + bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.4.desc"), 4, "bookshelf/redtomes"); + bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.5.desc"), 5, "bookshelf/abandoned"); + bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.6.desc"), 6, "bookshelf/hoarder"); + bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.7.desc"), 7, "bookshelf/brim"); + bookshelf.carverHelper.addVariation(StatCollector.translateToLocal("tile.bookshelf.8.desc"), 8, "bookshelf/historician"); + bookshelf.carverHelper.register(bookshelf, "bookshelf"); + bookshelf.setHarvestLevel("axe", 0); + Carving.chisel.registerOre("bookshelf", "bookshelf"); + } + + if (Configurations.featureEnabled("futuristicArmorPlating")) { + tyrian = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal); + tyrian.carverHelper.setChiselBlockName("Futuristic Armor Plating Block"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.0.desc"), 0, "tyrian/shining"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.1.desc"), 1, "tyrian/tyrian"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.2.desc"), 2, "tyrian/chaotic"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.3.desc"), 3, "tyrian/softplate"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.4.desc"), 4, "tyrian/rust"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.5.desc"), 5, "tyrian/elaborate"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.6.desc"), 6, "tyrian/routes"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.7.desc"), 7, "tyrian/platform"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.8.desc"), 8, "tyrian/platetiles"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.9.desc"), 9, "tyrian/diagonal"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.10.desc"), 10, "tyrian/dent"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.11.desc"), 11, "tyrian/blueplating"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.12.desc"), 12, "tyrian/black"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.13.desc"), 13, "tyrian/black2"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.14.desc"), 14, "tyrian/opening"); + tyrian.carverHelper.addVariation(StatCollector.translateToLocal("tile.tyrian.15.desc"), 15, "tyrian/plate"); + tyrian.carverHelper.register(tyrian, "tyrian"); + OreDictionary.registerOre("tyrian", tyrian); + Carving.chisel.registerOre("tyrian", "tyrian"); + } + + if (Configurations.featureEnabled("templeBlock")) { + temple = (BlockCarvable) new BlockEldritch().setHardness(2.0F).setCreativeTab(ModTabs.tabStoneChiselBlocks).setResistance(10F).setStepSound(Chisel.soundTempleFootstep); + temple.carverHelper.setChiselBlockName("Temple Block"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.0.desc"), 0, "temple/cobble"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.1.desc"), 1, "temple/ornate"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.2.desc"), 2, "temple/plate"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.3.desc"), 3, "temple/plate-cracked"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.4.desc"), 4, "temple/bricks"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.5.desc"), 5, "temple/bricks-large"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.6.desc"), 6, "temple/bricks-weared"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.7.desc"), 7, "temple/bricks-disarray"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.8.desc"), 8, "temple/column"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.9.desc"), 9, "temple/stand"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.10.desc"), 10, "temple/stand-mosaic"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.11.desc"), 11, "temple/stand-creeper"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.12.desc"), 12, "temple/tiles"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.13.desc"), 13, "temple/smalltiles"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.14.desc"), 14, "temple/tiles-light"); + temple.carverHelper.addVariation(StatCollector.translateToLocal("tile.templeblock.15.desc"), 15, "temple/smalltiles-light"); + temple.carverHelper.register(temple, "templeblock"); + Carving.chisel.registerOre("templeblock", "templeblock"); + + if (Configurations.featureEnabled("templeBlockMossy")) { + templeMossy = (BlockCarvable) new BlockEldritch().setHardness(2.0F).setCreativeTab(ModTabs.tabStoneChiselBlocks).setResistance(10F).setStepSound(Chisel.soundTempleFootstep); + templeMossy.carverHelper.setChiselBlockName("Mossy Temple Block"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.0.desc"), 0, "templemossy/cobble"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.1.desc"), 1, "templemossy/ornate"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.2.desc"), 2, "templemossy/plate"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.3.desc"), 3, "templemossy/plate-cracked"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.4.desc"), 4, "templemossy/bricks"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.5.desc"), 5, "templemossy/bricks-large"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.6.desc"), 6, "templemossy/bricks-weared"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.7.desc"), 7, "templemossy/bricks-disarray"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.8.desc"), 8, "templemossy/column"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.9.desc"), 9, "templemossy/stand"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.10.desc"), 10, "templemossy/stand-mosaic"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.11.desc"), 11, "templemossy/stand-creeper"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.12.desc"), 12, "templemossy/tiles"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.13.desc"), 13, "templemossy/smalltiles"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.14.desc"), 14, "templemossy/tiles-light"); + templeMossy.carverHelper.addVariation(StatCollector.translateToLocal("tile.mossy_templeblock.15.desc"), 15, "templemossy/smalltiles-light"); + templeMossy.carverHelper.register(templeMossy, "mossy_templeblock"); + Carving.chisel.registerOre("mossy_templeblock", "mossy_templeblock"); + } + } + + if (Configurations.featureEnabled("cloud")) { + cloud = (BlockCloud) new BlockCloud().setHardness(0.2F).setCreativeTab(ModTabs.tabOtherChiselBlocks).setLightOpacity(3).setStepSound(Block.soundTypeCloth); + cloud.carverHelper.addVariation(StatCollector.translateToLocal("tile.cloud.0.desc"), 0, "cloud/cloud"); + cloud.carverHelper.addVariation(StatCollector.translateToLocal("tile.cloud.1.desc"), 1, "cloud/large"); + cloud.carverHelper.addVariation(StatCollector.translateToLocal("tile.cloud.2.desc"), 2, "cloud/small"); + cloud.carverHelper.addVariation(StatCollector.translateToLocal("tile.cloud.3.desc"), 3, "cloud/vertical"); + cloud.carverHelper.addVariation(StatCollector.translateToLocal("tile.cloud.4.desc"), 4, "cloud/grid"); + cloud.carverHelper.register(cloud, "cloud"); + OreDictionary.registerOre("cloud", cloud); + Carving.chisel.registerOre("cloud", "cloud"); + } + + if (Configurations.featureEnabled("factory")) { + factory = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Chisel.soundMetalFootstep); + factory.carverHelper.setChiselBlockName("factoryblock"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.0.desc"), 0, "factory/dots"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.1.desc"), 1, "factory/rust2"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.2.desc"), 2, "factory/rust"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.3.desc"), 3, "factory/platex"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.4.desc"), 4, "factory/wireframewhite"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.5.desc"), 5, "factory/wireframe"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.6.desc"), 6, "factory/hazard"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.7.desc"), 7, "factory/hazardorange"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.8.desc"), 8, "factory/circuit"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.9.desc"), 9, "factory/metalbox"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.10.desc"), 10, "factory/goldplate"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.11.desc"), 11, "factory/goldplating"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.12.desc"), 12, "factory/grinder"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.13.desc"), 13, "factory/plating"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.14.desc"), 14, "factory/rustplates"); + factory.carverHelper.addVariation(StatCollector.translateToLocal("tile.factory.15.desc"), 15, "factory/column"); + factory.carverHelper.register(factory, "factoryblock"); + Carving.chisel.registerOre("factoryblock", "factoryblock"); + } + + // 1.7! Let's go! Let's go-go! + + String[] sGNames = new String[] { "White", "Orange", "Magenta", "Light Blue", "Yellow", "Lime", "Pink", "Gray", "Light Gray", "Cyan", "Purple", "Blue", "Brown", "Green", "Red", "Black" }; + + if (Configurations.featureEnabled("glassStained")) + 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(sGNames[i] + " bubble glass", glassPrefix, texName + "bubble"); + stainedGlass[glassId].carverHelper.addVariation(sGNames[i] + " glass panel", glassPrefix + 1, texName + "panel"); + stainedGlass[glassId].carverHelper.addVariation(sGNames[i] + " fancy glass panel", glassPrefix + 2, texName + "panel-fancy"); + stainedGlass[glassId].carverHelper.addVariation(sGNames[i] + " borderless glass", glassPrefix + 3, texName + "transparent"); + OreDictionary.registerOre(oreName, new ItemStack(Blocks.stained_glass, 1, i)); + Carving.chisel.registerOre(blockName, oreName); + for (CarvableVariation cv : stainedGlass[glassId].carverHelper.variations) { + if (cv.metadata < glassPrefix || cv.metadata >= glassPrefix + 4) + continue; + stainedGlass[glassId].carverHelper.registerVariation(blockName, cv, stainedGlass[glassId], cv.metadata); + } + } + + if (Configurations.featureEnabled("glassStainedPane")) + 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(ModTabs.tabOtherChiselBlocks); + stainedGlassPane[glassId].carverHelper.registerBlock(stainedGlassPane[glassId], blockName); + stainedGlassPane[glassId].carverHelper.blockName = "Stained Glass Pane"; + } + stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " bubble glass", glassPrefix, texName + "bubble"); + stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " glass panel", glassPrefix + 1, texName + "panel"); + stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " fancy glass panel", glassPrefix + 2, texName + "panel-fancy"); + stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " borderless glass", glassPrefix + 3, texName + "transparent"); + stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " quadrant glass", glassPrefix + 4, texName + "quad"); + stainedGlassPane[glassId].carverHelper.addVariation(sGNames[i] + " fancy quadrant glass", glassPrefix + 5, texName + "quad-fancy"); + OreDictionary.registerOre(oreName, new ItemStack(Blocks.stained_glass_pane, 1, i)); + Carving.chisel.registerOre(blockName, oreName); + for (CarvableVariation cv : stainedGlassPane[glassId].carverHelper.variations) { + if (cv.metadata < glassPrefix || cv.metadata >= glassPrefix + 8) + continue; + stainedGlassPane[glassId].carverHelper.registerVariation(blockName, cv, stainedGlassPane[glassId], cv.metadata); + } + } + + if (Configurations.featureEnabled("paperWall")) { + paperWall = (BlockCarvablePane) new BlockCarvablePane(Material.ground, true).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.5F).setResistance(10F); + paperWall.carverHelper.setChiselBlockName("Paper Wall"); + paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.0.desc"), 0, "paper/box"); + paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.1.desc"), 1, "paper/throughMiddle"); + paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.2.desc"), 2, "paper/cross"); + paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.3.desc"), 3, "paper/sixSections"); + paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.4.desc"), 4, "paper/vertical"); + paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.5.desc"), 5, "paper/horizontal"); + paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.6.desc"), 6, "paper/floral"); + paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.7.desc"), 7, "paper/plain"); + paperWall.carverHelper.addVariation(StatCollector.translateToLocal("tile.paperwall.8.desc"), 8, "paper/door"); + + paperWall.carverHelper.register(paperWall, "paperwall"); + Carving.chisel.registerOre("paperwall", "paperwall"); + + } + + if (Configurations.featureEnabled("woolenClay")) { + woolenClay = (BlockCarvable) new BlockCarvable(Material.clay).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(2F).setResistance(10F); + woolenClay.carverHelper.setChiselBlockName("Woolen Clay"); + + for (int i = 0; i < 16; i++) + woolenClay.carverHelper.addVariation(StatCollector.translateToLocal("tile.woolenClay." + i + ".desc"), i, "woolenClay/" + sGNames[i].replaceAll(" ", "").toLowerCase()); + woolenClay.carverHelper.register(woolenClay, "woolen_clay"); + + Carving.chisel.registerOre("woolen_clay", "woolen_clay"); + } + if (Configurations.featureEnabled("coloredSand")) { + coloredSand = (BlockCarvableSand) new BlockCarvableSand().setCreativeTab(ModTabs.tabOtherChiselBlocks); + coloredSand.carverHelper.setChiselBlockName("Colored Sand"); + + for (int i = 0; i < 16; i++) + coloredSand.carverHelper.addVariation(StatCollector.translateToLocal("tile.coloredSand." + i + ".desc"), i, "coloredSand/" + sGNames[i].replaceAll(" ", "").toLowerCase()); + coloredSand.carverHelper.register(coloredSand, "colored_sand"); + + Carving.chisel.registerOre("colored_sand", "colored_sand"); + } + + if (Configurations.featureEnabled("laboratory")) { + laboratory = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F).setStepSound(Chisel.soundMetalFootstep); + laboratory.carverHelper.setChiselBlockName("laboratoryblock"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.0.desc"), 0, "laboratory/wallpanel"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.1.desc"), 1, "laboratory/dottedpanel"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.2.desc"), 2, "laboratory/largewall"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.3.desc"), 3, "laboratory/roundel"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.4.desc"), 4, "laboratory/wallvents"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.5.desc"), 5, "laboratory/largetile"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.6.desc"), 6, "laboratory/smalltile"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.7.desc"), 7, "laboratory/floortile"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.8.desc"), 8, "laboratory/checkertile"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.9.desc"), 9, "laboratory/clearscreen"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.10.desc"), 10, "laboratory/fuzzscreen"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.11.desc"), 11, "laboratory/largesteel"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.12.desc"), 12, "laboratory/smallsteel"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.13.desc"), 13, "laboratory/directionright"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.14.desc"), 14, "laboratory/directionleft"); + laboratory.carverHelper.addVariation(StatCollector.translateToLocal("tile.laboratory.15.desc"), 15, "laboratory/infocon"); + laboratory.carverHelper.register(laboratory, "laboratoryblock"); + Carving.chisel.registerOre("laboratoryblock", "laboratoryblock"); + } + + if (Configurations.featureEnabled("pumpkin")) { + for (int metadata = 0; metadata < 16; metadata++) { + pumpkin[metadata] = (BlockCarvablePumpkin) new BlockCarvablePumpkin(false).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(1.0F).setBlockName("pumpkin") + .setCreativeTab(ModTabs.tabOtherChiselBlocks); + pumpkin[metadata].setInformation("pumpkin/pumpkin_face_" + (metadata + 1) + "_off"); + GameRegistry.registerBlock(pumpkin[metadata], "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"); + } + + if (Configurations.featureEnabled("jackolantern")) { + for (int metadata = 0; metadata < 16; metadata++) { + jackolantern[metadata] = (BlockCarvablePumpkin) new BlockCarvablePumpkin(true).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(1.0F).setBlockName("litpumpkin") + .setCreativeTab(ModTabs.tabOtherChiselBlocks); + jackolantern[metadata].setInformation("pumpkin/pumpkin_face_" + (metadata + 1) + "_on"); + GameRegistry.registerBlock(jackolantern[metadata], ("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"); + } + + if (Configurations.featureEnabled("leaves")) { + leaf = (BlockLeaf) new BlockLeaf(Material.leaves).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(0.2F).setStepSound(Block.soundTypeGrass); + 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); + if (Configurations.fancy) { + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.6.desc"), 6, "leaves/dead"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.7.desc"), 7, "leaves/fancy"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.8.desc"), 8, "leaves/pinkpetal"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.9.desc"), 9, "leaves/red_roses"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.10.desc"), 10, "leaves/roses"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.11.desc"), 11, "leaves/christmasBalls"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.12.desc"), 12, "leaves/christmasLights"); + } else { + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.6.desc"), 6, "leaves/dead_opaque"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.7.desc"), 7, "leaves/fancy_opaque"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.8.desc"), 8, "leaves/pinkpetal_opaque"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.9.desc"), 9, "leaves/red_roses_opaque"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.10.desc"), 10, "leaves/roses_opaque"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.11.desc"), 11, "leaves/christmasBalls_opaque"); + leaf.carverHelper.addVariation(StatCollector.translateToLocal("tile.leaves.12.desc"), 12, "leaves/christmasLights_opaque"); + } + + leaf.carverHelper.register(leaf, "leaves"); + Carving.chisel.registerOre("leaves", "leaves"); + } + + if (areChestsReady) { + for (int x = 0; x < 16; x++) { + present[x] = (BlockPresent) new BlockPresent(x).setCreativeTab(ModTabs.tabOtherChiselBlocks).setHardness(2.0F).setResistance(10.0F).setBlockName("present"); + GameRegistry.registerBlock(present[x], "chest" + x); + Carving.chisel.addVariation("present", present[x], 0, (x + 1)); + } + Carving.chisel.registerOre("chest", "chest"); + } + + if (Configurations.featureEnabled("voidstone")) { + voidstone = (BlockCarvable) new BlockCarvable().setCreativeTab(ModTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabStoneChiselBlocks) + .setHardness(5.0F).setResistance(10.0F); + voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.0.desc"), 0, "voidstone/raw"); + voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.1.desc"), 1, "voidstone/quarters"); + voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.2.desc"), 2, "voidstone/smooth"); + voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.3.desc"), 3, "voidstone/skulls"); + voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.4.desc"), 4, "voidstone/rune"); + voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.5.desc"), 5, "voidstone/metalborder"); + voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.6.desc"), 6, "voidstone/eye"); + voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.7.desc"), 7, "voidstone/bevel"); + + voidstone.carverHelper.register(voidstone, "voidstone"); + Carving.chisel.registerOre("voidstone", "voidstone"); + + voidstone2 = (BlockMarbleTexturedOre) new BlockMarbleTexturedOre(Material.rock, Chisel.MOD_ID + ":voidstone/animated/void").setStepSound(Block.soundTypeStone) + .setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F); + voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.0.desc"), 0, "voidstone/animated/raw"); + voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.1.desc"), 1, "voidstone/animated/quarters"); + voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.2.desc"), 2, "voidstone/animated/smooth"); + voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.3.desc"), 3, "voidstone/animated/skulls"); + voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.4.desc"), 4, "voidstone/animated/rune"); + voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.5.desc"), 5, "voidstone/animated/metalborder"); + voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.6.desc"), 6, "voidstone/animated/eye"); + voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.7.desc"), 7, "voidstone/animated/bevel"); + + voidstone2.carverHelper.register(voidstone2, "voidstone2"); + Carving.chisel.registerOre("voidstone2", "voidstone2"); + } + + if (Configurations.featureEnabled("voidstonePillars")) { + voidstonePillar = (BlockVoidstonePillar) new BlockVoidstonePillar().setCreativeTab(ModTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone); + voidstonePillar.carvableHelper.addVariation(StatCollector.translateToLocal("tile.voidstonePillar.0.desc"), 0, "voidstone/pillar-side"); + voidstonePillar.carvableHelper.register(voidstonePillar, "voidstonePillar"); + Carving.chisel.registerOre("voidstonePillar", "voidstonePillar"); + + voidstonePillar2 = (BlockVoidstonePillar2) new BlockVoidstonePillar2().setStepSound(Block.soundTypeStone); + voidstonePillar2.carvableHelper.addVariation(StatCollector.translateToLocal("tile.voidstonePillar2.0.desc"), 0, "voidstone/pillar-side"); + voidstonePillar2.carvableHelper.register(voidstonePillar2, "voidstonePillar2"); + Carving.chisel.registerOre("voidstonePillar2", "voidstonePillar2"); + } + + if (Configurations.featureEnabled("waterstone")) { + waterstone = (BlockWaterstone) new BlockWaterstone(Material.rock, "water_flow").setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10.0F); + waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.0.desc"), 0, "waterstone/cobble"); + waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.1.desc"), 1, "waterstone/black"); + waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.2.desc"), 2, "waterstone/tiles"); + waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.3.desc"), 3, "waterstone/chaotic"); + waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.4.desc"), 4, "waterstone/creeper"); + waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.5.desc"), 5, "waterstone/panel"); + waterstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.waterstone.6.desc"), 6, "waterstone/panel-ornate"); + waterstone.carverHelper.register(waterstone, "waterstone"); + OreDictionary.registerOre("blockWaterstone", waterstone); + Carving.chisel.registerOre("waterstone", "blockWaterstone"); + } + + if (Configurations.featureEnabled("hexPlating")) { + hexPlating = (BlockCarvable) new BlockCarvable().setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10.0F); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.0.desc"), 0, "hexPlating/black"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.1.desc"), 1, "hexPlating/blue"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.2.desc"), 2, "hexPlating/brown"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.3.desc"), 3, "hexPlating/cyan"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.4.desc"), 4, "hexPlating/green"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.5.desc"), 5, "hexPlating/light_blue"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.6.desc"), 6, "hexPlating/light_gray"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.7.desc"), 7, "hexPlating/lime"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.8.desc"), 8, "hexPlating/magenta"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.9.desc"), 9, "hexPlating/orange"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.10.desc"), 10, "hexPlating/pink"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.11.desc"), 11, "hexPlating/purple"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.12.desc"), 12, "hexPlating/red"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.13.desc"), 13, "hexPlating/white"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.14.desc"), 14, "hexPlating/yellow"); + hexPlating.carverHelper.addVariation(StatCollector.translateToLocal("tile.hexPlating.15.desc"), 15, "hexPlating/gray"); + hexPlating.carverHelper.register(hexPlating, "hexPlating"); + Carving.chisel.registerOre("hexPlating", "hexPlating"); + } + + if (Configurations.featureEnabled("fantasy2")) { + fantasy2 = (BlockCarvable) new BlockCarvable().setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.0.desc"), 0, "fantasy2/brick"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.1.desc"), 1, "fantasy2/brick-faded"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.2.desc"), 2, "fantasy2/brick-wear"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.3.desc"), 3, "fantasy2/bricks"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.4.desc"), 4, "fantasy2/decor"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.5.desc"), 5, "fantasy2/decor-block"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.6.desc"), 6, "fantasy2/pillar"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.7.desc"), 7, "fantasy2/pillar-decorated"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.8.desc"), 8, "fantasy2/gold-decor-1"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.9.desc"), 9, "fantasy2/gold-decor-2"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.10.desc"), 10, "fantasy2/gold-decor-3"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.11.desc"), 11, "fantasy2/gold-decor-4"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.12.desc"), 12, "fantasy2/plate"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.13.desc"), 13, "fantasy2/block"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.14.desc"), 14, "fantasy2/bricks-chaotic"); + fantasy2.carverHelper.addVariation(StatCollector.translateToLocal("tile.fantasyblock2.15.desc"), 15, "fantasy2/bricks-wear"); + fantasy2.carverHelper.register(fantasy2, "fantasyblock2"); + OreDictionary.registerOre("fantasy2", fantasy2); + Carving.chisel.registerOre("fantasyblock2", "fantasy2"); + } + + if (Configurations.featureEnabled("grimstone")) { + grimstone = (BlockGrimstone) new BlockGrimstone(Material.rock).setCreativeTab(ModTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10F); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.0.desc"), 0, "grimstone/grimstone"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.1.desc"), 1, "grimstone/smooth"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.2.desc"), 2, "grimstone/hate"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.3.desc"), 3, "grimstone/chiseled"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.4.desc"), 4, "grimstone/blocks"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.5.desc"), 5, "grimstone/blocks-rough"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.6.desc"), 6, "grimstone/brick"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.7.desc"), 7, "grimstone/largebricks"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.8.desc"), 8, "grimstone/platform"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.9.desc"), 9, "grimstone/platform-tiles"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.10.desc"), 10, "grimstone/construction"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.11.desc"), 11, "grimstone/fancy-tiles"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.12.desc"), 12, "grimstone/plate"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.13.desc"), 13, "grimstone/plate-rough"); + grimstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.grimstone.14.desc"), 14, "grimstone/flaky"); + grimstone.carverHelper.register(grimstone, "grimstone"); + Carving.chisel.registerOre("grimstone", "grimstone"); + } + + if (Configurations.featureEnabled("technical")) { + technical = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.0.desc"), 0, "technical/scaffold"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.1.desc"), 1, "technical/cautiontape"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.2.desc"), 2, "technical/industrialrelic"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.3.desc"), 3, "technical/pipesLarge"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.4.desc"), 4, "technical/fanFast"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.5.desc"), 5, "technical/pipesSmall"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.6.desc"), 6, "technical/fanStill"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.7.desc"), 7, "technical/vent"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.8.desc"), 8, "technical/ventGlowing"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.9.desc"), 9, "technical/insulationv2"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.10.desc"), 10, "technical/spinningStuffAnim"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.11.desc"), 11, "technical/cables"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.12.desc"), 12, "technical/rustyBoltedPlates"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.13.desc"), 13, "technical/grate"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.14.desc"), 14, "technical/fanMalfunction"); + technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.15.desc"), 15, "technical/grateRusty"); + technical.carverHelper.register(technical, "technical"); + Carving.chisel.registerOre("technical", "technical"); + + technical2 = (BlockCarvableGlass) new BlockCarvableGlass().setHardness(2.0F).setResistance(10F); + technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.0.desc"), 0, "technical/scaffoldTransparent"); + technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.4.desc"), 1, "technical/fanFastTransparent"); + technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.6.desc"), 2, "technical/fanStillTransparent"); + technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.14.desc"), 3, "technical/fanStillTransparent"); + technical2.carverHelper.register(technical2, "technical2"); + Carving.chisel.registerOre("technical2", "technical2"); + } + + // Once screen overlay is done, remove WIP texs + + if (Configurations.featureEnabled("futura")) { + futura = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); + futura.carverHelper.addVariation(StatCollector.translateToLocal("tile.futura.0.desc"), 0, "futura/screenMetallicWIP"); + futura.carverHelper.addVariation(StatCollector.translateToLocal("tile.futura.1.desc"), 1, "futura/screenCyanWIP"); + futura.carverHelper.addVariation(StatCollector.translateToLocal("tile.futura.2.desc"), 2, "futura/controllerWIP"); + futura.carverHelper.register(futura, "futura"); + Carving.chisel.registerOre("futura", "futura"); + } + + if (Configurations.featureEnabled("brickCustom")) { + brickCustom = (BlockCarvable) new BlockCarvable(Material.rock).setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabStoneChiselBlocks); + Carving.chisel.addVariation("brickCustom", Blocks.brick_block, 0, 0); + brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.1.desc"), 1, "brickCustom/large"); + brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.2.desc"), 2, "brickCustom/mortarless"); + brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.3.desc"), 3, "brickCustom/varied"); + // brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.4.desc"), + // 4, "brickCustom/cracked"); + brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.5.desc"), 5, "brickCustom/aged"); + // brickCustom.carverHelper.addVariation(StatCollector.translateToLocal("tile.brickCustom.6.desc"), + // 6, "brickCustom/mossy"); + brickCustom.carverHelper.register(brickCustom, "brickCustom"); + Carving.chisel.registerOre("brickCustom", "brickCustom"); + } + + if (Configurations.featureEnabled("quartz")) { + 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"); + } + + // 1.8 + if (Configurations.featureEnabled("granite")) { + granite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ModTabs.tabStoneChiselBlocks); + granite.carverHelper.setChiselBlockName("granite"); + granite.carverHelper.addVariation(StatCollector.translateToLocal("tile.granite.0.desc"), 0, "granite/granite"); + granite.carverHelper.addVariation(StatCollector.translateToLocal("tile.granite.1.desc"), 1, "granite/polishedGranite"); + granite.carverHelper.register(granite, "granite"); + Carving.chisel.registerOre("granite", "granite"); + } + + if (Configurations.featureEnabled("diorite")) { + diorite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ModTabs.tabStoneChiselBlocks); + diorite.carverHelper.setChiselBlockName("diorite"); + diorite.carverHelper.addVariation(StatCollector.translateToLocal("tile.diorite.0.desc"), 0, "diorite/diorite"); + diorite.carverHelper.addVariation(StatCollector.translateToLocal("tile.diorite.1.desc"), 1, "diorite/polishedDiorite"); + diorite.carverHelper.register(diorite, "diorite"); + Carving.chisel.registerOre("diorite", "diorite"); + } + + if (Configurations.featureEnabled("andesite")) { + andesite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ModTabs.tabStoneChiselBlocks); + andesite.carverHelper.setChiselBlockName("andesite"); + andesite.carverHelper.addVariation(StatCollector.translateToLocal("tile.andesite.0.desc"), 0, "andesite/andesite"); + andesite.carverHelper.addVariation(StatCollector.translateToLocal("tile.andesite.1.desc"), 1, "andesite/polishedAndesite"); + andesite.carverHelper.register(andesite, "andesite"); + Carving.chisel.registerOre("andesite", "andesite"); + } + } + + public static void postLoad() { + + // Thaumcraft + if (Configurations.featureEnabled("arcane") && Loader.isModLoaded("Thaumcraft")) { + arcane = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("arcane", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 6, 0); + Carving.chisel.addVariation("arcane", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 7, 1); + arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.0.desc"), 0, "arcane/moonEngrave"); + arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.1.desc"), 1, "arcane/moonGlowAnim"); + arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.2.desc"), 2, "arcane/arcaneTile"); + arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.3.desc"), 3, "arcane/arcaneRunes"); + arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.4.desc"), 4, "arcane/arcaneRunesGlow"); + arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.5.desc"), 5, "arcane/bigBrick"); + arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.6.desc"), 6, "arcane/conduitGlowAnim"); + arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.7.desc"), 7, "arcane/BorderBrain"); + arcane.carverHelper.register(arcane, "arcane"); + Carving.chisel.registerOre("arcane", "arcane"); + } + + // Blood Magic + if (Configurations.featureEnabled("bloodRune") && Loader.isModLoaded("AWWayOfTime")) { + bloodRune = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ModTabs.tabModdedChiselBlocks).setStepSound(Block.soundTypeStone); + Carving.chisel.addVariation("bloodRune", GameRegistry.findBlock("AWWayOfTime", "bloodRune.blank"), 0, 0); + bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.0.desc"), 0, "bloodMagic/bloodRuneArranged"); + bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.1.desc"), 1, "bloodMagic/bloodRuneBricks"); + bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.2.desc"), 2, "bloodMagic/bloodRuneCarved"); + bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.3.desc"), 3, "bloodMagic/bloodRuneCarvedRadial"); + bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.4.desc"), 4, "bloodMagic/bloodRuneClassicPanel"); + bloodRune.carverHelper.addVariation(StatCollector.translateToLocal("tile.bloodRune.5.desc"), 5, "bloodMagic/bloodRuneTiles"); + bloodRune.carverHelper.register(bloodRune, "bloodRune"); + Carving.chisel.registerOre("bloodRune", "bloodRune"); + } + + // Twilight Forest + + if (Configurations.featureEnabled("TFMazestone") && Loader.isModLoaded("TwilightForest")) { + 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"); + } + + if (Configurations.featureEnabled("TFTowerStone") && Loader.isModLoaded("TwilightForest")) { + 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"); + } + + if (Configurations.featureEnabled("TFUnderBrick") && Loader.isModLoaded("TwilightForest")) { + 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"); + } + + // Applied Energistics + + if (Configurations.featureEnabled("AECertusQuartz") && Loader.isModLoaded("appliedenergistics2")) { + 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"); + } + + if (Configurations.featureEnabled("AESkyStone") && Loader.isModLoaded("appliedenergistics2")) { + 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"); + } + + // Railcraft + if (Configurations.featureEnabled("RCInfernalStone") && Loader.isModLoaded("Railcraft")) { + Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 0, 0); + Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 1, 1); + Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 2, 2); + Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 3, 3); + Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 4, 4); + Carving.chisel.addVariation("RCInfernalStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.infernal"), 5, 5); + Carving.chisel.registerOre("RCInfernalStone", "RCInfernalStone"); + } + + if (Configurations.featureEnabled("RCSandyStone") && Loader.isModLoaded("Railcraft")) { + Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 0, 0); + Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 1, 1); + Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 2, 2); + Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 3, 3); + Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 4, 4); + Carving.chisel.addVariation("RCSandyStone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.sandy"), 5, 5); + Carving.chisel.registerOre("RCSandyStone", "RCSandyStone"); + } + + if (Configurations.featureEnabled("RCFrostBoundBlock") && Loader.isModLoaded("Railcraft")) { + Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 0, 0); + Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 1, 1); + Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 2, 2); + Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 3, 3); + Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 4, 4); + Carving.chisel.addVariation("RCFrostBoundBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.frostbound"), 5, 5); + Carving.chisel.registerOre("RCFrostBoundBlock", "RCFrostBoundBlock"); + } + + if (Configurations.featureEnabled("RCQuarriedBlock") && Loader.isModLoaded("Railcraft")) { + Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 0, 0); + Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 1, 1); + Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 2, 2); + Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 3, 3); + Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 4, 4); + Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 5, 5); + Carving.chisel.registerOre("RCQuarriedBlock", "RCQuarriedBlock"); + } + + if (Configurations.featureEnabled("RCBleachedBone") && Loader.isModLoaded("Railcraft")) { + Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 0, 0); + Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 1, 1); + Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 2, 2); + Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 3, 3); + Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 4, 4); + Carving.chisel.addVariation("RCBleachedBone", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bleachedbone"), 5, 5); + Carving.chisel.registerOre("RCBleachedBone", "RCBleachedBone"); + } + + if (Configurations.featureEnabled("RCBloodStained") && Loader.isModLoaded("Railcraft")) { + Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 0, 0); + Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 1, 1); + Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 2, 2); + Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 3, 3); + Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 4, 4); + Carving.chisel.addVariation("RCBloodStained", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.bloodstained"), 5, 5); + Carving.chisel.registerOre("RCBloodStained", "RCBloodStained"); + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/init/ModItems.java b/src/main/java/com/cricketcraft/chisel/init/ModItems.java index 3280f72e..039059ec 100644 --- a/src/main/java/com/cricketcraft/chisel/init/ModItems.java +++ b/src/main/java/com/cricketcraft/chisel/init/ModItems.java @@ -5,42 +5,48 @@ import com.cricketcraft.chisel.Configurations; import com.cricketcraft.chisel.entity.EntityBallOMoss; import com.cricketcraft.chisel.entity.EntityCloudInABottle; import com.cricketcraft.chisel.entity.EntitySmashingRock; -import com.cricketcraft.chisel.item.*; +import com.cricketcraft.chisel.item.ItemBallOMoss; +import com.cricketcraft.chisel.item.ItemChisel; +import com.cricketcraft.chisel.item.ItemCloudInABottle; +import com.cricketcraft.chisel.item.ItemSmashingRock; +import com.cricketcraft.chisel.item.ItemUpgrade; + import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; public class ModItems { - public static ItemChisel chisel; - public static ItemCloudInABottle itemCloudInABottle; - public static ItemBallOMoss itemBallOMoss; - public static ItemSmashingRock smashingRock; - public static ItemUpgrade upgrade; - public static void load() { - chisel = (ItemChisel) new ItemChisel().setCreativeTab(ModTabs.tabChisel); - GameRegistry.registerItem(chisel, "chisel"); + public static ItemChisel chisel; + public static ItemCloudInABottle itemCloudInABottle; + public static ItemBallOMoss itemBallOMoss; + public static ItemSmashingRock smashingRock; + public static ItemUpgrade upgrade; - if (Configurations.featureEnabled("cloud")) { - itemCloudInABottle = (ItemCloudInABottle) new ItemCloudInABottle().setTextureName("Chisel:cloudinabottle-x").setCreativeTab(ModTabs.tabChisel); - EntityRegistry.registerModEntity(EntityCloudInABottle.class, "CloudInABottle", 1, Chisel.instance, 40, 1, true); - GameRegistry.registerItem(itemCloudInABottle, "cloudinabottle"); - } + public static void load() { + chisel = (ItemChisel) new ItemChisel().setCreativeTab(ModTabs.tabChisel); + GameRegistry.registerItem(chisel, "chisel"); - if (Configurations.featureEnabled("ballOfMoss")) { - itemBallOMoss = (ItemBallOMoss) new ItemBallOMoss().setTextureName("Chisel:ballomoss").setCreativeTab(ModTabs.tabChisel); - EntityRegistry.registerModEntity(EntityBallOMoss.class, "BallOMoss", 2, Chisel.instance, 40, 1, true); - GameRegistry.registerItem(itemBallOMoss, "ballomoss"); - } + if (Configurations.featureEnabled("cloud")) { + itemCloudInABottle = (ItemCloudInABottle) new ItemCloudInABottle().setTextureName("Chisel:cloudinabottle-x").setCreativeTab(ModTabs.tabChisel); + EntityRegistry.registerModEntity(EntityCloudInABottle.class, "CloudInABottle", 1, Chisel.instance, 40, 1, true); + GameRegistry.registerItem(itemCloudInABottle, "cloudinabottle"); + } - if (Configurations.featureEnabled("smashingRock")) { - smashingRock = (ItemSmashingRock) new ItemSmashingRock().setTextureName("Chisel:smashingrock").setCreativeTab(ModTabs.tabChisel); - EntityRegistry.registerModEntity(EntitySmashingRock.class, "SmashingRock", 2, Chisel.instance, 40, 1, true); - GameRegistry.registerItem(smashingRock, "smashingrock"); - } + if (Configurations.featureEnabled("ballOfMoss")) { + itemBallOMoss = (ItemBallOMoss) new ItemBallOMoss().setTextureName("Chisel:ballomoss").setCreativeTab(ModTabs.tabChisel); + EntityRegistry.registerModEntity(EntityBallOMoss.class, "BallOMoss", 2, Chisel.instance, 40, 1, true); + GameRegistry.registerItem(itemBallOMoss, "ballomoss"); + } - if(Configurations.featureEnabled("autoChiselUpgrades")){ - upgrade = (ItemUpgrade) new ItemUpgrade("upgrade").setCreativeTab(ModTabs.tabChisel); - GameRegistry.registerItem(upgrade, upgrade.getUnlocalizedName()); - } - } + if (Configurations.featureEnabled("smashingRock")) { + smashingRock = (ItemSmashingRock) new ItemSmashingRock().setTextureName("Chisel:smashingrock").setCreativeTab(ModTabs.tabChisel); + EntityRegistry.registerModEntity(EntitySmashingRock.class, "SmashingRock", 2, Chisel.instance, 40, 1, true); + GameRegistry.registerItem(smashingRock, "smashingrock"); + } + + if (Configurations.featureEnabled("autoChiselUpgrades")) { + upgrade = (ItemUpgrade) new ItemUpgrade("upgrade").setCreativeTab(ModTabs.tabChisel); + GameRegistry.registerItem(upgrade, upgrade.getUnlocalizedName()); + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/init/ModTabs.java b/src/main/java/com/cricketcraft/chisel/init/ModTabs.java index 6e7bfa1c..62381adb 100644 --- a/src/main/java/com/cricketcraft/chisel/init/ModTabs.java +++ b/src/main/java/com/cricketcraft/chisel/init/ModTabs.java @@ -1,73 +1,76 @@ package com.cricketcraft.chisel.init; -import com.cricketcraft.chisel.Chisel; -import cpw.mods.fml.common.Loader; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; +import com.cricketcraft.chisel.Chisel; + +import cpw.mods.fml.common.Loader; + public class ModTabs { - private static boolean atLeastOneModIsLoaded = false; + private static boolean atLeastOneModIsLoaded = false; - public static CreativeTabs tabChisel; - public static CreativeTabs tabStoneChiselBlocks, tabWoodChiselBlocks,tabMetalChiselBlocks, tabOtherChiselBlocks, tabModdedChiselBlocks; + public static CreativeTabs tabChisel; + public static CreativeTabs tabStoneChiselBlocks, tabWoodChiselBlocks, tabMetalChiselBlocks, tabOtherChiselBlocks, tabModdedChiselBlocks; - public static void load(){ + public static void load() { - tabChisel = new CreativeTabs("tabChisel") - { - @Override - public Item getTabIconItem() { - return ModItems.chisel; - } - }; + tabChisel = new CreativeTabs("tabChisel") { - for(String s : Chisel.modsSupported){ - if(Loader.isModLoaded(s)){ - atLeastOneModIsLoaded = true; - } - } + @Override + public Item getTabIconItem() { + return ModItems.chisel; + } + }; - if(atLeastOneModIsLoaded){ - tabModdedChiselBlocks = new CreativeTabs("tabModdedChiselBlocks") { - @Override - public Item getTabIconItem() { - return Item.getItemFromBlock(ModBlocks.arcane); - } - }; - } + for (String s : Chisel.modsSupported) { + if (Loader.isModLoaded(s)) { + atLeastOneModIsLoaded = true; + } + } - tabStoneChiselBlocks = new CreativeTabs("tabStoneChiselBlocks") { - @Override - public Item getTabIconItem() - { - return Item.getItemFromBlock(ModBlocks.holystone); - } - }; + if (atLeastOneModIsLoaded) { + tabModdedChiselBlocks = new CreativeTabs("tabModdedChiselBlocks") { - tabWoodChiselBlocks = new CreativeTabs("tabWoodChiselBlocks") { - @Override - public Item getTabIconItem() - { - return Item.getItemFromBlock(Blocks.bookshelf); - } - }; + @Override + public Item getTabIconItem() { + return Item.getItemFromBlock(ModBlocks.arcane); + } + }; + } - tabMetalChiselBlocks = new CreativeTabs("tabMetalChiselBlocks") { - @Override - public Item getTabIconItem() - { - return Item.getItemFromBlock(ModBlocks.technical); - } - }; + tabStoneChiselBlocks = new CreativeTabs("tabStoneChiselBlocks") { - tabOtherChiselBlocks = new CreativeTabs("tabOtherChiselBlocks") { - @Override - public Item getTabIconItem() - { - return Item.getItemFromBlock(ModBlocks.jackolantern[0]); - } - }; - } + @Override + public Item getTabIconItem() { + return Item.getItemFromBlock(ModBlocks.holystone); + } + }; + + tabWoodChiselBlocks = new CreativeTabs("tabWoodChiselBlocks") { + + @Override + public Item getTabIconItem() { + return Item.getItemFromBlock(Blocks.bookshelf); + } + }; + + tabMetalChiselBlocks = new CreativeTabs("tabMetalChiselBlocks") { + + @Override + public Item getTabIconItem() { + return Item.getItemFromBlock(ModBlocks.technical); + } + }; + + tabOtherChiselBlocks = new CreativeTabs("tabOtherChiselBlocks") { + + @Override + public Item getTabIconItem() { + return Item.getItemFromBlock(ModBlocks.jackolantern[0]); + } + }; + } } diff --git a/src/main/java/com/cricketcraft/chisel/inventory/ContainerAutoChisel.java b/src/main/java/com/cricketcraft/chisel/inventory/ContainerAutoChisel.java index 04e957b6..fb23f808 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/ContainerAutoChisel.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/ContainerAutoChisel.java @@ -1,92 +1,92 @@ package com.cricketcraft.chisel.inventory; -import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel; 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.ItemStack; +import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel; + public class ContainerAutoChisel extends Container { - public static TileEntityAutoChisel autoChisel; - public static EntityPlayer player; + public static TileEntityAutoChisel autoChisel; + public static EntityPlayer player; - public ContainerAutoChisel(InventoryPlayer player, TileEntityAutoChisel tileEntityAutoChisel) { + public ContainerAutoChisel(InventoryPlayer player, TileEntityAutoChisel tileEntityAutoChisel) { - this.player = player.player; - autoChisel = tileEntityAutoChisel; + ContainerAutoChisel.player = player.player; + autoChisel = tileEntityAutoChisel; - addSlotToContainer(new Slot(tileEntityAutoChisel, 0, 53, 15)); - addSlotToContainer(new Slot(tileEntityAutoChisel, 1, 78, 51)); - addSlotToContainer(new Slot(tileEntityAutoChisel, 2, 103, 15)); - addSlotToContainer(new Slot(tileEntityAutoChisel, 3, 151, 51)); - addSlotToContainer(new Slot(tileEntityAutoChisel, 4, 151, 31)); - addSlotToContainer(new Slot(tileEntityAutoChisel, 5, 151, 11)); + addSlotToContainer(new Slot(tileEntityAutoChisel, 0, 53, 15)); + addSlotToContainer(new Slot(tileEntityAutoChisel, 1, 78, 51)); + addSlotToContainer(new Slot(tileEntityAutoChisel, 2, 103, 15)); + addSlotToContainer(new Slot(tileEntityAutoChisel, 3, 151, 51)); + addSlotToContainer(new Slot(tileEntityAutoChisel, 4, 151, 31)); + addSlotToContainer(new Slot(tileEntityAutoChisel, 5, 151, 11)); + bindPlayerInventory(player); + } - bindPlayerInventory(player); - } + 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 (slotNumber == 2) { + if (!this.mergeItemStack(itemStack1, 3, 39, true)) { + return null; + } - if (slotNumber == 2) { - if (!this.mergeItemStack(itemStack1, 3, 39, true)) { - return null; - } + slot.onSlotChange(itemStack1, itemStack); + } else if (slotNumber != 1 && slotNumber != 0) { + if (!this.mergeItemStack(itemStack1, 0, 1, true)) { + return null; + } else if (slotNumber >= 3 && slotNumber < 30) { + if (this.mergeItemStack(itemStack1, 30, 39, false)) { + return null; + } + } else if (slotNumber >= 30 && slotNumber < 39 && !this.mergeItemStack(itemStack1, 3, 30, false)) { + return null; + } + } else if (this.mergeItemStack(itemStack1, 3, 39, false)) { + return null; + } - slot.onSlotChange(itemStack1, itemStack); - } else if (slotNumber != 1 && slotNumber != 0) { - if (!this.mergeItemStack(itemStack1, 0, 1, true)) { - return null; - } else if (slotNumber >= 3 && slotNumber < 30) { - if (this.mergeItemStack(itemStack1, 30, 39, false)) { - return null; - } - } else if (slotNumber >= 30 && slotNumber < 39 && !this.mergeItemStack(itemStack1, 3, 30, false)) { - return null; - } - } else if (this.mergeItemStack(itemStack1, 3, 39, 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; + } } diff --git a/src/main/java/com/cricketcraft/chisel/inventory/ContainerChisel.java b/src/main/java/com/cricketcraft/chisel/inventory/ContainerChisel.java index e3a272ba..9dc41c2b 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/ContainerChisel.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/ContainerChisel.java @@ -12,118 +12,102 @@ import com.cricketcraft.chisel.carving.Carving; import com.cricketcraft.chisel.item.ItemChisel; import com.cricketcraft.chisel.utils.General; -public class ContainerChisel extends Container -{ - public final InventoryChiselSelection inventory; - public InventoryPlayer playerInventory; - int currentIndex; - public ItemStack chisel; - public boolean finished; - public Carving carving; +public class ContainerChisel extends Container { - public ContainerChisel(InventoryPlayer inventoryplayer, InventoryChiselSelection inv) - { - inventory = inv; - playerInventory = inventoryplayer; - currentIndex = playerInventory.currentItem; - inv.container = this; + public final InventoryChiselSelection inventory; + public InventoryPlayer playerInventory; + int currentIndex; + public ItemStack chisel; + public boolean finished; + public Carving carving; - int[] leftOffsets = {8, 26, 134, 152, 44, 116}; - int[] topOffsets = {8, 26, 44, 62}; + public ContainerChisel(InventoryPlayer inventoryplayer, InventoryChiselSelection inv) { + inventory = inv; + playerInventory = inventoryplayer; + currentIndex = playerInventory.currentItem; + inv.container = this; - for(int i = 0; i < 2; i++) - { - for(int y = 0; y < 4; y++) - { - for(int x = 0; x < 2; x++) - { - addSlotToContainer(new SlotChiselSelection(this, inventory, inventory, x + i * 8 + y * 2, leftOffsets[x + i * 2], topOffsets[y])); - } - } - } + int[] leftOffsets = { 8, 26, 134, 152, 44, 116 }; + int[] topOffsets = { 8, 26, 44, 62 }; - for(int y = 0; y < 4; y++) - { - for(int x = 0; x < 2; x++) - { - addSlotToContainer(new SlotChiselSelection(this, inventory, inventory, 16 + x + y * 2, leftOffsets[4 + x], topOffsets[3 - y])); - } - } + for (int i = 0; i < 2; i++) { + for (int y = 0; y < 4; y++) { + for (int x = 0; x < 2; x++) { + addSlotToContainer(new SlotChiselSelection(this, inventory, inventory, x + i * 8 + y * 2, leftOffsets[x + i * 2], topOffsets[y])); + } + } + } - addSlotToContainer(new SlotChiselInput(this, inventory, InventoryChiselSelection.normalSlots, 80, 35)); + for (int y = 0; y < 4; y++) { + for (int x = 0; x < 2; x++) { + addSlotToContainer(new SlotChiselSelection(this, inventory, inventory, 16 + x + y * 2, leftOffsets[4 + x], topOffsets[3 - y])); + } + } - for(int k = 0; k < 3; k++) - { - for(int j1 = 0; j1 < 9; j1++) - { - addSlotToContainer(new Slot(inventoryplayer, j1 + k * 9 + 9, 8 + j1 * 18, 102 + k * 18 - 18)); - } - } + addSlotToContainer(new SlotChiselInput(this, inventory, InventoryChiselSelection.normalSlots, 80, 35)); - for(int l = 0; l < 9; l++) - { - addSlotToContainer(l == currentIndex ? - new SlotChiselPlayer(this, inventoryplayer, l, 8 + l * 18, 160 - 18) : - new Slot(inventoryplayer, l, 8 + l * 18, 160 - 18) - ); - } + for (int k = 0; k < 3; k++) { + for (int j1 = 0; j1 < 9; j1++) { + addSlotToContainer(new Slot(inventoryplayer, j1 + k * 9 + 9, 8 + j1 * 18, 102 + k * 18 - 18)); + } + } - chisel = inventoryplayer.getCurrentItem(); - if(chisel.stackTagCompound != null) - { - ItemStack stack = ItemStack.loadItemStackFromNBT(chisel.stackTagCompound.getCompoundTag("chiselTarget")); - inventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, stack); - } + for (int l = 0; l < 9; l++) { + addSlotToContainer(l == currentIndex ? new SlotChiselPlayer(this, inventoryplayer, l, 8 + l * 18, 160 - 18) : new Slot(inventoryplayer, l, 8 + l * 18, 160 - 18)); + } - Item item = General.getItem(chisel); - carving = item instanceof ItemChisel ? ((ItemChisel) item).carving : Carving.chisel; + chisel = inventoryplayer.getCurrentItem(); + if (chisel.stackTagCompound != null) { + ItemStack stack = ItemStack.loadItemStackFromNBT(chisel.stackTagCompound.getCompoundTag("chiselTarget")); + inventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, stack); + } - inventory.updateItems(); - } + Item item = General.getItem(chisel); + carving = item instanceof ItemChisel ? ItemChisel.carving : Carving.chisel; - @Override - public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) - { - if(par3 == 2 && par2 == currentIndex) - return null; + inventory.updateItems(); + } - return super.slotClick(par1, par2, par3, par4EntityPlayer); - } + @Override + public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) { + if (par3 == 2 && par2 == currentIndex) + return null; - @Override - public void onContainerClosed(EntityPlayer entityplayer) - { - inventory.clearItems(); - super.onContainerClosed(entityplayer); - } + return super.slotClick(par1, par2, par3, par4EntityPlayer); + } - @Override - public boolean canInteractWith(EntityPlayer entityplayer) - { - return inventory.isUseableByPlayer(entityplayer); - } + @Override + public void onContainerClosed(EntityPlayer entityplayer) { + inventory.clearItems(); + super.onContainerClosed(entityplayer); + } - @Override - public ItemStack transferStackInSlot(EntityPlayer entity, int i) - { - return null; - } + @Override + public boolean canInteractWith(EntityPlayer entityplayer) { + return inventory.isUseableByPlayer(entityplayer); + } - public void onChiselSlotChanged() - { - ItemStack stack = playerInventory.mainInventory[currentIndex]; - if(!stack.isItemEqual(chisel)) finished = true; + @Override + public ItemStack transferStackInSlot(EntityPlayer entity, int i) { + return null; + } - if(finished) return; + public void onChiselSlotChanged() { + ItemStack stack = playerInventory.mainInventory[currentIndex]; + if (!stack.isItemEqual(chisel)) + finished = true; - if(chisel.stackTagCompound == null) - chisel.stackTagCompound = new NBTTagCompound(); + if (finished) + return; - NBTTagCompound tag = new NBTTagCompound(); - if(inventory.getStackInSpecialSlot() != null) - inventory.getStackInSpecialSlot().writeToNBT(tag); + if (chisel.stackTagCompound == null) + chisel.stackTagCompound = new NBTTagCompound(); - chisel.stackTagCompound.setTag("chiselTarget", tag); - playerInventory.mainInventory[currentIndex] = chisel; - } + NBTTagCompound tag = new NBTTagCompound(); + if (inventory.getStackInSpecialSlot() != null) + inventory.getStackInSpecialSlot().writeToNBT(tag); + + chisel.stackTagCompound.setTag("chiselTarget", tag); + playerInventory.mainInventory[currentIndex] = chisel; + } } diff --git a/src/main/java/com/cricketcraft/chisel/inventory/ContainerPresent.java b/src/main/java/com/cricketcraft/chisel/inventory/ContainerPresent.java index 1d7e01f1..113aa14d 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/ContainerPresent.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/ContainerPresent.java @@ -5,34 +5,35 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; public class ContainerPresent extends ContainerChest { - private IInventory lower; - private int rows; - public ContainerPresent(IInventory player, IInventory chest) { - super(player, chest); - lower = chest; - rows = chest.getSizeInventory() / 9; - chest.openInventory(); - int a = (rows - 4) * 18; + private IInventory lower; + private int rows; - 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) { + super(player, 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)); + } + } + + public IInventory getLowerPresentInventory() { + return lower; + } } diff --git a/src/main/java/com/cricketcraft/chisel/inventory/InventoryChiselSelection.java b/src/main/java/com/cricketcraft/chisel/inventory/InventoryChiselSelection.java index 1494c397..e5cbfca7 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/InventoryChiselSelection.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/InventoryChiselSelection.java @@ -10,178 +10,155 @@ import net.minecraft.item.ItemStack; import com.cricketcraft.chisel.item.ItemChisel; -public class InventoryChiselSelection implements IInventory -{ - ItemStack chisel = null; - public final static int normalSlots = 32; - public int activeVariations = 0; - ContainerChisel container; - ItemStack[] inventory; +public class InventoryChiselSelection implements IInventory { - public InventoryChiselSelection(ItemStack c) - { - super(); + ItemStack chisel = null; + public final static int normalSlots = 32; + public int activeVariations = 0; + ContainerChisel container; + ItemStack[] inventory; - inventory = new ItemStack[normalSlots + 1]; - chisel = c; - } + public InventoryChiselSelection(ItemStack c) { + super(); - public void onInventoryUpdate(int slot) - { + inventory = new ItemStack[normalSlots + 1]; + chisel = c; + } - } + public void onInventoryUpdate(int slot) { - @Override - public int getSizeInventory() - { - return normalSlots + 1; - } + } - @Override - public ItemStack getStackInSlot(int var1) - { - return inventory[var1]; - } + @Override + public int getSizeInventory() { + return normalSlots + 1; + } - public void updateInventoryState(int slot) - { - onInventoryUpdate(slot); - } + @Override + public ItemStack getStackInSlot(int var1) { + return inventory[var1]; + } - @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); + public void updateInventoryState(int slot) { + onInventoryUpdate(slot); + } - if(this.inventory[slot].stackSize == 0) - this.inventory[slot] = null; + @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); - updateInventoryState(slot); + if (this.inventory[slot].stackSize == 0) + this.inventory[slot] = null; - return stack; - } - } else return null; - } + updateInventoryState(slot); - @Override - public String getInventoryName() - { - return "container.chisel"; - } + return stack; + } + } else + return null; + } - @Override - public boolean hasCustomInventoryName() - { - return false; - } + @Override + public String getInventoryName() { + return "container.chisel"; + } - @Override - public int getInventoryStackLimit() - { - return 64; - } + @Override + public boolean hasCustomInventoryName() { + return false; + } - @Override - public void markDirty() - { + @Override + public int getInventoryStackLimit() { + return 64; + } - } + @Override + public void markDirty() { - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) - { - return true; - } + } - public void clearItems() - { - activeVariations = 0; - for(int i = 0; i < normalSlots; i++) - { - inventory[i] = null; - } - } + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return true; + } - public ItemStack getStackInSpecialSlot() - { - return inventory[normalSlots]; - } + public void clearItems() { + activeVariations = 0; + for (int i = 0; i < normalSlots; i++) { + inventory[i] = null; + } + } - public void updateItems() - { - ItemStack chiseledItem = inventory[normalSlots]; + public ItemStack getStackInSpecialSlot() { + return inventory[normalSlots]; + } - clearItems(); + public void updateItems() { + ItemStack chiseledItem = inventory[normalSlots]; - if(chiseledItem == null) - { - container.onChiselSlotChanged(); - return; - } + clearItems(); - Item item = chiseledItem.getItem(); - if(item == null) return; + if (chiseledItem == null) { + container.onChiselSlotChanged(); + return; + } - if(Block.getBlockFromItem(item) == null) - return; + Item item = chiseledItem.getItem(); + if (item == null) + return; - ArrayList list = container.carving.getItems(chiseledItem); + if (Block.getBlockFromItem(item) == null) + return; - activeVariations = 0; - while(activeVariations < normalSlots && activeVariations < list.size()) - { - inventory[activeVariations] = list.get(activeVariations); - activeVariations++; - } + ArrayList list = container.carving.getItems(chiseledItem); - container.onChiselSlotChanged(); - } + activeVariations = 0; + while (activeVariations < normalSlots && activeVariations < list.size()) { + inventory[activeVariations] = list.get(activeVariations); + activeVariations++; + } - @Override - public ItemStack getStackInSlotOnClosing(int slot) - { - ItemStack stack = getStackInSlot(slot); + container.onChiselSlotChanged(); + } - if(stack == null) - return null; - inventory[slot] = null; + @Override + public ItemStack getStackInSlotOnClosing(int slot) { + ItemStack stack = getStackInSlot(slot); - updateInventoryState(slot); - return stack; - } + if (stack == null) + return null; + inventory[slot] = null; - @Override - public void setInventorySlotContents(int slot, ItemStack stack) - { - inventory[slot] = stack; - updateInventoryState(slot); - } + updateInventoryState(slot); + return stack; + } - @Override - public void openInventory() - { - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + inventory[slot] = stack; + updateInventoryState(slot); + } - @Override - public void closeInventory() - { - } + @Override + public void openInventory() { + } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack) - { - return !(stack != null && (stack.getItem() instanceof ItemChisel)) && i == normalSlots; - } + @Override + public void closeInventory() { + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack stack) { + return !(stack != null && (stack.getItem() instanceof ItemChisel)) && i == normalSlots; + } } diff --git a/src/main/java/com/cricketcraft/chisel/inventory/InventoryLargePresent.java b/src/main/java/com/cricketcraft/chisel/inventory/InventoryLargePresent.java index 9c7adf4e..b8c85c79 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/InventoryLargePresent.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/InventoryLargePresent.java @@ -5,98 +5,99 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; public class InventoryLargePresent implements IInventory { - private String name; - private IInventory upper, lower; - public InventoryLargePresent(String name, IInventory upper, IInventory lower) { - this.name = name; + private String name; + private IInventory upper, lower; - if (upper == null) { - upper = lower; - } + public InventoryLargePresent(String name, IInventory upper, IInventory lower) { + this.name = name; - if (lower == null) { - lower = upper; - } + if (upper == null) { + upper = lower; + } - this.upper = upper; - this.lower = lower; - } + if (lower == null) { + lower = upper; + } - @Override - public int getSizeInventory() { - return upper.getSizeInventory() + lower.getSizeInventory(); - } + this.upper = upper; + this.lower = lower; + } - public boolean isPartOfLargePresent(IInventory inventory) { - return upper == inventory || lower == inventory; - } + @Override + public int getSizeInventory() { + return upper.getSizeInventory() + lower.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int slot) { - return slot >= upper.getSizeInventory() ? lower.getStackInSlot(slot - upper.getSizeInventory()) : upper.getStackInSlot(slot); - } + public boolean isPartOfLargePresent(IInventory inventory) { + return upper == inventory || lower == inventory; + } - @Override - public ItemStack decrStackSize(int slot, int size) { - return slot >= upper.getSizeInventory() ? lower.getStackInSlot(slot - upper.getSizeInventory()) : upper.getStackInSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) { + return slot >= upper.getSizeInventory() ? lower.getStackInSlot(slot - upper.getSizeInventory()) : upper.getStackInSlot(slot); + } - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - return slot >= upper.getSizeInventory() ? lower.getStackInSlotOnClosing(slot - upper.getSizeInventory()) : upper.getStackInSlotOnClosing(slot); - } + @Override + public ItemStack decrStackSize(int slot, int size) { + return slot >= upper.getSizeInventory() ? lower.getStackInSlot(slot - upper.getSizeInventory()) : upper.getStackInSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - if (slot >= upper.getSizeInventory()) { - lower.setInventorySlotContents(slot - upper.getSizeInventory(), stack); - } else { - upper.setInventorySlotContents(slot, stack); - } - } + @Override + public ItemStack getStackInSlotOnClosing(int slot) { + return slot >= upper.getSizeInventory() ? lower.getStackInSlotOnClosing(slot - upper.getSizeInventory()) : upper.getStackInSlotOnClosing(slot); + } - @Override - public String getInventoryName() { - return upper.hasCustomInventoryName() ? upper.getInventoryName() : (lower.hasCustomInventoryName() ? lower.getInventoryName() : name); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + if (slot >= upper.getSizeInventory()) { + lower.setInventorySlotContents(slot - upper.getSizeInventory(), stack); + } else { + upper.setInventorySlotContents(slot, stack); + } + } - @Override - public boolean hasCustomInventoryName() { - return upper.hasCustomInventoryName() || lower.hasCustomInventoryName(); - } + @Override + public String getInventoryName() { + return upper.hasCustomInventoryName() ? upper.getInventoryName() : (lower.hasCustomInventoryName() ? lower.getInventoryName() : name); + } - @Override - public int getInventoryStackLimit() { - return upper.getInventoryStackLimit(); - } + @Override + public boolean hasCustomInventoryName() { + return upper.hasCustomInventoryName() || lower.hasCustomInventoryName(); + } - @Override - public void markDirty() { - upper.markDirty(); - lower.markDirty(); - } + @Override + public int getInventoryStackLimit() { + return upper.getInventoryStackLimit(); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return upper.isUseableByPlayer(player) && lower.isUseableByPlayer(player); - } + @Override + public void markDirty() { + upper.markDirty(); + lower.markDirty(); + } - @Override - public void openInventory() { - upper.openInventory(); - lower.openInventory(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + return upper.isUseableByPlayer(player) && lower.isUseableByPlayer(player); + } - @Override - public void closeInventory() { - upper.closeInventory(); - ; - lower.closeInventory(); - } + @Override + public void openInventory() { + upper.openInventory(); + lower.openInventory(); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return true; - } + @Override + public void closeInventory() { + upper.closeInventory(); + ; + lower.closeInventory(); + } + + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) { + return true; + } } diff --git a/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselInput.java b/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselInput.java index 759fb0ce..77e3ad4e 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselInput.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselInput.java @@ -4,39 +4,37 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; 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 class SlotChiselInput extends Slot { - @Override - public boolean isItemValid(ItemStack itemstack) - { - if(container.finished) return false; + public SlotChiselInput(ContainerChisel container, InventoryChiselSelection inv, int i, int j, int k) { + super(inv, i, j, k); + selInventory = inv; + this.container = container; + } - return super.isItemValid(itemstack); - } + @Override + public boolean isItemValid(ItemStack itemstack) { + if (container.finished) + return false; - @Override - public boolean canTakeStack(EntityPlayer par1EntityPlayer) - { - return !container.finished && super.canTakeStack(par1EntityPlayer); + return super.isItemValid(itemstack); + } - } + @Override + public boolean canTakeStack(EntityPlayer par1EntityPlayer) { + return !container.finished && super.canTakeStack(par1EntityPlayer); - @Override - public void onSlotChanged() - { - if(container.finished) return; + } - super.onSlotChanged(); - selInventory.updateItems(); - } + @Override + public void onSlotChanged() { + if (container.finished) + return; - ContainerChisel container; - InventoryChiselSelection selInventory; + super.onSlotChanged(); + selInventory.updateItems(); + } + + ContainerChisel container; + InventoryChiselSelection selInventory; } diff --git a/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselPlayer.java b/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselPlayer.java index 6b4d7896..ae416653 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselPlayer.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselPlayer.java @@ -5,42 +5,35 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +public class SlotChiselPlayer extends Slot { -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/com/cricketcraft/chisel/inventory/SlotChiselSelection.java b/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselSelection.java index a9775794..a6e02c8d 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselSelection.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselSelection.java @@ -7,81 +7,85 @@ import net.minecraft.item.ItemStack; import com.cricketcraft.chisel.utils.General; -public class SlotChiselSelection extends Slot -{ - public SlotChiselSelection(ContainerChisel container, InventoryChiselSelection inv, IInventory iinventory, int i, int j, int k) - { - super(iinventory, i, j, k); +public class SlotChiselSelection extends Slot { - this.container = container; - selInventory = inv; - } + public SlotChiselSelection(ContainerChisel container, InventoryChiselSelection inv, IInventory iinventory, int i, int j, int k) { + super(iinventory, i, j, k); - @Override - public boolean isItemValid(ItemStack itemstack) - { - return false; - } + this.container = container; + selInventory = inv; + } - @Override - public boolean canTakeStack(EntityPlayer par1EntityPlayer) - { - if(container.finished) return false; + @Override + public boolean isItemValid(ItemStack itemstack) { + return false; + } - return par1EntityPlayer.inventory.getItemStack() == null; - } + @Override + public boolean canTakeStack(EntityPlayer par1EntityPlayer) { + if (container.finished) + return false; - @Override - public void onPickupFromSlot(EntityPlayer player, ItemStack itemstack) - { - ItemStack stack = player.inventory.getItemStack(); - ItemStack crafted = selInventory.inventory[InventoryChiselSelection.normalSlots]; + return par1EntityPlayer.inventory.getItemStack() == null; + } - if(stack == null) - { - if(crafted != null && crafted.stackSize > 0) crafted.stackSize--; - if(crafted.stackSize == 0) crafted = null; + @Override + public void onPickupFromSlot(EntityPlayer player, ItemStack itemstack) { + ItemStack stack = player.inventory.getItemStack(); + ItemStack crafted = selInventory.inventory[InventoryChiselSelection.normalSlots]; - selInventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, crafted); - } else - { - putStack(new ItemStack(itemstack.getItem(), itemstack.stackSize, itemstack.getItemDamage())); + if (stack == null) { + if (crafted != null && crafted.stackSize > 0) + crafted.stackSize--; + if (crafted.stackSize == 0) + crafted = null; - player.inventory.setItemStack(null); + selInventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, crafted); + } else { + putStack(new ItemStack(itemstack.getItem(), itemstack.stackSize, itemstack.getItemDamage())); - if(selInventory.inventory[InventoryChiselSelection.normalSlots] == null) return; + player.inventory.setItemStack(null); - player.inventory.setItemStack(new ItemStack(itemstack.getItem(), selInventory.inventory[InventoryChiselSelection.normalSlots].stackSize, itemstack.getItemDamage())); - selInventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, null); - } + if (selInventory.inventory[InventoryChiselSelection.normalSlots] == null) + return; - - selInventory.updateItems(); - - String sound = container.carving.getVariationSound(itemstack.getItem(), itemstack.getItemDamage()); - player.worldObj.playSoundAtEntity(player, sound, 0.3f + 0.7f * General.rand.nextFloat(), 0.6f + 0.4f * General.rand.nextFloat()); - - -/* ItemStack stack=player.inventory.getItemStack(); - - putStack(new ItemStack(itemstack.itemID, itemstack.stackSize, itemstack.getItemDamage())); - - super.onPickupFromSlot(player,itemstack); - - player.inventory.setItemStack(null); - - if(selInventory.items[InventoryChiselSelection.normalSlots]==null) return; - - player.inventory.setItemStack(new ItemStack(itemstack.itemID, selInventory.items[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(); - String sound=Carving.chisel.getVariationSound(itemstack.itemID, itemstack.getItemDamage()); + String sound = container.carving.getVariationSound(itemstack.getItem(), itemstack.getItemDamage()); player.worldObj.playSoundAtEntity(player, sound, 0.3f + 0.7f * General.rand.nextFloat(), 0.6f + 0.4f * General.rand.nextFloat()); -*/ - } - ContainerChisel container; - InventoryChiselSelection selInventory; + /* + * ItemStack stack=player.inventory.getItemStack(); + * + * putStack(new ItemStack(itemstack.itemID, itemstack.stackSize, + * itemstack.getItemDamage())); + * + * super.onPickupFromSlot(player,itemstack); + * + * player.inventory.setItemStack(null); + * + * if(selInventory.items[InventoryChiselSelection.normalSlots]==null) + * return; + * + * player.inventory.setItemStack(new ItemStack(itemstack.itemID, + * selInventory.items[InventoryChiselSelection.normalSlots].stackSize, + * itemstack.getItemDamage())); + * selInventory.setInventorySlotContents(InventoryChiselSelection + * .normalSlots,null); + * + * selInventory.updateItems(); + * + * String sound=Carving.chisel.getVariationSound(itemstack.itemID, + * itemstack.getItemDamage()); player.worldObj.playSoundAtEntity(player, + * sound, 0.3f + 0.7f * General.rand.nextFloat(), 0.6f + 0.4f * + * General.rand.nextFloat()); + */ + } + + ContainerChisel container; + InventoryChiselSelection selInventory; } diff --git a/src/main/java/com/cricketcraft/chisel/item/BaseItem.java b/src/main/java/com/cricketcraft/chisel/item/BaseItem.java index 1b1248f5..7471af9d 100644 --- a/src/main/java/com/cricketcraft/chisel/item/BaseItem.java +++ b/src/main/java/com/cricketcraft/chisel/item/BaseItem.java @@ -10,77 +10,71 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; public class BaseItem extends Item { - @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 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 }; + @Override + public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { + getWrappedDesc(list, itemStack); + } - // return text if less than length - if (input.length() <= len) - return new String[] { input }; + 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()); + } - char[] chars = input.toCharArray(); - Vector lines = new Vector(); - StringBuffer line = new StringBuffer(); - StringBuffer word = new StringBuffer(); + public static String[] wrap(String input, int len) { + // return empty array for null text + if (input == null) + return new String[] {}; - for (char c : chars) - { - word.append(c); + // return text if len is zero or less + if (len <= 0) + return new String[] { input }; - if (c == ' ') - { - if ((line.length() + word.length()) > len) - { - lines.add(line.toString()); - line.delete(0, line.length()); - } + // return text if less than length + if (input.length() <= len) + return new String[] { input }; - line.append(word); - word.delete(0, word.length()); - } - } + char[] chars = input.toCharArray(); + Vector lines = new Vector(); + StringBuffer line = new StringBuffer(); + StringBuffer word = new StringBuffer(); - // handle any extra chars in current word - if (word.length() > 0) - { - if ((line.length() + word.length()) > len) - { + for (char c : chars) { + word.append(c); + + 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()); } - - // 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] = (String) e.nextElement(); - } - - return ret; } + + // 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()); + } + + String[] ret = new String[lines.size()]; + int c = 0; // counter + for (Enumeration e = lines.elements(); e.hasMoreElements(); c++) { + ret[c] = (String) e.nextElement(); + } + + return ret; + } } diff --git a/src/main/java/com/cricketcraft/chisel/item/ItemBallOMoss.java b/src/main/java/com/cricketcraft/chisel/item/ItemBallOMoss.java index 75c07b96..0446e3be 100644 --- a/src/main/java/com/cricketcraft/chisel/item/ItemBallOMoss.java +++ b/src/main/java/com/cricketcraft/chisel/item/ItemBallOMoss.java @@ -6,31 +6,26 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.entity.EntityBallOMoss; -public class ItemBallOMoss extends BaseItem -{ +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/com/cricketcraft/chisel/item/ItemCarvable.java b/src/main/java/com/cricketcraft/chisel/item/ItemCarvable.java index 3a79cb55..9359063a 100644 --- a/src/main/java/com/cricketcraft/chisel/item/ItemCarvable.java +++ b/src/main/java/com/cricketcraft/chisel/item/ItemCarvable.java @@ -14,45 +14,43 @@ import com.cricketcraft.chisel.api.ICarvable; import com.cricketcraft.chisel.carving.CarvableVariation; import com.cricketcraft.chisel.utils.General; -public class ItemCarvable extends ItemBlock -{ +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); + } - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) - { - if(!Configurations.blockDescriptions) return; + @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; - CarvableVariation var = carvable.getVariation(stack.getItemDamage()); - if(var == null) - return; + ICarvable carvable = (ICarvable) block; + CarvableVariation var = carvable.getVariation(stack.getItemDamage()); + if (var == null) + return; - lines.add(var.description); - } + lines.add(var.description); + } } diff --git a/src/main/java/com/cricketcraft/chisel/item/ItemChisel.java b/src/main/java/com/cricketcraft/chisel/item/ItemChisel.java index 8aa5bbc5..4d5f96f1 100644 --- a/src/main/java/com/cricketcraft/chisel/item/ItemChisel.java +++ b/src/main/java/com/cricketcraft/chisel/item/ItemChisel.java @@ -193,7 +193,7 @@ public class ItemChisel extends Item implements IChiselMode { y = buf.readInt(); z = buf.readInt(); block = buf.readInt(); - meta = (byte) buf.readByte(); + meta = buf.readByte(); } } diff --git a/src/main/java/com/cricketcraft/chisel/item/ItemCloudInABottle.java b/src/main/java/com/cricketcraft/chisel/item/ItemCloudInABottle.java index 76f13860..729a5406 100644 --- a/src/main/java/com/cricketcraft/chisel/item/ItemCloudInABottle.java +++ b/src/main/java/com/cricketcraft/chisel/item/ItemCloudInABottle.java @@ -6,30 +6,26 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.entity.EntityCloudInABottle; -public class ItemCloudInABottle extends BaseItem -{ +public class ItemCloudInABottle extends BaseItem { - public ItemCloudInABottle() - { - super(); - setUnlocalizedName("cloudBottle"); - } - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) - { - if(!par3EntityPlayer.capabilities.isCreativeMode) - { - --par1ItemStack.stackSize; - } + public ItemCloudInABottle() { + super(); + setUnlocalizedName("cloudBottle"); + } - if(par2World.isRemote) - par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + if (!par3EntityPlayer.capabilities.isCreativeMode) { + --par1ItemStack.stackSize; + } - if(!par2World.isRemote) - { - par2World.spawnEntityInWorld(new EntityCloudInABottle(par2World, par3EntityPlayer)); - } + if (par2World.isRemote) + par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); - return par1ItemStack; - } + if (!par2World.isRemote) { + par2World.spawnEntityInWorld(new EntityCloudInABottle(par2World, par3EntityPlayer)); + } + + return par1ItemStack; + } } diff --git a/src/main/java/com/cricketcraft/chisel/item/ItemMarbleSlab.java b/src/main/java/com/cricketcraft/chisel/item/ItemMarbleSlab.java index a30374ae..a09b23de 100644 --- a/src/main/java/com/cricketcraft/chisel/item/ItemMarbleSlab.java +++ b/src/main/java/com/cricketcraft/chisel/item/ItemMarbleSlab.java @@ -8,113 +8,101 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.block.BlockMarbleSlab; -public class ItemMarbleSlab extends ItemCarvable -{ +public class ItemMarbleSlab extends ItemCarvable { - public ItemMarbleSlab(Block block) - { - super(block); - } + public ItemMarbleSlab(Block block) { + super(block); + } - @Override - public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) - { - BlockMarbleSlab block = (BlockMarbleSlab) Block.getBlockFromItem(this); + @Override + public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) { + BlockMarbleSlab block = (BlockMarbleSlab) Block.getBlockFromItem(this); - switch(side) - { - 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 (side) { + case 0: + --y; + break; + case 1: + ++y; + break; + case 2: + --z; + break; + case 3: + ++z; + break; + case 4: + --x; + break; + case 5: + ++x; + break; + } - Block targetBlock = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); + Block targetBlock = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); - return (targetBlock.equals(block) || targetBlock.equals(block.top)) && meta == stack.getItemDamage() || world.canPlaceEntityOnSide(block, x, y, z, false, side, (Entity) null, stack); + return (targetBlock.equals(block) || targetBlock.equals(block.top)) && meta == stack.getItemDamage() || world.canPlaceEntityOnSide(block, x, y, z, false, side, (Entity) null, stack); - } + } + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hx, float hy, float hz) { + BlockMarbleSlab block = (BlockMarbleSlab) Block.getBlockFromItem(this); - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hx, float hy, float hz) - { - BlockMarbleSlab block = (BlockMarbleSlab) Block.getBlockFromItem(this); + Block targetBlock = world.getBlock(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + boolean metaMatches = meta == stack.getItemDamage(); - Block targetBlock = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - boolean metaMatches = meta == stack.getItemDamage(); + if (metaMatches && side == 0 && targetBlock.equals(block.top)) { + world.setBlock(x, y, z, block.master, meta, 2); + stack.stackSize -= 1; + return true; + } else if (metaMatches && side == 1 && targetBlock.equals(block.bottom)) { + world.setBlock(x, y, z, block.master, meta, 2); + stack.stackSize -= 1; + return true; + } - if(metaMatches && side == 0 && targetBlock.equals(block.top)) - { - world.setBlock(x, y, z, block.master, meta, 2); - stack.stackSize -= 1; - return true; - } else if(metaMatches && side == 1 && targetBlock.equals(block.bottom)) - { - world.setBlock(x, y, z, block.master, meta, 2); - stack.stackSize -= 1; - return true; - } + boolean result = super.onItemUse(stack, player, world, x, y, z, side, hz, hy, hz); - boolean result = super.onItemUse(stack, player, world, x, y, z, side, hz, hy, hz); + switch (side) { + case 0: + --y; + break; + case 1: + ++y; + break; + case 2: + --z; + break; + case 3: + ++z; + break; + case 4: + --x; + break; + case 5: + ++x; + break; + } + targetBlock = world.getBlock(x, y, z); + meta = world.getBlockMetadata(x, y, z); - switch(side) - { - case 0: - --y; - break; - case 1: - ++y; - break; - case 2: - --z; - break; - case 3: - ++z; - break; - case 4: - --x; - break; - case 5: - ++x; - break; - } + if (!result && (targetBlock.equals(block.top) || targetBlock.equals(block.bottom)) && meta == stack.getItemDamage()) { + world.setBlock(x, y, z, block.master, meta, 2); + return true; + } - targetBlock = world.getBlock(x, y, z); - meta = world.getBlockMetadata(x, y, z); + if (!result) + return false; - if(!result && (targetBlock.equals(block.top) || targetBlock.equals(block.bottom)) && meta == stack.getItemDamage()) - { - world.setBlock(x, y, z, block.master, meta, 2); - return true; - } + if (side != 0 && (side == 1 || hy <= 0.5D)) + return true; - if(!result) - return false; - - if(side != 0 && (side == 1 || hy <= 0.5D)) - return true; - - - //TODO allow top slabs - //world.setBlock(x, y, z, block.top, meta, 2); - return true; - } + // TODO allow top slabs + // world.setBlock(x, y, z, block.top, meta, 2); + return true; + } } diff --git a/src/main/java/com/cricketcraft/chisel/item/ItemSmashingRock.java b/src/main/java/com/cricketcraft/chisel/item/ItemSmashingRock.java index 7a496d39..1f75cdfd 100644 --- a/src/main/java/com/cricketcraft/chisel/item/ItemSmashingRock.java +++ b/src/main/java/com/cricketcraft/chisel/item/ItemSmashingRock.java @@ -6,32 +6,26 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.entity.EntitySmashingRock; -public class ItemSmashingRock extends BaseItem -{ +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/com/cricketcraft/chisel/item/ItemUpgrade.java b/src/main/java/com/cricketcraft/chisel/item/ItemUpgrade.java index ea5b0b51..a018d504 100644 --- a/src/main/java/com/cricketcraft/chisel/item/ItemUpgrade.java +++ b/src/main/java/com/cricketcraft/chisel/item/ItemUpgrade.java @@ -14,59 +14,60 @@ import net.minecraft.world.World; import com.cricketcraft.chisel.Chisel; import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel; -public class ItemUpgrade extends BaseItem{ +public class ItemUpgrade extends BaseItem { - public IIcon[] icons = new IIcon[3]; + public IIcon[] icons = new IIcon[3]; - public ItemUpgrade(String unlocalizedName) { - super(); - this.setUnlocalizedName(unlocalizedName); - this.setCreativeTab(CreativeTabs.tabMaterials); - } + public ItemUpgrade(String unlocalizedName) { + super(); + this.setUnlocalizedName(unlocalizedName); + this.setCreativeTab(CreativeTabs.tabMaterials); + } - @Override - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int size, float hitX, float hitY, float hitZ){ - if(world.isRemote) return false; - TileEntity tile = world.getTileEntity(x, y, z); - if(tile != null && tile instanceof TileEntityAutoChisel){ - } - return true; - } + @Override + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int size, float hitX, float hitY, float hitZ) { + if (world.isRemote) + return false; + TileEntity tile = world.getTileEntity(x, y, z); + if (tile != null && tile instanceof TileEntityAutoChisel) { + } + return true; + } - @Override - public IIcon getIconFromDamage(int meta) { - if (meta > 3) - meta = 0; + @Override + public IIcon getIconFromDamage(int meta) { + if (meta > 3) + meta = 0; - return this.icons[meta]; - } + return this.icons[meta]; + } - @Override - public void registerIcons(IIconRegister reg) { - for (int i = 0; i < 3; i ++) { - this.icons[i] = reg.registerIcon(Chisel.MOD_ID + ":upgradeItem_" + i); - } - } + @Override + public void registerIcons(IIconRegister reg) { + for (int i = 0; i < 3; i++) { + this.icons[i] = reg.registerIcon(Chisel.MOD_ID + ":upgradeItem_" + i); + } + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - for (int i = 0; i < 3; 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 < 3; i++) { + list.add(new ItemStack(item, 1, i)); + } + } - @Override - public String getUnlocalizedName(ItemStack stack) { - switch (stack.getItemDamage()) { - case 0: - return this.getUnlocalizedName() + "_speed"; - case 1: - return this.getUnlocalizedName() + "_automation"; - case 2: - return this.getUnlocalizedName() + "_stack"; - default: - return this.getUnlocalizedName(); - } - } + @Override + public String getUnlocalizedName(ItemStack stack) { + switch (stack.getItemDamage()) { + case 0: + return this.getUnlocalizedName() + "_speed"; + case 1: + return this.getUnlocalizedName() + "_automation"; + case 2: + return this.getUnlocalizedName() + "_stack"; + default: + return this.getUnlocalizedName(); + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/proxy/ClientProxy.java b/src/main/java/com/cricketcraft/chisel/proxy/ClientProxy.java index 003178f5..3b2057cb 100644 --- a/src/main/java/com/cricketcraft/chisel/proxy/ClientProxy.java +++ b/src/main/java/com/cricketcraft/chisel/proxy/ClientProxy.java @@ -1,8 +1,21 @@ package com.cricketcraft.chisel.proxy; +import net.minecraft.client.renderer.entity.RenderSnowball; +import net.minecraft.item.Item; +import net.minecraftforge.client.MinecraftForgeClient; + import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel; import com.cricketcraft.chisel.block.tileentity.TileEntityPresent; -import com.cricketcraft.chisel.client.render.*; +import com.cricketcraft.chisel.client.render.BlockAdvancedMarbleRenderer; +import com.cricketcraft.chisel.client.render.BlockCarpetRenderer; +import com.cricketcraft.chisel.client.render.BlockEldritchRenderer; +import com.cricketcraft.chisel.client.render.BlockMarblePaneRenderer; +import com.cricketcraft.chisel.client.render.BlockMarblePillarRenderer; +import com.cricketcraft.chisel.client.render.BlockMarbleStairsRenderer; +import com.cricketcraft.chisel.client.render.BlockNoCTMRenderer; +import com.cricketcraft.chisel.client.render.BlockRoadLineRenderer; +import com.cricketcraft.chisel.client.render.BlockSnakeStoneRenderer; +import com.cricketcraft.chisel.client.render.BlockTexturedOreRenderer; import com.cricketcraft.chisel.client.render.item.ItemAutoChiselRenderer; import com.cricketcraft.chisel.client.render.item.ItemChiselRenderer; import com.cricketcraft.chisel.client.render.item.ItemPresentRenderer; @@ -13,48 +26,44 @@ import com.cricketcraft.chisel.entity.EntityCloudInABottle; import com.cricketcraft.chisel.entity.EntitySmashingRock; import com.cricketcraft.chisel.init.ModBlocks; import com.cricketcraft.chisel.init.ModItems; + import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; -import net.minecraft.client.renderer.entity.RenderSnowball; -import net.minecraft.item.Item; -import net.minecraftforge.client.MinecraftForgeClient; -public class ClientProxy extends CommonProxy -{ - ItemChiselRenderer renderer = new ItemChiselRenderer(); +public class ClientProxy extends CommonProxy { - @Override - public void preInit() - { - } + ItemChiselRenderer renderer = new ItemChiselRenderer(); - @Override - public void init() - { - RenderingRegistry.registerBlockHandler(new BlockMarbleStairsRenderer()); - RenderingRegistry.registerBlockHandler(new BlockMarblePaneRenderer()); - RenderingRegistry.registerBlockHandler(new BlockRoadLineRenderer()); - RenderingRegistry.registerBlockHandler(new BlockSnakeStoneRenderer()); - RenderingRegistry.registerBlockHandler(new BlockNoCTMRenderer()); - RenderingRegistry.registerBlockHandler(new BlockMarblePillarRenderer()); - RenderingRegistry.registerBlockHandler(new BlockEldritchRenderer()); - RenderingRegistry.registerBlockHandler(new BlockAdvancedMarbleRenderer()); - RenderingRegistry.registerBlockHandler(new BlockCarpetRenderer()); + @Override + public void preInit() { + } - RenderingRegistry.registerBlockHandler(new BlockTexturedOreRenderer()); + @Override + public void init() { + RenderingRegistry.registerBlockHandler(new BlockMarbleStairsRenderer()); + RenderingRegistry.registerBlockHandler(new BlockMarblePaneRenderer()); + RenderingRegistry.registerBlockHandler(new BlockRoadLineRenderer()); + RenderingRegistry.registerBlockHandler(new BlockSnakeStoneRenderer()); + RenderingRegistry.registerBlockHandler(new BlockNoCTMRenderer()); + RenderingRegistry.registerBlockHandler(new BlockMarblePillarRenderer()); + RenderingRegistry.registerBlockHandler(new BlockEldritchRenderer()); + RenderingRegistry.registerBlockHandler(new BlockAdvancedMarbleRenderer()); + RenderingRegistry.registerBlockHandler(new BlockCarpetRenderer()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAutoChisel.class, new RenderAutoChisel()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPresent.class, new RenderPresent()); + RenderingRegistry.registerBlockHandler(new BlockTexturedOreRenderer()); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.autoChisel), new ItemAutoChiselRenderer()); - for(int x = 0; x < 16; x++){ - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.present[x]), new ItemPresentRenderer(x)); - } + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAutoChisel.class, new RenderAutoChisel()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPresent.class, new RenderPresent()); - RenderingRegistry.registerEntityRenderingHandler(EntityCloudInABottle.class, new RenderSnowball(ModItems.itemCloudInABottle)); - RenderingRegistry.registerEntityRenderingHandler(EntityBallOMoss.class, new RenderSnowball(ModItems.itemBallOMoss)); - RenderingRegistry.registerEntityRenderingHandler(EntitySmashingRock.class, new RenderSnowball(ModItems.smashingRock)); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.autoChisel), new ItemAutoChiselRenderer()); + for (int x = 0; x < 16; x++) { + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.present[x]), new ItemPresentRenderer(x)); + } - MinecraftForgeClient.registerItemRenderer(ModItems.chisel, renderer); - } + RenderingRegistry.registerEntityRenderingHandler(EntityCloudInABottle.class, new RenderSnowball(ModItems.itemCloudInABottle)); + RenderingRegistry.registerEntityRenderingHandler(EntityBallOMoss.class, new RenderSnowball(ModItems.itemBallOMoss)); + RenderingRegistry.registerEntityRenderingHandler(EntitySmashingRock.class, new RenderSnowball(ModItems.smashingRock)); + + MinecraftForgeClient.registerItemRenderer(ModItems.chisel, renderer); + } } diff --git a/src/main/java/com/cricketcraft/chisel/proxy/CommonProxy.java b/src/main/java/com/cricketcraft/chisel/proxy/CommonProxy.java index e0585faf..86af073b 100644 --- a/src/main/java/com/cricketcraft/chisel/proxy/CommonProxy.java +++ b/src/main/java/com/cricketcraft/chisel/proxy/CommonProxy.java @@ -5,18 +5,16 @@ import com.cricketcraft.chisel.block.tileentity.TileEntityPresent; import cpw.mods.fml.common.registry.GameRegistry; -public class CommonProxy -{ +public class CommonProxy { + public void registerTileEntities() { - GameRegistry.registerTileEntity(TileEntityAutoChisel.class, "autoChisel"); - GameRegistry.registerTileEntity(TileEntityPresent.class, "tile.present.present"); - } + GameRegistry.registerTileEntity(TileEntityAutoChisel.class, "autoChisel"); + GameRegistry.registerTileEntity(TileEntityPresent.class, "tile.present.present"); + } - public void preInit() - { - } + public void preInit() { + } - public void init() - { - } + public void init() { + } } diff --git a/src/main/java/com/cricketcraft/chisel/utils/BlockTexturedOre.java b/src/main/java/com/cricketcraft/chisel/utils/BlockTexturedOre.java index e6c705d1..9e501e5e 100644 --- a/src/main/java/com/cricketcraft/chisel/utils/BlockTexturedOre.java +++ b/src/main/java/com/cricketcraft/chisel/utils/BlockTexturedOre.java @@ -5,58 +5,51 @@ import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; -public class BlockTexturedOre extends Block -{ - int currentPass; - Block base; - IIcon icon; - String iconFile; +public class BlockTexturedOre extends Block { - public BlockTexturedOre(Material mat, Block base) - { - super(mat); + int currentPass; + Block base; + IIcon icon; + String iconFile; - this.base = base; - } + public BlockTexturedOre(Material mat, Block base) { + super(mat); - public BlockTexturedOre(Material mat, String iconFile) - { - super(mat); + this.base = base; + } - this.iconFile = iconFile; - } + public BlockTexturedOre(Material mat, String iconFile) { + super(mat); - @Override - public boolean renderAsNormalBlock() - { - return false; - } + this.iconFile = iconFile; + } - @Override - public int getRenderType() - { - return BlockTexturedOreRenderer.id; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - public int getRenderBlockPass() - { - return 1; - } + @Override + public int getRenderType() { + return BlockTexturedOreRenderer.id; + } - @Override - public boolean canRenderInPass(int pass) - { - currentPass = pass; + @Override + public int getRenderBlockPass() { + return 1; + } - return pass == 1 || pass == 0; - } + @Override + public boolean canRenderInPass(int pass) { + currentPass = pass; - @Override - public void registerBlockIcons(IIconRegister register) - { - if(iconFile != null) - icon = register.registerIcon(iconFile); - } + return pass == 1 || pass == 0; + } + + @Override + public void registerBlockIcons(IIconRegister register) { + if (iconFile != null) + icon = register.registerIcon(iconFile); + } } diff --git a/src/main/java/com/cricketcraft/chisel/utils/BlockTexturedOreRenderer.java b/src/main/java/com/cricketcraft/chisel/utils/BlockTexturedOreRenderer.java index ad609c35..36c1e3c9 100644 --- a/src/main/java/com/cricketcraft/chisel/utils/BlockTexturedOreRenderer.java +++ b/src/main/java/com/cricketcraft/chisel/utils/BlockTexturedOreRenderer.java @@ -10,78 +10,67 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; -public class BlockTexturedOreRenderer implements ISimpleBlockRenderingHandler -{ - float bot = -0.001f, top = 1.0f - bot; - static int id; +public class BlockTexturedOreRenderer implements ISimpleBlockRenderingHandler { - public BlockTexturedOreRenderer() - { - id = RenderingRegistry.getNextAvailableRenderId(); - } + float bot = -0.001f, top = 1.0f - bot; + static int id; - @Override - public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) - { - if(blck == null || !(blck instanceof BlockTexturedOre)) - return; + public BlockTexturedOreRenderer() { + id = RenderingRegistry.getNextAvailableRenderId(); + } - BlockTexturedOre block = (BlockTexturedOre) blck; + @Override + public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) { + if (blck == null || !(blck instanceof BlockTexturedOre)) + return; - 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); - } + BlockTexturedOre block = (BlockTexturedOre) blck; - GL11.glEnable(3042); - GL11.glBlendFunc(770, 771); - renderer.setRenderBounds(bot, bot, bot, top, top, top); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - Drawing.drawBlock(block, meta, renderer); - GL11.glDisable(3042); - } + 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); + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) - { - if(blck == null || !(blck instanceof BlockTexturedOre)) - return false; - BlockTexturedOre block = (BlockTexturedOre) blck; + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + renderer.setRenderBounds(bot, bot, bot, top, top, top); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + Drawing.drawBlock(block, meta, renderer); + GL11.glDisable(3042); + } - if(block.currentPass == 0) - { - if(block.icon != null) - { - renderer.overrideBlockTexture = block.icon; - renderer.renderStandardBlock(block, x, y, z); - renderer.overrideBlockTexture = null; - } else if(block.base != null) - { - renderer.renderBlockByRenderType(block.base, x, y, z); - } - } else - { - renderer.setRenderBounds(bot, bot, bot, top, top, top); - renderer.renderStandardBlock(block, x, y, z); - } + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) { + if (blck == null || !(blck instanceof BlockTexturedOre)) + return false; + BlockTexturedOre block = (BlockTexturedOre) blck; - return true; - } + if (block.currentPass == 0) { + if (block.icon != null) { + renderer.overrideBlockTexture = block.icon; + renderer.renderStandardBlock(block, x, y, z); + renderer.overrideBlockTexture = null; + } else if (block.base != null) { + renderer.renderBlockByRenderType(block.base, x, y, z); + } + } else { + renderer.setRenderBounds(bot, bot, bot, top, top, top); + renderer.renderStandardBlock(block, x, y, z); + } - @Override - public boolean shouldRender3DInInventory(int modelId) - { - return true; - } + return true; + } - @Override - public int getRenderId() - { - return id; - } + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return id; + } } diff --git a/src/main/java/com/cricketcraft/chisel/utils/Drawing.java b/src/main/java/com/cricketcraft/chisel/utils/Drawing.java index 657d199b..e085d3a3 100644 --- a/src/main/java/com/cricketcraft/chisel/utils/Drawing.java +++ b/src/main/java/com/cricketcraft/chisel/utils/Drawing.java @@ -5,65 +5,63 @@ import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.IIcon; -public class Drawing -{ - public static void drawBlock(Block block, IIcon icon, RenderBlocks renderer) - { - Tessellator tessellator = Tessellator.instance; +public class Drawing { - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, -1.0F, 0.0F); - renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 1.0F, 0.0F); - renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, -1.0F); - renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, 1.0F); - renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(-1.0F, 0.0F, 0.0F); - renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(1.0F, 0.0F, 0.0F); - renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); - tessellator.draw(); - } + public static void drawBlock(Block block, IIcon icon, RenderBlocks renderer) { + Tessellator tessellator = Tessellator.instance; - public static void drawBlock(Block block, int meta, RenderBlocks renderer) - { - Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + } - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, -1.0F, 0.0F); - renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 1.0F, 0.0F); - renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, -1.0F); - renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, 1.0F); - renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(-1.0F, 0.0F, 0.0F); - renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(1.0F, 0.0F, 0.0F); - renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta)); - tessellator.draw(); - } + public static void drawBlock(Block block, int meta, RenderBlocks renderer) { + Tessellator tessellator = Tessellator.instance; + + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta)); + tessellator.draw(); + } } diff --git a/src/main/java/com/cricketcraft/chisel/utils/DummyContainer.java b/src/main/java/com/cricketcraft/chisel/utils/DummyContainer.java index b09c0132..a0567933 100644 --- a/src/main/java/com/cricketcraft/chisel/utils/DummyContainer.java +++ b/src/main/java/com/cricketcraft/chisel/utils/DummyContainer.java @@ -3,11 +3,10 @@ package com.cricketcraft.chisel.utils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; -public class DummyContainer extends Container -{ - @Override - public boolean canInteractWith(EntityPlayer entityplayer) - { - return true; - } +public class DummyContainer extends Container { + + @Override + public boolean canInteractWith(EntityPlayer entityplayer) { + return true; + } } diff --git a/src/main/java/com/cricketcraft/chisel/utils/General.java b/src/main/java/com/cricketcraft/chisel/utils/General.java index 437f2d6e..cd5fe6c3 100644 --- a/src/main/java/com/cricketcraft/chisel/utils/General.java +++ b/src/main/java/com/cricketcraft/chisel/utils/General.java @@ -13,92 +13,81 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -public class General -{ - public static Random rand = new Random(); +public class General { - 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 Random rand = new Random(); - 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 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 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; + 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; + } + } - return x * x + y * y + z * z < distance * distance; - } + 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 Item getItem(ItemStack stack) - { - if(stack == null) - return null; - if(stack.getItem() == null) - return null; + return x * x + y * y + z * z < distance * distance; + } - return stack.getItem(); - } + public static Item getItem(ItemStack stack) { + if (stack == null) + return null; + if (stack.getItem() == null) + return null; - public static String getName(Item item) - { - String res = item.getUnlocalizedName(); - return cleanTags(res); - } + return stack.getItem(); + } - public static String getName(Block block) - { - String res = block.getUnlocalizedName(); - return cleanTags(res); - } + public static String getName(Item item) { + String res = item.getUnlocalizedName(); + return cleanTags(res); + } - public static String cleanTags(String tag) - { - return tag.replaceAll("[Cc]hisel\\p{Punct}", "").replaceFirst("^tile\\.", "").replaceFirst("^item\\.", ""); - } + 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 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); + } } diff --git a/src/main/java/com/cricketcraft/chisel/utils/GeneralClient.java b/src/main/java/com/cricketcraft/chisel/utils/GeneralClient.java index 59a6f1a9..547283fb 100644 --- a/src/main/java/com/cricketcraft/chisel/utils/GeneralClient.java +++ b/src/main/java/com/cricketcraft/chisel/utils/GeneralClient.java @@ -9,33 +9,29 @@ import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -public class GeneralClient -{ - 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 class GeneralClient { + public static Random rand = new Random(); - public static IIcon getMissingIcon() - { - return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); - } + 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(); + public static IIcon getMissingIcon() { + return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + } - public static void bind(String textureName) - { - ResourceLocation res = resources.get(textureName); + static HashMap resources = new HashMap(); - if(res == null) - { - res = new ResourceLocation(textureName); - resources.put(textureName, res); - } + public static void bind(String textureName) { + ResourceLocation res = resources.get(textureName); - Minecraft.getMinecraft().getTextureManager().bindTexture(res); - } + if (res == null) { + res = new ResourceLocation(textureName); + resources.put(textureName, res); + } + + Minecraft.getMinecraft().getTextureManager().bindTexture(res); + } } diff --git a/src/main/java/com/cricketcraft/chisel/utils/GuiHandler.java b/src/main/java/com/cricketcraft/chisel/utils/GuiHandler.java index ff3efc8a..5e3b4a03 100644 --- a/src/main/java/com/cricketcraft/chisel/utils/GuiHandler.java +++ b/src/main/java/com/cricketcraft/chisel/utils/GuiHandler.java @@ -8,69 +8,60 @@ import net.minecraft.world.World; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; -public abstract class GuiHandler implements Comparable -{ - static ArrayList items = new ArrayList(); +public abstract class GuiHandler implements Comparable { - int index; - Object mod; - String name; + static ArrayList items = new ArrayList(); - public GuiHandler(String n) - { - items.add(this); - name = n; - } + int index; + Object mod; + String name; - public void open(EntityPlayer player, World world, int x, int y, int z) - { - player.openGui(mod, index, world, x, y, z); - } + public GuiHandler(String n) { + items.add(this); + name = n; + } - @Override - public int compareTo(Object a) - { - return name.compareTo(((GuiHandler) a).name); - } + public void open(EntityPlayer player, World world, int x, int y, int z) { + player.openGui(mod, index, world, x, y, z); + } - public static void register(Object mod) - { - Collections.sort(items); - int index = 0; + @Override + public int compareTo(Object a) { + return name.compareTo(((GuiHandler) a).name); + } - for(GuiHandler h : items) - { - h.mod = mod; - h.index = index++; - } + public static void register(Object mod) { + Collections.sort(items); + int index = 0; - NetworkRegistry.INSTANCE.registerGuiHandler(mod, new IGuiHandler() - { - @Override - public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) - { - if(id < 0 || id >= items.size()) - { - return null; - } + for (GuiHandler h : items) { + h.mod = mod; + h.index = index++; + } - return items.get(id).getServerGuiElement(id, player, world, x, y, z); - } + NetworkRegistry.INSTANCE.registerGuiHandler(mod, new IGuiHandler() { - @Override - public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) - { - if(id < 0 || id >= items.size()) - { - return null; - } + @Override + public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { + if (id < 0 || id >= items.size()) { + return null; + } - return items.get(id).getClientGuiElement(id, player, world, x, y, z); - } - }); - } + return items.get(id).getServerGuiElement(id, player, world, x, y, z); + } - public abstract Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z); + @Override + public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { + if (id < 0 || id >= items.size()) { + return null; + } - public abstract Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z); + return items.get(id).getClientGuiElement(id, player, world, x, y, z); + } + }); + } + + public abstract Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z); + + public abstract Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z); } diff --git a/src/main/java/com/cricketcraft/chisel/utils/ItemMetaBlock.java b/src/main/java/com/cricketcraft/chisel/utils/ItemMetaBlock.java index bff56d2f..002f01c3 100644 --- a/src/main/java/com/cricketcraft/chisel/utils/ItemMetaBlock.java +++ b/src/main/java/com/cricketcraft/chisel/utils/ItemMetaBlock.java @@ -4,29 +4,25 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -public class ItemMetaBlock extends ItemBlock -{ - public ItemMetaBlock(Block b) - { - super(b); - setMaxDamage(0); - setHasSubtypes(true); - } +public class ItemMetaBlock extends ItemBlock { - @Override - public String getUnlocalizedName(ItemStack itemstack) - { - if(itemstack == null) - { - return Block.getBlockFromItem(this).getUnlocalizedName(); - } + public ItemMetaBlock(Block b) { + super(b); + setMaxDamage(0); + setHasSubtypes(true); + } - return Block.getBlockFromItem(this).getUnlocalizedName(); - } + @Override + public String getUnlocalizedName(ItemStack itemstack) { + if (itemstack == null) { + return Block.getBlockFromItem(this).getUnlocalizedName(); + } - @Override - public int getMetadata(int i) - { - return i; - } + return Block.getBlockFromItem(this).getUnlocalizedName(); + } + + @Override + public int getMetadata(int i) { + return i; + } } diff --git a/src/main/java/com/cricketcraft/chisel/world/GeneratorChisel.java b/src/main/java/com/cricketcraft/chisel/world/GeneratorChisel.java index ba7396a9..c03eb7d8 100644 --- a/src/main/java/com/cricketcraft/chisel/world/GeneratorChisel.java +++ b/src/main/java/com/cricketcraft/chisel/world/GeneratorChisel.java @@ -1,39 +1,34 @@ package com.cricketcraft.chisel.world; -import cpw.mods.fml.common.IWorldGenerator; +import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; +import cpw.mods.fml.common.IWorldGenerator; -import java.util.Random; +public class GeneratorChisel implements IWorldGenerator { -public class GeneratorChisel implements IWorldGenerator -{ - WorldGenMinable gen; - int amount; + WorldGenMinable gen; + int amount; - public GeneratorChisel(Block block, int count, int am) - { - gen = new WorldGenMinable(block, count); - amount = am; - } + public GeneratorChisel(Block block, int count, int am) { + gen = new WorldGenMinable(block, count); + amount = am; + } - protected void genStandardOre(World world, Random random, int x, int z, int bot, int top) - { - for(int l = 0; l < amount; ++l) - { - int i1 = x + random.nextInt(16); - int j1 = bot + random.nextInt(top - bot); - int k1 = z + random.nextInt(16); - gen.generate(world, random, i1, j1, k1); - } - } + protected void genStandardOre(World world, Random random, int x, int z, int bot, int top) { + for (int l = 0; l < amount; ++l) { + int i1 = x + random.nextInt(16); + int j1 = bot + random.nextInt(top - bot); + int k1 = z + random.nextInt(16); + gen.generate(world, random, i1, j1, k1); + } + } - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) - { - genStandardOre(world, random, chunkX * 16, chunkZ * 16, 40, 128); - } + @Override + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { + genStandardOre(world, random, chunkX * 16, chunkZ * 16, 40, 128); + } } -