Jump to content

AlexInCube

Members
  • Posts

    26
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

AlexInCube's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. 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; }
  2. 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); }
  3. @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.
  4. 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?
  5. I am render TileEntity. Everything you wrote, it takes the model from the block, not directly from JSON.
  6. 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?
  7. @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?
  8. I put the variables in IIntArray and it works fine.
  9. in general, I'm trying to look at the vanilla class to avoid mistakes.
  10. I can't do well right away, I'm just learning how to make mods for minecraft.
  11. I want to make it work somehow first, and then think about safety. Sending packages this way:
  12. 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?
  13. Okay, forget it, I just don't know what code to get the container in the packet.
×
×
  • Create New...

Important Information

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