
Kwibble
Forge Modder-
Posts
340 -
Joined
-
Last visited
Everything posted by Kwibble
-
@Jabelar, you would be create. But if you are actually wanting to validate the credentials... I am not sure how you do that.
-
And your still doing it wrong... Try this: @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if (itemStack != null && itemStack.getItem() == CommonProxy.applePickingGlove){ if (itemStack.getItemDamage() >= itemStack.getMaxDamage()){ } } return itemStack; }
-
See that parameter passed in called itemStack? Use that. That is the ItemStack of your item.
-
[1.7.2]Doing things when a player kills an entity?
Kwibble replied to dude22072's topic in Modder Support
Big difference. If the event is in cpw's packages, use what you are using. If it is from Minecraft forge packages, use what I said. -
[1.7.2]Doing things when a player kills an entity?
Kwibble replied to dude22072's topic in Modder Support
Have you registered the event? MinecraftForge.EVENT_BUS.register(new YourClass()); -
Since when was there a method called setBlockTextureNam()?? If I'm just old fashioned forge, then ignore this. But I ha have the sneaking suspicion that it could be your problem...
-
The reason I asked was to see if I could make s generic GUI button pressed message and from there call the normal playerinfo (IExtendedEntityProperties) message. Now I guess I am going to have to make a new message for every GUI button press that does something special server wise?
-
Say I have a message that gets sent to the server: MessageServerRandomStuff I can send this message and handle it in: @Override public IMessage onMessage(MessageServerRequestGuiOpen message, MessageContext ctx) { return null; } What I am wanting to know is this: Can I send another message to the server as the returned message? Or does it have to be a client received message in the return? (And vice versa for server sending to client).
-
This is quite a simple error really... You are using a deobfuscated name which means it will only work in the dev environment... You will have to find the obfuscated name and use that (it would be best to use a boolean in your main mod class called isDevEnvironment equal to true for when your developing, then set to false when you are going to release the mod).
-
Oh wait. Why are your assets not in the resources folder? Try this path: \src\main\resources\assets\randomblocks\textures\blocks
-
Notice how your path is RandomBlocks, but its looking for a folder randomblocks. You MUST have your ModID and associated assets folder lowercase.
-
Good job and your welcome
-
Thanks so much diesieben07! For anyone who is wanting to know how to do it, here is what I used: @Override public IIcon getIconIndex(ItemStack par1ItemStack) { if (this.containsDendri) { GuiScreen currentScreen = ModuleDendri.proxy.getCurrentScreen(); if (currentScreen != null) { if (currentScreen instanceof GuiContainer) { Container container = ( (GuiContainer) currentScreen ).inventorySlots; for (int j = 0; j < container.inventorySlots.size(); ++j) { Slot slot = (Slot) container.inventorySlots.get(j); if (slot.getStack() != null) { if (slot.getStack() == par1ItemStack) { Minecraft mc = Minecraft.getMinecraft(); ScaledResolution sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); final int x = slot.xDisplayPosition - 1; final int y = slot.yDisplayPosition - 1; final int width = sr.getScaledWidth(); final int height = sr.getScaledHeight(); final int guiLeft = (width - 176) / 2; final int guiTop = (height - 166) / 2; final int mouseX = (Mouse.getX() * width / mc.displayWidth) - guiLeft + 9; final int mouseY = (height - Mouse.getY() * height / mc.displayHeight - 1) - guiTop - 15; if (mouseX >= ( x ) && mouseX <= ( x + 17 )) { if (mouseY >= ( y ) && mouseY <= ( y + 17 )) { return this.symbolIcons[getSymbolIndexForContainedDendri()]; } } } } } } } return this.icons[1]; } return this.icons[0]; }
-
What would you suggest is doing it? This is what they use: this.mc.mcProfiler.startSection("mouse"); if (this.mc.inGameHasFocus && flag) { this.mc.mouseHelper.mouseXYChange(); float f1 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; float f2 = f1 * f1 * f1 * 8.0F; float f3 = (float)this.mc.mouseHelper.deltaX * f2; float f4 = (float)this.mc.mouseHelper.deltaY * f2; byte b0 = 1; if (this.mc.gameSettings.invertMouse) { b0 = -1; } if (this.mc.gameSettings.smoothCamera) { this.smoothCamYaw += f3; this.smoothCamPitch += f4; float f5 = par1 - this.smoothCamPartialTicks; this.smoothCamPartialTicks = par1; f3 = this.smoothCamFilterX * f5; f4 = this.smoothCamFilterY * f5; this.mc.thePlayer.setAngles(f3, f4 * (float)b0); } else { this.mc.thePlayer.setAngles(f3, f4 * (float)b0); } } this.mc.mcProfiler.endSection();
-
>.> why... Well, did you register the event?
-
Use the event LivingAttackEvent. Then, check to see if event.entity an instance of the mob you want. If it is, add experience to the mob. Or add the XP to the player if that's what you are trying to do.
-
And if you want to keep it persistent over death, look into EntityPlayer.PERSISTANT_TAG (or something similar), EntityJoinWorldEvent and LivingDeathEvent.
-
Interesting bug that only affects me (everyone else on server is fine)
Kwibble replied to Zer0HD2's topic in Modder Support
I must ask, were the other people using your mod or was it just you? If that was the case... Hmm, I wonder why it was just you! If the others were using your mod... Hmm, post the code. -
I missed it before, but no wonder your contains call isn't working. Your checking to see if a list of entities (not classes) contains a class. What you want to do is get the iterators current value with entities.iterator().next(). Then you would check with if (entityInstance instanceof EntityGrunt) { // your code here }
-
That's not how iterator works. Please go learn how and then see if you can figure it out.
-
First, you would create a packet handler etc. and register it. Then, you would create a packet that takes an integer (ID of the gui you want to open) as its data. When the packet is received, open up the GUI via the gui ID you sent.
-
@TLHPoE You missed the OP's point. They were asking if you knew WHY the background was being rendered orange - they don't WANT to render it orange.
-
Thanks diesieben07 for the idea. However, I am having an annoying time trying to implement it! I have this: GuiScreen currentScreen = ModuleDendri.proxy.getCurrentScreen(); if (currentScreen != null) { if (currentScreen instanceof GuiContainer) { Container container = ( (GuiContainer) currentScreen ).inventorySlots; for (int j = 0; j < container.inventorySlots.size(); ++j) { Slot slot = (Slot) container.inventorySlots.get(j); if (slot.getStack() != null) { if (slot.getStack().getItem() == ItemDendri.mist_bottle) { int x = slot.xDisplayPosition - 1; int y = slot.yDisplayPosition - 1; int mouseX = Mouse.getX(); int mouseY = this.flippedMouseY(); if (mouseX >= ( x ) && mouseX <= ( x + 17 )) { if (mouseY >= ( y ) && mouseY <= ( y + 17 )) { return this.spriteIcons[getSpriteIndex(this.containedDendri)]; } } } } } } } And the slot coordinates are so wrong it's not funny. Here is an example of the coordinates: Slot X: 62 Slot Y: 111 Mouse X: 374 Mouse Y: 348 So what I need now is a way to move my slot coordinates to the right spot, or to have the mouse coordinates translated to the right spot. And I don't want to just go about and say Mouse.getX() - 200; or something like that. Unless of course that works when you resize the screen... (Which I highly doubt).