Jump to content

arie2002

Forge Modder
  • Posts

    48
  • Joined

  • Last visited

Everything posted by arie2002

  1. if (event.getSide() == Side.CLIENT) { I'm checking if the side is the Client, so I don't have to worry 'bout that. Well, I have now. Does nothing. For as far as I can see I did the initialization correctly...
  2. Hello again! I'm currently messing around with IItemColors. I have made an item change colour depending on how damaged it is. However, now I want to do the same with an ItemBlock! I made a block and an itemblock and registered them correctly, and I registered the same ItemColorHandler as before to the itemblock. But the ItemBlock doesn't change color... The code doesn't even get activated?
  3. Hello! I'm working on a mod and I'm running into an issue. I would like to add some custom data to specific chunks. However, I couldn't find out how to do this. I searched around, but I only found out how to add data to a world. Is it possible to add data to a chunk? Arie
  4. Thanks for the quick reply! I looked through the documentation, and I don't really understand how and what capabilities are... Reading through it it almost seems capabilities are just temporary information, because the data is lost when the player dies or something. It might just be that I don't know many java/minecraft terms, but the documentation is just a bunch of gibberish to me
  5. Hello! I am working on a mod where custom data is attached to the player. Currently, this is my code: public static boolean isResearched(String tech, EntityPlayer player) { NBTTagCompound tag = player.getEntityData(); NBTTagList list = tag.getTagList("FTGU", NBT.TAG_STRING); for (int i = 0; i < list.tagCount(); i++) { String name = list.getStringTagAt(i); if (name == tech) { return true; } } return false; } public static void putResearched(String tech, EntityPlayer player) { NBTTagCompound tag = player.getEntityData(); if (!tag.hasKey("FTGU")) tag.setTag("FTGU", new NBTTagList()); NBTTagList list = tag.getTagList("FTGU", NBT.TAG_STRING); list.appendTag(new NBTTagString(tech)); } Basically, I am adding a new String List tag to the player NBT Compound. This code is run by the client and the server, so they should be synced up... ...but they aren't Right after the code is executed by both sides, I used the isResearched function and both sides said that the specific research was researched. However, later on I tested it again, and now only the server says it has been researched. Then I saved the world and reloaded it and now suddenly both sides say it hasn't been researched! I have never edited entity NBT before so I may be doing something entirely wrong
  6. Thanks, that solves one problem. However, the item still doesnt want to disappear...
  7. Hello! I am currently developing a mod and I came across an issue that I couldn't seem to solve with a google search. I am trying to show a message to the player when an item is right-clicked, and then remove that item from the player's hand. Currently, this is my code: package ftgumod.item; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import ftgumod.api.TechnologyHandler; import ftgumod.api.TechnologyUtil; public class ItemParchmentResearch extends Item { public ItemParchmentResearch(String name) { setUnlocalizedName(name); setMaxStackSize(1); } public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) { String tech = TechnologyUtil.getItemData(item).getString("FTGU"); if (TechnologyHandler.isResearched(tech, player)) { player.addChatMessage(new ChatComponentText(TechnologyHandler.getTechnology(tech).getLocalisedName() + " is already researched")); } else { TechnologyHandler.putResearched(tech, player); player.addChatMessage(new ChatComponentText(TechnologyHandler.getTechnology(tech).getLocalisedName() + " Researched!")); item.stackSize--; } return item; } } The Current problem is that the message appears twice, and that the item reappears a fraction of a second after it was consumed. I'm not sure what to do about this, so I'm asking for help.
  8. Thanks! But when I try ModelBakery, I am only able to use ModelBakry.addVariant Name EDIT: Anyways, it works, THANKS!
  9. Like the title says, I need to make an item that has multiple textures. I want to make an item that changes texture based on the amount of items in the ItemStack. I am familiar with the new 1.8 texture system (I can create a texture and let it show) but I can't find any tutorial that says how to make an item/block with multiple textures. - Arie2002
  10. I just tested only running IC2, and it still errors! Do I have the right IC2 version installed? New error:
  11. When I tried to make a modpack, this was the crash I got: Mods installed: - applied energistics2 rv2 stable 9 - CodeChickenCore 1.0.7.46 - NotEnoughItems1.0.5.111 - BuildCraft 7.0.12 - additional pipes 4.5.2 - customnpcs 1.7.10d - Waila 1.5.10 - extra cells 2.2.73 - Hardcore Questing 4.2.4 - IC2 1.118.401-lf - Thaumcraft 4.2.3.5 - thaumic energistics 0.8.10.5
  12. So, I have for the past days trying to make my Netty networking code work, and it doesn't seem to want to work for me... What I'm trying to do is to send information to the server when I right click with an item, so the server can set the item in the player's hand to the tile entity. Whatever I try to do, it doesn't seem to work... Because there is a lot of code in my mod, I will just send a link to my GitHub repository instead of pasting the code in here: https://github.com/RedstoneActivation/Elemental-Energy The networking gets called from: ra.heroworkbrine.elementalenergy.item.ItemChargeable IMessage: ra.heroworkbrine.elementalenergy.networking.EEMessage IMessageHandler: ra.heroworkbrine.elementalenergy.networking.MessageHandler If someone can find a flaw or knows a tutorial, it would be great! - Arie
  13. How did I not see that? Wow!
  14. Hello again! I just finished up my networking stuff, and I already have an error... This is the code of the IMessage: I have no idea what this error means, btw... Only the int m6 can be larger than 256, if the problem lies that the bytebuf can only store bytes - Arie
  15. I am indeed sending player operations to the server! The thing is, that the server has to know the coördinates of this operation, and that includes the dimension id (did I refer to it as world name? Oops...)
  16. Hello! I am currently working on packets and stuff, and I'm running into a problem: To send the world to the server side, I am sending the world name in a string. But how do I get the world from a string on the recieving end? - Arie [Edit] Solution: MinecraftServer.getServer().worldServers[dimensionID] Thanks larsgerrits!
  17. Hi! I just updated my mod from 1.7 to 1.8, and I'm already running into problems... A block called "EarthCollectorTier1" shows a texture when hold in a hand, but you can see through the frickin' world when placed on the ground! Github Repository: Click! Can someone help me with this? I have no idea what I'm doing wrong... Collector class files: Click!
  18. The title says it all.
  19. I never used dependencies in the @Mod annotation, how do I use it?
  20. So, I'm creating a mod that makes minecraft a bit more realistic. To do that I am removing all vanilla minecraft recipe's with this piece of code: CraftingManager.getInstance().getRecipeList().clear(); But there is a slight problem: this code also removes modded recipe's... Although this mod is not supposed to be played with other mods, it would still be nice for people who really want to play with other mods. So: is there a way to remove vanilla minecraft recipe's only?
  21. READ MY POST My problem is that i cannot move items when the inventory is open, NOT that the inventory is not opening. (aka it is opening) He did read your post. He's telling you exactly why it opened but you're not able to interact with it. Maybe YOU should read HIS post, instead of being an ass when someone is helping you. But I solved the problem with the workbench checking right? i placed a workbench in the world on coords 0, 0, 0 and opened that workbench. That should work, right?
  22. READ MY POST My problem is that i cannot move items when the inventory is open, NOT that the inventory is not opening. (aka it is opening)
  23. Like the title says, when I use player.displayGUIWorkbench, I do get the crafting menu but I CANNOT move items in my inventory! code: world.setBlock(0, 0, 0, Blocks.crafting_table, 0, 2); player.displayGUIWorkbench(0, 0, 0);
×
×
  • Create New...

Important Information

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