• Recently Browsing

    No registered users viewing this page.

  • Posts

    • That is not a modding problem, it's a basic Java problem, please learn basic Java before modding. If you do know basic Java and are just a bit confused, look through DeferredRegister, everything you need is there.
    • I also get ticking memory exceptions from writeSpawnData when I load the world
    • onEntityWalk detects when an entity is on top of a block, if that is what you need.
    • I'm trying to use IEntityAdditionalSpawnData for my projectile but I'm not really sure how to use the packet methods.  I have a capped arrow entity with an IItemTier field that get's written to in writeSpawnData and that gets read from in readSpawnData, I can see from the console (debugging I did) that writeSpawnData is getting called, but readSpawnData isn't.  Here's what my overrides look like @Override public void writeSpawnData(PacketBuffer buffer) { Two.LOGGER.info("writing..."); buffer.setCharSequence(0, (CharSequence) this.tier.toString(), Charset.defaultCharset()); Two.LOGGER.info("wrote spawn data {}", this.tier.toString()); } @Override public void readSpawnData(PacketBuffer additionalData) { Two.LOGGER.info("reading..."); String t = additionalData.readCharSequence(0, Charset.defaultCharset()).toString(); Two.LOGGER.info("read spawn data {}", t); try { this.tier = ItemTier.valueOf(t); } catch(Exception exception) { try { this.tier = ItemTierTwo.valueOf(t); } catch(Exception exception2) { Two.LOGGER.warn(exception2); } } }   I don't know how to use the PacketBuffer, what would I do if I wanted to write a String to one?  I'm also getting these error messages [m[1;31m[11:11:04] [Render thread/ERROR] [ne.mi.fm.ne.si.IndexedMessageCodec/SIMPLENET]: Received invalid discriminator byte 71 on channel fml:play [m[33m[11:11:04] [Render thread/WARN] [minecraft/ClientPlayNetHandler]: Unknown custom packet identifier: fml:play I used to have this done with the datamanager, but I read in the documentation that some things can be done without it. (like the color property of a tipped arrow) (it also reset the itemtier value whenever the world was reopened)   at first i tried it with data, then i tried it without data and with nbts (with writeAdditional and readAdditional) then I tried it without data or nbts and with packet buffers (writeSpawnData and readSpawnData)   here are some of the files I'm using CappedArrowEntity.java CappedArrowRenderer.java CappedArrowItem.java latest.log
  • Topics

  • Who's Online (See full list)