From ce6605314a5392cd32e607e518f6da9ff79ca1dd Mon Sep 17 00:00:00 2001 From: mDiyo Date: Wed, 4 Sep 2013 20:26:43 -0700 Subject: [PATCH] Re-add essence extractor block --- src/tconstruct/TConstruct.java | 2 +- src/tconstruct/blocks/ConveyorBase.java | 43 +++++++++++++++++++++++++ src/tconstruct/common/TContent.java | 40 ++++++++++++++--------- src/tconstruct/util/PHConstruct.java | 5 ++- 4 files changed, 73 insertions(+), 17 deletions(-) create mode 100644 src/tconstruct/blocks/ConveyorBase.java diff --git a/src/tconstruct/TConstruct.java b/src/tconstruct/TConstruct.java index 2c75fc6f..af034f5f 100644 --- a/src/tconstruct/TConstruct.java +++ b/src/tconstruct/TConstruct.java @@ -40,7 +40,7 @@ import cpw.mods.fml.relauncher.Side; * @dependencies: IC2 API, MFR API */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.2_1.4.3.1", dependencies = "required-after:Forge@[7.7.1.687,)") +@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.2_1.4.4", dependencies = "required-after:Forge@[7.7.1.687,)") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = tconstruct.util.network.TPacketHandler.class) public class TConstruct { diff --git a/src/tconstruct/blocks/ConveyorBase.java b/src/tconstruct/blocks/ConveyorBase.java new file mode 100644 index 00000000..2d5fbdd6 --- /dev/null +++ b/src/tconstruct/blocks/ConveyorBase.java @@ -0,0 +1,43 @@ +package tconstruct.blocks; + +import tconstruct.library.TConstructRegistry; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +public class ConveyorBase extends Block +{ + public ConveyorBase(int ID, Material material) + { + super(ID, material); + this.setCreativeTab(TConstructRegistry.blockTab); + setBlockBounds(0f, 0f, 0f, 1f, 0.5f, 1f); + } + + @Override + public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) + { + double moveX = 0; + double moveZ = 0; + + int meta = world.getBlockMetadata(x, y, z); + switch (meta % 4) + { + case 0: + moveX += 0.1; + break; + case 1: + moveZ += 0.1; + break; + case 2: + moveX -= 0.1; + break; + case 3: + moveZ -= 0.1; + break; + } + + entity.addVelocity(moveX, 0, moveZ); + } +} diff --git a/src/tconstruct/common/TContent.java b/src/tconstruct/common/TContent.java index 9bfc059a..bf32ffa0 100644 --- a/src/tconstruct/common/TContent.java +++ b/src/tconstruct/common/TContent.java @@ -35,6 +35,7 @@ import tconstruct.blocks.CraftingSlab; import tconstruct.blocks.CraftingStationBlock; import tconstruct.blocks.DryingRack; import tconstruct.blocks.EquipBlock; +import tconstruct.blocks.EssenceExtractor; import tconstruct.blocks.GlassBlockConnected; import tconstruct.blocks.GlassBlockConnectedMeta; import tconstruct.blocks.GlassPane; @@ -66,6 +67,7 @@ import tconstruct.blocks.logic.CastingTableLogic; import tconstruct.blocks.logic.CraftingStationLogic; import tconstruct.blocks.logic.DrawbridgeLogic; import tconstruct.blocks.logic.DryingRackLogic; +import tconstruct.blocks.logic.EssenceExtractorLogic; import tconstruct.blocks.logic.FaucetLogic; import tconstruct.blocks.logic.FirestarterLogic; import tconstruct.blocks.logic.FrypanLogic; @@ -400,6 +402,8 @@ public class TContent implements IFuelHandler public static SlimeLeaves slimeLeaves; public static SlimeSapling slimeSapling; + public static Block slimeChannel; + //Ores public static Block oreSlag; public static Block oreGravel; @@ -436,7 +440,7 @@ public class TContent implements IFuelHandler addLoot(); } - public void createEntities () + public void createEntities() { EntityRegistry.registerModEntity(FancyEntityItem.class, "Fancy Item", 0, TConstruct.instance, 32, 5, true); EntityRegistry.registerModEntity(DaggerEntity.class, "Dagger", 1, TConstruct.instance, 32, 5, true); @@ -490,7 +494,7 @@ public class TContent implements IFuelHandler public static Fluid[] fluids = new Fluid[25]; public static Block[] fluidBlocks = new Block[25]; - void registerBlocks () + void registerBlocks() { //Tool Station toolStationWood = new ToolStationBlock(PHConstruct.woodStation, Material.wood).setUnlocalizedName("ToolStation"); @@ -844,6 +848,9 @@ public class TContent implements IFuelHandler slimeSapling = (SlimeSapling) new SlimeSapling(PHConstruct.slimeSapling).setStepSound(slimeStep).setUnlocalizedName("slime.sapling"); GameRegistry.registerBlock(slimeSapling, SlimeSaplingItemBlock.class, "slime.sapling"); + /*slimeChannel = new ConveyorBase(PHConstruct.slimeChannel, Material.water).setStepSound(slimeStep).setUnlocalizedName("slime.channel"); + GameRegistry.registerBlock(slimeChannel, "slime.channel");*/ + //Decoration stoneTorch = new StoneTorch(PHConstruct.stoneTorch).setUnlocalizedName("decoration.stonetorch"); GameRegistry.registerBlock(stoneTorch, "decoration.stonetorch"); @@ -900,9 +907,12 @@ public class TContent implements IFuelHandler GameRegistry.registerBlock(stainedGlassClearPane, StainedGlassClearPaneItem.class, "GlassPaneClearStained"); //Crystalline + essenceExtractor = new EssenceExtractor(PHConstruct.essenceExtractor).setHardness(12f).setUnlocalizedName("extractor.essence"); + GameRegistry.registerBlock(essenceExtractor, "extractor.essence"); + GameRegistry.registerTileEntity(EssenceExtractorLogic.class, "extractor.essence"); } - void registerItems () + void registerItems() { titleIcon = new TitleIcon(PHConstruct.uselessItem).setUnlocalizedName("tconstruct.titleicon"); String[] blanks = new String[] { "blank_pattern", "blank_cast", "blank_cast" }; @@ -1023,7 +1033,7 @@ public class TContent implements IFuelHandler essenceCrystal = new EssenceCrystal(PHConstruct.essenceCrystal).setUnlocalizedName("tconstruct.crystal.essence"); goldHead = new GoldenHead(PHConstruct.goldHead, 4, 1.2F, false).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 10, 0, 1.0F).setUnlocalizedName("goldenhead"); -// essenceCrystal = new EssenceCrystal(PHConstruct.essenceCrystal).setUnlocalizedName("tconstruct.crystal.essence"); + // essenceCrystal = new EssenceCrystal(PHConstruct.essenceCrystal).setUnlocalizedName("tconstruct.crystal.essence"); String[] materialStrings = { "paperStack", "greenSlimeCrystal", "searedBrick", "ingotCobalt", "ingotArdite", "ingotManyullyn", "mossBall", "lavaCrystal", "necroticBone", "ingotCopper", "ingotTin", "ingotAluminum", "rawAluminum", "ingotBronze", "ingotAluminumBrass", "ingotAlumite", "ingotSteel", "blueSlimeCrystal", "ingotObsidian", "nuggetIron", "nuggetCopper", @@ -1061,7 +1071,7 @@ public class TContent implements IFuelHandler //Block.torchWood.setTickRandomly(false); } - void registerMaterials () + void registerMaterials() { TConstructRegistry.addToolMaterial(0, "Wood", "Wooden ", 0, 59, 200, 0, 1.0F, 0, 0f, "\u00A7e", ""); TConstructRegistry.addToolMaterial(1, "Stone", 1, 131, 400, 1, 0.5F, 0, 1f, "", "Stonebound"); @@ -1184,7 +1194,7 @@ public class TContent implements IFuelHandler public static Item[] patternOutputs; public static FluidStack[] liquids; - void addCraftingRecipes () + void addCraftingRecipes() { /* Tools */ patternOutputs = new Item[] { toolRod, pickaxeHead, shovelHead, hatchetHead, swordBlade, wideGuard, handGuard, crossbar, binding, frypanHead, signHead, knifeBlade, chiselHead, toughRod, @@ -1868,7 +1878,7 @@ public class TContent implements IFuelHandler GameRegistry.addRecipe(new ItemStack(craftingSlabWood, 1, 5), "b", 'b', new ItemStack(toolForge, 1, Short.MAX_VALUE)); } - void setupToolTabs () + void setupToolTabs() { TConstructRegistry.materialTab.init(new ItemStack(titleIcon, 1, 255)); TConstructRegistry.blockTab.init(new ItemStack(toolStationWood)); @@ -1885,7 +1895,7 @@ public class TContent implements IFuelHandler TConstructRegistry.toolTab.init(tool); } - public void addLoot () + public void addLoot() { //Item, min, max, weight ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(heartCanister, 1, 1), 1, 1, 5)); @@ -1915,7 +1925,7 @@ public class TContent implements IFuelHandler public static String[] liquidNames; - public void oreRegistry () + public void oreRegistry() { OreDictionary.registerOre("oreCobalt", new ItemStack(oreSlag, 1, 1)); OreDictionary.registerOre("oreArdite", new ItemStack(oreSlag, 1, 2)); @@ -1991,7 +2001,7 @@ public class TContent implements IFuelHandler public static boolean thaumcraftAvailable; - public void intermodCommunication () + public void intermodCommunication() { FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(oreBerry, 1, 12)); FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(oreBerry, 1, 13)); @@ -2014,7 +2024,7 @@ public class TContent implements IFuelHandler private static boolean initRecipes; - public static void modRecipes () + public static void modRecipes() { if (!initRecipes) { @@ -2054,7 +2064,7 @@ public class TContent implements IFuelHandler } } - public static void addShapedRecipeFirst (List recipeList, ItemStack itemstack, Object... objArray) + public static void addShapedRecipeFirst(List recipeList, ItemStack itemstack, Object... objArray) { String var3 = ""; int var4 = 0; @@ -2127,7 +2137,7 @@ public class TContent implements IFuelHandler recipeList.add(0, var17); } - public void modIntegration () + public void modIntegration() { ItemStack ironpick = ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 6), new ItemStack(TContent.toolRod, 1, 2), new ItemStack(TContent.binding, 1, 6), ""); /* IC2 */ @@ -2264,7 +2274,7 @@ public class TContent implements IFuelHandler } } - public static Object getStaticItem (String name, String classPackage) + public static Object getStaticItem(String name, String classPackage) { try { @@ -2283,7 +2293,7 @@ public class TContent implements IFuelHandler } @Override - public int getBurnTime (ItemStack fuel) + public int getBurnTime(ItemStack fuel) { if (fuel.itemID == materials.itemID && fuel.getItemDamage() == 7) return 26400; diff --git a/src/tconstruct/util/PHConstruct.java b/src/tconstruct/util/PHConstruct.java index 5031b0b6..f62b0435 100644 --- a/src/tconstruct/util/PHConstruct.java +++ b/src/tconstruct/util/PHConstruct.java @@ -101,6 +101,8 @@ public class PHConstruct barricadeSpruce = config.getBlock("Spruce Barricade", 1482).getInt(1482); barricadeBirch = config.getBlock("Birch Barricade", 1483).getInt(1483); barricadeJungle = config.getBlock("Jungle Barricade", 1487).getInt(1487); + + slimeChannel = config.getBlock("Slime Channel", 3190).getInt(3190); //Thermal Expansion moltenSilver = config.getBlock("Molten Silver", 3195).getInt(3195); @@ -141,7 +143,6 @@ public class PHConstruct searedSlab = config.getBlock("Seared Slab", 3230).getInt(3230); speedSlab = config.getBlock("Speed Slab", 3231).getInt(3231); - //grassSlab = config.getBlock("Grass Slab", 3230).getInt(3230); punji = config.getBlock("Punji", 3232).getInt(3232); woodCrafter = config.getBlock("Crafting Station", 3233).getInt(3233); @@ -449,6 +450,8 @@ public class PHConstruct public static int slimeTallGrass; public static int slimeLeaves; public static int slimeSapling; + + public static int slimeChannel; //Decoration public static int stoneTorch;