Full cleanup and format. Remove all warnings.

This commit is contained in:
tterrag1098 committed 2015-08-06 00:00:22 -04:00
1 parent 9ff61fe0c0
commit 444fdbfe19
78 files changed
+818 -805

No files matched your search

@@ -72,8 +72,8 @@ public class Chisel {
@Instance(MOD_ID)
public static Chisel instance;
public Chisel() {
public Chisel() {
ChiselAPIProps.MOD_ID = MOD_ID;
CarvableHelper.itemCarvableClass = ItemCarvable.class;
Carving.construct();
@@ -152,7 +152,7 @@ public class Chisel {
addWorldgen(Features.DIORITE, ChiselBlocks.diorite, Configurations.dioriteAmount, 40, 100, 0.5);
GameRegistry.registerWorldGenerator(GeneratorChisel.INSTANCE, 1000);
EntityRegistry.registerModEntity(EntityChiselSnowman.class, "snowman", 0, this, 80, 1, true);
EntityRegistry.registerModEntity(EntityChiselSnowman.class, "snowman", 0, this, 80, 1, true);
proxy.init();
MinecraftForge.EVENT_BUS.register(this);
@@ -125,13 +125,13 @@ public enum Features {
@Override
void addBlocks() {
BlockCarvable andesite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks);
andesite.carverHelper.addVariation(Configurations.imTooGoodForDescriptions ? "" : "tile.andesite.0.desc", 0, "andesite/andesite");
andesite.carverHelper.addVariation(Configurations.imTooGoodForDescriptions ? "" : "tile.andesite.0.desc", 0, "andesite/andesite");
andesite.carverHelper.addVariation("tile.andesite.1.desc", 1, "andesite/andesitePolished");
andesite.carverHelper.addVariation("tile.andesite.2.desc", 2, "andesite/andesitePillar");
andesite.carverHelper.addVariation("tile.andesite.3.desc", 3, "andesite/andesiteLBrick");
andesite.carverHelper.addVariation("tile.andesite.4.desc", 4, "andesite/andesiteOrnate");
andesite.carverHelper.addVariation("tile.andesite.5.desc", 5, "andesite/andesitePrism");
andesite.carverHelper.addVariation("tile.andesite.6.desc", 6, "andesite/andesiteTiles");
andesite.carverHelper.addVariation("tile.andesite.2.desc", 2, "andesite/andesitePillar");
andesite.carverHelper.addVariation("tile.andesite.3.desc", 3, "andesite/andesiteLBrick");
andesite.carverHelper.addVariation("tile.andesite.4.desc", 4, "andesite/andesiteOrnate");
andesite.carverHelper.addVariation("tile.andesite.5.desc", 5, "andesite/andesitePrism");
andesite.carverHelper.addVariation("tile.andesite.6.desc", 6, "andesite/andesiteTiles");
andesite.carverHelper.registerAll(andesite, "andesite");
andesite.carverHelper.registerOre("blockAndesite");
andesite.carverHelper.registerOre("stoneAndesite");
@@ -166,8 +166,8 @@ public enum Features {
if (meta == 0) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.antiBlock, 8, 15), "SSS", "SGS", "SSS", 'S', "stone", 'G', "dustGlowstone"));
}
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.antiBlock, 8, meta), "BBB", "BdB", "BBB",
'd', dyeOres[meta], 'B', new ItemStack(ChiselBlocks.antiBlock, 1, OreDictionary.WILDCARD_VALUE)));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.antiBlock, 8, meta), "BBB", "BdB", "BBB", 'd', dyeOres[meta], 'B', new ItemStack(ChiselBlocks.antiBlock, 1,
OreDictionary.WILDCARD_VALUE)));
}
@Override
@@ -190,11 +190,11 @@ public enum Features {
arcane.carverHelper.addVariation("tile.arcane.4.desc", 4, "arcane/runesGlow");
arcane.carverHelper.addVariation("tile.arcane.5.desc", 5, "arcane/bigBrick");
arcane.carverHelper.addVariation("tile.arcane.6.desc", 6, "arcane/conduitGlowAnim");
arcane.carverHelper.addVariation("tile.arcane.7.desc", 7, "arcane/BorderBrain");
arcane.carverHelper.addVariation("tile.arcane.8.desc", 8, "arcane/ArcaneBorder");
arcane.carverHelper.addVariation("tile.arcane.9.desc", 9, "arcane/arcaneMatrix");
arcane.carverHelper.addVariation("tile.arcane.10.desc", 10, "arcane/thaumcraftLogo");
arcane.carverHelper.addVariation("tile.arcane.11.desc", 11, "arcane/arcaneCrackAnim");
arcane.carverHelper.addVariation("tile.arcane.7.desc", 7, "arcane/BorderBrain");
arcane.carverHelper.addVariation("tile.arcane.8.desc", 8, "arcane/ArcaneBorder");
arcane.carverHelper.addVariation("tile.arcane.9.desc", 9, "arcane/arcaneMatrix");
arcane.carverHelper.addVariation("tile.arcane.10.desc", 10, "arcane/thaumcraftLogo");
arcane.carverHelper.addVariation("tile.arcane.11.desc", 11, "arcane/arcaneCrackAnim");
arcane.carverHelper.registerAll(arcane, "arcane");
Carving.chisel.registerOre("arcane", "arcane");
}
@@ -250,11 +250,12 @@ public enum Features {
},
BEACON {
@Override
void addBlocks(){
void addBlocks() {
BlockCarvableBeacon beacon = (BlockCarvableBeacon) new BlockCarvableBeacon().setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
Carving.chisel.addVariation("beacon", Blocks.beacon, 0, 0);
for(int meta = 0; meta < 16; meta++){
for (int meta = 0; meta < 16; meta++) {
beacon.carverHelper.addVariation("tile.beacon." + ItemDye.field_150923_a[meta] + ".desc", meta, "beacon", (meta + 1));
}
beacon.carverHelper.registerAll(beacon, "beacon");
@@ -391,8 +392,8 @@ public enum Features {
@Override
void addBlocks() {
BlockCarvableCarpet carpet = (BlockCarvableCarpet) new BlockCarvableCarpet(Material.cloth).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.1F).setStepSound(Block.soundTypeCloth)
.setLightOpacity(0).setStepSound(Block.soundTypeCloth);
BlockCarvableCarpet carpet = (BlockCarvableCarpet) new BlockCarvableCarpet(Material.cloth).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.1F)
.setStepSound(Block.soundTypeCloth).setLightOpacity(0).setStepSound(Block.soundTypeCloth);
carpet.carverHelper.addVariation("tile.carpet.0.desc", 0, new SubmapManagerCarpetFloor("white"));
carpet.carverHelper.addVariation("tile.carpet.1.desc", 1, new SubmapManagerCarpetFloor("orange"));
@@ -579,8 +580,7 @@ public enum Features {
}
},
COPPER
{
COPPER {
@Override
void addBlocks() {
@@ -616,7 +616,7 @@ public enum Features {
diamond_block.carverHelper.addVariation("tile.diamond.10.desc", 10, "diamond/terrain-diamond-fourornate");
diamond_block.carverHelper.addVariation("tile.diamond.11.desc", 11, "diamond/terrain-diamond-zelda");
diamond_block.carverHelper.addVariation("tile.diamond.12.desc", 12, "diamond/terrain-diamond-ornatelayer");
diamond_block.carverHelper.registerAll(diamond_block, "diamond_block");
diamond_block.carverHelper.registerAll(diamond_block, "diamond_block");
Carving.chisel.registerOre("diamond_block", "blockDiamond");
}
},
@@ -627,13 +627,13 @@ public enum Features {
void addBlocks() {
BlockCarvable diorite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks);
diorite.carverHelper.addVariation(Configurations.imTooGoodForDescriptions ? "" : "tile.diorite.0.desc", 0, "diorite/diorite");
diorite.carverHelper.addVariation(Configurations.imTooGoodForDescriptions ? "" : "tile.diorite.0.desc", 0, "diorite/diorite");
diorite.carverHelper.addVariation("tile.diorite.1.desc", 1, "diorite/dioritePolished");
diorite.carverHelper.addVariation("tile.diorite.2.desc", 2, "diorite/dioritePillar");
diorite.carverHelper.addVariation("tile.diorite.3.desc", 3, "diorite/dioriteLBrick");
diorite.carverHelper.addVariation("tile.diorite.4.desc", 4, "diorite/dioriteOrnate");
diorite.carverHelper.addVariation("tile.diorite.5.desc", 5, "diorite/dioritePrism");
diorite.carverHelper.addVariation("tile.diorite.6.desc", 6, "diorite/dioriteTiles");
diorite.carverHelper.addVariation("tile.diorite.3.desc", 3, "diorite/dioriteLBrick");
diorite.carverHelper.addVariation("tile.diorite.4.desc", 4, "diorite/dioriteOrnate");
diorite.carverHelper.addVariation("tile.diorite.5.desc", 5, "diorite/dioritePrism");
diorite.carverHelper.addVariation("tile.diorite.6.desc", 6, "diorite/dioriteTiles");
diorite.carverHelper.registerAll(diorite, "diorite");
diorite.carverHelper.registerOre("blockDiorite");
diorite.carverHelper.registerOre("stoneDiorite");
@@ -700,30 +700,30 @@ public enum Features {
}
},
END_STONE {
END_STONE {
@Override
void addBlocks() {
BlockCarvable end_Stone = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks);
Carving.chisel.addVariation("end_Stone", Blocks.end_stone , 0, -1);
end_Stone.carverHelper.addVariation("tile.end_Stone.0.desc", 0, "endstone/end_bricks");
end_Stone.carverHelper.addVariation("tile.end_Stone.1.desc", 1, "endstone/chaoticBricks");
end_Stone.carverHelper.addVariation("tile.end_Stone.2.desc", 2, "endstone/CheckeredTile");
end_Stone.carverHelper.addVariation("tile.end_Stone.3.desc", 3, "endstone/enderCircuit");
end_Stone.carverHelper.addVariation("tile.end_Stone.4.desc", 4, "endstone/endFrenchBricks");
end_Stone.carverHelper.addVariation("tile.end_Stone.5.desc", 5, "endstone/endPillar");
end_Stone.carverHelper.addVariation("tile.end_Stone.6.desc", 6, "endstone/endStoneEtched");
end_Stone.carverHelper.addVariation("tile.end_Stone.7.desc", 7, "endstone/prismaticEndStone");
end_Stone.carverHelper.addVariation("tile.end_Stone.8.desc", 8, "endstone/endStoneChunk");
end_Stone.carverHelper.addVariation("tile.end_Stone.9.desc", 9, "endstone/EnderFrame", new SubmapManagerCombinedCTM(9, "endstone/EnderFrame", TextureType.V9));
end_Stone.carverHelper.addVariation("tile.end_Stone.10.desc", 10, "endstone/arcaneEndStone");
end_Stone.carverHelper.addVariation("tile.end_Stone.11.desc", 11, "endstone/framedEndStone");
end_Stone.carverHelper.addVariation("tile.end_Stone.12.desc", 12, "endstone/endstoneOrnate");
end_Stone.carverHelper.addVariation("tile.end_Stone.13.desc", 13, "endstone/endstoneLargeTile");
end_Stone.carverHelper.registerAll(end_Stone, "end_Stone");
Carving.chisel.registerOre("end_Stone", "end_Stone");
}
},
@Override
void addBlocks() {
BlockCarvable end_Stone = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks);
Carving.chisel.addVariation("end_Stone", Blocks.end_stone, 0, -1);
end_Stone.carverHelper.addVariation("tile.end_Stone.0.desc", 0, "endstone/end_bricks");
end_Stone.carverHelper.addVariation("tile.end_Stone.1.desc", 1, "endstone/chaoticBricks");
end_Stone.carverHelper.addVariation("tile.end_Stone.2.desc", 2, "endstone/CheckeredTile");
end_Stone.carverHelper.addVariation("tile.end_Stone.3.desc", 3, "endstone/enderCircuit");
end_Stone.carverHelper.addVariation("tile.end_Stone.4.desc", 4, "endstone/endFrenchBricks");
end_Stone.carverHelper.addVariation("tile.end_Stone.5.desc", 5, "endstone/endPillar");
end_Stone.carverHelper.addVariation("tile.end_Stone.6.desc", 6, "endstone/endStoneEtched");
end_Stone.carverHelper.addVariation("tile.end_Stone.7.desc", 7, "endstone/prismaticEndStone");
end_Stone.carverHelper.addVariation("tile.end_Stone.8.desc", 8, "endstone/endStoneChunk");
end_Stone.carverHelper.addVariation("tile.end_Stone.9.desc", 9, "endstone/EnderFrame", new SubmapManagerCombinedCTM(9, "endstone/EnderFrame", TextureType.V9));
end_Stone.carverHelper.addVariation("tile.end_Stone.10.desc", 10, "endstone/arcaneEndStone");
end_Stone.carverHelper.addVariation("tile.end_Stone.11.desc", 11, "endstone/framedEndStone");
end_Stone.carverHelper.addVariation("tile.end_Stone.12.desc", 12, "endstone/endstoneOrnate");
end_Stone.carverHelper.addVariation("tile.end_Stone.13.desc", 13, "endstone/endstoneLargeTile");
end_Stone.carverHelper.registerAll(end_Stone, "end_Stone");
Carving.chisel.registerOre("end_Stone", "end_Stone");
}
},
FACTORY {
@@ -763,8 +763,8 @@ public enum Features {
@Override
void addRecipes() {
GameRegistry.addRecipe(new ItemStack(ChiselBlocks.factoryblock, Configurations.factoryBlockAmount, 0), new Object[]{"*X*", "X X", "*X*", '*', new ItemStack(Blocks.stone, 1), 'X',
new ItemStack(Items.iron_ingot, 1)});
GameRegistry.addRecipe(new ItemStack(ChiselBlocks.factoryblock, Configurations.factoryBlockAmount, 0), new Object[] { "*X*", "X X", "*X*", '*', new ItemStack(Blocks.stone, 1), 'X',
new ItemStack(Items.iron_ingot, 1) });
}
},
@@ -835,14 +835,14 @@ public enum Features {
futura.carverHelper.addVariation("tile.futura.5.desc", 5, "futura/WIP/controller", new SubmapManagerFakeController(5, "futura/WIP/uberWavy"));
futura.carverHelper.registerAll(futura, "futura");
BlockCarvable circuits = (BlockCarvable) new BlockCarvableGlow("animations/strobe").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10.0F);
for (int i = 0; i < 16; i++) {
circuits.carverHelper.addVariation("tile.futuraCircuit." + ItemDye.field_150921_b[i] + ".desc", i, "futura/circuitPlate", (i+20));
}
BlockCarvable circuits = (BlockCarvable) new BlockCarvableGlow("animations/strobe").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10.0F);
for (int i = 0; i < 16; i++) {
circuits.carverHelper.addVariation("tile.futuraCircuit." + ItemDye.field_150921_b[i] + ".desc", i, "futura/circuitPlate", (i + 20));
}
circuits.carverHelper.registerBlock(circuits, "futuraCircuit");
circuits.carverHelper.registerVariations("futura");
Carving.chisel.registerOre("futura", "futura");
circuits.carverHelper.registerBlock(circuits, "futuraCircuit");
circuits.carverHelper.registerVariations("futura");
Carving.chisel.registerOre("futura", "futura");
}
@Override
@@ -877,8 +877,8 @@ public enum Features {
BlockCarvableGlass glass2 = (BlockCarvableGlass) new BlockCarvableGlass().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F).setStepSound(Block.soundTypeGlass);
glass2.carverHelper.addVariation("tile.glass2.0.desc", 0, "glass/chrono", 20);
glass2.carverHelper.registerBlock(glass2, "glass2");
glass2.carverHelper.registerVariations("glass");
glass2.carverHelper.registerBlock(glass2, "glass2");
glass2.carverHelper.registerVariations("glass");
}
},
@@ -1013,18 +1013,18 @@ public enum Features {
gold_block.carverHelper.addVariation("tile.gold.13.desc", 13, "gold/terrain-gold-spaceblack");
gold_block.carverHelper.addVariation("tile.gold.14.desc", 14, "gold/terrain-gold-simple");
BlockCarvable gold2 = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F)
.setResistance(10F);
gold2.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/gold/caution", 20);
gold2.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/gold/crate", 21);
gold2.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/gold/thermal", 22);
gold2.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/gold/adv", 23);
gold2.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/gold/egregious", 24);
gold2.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/gold/bolted", 25);
gold2.carverHelper.registerBlock(gold2, "gold2");
gold2.carverHelper.registerVariations("gold_block");
BlockCarvable gold2 = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F)
.setResistance(10F);
gold2.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/gold/caution", 20);
gold2.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/gold/crate", 21);
gold2.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/gold/thermal", 22);
gold2.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/gold/adv", 23);
gold2.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/gold/egregious", 24);
gold2.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/gold/bolted", 25);
gold2.carverHelper.registerBlock(gold2, "gold2");
gold2.carverHelper.registerVariations("gold_block");
gold_block.carverHelper.registerAll(gold_block, "gold_block");
gold_block.carverHelper.registerAll(gold_block, "gold_block");
Carving.chisel.registerOre("gold_block", "blockGold");
}
},
@@ -1035,13 +1035,13 @@ public enum Features {
void addBlocks() {
BlockCarvable granite = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks);
granite.carverHelper.addVariation(Configurations.imTooGoodForDescriptions ? "" : "tile.granite.0.desc", 0, "granite/granite");
granite.carverHelper.addVariation(Configurations.imTooGoodForDescriptions ? "" : "tile.granite.0.desc", 0, "granite/granite");
granite.carverHelper.addVariation("tile.granite.1.desc", 1, "granite/granitePolished");
granite.carverHelper.addVariation("tile.granite.2.desc", 2, "granite/granitePillar");
granite.carverHelper.addVariation("tile.granite.3.desc", 3, "granite/graniteLBrick");
granite.carverHelper.addVariation("tile.granite.4.desc", 4, "granite/graniteOrnate");
granite.carverHelper.addVariation("tile.granite.5.desc", 5, "granite/granitePrism");
granite.carverHelper.addVariation("tile.granite.6.desc", 6, "granite/graniteTiles");
granite.carverHelper.addVariation("tile.granite.3.desc", 3, "granite/graniteLBrick");
granite.carverHelper.addVariation("tile.granite.4.desc", 4, "granite/graniteOrnate");
granite.carverHelper.addVariation("tile.granite.5.desc", 5, "granite/granitePrism");
granite.carverHelper.addVariation("tile.granite.6.desc", 6, "granite/graniteTiles");
granite.carverHelper.registerAll(granite, "granite");
granite.carverHelper.registerOre("blockGranite");
granite.carverHelper.registerOre("stoneGranite");
@@ -1087,21 +1087,21 @@ public enum Features {
@Override
void addBlocks() {
BlockCarvable hexPlating = (BlockCarvable) new BlockCarvableGlow("animations/archetype2").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2).setResistance(12);
for (int i = 0; i < 16; i++) {
hexPlating.carverHelper.addVariation("tile.hexPlating." + ItemDye.field_150921_b[i] + ".desc", i, "hexPlating/hexBase");
}
hexPlating.carverHelper.registerAll(hexPlating, "hexPlating");
Carving.chisel.registerOre("hexPlating", "hexPlating");
BlockCarvable hexPlating = (BlockCarvable) new BlockCarvableGlow("animations/archetype2").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2).setResistance(12);
for (int i = 0; i < 16; i++) {
hexPlating.carverHelper.addVariation("tile.hexPlating." + ItemDye.field_150921_b[i] + ".desc", i, "hexPlating/hexBase");
}
hexPlating.carverHelper.registerAll(hexPlating, "hexPlating");
Carving.chisel.registerOre("hexPlating", "hexPlating");
BlockCarvable hexLargePlating = (BlockCarvable) new BlockCarvableGlow("animations/archetype2").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2).setResistance(12);
for (int i = 0; i < 16; i++) {
hexLargePlating.carverHelper.addVariation("tile.hexPlating." + ItemDye.field_150921_b[i] + ".desc", i, "hexPlating/hexNew", (i+20));
}
BlockCarvable hexLargePlating = (BlockCarvable) new BlockCarvableGlow("animations/archetype2").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2).setResistance(12);
for (int i = 0; i < 16; i++) {
hexLargePlating.carverHelper.addVariation("tile.hexPlating." + ItemDye.field_150921_b[i] + ".desc", i, "hexPlating/hexNew", (i + 20));
}
hexLargePlating.carverHelper.registerBlock(hexLargePlating, "hexLargePlating");
hexLargePlating.carverHelper.registerVariations("hexPlating");
Carving.chisel.registerOre("hexPlating", "hexPlating");
hexLargePlating.carverHelper.registerBlock(hexLargePlating, "hexLargePlating");
hexLargePlating.carverHelper.registerVariations("hexPlating");
Carving.chisel.registerOre("hexPlating", "hexPlating");
}
@Override
@@ -1272,18 +1272,18 @@ public enum Features {
iron_block.carverHelper.addVariation("tile.iron.14.desc", 14, "iron/terrain-iron-vents");
iron_block.carverHelper.addVariation("tile.iron.15.desc", 15, "iron/terrain-iron-simple");
BlockCarvable iron2 = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F)
.setResistance(10F);
iron2.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/iron/caution", 20);
iron2.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/iron/crate", 21);
iron2.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/iron/thermal", 22);
iron2.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/iron/adv", 23);
iron2.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/iron/egregious", 24);
iron2.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/iron/bolted", 25);
iron2.carverHelper.registerBlock(iron2, "iron2");
iron2.carverHelper.registerVariations("iron_block");
BlockCarvable iron2 = (BlockCarvable) new BlockBeaconBase(Material.iron).setStepSound(Block.soundTypeMetal).setCreativeTab(ChiselTabs.tabModdedChiselBlocks).setHardness(5F)
.setResistance(10F);
iron2.carverHelper.addVariation("tile.metalOre.0.desc", 0, "metals/iron/caution", 20);
iron2.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/iron/crate", 21);
iron2.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/iron/thermal", 22);
iron2.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/iron/adv", 23);
iron2.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/iron/egregious", 24);
iron2.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/iron/bolted", 25);
iron2.carverHelper.registerBlock(iron2, "iron2");
iron2.carverHelper.registerVariations("iron_block");
iron_block.carverHelper.registerAll(iron_block, "iron_block");
iron_block.carverHelper.registerAll(iron_block, "iron_block");
Carving.chisel.registerOre("iron_block", "blockIron");
}
},
@@ -1353,7 +1353,7 @@ public enum Features {
lapis_block.carverHelper.addVariation("tile.lapis.7.desc", 7, "lapis/a1-blocklapis-smooth");
lapis_block.carverHelper.addVariation("tile.lapis.8.desc", 8, "lapis/a1-blocklapis-ornatelayer");
lapis_block.carverHelper.registerAll(lapis_block, "lapis_block");
lapis_block.carverHelper.registerAll(lapis_block, "lapis_block");
Carving.chisel.registerOre("lapis_block", "lapis");
}
},
@@ -1406,6 +1406,7 @@ public enum Features {
BlockLeaf leaves = (BlockLeaf) new BlockLeaf(Material.leaves).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.2F).setStepSound(Block.soundTypeGrass);
Carving.chisel.addGroup(new SimpleCarvingGroup("leaves") {
@Override
public List<ICarvingVariation> getVariations() {
if (Configurations.chiselBackToVanillaLeaves) {
return super.getVariations();
@@ -1693,38 +1694,37 @@ public enum Features {
}
},
NATION {
NATION {
@Override
void addBlocks() {
BlockCarvable imperial = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F);
imperial.carverHelper.addVariation("tile.imperial.0.desc", 0, "military/imperialCamo");
imperial.carverHelper.addVariation("tile.imperial.1.desc", 1, "military/imperialCamoSecluded");
imperial.carverHelper.addVariation("tile.imperial.2.desc", 2, "military/imperialPlate");
imperial.carverHelper.addVariation("tile.imperial.3.desc", 3, "military/imperialCautionWhite");
imperial.carverHelper.addVariation("tile.imperial.4.desc", 4, "military/imperialCautionOrange");
imperial.carverHelper.registerBlock(imperial, "nation");
@Override
void addBlocks() {
BlockCarvable imperial = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F);
imperial.carverHelper.addVariation("tile.imperial.0.desc", 0, "military/imperialCamo");
imperial.carverHelper.addVariation("tile.imperial.1.desc", 1, "military/imperialCamoSecluded");
imperial.carverHelper.addVariation("tile.imperial.2.desc", 2, "military/imperialPlate");
imperial.carverHelper.addVariation("tile.imperial.3.desc", 3, "military/imperialCautionWhite");
imperial.carverHelper.addVariation("tile.imperial.4.desc", 4, "military/imperialCautionOrange");
imperial.carverHelper.registerBlock(imperial, "nation");
BlockCarvable rebel = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F);
rebel.carverHelper.addVariation("tile.rebel.0.desc", 0, "military/rebelCamo", 20);
rebel.carverHelper.addVariation("tile.rebel.1.desc", 1, "military/rebelCamoSecluded", 21);
rebel.carverHelper.addVariation("tile.rebel.2.desc", 2, "military/rebelPlate", 22);
rebel.carverHelper.addVariation("tile.rebel.3.desc", 3, "military/rebelCautionWhite", 23);
rebel.carverHelper.addVariation("tile.rebel.4.desc", 4, "military/rebelCautionRed", 24);
rebel.carverHelper.registerBlock(rebel, "rebel");
BlockCarvable rebel = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F);
rebel.carverHelper.addVariation("tile.rebel.0.desc", 0, "military/rebelCamo", 20);
rebel.carverHelper.addVariation("tile.rebel.1.desc", 1, "military/rebelCamoSecluded", 21);
rebel.carverHelper.addVariation("tile.rebel.2.desc", 2, "military/rebelPlate", 22);
rebel.carverHelper.addVariation("tile.rebel.3.desc", 3, "military/rebelCautionWhite", 23);
rebel.carverHelper.addVariation("tile.rebel.4.desc", 4, "military/rebelCautionRed", 24);
rebel.carverHelper.registerBlock(rebel, "rebel");
imperial.carverHelper.registerVariations("military");
rebel.carverHelper.registerVariations("military");
imperial.carverHelper.registerVariations("military");
rebel.carverHelper.registerVariations("military");
Carving.chisel.registerOre("military", "military");
}
Carving.chisel.registerOre("military", "military");
}
@Override
void addRecipes() {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.rebel, 32, 0), new Object[] { "xyx", "yzy", "xyx", 'x', "stone", 'y',
Items.iron_ingot, 'z', Items.gold_nugget }));
}
},
@Override
void addRecipes() {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.rebel, 32, 0), new Object[] { "xyx", "yzy", "xyx", 'x', "stone", 'y', Items.iron_ingot, 'z', Items.gold_nugget }));
}
},
NETHER_BRICK {
@@ -1793,7 +1793,8 @@ public enum Features {
@Override
void addBlocks() {
BlockCarvable obsidian = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(50.0F).setResistance(2000.0F).setStepSound(Block.soundTypeStone);
BlockCarvable obsidian = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(50.0F).setResistance(2000.0F)
.setStepSound(Block.soundTypeStone);
Carving.chisel.addVariation("obsidian", Blocks.obsidian, 0, 0);
obsidian.carverHelper.addVariation("tile.obsidian.1.desc", 1, "obsidian/pillar");
@@ -1812,7 +1813,7 @@ public enum Features {
obsidian.carverHelper.addVariation("tile.obsidian.14.desc", 14, "obsidian/greek");
obsidian.carverHelper.addVariation("tile.obsidian.15.desc", 15, "obsidian/crate");
obsidian.carverHelper.registerAll(obsidian, "obsidian");
obsidian.carverHelper.registerAll(obsidian, "obsidian");
Carving.chisel.registerOre("obsidian", "obsidian");
}
},
@@ -1842,6 +1843,7 @@ public enum Features {
packedice.carverHelper.registerAll(packedice, "packedice");
Carving.chisel.registerOre("packedice", "packedice");
}
@Override
void addRecipes() {
GameRegistry.addRecipe(new ItemStack(ChiselBlocks.packedice_pillar, 6, 0), "XX", "XX", "XX", 'X', new ItemStack(ChiselBlocks.packedice, 1, OreDictionary.WILDCARD_VALUE));
@@ -1852,8 +1854,8 @@ public enum Features {
@Override
void addBlocks() {
BlockCarvablePackedIce packedice_pillar = (BlockCarvablePackedIce) new BlockCarvablePackedIce().setCreativeTab(ChiselTabs.tabOtherChiselBlocks)
.setHardness(0.5F).setLightOpacity(3).setStepSound(Block.soundTypeGlass);
BlockCarvablePackedIce packedice_pillar = (BlockCarvablePackedIce) new BlockCarvablePackedIce().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.5F).setLightOpacity(3)
.setStepSound(Block.soundTypeGlass);
packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.0.desc", 0, "icepillar/plainplain");
packedice_pillar.carverHelper.addVariation("tile.packedice_pillar.1.desc", 1, "icepillar/plaingreek");
@@ -1890,11 +1892,11 @@ public enum Features {
makerPackedIceStairs.carverHelper.addVariation("tile.packedice_stairs.15.desc", 15, "ice/poison");
makerPackedIceStairs.create(new IStairsCreator() {
@Override
public BlockCarvableStairs create(Block block, int meta, CarvableHelper helper) {
return new BlockCarvablePackedIceStairs(block, meta, helper);
}
}, "packedice_stairs", ChiselBlocks.packediceStairs);
@Override
public BlockCarvableStairs create(Block block, int meta, CarvableHelper helper) {
return new BlockCarvablePackedIceStairs(block, meta, helper);
}
}, "packedice_stairs", ChiselBlocks.packediceStairs);
Carving.chisel.registerOre("packedice_stairs", "packedIceStairs");
}
},
@@ -1990,31 +1992,32 @@ public enum Features {
}
},
PURPUR {
@Override
void addBlocks() {
BlockCarvable purpur = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks);
purpur.carverHelper.addVariation("tile.purpur.0.desc", 0, "end_purpur/purpur_block");
purpur.carverHelper.addVariation("tile.purpur.1.desc", 1, "end_purpur/purpur_pillar");
purpur.carverHelper.addVariation("tile.purpur.2.desc", 2, "end_purpur/shulker");
purpur.carverHelper.addVariation("tile.purpur.3.desc", 3, "end_purpur/tilePurpur");
purpur.carverHelper.addVariation("tile.purpur.4.desc", 4, "end_purpur/tileBrokenPurpur");
purpur.carverHelper.addVariation("tile.purpur.5.desc", 5, "end_purpur/prismaticPurpur");
purpur.carverHelper.addVariation("tile.purpur.6.desc", 6, "end_purpur/purpurBricks");
purpur.carverHelper.addVariation("tile.purpur.7.desc", 7, "end_purpur/purpurCobble");
purpur.carverHelper.addVariation("tile.purpur.8.desc", 8, "end_purpur/arcanePurpur");
purpur.carverHelper.addVariation("tile.purpur.9.desc", 9, "end_purpur/purpurLargeTile");
purpur.carverHelper.addVariation("tile.purpur.10.desc", 10, "end_purpur/purpurOrnate");
PURPUR {
purpur.carverHelper.registerAll(purpur, "purpur");
Carving.chisel.registerOre("purpur", "purpur");
}
@Override
void addBlocks() {
BlockCarvable purpur = (BlockCarvable) new BlockCarvable(Material.rock).setHardness(2.0F).setResistance(10.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks);
purpur.carverHelper.addVariation("tile.purpur.0.desc", 0, "end_purpur/purpur_block");
purpur.carverHelper.addVariation("tile.purpur.1.desc", 1, "end_purpur/purpur_pillar");
purpur.carverHelper.addVariation("tile.purpur.2.desc", 2, "end_purpur/shulker");
purpur.carverHelper.addVariation("tile.purpur.3.desc", 3, "end_purpur/tilePurpur");
purpur.carverHelper.addVariation("tile.purpur.4.desc", 4, "end_purpur/tileBrokenPurpur");
purpur.carverHelper.addVariation("tile.purpur.5.desc", 5, "end_purpur/prismaticPurpur");
purpur.carverHelper.addVariation("tile.purpur.6.desc", 6, "end_purpur/purpurBricks");
purpur.carverHelper.addVariation("tile.purpur.7.desc", 7, "end_purpur/purpurCobble");
purpur.carverHelper.addVariation("tile.purpur.8.desc", 8, "end_purpur/arcanePurpur");
purpur.carverHelper.addVariation("tile.purpur.9.desc", 9, "end_purpur/purpurLargeTile");
purpur.carverHelper.addVariation("tile.purpur.10.desc", 10, "end_purpur/purpurOrnate");
@Override
void addRecipes() {
GameRegistry.addShapelessRecipe(new ItemStack(ChiselBlocks.purpur), new ItemStack(Item.getItemFromBlock(Blocks.end_stone), 1), new ItemStack(Items.dye, 1, 5));
}
},
purpur.carverHelper.registerAll(purpur, "purpur");
Carving.chisel.registerOre("purpur", "purpur");
}
@Override
void addRecipes() {
GameRegistry.addShapelessRecipe(new ItemStack(ChiselBlocks.purpur), new ItemStack(Item.getItemFromBlock(Blocks.end_stone), 1), new ItemStack(Items.dye, 1, 5));
}
},
QUARTZ {
@@ -2187,7 +2190,7 @@ public enum Features {
redstone_block.carverHelper.addVariation("tile.redstone_block.14.desc", 14, "redstone/a1-blockredstone-skullred");
redstone_block.carverHelper.addVariation("tile.redstone_block.15.desc", 15, "redstone/a1-blockredstone-redstonezelda");
redstone_block.carverHelper.registerAll(redstone_block, "redstone_block");
redstone_block.carverHelper.registerAll(redstone_block, "redstone_block");
Carving.chisel.registerOre("redstone_block", "redstone");
}
},
@@ -2395,10 +2398,10 @@ public enum Features {
}
}
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.0.desc", 0, "stonebrick2/masonBricksPlain", 16);
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.1.desc", 1, "stonebrick2/masonBricksFelsic", 17);
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.2.desc", 2, "stonebrick2/masonBricksMafic", 18);
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.3.desc", 3, "stonebrick2/masonBricksMixed", 19);
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.0.desc", 0, "stonebrick2/masonBricksPlain", 16);
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.1.desc", 1, "stonebrick2/masonBricksFelsic", 17);
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.2.desc", 2, "stonebrick2/masonBricksMafic", 18);
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.3.desc", 3, "stonebrick2/masonBricksMixed", 19);
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.4.desc", 4, "stonebrick/smallbricks");
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.5.desc", 5, "stonebrick/largebricks");
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.6.desc", 6, "stonebrick/smallchaotic");
@@ -2413,9 +2416,9 @@ public enum Features {
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.15.desc", 15, "stonebrick/poison");
stonebricksmooth.carverHelper.registerAll(stonebricksmooth, "stonebricksmooth");
Carving.chisel.registerOre("stonebricksmooth", "stonebricksmooth");
Carving.chisel.registerOre("stonebricksmooth", "stonebricksmooth");
//Carving.chisel.addVariation("stonebricksmooth", GameRegistry.findBlock("Chisel-2", "tile.TFTowerStone"), 0, 0);
// Carving.chisel.addVariation("stonebricksmooth", GameRegistry.findBlock("Chisel-2", "tile.TFTowerStone"), 0, 0);
}
},
@@ -2474,11 +2477,12 @@ public enum Features {
technical4.carverHelper.addVariation("tile.technical4.1.desc", 1, "technical/new/weatheredOrangePanels");
technical4.carverHelper.addVariation("tile.technical4.2.desc", 2, "technical/new/Sturdy");
technical4.carverHelper.addVariation("tile.technical4.3.desc", 3, "technical/new/MegaCell");
technical4.carverHelper.addVariation("tile.technical4.4.desc", 4, "technical/new/ExhaustPlating"/*, new SubmapManagerCombinedCTM(4, "technical/new/test/ExhaustPlating", TextureType.R4)*/);
technical4.carverHelper
.addVariation("tile.technical4.4.desc", 4, "technical/new/ExhaustPlating"/* , new SubmapManagerCombinedCTM(4, "technical/new/test/ExhaustPlating", TextureType.R4) */);
technical4.carverHelper.addVariation("tile.technical4.5.desc", 5, "technical/new/MakeshiftPanels");
technical4.carverHelper.addVariation("tile.technical4.6.desc", 6, "technical/new/Piping");
//The animation is malfunctioning. :(
//technical4.carverHelper.addVariation("tile.technical4.7.desc", 7, "technical/new/TapeDrive");
// The animation is malfunctioning. :(
// technical4.carverHelper.addVariation("tile.technical4.7.desc", 7, "technical/new/TapeDrive");
technical4.carverHelper.registerBlock(technical4, "technical4");
technical4.carverHelper.registerVariations("technical");
@@ -2489,8 +2493,10 @@ public enum Features {
void addRecipes() {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.technical, Configurations.factoryBlockAmount, 0), new Object[] { "xyx", "yxy", "xyx", 'x', "stone", 'y',
Items.iron_ingot }));
/*GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.technical2, Configurations.factoryBlockAmount, 0), new Object[] { "xyx", "yzy", "xyx", 'x', "stone", 'y',
"ingotIron", 'z', Blocks.glass })); //*/
/*
* GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.technical2, Configurations.factoryBlockAmount, 0), new Object[] { "xyx", "yzy", "xyx", 'x', "stone", 'y',
* "ingotIron", 'z', Blocks.glass })); //
*/
}
},
@@ -2753,8 +2759,7 @@ public enum Features {
voidstone.carverHelper.registerAll(voidstone, "voidstone");
Carving.chisel.registerOre("voidstone", "voidstone");
BlockCarvable voidstone2 = (BlockCarvable) new BlockCarvable().setStepSound(Block.soundTypeStone)
.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F);
BlockCarvable voidstone2 = (BlockCarvable) new BlockCarvable().setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F);
voidstone2.carverHelper.addVariation("tile.voidstone.0.desc", 0, new SubmapManagerVoidstone("voidstone/animated/raw", 0));
voidstone2.carverHelper.addVariation("tile.voidstone.1.desc", 1, new SubmapManagerVoidstone("voidstone/animated/quarters", 1));
voidstone2.carverHelper.addVariation("tile.voidstone.2.desc", 2, new SubmapManagerVoidstone("voidstone/animated/smooth", 2));
@@ -2769,7 +2774,6 @@ public enum Features {
BlockCarvable voidstonerunic = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F);
for (int i = 1; i < 16; i++)
voidstonerunic.carverHelper.addVariation("tile.voidstoneRunic." + sGNames[i].replaceAll(" ", "").toLowerCase() + ".desc", i, "voidstone/runes/rune" + sGNames[i].replaceAll(" ", ""));
voidstonerunic.carverHelper.registerAll(voidstonerunic, "voidstoneRunic");
@@ -2904,7 +2908,6 @@ public enum Features {
void addBlocks() {
BlockCarvable woolen_clay = (BlockCarvable) new BlockCarvable(Material.clay).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(2F).setResistance(10F);
for (int i = 0; i < 16; i++)
woolen_clay.carverHelper.addVariation("tile.woolenClay." + i + ".desc", i, "woolenClay/" + sGNames[i].replaceAll(" ", "").toLowerCase());
woolen_clay.carverHelper.registerAll(woolen_clay, "woolen_clay");
@@ -3,5 +3,5 @@ package com.cricketcraft.chisel.api;
public class ChiselAPIProps {
public static final String VERSION = "0.1.0";
public static String MOD_ID = null; // Set by Chisel
public static String MOD_ID = null; // Set by Chisel
}
@@ -1,18 +1,16 @@
package com.cricketcraft.chisel.api;
import com.cricketcraft.chisel.api.carving.IChiselMode;
import net.minecraft.item.ItemStack;
import com.cricketcraft.chisel.api.carving.IChiselMode;
/**
* Implement this on chisel items which require more control over chisel modes
* (including adding new modes).
* Implement this on chisel items which require more control over chisel modes (including adding new modes).
*/
public interface IAdvancedChisel {
/**
* Gets the next mode the button in the GUI should switch to given the
* current mode.
* Gets the next mode the button in the GUI should switch to given the current mode.
*
* @param stack
* The {@link ItemStack} representing the chisel
@@ -1,6 +1,5 @@
package com.cricketcraft.chisel.api;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import com.cricketcraft.chisel.api.carving.CarvableHelper;
@@ -32,6 +31,7 @@ public interface ICarvable extends ICTMBlock<IVariationInfo> {
* The metadata of the block
* @return The {@link ISubmapManager} that represents this block in the world.
*/
@Override
public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata);
/**
@@ -39,5 +39,6 @@ public interface ICarvable extends ICTMBlock<IVariationInfo> {
*
* @return A {@link ISubmapManager}
*/
@Override
public IVariationInfo getManager(int meta);
}
@@ -5,36 +5,45 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
/**
* To be implemented on blocks that "hide" another block inside, so connected textuers can still be
* accomplished.
* To be implemented on blocks that "hide" another block inside, so connected textuers can still be accomplished.
*/
public interface IFacade
{
/**
* Gets the block this facade is acting as.
*
* @param world {@link World}
* @param x X coord of your block
* @param y Y coord of your block
* @param z Z coord of your block
* @param side The side being rendered, NOT the side being connected from.
* <p>
* This value can be -1 if no side is specified. Please handle this appropriately.
* @return The block inside of your facade block.
*/
Block getFacade(IBlockAccess world, int x, int y, int z, int side);
public interface IFacade {
/**
* Gets the metadata of the block that this facade is acting as.
*
* @param world {@link World}
* @param x X coord of your block
* @param y Y coord of your block
* @param z Z coord of your block
* @param side The side being rendered, NOT the side being connected from.
* <p>
* This value can be -1 if no side is specified. Please handle this appropriately.
* @return The metadata of your facade block.
*/
int getFacadeMetadata(IBlockAccess world, int x, int y, int z, int side);
/**
* Gets the block this facade is acting as.
*
* @param world
* {@link World}
* @param x
* X coord of your block
* @param y
* Y coord of your block
* @param z
* Z coord of your block
* @param side
* The side being rendered, NOT the side being connected from.
* <p>
* This value can be -1 if no side is specified. Please handle this appropriately.
* @return The block inside of your facade block.
*/
Block getFacade(IBlockAccess world, int x, int y, int z, int side);
/**
* Gets the metadata of the block that this facade is acting as.
*
* @param world
* {@link World}
* @param x
* X coord of your block
* @param y
* Y coord of your block
* @param z
* Z coord of your block
* @param side
* The side being rendered, NOT the side being connected from.
* <p>
* This value can be -1 if no side is specified. Please handle this appropriately.
* @return The metadata of your facade block.
*/
int getFacadeMetadata(IBlockAccess world, int x, int y, int z, int side);
}
@@ -6,10 +6,10 @@ import net.minecraft.util.ChatComponentTranslation;
public class Statistics {
public static StatBase blocksChiseled = (new StatBasic("stat.blockChiseled", new ChatComponentTranslation("stat.blockChiseled", new Object[0])));
public static StatBase blocksChiseled = (new StatBasic("stat.blockChiseled", new ChatComponentTranslation("stat.blockChiseled", new Object[0])));
public static void init(){
blocksChiseled.initIndependentStat();
blocksChiseled.registerStat();
}
public static void init() {
blocksChiseled.initIndependentStat();
blocksChiseled.registerStat();
}
}
@@ -26,42 +26,42 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class CarvableHelper {
public static Class<? extends ItemBlock> itemCarvableClass = null;
private Block theBlock;
public ArrayList<IVariationInfo> infoList = new ArrayList<IVariationInfo>();
IVariationInfo[] infoMap = new IVariationInfo[16];
public boolean forbidChiseling = false;
public CarvableHelper(Block block) {
this.theBlock = block;
}
public void addVariation(String description, int metadata, ISubmapManager manager) {
addVariation(description, metadata, null, manager);
}
public void addVariation(String description, int metadata, Block bb) {
addVariation(description, metadata, null, bb, 0, ChiselAPIProps.MOD_ID);
}
public void addVariation(String description, int metadata, ISubmapManager manager) {
addVariation(description, metadata, null, manager);
}
public void addVariation(String description, int metadata, Block bb, int blockMeta) {
addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID);
}
public void addVariation(String description, int metadata, Block bb) {
addVariation(description, metadata, null, bb, 0, ChiselAPIProps.MOD_ID);
}
public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material) {
addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID);
}
public void addVariation(String description, int metadata, Block bb, int blockMeta) {
addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID);
}
public void addVariation(String description, int metadata, String texture) {
addVariation(description, metadata, texture, (ISubmapManager) null);
}
public void addVariation(String description, int metadata, String texture, ISubmapManager manager) {
addVariation(description, metadata, texture, null, 0, ChiselAPIProps.MOD_ID, manager, metadata);
}
public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material) {
addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID);
}
public void addVariation(String description, int metadata, String texture) {
addVariation(description, metadata, texture, (ISubmapManager) null);
}
public void addVariation(String description, int metadata, String texture, ISubmapManager manager) {
addVariation(description, metadata, texture, null, 0, ChiselAPIProps.MOD_ID, manager, metadata);
}
public void addVariation(String description, int metadata, Block bb, String modid) {
addVariation(description, metadata, null, bb, 0, modid);
@@ -92,9 +92,8 @@ public class CarvableHelper {
if (infoList.size() >= 16)
return;
IVariationInfo info = FMLCommonHandler.instance().getSide().isClient()
? getClientInfo(modid, texture, description, metadata, block, blockMeta, customManager, order)
: getServerInfo(modid, texture, description, metadata, block, blockMeta, customManager, order);
IVariationInfo info = FMLCommonHandler.instance().getSide().isClient() ? getClientInfo(modid, texture, description, metadata, block, blockMeta, customManager, order) : getServerInfo(modid,
texture, description, metadata, block, blockMeta, customManager, order);
infoList.add(info);
infoMap[metadata] = info;
@@ -106,7 +105,7 @@ public class CarvableHelper {
if (type == TextureType.CUSTOM && customManager == null && block == null) {
throw new IllegalArgumentException(String.format("Could not find texture %s, and no custom texture manager was provided.", texture));
}
ISubmapManager manager;
if (customManager != null) {
manager = customManager;
@@ -117,7 +116,7 @@ public class CarvableHelper {
}
return new VariationInfoBase(var, description, manager);
}
private IVariationInfo getServerInfo(String modid, String texture, String description, int metadata, Block block, int blockMeta, ISubmapManager customManager, int order) {
ICarvingVariation var = CarvingUtils.getDefaultVariationFor(theBlock, metadata, order);
return new VariationInfoBase(var, description, null);
@@ -141,7 +140,7 @@ public class CarvableHelper {
IVariationInfo info = infoMap[metadata];
if (info == null)
return getMissingIcon();
return info.getIcon(side, metadata);
}
@@ -119,6 +119,7 @@ public class CarvingUtils {
this.name = name;
}
@Override
public List<ICarvingVariation> getVariations() {
return Lists.newArrayList(variations);
}
@@ -8,6 +8,6 @@ public interface IVariationInfo extends ISubmapManager {
ICarvingVariation getVariation();
String getDescription();
TextureType getType();
}
@@ -1,8 +1,7 @@
package com.cricketcraft.chisel.api.rendering;
public class ClientUtils {
public static int renderCTMId;
}
@@ -71,6 +71,7 @@ public class BlockCarvable extends Block implements ICarvable {
carverHelper.registerBlockIcons(Chisel.MOD_ID, this, register);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
carverHelper.registerSubBlocks(this, tabs, list);
@@ -14,6 +14,6 @@ public class BlockCarvableAntiBlock extends BlockCarvableColor implements ICarva
@Override
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
return false;
return false;
}
}
@@ -17,58 +17,58 @@ import com.cricketcraft.chisel.init.ChiselTabs;
public class BlockCarvableBeacon extends BlockBeacon implements ICarvable {
public static int renderId;
public CarvableHelper carverHelper;
public BlockCarvableBeacon() {
super();
setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
setLightLevel(5.0F);
setBlockTextureName("beacon");
carverHelper = new CarvableHelper(this);
}
public CarvableHelper carverHelper;
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityCarvableBeacon();
}
public BlockCarvableBeacon() {
super();
setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
setLightLevel(5.0F);
setBlockTextureName("beacon");
carverHelper = new CarvableHelper(this);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par5, float hitX, float hitY, float hitZ) {
if (world.isRemote) {
return true;
} else {
TileEntityCarvableBeacon tileentitybeacon = (TileEntityCarvableBeacon) world.getTileEntity(x, y, z);
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityCarvableBeacon();
}
if (tileentitybeacon != null) {
player.func_146104_a(tileentitybeacon);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par5, float hitX, float hitY, float hitZ) {
if (world.isRemote) {
return true;
} else {
TileEntityCarvableBeacon tileentitybeacon = (TileEntityCarvableBeacon) world.getTileEntity(x, y, z);
return true;
}
}
if (tileentitybeacon != null) {
player.func_146104_a(tileentitybeacon);
}
@Override
public int getRenderType() {
return renderId;
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
super.onBlockPlacedBy(world, x, y, z, player, stack);
return true;
}
}
if (stack.hasDisplayName()) {
((TileEntityCarvableBeacon) world.getTileEntity(x, y, z)).func_145999_a(stack.getDisplayName());
}
}
@Override
public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) {
return carverHelper.getVariation(metadata);
}
@Override
public int getRenderType() {
return renderId;
}
@Override
public IVariationInfo getManager(int meta) {
return carverHelper.getVariation(meta);
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
super.onBlockPlacedBy(world, x, y, z, player, stack);
if (stack.hasDisplayName()) {
((TileEntityCarvableBeacon) world.getTileEntity(x, y, z)).func_145999_a(stack.getDisplayName());
}
}
@Override
public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata) {
return carverHelper.getVariation(metadata);
}
@Override
public IVariationInfo getManager(int meta) {
return carverHelper.getVariation(meta);
}
}
@@ -44,7 +44,7 @@ public class BlockCarvableBookshelf extends BlockCarvable {
return Items.book;
}
@Override
@Override
public int damageDropped(int damage) {
return 0;
}
@@ -43,11 +43,12 @@ public class BlockCarvableCarpet extends BlockCarpet implements ICarvable {
carverHelper.registerBlockIcons("Chisel", this, register);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
carverHelper.registerSubBlocks(this, tabs, list);
}
@Override
public int getRenderType() {
return ClientUtils.renderCTMId;
@@ -6,21 +6,21 @@ import net.minecraftforge.common.util.ForgeDirection;
public class BlockCarvableColor extends BlockCarvable {
public BlockCarvableColor() {
this(Material.rock);
}
public BlockCarvableColor() {
this(Material.rock);
}
public BlockCarvableColor(Material m) {
super(m);
}
public BlockCarvableColor(Material m) {
super(m);
}
@Override
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int color) {
int newColor = 15 - color;
if (world.getBlockMetadata(x, y, z) != newColor) {
world.setBlockMetadataWithNotify(x, y, z, newColor, 3);
return true;
}
return false;
}
@Override
public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int color) {
int newColor = 15 - color;
if (world.getBlockMetadata(x, y, z) != newColor) {
world.setBlockMetadataWithNotify(x, y, z, newColor, 3);
return true;
}
return false;
}
}
@@ -66,6 +66,7 @@ public class BlockCarvableGlass extends BlockGlass implements ICarvable {
carverHelper.registerBlockIcons("Chisel", this, register);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
carverHelper.registerSubBlocks(this, tabs, list);
@@ -1,11 +1,11 @@
package com.cricketcraft.chisel.block;
import com.cricketcraft.chisel.client.render.SubmapManagerBase;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.client.render.SubmapManagerBase;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -29,7 +29,7 @@ public class BlockCarvableGlow extends BlockCarvableColor {
this.glowTexturePath = glowTexture;
}
public BlockCarvableGlow(Material material, String glowTexture, SubmapManagerBase submapManagerBase){
public BlockCarvableGlow(Material material, String glowTexture, SubmapManagerBase submapManagerBase) {
super(material);
this.glowTexturePath = glowTexture;
this.submapManagerBase = submapManagerBase;
@@ -41,11 +41,11 @@ public class BlockCarvableGlow extends BlockCarvableColor {
glowTexture = register.registerIcon(Chisel.MOD_ID + ":" + glowTexturePath);
}
public boolean hasSubmapManager(){
public boolean hasSubmapManager() {
return submapManagerBase == null;
}
public SubmapManagerBase getSubmapManager(){
public SubmapManagerBase getSubmapManager() {
return hasSubmapManager() ? submapManagerBase : null;
}
@@ -32,11 +32,11 @@ public class BlockCarvableGlowstone extends BlockCarvable {
public int damageDropped(int i) {
return 0;
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
{
Block glowstone = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
return new ItemStack(Item.getItemFromBlock(glowstone), 1, meta);
}
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
Block glowstone = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
return new ItemStack(Item.getItemFromBlock(glowstone), 1, meta);
}
}
@@ -26,7 +26,7 @@ public class BlockCarvableIce extends BlockIce implements ICarvable {
super();
carverHelper = new CarvableHelper(this);
}
@Override
public int getRenderType() {
return ClientUtils.renderCTMId;
@@ -42,6 +42,7 @@ public class BlockCarvableIce extends BlockIce implements ICarvable {
carverHelper.registerBlockIcons("Chisel", this, register);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
carverHelper.registerSubBlocks(this, tabs, list);
@@ -63,12 +63,9 @@ public class BlockCarvableLamp extends BlockCarvable {
}
/*
* @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
@@ -10,6 +10,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockCarvableLayered extends BlockCarvable {
@SideOnly(Side.CLIENT)
private IIcon baseTexture;
private String baseTexLocation;
@@ -18,14 +19,17 @@ public class BlockCarvableLayered extends BlockCarvable {
super(mat);
this.baseTexLocation = baseTexLocation;
}
@Override
public void registerBlockIcons(IIconRegister register) {
super.registerBlockIcons(register);
baseTexture = register.registerIcon(Chisel.MOD_ID + ":" + baseTexLocation);
}
public IIcon getBaseTex() {
return baseTexture;
}
@Override
public int getRenderType() {
return Chisel.renderLayeredId;
@@ -34,7 +34,7 @@ public class BlockCarvablePackedIce extends Block implements ICarvable {
public int getRenderType() {
return ClientUtils.renderCTMId;
}
@Override
public IIcon getIcon(int side, int metadata) {
return carverHelper.getIcon(side, metadata);
@@ -50,6 +50,7 @@ public class BlockCarvablePackedIce extends Block implements ICarvable {
carverHelper.registerBlockIcons("Chisel", this, register);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
carverHelper.registerSubBlocks(this, tabs, list);
@@ -63,6 +63,7 @@ public class BlockCarvablePane extends BlockPane implements ICarvable {
carverHelper.registerBlockIcons("Chisel", this, register);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
carverHelper.registerSubBlocks(this, tabs, list);
@@ -10,8 +10,7 @@ public class BlockCarvablePowered extends BlockCarvable {
}
/**
* Can this block provide power. Only wire currently seems to have this
* change based on its state.
* Can this block provide power. Only wire currently seems to have this change based on its state.
*/
@Override
public boolean canProvidePower() {
@@ -19,11 +18,8 @@ public class BlockCarvablePowered extends BlockCarvable {
}
/**
* 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.
* 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) {
@@ -36,65 +36,65 @@ public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
carverHelper = new CarvableHelper(this);
}
@Override
public void onBlockAdded(World world, int x, int y, int z){
if(world.getBlock(x, y - 1, z) == Blocks.snow && world.getBlock(x, y - 2, z) == Blocks.snow){
if(!world.isRemote){
//Let's grab the pumpkin before we start
ItemStack pumpkin = new ItemStack(world.getBlock(x, y, z), world.getBlockMetadata(x, y, z));
@Override
public void onBlockAdded(World world, int x, int y, int z) {
if (world.getBlock(x, y - 1, z) == Blocks.snow && world.getBlock(x, y - 2, z) == Blocks.snow) {
if (!world.isRemote) {
// Let's grab the pumpkin before we start
ItemStack pumpkin = new ItemStack(world.getBlock(x, y, z), world.getBlockMetadata(x, y, z));
world.setBlock(x, y, z, Blocks.air, 0, 2);
world.setBlock(x, y - 1, z, Blocks.air, 0, 2);
world.setBlock(x, y - 2, z, Blocks.air, 0, 2);
EntityChiselSnowman snowman = new EntityChiselSnowman(world);
snowman.setCurrentItemOrArmor(2, pumpkin);
snowman.setLocationAndAngles((double) x + 0.5D, (double) y - 1.95D, (double) z + 0.5D, 0.0F, 0.0F);
world.spawnEntityInWorld(snowman);
world.notifyBlockChange(x, y, z, Blocks.air);
world.notifyBlockChange(x, y - 1, z, Blocks.air);
world.notifyBlockChange(x, y - 2, z, Blocks.air);
}
world.setBlock(x, y, z, Blocks.air, 0, 2);
world.setBlock(x, y - 1, z, Blocks.air, 0, 2);
world.setBlock(x, y - 2, z, Blocks.air, 0, 2);
EntityChiselSnowman snowman = new EntityChiselSnowman(world);
snowman.setCurrentItemOrArmor(2, pumpkin);
snowman.setLocationAndAngles(x + 0.5D, y - 1.95D, z + 0.5D, 0.0F, 0.0F);
world.spawnEntityInWorld(snowman);
world.notifyBlockChange(x, y, z, Blocks.air);
world.notifyBlockChange(x, y - 1, z, Blocks.air);
world.notifyBlockChange(x, y - 2, z, Blocks.air);
}
//Spawn some lovely particles
for(int c = 0; c < 120; ++c){
world.spawnParticle("snowshovel", (double)x + world.rand.nextDouble(), (double) (y - 2) + world.rand.nextDouble() * 2.5D, (double) z + world.rand.nextDouble(), 0.0D, 0.0D, 0.0D);
}
} else if(world.getBlock(x, y - 1, z) == Blocks.iron_block || world.getBlock(x, y - 2, z) == Blocks.iron_block){
boolean flag = world.getBlock(x - 1, y - 1, z) == Blocks.iron_block && world.getBlock(x + 1, y - 1, z) == Blocks.iron_block;
boolean flag1 = world.getBlock(x, y - 1, z - 1) == Blocks.iron_block && world.getBlock(x, y - 1, z + 1) == Blocks.iron_block;
// Spawn some lovely particles
for (int c = 0; c < 120; ++c) {
world.spawnParticle("snowshovel", x + world.rand.nextDouble(), y - 2 + world.rand.nextDouble() * 2.5D, z + world.rand.nextDouble(), 0.0D, 0.0D, 0.0D);
}
} else if (world.getBlock(x, y - 1, z) == Blocks.iron_block || world.getBlock(x, y - 2, z) == Blocks.iron_block) {
boolean flag = world.getBlock(x - 1, y - 1, z) == Blocks.iron_block && world.getBlock(x + 1, y - 1, z) == Blocks.iron_block;
boolean flag1 = world.getBlock(x, y - 1, z - 1) == Blocks.iron_block && world.getBlock(x, y - 1, z + 1) == Blocks.iron_block;
if(flag || flag1){
world.setBlock(x, y, z, Blocks.air, 0, 2);
world.setBlock(x, y - 1, z, Blocks.air, 0, 2);
world.setBlock(x, y - 2, z, Blocks.air, 0, 2);
if (flag || flag1) {
world.setBlock(x, y, z, Blocks.air, 0, 2);
world.setBlock(x, y - 1, z, Blocks.air, 0, 2);
world.setBlock(x, y - 2, z, Blocks.air, 0, 2);
if(flag){
world.setBlock(x - 1, y - 1, z, Blocks.air, 0, 2);
world.setBlock(x + 1, y - 1, z, Blocks.air, 0, 2);
} else {
world.setBlock(x, y - 1, z - 1, Blocks.air, 0, 2);
world.setBlock(x, y - 1, z + 1, Blocks.air, 0, 2);
}
if (flag) {
world.setBlock(x - 1, y - 1, z, Blocks.air, 0, 2);
world.setBlock(x + 1, y - 1, z, Blocks.air, 0, 2);
} else {
world.setBlock(x, y - 1, z - 1, Blocks.air, 0, 2);
world.setBlock(x, y - 1, z + 1, Blocks.air, 0, 2);
}
EntityIronGolem ironGolem = new EntityIronGolem(world);
ironGolem.setPlayerCreated(true);
ironGolem.setLocationAndAngles((double) x + 0.5D, (double) y - 1.95D, (double) z + 0.5D, 0.0F, 0.0F);
world.spawnEntityInWorld(ironGolem);
EntityIronGolem ironGolem = new EntityIronGolem(world);
ironGolem.setPlayerCreated(true);
ironGolem.setLocationAndAngles(x + 0.5D, y - 1.95D, z + 0.5D, 0.0F, 0.0F);
world.spawnEntityInWorld(ironGolem);
world.notifyBlockChange(x, y, z, Blocks.air);
world.notifyBlockChange(x, y - 1, z, Blocks.air);
world.notifyBlockChange(x, y - 2, z, Blocks.air);
world.notifyBlockChange(x, y, z, Blocks.air);
world.notifyBlockChange(x, y - 1, z, Blocks.air);
world.notifyBlockChange(x, y - 2, z, Blocks.air);
if(flag){
world.notifyBlockChange(x - 1, y - 1, z, Blocks.air);
world.notifyBlockChange(x + 1, y - 1, z, Blocks.air);
} else {
world.notifyBlockChange(x, y - 1, z - 1, Blocks.air);
world.notifyBlockChange(x, y - 1, z + 1, Blocks.air);
}
}
}
}
if (flag) {
world.notifyBlockChange(x - 1, y - 1, z, Blocks.air);
world.notifyBlockChange(x + 1, y - 1, z, Blocks.air);
} else {
world.notifyBlockChange(x, y - 1, z - 1, Blocks.air);
world.notifyBlockChange(x, y - 1, z + 1, Blocks.air);
}
}
}
}
@Override
@SideOnly(Side.CLIENT)
@@ -62,6 +62,7 @@ public class BlockCarvableSand extends BlockSand implements ICarvable {
carverHelper.registerBlockIcons("Chisel", this, register);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
carverHelper.registerSubBlocks(this, tabs, list);
@@ -16,7 +16,6 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import static net.minecraftforge.common.util.ForgeDirection.UP;
public class BlockCarvableSlab extends BlockCarvable {
@@ -63,6 +62,7 @@ public class BlockCarvableSlab extends BlockCarvable {
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}
@SuppressWarnings("rawtypes")
@Override
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) {
setBlockBoundsBasedOnState(par1World, par2, par3, par4);
@@ -101,25 +101,31 @@ public class BlockCarvableSlab extends BlockCarvable {
// return master.getIcon(side, metadata);
}
@SuppressWarnings("rawtypes")
@Override
public void getSubBlocks(Item block, CreativeTabs tabs, List list) {
if (isBottom)
super.getSubBlocks(block, tabs, list);
}
/**
* Checks if the block is a solid face on the given side, used by placement logic.
*
* @param world The current world
* @param x X Position
* @param y Y position
* @param z Z position
* @param side The side to check
* @return True if the block is solid on the specified side.
*/
* Checks if the block is a solid face on the given side, used by placement logic.
*
* @param world
* The current world
* @param x
* X Position
* @param y
* Y position
* @param z
* Z position
* @param side
* The side to check
* @return True if the block is solid on the specified side.
*/
@Override
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side)
{
return !isBottom && (side == UP);
}
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
return !isBottom && (side == UP);
}
}
@@ -72,7 +72,7 @@ public class BlockCarvableStairs extends BlockStairs implements ICarvable {
if (par6ItemStack.getItemDamage() >= 8) {
meta += 8;
}
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta, 2);
}
@@ -47,19 +47,20 @@ public class BlockCarvableTorch extends BlockTorch implements ICarvable {
public void registerBlockIcons(IIconRegister icon) {
this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":torch/" + texLocation);
}
public BlockCarvableTorch disableParticles() {
this.emitsParticles = false;
return this;
}
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) {
if (emitsParticles) {
int l = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_);
double d0 = (double) ((float) p_149734_2_ + 0.5F);
double d1 = (double) ((float) p_149734_3_ + 0.7F);
double d2 = (double) ((float) p_149734_4_ + 0.5F);
double d0 = p_149734_2_ + 0.5F;
double d1 = p_149734_3_ + 0.7F;
double d2 = p_149734_4_ + 0.5F;
double d3 = 0.2199999988079071D;
double d4 = 0.27000001072883606D;
@@ -36,6 +36,7 @@ public class BlockCarvableWall extends BlockWall {
carverHelper.registerBlockIcons("Chisel", this, register);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubBlocks(Item block, CreativeTabs tabs, List list) {
carverHelper.registerSubBlocks(this, tabs, list);
@@ -43,6 +43,7 @@ public class BlockCloud extends BlockCarvable {
return Configurations.ghostCloud ? 1 : 0;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
Block block = world.getBlock(x, y, z);
@@ -18,10 +18,10 @@ public class BlockConcrete extends BlockCarvable {
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
if(Configurations.fullBlockConcrete)
if (Configurations.fullBlockConcrete)
return AxisAlignedBB.getBoundingBox(par2, par3, par4, (par2 + 1), ((par3 + 1)), (par4 + 1));
else
return AxisAlignedBB.getBoundingBox(par2, par3, par4, (par2 + 1), ((par3 + 1) - 0.125F), (par4 + 1));
return AxisAlignedBB.getBoundingBox(par2, par3, par4, (par2 + 1), ((par3 + 1) - 0.125F), (par4 + 1));
}
@Override
@@ -47,6 +47,7 @@ public class BlockMultiLayer extends BlockMultiLayerBase implements ICarvable {
carverHelper.registerBlockIcons("Chisel", this, register);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubBlocks(Item block, CreativeTabs tabs, List list) {
carverHelper.registerSubBlocks(this, tabs, list);
@@ -118,16 +118,18 @@ public class BlockPresent extends Block implements ICarvable {
@Override
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
if(world.getTileEntity(x, y, z) instanceof TileEntityPresent)
return getBoundingBox((TileEntityPresent) world.getTileEntity(x, y, z));
else return null;
if (world.getTileEntity(x, y, z) instanceof TileEntityPresent)
return getBoundingBox((TileEntityPresent) world.getTileEntity(x, y, z));
else
return null;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
if(world.getTileEntity(x, y, z) instanceof TileEntityPresent)
return getBoundingBox((TileEntityPresent) world.getTileEntity(x, y, z));
else return null;
if (world.getTileEntity(x, y, z) instanceof TileEntityPresent)
return getBoundingBox((TileEntityPresent) world.getTileEntity(x, y, z));
else
return null;
}
public AxisAlignedBB getBoundingBox(TileEntityPresent me) {
@@ -147,8 +149,8 @@ public class BlockPresent extends Block implements ICarvable {
return AxisAlignedBB.getBoundingBox(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ);
}
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
{
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
TileEntityPresent te = (TileEntityPresent) world.getTileEntity(x, y, z);
if (!te.isConnected()) {
setBlockBounds(0.0625F, 0, 0.0625F, 0.9375F, 0.875F, 0.9365F);
@@ -211,7 +211,6 @@ public class BlockSnakestone extends Block {
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;
@@ -288,8 +287,6 @@ public class BlockSnakestone extends Block {
@Override
public IIcon getIcon(int side, int meta) {
int type = meta & 0xc;
int orient = meta & 0x3;
switch (meta | (side << 4)) {
@@ -506,6 +503,7 @@ public class BlockSnakestone extends Block {
return iconCross;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
list.add(new ItemStack(item, 1, 1));
@@ -1,11 +1,11 @@
package com.cricketcraft.chisel.block;
import com.cricketcraft.chisel.init.ChiselTabs;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import com.cricketcraft.chisel.api.carving.CarvableHelper;
import com.cricketcraft.chisel.api.carving.IVariationInfo;
import com.cricketcraft.chisel.init.ChiselTabs;
import com.cricketcraft.chisel.item.ItemCarvable;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -1,14 +1,15 @@
package com.cricketcraft.chisel.block.tileentity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.tileentity.TileEntityBeacon;
import net.minecraft.util.AxisAlignedBB;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TileEntityCarvableBeacon extends TileEntityBeacon {
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox() {
return INFINITE_EXTENT_AABB;
}
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox() {
return INFINITE_EXTENT_AABB;
}
}
@@ -34,7 +34,7 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
if (!isConnected() && autoSearch && worldObj != null /* ugh */) {
if (cachedDir != null) {
connectTo(cachedDir);
} else if (!worldObj.isRemote){
} else if (!worldObj.isRemote) {
findConnections();
}
autoSearch = false;
@@ -46,7 +46,8 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
}
private boolean connectTo(TileEntityPresent present, ForgeDirection dir) {
if (present.getBlockMetadata() == getBlockMetadata() && !present.isConnected() && (present.cachedDir == null || present.cachedDir == dir.getOpposite()) && Math.abs(present.xCoord - xCoord + present.yCoord - yCoord + present.zCoord - zCoord) == 1) {
if (present.getBlockMetadata() == getBlockMetadata() && !present.isConnected() && (present.cachedDir == null || present.cachedDir == dir.getOpposite())
&& Math.abs(present.xCoord - xCoord + present.yCoord - yCoord + present.zCoord - zCoord) == 1) {
connection = present;
connection.connection = this;
connection.cachedDir = dir.getOpposite();
@@ -71,9 +72,7 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
/**
* @param preserveDir
* If true, this is only a virtual disconnect, meaning the other
* chest still exists, but is still loaded, so maintain a
* cachedDir for reconnection upon chunk load.
* If true, this is only a virtual disconnect, meaning the other chest still exists, but is still loaded, so maintain a cachedDir for reconnection upon chunk load.
*/
public void disconnect(boolean preserveDir) {
if (isConnected()) {
@@ -22,12 +22,13 @@ public class Carving implements ICarvingRegistry {
public static final ICarvingRegistry chisel = new Carving();
public static final Carving needle = new Carving();
static {
CarvingUtils.chisel = chisel;
}
public static void construct() {}
public static void construct() {
}
private Carving() {
}
@@ -142,7 +143,7 @@ public class Carving implements ICarvingRegistry {
ICarvingGroup g = groups.getGroupByName(groupName);
return groups.remove(g) ? g : null;
}
@Override
public ICarvingVariation removeVariation(Block block, int metadata) {
return removeVariation(block, metadata, null);
@@ -1,6 +1,5 @@
package com.cricketcraft.chisel.client.render;
import com.cricketcraft.chisel.entity.EntityChiselSnowman;
import net.minecraft.block.Block;
import net.minecraft.client.model.ModelSnowMan;
import net.minecraft.client.renderer.RenderBlocks;
@@ -12,54 +11,58 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*;
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*;
import org.lwjgl.opengl.GL11;
public class RenderChiselSnowman extends RenderLiving{
import com.cricketcraft.chisel.entity.EntityChiselSnowman;
private static final ResourceLocation snowManTextures = new ResourceLocation("textures/entity/snowman.png");
private ModelSnowMan snowMan;
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED;
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;
public RenderChiselSnowman() {
super(new ModelSnowMan(), 0.5F);
snowMan = (ModelSnowMan)super.mainModel;
setRenderPassModel(this.snowMan);
}
public class RenderChiselSnowman extends RenderLiving {
@Override
protected void renderEquippedItems(EntityLivingBase entityLivingBase, float size){
this.renderEquippedItems((EntityChiselSnowman) entityLivingBase, size);
}
private static final ResourceLocation snowManTextures = new ResourceLocation("textures/entity/snowman.png");
private ModelSnowMan snowMan;
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return this.getEntityTexture((EntityChiselSnowman) entity);
}
public RenderChiselSnowman() {
super(new ModelSnowMan(), 0.5F);
snowMan = (ModelSnowMan) super.mainModel;
setRenderPassModel(this.snowMan);
}
protected ResourceLocation getEntityTexture(EntityChiselSnowman snowman){
return snowManTextures;
}
@Override
protected void renderEquippedItems(EntityLivingBase entityLivingBase, float size) {
this.renderEquippedItems((EntityChiselSnowman) entityLivingBase, size);
}
protected void renderEquippedItems(EntityChiselSnowman snowman, float size){
super.renderEquippedItems(snowman, size);
ItemStack itemStack = snowman.getEquipmentInSlot(2);
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return this.getEntityTexture((EntityChiselSnowman) entity);
}
if(itemStack.getItem() instanceof ItemBlock){
GL11.glPushMatrix();
this.snowMan.head.postRender(0.0625F);
protected ResourceLocation getEntityTexture(EntityChiselSnowman snowman) {
return snowManTextures;
}
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, EQUIPPED);
boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemStack, BLOCK_3D));
protected void renderEquippedItems(EntityChiselSnowman snowman, float size) {
super.renderEquippedItems(snowman, size);
ItemStack itemStack = snowman.getEquipmentInSlot(2);
if(is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemStack.getItem()).getRenderType())){
float f1 = 0.625F;
GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glScalef(f1, -f1, f1);
}
this.renderManager.itemRenderer.renderItem(snowman, itemStack, 0);
GL11.glPopMatrix();
}
}
if (itemStack.getItem() instanceof ItemBlock) {
GL11.glPushMatrix();
this.snowMan.head.postRender(0.0625F);
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, EQUIPPED);
boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemStack, BLOCK_3D));
if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemStack.getItem()).getRenderType())) {
float f1 = 0.625F;
GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glScalef(f1, -f1, f1);
}
this.renderManager.itemRenderer.renderItem(snowman, itemStack, 0);
GL11.glPopMatrix();
}
}
}
@@ -33,24 +33,17 @@ public class RendererEldritch implements ISimpleBlockRenderingHandler {
// tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x,
// y, z));
/*
* double d0 = 0.4000000059604645D; double d1 = 0.5D - d0; double d2 =
* 0.20000000298023224D;
* 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);
* 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);
* 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);
*
*
*
@@ -63,13 +56,9 @@ public class RendererEldritch implements ISimpleBlockRenderingHandler {
*
*
*
* 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(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);
* 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;
@@ -27,7 +27,7 @@ public class RendererLayeredGlow implements ISimpleBlockRenderingHandler {
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
GeneralClient.setGLColorFromInt(Configurations.configColors[metadata]);
GL11.glDisable(GL11.GL_LIGHTING);
Drawing.drawBlock(block, ((BlockCarvableGlow)block).getGlowTexture(), renderer);
Drawing.drawBlock(block, ((BlockCarvableGlow) block).getGlowTexture(), renderer);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glColor3f(1, 1, 1);
Drawing.drawBlock(block, metadata, renderer);
@@ -42,7 +42,7 @@ public class RendererLayeredGlow implements ISimpleBlockRenderingHandler {
renderer.renderStandardBlock(block, x, y, z);
return true;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
@@ -1,15 +1,17 @@
package com.cricketcraft.chisel.client.render;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.init.Blocks;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.MinecraftForgeClient;
import com.cricketcraft.chisel.block.BlockMultiLayerBase;
import com.cricketcraft.ctmlib.Drawing;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.init.Blocks;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.MinecraftForgeClient;
import static org.lwjgl.opengl.GL11.*;
public class RendererMultiLayer implements ISimpleBlockRenderingHandler {
@@ -35,7 +37,7 @@ public class RendererMultiLayer implements ISimpleBlockRenderingHandler {
} else if (block.base != null) {
renderer.renderBlockAsItem(block.base, meta, 1.0f);
}
glPushMatrix();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -23,7 +23,7 @@ public class RendererSimpleLayered implements ISimpleBlockRenderingHandler {
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
GL11.glDisable(GL11.GL_LIGHTING);
Drawing.drawBlock(block, ((BlockCarvableLayered)block).getBaseTex(), renderer);
Drawing.drawBlock(block, ((BlockCarvableLayered) block).getBaseTex(), renderer);
GL11.glEnable(GL11.GL_LIGHTING);
Drawing.drawBlock(block, metadata, renderer);
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
@@ -32,7 +32,7 @@ public class SubmapManagerAntiblock extends SubmapManagerBase {
@SideOnly(Side.CLIENT)
private static RenderBlocksCTMFullbright rb;
private String color;
private TextureSubmap submap, submapSmall;
@@ -11,14 +11,13 @@ import com.cricketcraft.ctmlib.ISubmapManager;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public abstract class SubmapManagerBase implements ISubmapManager {
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
return getIcon(side, world.getBlockMetadata(x, y, z));
}
@Override
@SideOnly(Side.CLIENT)
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
@@ -59,7 +59,7 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
setIcons(rType, x, y, z, ForgeDirection.SOUTH);
super.renderFaceZPos(block, x, y, z, submapSmall.getSubIcon(0, 0));
}
private void setIcons(TextureType type, double x, double y, double z, ForgeDirection side) {
int ix = MathHelper.floor_double(x);
int iy = MathHelper.floor_double(y);
@@ -73,7 +73,7 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
}
}
}
private class Submap extends TextureSubmap {
private TextureSubmap[][] submap;
@@ -105,9 +105,7 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
private TextureType rType;
public SubmapManagerCombinedCTM(int meta, String texturePath, TextureType rType) {
assert rType == TextureType.R16 || rType == TextureType.R9 || rType == TextureType.R4 ||
rType == TextureType.V4 || rType == TextureType.V9
: "Not a valid random type!";
assert rType == TextureType.R16 || rType == TextureType.R9 || rType == TextureType.R4 || rType == TextureType.V4 || rType == TextureType.V9 : "Not a valid random type!";
this.meta = meta;
this.texturePath = texturePath;
@@ -1,33 +1,33 @@
package com.cricketcraft.chisel.client.render;
import com.cricketcraft.chisel.Chisel;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.init.ChiselBlocks;
import com.cricketcraft.ctmlib.CTM;
import com.cricketcraft.ctmlib.TextureSubmap;
import com.google.common.base.Optional;
import static com.cricketcraft.ctmlib.Dir.*;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import static com.cricketcraft.ctmlib.Dir.*;
public class SubmapManagerFakeController extends SubmapManagerBase {
private TextureSubmap map;
private CTM ctm = CTM.getInstance();
private int meta;
private String texturePath;
private String texturePath;
public SubmapManagerFakeController(int meta, String texture) {
ctm.disableObscuredFaceCheck = Optional.of(true);
this.meta = meta;
texturePath = texture;
}
public SubmapManagerFakeController(int meta, String texture) {
ctm.disableObscuredFaceCheck = Optional.of(true);
this.meta = meta;
texturePath = texture;
}
public SubmapManagerFakeController(int meta) {
ctm.disableObscuredFaceCheck = Optional.of(true);
@@ -40,8 +40,7 @@ public class SubmapManagerFakeController extends SubmapManagerBase {
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
{
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
ctm.buildConnectionMap(world, x, y, z, side, ChiselBlocks.futura, meta);
if (ctm.connectedAnd(TOP, TOP_RIGHT, RIGHT, BOTTOM_RIGHT, BOTTOM, BOTTOM_LEFT, LEFT, TOP_LEFT)) {
@@ -59,15 +58,11 @@ public class SubmapManagerFakeController extends SubmapManagerBase {
@SideOnly(Side.CLIENT)
public void registerIcons(String modName, Block block, IIconRegister register) {
if (texturePath != null)
{
map = new TextureSubmap(register.registerIcon(modName + ":" + texturePath), 2, 2);
}
else
{
Chisel.logger.info("SubmapManagerFakeController was called on block " + block.getUnlocalizedName()
+ " without declaring texture, using a default texture instead.");
map = new TextureSubmap(register.registerIcon(modName + ":futura/WIP/controller"), 2, 2);
}
if (texturePath != null) {
map = new TextureSubmap(register.registerIcon(modName + ":" + texturePath), 2, 2);
} else {
Chisel.logger.info("SubmapManagerFakeController was called on block " + block.getUnlocalizedName() + " without declaring texture, using a default texture instead.");
map = new TextureSubmap(register.registerIcon(modName + ":futura/WIP/controller"), 2, 2);
}
}
}
@@ -58,7 +58,7 @@ public class SubmapManagerSlab implements ISubmapManager {
rb.submapSmall = submapSmall;
return rb;
}
private boolean hadOverride = false;
@Override
@@ -22,7 +22,7 @@ public class SubmapManagerVoidstone extends SubmapManagerBase {
// TODO there must be a better more generic way to do this...
@SideOnly(Side.CLIENT)
private class RenderBlocksVoidstone extends RenderBlocksCTM {
@Override
public void renderFaceXNeg(Block block, double x, double y, double z, IIcon icon) {
super.renderFaceXNeg(block, x, y, z, icon);
@@ -100,7 +100,7 @@ public class SubmapManagerVoidstone extends SubmapManagerBase {
public IIcon getIcon(int side, int meta) {
return overlay.getIcon(side, meta);
}
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
return overlay.getIcon(world, x, y, z, side);
@@ -3,7 +3,6 @@ package com.cricketcraft.chisel.client.render.tile;
import java.awt.Color;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBeacon;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
@@ -23,109 +22,111 @@ import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class RenderCarvableBeacon extends TileEntityBeaconRenderer implements ISimpleBlockRenderingHandler {
private static final ResourceLocation texture = new ResourceLocation("textures/entity/beacon_beam.png");
private int renderId;
private static final ResourceLocation texture = new ResourceLocation("textures/entity/beacon_beam.png");
private int renderId;
public RenderCarvableBeacon() {
this.renderId = RenderingRegistry.getNextAvailableRenderId();
this.renderId = RenderingRegistry.getNextAvailableRenderId();
}
public void renderTileEntityAt(TileEntityCarvableBeacon beacon, double x, double y, double z, float partialTicks) {
float f1 = beacon.func_146002_i();
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
if(f1 > 0.1F){
Color color = new Color(ItemDye.field_150922_c[beacon.getWorldObj().getBlockMetadata(beacon.xCoord, beacon.yCoord, beacon.zCoord)]);
Tessellator tessellator = Tessellator.instance;
this.bindTexture(texture);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
OpenGlHelper.glBlendFunc(770, 1, 1, 0);
float f2 = (float) beacon.getWorldObj().getTotalWorldTime() + partialTicks;
float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F);
byte b0 = 1;
double d3 = (double) f2 * 0.025D * (1.0D - (double) (b0 & 1) * 2.5D);
tessellator.startDrawingQuads();
tessellator.setColorRGBA(color.getRed(), color.getGreen(), color.getBlue(), 32);
double d5 = (double) b0 * 0.2D;
double d7 = 0.5D + Math.cos(d3 + 2.356194490192345D) * d5;
double d9 = 0.5D + Math.sin(d3 + 2.356194490192345D) * d5;
double d11 = 0.5D + Math.cos(d3 + (Math.PI / 4D)) * d5;
double d13 = 0.5D + Math.sin(d3 + (Math.PI / 4D)) * d5;
double d15 = 0.5D + Math.cos(d3 + 3.9269908169872414D) * d5;
double d17 = 0.5D + Math.sin(d3 + 3.9269908169872414D) * d5;
double d19 = 0.5D + Math.cos(d3 + 5.497787143782138D) * d5;
double d21 = 0.5D + Math.sin(d3 + 5.497787143782138D) * d5;
double d23 = (double) (256.0F * f1);
double d25 = 0.0D;
double d27 = 1.0D;
double d28 = (double) (-1.0F + f3);
double d29 = (double) (256.0F * f1) * (0.5D / d5) + d28;
tessellator.addVertexWithUV(x + d7, y + d23, z + d9, d27, d29);
tessellator.addVertexWithUV(x + d7, y, z + d9, d27, d28);
tessellator.addVertexWithUV(x + d11, y, z + d13, d25, d28);
tessellator.addVertexWithUV(x + d11, y + d23, z + d13, d25, d29);
tessellator.addVertexWithUV(x + d19, y + d23, z + d21, d27, d29);
tessellator.addVertexWithUV(x + d19, y, z + d21, d27, d28);
tessellator.addVertexWithUV(x + d15, y, z + d17, d25, d28);
tessellator.addVertexWithUV(x + d15, y + d23, z + d17, d25, d29);
tessellator.addVertexWithUV(x + d11, y + d23, z + d13, d27, d29);
tessellator.addVertexWithUV(x + d11, y, z + d13, d27, d28);
tessellator.addVertexWithUV(x + d19, y, z + d21, d25, d28);
tessellator.addVertexWithUV(x + d19, y + d23, z + d21, d25, d29);
tessellator.addVertexWithUV(x + d15, y + d23, z + d17, d27, d29);
tessellator.addVertexWithUV(x + d15, y, z + d17, d27, d28);
tessellator.addVertexWithUV(x + d7, y, z + d9, d25, d28);
tessellator.addVertexWithUV(x + d7, y + d23, z + d9, d25, d29);
tessellator.draw();
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glDepthMask(false);
tessellator.startDrawingQuads();
tessellator.setColorRGBA(color.getRed(), color.getGreen(), color.getBlue(), 32);
double d30 = 0.2D;
double d4 = 0.2D;
double d6 = 0.8D;
double d8 = 0.2D;
double d10 = 0.2D;
double d12 = 0.8D;
double d14 = 0.8D;
double d16 = 0.8D;
double d18 = (double) (256.0F * f1);
double d20 = 0.0D;
double d22 = 1.0D;
double d24 = (double) (-1.0F + f3);
double d26 = (double) (256.0F * f1) + d24;
tessellator.addVertexWithUV(x + d30, y + d18, z + d4, d22, d26);
tessellator.addVertexWithUV(x + d30, y, z + d4, d22, d24);
tessellator.addVertexWithUV(x + d6, y, z + d8, d20, d24);
tessellator.addVertexWithUV(x + d6, y + d18, z + d8, d20, d26);
tessellator.addVertexWithUV(x + d14, y + d18, z + d16, d22, d26);
tessellator.addVertexWithUV(x + d14, y, z + d16, d22, d24);
tessellator.addVertexWithUV(x + d10, y, z + d12, d20, d24);
tessellator.addVertexWithUV(x + d10, y + d18, z + d12, d20, d26);
tessellator.addVertexWithUV(x + d6, y + d18, z + d8, d22, d26);
tessellator.addVertexWithUV(x + d6, y, z + d8, d22, d24);
tessellator.addVertexWithUV(x + d14, y, z + d16, d20, d24);
tessellator.addVertexWithUV(x + d14, y + d18, z + d16, d20, d26);
tessellator.addVertexWithUV(x + d10, y + d18, z + d12, d22, d26);
tessellator.addVertexWithUV(x + d10, y, z + d12, d22, d24);
tessellator.addVertexWithUV(x + d30, y, z + d4, d20, d24);
tessellator.addVertexWithUV(x + d30, y + d18, z + d4, d20, d26);
tessellator.draw();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDepthMask(true);
}
}
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
this.renderTileEntityAt((TileEntityCarvableBeacon) tile, x, y, z, partialTicks);
}
public void renderTileEntityAt(TileEntityCarvableBeacon beacon, double x, double y, double z, float partialTicks) {
float f1 = beacon.func_146002_i();
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
if (f1 > 0.1F) {
Color color = new Color(ItemDye.field_150922_c[beacon.getWorldObj().getBlockMetadata(beacon.xCoord, beacon.yCoord, beacon.zCoord)]);
Tessellator tessellator = Tessellator.instance;
this.bindTexture(texture);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
OpenGlHelper.glBlendFunc(770, 1, 1, 0);
float f2 = beacon.getWorldObj().getTotalWorldTime() + partialTicks;
float f3 = -f2 * 0.2F - MathHelper.floor_float(-f2 * 0.1F);
byte b0 = 1;
double d3 = f2 * 0.025D * (1.0D - (b0 & 1) * 2.5D);
tessellator.startDrawingQuads();
tessellator.setColorRGBA(color.getRed(), color.getGreen(), color.getBlue(), 32);
double d5 = b0 * 0.2D;
double d7 = 0.5D + Math.cos(d3 + 2.356194490192345D) * d5;
double d9 = 0.5D + Math.sin(d3 + 2.356194490192345D) * d5;
double d11 = 0.5D + Math.cos(d3 + (Math.PI / 4D)) * d5;
double d13 = 0.5D + Math.sin(d3 + (Math.PI / 4D)) * d5;
double d15 = 0.5D + Math.cos(d3 + 3.9269908169872414D) * d5;
double d17 = 0.5D + Math.sin(d3 + 3.9269908169872414D) * d5;
double d19 = 0.5D + Math.cos(d3 + 5.497787143782138D) * d5;
double d21 = 0.5D + Math.sin(d3 + 5.497787143782138D) * d5;
double d23 = 256.0F * f1;
double d25 = 0.0D;
double d27 = 1.0D;
double d28 = -1.0F + f3;
double d29 = 256.0F * f1 * (0.5D / d5) + d28;
tessellator.addVertexWithUV(x + d7, y + d23, z + d9, d27, d29);
tessellator.addVertexWithUV(x + d7, y, z + d9, d27, d28);
tessellator.addVertexWithUV(x + d11, y, z + d13, d25, d28);
tessellator.addVertexWithUV(x + d11, y + d23, z + d13, d25, d29);
tessellator.addVertexWithUV(x + d19, y + d23, z + d21, d27, d29);
tessellator.addVertexWithUV(x + d19, y, z + d21, d27, d28);
tessellator.addVertexWithUV(x + d15, y, z + d17, d25, d28);
tessellator.addVertexWithUV(x + d15, y + d23, z + d17, d25, d29);
tessellator.addVertexWithUV(x + d11, y + d23, z + d13, d27, d29);
tessellator.addVertexWithUV(x + d11, y, z + d13, d27, d28);
tessellator.addVertexWithUV(x + d19, y, z + d21, d25, d28);
tessellator.addVertexWithUV(x + d19, y + d23, z + d21, d25, d29);
tessellator.addVertexWithUV(x + d15, y + d23, z + d17, d27, d29);
tessellator.addVertexWithUV(x + d15, y, z + d17, d27, d28);
tessellator.addVertexWithUV(x + d7, y, z + d9, d25, d28);
tessellator.addVertexWithUV(x + d7, y + d23, z + d9, d25, d29);
tessellator.draw();
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glDepthMask(false);
tessellator.startDrawingQuads();
tessellator.setColorRGBA(color.getRed(), color.getGreen(), color.getBlue(), 32);
double d30 = 0.2D;
double d4 = 0.2D;
double d6 = 0.8D;
double d8 = 0.2D;
double d10 = 0.2D;
double d12 = 0.8D;
double d14 = 0.8D;
double d16 = 0.8D;
double d18 = 256.0F * f1;
double d20 = 0.0D;
double d22 = 1.0D;
double d24 = -1.0F + f3;
double d26 = 256.0F * f1 + d24;
tessellator.addVertexWithUV(x + d30, y + d18, z + d4, d22, d26);
tessellator.addVertexWithUV(x + d30, y, z + d4, d22, d24);
tessellator.addVertexWithUV(x + d6, y, z + d8, d20, d24);
tessellator.addVertexWithUV(x + d6, y + d18, z + d8, d20, d26);
tessellator.addVertexWithUV(x + d14, y + d18, z + d16, d22, d26);
tessellator.addVertexWithUV(x + d14, y, z + d16, d22, d24);
tessellator.addVertexWithUV(x + d10, y, z + d12, d20, d24);
tessellator.addVertexWithUV(x + d10, y + d18, z + d12, d20, d26);
tessellator.addVertexWithUV(x + d6, y + d18, z + d8, d22, d26);
tessellator.addVertexWithUV(x + d6, y, z + d8, d22, d24);
tessellator.addVertexWithUV(x + d14, y, z + d16, d20, d24);
tessellator.addVertexWithUV(x + d14, y + d18, z + d16, d20, d26);
tessellator.addVertexWithUV(x + d10, y + d18, z + d12, d22, d26);
tessellator.addVertexWithUV(x + d10, y, z + d12, d22, d24);
tessellator.addVertexWithUV(x + d30, y, z + d4, d20, d24);
tessellator.addVertexWithUV(x + d30, y + d18, z + d4, d20, d26);
tessellator.draw();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDepthMask(true);
}
}
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
this.renderTileEntityAt((TileEntityCarvableBeacon) tile, x, y, z, partialTicks);
}
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
@@ -134,19 +135,19 @@ public class RenderCarvableBeacon extends TileEntityBeaconRenderer implements IS
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
float f = 0.1875F;
renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.glass));
renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1);
renderer.renderAllFaces = true;
renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.obsidian));
renderer.setRenderBounds(0.125D, 0.00625D, 0.125D, 0.875D, (double)f, 0.875D);
renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1);
renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.beacon));
renderer.setRenderBounds(0.1875D, (double)f, 0.1875D, 0.8125D, 0.875D, 0.8125D);
renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1);
renderer.renderAllFaces = false;
renderer.clearOverrideBlockTexture();
return true;
float f = 0.1875F;
renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.glass));
renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1);
renderer.renderAllFaces = true;
renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.obsidian));
renderer.setRenderBounds(0.125D, 0.00625D, 0.125D, 0.875D, f, 0.875D);
renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1);
renderer.setOverrideBlockTexture(renderer.getBlockIcon(Blocks.beacon));
renderer.setRenderBounds(0.1875D, f, 0.1875D, 0.8125D, 0.875D, 0.8125D);
renderer.renderStandardBlockWithAmbientOcclusion(block, x, y, z, 1, 1, 1);
renderer.renderAllFaces = false;
renderer.clearOverrideBlockTexture();
return true;
}
@Override
@@ -25,7 +25,7 @@ public class RenderPresent extends TileEntitySpecialRenderer implements IItemRen
private ModelChest smallChest = new ModelChest();
private ModelChest largeChest = new ModelLargeChest();
private HashMap<Integer, ResourceLocation> textureCache = Maps.newHashMap();
public void renderTileEntityAt(TileEntityPresent present, double x, double y, double z, float partialTicks) {
@@ -38,7 +38,7 @@ public class RenderPresent extends TileEntitySpecialRenderer implements IItemRen
bindTexture(present);
if (!present.isConnected()) {
GL11.glRotatef(90 * rotation + 180, 0, 1, 0);
switch(rotation) {
switch (rotation) {
case 0:
GL11.glTranslatef(-1, 0, -1);
break;
@@ -52,7 +52,7 @@ public class RenderPresent extends TileEntitySpecialRenderer implements IItemRen
smallChest.renderAll();
} else if (present.isParent()) {
ForgeDirection dir = present.getConnectionDir();
switch(dir) {
switch (dir) {
case NORTH:
GL11.glRotatef(-90, 0, 1, 0);
GL11.glTranslatef(0, 0, -1);
@@ -75,7 +75,7 @@ public class RenderPresent extends TileEntitySpecialRenderer implements IItemRen
}
GL11.glPopMatrix();
}
private void bindTexture(TileEntityPresent present) {
int idx = present.getWorldObj().getBlockMetadata(present.xCoord, present.yCoord, present.zCoord) + (present.isConnected() ? 0 : 16);
ResourceLocation rl = textureCache.get(idx);
@@ -92,7 +92,7 @@ public class RenderPresent extends TileEntitySpecialRenderer implements IItemRen
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) {
this.renderTileEntityAt((TileEntityPresent) tileEntity, x, y, z, partialTicks);
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return type != ItemRenderType.FIRST_PERSON_MAP;
@@ -5,6 +5,8 @@ import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import org.apache.logging.log4j.Level;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.carving.Carving;
import com.cricketcraft.chisel.init.ChiselBlocks;
@@ -17,24 +19,21 @@ import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import org.apache.logging.log4j.Level;
public class Compatibility {
public static String[] rockColorNames = { "gray", "lightgray", "brown", "tan", "reddish", "bluish", "greenish" };
public static Map<Integer, String> tconMap = Maps.newHashMap();
public static Map<Integer, String> tconMap = Maps.newHashMap();
static
{
tconMap.put(0, "obsidian");
tconMap.put(1, "sandstone");
tconMap.put(2, "netherrack");
tconMap.put(3, "stonebricksmooth");
tconMap.put(12, "end_stone");
}
static {
tconMap.put(0, "obsidian");
tconMap.put(1, "sandstone");
tconMap.put(2, "netherrack");
tconMap.put(3, "stonebricksmooth");
tconMap.put(12, "end_stone");
}
public static void init(FMLPostInitializationEvent event) {
public static void init(FMLPostInitializationEvent event) {
/* Proj Red */
addSupport("ProjRed|Exploration", "projectred.exploration.stone", "marble", 0, 99);
@@ -71,24 +70,23 @@ public class Compatibility {
/* Thaumcraft TODO There is probably a cleaner way of doing this */
if (Loader.isModLoaded("Thaumcraft")) {
loadThaumcraftAspects();
}
}
for (Integer i : tconMap.keySet())
{
addSupport("TConstruct", "decoration.multibrick", tconMap.get(i), i, 99);
addSupport("TConstruct", "decoration.multibrickfancy", tconMap.get(i), i, 99);
}
for (Integer i : tconMap.keySet()) {
addSupport("TConstruct", "decoration.multibrick", tconMap.get(i), i, 99);
addSupport("TConstruct", "decoration.multibrickfancy", tconMap.get(i), i, 99);
}
addSupport("TConstruct", "decoration.multibrickfancy", "stonebricksmooth", 14, 99);
addSupport("TConstruct", "decoration.multibrickfancy", "stonebricksmooth", 15, 99);
addSupport("TConstruct", "decoration.multibrickfancy", "stonebricksmooth", 14, 99);
addSupport("TConstruct", "decoration.multibrickfancy", "stonebricksmooth", 15, 99);
addSupport("Botania", "endStoneBrick", "end_stone", 0, 0);
addSupport("Botania", "endStoneBrick", "end_stone", 1, 0);
addSupport("Botania", "endStoneBrick", "end_stone", 0, 0);
addSupport("Botania", "endStoneBrick", "end_stone", 1, 0);
if(Loader.isModLoaded("EE3")){
if (Loader.isModLoaded("EE3")) {
loadEE3Values();
}
}
}
public static void addSupport(String modname, String blockname, String name, int metadata, int order) {
if (Loader.isModLoaded(modname) && GameRegistry.findBlock(modname, blockname) != null) {
@@ -101,11 +99,11 @@ public class Compatibility {
}
private static void loadThaumcraftAspects() {
// ThaumcraftApi.registerObjectTag(new ItemStack(ChiselBlocks.cobblestone, 1, OreDictionary.WILDCARD_VALUE), (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1));
// ThaumcraftApi.registerObjectTag(new ItemStack(ChiselBlocks.cobblestoneWall, 1, OreDictionary.WILDCARD_VALUE), (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1));
// ThaumcraftApi.registerObjectTag(new ItemStack(ChiselBlocks.cobblestone, 1, OreDictionary.WILDCARD_VALUE), (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1));
// ThaumcraftApi.registerObjectTag(new ItemStack(ChiselBlocks.cobblestoneWall, 1, OreDictionary.WILDCARD_VALUE), (new AspectList()).add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1));
}
private static void loadEE3Values(){
private static void loadEE3Values() {
FMLLog.log(Chisel.MOD_ID, Level.INFO, "[Chisel 2] Oooh is that Equivalent Exchange I see?");
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselItems.ballomoss, 1), 16);
@@ -136,25 +134,29 @@ public class Compatibility {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass2, 1), 1);
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.technical2, 1, 0), 32);
for(int x = 0; x < ChiselBlocks.pumpkin.length; x++){
for (int x = 0; x < ChiselBlocks.pumpkin.length; x++) {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.pumpkin[x], 1), 144);
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.jackolantern[x], 1), 153);
}
for(int x = 0; x < ChiselBlocks.torches.length; x++){
for (int x = 0; x < ChiselBlocks.torches.length; x++) {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.torches[x], 1), 9);
}
for(int x = 0; x < 10; x++){
for (int x = 0; x < 10; x++) {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.valentines, 1, x), 3);
}
for(int x = 0 ; x < 16; x++){
if(x <= 10)EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.concrete, 1, x), 8);
if(x <= 14)EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.grimstone, 1, x), 5);
if(x < 14)EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.grimstone, 1, x), 7);
if(x < 12)EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.dirt, 1, x), 1);
if(x < 5){
for (int x = 0; x < 16; x++) {
if (x <= 10)
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.concrete, 1, x), 8);
if (x <= 14)
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.grimstone, 1, x), 5);
if (x < 14)
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.grimstone, 1, x), 7);
if (x < 12)
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.dirt, 1, x), 1);
if (x < 5) {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.rebel, 1, x), 39);
}
@@ -182,19 +184,22 @@ public class Compatibility {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.circuits, 1, x), 37);
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.factoryblock2, 1, x), 32);
if(x < 15)EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.warningSign, 1, x), 6);
if (x < 15)
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.warningSign, 1, x), 6);
if(x < 4)EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.factoryblock2, 1, x), 32);
if (x < 4)
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.factoryblock2, 1, x), 32);
for(int c = 0; c < ChiselBlocks.stainedGlass.length; c++){
for (int c = 0; c < ChiselBlocks.stainedGlass.length; c++) {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.stainedGlass[c], 1, x), 1);
}
for(int c = 0; c < ChiselBlocks.stainedGlassPane.length; c++){
if(x <= 13)EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.stainedGlassPane[c], 1, x), 1);
for (int c = 0; c < ChiselBlocks.stainedGlassPane.length; c++) {
if (x <= 13)
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.stainedGlassPane[c], 1, x), 1);
}
if(x > 0) {
if (x > 0) {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.cobblestone, 1, x), 1);
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.mossy_cobblestone, 1, x), 1);
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.netherrack, 1, x), 1);
@@ -203,7 +208,8 @@ public class Compatibility {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.voidstonerunic, 1, x), 160);
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.glass, 1, x), 1);
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.redstone_block, 1, x), 288);
if(x <= 8)EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.bookshelf, 1, x), 528);
if (x <= 8)
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.bookshelf, 1, x), 528);
if (x <= 12) {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.diamond_block, 1, x), 73728);
if (x != 12)
@@ -216,7 +222,7 @@ public class Compatibility {
}
}
for(int x = 0; x <= 6; x++){
for (int x = 0; x <= 6; x++) {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.andesite, 1, x), 129);
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.diorite, 1, x), 257);
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.granite, 1, x), 513);
@@ -238,7 +244,7 @@ public class Compatibility {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall_block, 1, x), 32);
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall_block, 1, 7), 32);
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.paperwall_block, 1, 8), 32);
if(x > 0){
if (x > 0) {
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new ItemStack(ChiselBlocks.brickCustom, 1, x), 256);
}
}
@@ -14,7 +14,7 @@ public class IMCHandler {
public static final IMCHandler INSTANCE = new IMCHandler();
private int order = 1000;
private IMCHandler() {
}
@@ -1,16 +1,16 @@
package com.cricketcraft.chisel.compat.fmp;
import com.cricketcraft.chisel.init.ChiselBlocks;
import com.google.common.collect.Lists;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import codechicken.lib.vec.BlockCoord;
import codechicken.multipart.MultiPartRegistry;
import codechicken.multipart.MultiPartRegistry.IPartConverter;
import codechicken.multipart.MultiPartRegistry.IPartFactory;
import codechicken.multipart.MultiPartRegistry;
import codechicken.multipart.TMultiPart;
import com.cricketcraft.chisel.init.ChiselBlocks;
import com.google.common.collect.Lists;
public class FMPCompat implements IPartFactory, IPartConverter {
public void init() {
@@ -25,6 +25,7 @@ public class ItemBlockChiselTorchPart extends ItemBlock {
this.torch = torch;
}
@Override
@SideOnly(Side.CLIENT)
public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) {
return (placePart(world, new BlockCoord(x, y, z).offset(side), stack, side, false)) || (super.func_150936_a(world, x, y, z, side, player, stack));
@@ -1,13 +1,13 @@
package com.cricketcraft.chisel.compat.fmp;
import com.cricketcraft.chisel.init.ChiselBlocks;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import codechicken.lib.data.MCDataInput;
import codechicken.lib.data.MCDataOutput;
import codechicken.multipart.minecraft.TorchPart;
import com.cricketcraft.chisel.init.ChiselBlocks;
public class PartChiselTorch extends TorchPart {
private int idx;
@@ -83,7 +83,7 @@ public class RecipeHandlerChisel extends TemplateRecipeHandler {
public String getGuiTexture() {
return "Chisel:textures/chiselNEI.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiChisel.class;
@@ -111,6 +111,7 @@ public class RecipeHandlerChisel extends TemplateRecipeHandler {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(75, 22, 15, 13), "chisel2.chisel", new Object[0]));
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("chisel2.chisel")) {
for (String name : Carving.chisel.getSortedGroupNames()) {
@@ -1,15 +1,15 @@
package com.cricketcraft.chisel.config;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.Features;
import com.cricketcraft.ctmlib.CTM;
import java.util.Locale;
import net.minecraft.item.ItemDye;
import net.minecraftforge.common.config.Configuration;
import org.apache.commons.lang3.StringUtils;
import java.util.Locale;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.Features;
import com.cricketcraft.ctmlib.CTM;
public class Configurations {
@@ -3,11 +3,11 @@ package com.cricketcraft.chisel.entity;
import net.minecraft.entity.monster.EntitySnowman;
import net.minecraft.world.World;
public class EntityChiselSnowman extends EntitySnowman{
public class EntityChiselSnowman extends EntitySnowman {
public EntityChiselSnowman(World world){
super(world);
}
public EntityChiselSnowman(World world) {
super(world);
}
//No special features just needed to get around the hardcoding
// No special features just needed to get around the hardcoding
}
@@ -60,7 +60,7 @@ public class EntitySnakestoneObsidianFX extends EntityFX {
noClip = true;
setParticleIcon(block.particles[General.rand.nextInt(block.particles.length)]);
setParticleIcon(BlockSnakestoneObsidian.particles[General.rand.nextInt(BlockSnakestoneObsidian.particles.length)]);
}
@Override
@@ -34,7 +34,7 @@ public final class ChiselBlocks {
public static final BlockCarvableGlowstone glowstone = null;
public static final BlockCarvable lapis_block = null;
public static final BlockCarvable emerald_block = null;
public static final BlockCarvable rebel = null;
public static final BlockCarvable rebel = null;
public static final BlockCarvable nether_brick = null;
public static final BlockCarvable netherrack = null;
public static final BlockCarvable mossy_cobblestone = null;
@@ -88,7 +88,7 @@ public final class ChiselBlocks {
public static final BlockCarvable arcane = null;
public static final BlockCarvable thaumium = null;
public static final BlockCarvable tallow = null;
public static final BlockCarvable copperblock = null;
public static final BlockCarvable bronzeblock = null;
public static final BlockCarvable aluminumblock = null;
@@ -6,6 +6,7 @@ import com.cricketcraft.chisel.item.ItemCloudInABottle;
import com.cricketcraft.chisel.item.ItemSmashingRock;
import com.cricketcraft.chisel.item.ItemUpgrade;
import com.cricketcraft.chisel.item.chisel.ItemChisel;
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
@ObjectHolder(Chisel.MOD_ID)
@@ -44,29 +44,21 @@ public class ContainerPresent extends Container {
ItemStack itemstack = null;
Slot slot = (Slot) this.inventorySlots.get(p_82846_2_);
if (slot != null && slot.getHasStack())
{
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (p_82846_2_ < rows * 9)
{
if (!this.mergeItemStack(itemstack1, rows * 9, inventorySlots.size(), true))
{
if (p_82846_2_ < rows * 9) {
if (!this.mergeItemStack(itemstack1, rows * 9, inventorySlots.size(), true)) {
return null;
}
}
else if (!this.mergeItemStack(itemstack1, 0, rows * 9, false))
{
} else if (!this.mergeItemStack(itemstack1, 0, rows * 9, false)) {
return null;
}
if (itemstack1.stackSize == 0)
{
if (itemstack1.stackSize == 0) {
slot.putStack((ItemStack) null);
}
else
{
} else {
slot.onSlotChanged();
}
}
@@ -128,7 +128,7 @@ public class InventoryChiselSelection implements IInventory {
activeVariations = 0;
while (activeVariations < normalSlots && activeVariations < list.size()) {
if(Block.blockRegistry.getNameForObject(Block.getBlockFromItem(list.get(activeVariations).getItem())) != null) {
if (Block.blockRegistry.getNameForObject(Block.getBlockFromItem(list.get(activeVariations).getItem())) != null) {
inventory[activeVariations] = list.get(activeVariations);
activeVariations++;
}
@@ -165,7 +165,7 @@ public class InventoryChiselSelection implements IInventory {
@Override
public boolean isItemValidForSlot(int i, ItemStack stack) {
//Really didn't think people would chisel a shovel
// Really didn't think people would chisel a shovel
if (stack.getItem() instanceof ItemTool) {
return false;
}
@@ -73,7 +73,7 @@ public class BaseItem extends Item {
String[] ret = new String[lines.size()];
int c = 0; // counter
for (Enumeration<String> e = lines.elements(); e.hasMoreElements(); c++) {
ret[c] = (String) e.nextElement();
ret[c] = e.nextElement();
}
return ret;
@@ -2,13 +2,12 @@ package com.cricketcraft.chisel.item;
import net.minecraft.block.Block;
public class ItemBlockPresent extends ItemCarvable {
public ItemBlockPresent(Block block) {
super(block);
}
@Override
public int getMetadata(int i) {
return 0;
@@ -6,12 +6,12 @@ import net.minecraft.item.ItemStack;
public class ItemCarvablePumpkin extends ItemCarvable {
public ItemCarvablePumpkin(Block block) {
super(block);
}
public ItemCarvablePumpkin(Block block) {
super(block);
}
@Override
public boolean isValidArmor(ItemStack itemStack, int armorType, Entity entity){
return true;
}
@Override
public boolean isValidArmor(ItemStack itemStack, int armorType, Entity entity) {
return true;
}
}
@@ -49,7 +49,7 @@ public enum ChiselMode implements IChiselMode {
public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, ICarvingVariation variation) {
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
int facing = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int facing = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
for (int i = -1; i <= 1; i++) {
if (side != ForgeDirection.DOWN && side != ForgeDirection.UP) {
setVariation(player, world, x, y + i, z, block, meta, variation);
@@ -69,7 +69,7 @@ public enum ChiselMode implements IChiselMode {
public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side, ICarvingVariation variation) {
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
int facing = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int facing = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
for (int i = -1; i <= 1; i++) {
if (side != ForgeDirection.DOWN && side != ForgeDirection.UP) {
if (side == ForgeDirection.EAST || side == ForgeDirection.WEST) {
@@ -1,13 +1,7 @@
package com.cricketcraft.chisel.item.chisel;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.api.IChiselItem;
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
import com.cricketcraft.chisel.carving.Carving;
import com.cricketcraft.chisel.config.Configurations;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
@@ -21,14 +15,20 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import java.util.List;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.api.IChiselItem;
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
import com.cricketcraft.chisel.carving.Carving;
import com.cricketcraft.chisel.config.Configurations;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
public class ItemChisel extends Item implements IChiselItem {
public enum ChiselType {
IRON(Configurations.ironChiselMaxDamage, Configurations.ironChiselAttackDamage),
DIAMOND(Configurations.diamondChiselMaxDamage, Configurations.diamondChiselAttackDamage),
OBSIDIAN(Configurations.obsidianChiselMaxDamage, Configurations.obsidianChiselAttackDamage);
IRON(Configurations.ironChiselMaxDamage, Configurations.ironChiselAttackDamage), DIAMOND(Configurations.diamondChiselMaxDamage, Configurations.diamondChiselAttackDamage), OBSIDIAN(
Configurations.obsidianChiselMaxDamage, Configurations.obsidianChiselAttackDamage);
final int maxDamage;
final int attackDamage;
@@ -52,27 +52,26 @@ public class ItemChisel extends Item implements IChiselItem {
}
@Override
public int getMaxDamage(ItemStack stack){
if(Configurations.allowChiselDamage)
public int getMaxDamage(ItemStack stack) {
if (Configurations.allowChiselDamage)
return type.maxDamage;
return 0;
}
@Override
public boolean isDamageable(){
public boolean isDamageable() {
return Configurations.allowChiselDamage;
}
@Override
public boolean getIsRepairable(ItemStack damagedItem, ItemStack repairMaterial)
{
public boolean getIsRepairable(ItemStack damagedItem, ItemStack repairMaterial) {
switch (type) {
case DIAMOND:
return repairMaterial.getItem().equals(Items.diamond);
case IRON:
return repairMaterial.getItem().equals(Items.iron_ingot);
case OBSIDIAN:
return repairMaterial.getItem().equals(Item.getItemFromBlock(Blocks.obsidian));
case DIAMOND:
return repairMaterial.getItem().equals(Items.diamond);
case IRON:
return repairMaterial.getItem().equals(Items.iron_ingot);
case OBSIDIAN:
return repairMaterial.getItem().equals(Item.getItemFromBlock(Blocks.obsidian));
}
return false;
@@ -20,7 +20,7 @@ public class MessageAutoChisel extends MessageCoords {
ItemStack base;
boolean playSound, breakChisel;
int chiseled;
public MessageAutoChisel(TileEntityAutoChisel tile, int chiseled, boolean playSound, boolean breakChisel) {
super(tile);
this.base = tile.getStackInSlot(TileEntityAutoChisel.BASE);
@@ -31,7 +31,7 @@ public class MessageAutoChisel extends MessageCoords {
this.breakChisel = breakChisel;
this.chiseled = chiseled;
}
@Override
public void toBytes(ByteBuf buf) {
super.toBytes(buf);
@@ -40,7 +40,7 @@ public class MessageAutoChisel extends MessageCoords {
buf.writeInt(chiseled);
ByteBufUtils.writeItemStack(buf, base);
}
@Override
public void fromBytes(ByteBuf buf) {
super.fromBytes(buf);
@@ -52,6 +52,7 @@ public class MessageAutoChisel extends MessageCoords {
public static class Handler implements IMessageHandler<MessageAutoChisel, IMessage> {
@Override
public IMessage onMessage(MessageAutoChisel message, MessageContext ctx) {
TileEntity te = message.getTileEntity(ctx);
@@ -16,25 +16,27 @@ import cpw.mods.fml.common.network.simpleimpl.MessageContext;
public class MessageChiselMode implements IMessage {
public MessageChiselMode(){
public MessageChiselMode() {
}
private String mode;
public MessageChiselMode(IChiselMode iChiselMode) {
this.mode = iChiselMode.name();
}
@Override
public void toBytes(ByteBuf buf) {
ByteBufUtils.writeUTF8String(buf, mode);
}
@Override
public void fromBytes(ByteBuf buf) {
this.mode = ByteBufUtils.readUTF8String(buf);
}
public static class Handler implements IMessageHandler<MessageChiselMode, IMessage> {
@Override
public IMessage onMessage(MessageChiselMode message, MessageContext ctx) {
ItemStack stack = ctx.getServerHandler().playerEntity.getCurrentEquippedItem();
@@ -11,27 +11,26 @@ import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
public class MessagePresentConnect extends MessageCoords {
private ForgeDirection dir;
private boolean connect, preserveDir;
public MessagePresentConnect() {
super();
}
public MessagePresentConnect(TileEntityPresent present, ForgeDirection dir, boolean connecting) {
this(present, dir, connecting, false);
}
public MessagePresentConnect(TileEntityPresent present, ForgeDirection dir, boolean connecting, boolean preserveDir) {
super(present);
this.dir = dir;
this.connect = connecting;
this.preserveDir = preserveDir;
}
@Override
public void toBytes(ByteBuf buf) {
super.toBytes(buf);
@@ -39,7 +38,7 @@ public class MessagePresentConnect extends MessageCoords {
buf.writeBoolean(connect);
buf.writeBoolean(preserveDir);
}
@Override
public void fromBytes(ByteBuf buf) {
super.fromBytes(buf);
@@ -47,9 +46,9 @@ public class MessagePresentConnect extends MessageCoords {
connect = buf.readBoolean();
preserveDir = buf.readBoolean();
}
public static class Handler implements IMessageHandler<MessagePresentConnect, IMessage> {
@Override
public IMessage onMessage(MessagePresentConnect message, MessageContext ctx) {
TileEntity te = message.getTileEntity(ctx);
@@ -1,10 +1,10 @@
package com.cricketcraft.chisel.proxy;
import com.cricketcraft.chisel.block.tileentity.TileEntityCarvableBeacon;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel;
import com.cricketcraft.chisel.block.tileentity.TileEntityCarvableBeacon;
import com.cricketcraft.chisel.block.tileentity.TileEntityPresent;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -125,24 +125,25 @@ public class General {
}
private static final String MODE_KEY = "chiselMode";
public static IChiselMode getChiselMode(ItemStack chisel) {
if (chisel == null) {
return ChiselMode.SINGLE;
}
if (chisel.stackTagCompound == null || Strings.isNullOrEmpty(chisel.stackTagCompound.getString(MODE_KEY))) {
initTag(chisel);
chisel.stackTagCompound.setString(MODE_KEY, ChiselMode.SINGLE.name());
}
String name = chisel.stackTagCompound.getString(MODE_KEY);
if (chisel.getItem() instanceof IAdvancedChisel) {
return ((IAdvancedChisel)chisel.getItem()).getMode(chisel, name);
return ((IAdvancedChisel) chisel.getItem()).getMode(chisel, name);
}
return Enum.valueOf(ChiselMode.class, chisel.stackTagCompound.getString(MODE_KEY));
}
public static void setChiselMode(ItemStack chisel, IChiselMode mode) {
initTag(chisel);
chisel.stackTagCompound.setString(MODE_KEY, mode.name());
@@ -29,12 +29,11 @@ public class GeneralClient {
Minecraft.getMinecraft().getTextureManager().bindTexture(res);
}
public static void setGLColorFromInt(int color)
{
float red = (color >> 16 & 255) / 255.0F;
float green = (color >> 8 & 255) / 255.0F;
float blue = (color & 255) / 255.0F;
GL11.glColor4f(red, green, blue, 1.0F);
}
public static void setGLColorFromInt(int color) {
float red = (color >> 16 & 255) / 255.0F;
float green = (color >> 8 & 255) / 255.0F;
float blue = (color & 255) / 255.0F;
GL11.glColor4f(red, green, blue, 1.0F);
}
}