make sign set displayname of claimer
Some checks failed
/ Auto-Build-App (push) Has been cancelled

This commit is contained in:
pietru 2025-05-10 21:53:52 +02:00
parent db75fd5626
commit 53db2009fc
2 changed files with 5 additions and 2 deletions

View file

@ -28,6 +28,8 @@ public class BlockEntitySignMixin {
@Shadow
private String[] texts = new String[]{"", "", "", "", ""};
@Shadow
public boolean textureDirty = true;
@Inject(method = "onInteract", at = @At("HEAD"), cancellable = true)
private void event_onInteract(CallbackInfo ci, @Local Player player, @Local Zone zone){
@ -86,6 +88,9 @@ public class BlockEntitySignMixin {
MessagePacket packet = new MessagePacket("[Server] Successfully claimed area of size "+size+" (size*2+1)");
packet.setupAndSend(ServerSingletons.getConnection(player));
texts[2] = player.getAccount().getDisplayName();
textureDirty = true;
} else {
MessagePacket packet = new MessagePacket("[Server] Area of size "+size+" intersects another protected area...");
packet.setupAndSend(ServerSingletons.getConnection(player));

View file

@ -6,9 +6,7 @@ import finalforeach.cosmicreach.blocks.BlockPosition;
import finalforeach.cosmicreach.blocks.BlockState;
import finalforeach.cosmicreach.blocks.BlockStateMissing;
import finalforeach.cosmicreach.entities.player.Player;
import finalforeach.cosmicreach.items.ItemMergeStrategy;
import finalforeach.cosmicreach.items.ItemSlot;
import finalforeach.cosmicreach.items.ItemStack;
import finalforeach.cosmicreach.networking.NetworkIdentity;
import finalforeach.cosmicreach.networking.packets.MessagePacket;
import finalforeach.cosmicreach.networking.packets.blocks.PlaceBlockPacket;