Jump to content

AlexInCube

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by AlexInCube

  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.
  16. I know there's an event through which you can get a container
  17. I have to do it through the event?
  18. I don't know what kind of code there must be in the package to get something out of windowid.
  19. I send windowId into a package. But how do I interact with it?
  20. I put the mod on github, I'm trying to make it possible to change the redstone mode in block breaker through gui. https://github.com/AlexInCube/All-you-need
  21. Yes, if i print message in packet it work.
  22. nobody did that at 1.15?
  23. I want the GUI to change the control of the redstone signal when you press a button. But packet don't change the variable in TileEntity. P.S. NBT dont saved too. GUI Code: Packet Code: TileEntity Code:
  24. I went through the playsound and stopsound commands, found SPlaySoundPacket and SStopSoundPacket there. I tried to use them new SPlaySoundPacket(new ResourceLocation("block.portal.trigger"), SoundCategory.BLOCKS,playerIn.getPositionVec(),1,1); new SStopSoundPacket(new ResourceLocation("block.portal.ambient"),SoundCategory.BLOCKS); but it didn't work.
  25. so I have to put my sounds in an array and check it out?
×
×
  • Create New...

Important Information

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