Merge remote-tracking branch 'origin/1.20.4' into 1.20.4

This commit is contained in:
Flanks255 2024-03-13 16:56:41 -05:00
commit da7de46cdc
3 changed files with 15 additions and 8 deletions

View file

@ -37,6 +37,14 @@ runs {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'neoforge.enabledGameTestNamespaces', "actuallyadditions"
}
client2 {
configure ("client")
programArguments.addAll '--username', 'Dev2'
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'neoforge.enabledGameTestNamespaces', "actuallyadditions"
}
server {
systemProperty 'neoforge.enabledGameTestNamespaces', "actuallyadditions"

View file

@ -44,18 +44,18 @@ public class ItemPlayerProbe extends ItemBase {
public void inventoryTick(ItemStack stack, Level world, Entity entity, int itemSlot, boolean isSelected) {
if (!world.isClientSide) {
CompoundTag compound = stack.getOrCreateTag();
if (compound.contains("UUIDMost")) {
if (compound.contains("UUID")) {
UUID id = compound.getUUID("UUID");
Player player = world.getPlayerByUUID(id);
if (player != null) {
if (player.isShiftKeyDown()) {
ItemPhantomConnector.clearStorage(stack, "UUIDLeast", "UUIDMost", "Name");
ItemPhantomConnector.clearStorage(stack, "UUID", "Name");
((Player) entity).displayClientMessage(Component.translatable("tooltip." + ActuallyAdditions.MODID + ".playerProbe.disconnect.1"), false);
player.displayClientMessage(Component.translatable("tooltip." + ActuallyAdditions.MODID + ".playerProbe.notice"), false);
//TheAchievements.GET_UNPROBED.get(player);
}
} else {
ItemPhantomConnector.clearStorage(stack, "UUIDLeast", "UUIDMost", "Name");
ItemPhantomConnector.clearStorage(stack, "UUID", "Name");
((Player) entity).displayClientMessage(Component.translatable("tooltip." + ActuallyAdditions.MODID + ".playerProbe.disconnect.2"), false);
}
}
@ -71,17 +71,16 @@ public class ItemPlayerProbe extends ItemBase {
ItemStack stack = player.getItemInHand(context.getHand());
BlockEntity tile = context.getLevel().getBlockEntity(context.getClickedPos());
if (tile instanceof TileEntityPlayerInterface) {
if (tile instanceof TileEntityPlayerInterface face) {
CompoundTag compound = stack.getOrCreateTag();
if (compound.contains("UUIDMost")) {
if (compound.contains("UUID")) {
if (!context.getLevel().isClientSide) {
TileEntityPlayerInterface face = (TileEntityPlayerInterface) tile;
face.connectedPlayer = compound.getUUID("UUID");
face.playerName = compound.getString("Name");
face.setChanged();
face.sendUpdate();
ItemPhantomConnector.clearStorage(stack, "UUIDLeast", "UUIDMost", "Name");
ItemPhantomConnector.clearStorage(stack, "UUID", "Name");
}
return InteractionResult.SUCCESS;
}

View file

@ -131,7 +131,7 @@ public class TileEntityPlayerInterface extends TileEntityBase implements IEnergy
super.readSyncableNBT(compound, type);
this.storage.readFromNBT(compound);
if (compound.contains("PlayerLeast") && type != NBTType.SAVE_BLOCK) {
if (compound.contains("Player") && type != NBTType.SAVE_BLOCK) {
this.connectedPlayer = compound.getUUID("Player");
this.playerName = compound.getString("PlayerName");
}