Jump to content

Taji34

Forge Modder
  • Posts

    147
  • Joined

  • Last visited

Everything posted by Taji34

  1. How would I send a packet to the server to change the NBT tag name? Am I able to send lines of code to the server in a packet?
  2. So do I have the NBT data in the right place now? package taji34.troncraft; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.settings.KeyBinding; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagByte; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagString; import net.minecraft.network.packet.Packet250CustomPayload; import net.minecraft.world.World; public class Baton extends Item { public Baton(int par1) { super(par1); setMaxStackSize(1); setCreativeTab(CreativeTabs.tabMisc); setUnlocalizedName("Baton"); } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("Troncraft:Baton"); } public static KeyBinding mode = new KeyBinding("Baton Staff Mode", 36); public void keyboardEvent(KeyBinding keybinding) { if(keybinding == mode) { } } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { NBTTagCompound tag = par1ItemStack.getTagCompound(); if (tag == null) { tag = new NBTTagCompound(); par1ItemStack.setTagCompound(tag); } if (tag.getName().equals("tag")) { tag.setName("Test1"); } System.out.println(tag.getName()); return par1ItemStack; } }
  3. Okay, so I am trying to get the name of a NBTTag to change when I press a key, however when I press the key the name is not changing. I have it print the name to the console on right click, but the name just stays at what it was initialized at. Here is my code: Baton.java: package taji34.troncraft; import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.settings.KeyBinding; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagByte; import net.minecraft.nbt.NBTTagString; import net.minecraft.world.World; public class Baton extends Item { public Baton(int par1) { super(par1); setMaxStackSize(1); setCreativeTab(CreativeTabs.tabMisc); setUnlocalizedName("Baton"); } NBTTagByte data = new NBTTagByte("Test1"); @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("Troncraft:Baton"); } public static KeyBinding mode = new KeyBinding("Baton Staff Mode", 36); public void keyboardEvent(KeyBinding keybinding) { if(keybinding == mode) { if(!(data.getName().equals("Test2"))){ data.setName("Test2"); } } } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { System.out.println(data.getName()); return par1ItemStack; } } Troncraft.java: package taji34.troncraft; import net.minecraft.block.Block; import net.minecraft.client.renderer.entity.RenderSnowball; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.projectile.EntitySnowball; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.src.ModLoader; import cpw.mods.fml.client.registry.KeyBindingRegistry; import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PostInit; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="Troncraft", name="Troncraft", version="0.0.1") @NetworkMod(clientSideRequired=true, serverSideRequired=false) public class Troncraft { // The instance of your mod that Forge uses. @Instance("Troncraft") public static Troncraft instance; public final static Item identityDisk = new IdentityDisk(5001); int diskItemID = identityDisk.itemID; private final static Item baton = new Baton(5002); int batonItemID = baton.itemID; KeyBinding[] bindings = { Baton.mode }; TajiKeyHandler keyHandler; // Says where the client and server 'proxy' code is loaded. @SidedProxy(clientSide="taji34.troncraft.client.ClientProxy", serverSide="taji34.troncraft.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { // Stub Method } @EventHandler public void load(FMLInitializationEvent event) { LanguageRegistry.addName(identityDisk, "Identity Disk"); LanguageRegistry.addName(baton, "Baton"); EntityRegistry.registerModEntity(EntityIdentityDisk.class, "IdentityDisk", 5001, this, 40, 3, true); RenderingRegistry.registerEntityRenderingHandler(EntityIdentityDisk.class, new RenderSnowball(identityDisk)); keyHandler = new TajiKeyHandler(bindings); KeyBindingRegistry.registerKeyBinding(keyHandler); } @EventHandler public void postInit(FMLPostInitializationEvent event) { // Stub Method } } Any ideas? Am I doing something wrong?
  4. Hey, so in case anyone was looking at this thread and wanted to know the working code I used, here it is: public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){ if (par5){ par2World.playSoundAtEntity(par3Entity, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); //"random.bow" just used as a test } }
  5. Is there a specific method I should use? Or do I just compare the result of getCurrentItem with the item I want the sound to play on?
  6. I am simply wondering what method to override in my item in order to put use the playSoundAtEntity method so I can play a sound when the player holds an item.
  7. I put that into my Main class and changed what I needed and it doesn't seem to be working, still invisible.
  8. Yeah, I figure that you have to make a separate class to register the renders in order to not edit core minecraft files, but I'm not quite sure.
  9. Hi, I'm wondering how I would go about rendering an entity like a snowball. Like, I've created the entity and it works fine, it's just invisible because the renderer doesn't know how to. What class do I need to make a stuff to register the entity and how to render it in game?
  10. Forge Version: minecraftforge-src-1.6.2-9.10.0.789 Eclipse Version: Kepler Release (Build id: 20130614-0229) JDK Version: jdk1.7.0_09 Okay, so I followed the tutorial on the wiki, and when I open my workspace it has the following 8 warnings: Build path specifies execution environment JavaSE-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment. Dead code Resource leak: '<unassigned Closeable value>' is never closed Resource leak: 'jar' is never closed Resource leak: 'mcJarFile' is never closed The argument of type String[] should explicitly be cast to Object[] for the invocation of the varargs method translateToLocalFormatted(String, Object...) from type StatCollector. It could alternatively be cast to Object for a varargs invocation The assignment to variable par2 has no effect Unreachable catch block for IOException. Only more specific exceptions are thrown and they are handled by previous catch block(s). I have not done anything to any files yet, this is off a clean install. Should I worry about these warnings, or not? Thank You.
  11. THIS THREAD WILL NOT BE KEPT UP TO DATE, PLEASE VISIT OUR THREAD ON THE MINECRAFT FORUMS: http://www.minecraftforum.net/topic/2760740-172alphatroncraft/ DISCLAIMER: We do not own, or own the rights to the Tron name or any names associated with tron. All rights go to Disney. Hello program, Welcome to the grid. What is Troncraft? Troncraft is a Tron: Legacy inspired mod. Other tron mods add individual things such as Light Cycles, identity discs and armor, etc. Troncraft will add a whole new dimension to minecraft called The Grid. In addition to the new realm, we plan to add our own rendition of light cycles, identity discs, etc. from the tron series into minecraft. The grid will also be inhabited by Programs, ISOs, and the rare User. Progress: First Alpha build, few features, not balanced. Planned features: Light Cycles Identity Discs Implemented, further functionality planned Light Batons Implementer, furthur functionality planned The Grid New Mobs for the Grid Installation Instructions: [*]Download Minecraft Forge 10.12.1.1112 for Minecraft 1.7.2 and install, newer versions of Minecraft Forge should work, but have not been tested and are not gauranteed to work. [*]Drop the mod file (.jar) into the mods folder of your minecraft install, and then you are done! Downloads Lincence: This mod is licenced under MMPL version 1.0.1
  12. So I did some snooping around and looked at the MCP tutorial and figured out that I needed to change some settings, but now it runs but then give out an error message: 2012-10-15 21:08:48 [iNFO] [ForgeModLoader] Forge Mod Loader version 3.1.35.394 for Minecraft client:1.3.2, server:1.3.2 loading 2012-10-15 21:08:48 [iNFO] [ForgeModLoader] Downloading file http://files.minecraftforge.net/fmllibs/argo-2.25.jar 2012-10-15 21:08:49 [iNFO] [ForgeModLoader] Download complete 2012-10-15 21:08:49 [iNFO] [ForgeModLoader] Downloading file http://files.minecraftforge.net/fmllibs/guava-12.0.1.jar 2012-10-15 21:08:52 [iNFO] [ForgeModLoader] Download complete 2012-10-15 21:08:52 [iNFO] [ForgeModLoader] Downloading file http://files.minecraftforge.net/fmllibs/asm-all-4.0.jar 2012-10-15 21:08:53 [iNFO] [ForgeModLoader] Download complete 2012-10-15 21:08:54 [iNFO] [sTDERR] java.lang.reflect.InvocationTargetException 2012-10-15 21:08:54 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2012-10-15 21:08:54 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 2012-10-15 21:08:54 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2012-10-15 21:08:54 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Method.java:601) 2012-10-15 21:08:54 [iNFO] [sTDERR] at cpw.mods.fml.relauncher.FMLRelauncher.relaunchClient(FMLRelauncher.java:111) 2012-10-15 21:08:54 [iNFO] [sTDERR] at cpw.mods.fml.relauncher.FMLRelauncher.handleClientRelaunch(FMLRelauncher.java:26) 2012-10-15 21:08:54 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.main(Minecraft.java:2112) 2012-10-15 21:08:54 [iNFO] [sTDERR] at Start.main(Start.java:29) 2012-10-15 21:08:54 [iNFO] [sTDERR] Caused by: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path 2012-10-15 21:08:54 [iNFO] [sTDERR] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860) 2012-10-15 21:08:54 [iNFO] [sTDERR] at java.lang.Runtime.loadLibrary0(Runtime.java:845) 2012-10-15 21:08:54 [iNFO] [sTDERR] at java.lang.System.loadLibrary(System.java:1084) 2012-10-15 21:08:54 [iNFO] [sTDERR] at org.lwjgl.Sys$1.run(Sys.java:72) 2012-10-15 21:08:54 [iNFO] [sTDERR] at java.security.AccessController.doPrivileged(Native Method) 2012-10-15 21:08:54 [iNFO] [sTDERR] at org.lwjgl.Sys.doLoadLibrary(Sys.java:65) 2012-10-15 21:08:54 [iNFO] [sTDERR] at org.lwjgl.Sys.loadLibrary(Sys.java:81) 2012-10-15 21:08:54 [iNFO] [sTDERR] at org.lwjgl.Sys.<clinit>(Sys.java:98) 2012-10-15 21:08:54 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.getSystemTime(Minecraft.java:2423) 2012-10-15 21:08:54 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.fmlReentry(Minecraft.java:2122) 2012-10-15 21:08:54 [iNFO] [sTDERR] ... 8 more Any ideas? EDIT: I figured out my problem! The library path wasn't pointing to the right place, so it couldn't find some files. Thanks for the help!
  13. I followed the instructions found here: http://www.minecraftforge.net/wiki/NetBeans but when I try to run Minecraft in Netbeans I get the following error: java.lang.NoSuchFieldException: minecraftDir at java.lang.Class.getDeclaredField(Class.java:1899) at Start.main(Start.java:17) I haven't edited anything with Minecraft yet, I was just checking to make sure it ran correctly. I am using the recommended build of forge (as of Oct 15, build 303). What's wrong? Did I do something wrong somewhere? Thanks for your help.
  14. I'm trying to make an addon for Buildcraft and I can't figure out how to add the source to MCP with Forge. Help would be much appreciated. Also, If this is the wrong thread to post this in, could a Mod move it to the correct thread?
  15. Yeah, I was considering using eclipse, I'm probably going to try that.
  16. Okay, so I followed the Minecraft Forge installation instructions on the wiki, and the instructions on the MCP wiki for setting up Netbeans with MCP and I get this error: http://i1063.photobucket.com/albums/t506/Taji34/Error_zps02279195.png[/img] Did I do something wrong or is this normal?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.