mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-11 15:57:31 +00:00
Worlds transfer now
This commit is contained in:
1 parent
1fe52ac4d2
commit
5e7f601eac
9 files changed
+54
-33
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@ public class BlockAutoChisel extends BlockContainer
|
||||
public BlockAutoChisel()
|
||||
{
|
||||
super(Material.rock);
|
||||
setBlockName("autoChisel");
|
||||
setHardness(1F);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user