Jump to content

Feldherren

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Feldherren

  1. For plugin-testing purposes (currently), I've written something that can dynamically create simple items based on either the contents of a configuration file, or in-game commands (that, along with creating said item, add the right details to the configuration file), and use a command or output a message when used on things. I've run into a couple of minor issues with this - they work, but they only have unlocalised names, and . First, items created from either the configuration file or in-game commands only have unlocalised names; since the unlocalised name is different for each item, and since these items aren't made in advance, the EN_lang file doesn't contain a proper name for them. Is there a way to give items proper names when created, since I don't know what names are going to be used in advance? Second, items created via in-game commands function properly, but don't have the expected item graphic, instead acting as if they have no graphic. If the server is restarted and the item created from the configuration file, they do. Is this a result of attempting to register an item too late, and, again, is there a way to fix this? Possibly relevant: constructor of basic item public ItemMagicWand(String name, String newCommand) { setUnlocalizedName(MagicWands.MODID + "_" + name); setTextureName(MagicWands.MODID + ":" + "magicWand"); GameRegistry.registerItem(this, name); setCreativeTab(CreativeTabs.tabMisc); command = newCommand; if(command.charAt(0) == "/".toCharArray()[0]) isCommand = true; else isCommand = false; }
  2. For testing purposes I've been writing a mod that dynamically generates custom items with an attached string based on a configuration file. The intention is allowing a player to run a command (eventually on a given creature, tile or chunk) by using the custom item; currently I've got it so the custom items spit out text from a configuration file. However, when I try to use this to run a command (EG. '/summon Sheep ~ ~ ~ {CustomName:Magic Sheep}' - which works when used from chat by the player) it still just outputs the text to chat rather than attempting to do it as if the wielding player had typed it out themselves. Is it possible to do this? Here's the code for the custom items as I have it currently: package org.nationsatwar.magictestingwands.items; import net.minecraft.client.Minecraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import org.nationsatwar.magictestingwands.MagicWands; import cpw.mods.fml.common.registry.GameRegistry; public class ItemMagicWand extends Item { private String command = ""; public ItemMagicWand(String name, String newCommand) { setUnlocalizedName(MagicWands.MODID + "_" + name); setTextureName(MagicWands.MODID + ":" + "magicWand"); GameRegistry.registerItem(this, name); setCreativeTab(CreativeTabs.tabMisc); command = newCommand; } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); ChatComponentText msg = new ChatComponentText(command); if(!par3EntityPlayer.worldObj.isRemote) { Minecraft.getMinecraft().thePlayer.addChatComponentMessage(msg); } return par1ItemStack; } }
  3. This has been solved, but I'm not sure if I can competently explain it. As far as I'm aware, when an entity rather than the environment was hit, the spawnParticle() method ended up rendering them to the server, not the client, so I as a player saw nothing. I (with the help of a better-coder friend) ended up using packets to get the client to render the particles. So, should anyone need an example: In preInit() in the main class: snw = NetworkRegistry.INSTANCE.newSimpleChannel(SmokebombMain.MODID); snw.registerMessage(PacketHugeExplosion.class, PacketHugeExplosion.class, 0, Side.CLIENT); EntityGreySmokebomb: package com.feldherren.smokebomb; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; public class EntityGreySmokebomb extends EntityThrowable { private int amount = 10; public EntityGreySmokebomb(World par1World) { super(par1World); } public EntityGreySmokebomb(World par1World, EntityLivingBase par2EntityLivingBase) { super(par1World, par2EntityLivingBase); } public EntityGreySmokebomb(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } /** * Called when this EntityThrowable hits a block or entity. */ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { if (par1MovingObjectPosition.entityHit != null) { EntityPlayer player = (EntityPlayer)this.getThrower(); TargetPoint point = new TargetPoint(par1MovingObjectPosition.entityHit.dimension, 100, par1MovingObjectPosition.entityHit.posX, par1MovingObjectPosition.entityHit.posY, par1MovingObjectPosition.entityHit.posZ); PacketHugeExplosion packetHugeExplosion = new PacketHugeExplosion(par1MovingObjectPosition.entityHit.posX,par1MovingObjectPosition.entityHit.posY, par1MovingObjectPosition.entityHit.posZ, amount); SmokebombMain.snw.sendToAllAround(packetHugeExplosion, point); par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, getThrower()), 0.0F); } for (int var3 = 0; var3 < amount; ++var3) { this.worldObj.spawnParticle("hugeexplosion", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); } if (!this.worldObj.isRemote) { this.setDead(); } } } PacketHugeExplosion: package com.feldherren.smokebomb; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; public class PacketHugeExplosion implements IMessage, IMessageHandler<PacketHugeExplosion, IMessage> { double posX, posY, posZ; int amount; public PacketHugeExplosion() { } public PacketHugeExplosion(EntityPlayer player, int amount) { this(player.posX, player.posY, player.posZ, amount); } public PacketHugeExplosion(double posX, double posY, double posZ, int amount) { this.posX = posX; this.posY = posY; this.posZ = posZ; this.amount = amount; } @Override public void fromBytes(ByteBuf buf) { // TODO Auto-generated method stub this.posX = buf.readDouble(); this.posY = buf.readDouble(); this.posZ = buf.readDouble(); this.amount = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { // TODO Auto-generated method stub buf.writeDouble(posX); buf.writeDouble(posY); buf.writeDouble(posZ); buf.writeInt(amount); } @Override public IMessage onMessage(PacketHugeExplosion message, MessageContext ctx) { for (int var3 = 0; var3 < message.amount; ++var3) { FMLClientHandler.instance().getClient().theWorld.spawnParticle("hugeexplosion", message.posX, message.posY+1, message.posZ, 0.0D, 0.0D, 0.0D); } // TODO Auto-generated method stub return null; } } I don't think I missed anything out here, so this should serve as an example of how to do it. Seems solved now that it does detonate on sheep, too.
  4. I don't know. Would that cause particles to be generated and visible to at least the thrower when the smokebomb or snowball entity hits a block, but cause particles to (apparently) not to be generated when the projectile hits a sheep? How can I tell?
  5. That 'int amount' was actually just there to make sure the loop that outputs particles would do the same from in the 'has hit something' part as outside, when I had two copies of it, and from when I was testing to see what works best for a cloud of smoke - ten particles look good, a hundred particles look stupidly-synchronised. That said, tried that. Unfortunately it didn't help, but changing it didn't break anything and I should probably remember to set things private in future. The problem with copying the snowball code exactly is... snowballs show exactly the same behaviour. You're assuming they emit particles when you hit an entity like a sheep with them, but they don't. The behaviour of unmodified snowballs was one of the first things I checked, since EntityGreySmokebomb here is very obviously copied from EntitySnowball. I've checked this on a vanilla copy of Minecraft, too. (This is why I asked about ThrowableEntity and not 'my throwable thing', but I thought I'd mentioned it in the original post. Checking it, I guess I didn't.) These smokebombs do work when they hit the environment. They generate a very obvious cloud of smoke. The particle certainly isn't invisible.
  6. I have a smokebomb. It's kind of like a snowball, but instead of splitting into snow particles when you throw it at solid stuff, it generates a cloud of smoke instead. Well, currently a smokecube, because I haven't yet found a good tutorial for 1.7.2 ThrowableEntity renderers, and what I've found for 1.6 doesn't seem to work. Not my current issue, at any rate. I want my smokecube to explode into smoke when it hits anything. I'm not having any issues with the smokecube and the ground, but when it gets tossed at an entity, it just deals 0 damage (not a problem) and vanishes without generating any particles (problem). I want a cloud of smoke even if an entity blocks the smokecube with their face. I've tried putting a copy of the particle generation loop in the conditional section that checks if it hit an entity, but that doesn't change anything whether placed before or after the line saying it deals 0 damage to the entity. I've also, by trial and error, attempted to use blockX, blockY and blockZ from par1MovingObjectPosition.entityHit in place of the this.usual posX, this.posY and this.posZ in this.worldObj.spawnParticle(), but again that did nothing. Does anyone know how to make a ThrowableEntity do particle stuff when/after hitting an entity, rather than just dealing damage (if applicable) and vanishing? package com.feldherren.smokebomb; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class EntityGreySmokebomb extends EntityThrowable { int amount = 10; public EntityGreySmokebomb(World par1World) { super(par1World); } public EntityGreySmokebomb(World par1World, EntityLivingBase par2EntityLivingBase) { super(par1World, par2EntityLivingBase); } public EntityGreySmokebomb(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } /** * Called when this EntityThrowable hits a block or entity. */ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { if (par1MovingObjectPosition.entityHit != null) { par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, getThrower()), 0.0F); } for (int var3 = 0; var3 < amount; ++var3) { this.worldObj.spawnParticle("hugeexplosion", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); } if (!this.worldObj.isRemote) { this.setDead(); } } }
  7. Okay. Thank you very much for your help. That solved it.
  8. Okay. To make sure I'm getting this correct... well, I tested and it works, but this is more to provide the answer for anyone who gets the same issue and to make sure I'm not doing something that will cause issues for me further down the line, instead of just doing: @instance ...prior to setting up the instance, I want to do: @instance(value = [MainClassHere].MODID) Right?
  9. So I have my workspace and my Forge project set up (as per tutorial, now), and have one functional mod written sitting there as a package. The Minecraft client used for testing runs properly and the command the mod adds works as expected. I create another package, set it up with a basic modfile, and attempt to run the client. This time it fails to work, and gives me errors: [18:23:46] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker [18:23:46] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker [18:23:46] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker [18:23:46] [main/INFO] [FML]: Forge Mod Loader version 7.2.211.1121 for Minecraft 1.7.2 loading [18:23:46] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_05, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre8 [18:23:46] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [18:23:46] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [18:23:46] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker [18:23:46] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [18:23:46] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [18:23:46] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [18:23:46] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [18:23:47] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/BECKYPC/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1121/forgeSrc-1.7.2-10.12.2.1121.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again! [18:23:47] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem! [18:23:47] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/BECKYPC/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1121/forgeSrc-1.7.2-10.12.2.1121.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it [18:23:47] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [18:23:47] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [18:23:47] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker [18:23:47] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [18:23:47] [main/INFO]: Setting user: Player897 [18:23:48] [Client thread/INFO]: LWJGL Version: 2.9.0 [18:23:49] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [18:23:49] [Client thread/INFO] [FML]: MinecraftForge v10.12.2.1121 Initialized [18:23:49] [Client thread/INFO] [FML]: Replaced 182 ore recipies [18:23:49] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [18:23:49] [Client thread/INFO] [FML]: Searching G:\Projects\Nations at War\Coding\Forge\Forge\eclipse\mods for mods [18:23:50] [Client thread/ERROR] [FML]: FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.FMLRenderAccessLibrary. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! [18:23:51] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load Jun 22, 2014 6:23:51 PM com.google.common.eventbus.EventBus dispatch SEVERE: Could not dispatch event: cpw.mods.fml.common.event.FMLConstructionEvent@4a68cbc5 to handler [wrapper public void cpw.mods.fml.common.FMLModContainer.constructMod(cpw.mods.fml.common.event.FMLConstructionEvent)] java.lang.reflect.InvocationTargetException 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:47) 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.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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:47) 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:118) at cpw.mods.fml.common.Loader.loadMods(Loader.java:491) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204) at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) at net.minecraft.client.Minecraft.run(Minecraft.java:892) at net.minecraft.client.main.Main.main(Main.java:112) 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 net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.IllegalArgumentException: Can not set static com.feldherren.smokebomb.SmokebombMain field com.feldherren.smokebomb.SmokebombMain.instance to com.feldherren.moonphase.MoonphaseMain at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source) at java.lang.reflect.Field.set(Unknown Source) at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:407) at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:338) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:493) ... 32 more Jun 22, 2014 6:23:51 PM com.google.common.eventbus.EventBus dispatch SEVERE: Could not dispatch event: cpw.mods.fml.common.event.FMLConstructionEvent@4a68cbc5 to handler [wrapper public void cpw.mods.fml.common.FMLModContainer.constructMod(cpw.mods.fml.common.event.FMLConstructionEvent)] java.lang.reflect.InvocationTargetException 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:47) 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.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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:47) 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:118) at cpw.mods.fml.common.Loader.loadMods(Loader.java:491) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204) at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) at net.minecraft.client.Minecraft.run(Minecraft.java:892) at net.minecraft.client.main.Main.main(Main.java:112) 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 net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.IllegalArgumentException: Can not set static com.feldherren.moonphase.MoonphaseMain field com.feldherren.moonphase.MoonphaseMain.instance to com.feldherren.smokebomb.SmokebombMain at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source) at java.lang.reflect.Field.set(Unknown Source) at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:407) at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:338) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:493) ... 32 more [18:23:51] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from CONSTRUCTING to PREINITIALIZATION. Loading cannot continue [18:23:51] [Client thread/ERROR] [FML]: mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed FML{7.2.211.1121} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed Forge{10.12.2.1121} [Minecraft Forge] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed moonphase{1.0} [Moon Phase Command] (bin) Unloaded->Errored smokebomb{1.0.0} [smokebombs] (bin) Unloaded->Errored [18:23:51] [Client thread/ERROR] [FML]: The following problems were captured during this phase [18:23:51] [Client thread/ERROR] [FML]: Caught exception from moonphase java.lang.IllegalArgumentException: Can not set static com.feldherren.smokebomb.SmokebombMain field com.feldherren.smokebomb.SmokebombMain.instance to com.feldherren.moonphase.MoonphaseMain at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[?:1.8.0_05] at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[?:1.8.0_05] at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source) ~[?:1.8.0_05] at java.lang.reflect.Field.set(Unknown Source) ~[?:1.8.0_05] at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:407) ~[FMLModContainer.class:?] at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:338) ~[FMLModContainer.class:?] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:493) ~[FMLModContainer.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[LoadController.class:?] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[LoadController.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?] at cpw.mods.fml.common.Loader.loadMods(Loader.java:491) [Loader.class:?] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:892) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] [18:23:51] [Client thread/ERROR] [FML]: Caught exception from smokebomb java.lang.IllegalArgumentException: Can not set static com.feldherren.moonphase.MoonphaseMain field com.feldherren.moonphase.MoonphaseMain.instance to com.feldherren.smokebomb.SmokebombMain at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[?:1.8.0_05] at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) ~[?:1.8.0_05] at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source) ~[?:1.8.0_05] at java.lang.reflect.Field.set(Unknown Source) ~[?:1.8.0_05] at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:407) ~[FMLModContainer.class:?] at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:338) ~[FMLModContainer.class:?] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:493) ~[FMLModContainer.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[LoadController.class:?] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[LoadController.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?] at cpw.mods.fml.common.Loader.loadMods(Loader.java:491) [Loader.class:?] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:892) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] [18:23:51] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Moon Phase Command, FMLFileResourcePack:Smokebombs ---- Minecraft Crash Report ---- // On the bright side, I bought you a teddy bear! Time: 22/06/14 18:23 Description: Initializing game java.lang.IllegalArgumentException: Can not set static com.feldherren.smokebomb.SmokebombMain field com.feldherren.smokebomb.SmokebombMain.instance to com.feldherren.moonphase.MoonphaseMain at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source) at java.lang.reflect.Field.set(Unknown Source) at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:407) at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:338) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:493) 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:47) 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.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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:47) 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:118) at cpw.mods.fml.common.Loader.loadMods(Loader.java:491) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204) at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) at net.minecraft.client.Minecraft.run(Minecraft.java:892) at net.minecraft.client.main.Main.main(Main.java:112) 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 net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source) at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source) at java.lang.reflect.Field.set(Unknown Source) at cpw.mods.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:407) at cpw.mods.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:338) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:493) 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:47) 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.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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:47) 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:118) at cpw.mods.fml.common.Loader.loadMods(Loader.java:491) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:204) at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:892) at net.minecraft.client.main.Main.main(Main.java:112) 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 net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details: Minecraft Version: 1.7.2 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0_05, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 867881064 bytes (827 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 IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.03 FML v7.2.211.1121 Minecraft Forge 10.12.2.1121 5 mods loaded, 5 mods active mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed FML{7.2.211.1121} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed Forge{10.12.2.1121} [Minecraft Forge] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed moonphase{1.0} [Moon Phase Command] (bin) Unloaded->Errored smokebomb{1.0.0} [smokebombs] (bin) Unloaded->Errored Launched Version: 1.6 LWJGL: 2.9.0 OpenGL: GeForce GTX 680/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: null Anisotropic Filtering: Off (1) #@!@# Game crashed! Crash report saved to: #@!@# G:\Projects\Nations at War\Coding\Forge\Forge\eclipse\.\crash-reports\crash-2014-06-22_18.23.51-client.txt Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release Delete the new package, and it starts to work again. I notice that it's attempting to set the instance of each package to the main class of the other package. Is this a likely cause of the issue? Or would you need the code from the two packages to work out what's going on? I can post that, but don't want to if it's something basic. So am I doing something stupid, or can you just not (without doing stuff to prevent this issue) work on more than one package at once? And in either case, can this problem be prevented?
  10. Okay, I think I see where they differ. I was going to ask if you could tell me where, but I do see it, now. Thanks. My code was elsewhere, and I recognised that was why gradle wasn't working. I was wondering if there was a way around that, but going by what you said that was a symptom of another problem. Now I just need to work out why my code isn't working having been copied over from the original location, where it did work.
  11. It's described here: http://www.minecraftforge.net/forum/index.php/topic,14048.0.html (Also at http://bedrockminer.jimdo.com/modding-tutorials-1-7/set-up-minecraft-forge/set-up-minecraft-forge-advanced-setup/ , which is why I ended up using it in the first place.) Basically, creating a new workspace and importing Forge into it, rather than putting your workspace in the Eclipse directory in the Forge directory. I think. I've successfully written and run something already with this setup, so it's not that it doesn't work at all, but the steps for compiling a mod only seem to cover projects using the normal setup.
  12. The instructions for using gradle to compile mods in the tutorial only seems to be applicable when the basic setup process was used; having used the advanced initial setup (it was recommended by the first tutorial I found for setting up Forge for development with Eclipse, so I initially went with that), I ended up creating my mod in another package. However, I've noticed that the given steps for using gradle to compile this mod don't work for items in other projects. What do I need to do to compile my mod in another project than the default Forge one? Or do I need to somehow finagle the package for my mod from the other project to the Forge one? I'm new to Forge, having previously used Bukkit - and I'm rusty with both that and Eclipse due to not having used either for quite a while. Sorry if any of this sounds stupid.
×
×
  • Create New...

Important Information

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