
AlexInCube
Members-
Posts
26 -
Joined
-
Last visited
Everything posted by AlexInCube
-
but how do I fix it?
-
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; }
-
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); }
-
@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.
-
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?
-
I am render TileEntity. Everything you wrote, it takes the model from the block, not directly from JSON.
-
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?
-
[1.15.1] DeferredRegister vs RegistryEvent
AlexInCube replied to DragonITA's topic in Modder Support
@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? -
I put the variables in IIntArray and it works fine.
-
in general, I'm trying to look at the vanilla class to avoid mistakes.
-
I can't do well right away, I'm just learning how to make mods for minecraft.
-
I want to make it work somehow first, and then think about safety. Sending packages this way:
-
what did I do wrong?
-
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?
-
Okay, forget it, I just don't know what code to get the container in the packet.
-
I know there's an event through which you can get a container
-
I have to do it through the event?
-
I don't know what kind of code there must be in the package to get something out of windowid.
-
I send windowId into a package. But how do I interact with it?
-
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
-
Yes, if i print message in packet it work.
-
nobody did that at 1.15?
-
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:
-
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.
-
so I have to put my sounds in an array and check it out?