Update to 1.19.3
This commit is contained in:
parent
c5dd4b402f
commit
d93f7fdd00
51 changed files with 264 additions and 360 deletions
|
@ -2,14 +2,12 @@ package dev.zontreck.otemod.commands;
|
|||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
|
||||
public class FlyCommand {
|
||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
||||
|
@ -39,12 +37,12 @@ public class FlyCommand {
|
|||
p.getAbilities().flying=false;
|
||||
p.onUpdateAbilities();
|
||||
|
||||
ctx.sendSuccess(new TextComponent(OTEMod.OTEPrefix + ChatColor.DARK_PURPLE + " Your ability to fly has been disabled"), false);
|
||||
ctx.sendSuccess(Component.literal(OTEMod.OTEPrefix + ChatColor.DARK_PURPLE + " Your ability to fly has been disabled"), false);
|
||||
}else {
|
||||
p.getAbilities().mayfly=true;
|
||||
p.onUpdateAbilities();
|
||||
|
||||
ctx.sendSuccess(new TextComponent(OTEMod.OTEPrefix + ChatColor.DARK_PURPLE + " You can now fly"), false);
|
||||
ctx.sendSuccess(Component.literal(OTEMod.OTEPrefix + ChatColor.DARK_PURPLE + " You can now fly"), false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package dev.zontreck.otemod.commands.items;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.chat.HoverTip;
|
||||
import dev.zontreck.libzontreck.profiles.Profile;
|
||||
import dev.zontreck.libzontreck.profiles.UserProfileNotYetExistsException;
|
||||
|
@ -12,7 +10,6 @@ import net.minecraft.commands.CommandSourceStack;
|
|||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.network.chat.Style;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
@ -39,7 +36,7 @@ public class ShareItemInChatCommand {
|
|||
ItemStack is = play.getItemInHand(InteractionHand.MAIN_HAND);
|
||||
if(is.getItem() instanceof AirItem)
|
||||
{
|
||||
play.displayClientMessage(new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Red!You cannot share air in the chat.")), false);
|
||||
play.displayClientMessage(ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Red!You cannot share air in the chat."), false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -50,7 +47,7 @@ public class ShareItemInChatCommand {
|
|||
return 1;
|
||||
}
|
||||
|
||||
MutableComponent component = new TextComponent(OTEMod.OTEPrefix).append(is.getDisplayName()).append(new TextComponent(ChatColor.doColors(" !White!-!Dark_Purple! Hover here to see the item that "+prof.name_color+prof.nickname+"!Dark_Purple! shared")));
|
||||
MutableComponent component = ChatHelpers.macro(OTEMod.OTEPrefix).append(is.getDisplayName()).append(ChatHelpers.macro(" !White!-!Dark_Purple! Hover here to see the item that "+prof.name_color+prof.nickname+"!Dark_Purple! shared"));
|
||||
Style style = Style.EMPTY.withFont(Style.DEFAULT_FONT);
|
||||
component = component.withStyle(style.withHoverEvent(HoverTip.getItem(is)));
|
||||
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
package dev.zontreck.otemod.commands.profilecmds;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
||||
import dev.zontreck.libzontreck.LibZontreck;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor.ColorOptions;
|
||||
import dev.zontreck.libzontreck.profiles.Profile;
|
||||
import dev.zontreck.libzontreck.profiles.UserProfileNotYetExistsException;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraftforge.server.command.EnumArgument;
|
||||
|
@ -54,7 +52,7 @@ public class ChatColorCommand {
|
|||
p.commit();
|
||||
LibZontreck.PROFILES.put(play.getStringUUID(), p);
|
||||
|
||||
source.sendSuccess(new TextComponent(OTEMod.OTEPrefix + " "+ChatColor.DARK_PURPLE + "Your chat color has been updated"), false);
|
||||
source.sendSuccess(ChatHelpers.macro(OTEMod.OTEPrefix + " "+ChatColor.DARK_PURPLE + "Your chat color has been updated"), false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
package dev.zontreck.otemod.commands.profilecmds;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
||||
import dev.zontreck.libzontreck.LibZontreck;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor.ColorOptions;
|
||||
import dev.zontreck.libzontreck.profiles.Profile;
|
||||
import dev.zontreck.libzontreck.profiles.UserProfileNotYetExistsException;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraftforge.server.command.EnumArgument;
|
||||
|
@ -54,7 +52,7 @@ public class NameColorCommand {
|
|||
p.commit();
|
||||
LibZontreck.PROFILES.put(play.getStringUUID(), p);
|
||||
|
||||
source.sendSuccess(new TextComponent(OTEMod.OTEPrefix+ " "+ChatColor.DARK_PURPLE + "Your name color has been updated"), false);
|
||||
source.sendSuccess(ChatHelpers.macro(OTEMod.OTEPrefix+ " "+ChatColor.DARK_PURPLE + "Your name color has been updated"), false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2,16 +2,14 @@ package dev.zontreck.otemod.commands.profilecmds;
|
|||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
|
||||
import dev.zontreck.libzontreck.LibZontreck;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.profiles.Profile;
|
||||
import dev.zontreck.libzontreck.profiles.UserProfileNotYetExistsException;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
|
@ -50,7 +48,7 @@ public class NickCommand {
|
|||
p.commit();
|
||||
LibZontreck.PROFILES.put(play.getStringUUID(), p);
|
||||
|
||||
source.sendSuccess(new TextComponent(OTEMod.OTEPrefix+ " "+ChatColor.DARK_PURPLE + "Your nickname has been updated"), false);
|
||||
source.sendSuccess(ChatHelpers.macro(OTEMod.OTEPrefix+ " "+ChatColor.DARK_PURPLE + "Your nickname has been updated"), false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
package dev.zontreck.otemod.commands.profilecmds;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
||||
import dev.zontreck.libzontreck.LibZontreck;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor.ColorOptions;
|
||||
import dev.zontreck.libzontreck.profiles.Profile;
|
||||
import dev.zontreck.libzontreck.profiles.UserProfileNotYetExistsException;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraftforge.server.command.EnumArgument;
|
||||
|
@ -54,7 +53,7 @@ public class PrefixColorCommand {
|
|||
p.commit();
|
||||
LibZontreck.PROFILES.put(play.getStringUUID(), p);
|
||||
|
||||
source.sendSuccess(new TextComponent(OTEMod.OTEPrefix+ " "+ChatColor.DARK_PURPLE + "Your prefix color has been updated"), false);
|
||||
source.sendSuccess(ChatHelpers.macro(OTEMod.OTEPrefix+ " "+ChatColor.DARK_PURPLE + "Your prefix color has been updated"), false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2,16 +2,14 @@ package dev.zontreck.otemod.commands.profilecmds;
|
|||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
|
||||
import dev.zontreck.libzontreck.LibZontreck;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.profiles.Profile;
|
||||
import dev.zontreck.libzontreck.profiles.UserProfileNotYetExistsException;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
|
@ -50,7 +48,7 @@ public class PrefixCommand {
|
|||
p.commit();
|
||||
LibZontreck.PROFILES.put(play.getStringUUID(), p);
|
||||
|
||||
source.sendSuccess(new TextComponent(OTEMod.OTEPrefix+ " "+ChatColor.DARK_PURPLE + "Your prefix has been updated"), false);
|
||||
source.sendSuccess(ChatHelpers.macro(OTEMod.OTEPrefix+ " "+ChatColor.DARK_PURPLE + "Your prefix has been updated"), false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package dev.zontreck.otemod.commands.vaults;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.implementation.vault.NoMoreVaultException;
|
||||
import dev.zontreck.otemod.implementation.vault.VaultContainer;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.SimpleMenuProvider;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
|
@ -35,11 +33,11 @@ public class TrashCommand {
|
|||
try {
|
||||
container = new VaultContainer(play, -1);
|
||||
} catch (NoMoreVaultException e) {
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Red!You cannot open anymore vaults. Craft a new vault!")), play.server);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Red!You cannot open anymore vaults. Craft a new vault!"), play.server);
|
||||
return 0;
|
||||
}
|
||||
|
||||
NetworkHooks.openGui(play, new SimpleMenuProvider(container.serverMenu, new TextComponent("Trash")));
|
||||
NetworkHooks.openScreen(play, new SimpleMenuProvider(container.serverMenu, Component.literal("Trash")));
|
||||
|
||||
// Add to the master vault registry
|
||||
if(VaultContainer.VAULT_REGISTRY.containsKey(play.getUUID()))VaultContainer.VAULT_REGISTRY.remove(play.getUUID());
|
||||
|
|
|
@ -2,15 +2,13 @@ package dev.zontreck.otemod.commands.vaults;
|
|||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.IntegerArgumentType;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.implementation.vault.NoMoreVaultException;
|
||||
import dev.zontreck.otemod.implementation.vault.VaultContainer;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.SimpleMenuProvider;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
|
@ -34,7 +32,7 @@ public class VaultCommand {
|
|||
ServerPlayer play = (ServerPlayer)source.getEntity();
|
||||
if(i <0)
|
||||
{
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(ChatColor.doColors(OTEMod.OTEPrefix+" !Dark_Red!You can only specify a vault number in the positive range")), source.getServer());
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Red!You can only specify a vault number in the positive range"), source.getServer());
|
||||
return 0;
|
||||
}
|
||||
doOpen(play, i);
|
||||
|
@ -49,11 +47,11 @@ public class VaultCommand {
|
|||
try {
|
||||
container = new VaultContainer(p, i);
|
||||
} catch (NoMoreVaultException e) {
|
||||
ChatHelpers.broadcastTo(p.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Red!You cannot open anymore vaults. Craft a new vault!")), p.server);
|
||||
ChatHelpers.broadcastTo(p.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Red!You cannot open anymore vaults. Craft a new vault!"), p.server);
|
||||
return;
|
||||
}
|
||||
|
||||
NetworkHooks.openGui(p, new SimpleMenuProvider(container.serverMenu, new TextComponent("Vault "+i)));
|
||||
NetworkHooks.openScreen(p, new SimpleMenuProvider(container.serverMenu, Component.literal("Vault " + i)));
|
||||
|
||||
// Add to the master vault registry
|
||||
if(VaultContainer.VAULT_REGISTRY.containsKey(p.getUUID()))VaultContainer.VAULT_REGISTRY.remove(p.getUUID());
|
||||
|
|
|
@ -1,16 +1,7 @@
|
|||
package dev.zontreck.otemod.commands.zschem;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.libzontreck.vectors.Vector3;
|
||||
import dev.zontreck.libzontreck.vectors.WorldPosition;
|
||||
|
@ -26,12 +17,18 @@ import net.minecraft.nbt.CompoundTag;
|
|||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.NbtIo;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraftforge.fml.loading.FMLConfig;
|
||||
import net.minecraftforge.fml.loading.FMLPaths;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class LoadSchem {
|
||||
|
||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
||||
|
@ -115,17 +112,17 @@ public class LoadSchem {
|
|||
MemoryHolder.setBlocks(play, blocks);
|
||||
|
||||
}else {
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix + ChatColor.doColors(" !Dark_Red!No such ZSchem exists!")), source.getServer());
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix + " !Dark_Red!No such ZSchem exists!"), source.getServer());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Green!ZSchem loaded from disk!")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Green!ZSchem loaded from disk!"), OTEMod.THE_SERVER);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(ChatColor.doColors("!Dark_Red! You must set the first position")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro("!Dark_Red! You must set the first position"), OTEMod.THE_SERVER);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -133,10 +130,10 @@ public class LoadSchem {
|
|||
private static int loadSchematicUsage(CommandSourceStack source)
|
||||
{
|
||||
String usage = OTEMod.OTEPrefix;
|
||||
usage += ChatColor.doColors("!gold! /loadzschem [string:name]");
|
||||
usage += "!gold! /loadzschem [string:name]";
|
||||
ServerPlayer play=(ServerPlayer)source.getEntity();
|
||||
if(play==null)return 1;
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(usage), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(usage), OTEMod.THE_SERVER);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,26 +1,21 @@
|
|||
package dev.zontreck.otemod.commands.zschem;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.chat.ChatServerOverride;
|
||||
import dev.zontreck.otemod.integrations.LuckPermsHelper;
|
||||
import dev.zontreck.otemod.permissions.Permissions;
|
||||
import dev.zontreck.otemod.zschem.MemoryHolder;
|
||||
import dev.zontreck.otemod.zschem.MemoryHolder.Container;
|
||||
import dev.zontreck.otemod.zschem.StoredBlock;
|
||||
import dev.zontreck.otemod.zschem.WorldProp;
|
||||
import dev.zontreck.otemod.zschem.MemoryHolder.Container;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
// This command will place the loaded schematic in world. The schematic will originate from position 1. The positions are relative and are added onto position 1.
|
||||
public class Place {
|
||||
|
||||
|
@ -46,7 +41,7 @@ public class Place {
|
|||
|
||||
if(!MemoryHolder.hasPlayerCached(play)){
|
||||
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Red!You must first load the zschem!")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Red!You must first load the zschem!"), OTEMod.THE_SERVER);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -67,13 +62,13 @@ public class Place {
|
|||
|
||||
}else {
|
||||
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Red!You must first load the zschem!")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Red!You must first load the zschem!"), OTEMod.THE_SERVER);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Green!Enqueued!")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Green!Enqueued!"), OTEMod.THE_SERVER);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,29 +1,24 @@
|
|||
package dev.zontreck.otemod.commands.zschem;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.libzontreck.vectors.Vector3;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.integrations.LuckPermsHelper;
|
||||
import dev.zontreck.otemod.permissions.Permissions;
|
||||
import dev.zontreck.otemod.zschem.MemoryHolder;
|
||||
import dev.zontreck.otemod.zschem.MemoryHolder.Container;
|
||||
import dev.zontreck.otemod.zschem.StoredBlock;
|
||||
import dev.zontreck.otemod.zschem.WorldProp;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.libzontreck.vectors.Vector3;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.chat.ChatServerOverride;
|
||||
import dev.zontreck.otemod.integrations.LuckPermsHelper;
|
||||
import dev.zontreck.otemod.permissions.Permissions;
|
||||
import dev.zontreck.otemod.zschem.MemoryHolder;
|
||||
import dev.zontreck.otemod.zschem.StoredBlock;
|
||||
import dev.zontreck.otemod.zschem.WorldProp;
|
||||
import dev.zontreck.otemod.zschem.MemoryHolder.Container;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
|
||||
// This command will place the loaded schematic in world. The schematic will originate from position 1. The positions are relative and are added onto position 1.
|
||||
public class PlaceAsAir {
|
||||
|
||||
|
@ -49,7 +44,7 @@ public class PlaceAsAir {
|
|||
|
||||
if(!MemoryHolder.hasPlayerCached(play)){
|
||||
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Red!You must first set the positions!")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Red!You must first set the positions!"), OTEMod.THE_SERVER);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -74,13 +69,13 @@ public class PlaceAsAir {
|
|||
|
||||
}else {
|
||||
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Red!You must first set the positions!")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Red!You must first set the positions!"), OTEMod.THE_SERVER);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Green!Enqueued!")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Green!Enqueued!"), OTEMod.THE_SERVER);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,19 +1,10 @@
|
|||
package dev.zontreck.otemod.commands.zschem;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.libzontreck.vectors.Vector3;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.chat.ChatServerOverride;
|
||||
import dev.zontreck.otemod.integrations.LuckPermsHelper;
|
||||
import dev.zontreck.otemod.permissions.Permissions;
|
||||
import dev.zontreck.otemod.zschem.MemoryHolder;
|
||||
|
@ -25,12 +16,16 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.NbtIo;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraftforge.fml.loading.FMLConfig;
|
||||
import net.minecraftforge.fml.loading.FMLPaths;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SaveSchem {
|
||||
|
||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
||||
|
@ -108,12 +103,12 @@ public class SaveSchem {
|
|||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Green!ZSchem saved to disk!")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(OTEMod.OTEPrefix+" !Dark_Green!ZSchem saved to disk!"), OTEMod.THE_SERVER);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(ChatColor.doColors("!Dark_Red! You must first set the positions")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro("!Dark_Red! You must first set the positions"), OTEMod.THE_SERVER);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -121,10 +116,10 @@ public class SaveSchem {
|
|||
private static int saveSchematicUsage(CommandSourceStack source)
|
||||
{
|
||||
String usage = OTEMod.OTEPrefix;
|
||||
usage += ChatColor.doColors("!gold! /savezschem [string:name]");
|
||||
usage += "!gold! /savezschem [string:name]";
|
||||
ServerPlayer play=(ServerPlayer)source.getEntity();
|
||||
if(play==null)return 1;
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(usage), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(usage), OTEMod.THE_SERVER);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
package dev.zontreck.otemod.commands.zschem;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.libzontreck.vectors.Vector3;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.chat.ChatServerOverride;
|
||||
import dev.zontreck.otemod.integrations.LuckPermsHelper;
|
||||
import dev.zontreck.otemod.permissions.Permissions;
|
||||
import dev.zontreck.otemod.zschem.MemoryHolder;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
|
||||
public class SetPos1 {
|
||||
|
@ -40,7 +37,7 @@ public class SetPos1 {
|
|||
MemoryHolder.setPos1(play, new Vector3(source.getPosition()));
|
||||
MemoryHolder.setLevel(play, source.getLevel());
|
||||
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Green!Position 1 set!")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), Component.literal(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Green!Position 1 set!")), OTEMod.THE_SERVER);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
package dev.zontreck.otemod.commands.zschem;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.libzontreck.vectors.Vector3;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.chat.ChatServerOverride;
|
||||
import dev.zontreck.otemod.integrations.LuckPermsHelper;
|
||||
import dev.zontreck.otemod.permissions.Permissions;
|
||||
import dev.zontreck.otemod.zschem.MemoryHolder;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
|
||||
public class SetPos2 {
|
||||
|
@ -40,7 +37,7 @@ public class SetPos2 {
|
|||
MemoryHolder.setPos2(play, new Vector3(source.getPosition()));
|
||||
MemoryHolder.setLevel(play, source.getLevel());
|
||||
|
||||
ChatHelpers.broadcastTo(play.getUUID(), new TextComponent(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Green!Position 2 set!")), OTEMod.THE_SERVER);
|
||||
ChatHelpers.broadcastTo(play.getUUID(), Component.literal(OTEMod.OTEPrefix+ChatColor.doColors(" !Dark_Green!Position 2 set!")), OTEMod.THE_SERVER);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Reference in a new issue