use of net.minecraft.inventory.EnderChestInventory in project KahzerxMod by otakucraft.
the class SpoofExtension method spoofEC.
public int spoofEC(ServerCommandSource source, String playerE) throws CommandSyntaxException {
ServerPlayerEntity player = source.getPlayer();
ServerPlayerEntity player2 = source.getServer().getPlayerManager().getPlayer(playerE);
if (player2 != null) {
EnderChestInventory enderChestInventory = player2.getEnderChestInventory();
// Generar la pantalla de enderChest.
player.openHandledScreen(new SimpleNamedScreenHandlerFactory((i, playerInventory, playerEntity) -> GenericContainerScreenHandler.createGeneric9x3(i, playerInventory, enderChestInventory), new LiteralText(String.format("%s stop hax >:(", player.getName().getString()))));
} else {
source.sendFeedback(new LiteralText("player offline"), false);
}
return 1;
}
use of net.minecraft.inventory.EnderChestInventory in project Rug by RubixDev.
the class PeekCommand method showEnderChest.
public static void showEnderChest(ServerPlayerEntity executingPlayer, ServerPlayerEntity targetPlayer) {
EnderChestInventory targetEnderChest = targetPlayer.getEnderChestInventory();
PlayerDataGui invScreen = new PlayerDataGui(ScreenHandlerType.GENERIC_9X3, executingPlayer, targetPlayer);
invScreen.setTitle(Text.of("EnderChest of " + targetPlayer.getDisplayName().asString()));
for (int slot = 0; slot < targetEnderChest.size(); slot++) {
invScreen.setSlotRedirect(slot, new Slot(targetEnderChest, slot, 0, 0));
}
invScreen.open();
}
Aggregations