Jump to content

shieldbug1

Forge Modder
  • Posts

    404
  • Joined

  • Last visited

Everything posted by shieldbug1

  1. Please use the [ code ] tags (without the spaces) to make it easier to read. Now there are a few things I don't get here: @SideOnly(Side.CLIENT) public int aaA; @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int metadata) { for (int i = 0; i < 2; ++i) { aaA = i; } return field_150129_M[(!isOpaqueCube() ? 0 : 1)] [aaA]; } Is identical to @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { return field_150129_M[0][1]; } Next: public void registerBlockIcons(IIconRegister iconRegister) { field_150129_M = new IIcon[2][2]; for (int i = 0; i < 2; ++i) { field_150129_M[0] = iconRegister.registerIcon(CurrentMainClass.MODID + ":" + "waterinvolved_leaves"); field_150129_M[1] = iconRegister.registerIcon(CurrentMainClass.MODID + ":" + "waterinvolved_leaves_opaque"); } } What does this for-loop even do? You're instantiating indexes 0 an 1 in your array twice to the exact same thing. Apart from that field_150129_M is an IIcon[][] (double array). So field_150129_M[0] and field_150129_M[1] are actually arrays themselves. These things might be the cause of your problems, though I don't know. I also suggest cleaning up all of your local variables and renaming to readable things (p_SOMENUMBER_SOMELETTER is not understandable, and very hard to debug).
  2. I've made a library/utility mod that all my other mods depend on because I don't like having so much duplicate code. Now I created a sort of 'Dummy' mod class (a class annotated with @Mod) so that I can still hook into the @EventHandler events, as well as use the 'dependencies' functionality of @Mod. I don't really think it's necessary for this dummy mod to be shown in the 'Mods' screen (from the game menu). What would be the best way to approach this?
  3. I can confirm this also happens to me on that thread, using Google Chrome.
  4. I haven't messed with them yet, but you can try playing around with the new PlaceEvent (or maybe MultiPlaceEvent?).
  5. I believe the constructor for ResourceLocation takes in two arguments, domain (usually ModID), and then the location. So it should look like: new ResourceLocation(MODID, LOCATION);
  6. Could you link an example? I have never noticed this.
  7. I haven't done any rendering, but it looks like your switch statement is falling through. That could be it, maybe?
  8. Whatever you return in onMessage should be the reply if you need one. Otherwise return null.
  9. You don't even have to mess with packets themseles. Diesieben has an incredibly simple to understand tutorial on how to use the SimpleNetworkWrapper.
  10. Did you run gradlew eclipse setupDecompWorkspace gives you the source, while Dev doesn't. (http://prntscr.com/4ti9oi straight from running the command 'gradlew tasks' - as you can see, setupDecompWorkspace does CI + Dev + source). Running gradlew eclipse "generates all Eclipse files".
  11. You can't save a tileEntity by itself, however you can do this: SomeTileEntity tileEntity = ......; NBTTagCompound compound = new NBTTagCompound(); tileEntity.writeToNBT(compound); Then later, to get the tileEntity back NBTTagCompound compound = //retrieve the compound SomeTileEntity tileEntity = new SomeTileEntity(); tileEntity.readFromNBT(compound);
  12. Try running the setupDecompWorkspace and eclipse ForgeGradle commands again.
  13. Check the class of the entity. If you want to only affect vanilla entities then check the class itself, otherwise just use instanceof.
  14. I don't know if a IMessage can be its own IMessageHandler (I think I saw a pull for this get rejected on github). Rather than having your MessageIronNote class implement IMessageHandler directly, try having a static nested class implement it instead. public final class MyMessage implements IMessage { //IMessage code ... public static final class Handler implements IMessageHandler<MyMessage, IMessage> { //Handler code ... } } And registering like this: INSTANCE.registerMessage(MyMessage.Handler.class, MyMessage.class, id++, Side.SERVER);
  15. If you're looking for copy-paste ready code, you won't find it here.
  16. Call them from the Block's constructor. public final class SomeBlock extends Block { public SomeBlock() { super(Material.rock); setHardness(1.0F); } } To be honest, the block class shouldn't be treated as a 'Builder' class, and those methods should be void rather than 'chaining'.
  17. Your checkUpdate method needs to have an @EventHandler annotation, not a @SubscribeEvent one.
  18. What do you want to do? You can use the PlayerLoggedInEvent, EntityConstructing and EntityJoinWorldEvent events, in conjunction with PlayerChangedDimensionEvent and PlayerEvent.Clone if you need to keep stuff over deaths and dimension changes or whatever.
  19. First of all, max and min values are fields, not methods. You do not use brackets. Second, they're all CAPS like MAX_VALUE. Lastly, because the 'wildcard value' changes (it used to be -1 I think) you use OreDictionary.WILDCARD_VALUE. Anyway, to compare items just use ItemStack#getItem and then compare the reference, since there is only one instance of your item at a time.
  20. You're using the Minecraft class, which is Client only. You need to move your code into your client proxy, so that on message method should like like public IMessage onMessage(SomeMessage message, MessageContext ctx) { return MainMod.proxy.handleSomeMessage(message, ctx); } And then you create that method in client and server proxy, and just return null and do nothing on the server. Even though the message is sent from the server and only handled on the client, the server still needs to know about this class.
  21. ICommadSender is an interface implemented by EntityPlayer (or it's subclasses, I can't remember). if(someCommandSender instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) someCommandSender; }
  22. Are there any errors when running the gradle commands? Try running gradlew clean and then setupDecompWorkspace and eclipse again.
  23. You need to override the method onDescriptionPacket (or whatever the method is called, I forget) in your TileEntity class, and call readFromNBT from the NBTTagCompound you get from the Packet in the parameters of the method. Alternatively you can use the Simple Network Wrapper to update values between Client and Server. You can look at Pahimar's GitHub repository for EE3 as an example on how to do this properly.
×
×
  • Create New...

Important Information

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