Skip to content

Commit

Permalink
Copy custom block entity tag when doing custom placement
Browse files Browse the repository at this point in the history
  • Loading branch information
Moulberry committed Jan 6, 2024
1 parent bb57b07 commit 53ee4ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
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;
Expand Down Expand Up @@ -115,6 +117,8 @@ public void onPluginMessageReceived(@NotNull String channel, @NotNull Player buk

CraftWorld world = player.level().getWorld();

BlockPlaceContext blockPlaceContext = new BlockPlaceContext(player, hand, player.getItemInHand(hand), blockHit);

// Update blocks
if (updateNeighbors) {
int count = 0;
Expand Down Expand Up @@ -252,6 +256,10 @@ public void onPluginMessageReceived(@NotNull String channel, @NotNull Player buk
}
}

if (!breaking) {
BlockItem.updateCustomBlockEntityTag(player.level(), player, blockPlaceContext.getClickedPos(), player.getItemInHand(hand));
}

if (sequenceId >= 0) {
player.connection.ackBlockChangesUpTo(sequenceId);
}
Expand Down

0 comments on commit 53ee4ee

Please sign in to comment.