Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. 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; } }
  2. Step 1: Knowing what you want to do. Step 2: Finding similar behavior and looking at its source. Step 3: Learning shit.
  3. 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.
  4. 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
  5. 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).
  6. 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.
  7. 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.
  8. 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).
  9. Or take so long that the player is no longer on the server at all.
  10. use all lower case letters in both your code and your file and folder names.
  11. 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); }
  12. 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.
  13. Beep beep boop boop. Errorͤͬͬͦͬ parsing post.ͬͦͬͬͤ̄ͤͩͦͨ̄ͦͨͣͬͩ
  14. Oh I see, the if statements are commented, didn't notice that.
  15. 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.
×
×
  • Create New...

Important Information

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