-
Posts
12 -
Joined
-
Last visited
Everything posted by NoEffort
-
[1.16.5] [SOLVED] Block NBT being modified every other tick
NoEffort replied to NoEffort's topic in Modder Support
Noted and resolved. -
[1.16.5] [SOLVED] Block NBT being modified every other tick
NoEffort replied to NoEffort's topic in Modder Support
Thanks for all the help guys, praise be the internet! If you're curious, I created a new message & registered it. Here's the handler for said message: public static void handle(WeatherPedestalUpdateMessage message, Supplier<NetworkEvent.Context> context) { NetworkEvent.Context ctx = context.get(); ctx.enqueueWork(() -> { ServerPlayerEntity player = ctx.getSender(); TileEntity tile = player.level.getBlockEntity(message.pos); if(tile == null || !player.level.isLoaded(message.pos) || !(tile instanceof WeatherPedestalTileEntity)) return; WeatherPedestalTileEntity pedestal = (WeatherPedestalTileEntity) tile; pedestal.setRaining(message.rain); pedestal.setThundering(message.thunder); pedestal.setClear(message.clear); player.level.sendBlockUpdated(message.pos, pedestal.getBlockState(), pedestal.getBlockState(), Constants.BlockFlags.BLOCK_UPDATE); }); ctx.setPacketHandled(true); } I also removed half of my update() method in WeatherPedestalScreen, and replaced it with this single line: NuggetMod.CHANNEL.sendToServer(new WeatherPedestalUpdateMessage(this.pos, rain, thunder, clear)); -
[1.16.5] [SOLVED] Block NBT being modified every other tick
NoEffort replied to NoEffort's topic in Modder Support
How can I resolve this? Network messages? Maybe my design is wrong and I should be using another method? EDIT: Method, as in plan of attack not functional Java method -
[1.16.5] [SOLVED] Block NBT being modified every other tick
NoEffort replied to NoEffort's topic in Modder Support
I do a combination of these to achieve the same result (on paper, I suppose). WeatherPedestalTileEntity.java (Snippet): -
[1.16.5] [SOLVED] Block NBT being modified every other tick
NoEffort replied to NoEffort's topic in Modder Support
@Draco18s You got it boss: https://github.com/NoEffort/NuggetMod/tree/main -
[1.16.5] [SOLVED] Block NBT being modified every other tick
NoEffort replied to NoEffort's topic in Modder Support
So what you're saying is my Client is correct, but the server is not? The docs lead me to believe I've done everything I should be doing, but it seems like that isn't the case. How can I go about syncing the data correctly? -
Long time no see, I've got this block that I want to update on a button press in it's respective screen. The block data does technically update, but it seems to switch back to it's default values every other tick (or at least, that's what it seems like visibly). Have a look: Related Code: https://gist.github.com/NoEffort/5cd66d7d5c8165338b9ae89c6036f3c3 The Bug:
-
Because it worked in theory. Also, the game did crash when setting a breakpoint on this method. [ALSO] This method did not need to be changed in the end. Keen eye, much obliged! I did not mean to call isDouble() with !
-
Half-Slabs that I've created move their positions from being half_slab_bottom to half_slab_top and I don't know why. *Note: There are no error messages in console when booting the game, placing the slabs, or opening the world. GitHub: https://github.com/NoEffort/Basic Video: https://www.youtube.com/watch?v=wh3eUJmlx-w All help is appreciated!