From 5e7f601eaceeb31116f31377473c30d05366259d Mon Sep 17 00:00:00 2001 From: TheCricket Date: Sun, 23 Nov 2014 18:47:05 -0500 Subject: [PATCH] Worlds transfer now --- build.gradle | 2 +- .../minecraft/chisel/BlockNameConversion.java | 27 ++++++++++----- .../info/jbcs/minecraft/chisel/Chisel.java | 2 +- .../jbcs/minecraft/chisel/Configurations.java | 2 ++ .../chisel/block/BlockAutoChisel.java | 1 - .../chisel/compat/MarbleCompatibility.java | 11 ++++++ .../jbcs/minecraft/chisel/init/ModBlocks.java | 4 +-- .../minecraft/chisel/proxy/ClientProxy.java | 4 +-- .../resources/assets/chisel/lang/en_US.lang | 34 +++++++++---------- 9 files changed, 54 insertions(+), 33 deletions(-) diff --git a/build.gradle b/build.gradle index b8b68174..b4c92012 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { } apply plugin: 'forge' -version = "2.0.0.2" +version = "2.0.0.3" group = "info.jbcs.minecraft.chisel" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Chisel 2" diff --git a/src/main/java/info/jbcs/minecraft/chisel/BlockNameConversion.java b/src/main/java/info/jbcs/minecraft/chisel/BlockNameConversion.java index 49c2806d..04fd9c9f 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/BlockNameConversion.java +++ b/src/main/java/info/jbcs/minecraft/chisel/BlockNameConversion.java @@ -24,10 +24,14 @@ public class BlockNameConversion switch (step) { case 0: // lookup list return namingConversion.get(oldname); - case 1: // simple lower case - return oldname.toLowerCase(); + case 1: // remove Chisel: + if(oldname.startsWith("Chisel:")){ + newname = oldname.replaceAll("(?i)" + "Chisel:", ""); + } + return newname; case 2: // rename "marbleSlab" -> "marble_slab", "redstone" -> "redstone_block" newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase(); + if (newname.startsWith("block_")) { newname = newname.replaceFirst("block_([a-z_]+)", "$1_block"); @@ -45,7 +49,7 @@ public class BlockNameConversion } 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) + // 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); @@ -75,15 +79,22 @@ public class BlockNameConversion // "LightGray" is unfortunately converted to "light_gray" namingConversion.put("stainedGlassLightGray", "stained_glass_lightgray"); namingConversion.put("stainedGlassPaneLightGray", "stained_glass_pane_lightgray"); + namingConversion.put("blockTemple", "templeblock"); + namingConversion.put("stoneBrick", "stonebricksmooth"); + namingConversion.put("blockTempleMossy", "mossy_templeblock"); + namingConversion.put("blockFactory", "factoryblock"); + namingConversion.put("blockFft", "fantasyblock"); + namingConversion.put("blockCarpetFloor", "carpet"); + namingConversion.put("blockLaboratory", "laboratoryblock"); } public static Item findItem(String oldname) { - FMLLog.getLogger().trace("findItem() START " + 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("findItem() Checking for " + NameConversions.conversion(oldname, i)); + FMLLog.getLogger().trace("[Chisel 2] findItem() Checking for " + NameConversions.conversion(oldname, i)); item = GameRegistry.findItem(Chisel.MOD_ID, NameConversions.conversion(oldname, i)); } @@ -92,14 +103,14 @@ public class BlockNameConversion public static Block findBlock(String oldname) { - FMLLog.getLogger().trace("findBlock() START: " + 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("findBlock() Checking for " + NameConversions.conversion(oldname, 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/info/jbcs/minecraft/chisel/Chisel.java b/src/main/java/info/jbcs/minecraft/chisel/Chisel.java index 4aff1753..26a4004f 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/Chisel.java +++ b/src/main/java/info/jbcs/minecraft/chisel/Chisel.java @@ -54,7 +54,7 @@ public class Chisel { public static final String MOD_ID = "chisel"; public static final String MOD_NAME = "Chisel 2"; - public static final String VERSION = "2.0.0.2"; + public static final String VERSION = "2.0.0.3"; public static boolean multipartLoaded = false; diff --git a/src/main/java/info/jbcs/minecraft/chisel/Configurations.java b/src/main/java/info/jbcs/minecraft/chisel/Configurations.java index f382403b..0aa3a2a1 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/Configurations.java +++ b/src/main/java/info/jbcs/minecraft/chisel/Configurations.java @@ -16,6 +16,7 @@ public class Configurations public static boolean enableChiseling; public static boolean chiselRecipe; public static boolean autoChisel; + public static boolean isPokefennChisel; public static int factoryBlockAmount; public static int particlesTickrate; @@ -40,6 +41,7 @@ public class Configurations limestoneAmount = config.get("worldgen", "limestoneAmount", 8, "Amount of limestone 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(false); + isPokefennChisel = config.get("general", "isPokefennChisel", false, "Are you using pokefenns chisel and would like to transfer your world?").getBoolean(false); if(config.hasChanged()) { diff --git a/src/main/java/info/jbcs/minecraft/chisel/block/BlockAutoChisel.java b/src/main/java/info/jbcs/minecraft/chisel/block/BlockAutoChisel.java index 7b88ee83..84daa521 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/block/BlockAutoChisel.java +++ b/src/main/java/info/jbcs/minecraft/chisel/block/BlockAutoChisel.java @@ -21,7 +21,6 @@ public class BlockAutoChisel extends BlockContainer public BlockAutoChisel() { super(Material.rock); - setBlockName("autoChisel"); setHardness(1F); } diff --git a/src/main/java/info/jbcs/minecraft/chisel/compat/MarbleCompatibility.java b/src/main/java/info/jbcs/minecraft/chisel/compat/MarbleCompatibility.java index 394f662e..7ec41e4e 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/compat/MarbleCompatibility.java +++ b/src/main/java/info/jbcs/minecraft/chisel/compat/MarbleCompatibility.java @@ -106,6 +106,17 @@ public class MarbleCompatibility block.setHarvestLevel("chisel", 0, 0); } }; + + new ClassBlockCompat("com.bluepowermod.init.BPBlocks", "marble") + { + @Override + void action() + { + Carving.chisel.addVariation("marble", block, 0, 99); + block.setHarvestLevel("chisel", 0, 0); + } + }; + new ClassBlockCompat("num.numirp.block.ModBlocks", "blockDecor") { @Override diff --git a/src/main/java/info/jbcs/minecraft/chisel/init/ModBlocks.java b/src/main/java/info/jbcs/minecraft/chisel/init/ModBlocks.java index b3dec6c6..1cef8b72 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/init/ModBlocks.java +++ b/src/main/java/info/jbcs/minecraft/chisel/init/ModBlocks.java @@ -86,7 +86,7 @@ public class ModBlocks { public static void load() { if(Configurations.featureEnabled("autoChisel")){ - autoChisel = new BlockAutoChisel().setBlockTextureName("Chisel:autoChiselOld").setCreativeTab(ModTabs.tabChisel); + autoChisel = new BlockAutoChisel().setBlockTextureName("Chisel:autoChisel").setCreativeTab(ModTabs.tabChisel); GameRegistry.registerBlock(autoChisel, autoChisel.getUnlocalizedName()); Chisel.proxy.registerTileEntities(); } @@ -1300,7 +1300,5 @@ public class ModBlocks { voidstonePillar.carvableHelper.register(voidstonePillar, "voidstonePillar"); Carving.chisel.registerOre("voidstonePillar", "voidstonePillar"); } - - Blocks.stone.setHarvestLevel("chisel", 0, 0); } } diff --git a/src/main/java/info/jbcs/minecraft/chisel/proxy/ClientProxy.java b/src/main/java/info/jbcs/minecraft/chisel/proxy/ClientProxy.java index d87ccefe..c91f0ee8 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/proxy/ClientProxy.java +++ b/src/main/java/info/jbcs/minecraft/chisel/proxy/ClientProxy.java @@ -40,9 +40,9 @@ public class ClientProxy extends CommonProxy RenderingRegistry.registerBlockHandler(new BlockTexturedOreRenderer()); - //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAutoChisel.class, new RenderAutoChisel()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAutoChisel.class, new RenderAutoChisel()); - //MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.autoChisel), new ItemAutoChiselRenderer()); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.autoChisel), new ItemAutoChiselRenderer()); RenderingRegistry.registerEntityRenderingHandler(EntityCloudInABottle.class, new RenderSnowball(ModItems.itemCloudInABottle)); RenderingRegistry.registerEntityRenderingHandler(EntityBallOMoss.class, new RenderSnowball(ModItems.itemBallOMoss)); diff --git a/src/main/resources/assets/chisel/lang/en_US.lang b/src/main/resources/assets/chisel/lang/en_US.lang index a2154cd4..841289d2 100644 --- a/src/main/resources/assets/chisel/lang/en_US.lang +++ b/src/main/resources/assets/chisel/lang/en_US.lang @@ -873,23 +873,23 @@ chisel.tile.woolenClay.14.desc=Red Woolen Clay chisel.tile.woolenClay.15.desc=Black Woolen Clay #Laboratory Block -tile.laboratoryblock.name=Laboratory Block -chisel.tile.blockLaboratory.0.desc=Wall Panel -chisel.tile.blockLaboratory.1.desc=Dotted Panel -chisel.tile.blockLaboratory.2.desc=Enameled Wall -chisel.tile.blockLaboratory.3.desc=Enameled Roundel Wall -chisel.tile.blockLaboratory.4.desc=Enameled Wall Vents -chisel.tile.blockLaboratory.5.desc=Large Enameled Tile -chisel.tile.blockLaboratory.6.desc=Small Enameled Tiles -chisel.tile.blockLaboratory.7.desc=Laboratory Floor -chisel.tile.blockLaboratory.8.desc=Checkerboard Floor -chisel.tile.blockLaboratory.9.desc=Clear Panel -chisel.tile.blockLaboratory.10.desc=Fuzzy Panel -chisel.tile.blockLaboratory.11.desc=Large Steel Tile -chisel.tile.blockLaboratory.12.desc=Small Steel Tiles -chisel.tile.blockLaboratory.13.desc=Direction Console (Right) -chisel.tile.blockLaboratory.14.desc=Direction Console (Left) -chisel.tile.blockLaboratory.15.desc=Information Console +tile.laboratory.name=Laboratory Block +chisel.tile.laboratory.0.desc=Wall Panel +chisel.tile.laboratory.1.desc=Dotted Panel +chisel.tile.laboratory.2.desc=Enameled Wall +chisel.tile.laboratory.3.desc=Enameled Roundel Wall +chisel.tile.laboratory.4.desc=Enameled Wall Vents +chisel.tile.laboratory.5.desc=Large Enameled Tile +chisel.tile.laboratory.6.desc=Small Enameled Tiles +chisel.tile.laboratory.7.desc=Laboratory Floor +chisel.tile.laboratory.8.desc=Checkerboard Floor +chisel.tile.laboratory.9.desc=Clear Panel +chisel.tile.laboratory.10.desc=Fuzzy Panel +chisel.tile.laboratory.11.desc=Large Steel Tile +chisel.tile.laboratory.12.desc=Small Steel Tiles +chisel.tile.laboratory.13.desc=Direction Console (Right) +chisel.tile.laboratory.14.desc=Direction Console (Left) +chisel.tile.laboratory.15.desc=Information Console # Creative Tab localizations itemGroup.tabChiselBlocks=Chisel Blocks