-
[1.10.2] Add color to ItemBlock (IItemColor)
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...
-
[1.10.2] Add color to ItemBlock (IItemColor)
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?
-
[1.10.2] Add custom data to a chunk, not a world
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
-
[1.9.4] Custom Player NBT Tag not working currectly
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
-
[1.9.4] Custom Player NBT Tag not working currectly
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
-
[1.8.9] Show message and consume item on item right-click
Thanks, that solves one problem. However, the item still doesnt want to disappear...
-
[1.8.9] Show message and consume item on item right-click
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.
-
[1.8] Multiple Texture Item
Thanks! But when I try ModelBakery, I am only able to use ModelBakry.addVariant Name EDIT: Anyways, it works, THANKS!
-
[1.8] Multiple Texture Item
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
-
Industrialcraft 2 Crash
I just tested only running IC2, and it still errors! Do I have the right IC2 version installed? New error:
-
Industrialcraft 2 Crash
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
-
[1.7.10] Send information from Client to Server
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
-
[1.7.10] Netty Networking Error
How did I not see that? Wow!
-
[SOLVED] Get world from string
Thanks!
-
[1.7.10] Netty Networking Error
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
IPS spam blocked by CleanTalk.