Fix the item expire delay amplifier
Fix aurora door texture Add trash command Push 1.3.3.1 alpha
This commit is contained in:
parent
146de39f44
commit
d44ffa6342
21 changed files with 110 additions and 88 deletions
|
@ -16,6 +16,7 @@ import dev.zontreck.otemod.commands.teleport.TPAHereCommand;
|
|||
import dev.zontreck.otemod.commands.teleport.TPAcceptCommand;
|
||||
import dev.zontreck.otemod.commands.teleport.TPCancelCommand;
|
||||
import dev.zontreck.otemod.commands.teleport.TPDenyCommand;
|
||||
import dev.zontreck.otemod.commands.vaults.TrashCommand;
|
||||
import dev.zontreck.otemod.commands.vaults.VaultCommand;
|
||||
import dev.zontreck.otemod.configs.OTEServerConfig;
|
||||
import net.minecraftforge.event.RegisterCommandsEvent;
|
||||
|
@ -104,6 +105,7 @@ public class CommandRegistry {
|
|||
|
||||
|
||||
VaultCommand.register(ev.getDispatcher());
|
||||
TrashCommand.register(ev.getDispatcher());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package dev.zontreck.otemod.commands.vaults;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
|
||||
import dev.zontreck.otemod.implementation.VaultContainer;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.SimpleMenuProvider;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
|
||||
public class TrashCommand {
|
||||
|
||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
||||
{
|
||||
dispatcher.register(Commands.literal("trash").executes(c-> vault(c.getSource())));
|
||||
|
||||
//dispatcher.register(Commands.literal("sethome").then(Commands.argument("nickname", StringArgumentType.string())).executes(command -> {
|
||||
//String arg = StringArgumentType.getString(command, "nickname");
|
||||
//return setHome(command.getSource(), arg);
|
||||
//}));
|
||||
}
|
||||
|
||||
private static int vault(CommandSourceStack source) {
|
||||
//VaultContainer cont = new VaultContainer(i, source.getPlayer().getUUID());
|
||||
//cont.startOpen(source.getPlayer());
|
||||
|
||||
VaultContainer container = new VaultContainer(source.getPlayer(), -1);
|
||||
|
||||
NetworkHooks.openScreen(source.getPlayer(), new SimpleMenuProvider(container.serverMenu, Component.literal("Trash")));
|
||||
|
||||
// Add to the master vault registry
|
||||
if(VaultContainer.VAULT_REGISTRY.containsKey(source.getPlayer().getUUID()))VaultContainer.VAULT_REGISTRY.remove(source.getPlayer().getUUID());
|
||||
VaultContainer.VAULT_REGISTRY.put(source.getPlayer().getUUID(), container);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -7,31 +7,12 @@ import javax.annotation.Nullable;
|
|||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
|
||||
import dev.zontreck.otemod.chat.ChatColor;
|
||||
import dev.zontreck.otemod.chat.ChatServerOverride;
|
||||
import dev.zontreck.otemod.implementation.VaultContainer;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.game.ClientboundOpenScreenPacket;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.CompoundContainer;
|
||||
import net.minecraft.world.MenuProvider;
|
||||
import net.minecraft.world.SimpleMenuProvider;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.ChestMenu;
|
||||
import net.minecraft.world.inventory.MenuConstructor;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import net.minecraft.world.level.block.ChestBlock;
|
||||
import net.minecraft.world.level.block.entity.ChestBlockEntity;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerContainerEvent;
|
||||
import net.minecraftforge.network.NetworkConstants;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
import net.minecraftforge.network.PlayMessages;
|
||||
|
||||
public class VaultCommand {
|
||||
|
||||
|
|
Reference in a new issue