Skip to content
This repository was archived by the owner on May 26, 2024. It is now read-only.

fix broken frame/block oredict name #148

Merged
merged 2 commits into from
Mar 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public BlockBaseModular(final Material material, final BlockTypes blockType, fin
protected BlockBaseModular(final String unlocalizedName, final String blockMaterialString,
final net.minecraft.block.material.Material vanillaMaterial, final BlockTypes blockType, final int colour,
final int miningLevel) {
super(blockType, unlocalizedName, vanillaMaterial, miningLevel);
super(blockType, unlocalizedName, vanillaMaterial, miningLevel);
this.setHarvestLevel(blockType.getHarvestTool(), miningLevel);
this.setBlockTextureName(CORE.MODID + ":" + blockType.getTexture());
this.blockColour = colour;
Expand All @@ -66,15 +66,19 @@ protected BlockBaseModular(final String unlocalizedName, final String blockMater
//ItemBlockGtBlock.sNameCache.put("block."+blockMaterial.getUnlocalizedName()+"."+this.thisBlock.name().toLowerCase(), GetProperName());
GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
if (fx == 0) {
GT_OreDictUnificator.registerOre("block" + thisBlockMaterial.replace(" ", ""), ItemUtils.getSimpleStack(this));
GT_OreDictUnificator.registerOre("block" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
}
else if (fx == 1) {
GT_OreDictUnificator.registerOre("frameGt" + thisBlockMaterial.replace(" ", ""), ItemUtils.getSimpleStack(this));
GT_OreDictUnificator.registerOre("frameGt" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
}
else if (fx == 2) {
GT_OreDictUnificator.registerOre("frameGt" + thisBlockMaterial.replace(" ", ""), ItemUtils.getSimpleStack(this));
GT_OreDictUnificator.registerOre("frameGt" + unifyMaterialName(thisBlockMaterial), ItemUtils.getSimpleStack(this));
}
}

public static String unifyMaterialName(String rawMaterName) {
return rawMaterName.replace(" ", "").replace("-", "").replace("_", "");
}

public boolean registerComponent() {
Logger.MATERIALS("Attempting to register "+this.getUnlocalizedName()+".");
Expand Down