Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. No, no you cannot. For two reasons. 1) @SideOnly(Side.CLIENT) 2) Returns horizon height for use in rendering the sky. As in, where the sun gets clipped: return this == FLAT ? 0.0D : 63.0D;
  2. And now you know why we use trace statements. They tell you what the program is doing as it does it, and lets you locate the problem area of code rather than BLINDLY GUESSING.
  3. Ok, now make your code look like this: System.out.println("Right clicked with: " + hand.getItem() + ":" + hand.getItemDamage()); System.out.println(hand.getItem() == Item.getItemFromBlock(Blocks.log)); System.out.println(hand.getItemDamage() == 0); System.out.println((hand.getItem() == Item.getItemFromBlock(Blocks.log) && hand.getItemDamage() == 0)); if(hand.getItem() == Item.getItemFromBlock(Blocks.log) && hand.getItemDamage() == 0) { System.out.println("Right clicked with the right block!");//this is the only new line And give me the output again.
  4. Just above that if statement, put this: System.out.println("Right clicked with: " + hand.getItem() + ":" + hand.getItemDamage()); System.out.println(hand.getItem() == Item.getItemFromBlock(Blocks.log)); System.out.println(hand.getItemDamage() == 0); System.out.println((hand.getItem() == Item.getItemFromBlock(Blocks.log) && hand.getItemDamage() == 0)); Then tell me what it prints out when you use various blocks.
  5. Ah, yeah, that'd do it. Also, try to use the [code ] tag.
  6. Ah, you're right, I missed that. Also, the pos = pos.add(0, 255, 0); might not be what you want. Don't you want to set the Y value to 255 not add 255? Though, is getBlockState the right function to use here? Pretty sure that's equivalent to getBlockMetadata , although not having actually played with 1.8 I'm admittedly guessing.
  7. world.getBlockState(pos) <-- and where is j? You're looking at the same block every single time.
  8. Potions are mo***fu*** weird. Those "weird strings" are basically a serialized way of doing bitwise math. Add, subtract, AND, NOT, XOR, etc. This is because every single potion in vanilla is a single item with 140 different damage values: Basically, each potion ingredient makes a change to the bits, only works if certain bits are active (for example, you can't make a splash potion out of a bottle of water even though if you give yourself a potion with those flags you will get a splash potion that doesn't exist) etc. etc. The one time I dug into the code I was duplicating it for my own purposes and even then it was tricky to work with and ended up redefining how the string options even worked because I couldn't get the original to do what I wanted/needed.
  9. So I removed all of my int clip = itemStack.stackTagCompound.getInteger("clip"); and replaced it with just the itemStack.stackTagCompound line, but I get the same result. No, not that. Those are local variables. He means this chunk and anything that references these: Item ammoType; String name; double reloadTime; double shotTime; int clipSize; float damage; float baseDamage; String fireSound; String reloadSound; int durability; int currentShotTime = 0; int currentReloadTime = 0;
  10. I know that. I don't have a certain block I'm trying to check for though. I'm trying to check for all blocks that interact only so I can spawn my entity if it doesn't interact. So you want any item when right clicked on any block to spawn something? Jesus christ, talk about a terrible idea...
  11. "JAR files are fundamental archive files, built on the ZIP file format and have the .jar file extension."
  12. Or you could fix your RIGHT_CLICK_BLOCK section of code to actually check for your block. More than one block returns false when right clicked and more than one returns true...
  13. Well. Did you call setTextureName ? What'd you pass?
  14. Change "modmercenario:/items/materiales/aceromercenario" to "modmercenario:materiales/aceromercenario"
  15. No error included in post. Cannot help. If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. Now go and learn Java. That is an order.
  16. Have you tried creating a new IChatComponent?
  17. That function returns void.
  18. You need to add the metadata check, duh.
  19. If you're looking at a GUI, you may need to call: if (worldObj != null) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); So that the server detects and sends changes to the client.
  20. drawTexturedModalRect(guiLeft + 47, guiTop + 19, 176, 16, k + 1, 16); Lets see. So you're drawing it at an X and Y position (good, that works correctly) with a particular UV (good that works), with a width of K+1 (seems fine) and a height of 16. Uh, it looks like your height is wrong.
  21. All of the functions you're not declaring as overrides automatically default to the version in the superclass. Ergo, you do have supers, they're just not written down.
  22. SMP / SSP have no differences in packets. As long as you do this: @Override public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); writeToNBT(nbtTag); return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbtTag); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); } Your TEs will update properly.
  23. Ahhh. I wondered if it had gone TE.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.