mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-12 16:27:45 +00:00
Merge branch 'dev' into ctm_refactor2
Conflicts: src/main/java/com/cricketcraft/chisel/Features.java src/main/java/com/cricketcraft/chisel/carving/CarvableHelper.java src/main/java/com/cricketcraft/chisel/config/Configurations.java
This commit is contained in:
commit
d0d01fbb68
286 files changed
+7124
-328
No files matched your search
@@ -2,6 +2,9 @@ package com.cricketcraft.chisel;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.cricketcraft.chisel.entity.EntityChiselSnowman;
|
||||
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -13,6 +16,7 @@ import org.apache.logging.log4j.Logger;
|
||||
import com.cricketcraft.chisel.block.BlockCarvable;
|
||||
import com.cricketcraft.chisel.compat.Compatibility;
|
||||
import com.cricketcraft.chisel.compat.IMCHandler;
|
||||
import com.cricketcraft.chisel.compat.fmp.FMPCompat;
|
||||
import com.cricketcraft.chisel.config.Configurations;
|
||||
import com.cricketcraft.chisel.init.ChiselBlocks;
|
||||
import com.cricketcraft.chisel.init.ChiselTabs;
|
||||
@@ -26,15 +30,16 @@ import com.cricketcraft.chisel.world.GeneratorChisel;
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
@@ -120,6 +125,9 @@ public class Chisel {
|
||||
Features.preInit();
|
||||
PacketHandler.init();
|
||||
ChiselController.INSTANCE.preInit();
|
||||
if (Loader.isModLoaded("ForgeMultipart")) {
|
||||
new FMPCompat().init();
|
||||
}
|
||||
proxy.preInit();
|
||||
}
|
||||
|
||||
@@ -136,6 +144,8 @@ 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);
|
||||
|
||||
proxy.init();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(instance);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.cricketcraft.chisel.carving.CarvableVariation;
|
||||
import com.cricketcraft.chisel.carving.Carving;
|
||||
import com.cricketcraft.chisel.carving.CarvingGroup;
|
||||
import com.cricketcraft.chisel.client.render.SubmapManagerFakeController;
|
||||
import com.cricketcraft.chisel.compat.fmp.ItemBlockChiselTorchPart;
|
||||
import com.cricketcraft.chisel.config.Configurations;
|
||||
import com.cricketcraft.chisel.entity.EntityBallOMoss;
|
||||
import com.cricketcraft.chisel.entity.EntityCloudInABottle;
|
||||
@@ -100,9 +101,18 @@ public enum Features {
|
||||
andesite.carverHelper.setChiselBlockName("andesite");
|
||||
andesite.carverHelper.addVariation("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.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");
|
||||
Carving.chisel.registerOre("andesite", "andesite");
|
||||
Carving.chisel.registerOre("andesite", "blockAndesite");
|
||||
}
|
||||
|
||||
@Override
|
||||
void addRecipes() {
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(andesite, 2), diorite, "cobblestone"));
|
||||
}
|
||||
},
|
||||
|
||||
@@ -153,7 +163,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.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/entropiedEntritchRock");
|
||||
arcane.carverHelper.registerAll(arcane, "arcane");
|
||||
Carving.chisel.registerOre("arcane", "arcane");
|
||||
}
|
||||
@@ -390,8 +404,10 @@ public enum Features {
|
||||
void addItems() {
|
||||
ItemChisel chisel = (ItemChisel) new ItemChisel(ChiselType.IRON).setCreativeTab(ChiselTabs.tabChisel);
|
||||
ItemChisel diamondChisel = (ItemChisel) new ItemChisel(ChiselType.DIAMOND).setCreativeTab(ChiselTabs.tabChisel);
|
||||
ItemChisel obsidianChisel = (ItemChisel) new ItemChisel(ChiselType.OBSIDIAN).setCreativeTab(ChiselTabs.tabChisel);
|
||||
GameRegistry.registerItem(chisel, "chisel");
|
||||
GameRegistry.registerItem(diamondChisel, "diamondChisel");
|
||||
GameRegistry.registerItem(obsidianChisel, "obsidianChisel");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -399,9 +415,11 @@ public enum Features {
|
||||
if (Configurations.chiselRecipe) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.chisel), " YY", " YY", "X ", 'X', "stickWood", 'Y', "ingotIron"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.diamondChisel), " YY", " YY", "x ", 'x', "stickWood", 'Y', "gemDiamond"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.obsidianChisel), " YY", " YY", "x ", 'x', "stickWood", 'Y', Blocks.obsidian));
|
||||
} else {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.chisel), " Y", "X ", 'X', "stickWood", 'Y', "ingotIron"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.diamondChisel), " Y", "X ", 'X', "stickWood", 'Y', "gemDiamond"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.obsidianChisel), " Y", "X ", 'X', "stickWood", 'Y', Blocks.obsidian));
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -558,7 +576,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", "diamond");
|
||||
}
|
||||
},
|
||||
@@ -572,9 +590,18 @@ public enum Features {
|
||||
diorite.carverHelper.addVariation("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.registerAll(diorite, "diorite");
|
||||
Carving.chisel.registerOre("diorite", "diorite");
|
||||
}
|
||||
|
||||
@Override
|
||||
void addRecipes() {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(diorite, 2), "cq", "qc", 'c', "cobblestone", 'q', "gemQuartz"));
|
||||
}
|
||||
},
|
||||
|
||||
DIRT {
|
||||
@@ -629,6 +656,17 @@ public enum Features {
|
||||
}
|
||||
},
|
||||
|
||||
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, 0);
|
||||
//end_stone.carverHelper.registerAll(emerald_block, "endStone");
|
||||
Carving.chisel.registerOre("end_stone", "end_stone");
|
||||
}
|
||||
},
|
||||
|
||||
FACTORY {
|
||||
|
||||
@Override
|
||||
@@ -654,6 +692,15 @@ public enum Features {
|
||||
factoryblock.carverHelper.addVariation("tile.factory.15.desc", 15, "factory/column");
|
||||
factoryblock.carverHelper.registerAll(factoryblock, "factoryblock");
|
||||
Carving.chisel.registerOre("factoryblock", "factoryblock");
|
||||
|
||||
BlockCarvable factoryblock2 = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F)
|
||||
.setStepSound(Chisel.soundMetalFootstep);
|
||||
factoryblock2.carverHelper.addVariation("tile.factory2.0.desc", 0, "factory/iceiceice");
|
||||
factoryblock2.carverHelper.addVariation("tile.factory2.1.desc", 1, "factory/vent");
|
||||
factoryblock2.carverHelper.addVariation("tile.factory2.2.desc", 2, "factory/tilemosaic");
|
||||
factoryblock2.carverHelper.addVariation("tile.factory2.3.desc", 3, "factory/wireframeblue");
|
||||
factoryblock2.carverHelper.registerAll(factoryblock2, "factoryblock2");
|
||||
factoryblock2.carverHelper.registerVariations("factoryblock", factoryblock2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -726,7 +773,7 @@ public enum Features {
|
||||
*/).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F);
|
||||
futura.carverHelper.addVariation("tile.futura.0.desc", 0, "futura/WIP/screenMetallicWIP");
|
||||
futura.carverHelper.addVariation("tile.futura.1.desc", 1, "futura/WIP/screenCyanWIP");
|
||||
futura.carverHelper.addVariation("tile.futura.2.desc", 2, "futura/WIP/controllerWIP", futura, 2, new SubmapManagerFakeController());
|
||||
futura.carverHelper.addVariation("tile.futura.2.desc", 2, "futura/WIP/controllerWIP", new SubmapManagerFakeController());
|
||||
futura.carverHelper.addVariation("tile.futura.3.desc", 3, "futura/WIP/wavyWIP");
|
||||
futura.carverHelper.registerAll(futura, "futura");
|
||||
Carving.chisel.registerOre("futura", "futura");
|
||||
@@ -761,6 +808,11 @@ public enum Features {
|
||||
glass.carverHelper.addVariation("tile.glass.15.desc", 15, "glass/a1-glasswindow-ironfencemodern");
|
||||
glass.carverHelper.registerAll(glass, "glass");
|
||||
Carving.chisel.registerOre("glass", "glass");
|
||||
|
||||
BlockCarvableGlass glass2 = (BlockCarvableGlass) new BlockCarvableGlass().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.3F).setStepSound(Block.soundTypeGlass);
|
||||
glass2.carverHelper.addVariation("tile.glass2.0.desc", 0, "glass/chrono");
|
||||
glass2.carverHelper.registerBlock(glass2, "glass2");
|
||||
glass2.carverHelper.registerVariations("glass", glass2);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -895,8 +947,20 @@ public enum Features {
|
||||
gold_block.carverHelper.addVariation("tile.gold.12.desc", 12, "gold/terrain-gold-space");
|
||||
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");
|
||||
gold_block.carverHelper.registerAll(gold_block, "gold_block");
|
||||
Carving.chisel.registerOre("gold_block", "gold");
|
||||
|
||||
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");
|
||||
gold2.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/gold/crate");
|
||||
gold2.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/gold/thermal");
|
||||
gold2.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/gold/adv");
|
||||
gold2.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/gold/egregious");
|
||||
gold2.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/gold/bolted");
|
||||
gold2.carverHelper.registerBlock(gold2, "gold2");
|
||||
gold2.carverHelper.registerVariations("gold_block", gold2);
|
||||
|
||||
gold_block.carverHelper.registerAll(gold_block, "gold_block");
|
||||
Carving.chisel.registerOre("gold_block", "blockGold");
|
||||
}
|
||||
},
|
||||
|
||||
@@ -909,9 +973,18 @@ public enum Features {
|
||||
granite.carverHelper.addVariation("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.registerAll(granite, "granite");
|
||||
Carving.chisel.registerOre("granite", "granite");
|
||||
}
|
||||
|
||||
@Override
|
||||
void addRecipes() {
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(granite, diorite, "gemQuartz"));
|
||||
}
|
||||
},
|
||||
|
||||
GRIMSTONE {
|
||||
@@ -948,12 +1021,21 @@ public enum Features {
|
||||
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockCarvable hexPlating = (BlockCarvable) new BlockCarvableGlow("hexPlating/hexAnim").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10.0F);
|
||||
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("hexPlating/hexAnim").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10.0F);
|
||||
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("hexPlating/hexAnim").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10.0F);
|
||||
for (int i = 0; i < 16; i++) {
|
||||
hexLargePlating.carverHelper.addVariation("tile.hexPlating." + ItemDye.field_150921_b[i] + ".desc", i, "hexPlating/hexNew");
|
||||
}
|
||||
|
||||
hexLargePlating.carverHelper.registerBlock(hexLargePlating, "hexLargePlating");
|
||||
hexLargePlating.carverHelper.registerVariations("hexPlating", hexLargePlating);
|
||||
Carving.chisel.registerOre("hexPlating", "hexPlating");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1123,8 +1205,20 @@ public enum Features {
|
||||
iron_block.carverHelper.addVariation("tile.iron.13.desc", 13, "iron/terrain-iron-spaceblack");
|
||||
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");
|
||||
iron_block.carverHelper.registerAll(iron_block, "iron_block");
|
||||
Carving.chisel.registerOre("iron_block", "iron");
|
||||
|
||||
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");
|
||||
iron2.carverHelper.addVariation("tile.metalOre.1.desc", 1, "metals/iron/crate");
|
||||
iron2.carverHelper.addVariation("tile.metalOre.2.desc", 2, "metals/iron/thermal");
|
||||
iron2.carverHelper.addVariation("tile.metalOre.3.desc", 3, "metals/iron/adv");
|
||||
iron2.carverHelper.addVariation("tile.metalOre.4.desc", 4, "metals/iron/egregious");
|
||||
iron2.carverHelper.addVariation("tile.metalOre.5.desc", 5, "metals/iron/bolted");
|
||||
iron2.carverHelper.registerBlock(iron2, "iron2");
|
||||
iron2.carverHelper.registerVariations("iron_block", iron2);
|
||||
|
||||
iron_block.carverHelper.registerAll(iron_block, "iron_block");
|
||||
Carving.chisel.registerOre("iron_block", "blockIron");
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1136,7 +1230,7 @@ public enum Features {
|
||||
jackolantern[metadata] = (BlockCarvablePumpkin) new BlockCarvablePumpkin(true).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(1.0F).setBlockName("litpumpkin")
|
||||
.setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setLightLevel(1.0f);
|
||||
jackolantern[metadata].setInformation("pumpkin/pumpkin_face_" + (metadata + 1) + "_on");
|
||||
GameRegistry.registerBlock(jackolantern[metadata], ("jackolantern" + (metadata + 1)));
|
||||
GameRegistry.registerBlock(jackolantern[metadata], ItemCarvablePumpkin.class, ("jackolantern" + (metadata + 1)));
|
||||
Carving.chisel.addVariation("jackolantern", jackolantern[metadata], 0, (metadata + 1));
|
||||
}
|
||||
Carving.chisel.addVariation("jackolantern", Blocks.lit_pumpkin, 0, 0);
|
||||
@@ -1192,7 +1286,8 @@ public enum Features {
|
||||
lapis_block.carverHelper.addVariation("tile.lapis.6.desc", 6, "lapis/a1-blocklapis-panel");
|
||||
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");
|
||||
}
|
||||
},
|
||||
@@ -1541,6 +1636,38 @@ public enum Features {
|
||||
}
|
||||
},
|
||||
|
||||
NATION {
|
||||
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockCarvable imperial = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F);
|
||||
imperial.carverHelper.addVariation("tile.nation.0.desc", 0, "nation/imperialCamo");
|
||||
imperial.carverHelper.addVariation("tile.nation.1.desc", 1, "nation/imperialCamoSecluded");
|
||||
imperial.carverHelper.addVariation("tile.nation.2.desc", 2, "nation/imperialPlate");
|
||||
imperial.carverHelper.addVariation("tile.nation.3.desc", 3, "nation/imperialCautionWhite");
|
||||
imperial.carverHelper.addVariation("tile.nation.4.desc", 4, "nation/imperialCautionOrange");
|
||||
//imperial.carverHelper.registerBlock(imperial, "imperial");
|
||||
imperial.carverHelper.registerAll(imperial, "nation");
|
||||
|
||||
BlockCarvable rebel = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F);
|
||||
rebel.carverHelper.addVariation("tile.nation.0.desc", 0, "nation/rebelCamo");
|
||||
rebel.carverHelper.addVariation("tile.nation.1.desc", 1, "nation/rebelCamoSecluded");
|
||||
rebel.carverHelper.addVariation("tile.nation.2.desc", 2, "nation/rebelPlate");
|
||||
rebel.carverHelper.addVariation("tile.nation.3.desc", 3, "nation/rebelCautionWhite");
|
||||
rebel.carverHelper.addVariation("tile.nation.4.desc", 4, "nation/rebelCautionRed");
|
||||
rebel.carverHelper.registerBlock(rebel, "rebel");
|
||||
rebel.carverHelper.registerVariations("nation", rebel);
|
||||
|
||||
Carving.chisel.registerOre("nation", "nation");
|
||||
}
|
||||
|
||||
@Override
|
||||
void addRecipes() {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.nation, 32, 0), new Object[] { "xyx", "yzy", "xyx", 'x', "stone", 'y',
|
||||
Items.iron_ingot, 'z', Items.gold_nugget }));
|
||||
}
|
||||
},
|
||||
|
||||
NETHER_BRICK {
|
||||
|
||||
@Override
|
||||
@@ -1591,7 +1718,8 @@ public enum Features {
|
||||
netherrack.carverHelper.addVariation("tile.hellrock.12.desc", 12, "netherrack/a1-netherrack-meatrock");
|
||||
netherrack.carverHelper.addVariation("tile.hellrock.13.desc", 13, "netherrack/a1-netherrack-red");
|
||||
netherrack.carverHelper.addVariation("tile.hellrock.14.desc", 14, "netherrack/a1-netherrack-wells");
|
||||
netherrack.carverHelper.registerAll(netherrack, "netherrack");
|
||||
|
||||
netherrack.carverHelper.registerAll(netherrack, "netherrack");
|
||||
Carving.chisel.registerOre("netherrack", "netherrack");
|
||||
}
|
||||
},
|
||||
@@ -1618,7 +1746,8 @@ public enum Features {
|
||||
obsidian.carverHelper.addVariation("tile.obsidian.13.desc", 13, "obsidian/tiles");
|
||||
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");
|
||||
}
|
||||
},
|
||||
@@ -1648,6 +1777,10 @@ 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));
|
||||
}
|
||||
},
|
||||
|
||||
PACKEDICE_PILLAR {
|
||||
@@ -1774,7 +1907,7 @@ public enum Features {
|
||||
pumpkin[metadata] = (BlockCarvablePumpkin) new BlockCarvablePumpkin(false).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(1.0F).setBlockName("pumpkin")
|
||||
.setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
|
||||
pumpkin[metadata].setInformation("pumpkin/pumpkin_face_" + (metadata + 1) + "_off");
|
||||
GameRegistry.registerBlock(pumpkin[metadata], "pumpkin" + (metadata + 1));
|
||||
GameRegistry.registerBlock(pumpkin[metadata], ItemCarvablePumpkin.class, "pumpkin" + (metadata + 1));
|
||||
Carving.chisel.addVariation("pumpkin", pumpkin[metadata], 0, (metadata + 1));
|
||||
}
|
||||
Carving.chisel.addVariation("pumpkin", Blocks.pumpkin, 0, 0);
|
||||
@@ -1824,7 +1957,9 @@ public enum Features {
|
||||
Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 4, 4);
|
||||
Carving.chisel.addVariation("RCAbyssalBlock", abyssal, 5, 5);
|
||||
Carving.chisel.registerOre("RCAbyssalBlock", "RCAbyssalBlock");
|
||||
};
|
||||
}
|
||||
|
||||
;
|
||||
},
|
||||
RC_BLEACHED_BONE(RAILCRAFT.getRequiredMod(), RAILCRAFT) {
|
||||
|
||||
@@ -1915,7 +2050,9 @@ public enum Features {
|
||||
Carving.chisel.addVariation("RCQuarriedBlock", quarried, 4, 4);
|
||||
Carving.chisel.addVariation("RCQuarriedBlock", quarried, 5, 5);
|
||||
Carving.chisel.registerOre("RCQuarriedBlock", "RCQuarriedBlock");
|
||||
};
|
||||
}
|
||||
|
||||
;
|
||||
},
|
||||
|
||||
RC_SANDY_STONE(RAILCRAFT.getRequiredMod(), RAILCRAFT) {
|
||||
@@ -1958,7 +2095,8 @@ public enum Features {
|
||||
redstone_block.carverHelper.addVariation("tile.redstone_block.13.desc", 13, "redstone/supaplex");
|
||||
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");
|
||||
}
|
||||
},
|
||||
@@ -2004,7 +2142,8 @@ public enum Features {
|
||||
sandstone.carverHelper.addVariation("tile.sandstone.13.desc", 13, "sandstone/blocks");
|
||||
sandstone.carverHelper.addVariation("tile.sandstone.14.desc", 14, "sandstone/mosaic");
|
||||
sandstone.carverHelper.addVariation("tile.sandstone.15.desc", 15, "sandstone/horizontal-tiles");
|
||||
sandstone.carverHelper.registerAll(sandstone, "sandstone");
|
||||
|
||||
sandstone.carverHelper.registerAll(sandstone, "sandstone");
|
||||
Carving.chisel.registerOre("sandstone", "sandstone");
|
||||
}
|
||||
|
||||
@@ -2124,8 +2263,7 @@ public enum Features {
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockSnakestoneObsidian obsidian_snakestone = (BlockSnakestoneObsidian) new BlockSnakestoneObsidian("Chisel:snakestone/obsidian/").setBlockName("chisel.obsidianSnakestone")
|
||||
.setHardness(50.0F)
|
||||
.setResistance(2000.0F);
|
||||
.setHardness(50.0F).setResistance(2000.0F);
|
||||
GameRegistry.registerBlock(obsidian_snakestone, ItemCarvable.class, "obsidian_snakestone");
|
||||
Carving.chisel.addVariation("obsidian", obsidian_snakestone, 1, 16);
|
||||
Carving.chisel.addVariation("obsidian", obsidian_snakestone, 13, 17);
|
||||
@@ -2161,13 +2299,17 @@ public enum Features {
|
||||
Carving.chisel.addVariation("stonebricksmooth", Blocks.stone, 0, -1);
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (i == 1) {
|
||||
if (Configurations.allowMossy)
|
||||
Carving.chisel.addVariation("stonebricksmooth", Blocks.stonebrick, i, i);
|
||||
} else {
|
||||
if ((i == 1) && (Configurations.allowMossy)) {
|
||||
Carving.chisel.addVariation("stonebricksmooth", Blocks.stonebrick, i, i);
|
||||
} else if (i != 1) {
|
||||
Carving.chisel.addVariation("stonebricksmooth", Blocks.stonebrick, i, i);
|
||||
}
|
||||
}
|
||||
|
||||
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.0.desc", 0, "stonebrick2/masonBricksPlain");
|
||||
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.1.desc", 1, "stonebrick2/masonBricksFelsic");
|
||||
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.2.desc", 2, "stonebrick2/masonBricksMafic");
|
||||
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.3.desc", 3, "stonebrick2/masonBricksMixed");
|
||||
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");
|
||||
@@ -2180,16 +2322,11 @@ public enum Features {
|
||||
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.13.desc", 13, "stonebrick/sunken");
|
||||
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.14.desc", 14, "stonebrick/ornatepanel");
|
||||
stonebricksmooth.carverHelper.addVariation("tile.stonebricksmooth.15.desc", 15, "stonebrick/poison");
|
||||
stonebricksmooth.carverHelper.registerAll(stonebricksmooth, "stonebricksmooth");
|
||||
|
||||
BlockCarvable stonebricksmooth2 = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(1.5F).setResistance(10.0F)
|
||||
.setStepSound(Block.soundTypeStone);
|
||||
stonebricksmooth2.carverHelper.addVariation("tile.stonebricksmooth2.0.desc", 0, "stonebrick2/masonryPlain");
|
||||
stonebricksmooth2.carverHelper.addVariation("tile.stonebricksmooth2.1.desc", 1, "stonebrick2/masonryFelsic");
|
||||
stonebricksmooth2.carverHelper.addVariation("tile.stonebricksmooth2.2.desc", 2, "stonebrick2/masonryMafic");
|
||||
stonebricksmooth2.carverHelper.addVariation("tile.stonebricksmooth2.3.desc", 3, "stonebrick2/masonryMixed");
|
||||
stonebricksmooth2.carverHelper.registerAll(stonebricksmooth2, "stonebricksmooth2");
|
||||
Carving.chisel.registerOre("stonebricksmooth2", "stonebricksmooth");
|
||||
stonebricksmooth.carverHelper.registerAll(stonebricksmooth, "stonebricksmooth");
|
||||
Carving.chisel.registerOre("stonebricksmooth", "stonebricksmooth");
|
||||
|
||||
//Carving.chisel.addVariation("stonebricksmooth", GameRegistry.findBlock("Chisel-2", "tile.TFTowerStone"), 0, 0);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2227,23 +2364,31 @@ public enum Features {
|
||||
technical.carverHelper.addVariation("tile.technical.13.desc", 13, "technical/grate");
|
||||
technical.carverHelper.addVariation("tile.technical.14.desc", 14, "technical/malfunctionFan");
|
||||
technical.carverHelper.addVariation("tile.technical.15.desc", 15, "technical/grateRusty");
|
||||
technical.carverHelper.registerAll(technical, "technical");
|
||||
technical.carverHelper.registerAll(technical, "technical");
|
||||
|
||||
BlockCarvableGlass technical2 = (BlockCarvableGlass) new BlockCarvableGlass().setHardness(2.0F).setResistance(10F);
|
||||
technical2.carverHelper.addVariation("tile.technical.0.desc", 0, "technical/scaffoldTransparent");
|
||||
technical2.carverHelper.addVariation("tile.technical.4.desc", 1, "technical/fanFastTransparent");
|
||||
technical2.carverHelper.addVariation("tile.technical.6.desc", 2, "technical/fanStillTransparent");
|
||||
technical2.carverHelper.addVariation("tile.technical.14.desc", 3, "technical/fanStillTransparent");
|
||||
technical2.carverHelper.registerAll(technical2, "technical2");
|
||||
Carving.chisel.registerOre("technical", "technical");
|
||||
technical2.carverHelper.registerBlock(technical2, "technical2");
|
||||
technical2.carverHelper.registerVariations("technical", technical2);
|
||||
|
||||
BlockCarvable technical3 = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F);
|
||||
technical3.carverHelper.addVariation("tile.technical3.0.desc", 0, "technical/massiveFan");
|
||||
technical3.carverHelper.addVariation("tile.technical3.1.desc", 1, "technical/massiveHexPlating");
|
||||
technical2.carverHelper.registerBlock(technical3, "technical3");
|
||||
technical2.carverHelper.registerVariations("technical", technical3);
|
||||
|
||||
Carving.chisel.registerOre("technical", "technical");
|
||||
}
|
||||
|
||||
@Override
|
||||
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 })); //*/
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2305,7 +2450,9 @@ public enum Features {
|
||||
mossy_templeblock.carverHelper.addVariation("tile.mossy_templeblock.15.desc", 15, "templemossy/smalltiles-light");
|
||||
mossy_templeblock.carverHelper.registerAll(mossy_templeblock, "mossy_templeblock");
|
||||
Carving.chisel.registerOre("mossy_templeblock", "mossy_templeblock");
|
||||
};
|
||||
}
|
||||
|
||||
;
|
||||
},
|
||||
|
||||
TIN {
|
||||
@@ -2392,14 +2539,18 @@ public enum Features {
|
||||
void addBlocks() {
|
||||
Carving.chisel.addVariation("torch", Blocks.torch, 0, 0);
|
||||
for (int type = 0; type < 10; type++) {
|
||||
if (type == 8 || type == 9)
|
||||
torch[type] = new BlockCarvableTorch().disableParticles();
|
||||
else
|
||||
torch[type] = new BlockCarvableTorch();
|
||||
|
||||
torch[type].setInformation("torch" + (type + 1));
|
||||
GameRegistry.registerBlock(torch[type], "torch" + (type + 1));
|
||||
Carving.chisel.addVariation("torch", torch[type], 0, (type + 1));
|
||||
String name = "torch" + (type + 1);
|
||||
BlockCarvableTorch t = new BlockCarvableTorch(type, name);
|
||||
if (type == 8 || type == 9) {
|
||||
t.disableParticles();
|
||||
}
|
||||
if (Loader.isModLoaded("ForgeMultipart")) {
|
||||
GameRegistry.registerBlock(t, ItemBlockChiselTorchPart.class, name, t);
|
||||
} else {
|
||||
GameRegistry.registerBlock(t, name);
|
||||
}
|
||||
Carving.chisel.addVariation("torch", t, 0, (type + 1));
|
||||
torches[type] = t;
|
||||
}
|
||||
Carving.chisel.registerOre("torch", "torch");
|
||||
}
|
||||
@@ -2457,16 +2608,27 @@ public enum Features {
|
||||
},
|
||||
|
||||
VALENTINES {
|
||||
@Override void addBlocks() {
|
||||
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockCarvable valentines = (BlockCarvable) new BlockCarvable(Material.wood).setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(2F)
|
||||
.setResistance(10F);
|
||||
valentines.carverHelper.addVariation("tile.valentines.0.desc", 0, "valentines/bricks");
|
||||
valentines.carverHelper.addVariation("tile.valentines.0.desc", 0, "valentines/1");
|
||||
valentines.carverHelper.addVariation("tile.valentines.1.desc", 1, "valentines/companion");
|
||||
valentines.carverHelper.addVariation("tile.valentines.2.desc", 2, "valentines/2");
|
||||
valentines.carverHelper.addVariation("tile.valentines.3.desc", 3, "valentines/3");
|
||||
valentines.carverHelper.addVariation("tile.valentines.4.desc", 4, "valentines/4");
|
||||
valentines.carverHelper.addVariation("tile.valentines.5.desc", 5, "valentines/5");
|
||||
valentines.carverHelper.addVariation("tile.valentines.6.desc", 6, "valentines/6");
|
||||
valentines.carverHelper.addVariation("tile.valentines.7.desc", 7, "valentines/7");
|
||||
valentines.carverHelper.addVariation("tile.valentines.8.desc", 8, "valentines/8");
|
||||
valentines.carverHelper.addVariation("tile.valentines.9.desc", 9, "valentines/9");
|
||||
valentines.carverHelper.registerAll(valentines, "valentines");
|
||||
Carving.chisel.registerOre("valentines", "blockValentines");
|
||||
}
|
||||
|
||||
@Override void addRecipes() {
|
||||
@Override
|
||||
void addRecipes() {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.valentines, 8, 0), "***", "*X*", "***", '*', "stone", 'X', new ItemStack(Items.dye, 1, 9)));
|
||||
}
|
||||
},
|
||||
@@ -2502,6 +2664,16 @@ public enum Features {
|
||||
|
||||
voidstone2.carverHelper.registerAll(voidstone2, "voidstone2");
|
||||
Carving.chisel.registerOre("voidstone2", "voidstone2");
|
||||
|
||||
BlockCarvable voidstoneRunic = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F);
|
||||
voidstoneRunic.carverHelper.setChiselBlockName("Voidstone Runic");
|
||||
|
||||
for (int i = 1; i < 16; i++)
|
||||
voidstoneRunic.carverHelper.addVariation("tile.voidstoneRunic." + i + ".desc", i, "voidstone/runes/rune" + sGNames[i].replaceAll(" ", ""));
|
||||
voidstoneRunic.carverHelper.registerAll(voidstoneRunic, "voidstoneRunic");
|
||||
voidstoneRunic.carverHelper.registerVariations("voidstone", voidstoneRunic);
|
||||
|
||||
Carving.chisel.registerOre("voidstoneRunic", "voidstoneRunic");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2653,7 +2825,6 @@ public enum Features {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
;
|
||||
|
||||
private static final String[] dyeOres = { "dyeBlack", "dyeRed", "dyeGreen", "dyeBrown", "dyeBlue", "dyePurple", "dyeCyan", "dyeLightGray", "dyeGray", "dyePink", "dyeLime", "dyeYellow",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.cricketcraft.chisel.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
@@ -26,4 +28,8 @@ public class BlockCarvableAntiBlock extends BlockCarvableColor implements ICarva
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -35,15 +35,20 @@ public class BlockCarvableBookshelf extends BlockCarvable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random) {
|
||||
public int quantityDropped(Random random) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int par1, Random par2Random, int par3) {
|
||||
public Item getItemDropped(int ammount, Random random, int meta) {
|
||||
return Items.book;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int damage){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEnchantPowerBonus(World world, int x, int y, int z) {
|
||||
return 1;
|
||||
|
||||
@@ -31,7 +31,12 @@ public class BlockCarvablePillar extends BlockCarvable {
|
||||
}
|
||||
|
||||
public IIcon getCtmIcon(int index, int metadata) {
|
||||
CarvableVariation var = carverHelper.variations.get(metadata);
|
||||
//Workaround to prevent crash with invalid meta
|
||||
CarvableVariation var = null;
|
||||
if(metadata <= carverHelper.variations.size())
|
||||
var = carverHelper.variations.get(metadata);
|
||||
else
|
||||
var = carverHelper.variations.get(0);
|
||||
|
||||
if (index >= 4)
|
||||
return var.iconTop;
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.cricketcraft.chisel.block;
|
||||
|
||||
import com.cricketcraft.chisel.entity.EntityChiselSnowman;
|
||||
import com.cricketcraft.chisel.init.ChiselBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPumpkin;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.monster.EntityIronGolem;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -13,6 +18,7 @@ import com.cricketcraft.chisel.carving.CarvableVariation;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
||||
|
||||
@@ -25,11 +31,72 @@ public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
||||
|
||||
public BlockCarvablePumpkin(boolean isOn) {
|
||||
super(isOn);
|
||||
this.setStepSound(Block.soundTypeWood);
|
||||
if (isOn)
|
||||
setLightLevel(10.0F);
|
||||
carverHelper = new CarvableHelper();
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
//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;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
package com.cricketcraft.chisel.block;
|
||||
|
||||
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.UP;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCompressedPowered;
|
||||
import net.minecraft.block.BlockFarmland;
|
||||
import net.minecraft.block.BlockHopper;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.BlockSnow;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -13,6 +22,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -103,5 +113,20 @@ public class BlockCarvableSlab extends BlockCarvable {
|
||||
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.
|
||||
*/
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side)
|
||||
{
|
||||
return !isBottom && (side == UP);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -69,6 +69,10 @@ public class BlockCarvableStairs extends BlockStairs implements ICarvable {
|
||||
|
||||
meta += par1World.getBlockMetadata(par2, par3, par4) % 8; // add upside-down-ness
|
||||
|
||||
if (par6ItemStack.getItemDamage() >= 8) {
|
||||
meta += 8;
|
||||
}
|
||||
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta, 2);
|
||||
}
|
||||
|
||||
@@ -84,6 +88,6 @@ public class BlockCarvableStairs extends BlockStairs implements ICarvable {
|
||||
|
||||
@Override
|
||||
public CarvableVariation getVariation(ItemStack stack) {
|
||||
return carverHelper.getVariation(stack.getItemDamage());
|
||||
return carverHelper.getVariation(blockMeta + (stack.getItemDamage() / 8));
|
||||
}
|
||||
}
|
||||
@@ -22,13 +22,16 @@ public class BlockCarvableTorch extends BlockTorch implements ICarvable {
|
||||
public CarvableHelper carverHelper;
|
||||
private String texLocation;
|
||||
protected boolean emitsParticles = true;
|
||||
public int idx;
|
||||
|
||||
public BlockCarvableTorch() {
|
||||
public BlockCarvableTorch(int idx, String tex) {
|
||||
super();
|
||||
carverHelper = new CarvableHelper();
|
||||
setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
|
||||
setLightLevel(0.9375F);
|
||||
setBlockName("torch");
|
||||
this.idx = idx;
|
||||
this.texLocation = tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,11 +48,7 @@ public class BlockCarvableTorch extends BlockTorch implements ICarvable {
|
||||
public void registerBlockIcons(IIconRegister icon) {
|
||||
this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":torch/" + texLocation);
|
||||
}
|
||||
|
||||
public void setInformation(String textureLocation) {
|
||||
this.texLocation = textureLocation;
|
||||
}
|
||||
|
||||
|
||||
public BlockCarvableTorch disableParticles() {
|
||||
this.emitsParticles = false;
|
||||
return this;
|
||||
|
||||
@@ -31,7 +31,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class BlockPresent extends Block implements ICarvable {
|
||||
|
||||
public CarvableHelper carverHelper;
|
||||
|
||||
|
||||
private float minX, minY, minZ, maxX, maxY, maxZ;
|
||||
|
||||
public BlockPresent() {
|
||||
@@ -48,7 +48,7 @@ public class BlockPresent extends Block implements ICarvable {
|
||||
public String getModelTexture(int type) {
|
||||
return "textures/blocks/present/presentChest" + type;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
@@ -118,12 +118,16 @@ 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;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
public AxisAlignedBB getBoundingBox(TileEntityPresent me) {
|
||||
@@ -169,7 +173,7 @@ public class BlockPresent extends Block implements ICarvable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata) {
|
||||
return true;
|
||||
@@ -193,7 +197,7 @@ public class BlockPresent extends Block implements ICarvable {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package com.cricketcraft.chisel.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.cricketcraft.chisel.client.GeneralChiselClient;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.cricketcraft.chisel.client.GeneralChiselClient;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockSnakestoneObsidian extends BlockSnakestone {
|
||||
|
||||
public IIcon[] particles = new IIcon[8];
|
||||
public static IIcon[] particles = new IIcon[8];
|
||||
|
||||
public BlockSnakestoneObsidian(String iconPrefix) {
|
||||
super(iconPrefix);
|
||||
|
||||
@@ -141,8 +141,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
// if we have the stack upgrade, boost the stack size to the max possible, otherwise just one
|
||||
chiseled.stackSize = hasUpgrade(Upgrade.STACK) ? canBeMade : 1;
|
||||
|
||||
// if we can place the result in the output
|
||||
if (canMerge(chiseled)) {
|
||||
if (canChisel(chiseled)) {
|
||||
// if our output is empty, just use the current result
|
||||
if (output == null) {
|
||||
setInventorySlotContents(OUTPUT, chiseled);
|
||||
@@ -187,7 +186,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean canMerge(ItemStack toMerge) {
|
||||
private boolean canChisel(ItemStack toMerge) {
|
||||
// if the output slot is empty we can merge without checking
|
||||
if (inventory[OUTPUT] == null) {
|
||||
return true;
|
||||
@@ -198,7 +197,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
return !toMerge.getHasSubtypes() || toMerge.getItemDamage() == inventory[OUTPUT].getItemDamage();
|
||||
}
|
||||
|
||||
return false;
|
||||
return ((IChiselItem)inventory[CHISEL].getItem()).canChisel(worldObj, inventory[CHISEL], General.getVariation(inventory[TARGET]));
|
||||
}
|
||||
|
||||
private boolean hasChisel() {
|
||||
|
||||
@@ -21,6 +21,8 @@ import com.cricketcraft.chisel.network.message.MessagePresentConnect;
|
||||
public class TileEntityPresent extends TileEntity implements IInventory, IDoubleChest {
|
||||
|
||||
private TileEntityPresent connection = null;
|
||||
// If cachedDir is non-null, but connection is null, this present must be
|
||||
// connected to an unloaded present. This is handled appropriately.
|
||||
private ForgeDirection cachedDir = null;
|
||||
private boolean isParent;
|
||||
private final ItemStack[] inventory = new ItemStack[27];
|
||||
@@ -29,14 +31,10 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (isConnected() && connection.isInvalid()) {
|
||||
disconnect();
|
||||
}
|
||||
|
||||
if (autoSearch && worldObj != null /* ugh */) {
|
||||
if (!isConnected() && autoSearch && worldObj != null /* ugh */) {
|
||||
if (cachedDir != null) {
|
||||
connectTo(cachedDir);
|
||||
} else {
|
||||
} else if (!worldObj.isRemote){
|
||||
findConnections();
|
||||
}
|
||||
autoSearch = false;
|
||||
@@ -48,7 +46,7 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
}
|
||||
|
||||
private boolean connectTo(TileEntityPresent present, ForgeDirection dir) {
|
||||
if (present.getBlockMetadata() == getBlockMetadata() && !present.isConnected() && 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();
|
||||
@@ -63,22 +61,31 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
}
|
||||
|
||||
public boolean connectTo(ForgeDirection dir) {
|
||||
TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
|
||||
int x = xCoord + dir.offsetX, y = yCoord + dir.offsetY, z = zCoord + dir.offsetZ;
|
||||
TileEntity te = getTileSafe(x, y, z);
|
||||
if (te instanceof TileEntityPresent) {
|
||||
return connectTo((TileEntityPresent) te, dir);
|
||||
}
|
||||
return false;
|
||||
return !exists(x, y, z);
|
||||
}
|
||||
|
||||
public void disconnect() {
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
public void disconnect(boolean preserveDir) {
|
||||
if (isConnected()) {
|
||||
this.connection.cachedDir = null;
|
||||
if (!preserveDir) {
|
||||
this.connection.cachedDir = null;
|
||||
this.cachedDir = null;
|
||||
}
|
||||
this.connection.connection = null;
|
||||
this.connection.markDirty();
|
||||
this.cachedDir = null;
|
||||
this.connection = null;
|
||||
this.markDirty();
|
||||
PacketHandler.INSTANCE.sendToDimension(new MessagePresentConnect(this, ForgeDirection.UNKNOWN, false), worldObj.provider.dimensionId);
|
||||
PacketHandler.INSTANCE.sendToDimension(new MessagePresentConnect(this, ForgeDirection.UNKNOWN, false, preserveDir), worldObj.provider.dimensionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,16 +111,21 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
|
||||
public void findConnections() {
|
||||
if (!isConnected()) {
|
||||
if (cachedDir != null) {
|
||||
if (connectTo(cachedDir)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (dir != ForgeDirection.UP && dir != ForgeDirection.DOWN) {
|
||||
if (connectTo(dir)) {
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public TileEntityPresent getParent() {
|
||||
return isParent || connection == null ? this : connection;
|
||||
}
|
||||
@@ -124,15 +136,12 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag)
|
||||
{
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < getTrueSizeInventory(); ++i)
|
||||
{
|
||||
if (inventory[i] != null)
|
||||
{
|
||||
for (int i = 0; i < getTrueSizeInventory(); ++i) {
|
||||
if (inventory[i] != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
nbttagcompound1.setByte("Slot", (byte) i);
|
||||
inventory[i].writeToNBT(nbttagcompound1);
|
||||
@@ -149,18 +158,15 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag)
|
||||
{
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
NBTTagList nbttaglist = tag.getTagList("Items", 10);
|
||||
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i)
|
||||
{
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
|
||||
int j = nbttagcompound1.getByte("Slot") & 255;
|
||||
|
||||
if (j >= 0 && j < getTrueSizeInventory())
|
||||
{
|
||||
if (j >= 0 && j < getTrueSizeInventory()) {
|
||||
inventory[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
@@ -173,7 +179,7 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
}
|
||||
autoSearch = true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
@@ -185,13 +191,29 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
|
||||
readFromNBT(packet.func_148857_g());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) {
|
||||
// prevent losing TE data when in-world chiseling
|
||||
return oldBlock != newBlock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
if (isConnected()) {
|
||||
disconnect(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
if (isConnected()) {
|
||||
disconnect(true);
|
||||
}
|
||||
}
|
||||
|
||||
private int getAdjustedSlot(int slot) {
|
||||
slot %= getSizeInventory();
|
||||
if (isConnected() && !isParent) {
|
||||
@@ -199,7 +221,32 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
}
|
||||
return slot;
|
||||
}
|
||||
|
||||
|
||||
private TileEntity getTileSafe(int x, int y, int z) {
|
||||
if (exists(x, y, z)) {
|
||||
return worldObj.getTileEntity(x, y, z);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// private Block getBlockSafe(int x, int y, int z) {
|
||||
// if (exists(x, y, z)) {
|
||||
// return worldObj.getBlock(x, y, z);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// private int getMetaSafe(int x, int y, int z) {
|
||||
// if (exists(x, y, z)) {
|
||||
// return worldObj.getBlockMetadata(x, y, z);
|
||||
// }
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
private boolean exists(int x, int y, int z) {
|
||||
return worldObj.blockExists(x, y, z);
|
||||
}
|
||||
|
||||
/* IInventory */
|
||||
|
||||
@Override
|
||||
@@ -218,41 +265,34 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int amount)
|
||||
{
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
slot = getAdjustedSlot(slot);
|
||||
ItemStack[] inv = inventory;
|
||||
if (isConnected() && slot >= getTrueSizeInventory()) {
|
||||
inv = connection.inventory;
|
||||
slot %= getTrueSizeInventory();
|
||||
connection.markDirty();
|
||||
}
|
||||
|
||||
if (inv[slot] != null)
|
||||
{
|
||||
if (inv[slot] != null) {
|
||||
ItemStack itemstack;
|
||||
|
||||
if (inv[slot].stackSize <= amount)
|
||||
{
|
||||
if (inv[slot].stackSize <= amount) {
|
||||
itemstack = inv[slot];
|
||||
inv[slot] = null;
|
||||
this.markDirty();
|
||||
return itemstack;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
itemstack = inv[slot].splitStack(amount);
|
||||
|
||||
if (inv[slot].stackSize == 0)
|
||||
{
|
||||
if (inv[slot].stackSize == 0) {
|
||||
inv[slot] = null;
|
||||
}
|
||||
|
||||
this.markDirty();
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -269,6 +309,7 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
inventory[slot] = stack;
|
||||
} else if (isConnected()) {
|
||||
connection.inventory[slot % getTrueSizeInventory()] = stack;
|
||||
connection.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,21 +347,21 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* IDoubleChest */
|
||||
|
||||
|
||||
@Override
|
||||
public int getTrueSizeInventory() {
|
||||
return inventory.length;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getTrueStackInSlot(int slot) {
|
||||
return inventory[slot % getTrueSizeInventory()];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void putStackInTrueSlot(int slot, ItemStack stack) {
|
||||
inventory[slot % getTrueSizeInventory()] = stack;
|
||||
inventory[slot % getTrueSizeInventory()] = stack;
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,12 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPane;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -18,10 +20,11 @@ import org.apache.commons.lang3.ArrayUtils;
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.api.client.CTM;
|
||||
import com.cricketcraft.chisel.client.render.TextureSubmap;
|
||||
import com.cricketcraft.chisel.compat.FMPIntegration;
|
||||
import com.cricketcraft.chisel.compat.fmp.FMPIMC;
|
||||
import com.cricketcraft.chisel.item.ItemCarvable;
|
||||
import com.cricketcraft.chisel.utils.GeneralClient;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class CarvableHelper {
|
||||
@@ -84,27 +87,48 @@ public class CarvableHelper {
|
||||
public boolean forbidChiseling = false;
|
||||
public String blockName;
|
||||
|
||||
public void addVariation(String description, int metadata, Block bb) {
|
||||
addVariation(description, metadata, null, bb, 0);
|
||||
public void addVariation(String description, int metadata, Block bb) {
|
||||
addVariation(description, metadata, null, bb, 0, Chisel.MOD_ID);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, Block bb, int blockMeta) {
|
||||
addVariation(description, metadata, null, bb, blockMeta, Chisel.MOD_ID);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material) {
|
||||
addVariation(description, metadata, null, bb, blockMeta, Chisel.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, Chisel.MOD_ID, manager);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, Block bb, String modid) {
|
||||
addVariation(description, metadata, null, bb, 0, modid);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, Block bb, int blockMeta) {
|
||||
addVariation(description, metadata, null, bb, blockMeta);
|
||||
public void addVariation(String description, int metadata, Block bb, int blockMeta, String modid) {
|
||||
addVariation(description, metadata, null, bb, blockMeta, modid);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material) {
|
||||
addVariation(description, metadata, null, bb, blockMeta);
|
||||
public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material, String modid) {
|
||||
addVariation(description, metadata, null, bb, blockMeta, modid);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, String texture) {
|
||||
addVariation(description, metadata, texture, null, 0);
|
||||
public void addVariation(String description, int metadata, String texture, String modid) {
|
||||
addVariation(description, metadata, texture, null, 0, modid);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, String texture, Block block, int blockMeta) {
|
||||
addVariation(description, metadata, texture, block, blockMeta, null);
|
||||
public void addVariation(String description, int metadata, String texture, Block block, int blockMeta, String modid) {
|
||||
addVariation(description, metadata, texture, block, blockMeta, modid, null);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, String texture, Block block, int blockMeta, ISubmapManager customManager) {
|
||||
public void addVariation(String description, int metadata, String texture, Block block, int blockMeta, String modid, ISubmapManager customManager) {
|
||||
|
||||
if (variations.size() >= 16)
|
||||
return;
|
||||
|
||||
@@ -118,7 +142,7 @@ public class CarvableHelper {
|
||||
variation.metadata = metadata;
|
||||
variation.blockName = blockName;
|
||||
|
||||
if (texture != null) {
|
||||
if (texture != null && FMLCommonHandler.instance().getSide().isClient()) {
|
||||
variation.texture = texture;
|
||||
String path = "/assets/" + Chisel.MOD_ID + "/textures/blocks/" + variation.texture;
|
||||
variation.type = (TextureType) TextureType.getTypeFor(path);
|
||||
@@ -136,6 +160,17 @@ public class CarvableHelper {
|
||||
map[metadata] = variation;
|
||||
}
|
||||
|
||||
// This is ugly, but faster than class.getResource
|
||||
private boolean exists(String modid, String path, String postfix) {
|
||||
ResourceLocation rl = new ResourceLocation(modid, "textures/blocks/" + path + postfix + ".png");
|
||||
try {
|
||||
Minecraft.getMinecraft().getResourceManager().getAllResources(rl);
|
||||
return true;
|
||||
} catch (Throwable t) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public CarvableVariation getVariation(int metadata) {
|
||||
if (metadata < 0 || metadata > 15)
|
||||
metadata = 0;
|
||||
@@ -245,7 +280,7 @@ public class CarvableHelper {
|
||||
|
||||
boolean p;
|
||||
boolean n;
|
||||
boolean reverse = side == 2 || side == 4;
|
||||
boolean reverse = side == 2 || side == 5;
|
||||
|
||||
if (side < 4) {
|
||||
p = ctm.isConnected(world, x - 1, y, z, side, block, metadata);
|
||||
@@ -262,40 +297,40 @@ public class CarvableHelper {
|
||||
else if (n)
|
||||
return variation.seamsCtmVert.icons[reverse ? 3 : 2];
|
||||
return variation.seamsCtmVert.icons[0];
|
||||
case V9:
|
||||
case V4:
|
||||
int variationSize = (variation.type == TextureType.V9) ? 3 : 2;
|
||||
case V9:
|
||||
case V4:
|
||||
int variationSize = (variation.type == TextureType.V9) ? 3 : 2;
|
||||
|
||||
int xModulus = x % variationSize;
|
||||
int zModulus = z % variationSize;
|
||||
// This ensures that blocks placed near 0,0 or it's axis' do not misbehave
|
||||
int textureX = (xModulus < 0) ? (xModulus + variationSize) : xModulus;
|
||||
int textureZ = (zModulus < 0) ? (zModulus + variationSize) : zModulus;
|
||||
// Always invert the y index
|
||||
int textureY = (variationSize - (y % variationSize) - 1);
|
||||
int xModulus = x % variationSize;
|
||||
int zModulus = z % variationSize;
|
||||
//This ensures that blocks placed near 0,0 or it's axis' do not misbehave
|
||||
int textureX = (xModulus < 0) ? (xModulus + variationSize) : xModulus;
|
||||
int textureZ = (zModulus < 0) ? (zModulus + variationSize) : zModulus;
|
||||
//Always invert the y index
|
||||
int textureY = (variationSize - (y % variationSize) - 1);
|
||||
|
||||
if (side == 2 || side == 5) {
|
||||
// For WEST, SOUTH reverse the indexes for both X and Z
|
||||
textureX = (variationSize - textureX - 1);
|
||||
textureZ = (variationSize - textureZ - 1);
|
||||
} else if (side == 0) {
|
||||
// For DOWN, reverse the indexes for only Z
|
||||
textureZ = (variationSize - textureZ - 1);
|
||||
}
|
||||
if (side == 2 || side == 5) {
|
||||
//For WEST, SOUTH reverse the indexes for both X and Z
|
||||
textureX = (variationSize - textureX - 1);
|
||||
textureZ = (variationSize - textureZ - 1);
|
||||
} /*else if (side == 0) {
|
||||
//For DOWN, reverse the indexes for only Z
|
||||
textureZ = (variationSize - textureZ - 1);
|
||||
}//*/
|
||||
|
||||
int index;
|
||||
if (side == 0 || side == 1) {
|
||||
// DOWN || UP
|
||||
index = textureX + textureZ * variationSize;
|
||||
} else if (side == 2 || side == 3) {
|
||||
// NORTH || SOUTH
|
||||
index = textureX + textureY * variationSize;
|
||||
} else {
|
||||
// WEST || EAST
|
||||
index = textureZ + textureY * variationSize;
|
||||
}
|
||||
int index;
|
||||
if (side == 0 || side == 1) {
|
||||
// DOWN || UP
|
||||
index = textureX + textureZ * variationSize;
|
||||
} else if (side == 2 || side == 3) {
|
||||
// NORTH || SOUTH
|
||||
index = textureX + textureY * variationSize;
|
||||
} else {
|
||||
// WEST || EAST
|
||||
index = textureZ + textureY * variationSize;
|
||||
}
|
||||
|
||||
return variation.variations9.icons[index];
|
||||
return variation.variations9.icons[index];
|
||||
case CTMX:
|
||||
return variation.icon;
|
||||
case R16:
|
||||
@@ -347,7 +382,7 @@ public class CarvableHelper {
|
||||
public void registerVariation(String name, CarvableVariation variation, Block block, int blockMeta) {
|
||||
|
||||
if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) {
|
||||
FMPIntegration.registerFMP(block, blockMeta);
|
||||
FMPIMC.registerFMP(block, blockMeta);
|
||||
}
|
||||
|
||||
if (forbidChiseling)
|
||||
|
||||
@@ -31,7 +31,7 @@ public class GeneralChiselClient {
|
||||
public static int tick = 0;
|
||||
|
||||
public static void spawnLavastoneFX(World world, BlockLavastone block, int x, int y, int z) {
|
||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0)
|
||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0)
|
||||
return;
|
||||
|
||||
float f = 0.15F;
|
||||
@@ -79,7 +79,7 @@ public class GeneralChiselClient {
|
||||
}
|
||||
|
||||
public static void spawnHolystoneFX(World world, BlockHolystone block, int x, int y, int z) {
|
||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0)
|
||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0)
|
||||
return;
|
||||
|
||||
float f = 0.15F;
|
||||
@@ -165,14 +165,14 @@ public class GeneralChiselClient {
|
||||
}
|
||||
|
||||
public static void spawnSnakestoneObsidianFX(World world, BlockSnakestoneObsidian block, int x, int y, int z) {
|
||||
if (Configurations.particlesTickrate != 0 || tick++ % Configurations.particlesTickrate != 0) {
|
||||
if (Configurations.particlesTickrate != 0 || tick++ % Configurations.particlesTickrate != 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
||||
EntitySnakestoneObsidianFX res = new EntitySnakestoneObsidianFX(world, block, x, y, z);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnBallOMossFX(World world, double x, double y, double z) {
|
||||
if (Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0) {
|
||||
if (Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0 || Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
||||
EntityBallOMossFX res = new EntityBallOMossFX(world, x, y, z);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ public class GeneralChiselClient {
|
||||
|
||||
public static EntityDiggingFX addBlockHitEffects(World world, int x, int y, int z, int side) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block.isAir(world, x, y, z))
|
||||
if (block.isAir(world, x, y, z) || Minecraft.getMinecraft().gameSettings.particleSetting != 0)
|
||||
return null;
|
||||
|
||||
EffectRenderer renderer = Minecraft.getMinecraft().effectRenderer;
|
||||
@@ -257,9 +257,10 @@ public class GeneralChiselClient {
|
||||
}
|
||||
|
||||
public static void spawnAutoChiselFX(TileEntityAutoChisel te, ItemStack base) {
|
||||
if (base != null) {
|
||||
if (base != null && Minecraft.getMinecraft().gameSettings.particleSetting == 0) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
EntityDiggingFX particle = new EntityDiggingFX(te.getWorldObj(), te.xCoord + 0.5, te.yCoord + 0.95, te.zCoord + 0.5, 0, 0, 0, Block.getBlockFromItem(base.getItem()), base.getItemDamage());
|
||||
EntityDiggingFX particle = new EntityDiggingFX(te.getWorldObj(), te.xCoord + 0.5, te.yCoord + 0.95, te.zCoord + 0.5, 0, 0, 0, Block.getBlockFromItem(base.getItem()),
|
||||
base.getItemDamage());
|
||||
particle.setVelocity((te.getWorldObj().rand.nextDouble() / 4) - 0.125, te.getWorldObj().rand.nextDouble() / 8, (te.getWorldObj().rand.nextDouble() / 4) - 0.125);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -56,6 +57,15 @@ public class GuiChisel extends GuiContainer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
super.updateScreen();
|
||||
ItemStack held = player.getCurrentEquippedItem();
|
||||
if (held == null || !(held.getItem() instanceof IChiselItem)) {
|
||||
mc.displayGuiScreen(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void setButtonText() {
|
||||
((GuiButton) buttonList.get(0)).displayString = I18n.format(container.inventory.getInventoryName() + ".mode." + currentMode.name().toLowerCase());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
package com.cricketcraft.chisel.client.player;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.event.RenderLivingEvent;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.cricketcraft.chisel.init.ChiselItems;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class PlayerSpecials {
|
||||
|
||||
private interface IDevRenderer {
|
||||
|
||||
void renderPlayer(EntityPlayer player, boolean post);
|
||||
|
||||
void renderExtras(EntityPlayer player, boolean post);
|
||||
}
|
||||
|
||||
private class RenderHolstered implements IDevRenderer {
|
||||
|
||||
private ItemStack toRender;
|
||||
|
||||
private RenderHolstered(ItemStack toRender) {
|
||||
this.toRender = toRender;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderExtras(EntityPlayer player, boolean post) {
|
||||
if (!post) {
|
||||
GL11.glPushMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
|
||||
if (player.isSneaking()) {
|
||||
GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
boolean armor = player.getCurrentArmor(1) != null;
|
||||
GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(-0.25F, -0.85F, armor ? 0.2F : 0.28F);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glColor3f(1.0F, 1.0F, 1.0F);
|
||||
int light = 0xF000F0;
|
||||
int lightmapX = light % 0x10000;
|
||||
int lightmapY = light / 0x10000;
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY);
|
||||
|
||||
IIcon icon = toRender.getIconIndex();
|
||||
ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 1.0F / 16.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderPlayer(EntityPlayer player, boolean post) {
|
||||
}
|
||||
}
|
||||
|
||||
private class RenderTranslucent implements IDevRenderer {
|
||||
|
||||
@Override
|
||||
public void renderExtras(EntityPlayer player, boolean post) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderPlayer(EntityPlayer player, boolean post) {
|
||||
if (!post) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
} else {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final PlayerSpecials INSTANCE = new PlayerSpecials();
|
||||
|
||||
private Multimap<UUID, IDevRenderer> renderMap = ArrayListMultimap.create();
|
||||
|
||||
private PlayerSpecials() {
|
||||
RenderHolstered backChisel = new RenderHolstered(new ItemStack(ChiselItems.obsidianChisel));
|
||||
RenderTranslucent translucent = new RenderTranslucent();
|
||||
|
||||
renderMap.putAll(UUID.fromString("a7529984-8cb2-4fb9-b799-97980f770101"), Lists.newArrayList(backChisel, translucent)); // Cricket
|
||||
renderMap.putAll(UUID.fromString("a1d2532b-ee11-4ca3-b4c5-76e168d4c98e"), Lists.newArrayList(backChisel, translucent)); // TheCricket26
|
||||
renderMap.putAll(UUID.fromString("5399b615-3440-4c66-939d-ab1375952ac3"), Lists.newArrayList(backChisel, translucent)); // Drullkus
|
||||
|
||||
renderMap.put(UUID.fromString("671516b1-4fb3-4c03-aa7c-9c88cfab3ae8"), new RenderHolstered(new ItemStack(ChiselItems.diamondChisel))); // tterrag
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onPlayerRenderPre(RenderLivingEvent.Pre event) {
|
||||
if(nameIsGood(event.entity)){
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerRenderPost(RenderLivingEvent.Post event) {
|
||||
if(nameIsGood(event.entity)){
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerRenderSpecialPre(RenderPlayerEvent.Specials.Pre event) {
|
||||
Collection<IDevRenderer> renders = renderMap.get(event.entityPlayer.getUniqueID());
|
||||
for (IDevRenderer r : renders) {
|
||||
r.renderExtras(event.entityPlayer, false);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerRenderSpecialPost(RenderPlayerEvent.Specials.Post event) {
|
||||
Collection<IDevRenderer> renders = renderMap.get(event.entityPlayer.getUniqueID());
|
||||
for (IDevRenderer r : renders) {
|
||||
r.renderExtras(event.entityPlayer, true);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean nameIsGood(Entity entity){
|
||||
if(EnumChatFormatting.getTextWithoutFormattingCodes(entity.getCommandSenderName()).equals("Cricket") || EnumChatFormatting.getTextWithoutFormattingCodes(entity.getCommandSenderName()).equals("TheCricket26"))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class BlockMarblePillarRenderer implements ISimpleBlockRenderingHandler {
|
||||
renderer.uvRotateEast = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateBottom = 1;
|
||||
renderer.uvRotateBottom = 2;
|
||||
|
||||
block.sides[4] = block.getCtmIcon(4, metadata);
|
||||
block.sides[5] = block.getCtmIcon(4, metadata);
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
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;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
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{
|
||||
|
||||
private static final ResourceLocation snowManTextures = new ResourceLocation("textures/entity/snowman.png");
|
||||
private ModelSnowMan snowMan;
|
||||
|
||||
public RenderChiselSnowman() {
|
||||
super(new ModelSnowMan(), 0.5F);
|
||||
snowMan = (ModelSnowMan)super.mainModel;
|
||||
setRenderPassModel(this.snowMan);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderEquippedItems(EntityLivingBase entityLivingBase, float size){
|
||||
this.renderEquippedItems((EntityChiselSnowman) entityLivingBase, size);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity entity) {
|
||||
return this.getEntityTexture((EntityChiselSnowman) entity);
|
||||
}
|
||||
|
||||
protected ResourceLocation getEntityTexture(EntityChiselSnowman snowman){
|
||||
return snowManTextures;
|
||||
}
|
||||
|
||||
protected void renderEquippedItems(EntityChiselSnowman snowman, float size){
|
||||
super.renderEquippedItems(snowman, size);
|
||||
ItemStack itemStack = snowman.getEquipmentInSlot(2);
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.cricketcraft.chisel.compat;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import com.cricketcraft.chisel.carving.Carving;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
@@ -12,10 +15,22 @@ public class Compatibility {
|
||||
|
||||
public static String[] rockColorNames = { "gray", "lightgray", "brown", "tan", "reddish", "bluish", "greenish" };
|
||||
|
||||
public static void init(FMLPostInitializationEvent event) {
|
||||
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");
|
||||
}
|
||||
|
||||
public static void init(FMLPostInitializationEvent event) {
|
||||
|
||||
/* Proj Red */
|
||||
addSupport("ProjRed|Exploration", "projectred.exploration.stone", "marble", 0, 99);
|
||||
addSupport("ProjRed|Exploration", "projectred.exploration.stone", "marble", 1, 99);
|
||||
|
||||
/* Bluepower */
|
||||
addSupport("bluepower", "marble", "marble", 0, 99);
|
||||
@@ -44,7 +59,23 @@ public class Compatibility {
|
||||
addSupport("PFAAGeologica", "mediumStoneBrickStairs.limestone", "limestoneStairs", 0, 99);
|
||||
addSupport("PFAAGeologica", "strongStoneBrick", "stoneBrick", 3, 99);
|
||||
addSupport("PFAAGeologica", "strongCobble", "cobblestone", 3, 99);
|
||||
}
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
addSupport("TConstruct", "decoration.multibrickfancy", "stonebricksmooth", 14, 99);
|
||||
addSupport("TConstruct", "decoration.multibrickfancy", "stonebricksmooth", 15, 99);
|
||||
|
||||
addSupport("Botania", "endStoneBrick", "end_stone", 12, 0);
|
||||
}
|
||||
|
||||
public static void addSupport(String modname, String blockname, String name, int metadata, int order) {
|
||||
if (Loader.isModLoaded(modname) && GameRegistry.findBlock(modname, blockname) != null) {
|
||||
@@ -55,4 +86,9 @@ public class Compatibility {
|
||||
public static void addSupport(String name, Block block, int metadata, int order) {
|
||||
Carving.chisel.addVariation(name, block, metadata, order);
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -40,15 +40,16 @@ public class IMCHandler {
|
||||
} else {
|
||||
reg.removeVariation(block, meta, data[0]);
|
||||
}
|
||||
break;
|
||||
case REGISTER_GROUP_ORE:
|
||||
reg.registerOre(data[0], data[1]);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Invalid IMC constant! How...what...?");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Chisel.logger.error("Could not handle data {} for IMC type {}. This was sent from mod {}.\n"
|
||||
+ "!! This is a bug in that mod !!\nSwallowing error and continuing...",
|
||||
value, type.name(), message.getSender());
|
||||
Chisel.logger.error("Could not handle data {} for IMC type {}. This was sent from mod {}.\n" + "!! This is a bug in that mod !!\nSwallowing error and continuing...", value, type.name(),
|
||||
message.getSender());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
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.IPartConverter;
|
||||
import codechicken.multipart.MultiPartRegistry.IPartFactory;
|
||||
import codechicken.multipart.MultiPartRegistry;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
|
||||
public class FMPCompat implements IPartFactory, IPartConverter {
|
||||
|
||||
public void init() {
|
||||
MultiPartRegistry.registerConverter(this);
|
||||
MultiPartRegistry.registerParts(this, new String[] { "chisel_torch" });
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<Block> blockTypes() {
|
||||
return Lists.newArrayList(ChiselBlocks.torches);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TMultiPart convert(World world, BlockCoord bc) {
|
||||
Block block = world.getBlock(bc.x, bc.y, bc.z);
|
||||
for (int i = 0; i < ChiselBlocks.torches.length; i++) {
|
||||
if (block == ChiselBlocks.torches[i]) {
|
||||
return new PartChiselTorch(i, world.getBlockMetadata(bc.x, bc.y, bc.z));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TMultiPart createPart(String type, boolean client) {
|
||||
if (type.equals("chisel_torch")) {
|
||||
return new PartChiselTorch();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package com.cricketcraft.chisel.compat;
|
||||
package com.cricketcraft.chisel.compat.fmp;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
public class FMPIntegration {
|
||||
public class FMPIMC {
|
||||
|
||||
public static void registerFMP(Block block) {
|
||||
registerFMP(block, 0, 15);
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.cricketcraft.chisel.compat.fmp;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import codechicken.lib.vec.BlockCoord;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
import codechicken.multipart.minecraft.TorchPart;
|
||||
|
||||
import com.cricketcraft.chisel.block.BlockCarvableTorch;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemBlockChiselTorchPart extends ItemBlock {
|
||||
|
||||
private BlockCarvableTorch torch;
|
||||
|
||||
// Blame FML for the duped params, these references will always be the same
|
||||
public ItemBlockChiselTorchPart(Block block, BlockCarvableTorch torch) {
|
||||
super(block);
|
||||
this.torch = torch;
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
public TMultiPart createMultiPart(World world, BlockCoord pos, ItemStack item, int side) {
|
||||
return new PartChiselTorch(torch.idx, TorchPart.sideMetaMap[side ^ 1]);
|
||||
}
|
||||
|
||||
public boolean placePart(World world, BlockCoord pos, ItemStack item, int side, boolean doPlace) {
|
||||
TileMultipart tile = TileMultipart.getOrConvertTile(world, pos);
|
||||
if (tile == null) {
|
||||
return false;
|
||||
}
|
||||
TMultiPart part = createMultiPart(world, pos, item, side);
|
||||
if (part == null) {
|
||||
return false;
|
||||
}
|
||||
if (tile.canAddPart(part)) {
|
||||
if (doPlace) {
|
||||
TileMultipart.addPart(world, pos, part);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
BlockCoord pos = new BlockCoord(x, y, z);
|
||||
if (!block.isReplaceable(world, x, y, z)) {
|
||||
pos = new BlockCoord(x, y, z).offset(side);
|
||||
}
|
||||
if (placePart(world, pos, stack, side, !world.isRemote)) {
|
||||
world.playSoundEffect(pos.x + 0.5F, pos.y + 0.5F, pos.z + 0.5F, field_150939_a.stepSound.func_150496_b(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
|
||||
stack.stackSize -= 1;
|
||||
return true;
|
||||
}
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
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;
|
||||
|
||||
public class PartChiselTorch extends TorchPart {
|
||||
|
||||
private int idx;
|
||||
|
||||
public PartChiselTorch() {
|
||||
}
|
||||
|
||||
public PartChiselTorch(int idx, int meta) {
|
||||
super(meta);
|
||||
this.idx = idx;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDesc(MCDataOutput packet) {
|
||||
super.writeDesc(packet);
|
||||
packet.writeInt(idx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readDesc(MCDataInput packet) {
|
||||
super.readDesc(packet);
|
||||
this.idx = packet.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(NBTTagCompound tag) {
|
||||
super.save(tag);
|
||||
tag.setInteger("idx", idx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(NBTTagCompound tag) {
|
||||
super.load(tag);
|
||||
this.idx = tag.getInteger("idx");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlock() {
|
||||
return ChiselBlocks.torches[idx];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "chisel_torch";
|
||||
}
|
||||
}
|
||||
@@ -67,13 +67,13 @@ public class Configurations {
|
||||
"Traversing concrete roads, players will acceleration to this velocity. For reference, normal running speed is about 0.28. Set to 0 to disable acceleration.").getDouble(0.45);
|
||||
ghostCloud = config.get(category, "doesCloudRenderLikeGhost", true).getBoolean(true);
|
||||
factoryBlockAmount = config.get(category, "amountYouGetFromFactoryBlockCrafting", 32).getInt(32);
|
||||
allowMossy = config.get(category, "allowCobbleToMossyInChisel", true).getBoolean(true);
|
||||
allowMossy = config.get(category, "allowBrickToMossyInChisel", true, "If true, you can chisel stone brick to mossy stone brick.").getBoolean(true);
|
||||
allowSmoothStone = config.get(category, "allowSmoothStoneToStoneBricksAndBack", true).getBoolean(true);
|
||||
chiselRecipe = config.get(category, "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel").getBoolean(false);
|
||||
enableFMP = config.get(category, "enableFMP", true, "Do you want to enable FMP").getBoolean(true);
|
||||
chiselStoneToCobbleBricks = config.get(category, "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false);
|
||||
chiselBackToVanillaLeaves = config.get(category, "chiselBackToVanillaLeaves", false, "If this is true, you can chisel from the chisel leaves back to vanilla ones. If it is false, you cannot.")
|
||||
.getBoolean(false);
|
||||
chiselBackToVanillaLeaves = config
|
||||
.get(category, "chiselBackToVanillaLeaves", false, "If this is true, you can chisel from the chisel leaves back to vanilla ones. If it is false, you cannot.").getBoolean(false);
|
||||
|
||||
/* worldgen */
|
||||
category = "worldgen";
|
||||
@@ -103,12 +103,13 @@ public class Configurations {
|
||||
ironChiselCanLeftClick = config.get(category, "ironChiselCanLeftClick", true, "If this is true, the iron chisel can left click chisel blocks. If false, it cannot.").getBoolean();
|
||||
ironChiselHasModes = config.get(category, "ironChiselHasModes", false, "If this is true, the iron chisel can change its chisel mode just as the diamond chisel can.").getBoolean();
|
||||
allowChiselCrossColors = config.get(category, "allowChiselCrossColors", true, "Should someone be able to chisel something into a different color.").getBoolean();
|
||||
ironChiselAttackDamage = config.get(category, "ironChiselAttackDamage", 2, "The extra attack damage points (in half hearts) that the iron chisel inflicts when it is used to attack an entity.")
|
||||
.getInt();
|
||||
diamondChiselAttackDamage = config
|
||||
.get(category, "diamondChiselAttackDamage", 2, "The extra attack damage points (in half hearts) that the diamond chisel inflicts when it is used to attack an entity.").getInt();
|
||||
obsidianChiselAttackDamage = config
|
||||
.get(category, "obsidianChiselAttackDamage", 4, "The extra attack damage points (in half hearts) that the obsidian chisel inflicts when it is used to attack an entity.").getInt();
|
||||
|
||||
ironChiselAttackDamage = config
|
||||
.get(category, "ironChiselAttackDamage", 2, "The extra attack damage points (in half hearts) that the iron chisel inflicts when it is used to attack an entity.").getInt();
|
||||
diamondChiselAttackDamage = config.get(category, "diamondChiselAttackDamage", 2,
|
||||
"The extra attack damage points (in half hearts) that the diamond chisel inflicts when it is used to attack an entity.").getInt();
|
||||
obsidianChiselAttackDamage = config.get(category, "obsidianChiselAttackDamage", 4,
|
||||
"The extra attack damage points (in half hearts) that the obsidian chisel inflicts when it is used to attack an entity.").getInt();
|
||||
|
||||
/* block */
|
||||
category = "block";
|
||||
@@ -118,12 +119,13 @@ public class Configurations {
|
||||
"The lowest harvest level of the tool able to break the road lines (requires useRoadLineTool to be true to take effect) (0 = Wood/Gold, 1 = Stone, 2 = Iron, 3 = Diamond) Default: 0")
|
||||
.getInt();
|
||||
|
||||
/* hexColors */
|
||||
/* hexColors */
|
||||
category = "hexColors";
|
||||
|
||||
for(int i = 0; i < ItemDye.field_150923_a.length; i++) {
|
||||
for (int i = 0; i < ItemDye.field_150923_a.length; i++) {
|
||||
// tterrag... don't kill me over this formatting.
|
||||
String temp = config.get(category, "hex" + ItemDye.field_150923_a[i], "#" + Integer.toHexString(ItemDye.field_150922_c[i]), Character.toUpperCase(ItemDye.field_150923_a[i].charAt(0)) + ItemDye.field_150923_a[i].substring(1) + " color for hex block overlay #RRGGBB").getString();
|
||||
String temp = config.get(category, "hex" + ItemDye.field_150923_a[i], "#" + Integer.toHexString(ItemDye.field_150922_c[i]),
|
||||
Character.toUpperCase(ItemDye.field_150923_a[i].charAt(0)) + ItemDye.field_150923_a[i].substring(1) + " color for hex block overlay #RRGGBB").getString();
|
||||
// Or this
|
||||
try {
|
||||
configColors[i] = Integer.decode(temp);
|
||||
@@ -163,4 +165,4 @@ public class Configurations {
|
||||
public static boolean featureEnabled(String feature) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.cricketcraft.chisel.entity;
|
||||
|
||||
import net.minecraft.entity.monster.EntitySnowman;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityChiselSnowman extends EntitySnowman{
|
||||
|
||||
public EntityChiselSnowman(World world){
|
||||
super(world);
|
||||
}
|
||||
|
||||
//No special features just needed to get around the hardcoding
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.cricketcraft.chisel.init;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.block.*;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
@ObjectHolder(Chisel.MOD_ID)
|
||||
public final class ChiselBlocks {
|
||||
@@ -19,6 +21,7 @@ public final class ChiselBlocks {
|
||||
public static final BlockCarvable cobblestone = null;
|
||||
public static final BlockMarbleWall cobblestoneWall = null;
|
||||
public static final BlockCarvableGlass glass = null;
|
||||
public static final BlockCarvableGlass glass2 = null;
|
||||
public static final BlockCarvablePane glass_pane = null;
|
||||
public static final BlockCarvable sandstone = null;
|
||||
public static final BlockCarvable sandstone_scribbles = null;
|
||||
@@ -30,6 +33,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 nation = null;
|
||||
public static final BlockCarvable nether_brick = null;
|
||||
public static final BlockCarvable netherrack = null;
|
||||
public static final BlockCarvable mossy_cobblestone = null;
|
||||
@@ -40,6 +44,7 @@ public final class ChiselBlocks {
|
||||
public static final BlockCarvablePackedIce packedice = null;
|
||||
public static final BlockCarvablePackedIcePillar packedice_pillar = null;
|
||||
public static final BlockCarvable obsidian = null;
|
||||
public static final BlockCarvable obsidian2 = null;
|
||||
public static final BlockCarvablePowered redstone_block = null;
|
||||
public static final BlockHolystone holystone = null;
|
||||
public static final BlockGrimstone grimstone = null;
|
||||
@@ -57,6 +62,7 @@ public final class ChiselBlocks {
|
||||
public static final BlockCarvable templeblock = null;
|
||||
public static final BlockCarvable mossy_templeblock = null;
|
||||
public static final BlockCarvable factoryblock = null;
|
||||
public static final BlockCarvable factoryblock2 = null;
|
||||
public static final BlockCarvablePane paperwall = null;
|
||||
public static final BlockCarvable paperwall_block = null;
|
||||
public static final BlockCarvable woolen_clay = null;
|
||||
@@ -101,7 +107,7 @@ public final class ChiselBlocks {
|
||||
public static BlockCarvableIceStairs[] iceStairs = new BlockCarvableIceStairs[8];
|
||||
public static BlockCarvablePackedIceStairs[] packediceStairs = new BlockCarvablePackedIceStairs[8];
|
||||
|
||||
public static BlockCarvableTorch[] torch = new BlockCarvableTorch[16];
|
||||
public static Block[] torches = new BlockCarvableTorch[16];
|
||||
|
||||
public static BlockCarvable[] planks = new BlockCarvable[6];
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ 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)
|
||||
@@ -14,6 +13,7 @@ public final class ChiselItems {
|
||||
|
||||
public static final ItemChisel chisel = null;
|
||||
public static final ItemChisel diamondChisel = null;
|
||||
public static final ItemChisel obsidianChisel = null;
|
||||
public static final ItemCloudInABottle cloudinabottle = null;
|
||||
public static final ItemBallOMoss ballomoss = null;
|
||||
public static final ItemSmashingRock smashingrock = null;
|
||||
|
||||
@@ -8,14 +8,20 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.cricketcraft.chisel.Features;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ChiselTabs {
|
||||
|
||||
private static class CustomCreativeTab extends CreativeTabs {
|
||||
|
||||
private boolean search;
|
||||
|
||||
private ItemStack stack;
|
||||
|
||||
public CustomCreativeTab(String label) {
|
||||
public CustomCreativeTab(String label, boolean searchbar) {
|
||||
super(label);
|
||||
this.search = searchbar;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -31,16 +37,35 @@ public class ChiselTabs {
|
||||
public ItemStack getIconItemStack() {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getBackgroundImageName() {
|
||||
|
||||
return search ? "item_search.png" : super.getBackgroundImageName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSearchbarWidth() {
|
||||
|
||||
return 89;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSearchBar() {
|
||||
|
||||
return search;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean atLeastOneModIsLoaded = false;
|
||||
|
||||
public static final CustomCreativeTab tabChisel = new CustomCreativeTab("tabChisel");
|
||||
public static final CustomCreativeTab tabStoneChiselBlocks = new CustomCreativeTab("tabStoneChiselBlocks");
|
||||
public static final CustomCreativeTab tabWoodChiselBlocks = new CustomCreativeTab("tabWoodChiselBlocks");
|
||||
public static final CustomCreativeTab tabMetalChiselBlocks = new CustomCreativeTab("tabMetalChiselBlocks");
|
||||
public static final CustomCreativeTab tabOtherChiselBlocks = new CustomCreativeTab("tabOtherChiselBlocks");
|
||||
public static final CustomCreativeTab tabModdedChiselBlocks = new CustomCreativeTab("tabModdedChiselBlocks");
|
||||
public static final CustomCreativeTab tabChisel = new CustomCreativeTab("tabChisel", false);
|
||||
public static final CustomCreativeTab tabStoneChiselBlocks = new CustomCreativeTab("tabStoneChiselBlocks", true);
|
||||
public static final CustomCreativeTab tabWoodChiselBlocks = new CustomCreativeTab("tabWoodChiselBlocks", true);
|
||||
public static final CustomCreativeTab tabMetalChiselBlocks = new CustomCreativeTab("tabMetalChiselBlocks", true);
|
||||
public static final CustomCreativeTab tabOtherChiselBlocks = new CustomCreativeTab("tabOtherChiselBlocks", true);
|
||||
public static final CustomCreativeTab tabModdedChiselBlocks = new CustomCreativeTab("tabModdedChiselBlocks", true);
|
||||
|
||||
// this serves mostly just to load the static initializers
|
||||
public static void preInit() {
|
||||
@@ -49,21 +74,26 @@ public class ChiselTabs {
|
||||
|
||||
public static void postInit() {
|
||||
|
||||
if(Features.CHISEL.enabled())
|
||||
tabChisel.setTabIconItemStack(new ItemStack(ChiselItems.chisel));
|
||||
else tabChisel.setTabIconItemStack(new ItemStack(Items.stick));
|
||||
if(Features.HOLYSTONE.enabled())
|
||||
tabStoneChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.holystone));
|
||||
else tabStoneChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.stonebrick));
|
||||
if(Features.WOOD.enabled())
|
||||
tabWoodChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.planks[0], 1, 1));
|
||||
else tabWoodChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.planks));
|
||||
if(Features.TECHNICAL.enabled())
|
||||
tabMetalChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.technical));
|
||||
else tabMetalChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.iron_block));
|
||||
if(Features.JACKOLANTERN.enabled())
|
||||
tabOtherChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.jackolantern[0]));
|
||||
else tabOtherChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.lit_pumpkin));
|
||||
if (Features.CHISEL.enabled())
|
||||
tabChisel.setTabIconItemStack(new ItemStack(ChiselItems.chisel));
|
||||
else
|
||||
tabChisel.setTabIconItemStack(new ItemStack(Items.stick));
|
||||
if (Features.HOLYSTONE.enabled())
|
||||
tabStoneChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.holystone));
|
||||
else
|
||||
tabStoneChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.stonebrick));
|
||||
if (Features.WOOD.enabled())
|
||||
tabWoodChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.planks[0], 1, 1));
|
||||
else
|
||||
tabWoodChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.planks));
|
||||
if (Features.TECHNICAL.enabled())
|
||||
tabMetalChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.technical));
|
||||
else
|
||||
tabMetalChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.iron_block));
|
||||
if (Features.JACKOLANTERN.enabled())
|
||||
tabOtherChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.jackolantern[0]));
|
||||
else
|
||||
tabOtherChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.lit_pumpkin));
|
||||
|
||||
if (atLeastOneModIsLoaded) {
|
||||
if (Features.ARCANE.enabled()) {
|
||||
@@ -71,9 +101,10 @@ public class ChiselTabs {
|
||||
} else if (Features.BLOOD_RUNE.enabled()) {
|
||||
tabModdedChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.bloodRune));
|
||||
} else {
|
||||
if(ChiselBlocks.voidstone != null)
|
||||
tabModdedChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.voidstone));
|
||||
else tabModdedChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.obsidian));
|
||||
if (ChiselBlocks.voidstone != null)
|
||||
tabModdedChiselBlocks.setTabIconItemStack(new ItemStack(ChiselBlocks.voidstone));
|
||||
else
|
||||
tabModdedChiselBlocks.setTabIconItemStack(new ItemStack(Blocks.obsidian));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ContainerChisel extends Container {
|
||||
|
||||
public final InventoryChiselSelection inventory;
|
||||
public InventoryPlayer playerInventory;
|
||||
int currentIndex;
|
||||
int chiselSlot;
|
||||
public ItemStack chisel;
|
||||
public boolean finished;
|
||||
public ICarvingRegistry carving;
|
||||
@@ -24,7 +24,7 @@ public class ContainerChisel extends Container {
|
||||
public ContainerChisel(InventoryPlayer inventoryplayer, InventoryChiselSelection inv) {
|
||||
inventory = inv;
|
||||
playerInventory = inventoryplayer;
|
||||
currentIndex = playerInventory.currentItem;
|
||||
chiselSlot = playerInventory.currentItem;
|
||||
inv.container = this;
|
||||
|
||||
int top = 8, left = 62;
|
||||
@@ -64,7 +64,10 @@ public class ContainerChisel extends Container {
|
||||
@Override
|
||||
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) {
|
||||
// we need to subtract away all the other slots
|
||||
if (par1 - inventory.getSizeInventory() - 27 == currentIndex)
|
||||
int clickedSlot = par1 - inventory.getSizeInventory() - 27;
|
||||
|
||||
// if the player has clicked on the chisel or is trying to use a number key to force an itemstack into the slot the chisel is in
|
||||
if (clickedSlot == chiselSlot || (par3 == 2 && par2 == chiselSlot))
|
||||
return null;
|
||||
|
||||
return super.slotClick(par1, par2, par3, par4EntityPlayer);
|
||||
@@ -128,7 +131,7 @@ public class ContainerChisel extends Container {
|
||||
}
|
||||
|
||||
public void onChiselSlotChanged() {
|
||||
ItemStack stack = playerInventory.mainInventory[currentIndex];
|
||||
ItemStack stack = playerInventory.mainInventory[chiselSlot];
|
||||
if (stack == null || !stack.isItemEqual(chisel))
|
||||
finished = true;
|
||||
|
||||
@@ -137,6 +140,6 @@ public class ContainerChisel extends Container {
|
||||
|
||||
General.setChiselTarget(chisel, inventory.getStackInSpecialSlot());
|
||||
|
||||
playerInventory.mainInventory[currentIndex] = chisel;
|
||||
playerInventory.mainInventory[chiselSlot] = chisel;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,9 @@ import com.cricketcraft.chisel.utils.GeneralClient;
|
||||
|
||||
public class SlotChiselSelection extends Slot {
|
||||
|
||||
private final ContainerChisel container;
|
||||
private final InventoryChiselSelection selInventory;
|
||||
|
||||
public SlotChiselSelection(ContainerChisel container, InventoryChiselSelection inv, IInventory iinventory, int i, int j, int k) {
|
||||
super(iinventory, i, j, k);
|
||||
|
||||
@@ -35,18 +38,13 @@ public class SlotChiselSelection extends Slot {
|
||||
|
||||
@Override
|
||||
public void onPickupFromSlot(EntityPlayer player, ItemStack itemstack) {
|
||||
ItemStack stack = player.inventory.getItemStack();
|
||||
ItemStack heldStack = player.inventory.getItemStack();
|
||||
ItemStack crafted = selInventory.inventory[InventoryChiselSelection.normalSlots];
|
||||
|
||||
if (stack == null) {
|
||||
if (crafted != null && crafted.stackSize > 0)
|
||||
crafted.stackSize--;
|
||||
if (crafted.stackSize == 0)
|
||||
crafted = null;
|
||||
|
||||
selInventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, crafted);
|
||||
if (heldStack == null) {
|
||||
selInventory.decrStackSize(InventoryChiselSelection.normalSlots, 1);
|
||||
} else {
|
||||
putStack(new ItemStack(itemstack.getItem(), itemstack.stackSize, itemstack.getItemDamage()));
|
||||
putStack(itemstack.copy());
|
||||
|
||||
player.inventory.setItemStack(null);
|
||||
|
||||
@@ -58,7 +56,7 @@ public class SlotChiselSelection extends Slot {
|
||||
}
|
||||
|
||||
selInventory.updateItems();
|
||||
|
||||
|
||||
if (((IChiselItem) container.chisel.getItem()).onChisel(player.worldObj, container.chisel, General.getVariation(crafted))) {
|
||||
container.chisel.damageItem(1, player);
|
||||
if (container.chisel.stackSize <= 0) {
|
||||
@@ -70,35 +68,5 @@ public class SlotChiselSelection extends Slot {
|
||||
String sound = Carving.chisel.getVariationSound(crafted.getItem(), crafted.getItemDamage());
|
||||
GeneralClient.playChiselSound(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), sound);
|
||||
}
|
||||
|
||||
/*
|
||||
* ItemStack stack=player.inventory.getItemStack();
|
||||
*
|
||||
* putStack(new ItemStack(itemstack.itemID, itemstack.stackSize,
|
||||
* itemstack.getItemDamage()));
|
||||
*
|
||||
* super.onPickupFromSlot(player,itemstack);
|
||||
*
|
||||
* player.inventory.setItemStack(null);
|
||||
*
|
||||
* if(selInventory.items[InventoryChiselSelection.normalSlots]==null)
|
||||
* return;
|
||||
*
|
||||
* player.inventory.setItemStack(new ItemStack(itemstack.itemID,
|
||||
* selInventory.items[InventoryChiselSelection.normalSlots].stackSize,
|
||||
* itemstack.getItemDamage()));
|
||||
* selInventory.setInventorySlotContents(InventoryChiselSelection
|
||||
* .normalSlots,null);
|
||||
*
|
||||
* selInventory.updateItems();
|
||||
*
|
||||
* String sound=Carving.chisel.getVariationSound(itemstack.itemID,
|
||||
* itemstack.getItemDamage()); player.worldObj.playSoundAtEntity(player,
|
||||
* sound, 0.3f + 0.7f * General.rand.nextFloat(), 0.6f + 0.4f *
|
||||
* General.rand.nextFloat());
|
||||
*/
|
||||
}
|
||||
|
||||
ContainerChisel container;
|
||||
InventoryChiselSelection selInventory;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.cricketcraft.chisel.item;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.carving.CarvableVariation;
|
||||
import com.cricketcraft.chisel.config.Configurations;
|
||||
import com.cricketcraft.chisel.utils.General;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemCarvablePumpkin extends ItemBlock {
|
||||
|
||||
public ItemCarvablePumpkin(Block block) {
|
||||
super(block);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidArmor(ItemStack itemStack, int armorType, Entity entity){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
return Block.getBlockFromItem(this).getIcon(2, damage);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) {
|
||||
if (!Configurations.blockDescriptions)
|
||||
return;
|
||||
|
||||
Item item = General.getItem(stack);
|
||||
if (item == null)
|
||||
return;
|
||||
|
||||
Block block = Block.getBlockFromItem(this);
|
||||
if (!(block instanceof ICarvable))
|
||||
return;
|
||||
|
||||
ICarvable carvable = (ICarvable) block;
|
||||
CarvableVariation var = carvable.getVariation(stack);
|
||||
if (var == null)
|
||||
return;
|
||||
|
||||
lines.add(var.getDescription());
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,13 @@
|
||||
package com.cricketcraft.chisel.item.chisel;
|
||||
|
||||
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;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -13,20 +19,14 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
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;
|
||||
|
||||
public class ItemChisel extends Item implements IChiselItem {
|
||||
|
||||
public enum ChiselType {
|
||||
IRON(Configurations.ironChiselMaxDamage, Configurations.ironChiselAttackDamage),
|
||||
DIAMOND(Configurations.diamondChiselMaxDamage, Configurations.diamondChiselAttackDamage);
|
||||
DIAMOND(Configurations.diamondChiselMaxDamage, Configurations.diamondChiselAttackDamage),
|
||||
OBSIDIAN(Configurations.obsidianChiselMaxDamage, Configurations.obsidianChiselAttackDamage);
|
||||
|
||||
final int maxDamage;
|
||||
final int attackDamage;
|
||||
@@ -71,11 +71,11 @@ public class ItemChisel extends Item implements IChiselItem {
|
||||
String lc2 = I18n.format(base + "lc2");
|
||||
String modes = I18n.format(base + "modes");
|
||||
list.add(gui);
|
||||
if (type == ChiselType.DIAMOND || Configurations.ironChiselCanLeftClick) {
|
||||
if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || Configurations.ironChiselCanLeftClick) {
|
||||
list.add(lc1);
|
||||
list.add(lc2);
|
||||
}
|
||||
if (type == ChiselType.DIAMOND || Configurations.ironChiselHasModes) {
|
||||
if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || Configurations.ironChiselHasModes) {
|
||||
list.add("");
|
||||
list.add(modes);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class ItemChisel extends Item implements IChiselItem {
|
||||
stack.damageItem(1, attacker);
|
||||
return super.hitEntity(stack, attacker, target);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canOpenGui(World world, EntityPlayer player, ItemStack chisel) {
|
||||
return true;
|
||||
@@ -117,11 +117,11 @@ public class ItemChisel extends Item implements IChiselItem {
|
||||
|
||||
@Override
|
||||
public boolean canChiselBlock(World world, EntityPlayer player, int x, int y, int z, Block block, int metadata) {
|
||||
return type == ChiselType.DIAMOND || Configurations.ironChiselCanLeftClick;
|
||||
return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || Configurations.ironChiselCanLeftClick;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasModes(ItemStack chisel) {
|
||||
return type == ChiselType.DIAMOND || Configurations.ironChiselHasModes;
|
||||
return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || Configurations.ironChiselHasModes;
|
||||
}
|
||||
}
|
||||
@@ -15,16 +15,21 @@ import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
public class MessagePresentConnect extends MessageCoords {
|
||||
|
||||
private ForgeDirection dir;
|
||||
private boolean connect;
|
||||
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
|
||||
@@ -32,6 +37,7 @@ public class MessagePresentConnect extends MessageCoords {
|
||||
super.toBytes(buf);
|
||||
buf.writeInt(dir.ordinal());
|
||||
buf.writeBoolean(connect);
|
||||
buf.writeBoolean(preserveDir);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,6 +45,7 @@ public class MessagePresentConnect extends MessageCoords {
|
||||
super.fromBytes(buf);
|
||||
dir = ForgeDirection.values()[buf.readInt()];
|
||||
connect = buf.readBoolean();
|
||||
preserveDir = buf.readBoolean();
|
||||
}
|
||||
|
||||
public static class Handler implements IMessageHandler<MessagePresentConnect, IMessage> {
|
||||
@@ -50,7 +57,7 @@ public class MessagePresentConnect extends MessageCoords {
|
||||
if (message.connect) {
|
||||
((TileEntityPresent) te).connectTo(message.dir);
|
||||
} else {
|
||||
((TileEntityPresent) te).disconnect();
|
||||
((TileEntityPresent) te).disconnect(message.preserveDir);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
package com.cricketcraft.chisel.proxy;
|
||||
|
||||
import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import com.cricketcraft.chisel.block.tileentity.TileEntityPresent;
|
||||
import com.cricketcraft.chisel.client.player.PlayerSpecials;
|
||||
import com.cricketcraft.chisel.client.render.*;
|
||||
import com.cricketcraft.chisel.client.render.item.ItemChiselRenderer;
|
||||
import com.cricketcraft.chisel.client.render.tile.RenderAutoChisel;
|
||||
import com.cricketcraft.chisel.client.render.tile.RenderPresent;
|
||||
import com.cricketcraft.chisel.entity.EntityBallOMoss;
|
||||
import com.cricketcraft.chisel.entity.EntityChiselSnowman;
|
||||
import com.cricketcraft.chisel.entity.EntityCloudInABottle;
|
||||
import com.cricketcraft.chisel.entity.EntitySmashingRock;
|
||||
import com.cricketcraft.chisel.init.ChiselBlocks;
|
||||
import com.cricketcraft.chisel.init.ChiselItems;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderSnowball;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -7,33 +22,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import com.cricketcraft.chisel.block.tileentity.TileEntityPresent;
|
||||
import com.cricketcraft.chisel.client.render.BlockAdvancedMarbleRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockCTMNoLightRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockCarpetRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockEldritchRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockGlowRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockLayeredRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockMarblePaneRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockMarblePillarRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockMarbleStairsRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockRoadLineRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockSnakeStoneRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockTexturedOreRenderer;
|
||||
import com.cricketcraft.chisel.client.render.RenderStandardBlockNoSunlight;
|
||||
import com.cricketcraft.chisel.client.render.item.ItemChiselRenderer;
|
||||
import com.cricketcraft.chisel.client.render.tile.RenderAutoChisel;
|
||||
import com.cricketcraft.chisel.client.render.tile.RenderPresent;
|
||||
import com.cricketcraft.chisel.entity.EntityBallOMoss;
|
||||
import com.cricketcraft.chisel.entity.EntityCloudInABottle;
|
||||
import com.cricketcraft.chisel.entity.EntitySmashingRock;
|
||||
import com.cricketcraft.chisel.init.ChiselBlocks;
|
||||
import com.cricketcraft.chisel.init.ChiselItems;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
ItemChiselRenderer renderer = new ItemChiselRenderer();
|
||||
@@ -71,9 +59,12 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCloudInABottle.class, new RenderSnowball(ChiselItems.cloudinabottle));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBallOMoss.class, new RenderSnowball(ChiselItems.ballomoss));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySmashingRock.class, new RenderSnowball(ChiselItems.smashingrock));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityChiselSnowman.class, new RenderChiselSnowman());
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(ChiselItems.chisel, renderer);
|
||||
MinecraftForgeClient.registerItemRenderer(ChiselItems.diamondChisel, renderer);
|
||||
|
||||
PlayerSpecials.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user