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.

AlexInCube

Members
  • Joined

  • Last visited

  1. but how do I fix it?
  2. but the animation in the renderer is kind of jerky. matrixStackIn.rotate(Vector3f.YP.rotationDegrees(angle+partialTicks*2)); there's gotta be a smooth rotation, and it feels like the animation has 20 fps. public void updateAnimation() { this.angle += 2; if (this.angle > 358) { this.angle = 0; } spawnWaterParticles(this.world, pos, 0, this.angle); } public int getAngle(){ return this.angle; }
  3. I understand it, I thought it only synchronized what's in the read and write. @Nullable @Override public SUpdateTileEntityPacket getUpdatePacket() { CompoundNBT tag = new CompoundNBT(); tag.putInt(ANGLE_TAG,this.angle); return new SUpdateTileEntityPacket(this.pos,0,tag); } @Override public CompoundNBT getUpdateTag() { return write(new CompoundNBT()); } @Override public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { super.onDataPacket(net, pkt); BlockState state = this.world.getBlockState(this.pos); this.angle = pkt.getNbtCompound().getInt(ANGLE_TAG); this.world.notifyBlockUpdate(this.pos, state, state, 3); }
  4. @Nullable @Override public SUpdateTileEntityPacket getUpdatePacket() { CompoundNBT tag = new CompoundNBT(); write(tag); return new SUpdateTileEntityPacket(this.pos,0,tag); } @Override public CompoundNBT getUpdateTag() { return write(new CompoundNBT()); } @Override public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { super.onDataPacket(net, pkt); readFromNBT(pkt.getNbtCompound()); BlockState state = this.world.getBlockState(this.pos); this.world.notifyBlockUpdate(this.pos, state, state, 3); } I used it, but nothing worked.
  5. I need to synchronize the angle in TE, the angle changes to the server, but not in the client. I don't need to save it in NBT. I used packets to send data from GUI to TE. But I need TE to send the packet to the TE client, how do I do that?
  6. I am render TileEntity. Everything you wrote, it takes the model from the block, not directly from JSON.
  7. I want to get the model out of the json file and render it, I could do a single block for each part of the model, but that's not comfortable. private ModelResourceLocation modellocation = new ModelResourceLocation("allyouneed:splinklertop","inventory"); private IBakedModel model = Minecraft.getInstance().getModelManager().getModel(modellocation).getBakedModel(); I kind of figured out how to get it, but how to render it?
  8. @Cadiboo// You can do extra filtering here if you don't want some blocks to have an BlockItem automatically registered for them // .filter(block -> needsItemBlock(block)) that was in your ExampleMod in ModEventSubscriber class. But I don't know how to use it. How do I add a block so that it's not in the creative tab?
  9. I put the variables in IIntArray and it works fine.
  10. in general, I'm trying to look at the vanilla class to avoid mistakes.
  11. I can't do well right away, I'm just learning how to make mods for minecraft.
  12. I want to make it work somehow first, and then think about safety. Sending packages this way:
  13. what did I do wrong?
  14. I didn't notice in the sender right away that you could get a container. if (windowId == ctx.get().getSender().openContainer.windowId){ } I'm checking to see if I'm comparing the windowid and then what? Do I have to update the variable in Container from TE all the time or try to change the variable in TE and Container at once?
  15. Okay, forget it, I just don't know what code to get the container in the packet.

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.