3
0
Mirror von https://github.com/Moulberry/AxiomPaperPlugin.git synchronisiert 2024-11-12 19:20:11 +01:00

Copy custom block entity tag when doing custom placement

Dieser Commit ist enthalten in:
Moulberry 2024-01-07 06:05:56 +08:00
Ursprung bb57b07323
Commit 53ee4ee813
2 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -8,7 +8,7 @@ plugins {
}
group = "com.moulberry.axiom"
version = "1.5.6"
version = "1.5.7"
description = "Serverside component for Axiom on Paper"
java {

Datei anzeigen

@ -16,7 +16,9 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.ai.village.poi.PoiType;
import net.minecraft.world.entity.ai.village.poi.PoiTypes;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
@ -115,6 +117,8 @@ public class SetBlockPacketListener implements PluginMessageListener {
CraftWorld world = player.level().getWorld();
BlockPlaceContext blockPlaceContext = new BlockPlaceContext(player, hand, player.getItemInHand(hand), blockHit);
// Update blocks
if (updateNeighbors) {
int count = 0;
@ -252,6 +256,10 @@ public class SetBlockPacketListener implements PluginMessageListener {
}
}
if (!breaking) {
BlockItem.updateCustomBlockEntityTag(player.level(), player, blockPlaceContext.getClickedPos(), player.getItemInHand(hand));
}
if (sequenceId >= 0) {
player.connection.ackBlockChangesUpTo(sequenceId);
}