Skip 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. It depends on what he's doing. If you're doing something "right now because you're looking at this block" then no. If you're doing something like "get me a list of all the valid locations matching X criteria" and picking one (or more) at random/via sorting algorithm, etc. then yeah, you should use a custom class.
  2. Registering the entity doesn't magically make the ItemFishingRod class spawn it when used. And that bit you don't know? It's either strings or ints, which are largely irrelevant. Meaning you can put fuckanything in and it'll work. But it still doesn't magically make the Fishing rod use the new lure.
  3. Add: @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()); }
  4. Where ever you bloody need it. Seriously. You want to know the block's metadata? Get it. Want to change it? Set it. The code snippet I posted is a chunk of code from my own project that is not useful to you except as a demonstration of how that function works.
  5. for(int ox = -1; ox <= 1 && inc; ox++) { for(int oz = -1; oz <= 1 && inc; oz++) { b = world.getBlock(x+ox, y, z+oz); if(b == Blocks.snow_layer || b == this) { mm = world.getBlockMetadata(x+ox, y, z+oz); if(mm < myMetadata) { inc = false; world.setBlockMetadataWithNotify(x+ox, y, z+oz, mm+1, 3); } }
  6. I don't know what the problem is, but: Replace this: Item.ToolMaterial.STONECRUSHER With this: STONECRUSHER
  7. You should save the coordinates found too. Use a custom class that stores both the block and its position, and keep a list of those.
  8. In that case: GL11.gl_rotatef([angle in degrees], 0, 1, 0); Angle is going to be some amount of 90 degree increments, pull from block metadata and multiply.
  9. Technically you aren't rotating the block. You're just displaying the "front" icon on a different side. It's all in the getIcon function (look at the Furnace or the Dispenser).
  10. Seriously dude? That class is everything you need, just copy that ONE class. That class imports Jack and All from the OpenMods library. JACK AND ALL.
  11. setupDecompWorkspace not setupDevWorkspace, the README is a lying bitch. Then quit and relaunch your IDE
  12. import and examinie EnumHelper
  13. Almost none of the parameter names are converted to human-readable and left in SRG format. It bugs me, but I can deal most of the time.
  14. getIcon != getIIcon
  15. Package, class, constant, methods. Yep. (packages are all lower case. Classes are camel case with a capitalized first letter, constants are ALL CAPS, methods, fields, and other variables are camel case with lower case first letter). Because your method signature is wrong. It's not overriding any function in the super class. Look closely.
  16. Oh yeah. I was doing it for my seed for a while until I wanted to add an Information (tooltip) line. Vanilla does a ton of items: itemRegistry.addObject(289, "gunpowder", (new itemRegistry.addObject(288, "feather", (new Item()).setUnlocalizedName("feather").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("feather")); Feathers has no special behaviors, no tooltip, nothing. It just needs an icon, a name, and a creative tab. Sticks, ingots, gunpowder, wheat, bowls, diamonds, flint, leather, brick, clay, bone, glowstone dust, sugar...they all do this.
  17. Or rather, it's common practice and considered good technique, but the compiler doesn't give a shit.
  18. This is why you use @Override If you had @Override on your getIIcon function you would know what the problem is.
  19. You need to set the block#blockIcon to not-null. You might not be using it for the TESR, but the breaking thing does use it.
  20. You'd have to fake it. Keep a stack at the maximum allowed as the "display" stack, then keep an internal counter storing the true value.
  21. Holy shit balls what the fuck. Is your main mod file seriously the common proxy? No, bad code monkey, no banana.
  22. It's like registering a block. Except instead of a block, its a TE.
  23. You want two things: 1) @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()); } 2) Whenever the inventory changes if (worldObj != null) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
  24. You can get it from the ItemStack, yes.
  25. First one: GameRegistry.registerTileEntity

Important Information

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

Account

Navigation

Search

Search

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.