
WildHeart
Members-
Posts
236 -
Joined
-
Last visited
Everything posted by WildHeart
-
You do not understand, I mean, how can I change the texture of the object directly in the game? See, before 1.7.10 was setTexture method and getIcon(or something similar) and it was possible to prescribe a different texture, and all would have worked, but how to do it on 1.8++ I have no idea.
-
This is understandable, but how to make the recipes available in the workbench without restarting? And how can you make the implementation with textures and icons, about which I wrote above?
-
Hrm, the player puts things in slots(3 x 3 in the bench) and puts it in the slot results in a single object. In the menu, the player clicks "save" and the recipe is saved in my data file, which is stored in the world. Then if the player opens the menu "library", he can choose the item you created earlier, click "to" and then the mod takes the stack and puts to him all that was stated previously and adds to the world the recipe for this item.
-
Yes, it's not my mod. I need it because I already have the object, which is registered once and I do a lot of different, to change NBT data, tooltips, etc. Now I am faced with the problem of recipes for these items and the substitution of the textures, depending on NBT data. The substitution of the textures and icons should occur for the specific item with a specific nbt data, with recipes as well. I will be glad if you can help me in this matter.
-
I need a realization, but it's bad or good without a difference.
-
I say that I want not only to 1.12. I want to see the implementation in early versions, 1.12 accidentally ordered, I'm sorry.
-
So, look mod Customs npc, he have function for adding recipes in game.
-
I have my item, which changes during the game, I need to change the recipe for this item from my list.
-
Hmm, but if I use 1.11 addRecipe? Especially in 1.12 no json recipes melting and boiling foul potions.
-
Hello, Can I add recipes right during the game?
-
Nice! It's works! Thank you!
-
s
-
privatecode
-
-
Hello, how to cancel closing the gui when typing in the textfield? I have a GuiContainer and textfield(custom), when you click in the text box, the buttons "E" the gui closes, how to undo it?
-
And even if NBT will indicate a new path to textures?
-
Hello, do the thing which you can change in the game(creates a new stack and change certain data). I want to do to you during the game to replace the path to textures/models without rejoining the game. Earlier in 1.7 this can be done using the IItemRenderer, but now I don't see a solution. Code 1.7 - icon: @SideOnly(Side.CLIENT) public final class IconRenderer implements IItemRenderer { public static final IconRenderer INSTANCE = new IconRenderer(); @Override public boolean handleRenderType(final ItemStack item, final ItemRenderType type) { return type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON; } @Override public boolean shouldUseRenderHelper(final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper) { return false; } @Override public void renderItem(final ItemRenderType type, final ItemStack stack, final Object... data) { GL11.glPushMatrix(); final Tessellator tess = Tessellator.instance; final EntityLivingBase entityliving = (EntityLivingBase) data[1]; final IIcon icon = entityliving.getItemIcon(stack, 0); final float tickness = 0.0625F; ItemRenderer.renderItemIn2D(tess, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), tickness); GL11.glPopMatrix(); } } How is this done?
-
Solved. Code: private static ItemStack stack; public SPacketUpdateNBT(){} public SPacketUpdateNBT(ItemStack stack) { this.stack = stack; } @Override public void handleClientSide(EntityPlayer player) { } @Override public void handleServerSide(EntityPlayerMP player) { try { ItemStack itemstack = this.stack; if (itemstack.isEmpty()) return; if (!ItemWritableBook.isNBTValid(itemstack.getTagCompound())) { FMLLog.log.error("Invalid book tag!"); } ItemStack itemstack1 = player.getHeldItemMainhand(); if (itemstack1.isEmpty()) return; if (itemstack.getItem() == ModItems.python_book && itemstack.getItem() == itemstack1.getItem()) { itemstack1.setTagInfo("pages", itemstack.getTagCompound().getTagList("pages", 8)); } } catch (Exception exception6) { exception6.printStackTrace(); } } @Override public void fromBytes(ByteBuf byteBuf) { this.stack = ByteBufUtils.readItemStack(byteBuf); } @Override public void toBytes(ByteBuf byteBuf) { ByteBufUtils.writeItemStack(byteBuf, this.stack); }
-
Forge uses packets netty, these packages are very laggs. You can wrap an ordinary batch system in Minecraft will be much better. And forge, why not wrapped model(obj) to display list? About the vanilla package, it's bad, you can do much better.
-
In principle it is possible, but there is one thing. In Minecraft pack CPacketCustomPayload spike, and at the moment I'm looking for a solution that is better. Speaking of bags, did you know that in forge batch system is bad?
-
I use in my GuiBook this code: PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer()); packetbuffer.writeItemStack(this.bookObj); this.mc.getConnection().sendPacket(new CPacketCustomPayload("MC|BEdit", packetbuffer)); But it also didn't work although this code is in vanilla gui book. What could be the problem?
-
Hello, i send packet to server(update nbt for ItemBook) and server not update nbt. What's the problem? public final class SPacketUpdateNBT extends AbstractPacket<SPacketUpdateNBT> { private static NBTTagCompound tagCompound; private static ItemStack stack; public SPacketUpdateNBT(){} public SPacketUpdateNBT(NBTTagCompound tagCompound, ItemStack stack) { this.tagCompound = tagCompound; this.stack = stack; } @Override public void handleClientSide(EntityPlayer player) { } @Override public void handleServerSide(EntityPlayer player) { this.stack.setTagCompound(this.tagCompound); } @Override public void fromBytes(ByteBuf byteBuf) { this.tagCompound = ByteBufUtils.readTag(byteBuf); this.stack = ByteBufUtils.readItemStack(byteBuf); } @Override public void toBytes(ByteBuf byteBuf) { ByteBufUtils.writeTag(byteBuf, this.tagCompound); ByteBufUtils.writeItemStack(byteBuf, this.stack); } } In GuiBook: @Override protected void actionPerformed(GuiButton button) throws IOException { boolean updateLines = false; if (button.enabled) { switch (button.id) { case BUTTON_DONE_ID: this.sendBookToServer(); this.mc.displayGuiScreen(null); break; and private void sendBookToServer() throws IOException { if (this.bookIsModified && this.bookPages != null) { while (this.bookPages.tagCount() > 1) { String s = this.bookPages.getStringTagAt(this.bookPages.tagCount() - 1); if (!s.isEmpty()) { break; } this.bookPages.removeTag(this.bookPages.tagCount() - 1); } if (this.bookObj.hasTagCompound()) { NBTTagCompound nbttagcompound = this.bookObj.getTagCompound(); nbttagcompound.setTag("pages", this.bookPages); } else { this.bookObj.setTagInfo("pages", this.bookPages); } String title = this.bookTitle; if (title.equals(TITLE_PLACEHOLDER)) title = ""; this.bookObj.setTagInfo("title", new NBTTagString(title)); //PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer()); //packetbuffer.writeItemStack(this.bookObj); //this.mc.getConnection().sendPacket(new CPacketCustomPayload("MC|BEdit", packetbuffer)); NetworkHandler.NETWORK.sendToServer(new SPacketUpdateNBT(this.bookObj.getTagCompound(), this.bookObj)); } }
-
Hello, i create a custom book (copypast of GuiScreenBook) and i send packet to server, but packet sends after open/close GuiInventory or GuiContainerCreative, not when I'm closing my book. GuiCustomBook. How to fix it? private void sendBookToServer() throws IOException { if (this.bookIsModified && this.bookPages != null) { while (this.bookPages.tagCount() > 1) { String s = this.bookPages.getStringTagAt(this.bookPages.tagCount() - 1); if (!s.isEmpty()) { break; } this.bookPages.removeTag(this.bookPages.tagCount() - 1); } if (this.bookObj.hasTagCompound()) { NBTTagCompound nbttagcompound = this.bookObj.getTagCompound(); nbttagcompound.setTag("pages", this.bookPages); } else { this.bookObj.setTagInfo("pages", this.bookPages); } String title = this.bookTitle; if (title.equals(TITLE_PLACEHOLDER)) title = ""; this.bookObj.setTagInfo("title", new NBTTagString(title)); PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer()); packetbuffer.writeItemStack(this.bookObj); this.mc.getConnection().sendPacket(new CPacketCustomPayload("MC|BEdit", packetbuffer)); } } @Override protected void actionPerformed(GuiButton button) throws IOException { boolean updateLines = false; if (button.enabled) { switch (button.id) { case BUTTON_DONE_ID: this.mc.displayGuiScreen(null); this.sendBookToServer(); break; } } }
-
[1.12] Double action if clicked right mouse button
WildHeart replied to WildHeart's topic in Modder Support
if (!this.world.isRemote) is fixed... -
Hello, i have a problem. If i click to entity right mouse button, the action is performed two times instead of one. How to fix it? P.s. This problem occurs only when there is no object in the hand, if the same object in hand then there is no such problem.