Skip to content

Commit 192afec

Browse files
committed
Bugfixes, additions for 0.5.1
1 parent 8272d28 commit 192afec

27 files changed

+826
-101
lines changed

forge2/src/main/java/flaxbeard/thaumicexploration/ThaumicExploration.java

+96-10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import thaumcraft.api.ThaumcraftApi;
3434
import thaumcraft.api.aspects.Aspect;
3535
import thaumcraft.api.aspects.AspectList;
36+
import thaumcraft.api.wands.StaffRod;
37+
import thaumcraft.api.wands.WandCap;
3638
import thaumcraft.api.wands.WandRod;
3739
import thaumcraft.common.config.ConfigBlocks;
3840
import thaumcraft.common.lib.ThaumcraftCraftingManager;
@@ -66,6 +68,7 @@
6668
import flaxbeard.thaumicexploration.enchantment.EnchantmentBinding;
6769
import flaxbeard.thaumicexploration.enchantment.EnchantmentDisarm;
6870
import flaxbeard.thaumicexploration.enchantment.EnchantmentNightVision;
71+
import flaxbeard.thaumicexploration.event.TXArmorEventHandler;
6972
import flaxbeard.thaumicexploration.event.TXBootsEventHandler;
7073
import flaxbeard.thaumicexploration.event.TXEventHandler;
7174
import flaxbeard.thaumicexploration.event.TXTickHandler;
@@ -82,7 +85,6 @@
8285
import flaxbeard.thaumicexploration.item.ItemTXRuneMeteorBoots;
8386
import flaxbeard.thaumicexploration.item.ItemTaintSeedFood;
8487
import flaxbeard.thaumicexploration.item.focus.ItemFocusNecromancy;
85-
import flaxbeard.thaumicexploration.misc.FauxAspect;
8688
import flaxbeard.thaumicexploration.misc.TXPotion;
8789
import flaxbeard.thaumicexploration.misc.TXTaintPotion;
8890
import flaxbeard.thaumicexploration.misc.WorldGenTX;
@@ -127,10 +129,20 @@ public class ThaumicExploration {
127129
public static int transmutationCoreID;
128130
public static Item amberCore;
129131
public static int amberCoreID;
132+
public static Item amberStaffCore;
133+
public static int amberStaffCoreID;
130134
public static Item necroCore;
131135
public static int necroCoreID;
132136
public static Item breadCore;
133137
public static int breadCoreID;
138+
public static Item sojournerCap;
139+
public static int sojournerCapID;
140+
public static Item sojournerCapUncharged;
141+
public static int sojournerCapUnchargedID;
142+
public static Item mechanistCap;
143+
public static int mechanistCapID;
144+
public static Item mechanistCapUncharged;
145+
public static int mechanistCapUnchargedID;
134146

135147
public static EnumArmorMaterial armorMaterialCrystal;
136148
public static Item maskEvil;
@@ -154,6 +166,23 @@ public class ThaumicExploration {
154166
public static Item talismanFood;
155167
public static int talismanFoodID;
156168

169+
public static Item enhancedHelmetRunic;
170+
public static Item enhancedChestRunic;
171+
public static Item enhancedLegsRunic;
172+
public static Item enhancedBootsRunic;
173+
public static Item enhancedHelmetRunic2;
174+
public static Item enhancedChestRunic2;
175+
public static Item enhancedLegsRunic2;
176+
public static Item enhancedBootsRunic2;
177+
public static int enhancedHelmetRunicID;
178+
public static int enhancedChestRunicID;
179+
public static int enhancedLegsRunicID;
180+
public static int enhancedBootsRunicID;
181+
public static int enhancedHelmetRunic2ID;
182+
public static int enhancedChestRunic2ID;
183+
public static int enhancedLegsRunic2ID;
184+
public static int enhancedBootsRunic2ID;
185+
157186
public static Item taintBerry;
158187
public static int taintBerryID;
159188

@@ -184,10 +213,15 @@ public class ThaumicExploration {
184213
public static int replicatorID;
185214
public static Block skullCandle;
186215
public static int skullCandleID;
216+
187217
public static WandRod WAND_ROD_CRYSTAL;
188218
public static WandRod WAND_ROD_AMBER;
189219
public static WandRod WAND_ROD_NECRO;
190220
public static WandRod WAND_ROD_BREAD;
221+
public static StaffRod STAFF_ROD_AMBER;
222+
223+
public static WandCap WAND_CAP_SOJOURNER;
224+
public static WandCap WAND_CAP_MECHANIST;
191225

192226
public WorldGenTX worldGen;
193227

@@ -209,6 +243,10 @@ public class ThaumicExploration {
209243
public static boolean allowFood;
210244
public static boolean allowUrn;
211245
public static boolean allowBoots;
246+
public static boolean allowSojourner;
247+
public static boolean allowMechanist;
248+
public static boolean allowEnchants;
249+
public static boolean allowTainturgy;
212250

213251
public static Aspect fakeAspectNecro;
214252

@@ -240,7 +278,7 @@ public class ThaumicExploration {
240278

241279

242280
private TXBootsEventHandler entityEventHandler;
243-
281+
private TXArmorEventHandler entityEventHandler2;
244282
@EventHandler
245283
public void preInit(FMLPreInitializationEvent event) {
246284

@@ -282,6 +320,7 @@ public void preInit(FMLPreInitializationEvent event) {
282320
jarSealLinkedID = config.getItem("Linked Jar Binding Seal", 11007).getInt();
283321
transmutationCoreID = config.getItem("Transmutation Filter Wand Core", 11004).getInt();
284322
amberCoreID = config.getItem("Amber Wand Core", 11005).getInt();
323+
amberStaffCoreID = config.getItem("Amber Staff Core", 11033).getInt();
285324
maskEvilID = config.getItem("Mask of Cruelty", 11008).getInt();
286325
bootsMeteorID = config.getItem("Boots of the Meteor", 11010).getInt();
287326
bootsCometID = config.getItem("Boots of the Comet", 11011).getInt();
@@ -296,6 +335,21 @@ public void preInit(FMLPreInitializationEvent event) {
296335
runicBootsMeteorID = config.getItem("Runic Boots of the Meteor", 11018).getInt();
297336
runicBootsCometID = config.getItem("Runic Boots of the Comet", 11019).getInt();
298337

338+
enhancedHelmetRunicID = config.getItem("Enhanced Runic Headpiece", 11021).getInt();
339+
enhancedChestRunicID = config.getItem("Enhanced Runic Chestpiece", 11022).getInt();
340+
enhancedLegsRunicID = config.getItem("Enhanced Runic Legpiece", 11023).getInt();
341+
enhancedBootsRunicID = config.getItem("Enhanced Runic Runic Footpiece", 11024).getInt();
342+
enhancedHelmetRunic2ID = config.getItem("Enhanced Runic Headpiece (2)", 11025).getInt();
343+
enhancedChestRunic2ID = config.getItem("Enhanced Runic Chestpiece (2)", 11026).getInt();
344+
enhancedLegsRunic2ID = config.getItem("Enhanced Runic Legpiece (2)", 11027).getInt();
345+
enhancedBootsRunic2ID = config.getItem("Enhanced Runic Runic Footpiece (2)", 11028).getInt();
346+
347+
sojournerCapUnchargedID = config.getItem("Inert Sojourner's Cap", 11030).getInt();
348+
sojournerCapID = config.getItem("Sojourner's Cap", 11029).getInt();
349+
350+
mechanistCapUnchargedID = config.getItem("Inert Mechanist's Cap", 11031).getInt();
351+
mechanistCapID = config.getItem("Mechanist's Cap", 11032).getInt();
352+
299353
//Block IDs
300354
boundChestID = config.getBlock("Bound Chest", 700).getInt();
301355
boundJarID = config.getBlock("Bound Jar", 701).getInt();
@@ -322,13 +376,17 @@ public void preInit(FMLPreInitializationEvent event) {
322376
breadWand = config.get("Easter Eggs", "Enable Thaumic Frenchurgy", false).getBoolean(true);
323377
brainsGolem = config.get("Miscellaneous", "Use Purified Brains in advanced golems", true).getBoolean(true);
324378
taintBloom = config.get("Miscellaneous", "Move the Etheral Bloom to the Tainturgy tab", true).getBoolean(true);
325-
allowBoundInventories = config.get("Miscellaneous", "Allow bound inventories", true).getBoolean(true);
326-
allowReplication = config.get("Miscellaneous", "Allow Thaumic Replicator", true).getBoolean(true);
327-
allowCrucSouls = config.get("Miscellaneous", "Allow Crucible of Souls", true).getBoolean(true);
328-
allowThinkTank = config.get("Miscellaneous", "Allow Think Tank", true).getBoolean(true);
329-
allowFood = config.get("Miscellaneous", "Allow Talisman of Nourishment", true).getBoolean(true);
330-
allowUrn = config.get("Miscellaneous", "Allow Everfull Urn", true).getBoolean(true);
331-
allowBoots = config.get("Miscellaneous", "Allow Boots of the Meteor/Comet", true).getBoolean(true);
379+
allowBoundInventories = config.get("Miscellaneous", "Enable bound inventories", true).getBoolean(true);
380+
allowReplication = config.get("Miscellaneous", "Enable Thaumic Replicator", true).getBoolean(true);
381+
allowCrucSouls = config.get("Miscellaneous", "Enable Crucible of Souls", true).getBoolean(true);
382+
allowThinkTank = config.get("Miscellaneous", "Enable Think Tank", true).getBoolean(true);
383+
allowFood = config.get("Miscellaneous", "Enable Talisman of Nourishment", true).getBoolean(true);
384+
allowUrn = config.get("Miscellaneous", "Enable Everfull Urn", true).getBoolean(true);
385+
allowBoots = config.get("Miscellaneous", "Enable Boots of the Meteor/Comet", true).getBoolean(true);
386+
allowSojourner = config.get("Miscellaneous", "Enable Sojourner's Wand Caps", true).getBoolean(true);
387+
allowMechanist = config.get("Miscellaneous", "Enable Mechanist's Wand Caps", true).getBoolean(true);
388+
allowEnchants = config.get("Miscellaneous", "Enable TX Enchantments", true).getBoolean(true);
389+
allowTainturgy = config.get("Miscellaneous", "Enable Tainturgy Tab & Wispy Dreamcatcher", true).getBoolean(true);
332390
allowMagicPlankReplication = config.get("Replicator", "Allow replication of Greatwood/Silverwood planks", true).getBoolean(true);
333391
allowModWoodReplication = config.get("Replicator", "Allow replication of other mods' logs and planks", true).getBoolean(true);
334392
allowModStoneReplication = config.get("Replicator", "Allow replication of other mods' stone blocks", true).getBoolean(true);
@@ -340,12 +398,16 @@ public void preInit(FMLPreInitializationEvent event) {
340398

341399
@EventHandler
342400
public void load(FMLInitializationEvent event) {
343-
fakeAspectNecro = new FauxAspect("Necromantic Energy", 0x870404, null, new ResourceLocation("thaumicexploration", "textures/tabs/necroAspect.png"), 771);
401+
//fakeAspectNecro = new FauxAspect("Necromantic Energy", 0x870404, null, new ResourceLocation("thaumicexploration", "textures/tabs/necroAspect.png"), 771);
344402

345403
TickRegistry.registerTickHandler(new TXTickHandler(), Side.CLIENT);
346404
this.entityEventHandler = new TXBootsEventHandler();
347405

348406
MinecraftForge.EVENT_BUS.register(this.entityEventHandler);
407+
408+
this.entityEventHandler2 = new TXArmorEventHandler();
409+
410+
MinecraftForge.EVENT_BUS.register(this.entityEventHandler2);
349411
NetworkRegistry.instance().registerGuiHandler(instance, new TXGuiHandler());
350412

351413
everfullUrnRenderID = RenderingRegistry.getNextAvailableRenderId();
@@ -403,10 +465,17 @@ public void load(FMLInitializationEvent event) {
403465
transmutationCore = (new Item(transmutationCoreID)).setUnlocalizedName("thaumicexploration:transmutationCore").setCreativeTab(tab).setTextureName("thaumicexploration:rodTransmutation");
404466
talismanFood = (new ItemFoodTalisman(talismanFoodID)).setUnlocalizedName("thaumicexploration:talismanFood").setCreativeTab(tab).setTextureName("thaumicexploration:talismanFood");
405467
amberCore = (new Item(amberCoreID)).setUnlocalizedName("thaumicexploration:amberCore").setCreativeTab(tab).setTextureName("thaumicexploration:rodAmber");
468+
amberStaffCore = (new Item(amberStaffCoreID)).setUnlocalizedName("thaumicexploration:amberStaffCore").setCreativeTab(tab).setTextureName("thaumicexploration:rodAmber_staff");
406469
necroCore = (new Item(necroCoreID)).setUnlocalizedName("thaumicexploration:necroCore").setCreativeTab(tab).setTextureName("thaumicexploration:rodNecro");
407470
if (this.breadWand) {
408471
breadCore = (new Item(breadCoreID)).setUnlocalizedName("thaumicexploration:breadCore").setCreativeTab(tab).setTextureName("thaumicexploration:rodBread");
409472
}
473+
sojournerCap = (new Item(sojournerCapID)).setUnlocalizedName("thaumicexploration:capSojourner").setCreativeTab(tab).setTextureName("thaumicexploration:capSojournerCharged");
474+
sojournerCapUncharged = (new Item(sojournerCapUnchargedID)).setUnlocalizedName("thaumicexploration:capSojournerInert").setCreativeTab(tab).setTextureName("thaumicexploration:capSojourner");
475+
476+
mechanistCap = (new Item(mechanistCapID)).setUnlocalizedName("thaumicexploration:capMechanist").setCreativeTab(tab).setTextureName("thaumicexploration:capMechanistCharged");
477+
mechanistCapUncharged = (new Item(mechanistCapUnchargedID)).setUnlocalizedName("thaumicexploration:capMechanistInert").setCreativeTab(tab).setTextureName("thaumicexploration:capMechanist");
478+
410479
pureZombieBrain = (new ItemBrain(pureZombieBrainID)).setUnlocalizedName("thaumicexploration:pureZombieBrain").setCreativeTab(tab).setTextureName("thaumicexploration:pureZombieBrain");
411480
blankSeal = (new ItemBlankSeal(blankSealID).setCreativeTab(tab).setTextureName("thaumicexploration:sealBlank"));
412481
chestSeal = (new ItemChestSeal(chestSealID).setCreativeTab(tab).setTextureName("thaumicexploration:sealChest").setUnlocalizedName("thaumicexploration:chestSeal"));
@@ -427,19 +496,35 @@ public void load(FMLInitializationEvent event) {
427496
itemAltar = (new ItemReed(itemAltarID, necroPedestal)).setUnlocalizedName("thaumicexploration:necroAltar").setCreativeTab(tab).setTextureName("thaumicExploration:necroAltar");
428497

429498
//Wands
499+
STAFF_ROD_AMBER = new StaffRod("AMBER",25,new ItemStack(ThaumicExploration.amberStaffCore),18,new WandRodAmberOnUpdate(), new ResourceLocation("thaumicexploration:textures/models/rodAmber.png"));
430500
WAND_ROD_AMBER = new WandRod("AMBER",10,new ItemStack(ThaumicExploration.amberCore),8,new WandRodAmberOnUpdate(), new ResourceLocation("thaumicexploration:textures/models/rodAmber.png"));
431501
WAND_ROD_CRYSTAL = new WandRod("transmutation",100,new ItemStack(ThaumicExploration.transmutationCore),1,new WandRodTransmutationOnUpdate());
432502
WAND_ROD_NECRO = new WandRod("NECROMANCER",100,new ItemStack(ThaumicExploration.necroCore),15,new WandRodNecromancerOnUpdate(), new ResourceLocation("thaumicexploration:textures/models/rodNecro.png"));
433503
if (this.breadWand) {
434504
WAND_ROD_BREAD = new WandRod("BREAD",39,new ItemStack(ThaumicExploration.breadCore),8,new WandRodBreadOnUpdate(), new ResourceLocation("thaumicexploration:textures/models/rodBread.png"));
435505
}
506+
WAND_CAP_SOJOURNER = new WandCap("SOJOURNER", 0.95F, new ItemStack(ThaumicExploration.sojournerCap), 6);
507+
WAND_CAP_SOJOURNER.setTexture(new ResourceLocation("thaumicexploration:textures/models/capSojourner.png"));
508+
509+
WAND_CAP_MECHANIST = new WandCap("MECHANIST", 0.95F, new ItemStack(ThaumicExploration.mechanistCap), 6);
510+
WAND_CAP_MECHANIST.setTexture(new ResourceLocation("thaumicexploration:textures/models/capMechanist.png"));
511+
436512
//WandRod.rods.put("transmutation1", WAND_ROD_CRYSTAL1);
437513
enchantmentBinding = new EnchantmentBinding(enchantmentBindingID, 1);
438514
enchantmentNightVision = new EnchantmentNightVision(enchantmentNightVisionID, 1);
439515
enchantmentDisarm = new EnchantmentDisarm(enchantmentDisarmID, 1);
440516
if (Loader.isModLoaded("ThaumicTinkerer")) {
441517
TTIntegration.registerEnchants();
442518
}
519+
520+
// enhancedHelmetRunic = new ItemEnhancedRunicArmor(1, enhancedHelmetRunicID, ThaumcraftApi.armorMatSpecial, 0, 0).setUnlocalizedName("thaumicexploration:enhancedHelmetRunic").setCreativeTab(tab);
521+
// enhancedChestRunic = new ItemEnhancedRunicArmor(1,enhancedChestRunicID, ThaumcraftApi.armorMatSpecial, 0, 1).setUnlocalizedName("thaumicexploration:enhancedChestplateRunic").setCreativeTab(tab);
522+
// enhancedLegsRunic = new ItemEnhancedRunicArmor(1,enhancedLegsRunicID, ThaumcraftApi.armorMatSpecial, 0, 2).setUnlocalizedName("thaumicexploration:enhancedLeggingsRunic").setCreativeTab(tab);
523+
// enhancedBootsRunic = new ItemEnhancedRunicArmor(1,enhancedBootsRunicID, ThaumcraftApi.armorMatSpecial, 0, 3).setUnlocalizedName("thaumicexploration:enhancedBootsRunic").setCreativeTab(tab);
524+
// enhancedHelmetRunic2 = new ItemEnhancedRunicArmor(2, enhancedHelmetRunic2ID, ThaumcraftApi.armorMatSpecial, 0, 0).setUnlocalizedName("thaumicexploration:enhancedHelmetRunic");
525+
// enhancedChestRunic2 = new ItemEnhancedRunicArmor(2,enhancedChestRunic2ID, ThaumcraftApi.armorMatSpecial, 0, 1).setUnlocalizedName("thaumicexploration:enhancedChestplateRunic");
526+
// enhancedLegsRunic2 = new ItemEnhancedRunicArmor(2,enhancedLegsRunic2ID, ThaumcraftApi.armorMatSpecial, 0, 2).setUnlocalizedName("thaumicexploration:enhancedLeggingsRunic");
527+
// enhancedBootsRunic2 = new ItemEnhancedRunicArmor(2,enhancedBootsRunic2ID, ThaumcraftApi.armorMatSpecial, 0, 3).setUnlocalizedName("thaumicexploration:enhancedBootsRunic");
443528

444529
potionBinding = (new TXPotion(potionBindingID, false, 0)).setIconIndex(0, 0).setPotionName("potion.binding");
445530
potionTaintWithdrawl = (new TXTaintPotion(potionTaintWithdrawlID, true, 0)).setPotionName("potion.taintWithdrawl");
@@ -448,6 +533,7 @@ public void load(FMLInitializationEvent event) {
448533
proxy.registerRenderers();
449534
}
450535

536+
451537
@EventHandler
452538
public void postInit(FMLPostInitializationEvent event) {
453539
//Researches, Thaumcraft Recipes

forge2/src/main/java/flaxbeard/thaumicexploration/block/BlockBoundJar.java

+25-18
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package flaxbeard.thaumicexploration.block;
22

3+
import java.util.ArrayList;
34
import java.util.List;
45
import java.util.Random;
56

67
import net.minecraft.creativetab.CreativeTabs;
7-
import net.minecraft.entity.item.EntityItem;
88
import net.minecraft.entity.player.EntityPlayer;
99
import net.minecraft.item.ItemStack;
1010
import net.minecraft.nbt.NBTTagCompound;
@@ -17,10 +17,11 @@
1717
import thaumcraft.common.config.ConfigBlocks;
1818
import thaumcraft.common.config.ConfigItems;
1919
import thaumcraft.common.items.ItemEssence;
20+
import thaumcraft.common.tiles.TileJarFillable;
21+
import thaumcraft.common.tiles.TileJarFillableVoid;
2022
import cpw.mods.fml.relauncher.Side;
2123
import cpw.mods.fml.relauncher.SideOnly;
2224
import flaxbeard.thaumicexploration.ThaumicExploration;
23-
import flaxbeard.thaumicexploration.tile.TileEntityBoundChest;
2425
import flaxbeard.thaumicexploration.tile.TileEntityBoundJar;
2526

2627

@@ -39,7 +40,6 @@ public TileEntity createTileEntity(World world, int metadata)
3940
}
4041

4142
@SideOnly(Side.CLIENT)
42-
@Override
4343
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
4444
{
4545
par3List.add(new ItemStack(par1, 1, 0));
@@ -51,6 +51,7 @@ public int idDropped(int par1, Random par2Random, int par3)
5151
return ConfigBlocks.blockJar.blockID;
5252
}
5353

54+
5455
public int quantityDropped(Random par1Random)
5556
{
5657
return 0;
@@ -61,26 +62,32 @@ public void breakBlock(World par1World, int par2, int par3, int par4, int par5,
6162
{
6263
TileEntity te = par1World.getBlockTileEntity(par2, par3, par4);
6364

64-
if ((te != null) && ((te instanceof TileEntityBoundJar)))
65-
{
66-
((TileEntityBoundJar)te).emptyJar();
67-
68-
ItemStack drop = new ItemStack(ConfigItems.itemJarFilled);
69-
if (((TileEntityBoundJar)te).amount > 0) {
70-
((ItemJarFilled)drop.getItem()).setAspects(drop, new AspectList().add(((TileEntityBoundJar)te).aspect, ((TileEntityBoundJar)te).amount));
71-
}
72-
else
73-
{
74-
drop = new ItemStack(ConfigBlocks.blockJar);
75-
}
76-
dropBlockAsItem_do(par1World, par2, par3, par4, drop);
77-
drop = new ItemStack(ThaumicExploration.blankSeal, 1, 15-((TileEntityBoundJar)te).getSealColor());
65+
ItemStack drop = new ItemStack(ThaumicExploration.blankSeal, 1, 15-((TileEntityBoundJar)te).getSealColor());
7866
dropBlockAsItem_do(par1World, par2, par3, par4, drop);
7967
}
8068

81-
//super.breakBlock(par1World, par2, par3, par4, par5, par6);
69+
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
70+
{
71+
ArrayList<ItemStack> drops = new ArrayList();
72+
int md = world.getBlockMetadata(x, y, z);
73+
TileEntity te = world.getBlockTileEntity(x, y, z);
74+
if ((te != null) && ((te instanceof TileJarFillable)))
75+
{
76+
ItemStack drop = new ItemStack(ConfigItems.itemJarFilled);
77+
if ((((TileJarFillable)te).amount <= 0) && (((TileJarFillable)te).aspectFilter == null)) {
78+
drop = new ItemStack(ConfigBlocks.blockJar);
79+
}
80+
if (((TileJarFillable)te).amount > 0) {
81+
((ItemJarFilled)drop.getItem()).setAspects(drop, new AspectList().add(((TileJarFillable)te).aspect, ((TileJarFillable)te).amount));
82+
}
83+
84+
drops.add(drop);
85+
}
86+
return drops;
87+
8288
}
8389

90+
8491
@Override
8592
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
8693
{

0 commit comments

Comments
 (0)