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. Make the block's bounding box bigger.
  2. I love it when I can search the forums and find exactly what I need. public class TickHandler implements ITickHandler { @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { if(type.equals(EnumSet.of(TickType.SERVER))) { onServerTick(MinecraftServer.getServer()); } } public void onServerTick(MinecraftServer server) { System.out.println("Tick"); } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.WORLD, TickType.SERVER, TickType.PLAYER); } @Override public String getLabel() { return null; } }
  3. Yes. It's called a tick handler.
  4. Step 1: Knowing what you want to do. Step 2: Finding similar behavior and looking at its source. Step 3: Learning shit.
  5. Just use packet 250 in the way packet 250 was meant to be used. When your packet handler receives it, extract the data (the sign text), and apply it to YOUR block. The reason packet 130 doesn't work is because it doesn't find a sign at the position your block is at, so it fails to do anything.
  6. Oh deary me. It seems I forgot the exact classname and you're too inflexible to look at the list of available packet classes and find number 250. Well here you go. I looked it up. Packet250CustomPayload
  7. Do not mess with the item IDs, just don't. You don't need to. You will never encounter problems unless you're doing bad practice. Whereas if you do subtract the 256 back out, you will have problems with compatibility with other mods (because they won't subtract 256 and thus their config will look like it has a different ID than your mod to the player, but! it will conflict anyway).
  8. Try Packet250CustomData
  9. Pretty much. You can't just arbitrarily create a new class and expect it to get inserted into the class hierarchy where you want it without doing REALLY complex stuff, like reflections.
  10. private static int potionID; Go learn Java. This line is your problem and it's really easy to fix and if you knew anything about any object oriented language you'd know what the problem is.
  11. No. Most I ever did was a TileEntity that changed texture when it dealt damage to someone, but I made it a client-sided only effect (if you saved and quit, then reloaded, the default texture was back) as it was purely cosmetic. If left alone for long enough it would revert anyway (it was blood splatter, so after 5 minutes it would change back to normal).
  12. Or take so long that the player is no longer on the server at all.
  13. use all lower case letters in both your code and your file and folder names.
  14. Yes. As for NBTs, this is a segment of working code: try { //I'm saving data to the world's save directory, inside a custom subfolder. You can also get/save NBTs //To other locations as well. Someone I know is reading (not writing) a file out of their mod's zip File rendersFolder = new File(DimensionManager.getCurrentSaveRootDirectory(), "LinkRenders"); rendersFolder.mkdir(); try { FileInputStream fis = new FileInputStream(new File(rendersFolder, s)); DataInputStream instream = new DataInputStream(fis); nbt = CompressedStreamTools.read(instream); instream.close(); fis.close(); } catch (FileNotFoundException e) { nbt = new NBTTagCompound("tag"); } NBTTagCompound yawtag = new NBTTagCompound("tag"); yawtag.setIntArray("imagedata", allData); nbt.setIntArray("imagedata", allData); int y = (int)Math.round(yaw / 22.5); nbt.setTag("yaw"+y, yawtag); nbt.setLong("date",world.getWorldInfo().getWorldTotalTime()); CompressedStreamTools.write(nbt, new File(rendersFolder, s)); } catch (IOException e) { System.out.println("Failed to write nbt " + s); }
  15. That's because you're using get, not set. Example (with integer arrays): int[] white = config.get("WorldGen","dimensionWhitelistList", new int[] {0}).getIntList(); //I sort the list here config.get("WorldGen","dimensionWhitelistList", new int[] {0}).set(whitestring); You can also save NBTs on the client side, if you'd like.
  16. Beep beep boop boop. Errorͤͬͬͦͬ parsing post.ͬͦͬͬͤ̄ͤͩͦͨ̄ͦͨͣͬͩ
  17. Oh I see, the if statements are commented, didn't notice that.
  18. Easy. Store the skin it should have in the NBT. Ask the mob what it's skin is during rendering. It should reply based on what's stored in its NBT.
  19. His code is doing that, actually.

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.