
ThaxxelGaming
Members-
Posts
6 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
ThaxxelGaming's Achievements

Tree Puncher (2/8)
0
Reputation
-
[SOLVED] Achievement Triggering Problems
ThaxxelGaming replied to ThaxxelGaming's topic in Modder Support
So correct me if I'm wrong, but what I hear you saying is something similar to this? public void takenFromCrafting(EntityPlayer thePlayer, ItemStack stack, IInventory matrix){ if(stack.itemID == Explosive.TNTSword.itemID) { thePlayer.triggerAchievement(buildExplosives); } } I used modloader because when I use something similar to this: public void addAchievementName(String ach, String name) { LanguageRegistry.instance().addStringLocalization("achievement." + ach, "en_US", name); } public void addAchievementDesc(String ach, String desc) { LanguageRegistry.instance().addStringLocalization("achievement." + ach + ".desc", "en_US", desc); } public void addAchievementLocalizations() { this.addAchievementName("buildExplosives", "E.W.O.M.D"); this.addAchievementDesc("buildExplosives", "Explosive Weapons of Mass Destruction"); } Shows up as achievement.buildExplosives.desc, still gotta figure out that part -
Hey guys, I don't know why, but for some reason my achievement refuses to trigger. No matter what method I use I can't get it to work. Trigger code: public void takenFromCrafting(EntityPlayer thePlayer, ItemStack stack, IInventory matrix){ if(stack.itemID == Explosive.TNTSword.itemID) { thePlayer.addStat(buildExplosives, 1); } } It is loaded, shows up on the achievement list, however once built in the crafting table and taken out, no achievement. Here is the full list of the code. Not sure what other method I should use, or if because of the update there is a different way of doing so. Would appreciate the help and input! Full Code: public class Explosive extends BaseMod { // ** declaring in game item ** public static Item TNTPickaxe; public static Item TNTSword; public static Item TNTAxe; public static Item TNTShovel; public static Item ElementalShaft; public static Item ElementalGem; public static Block ElementalOre; // ** New Achievements ** public static final Achievement buildExplosives = new Achievement(5000, "buildExplosives", -3, -1, Item.diamond, null).registerAchievement(); public static ElementalOreWorldGeneration Genworld = new ElementalOreWorldGeneration(); public void load() { } // ** Achievement Triggers ** public void takenFromCrafting(EntityPlayer thePlayer, ItemStack stack, IInventory matrix){ if(stack.itemID == TNTSword.itemID) { thePlayer.addStat(buildExplosives, 1); } } public Explosive (){ // ** Creating new in game item ** TNTPickaxe = new ItemTNTPickaxe(1000, EnumToolMaterial.ELEMENTAL).setUnlocalizedName("TNTPickaxe").setCreativeTab(CreativeTabs.tabTools); TNTSword = new ItemTNTSword(1001, EnumToolMaterial.ELEMENTAL).setUnlocalizedName("TNTSword").setCreativeTab(CreativeTabs.tabCombat); TNTAxe = new ItemTNTAxe(1002, EnumToolMaterial.ELEMENTAL).setUnlocalizedName("TNTAxe").setCreativeTab(CreativeTabs.tabTools); TNTShovel = new ItemTNTShovel(1003, EnumToolMaterial.ELEMENTAL).setUnlocalizedName("TNTShovel").setCreativeTab(CreativeTabs.tabTools); ElementalShaft = new ItemElementalShaft(1004).setUnlocalizedName("ElementalShaft").setCreativeTab(CreativeTabs.tabMaterials); ElementalGem = new ItemElementalGem(1005).setUnlocalizedName("ElementalGem").setCreativeTab(CreativeTabs.tabMaterials); ElementalOre = new BlockElementalOre(1007, Material.rock).setUnlocalizedName("ElementalOre").setCreativeTab(CreativeTabs.tabBlock).setHardness(15.0f).setResistance(15.0f).setLightValue(2.0f); // TO DO: MAKE WEAPON EXPLODE BLOCKS IN FRONT OF THEM: Sword DONE, Pickaxe, Axe, Shovel // TO DO: MAKE WEAPONS EXPLODE BUT DISAPPEAR BLOCKS: Pickaxe, Axe, Shovel // TO DO: MAKE NEW KIND OF TNT BLOCK FOR RECIPE // TO DO: CHARGE MECHANISIM FOR DIFFERENT EXPLOSION SIZES // ** Adding Blocks into the world - What kind of pickaxe can mine ** MinecraftForge.setBlockHarvestLevel(ElementalOre, "pickaxe", 3); GameRegistry.registerBlock(ElementalOre); GameRegistry.registerWorldGenerator(Genworld); // ** In Game Name ** LanguageRegistry.addName(ElementalOre, "Elemental Ore"); LanguageRegistry.addName(TNTPickaxe, "TnT Pickaxe"); LanguageRegistry.addName(TNTSword, "TnT Sword"); LanguageRegistry.addName(TNTAxe, "TnT Axe"); LanguageRegistry.addName(TNTShovel, "TnT Shovel"); LanguageRegistry.addName(ElementalShaft, "Elemental Shaft"); LanguageRegistry.addName(ElementalGem, "Elemental Gem"); // ** Recipes ** GameRegistry.addRecipe(new ItemStack(TNTPickaxe, 1), new Object [] { "XXX", " * ", " * ", 'X', Block.tnt, '*', Item.stick }); GameRegistry.addRecipe(new ItemStack(TNTSword, 1), new Object [] { " X ", " X ", " * ", 'X', Block.tnt, '*', Item.stick }); GameRegistry.addRecipe(new ItemStack(TNTAxe, 1), new Object [] { "XX ", "X* ", " * ", 'X', Block.tnt, '*', Item.stick }); GameRegistry.addRecipe(new ItemStack(TNTShovel, 1), new Object [] { " X ", " * ", " * ", 'X', Block.tnt, '*', Item.stick }); GameRegistry.addRecipe(new ItemStack(ElementalShaft, 4), new Object [] { " X ", " X ", 'X', ElementalGem }); // ** Achievement Descriptions ** ModLoader.addAchievementDesc(buildExplosives, "E.W.O.M.D", "Explosive Weapons Of Mass Destruction. Go Crazy!"); } public String getVersion() { return null; } } Thanks!
-
[SOLVED] Explosive Sword not working
ThaxxelGaming replied to ThaxxelGaming's topic in Modder Support
Fantastic! Thanks man! Found that using: public boolean onItemUse worked! OR i could use public ItemStack onItemRightClick. By changing the extends folder to Item.java rather than ItemSword.java. You helped out a lot, never would have thought otherwise! Thanks! -
Hey guys, I am stepping up into a more intermediate level of modding after a long break. Made a sword, wanting to have myself click on a block (dirt, cobblestone, etc) and make the surrounding area explode on touch or disappear. One of the two. (Without totally killing me in the process) Started off with the code below: Code: public class ItemTNTSword extends ItemSword{ public ItemTNTSword(int par1, EnumToolMaterial i) { super(par1, i); this.maxStackSize = 1; this.setCreativeTab(CreativeTabs.tabCombat); } public void updateIcons(IconRegister iconRegister){ iconIndex = iconRegister.registerIcon("Explosive:TnTSword"); } public boolean onBlockActivated(ItemStack itemstack, EntityPlayer entityplayer, World world, int blockx, int blocky, int blockz, int par7, float x, float y, float z) { if (par7 == 0) blocky--; if (par7 == 1) blocky++; if (par7 == 2) blockz--; if (par7 == 3) blockz++; if (par7 == 4) blockx--; if (par7 == 5) blockx++; world.createExplosion(entityplayer, blockx, blocky, blockz, 10.0f, true); return true; } However, this doesn't seem to work. I realize I have something wrong here, just not sure what. I am also pretty sure "onBlockActivated" is the wrong use for what I am going for. Would appreciate the help and input!! Thanks!
-
[SOLVED] Minecraft Crashes in Eclipse
ThaxxelGaming replied to ThaxxelGaming's topic in Modder Support
You are a life saver! Thank you very much! That is exactly what I was doing. Appreciate the help! -
Hey Guys, Finally returned to modding, and to refresh my memory decided to start with the basics. However, as I went to test everything, Minecraft continuously crashes.. Not quite sure where to begin to fix this. I have been looking up a lot, but have had no luck. I uploaded the crash report text file. Appreciate the help! Thanks! Crash Report Text (Wouldn't upload via attachment to copy and paste): ---- Minecraft Crash Report ---- // Oh - I know what I did wrong! Time: 4/25/13 10:11 PM Description: Failed to start game java.lang.ClassCastException: net.minecraft.block.BlockTNT cannot be cast to java.lang.Character at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:186) at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:244) at cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:239) at Snakegunner.mod.TnTSword.common.TnTSword.<init>(TnTSword.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at cpw.mods.fml.common.FMLModContainer$JavaAdapter.getNewInstance(FMLModContainer.java:129) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:487) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98) at cpw.mods.fml.common.Loader.loadMods(Loader.java:502) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:160) at net.minecraft.client.Minecraft.startGame(Minecraft.java:407) at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44) at net.minecraft.client.Minecraft.run(Minecraft.java:729) at java.lang.Thread.run(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.5.1 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_21, Oracle Corporation Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 946585440 bytes (902 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v7.44 FML v5.1.8.611 Minecraft Forge 7.7.1.611 4 mods loaded, 4 mods active mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed FML [Forge Mod Loader] (coremods) Unloaded->Constructed Forge [Minecraft Forge] (coremods) Unloaded->Constructed TnTSword [TnTSword] (bin) Unloaded->Errored LWJGL: 2.4.2 OpenGL: GeForce 310M/PCIe/SSE2 GL version 3.3.0, NVIDIA Corporation Is Modded: Definitely; Client brand changed to 'forge,fml' Type: Client (map_client.txt) Texture Pack: Default Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: null