Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.Traumatophobia.prefixmod;
- import java.util.ArrayList;
- import java.util.List;
- import net.minecraft.client.Minecraft;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommand;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraftforge.client.IClientCommand;
- public class EnchantAll implements IClientCommand {
- private final List aliases;
- public EnchantAll()
- {
- aliases = new ArrayList();
- aliases.add("ea");
- aliases.add("godall");
- }
- @Override
- public boolean checkPermission(MinecraftServer arg0, ICommandSender arg1) {
- // TODO Auto-generated method stub
- return true;
- }
- @Override
- public void execute(MinecraftServer arg0, ICommandSender arg1, String[] arg2) {
- Item item = Minecraft.getMinecraft().player.getHeldItemMainhand().getItem();
- if (item == Items.DIAMOND_PICKAXE || item == Items.DIAMOND_AXE || item == Items.DIAMOND_SHOVEL || item == Items.IRON_PICKAXE || item == Items.IRON_AXE || item == Items.IRON_SHOVEL || item == Items.STONE_PICKAXE || item == Items.STONE_AXE || item == Items.STONE_SHOVEL || item == Items.GOLDEN_PICKAXE || item == Items.GOLDEN_AXE || item == Items.GOLDEN_SHOVEL || item == Items.WOODEN_PICKAXE || item == Items.WOODEN_AXE || item == Items.WOODEN_SHOVEL) {
- PrefixMod.pressTime = 0;
- PrefixMod.enchanttool = true;
- PrefixMod.enchant = true;
- }
- else if (item == Items.DIAMOND_SWORD || item == Items.IRON_SWORD || item == Items.STONE_SWORD || item == Items.GOLDEN_SWORD || item == Items.WOODEN_SWORD) {
- PrefixMod.pressTime = 0;
- PrefixMod.enchantsword = true;
- PrefixMod.enchant = true;
- }
- else if (item == Items.BOW) {
- PrefixMod.pressTime = 0;
- PrefixMod.enchantbow = true;
- PrefixMod.enchant = true;
- }
- else if (item == Items.DIAMOND_CHESTPLATE || item == Items.DIAMOND_LEGGINGS || item == Items.IRON_CHESTPLATE || item == Items.IRON_LEGGINGS || item == Items.GOLDEN_CHESTPLATE || item == Items.GOLDEN_LEGGINGS || item == Items.LEATHER_CHESTPLATE || item == Items.LEATHER_LEGGINGS || item == Items.CHAINMAIL_CHESTPLATE || item == Items.CHAINMAIL_LEGGINGS ) {
- PrefixMod.enchanttorso = true;
- PrefixMod.pressTime = 0;
- PrefixMod.enchant = true;
- }
- else if (item == Items.DIAMOND_HELMET || item == Items.IRON_HELMET || item == Items.GOLDEN_HELMET || item == Items.CHAINMAIL_HELMET || item == Items.LEATHER_HELMET) {
- PrefixMod.enchanthelmet = true;
- PrefixMod.pressTime = 0;
- PrefixMod.enchant = true;
- }
- else if (item == Items.DIAMOND_BOOTS || item == Items.IRON_BOOTS || item == Items.GOLDEN_BOOTS || item == Items.CHAINMAIL_BOOTS || item == Items.LEATHER_BOOTS) {
- PrefixMod.enchantboots = true;
- PrefixMod.pressTime = 0;
- PrefixMod.enchant = true;
- }
- else if (item == Items.FISHING_ROD) {
- PrefixMod.enchantrod = true;
- PrefixMod.pressTime = 0;
- PrefixMod.enchant = true;
- }
- else if (item == Items.FLINT_AND_STEEL || item == Items.SHEARS || item == Items.ELYTRA || item == Items.DIAMOND_HOE || item == Items.IRON_HOE || item == Items.STONE_HOE || item == Items.GOLDEN_HOE || item == Items.WOODEN_HOE){
- PrefixMod.enchantother = true;
- PrefixMod.pressTime = 0;
- PrefixMod.enchant = true;
- }
- }
- @Override
- public List<String> getAliases() {
- // TODO Auto-generated method stub
- return this.aliases;
- }
- @Override
- public String getName() {
- // TODO Auto-generated method stub
- return "enchantall";
- }
- @Override
- public List<String> getTabCompletions(MinecraftServer arg0, ICommandSender arg1, String[] arg2, BlockPos arg3) {
- // TODO Auto-generated method stub
- List<String> empty = new ArrayList<>();
- return empty;
- }
- @Override
- public String getUsage(ICommandSender arg0) {
- // TODO Auto-generated method stub
- return "enchanall";
- }
- @Override
- public boolean isUsernameIndex(String[] arg0, int arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- @Override
- public int compareTo(ICommand arg0) {
- // TODO Auto-generated method stub
- return 0;
- }
- @Override
- public boolean allowUsageWithoutPrefix(ICommandSender arg0, String arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- }
- package com.Traumatophobia.prefixmod;
- import java.util.ArrayList;
- import java.util.List;
- import com.Traumatophobia.SkyblockMod.proxy.CommonProxy;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.audio.ISound;
- import net.minecraft.client.audio.SoundHandler;
- import net.minecraft.client.entity.EntityPlayerSP;
- import net.minecraft.command.ICommand;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.util.SoundCategory;
- import net.minecraft.util.SoundEvent;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraft.world.World;
- import net.minecraftforge.client.ClientCommandHandler;
- import net.minecraftforge.client.event.ClientChatEvent;
- import net.minecraftforge.client.event.ClientChatReceivedEvent;
- import net.minecraftforge.client.event.RenderGameOverlayEvent;
- import net.minecraftforge.client.event.sound.SoundLoadEvent;
- import net.minecraftforge.common.MinecraftForge;
- import net.minecraftforge.event.CommandEvent;
- import net.minecraftforge.event.ServerChatEvent;
- import net.minecraftforge.event.world.NoteBlockEvent.Note;
- import net.minecraftforge.fml.common.FMLCommonHandler;
- import net.minecraftforge.fml.common.Mod;
- import net.minecraftforge.fml.common.Mod.EventHandler;
- import net.minecraftforge.fml.common.Mod.Instance;
- import net.minecraftforge.fml.common.SidedProxy;
- import net.minecraftforge.fml.common.event.FMLInitializationEvent;
- import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
- import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
- import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
- import net.minecraftforge.fml.common.gameevent.PlayerEvent;
- import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
- @Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION, acceptedMinecraftVersions = Reference.ACCEPTED_VERSIONS)
- public class PrefixMod {
- public static boolean toggled = true;
- @Instance
- public static PrefixMod instance;
- @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
- public static CommonProxy proxy;
- @EventHandler
- public void init(FMLInitializationEvent event)
- {
- FMLCommonHandler.instance().bus().register(this);
- }
- @EventHandler
- public void serverLoad(FMLPostInitializationEvent event)
- {
- ClientCommandHandler.instance.registerCommand(new ToggleNotify());
- ClientCommandHandler.instance.registerCommand(new SetPrefix());
- ClientCommandHandler.instance.registerCommand(new ToggleLottery());
- ClientCommandHandler.instance.registerCommand(new ToggleVote());
- ClientCommandHandler.instance.registerCommand(new ToggleTips());
- ClientCommandHandler.instance.registerCommand(new ToggleAll());
- ClientCommandHandler.instance.registerCommand(new EnchantAll());
- }
- public static boolean loggedin = false;
- public static int pressTime = 0;
- public static boolean enchantsword = false;
- public static boolean playsound = false;
- public static boolean enchanttool = false;
- public static boolean enchanttorso = false;
- public static boolean enchantbow = false;
- public static boolean enchanthelmet = false;
- public static boolean enchantboots = false;
- public static boolean enchantrod = false;
- public static boolean enchantother = false;
- public static boolean enchant = false;
- @SubscribeEvent
- public void onPlayerTick(ClientTickEvent event) {
- if (enchant == true) {
- try {
- if (pressTime == 0 && enchantsword == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant sharpness 5");
- }
- else if (pressTime == 40 && enchantsword == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant smite 5");
- }
- else if (pressTime == 80 && enchantsword == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant baneofarthropods 5");
- }
- else if (pressTime == 120 && enchantsword == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant fireaspect 2");
- }
- else if (pressTime == 160 && enchantsword == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant looting 3");
- }
- else if (pressTime == 200 && enchantsword == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant knockback 2");
- }
- else if (pressTime == 240 && enchantsword == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant sweepingedge 3");
- }
- else if (pressTime == 280 && enchantsword == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant unbreaking 3");
- }
- else if (pressTime == 320 && enchantsword == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant mending 1");
- enchantsword = false;
- enchant = false;
- }
- if (pressTime == 0 && enchanttool == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant efficiency 5");
- }
- else if (pressTime == 40 && enchanttool == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant unbreaking 3");
- }
- else if (pressTime == 80 && enchanttool == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant fortune 3");
- }
- else if (pressTime == 120 && enchanttool == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant mending 1");
- enchanttool = false;
- enchant = false;
- }
- if (pressTime == 0 && enchanttorso == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant protection 4");
- }
- else if (pressTime == 40 && enchanttorso == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant fireprotection 4");
- }
- else if (pressTime == 80 && enchanttorso == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant blastprotection 4");
- }
- else if (pressTime == 120 && enchanttorso == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant projectileprotection 4");
- }
- else if (pressTime == 160 && enchanttorso == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant unbreaking 3");
- }
- else if (pressTime == 200 && enchanttorso == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant thorns 3");
- }
- else if (pressTime == 240 && enchanttorso == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant mending 1");
- enchanttorso = false;
- enchant = false;
- }
- if (pressTime == 0 && enchantbow == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant power 5");
- }
- else if (pressTime == 40 && enchantbow == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant punch 2");
- }
- else if (pressTime == 80 && enchantbow == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant unbreaking 3");
- }
- else if (pressTime == 120 && enchantbow == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant flame 1");
- }
- else if (pressTime == 160 && enchantbow == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant infinity 1");
- enchantbow = false;
- enchant = false;
- }
- if (pressTime == 0 && enchanthelmet == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant protection 4");
- }
- else if (pressTime == 40 && enchanthelmet == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant fireprotection 4");
- }
- else if (pressTime == 80 && enchanthelmet == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant blastprotection 4");
- }
- else if (pressTime == 120 && enchanthelmet == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant projectileprotection 4");
- }
- else if (pressTime == 160 && enchanthelmet == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant unbreaking 3");
- }
- else if (pressTime == 200 && enchanthelmet == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant thorns 3");
- }
- else if (pressTime == 240 && enchanthelmet == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant mending 1");
- }
- else if (pressTime == 280 && enchanthelmet == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant respiration 3");
- }
- else if (pressTime == 320 && enchanthelmet == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant aquaaffinity 1");
- enchanthelmet = false;
- enchant = false;
- }
- if (pressTime == 0 && enchantboots == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant protection 4");
- }
- else if (pressTime == 40 && enchantboots == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant fireprotection 4");
- }
- else if (pressTime == 80 && enchantboots == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant blastprotection 4");
- }
- else if (pressTime == 120 && enchantboots == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant projectileprotection 4");
- }
- else if (pressTime == 160 && enchantboots == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant unbreaking 3");
- }
- else if (pressTime == 200 && enchantboots == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant thorns 3");
- }
- else if (pressTime == 240 && enchantboots == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant mending 1");
- }
- else if (pressTime == 280 && enchantboots == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant depth_strider 3");
- }
- else if (pressTime == 320 && enchantboots == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant featherfalling 4");
- enchantboots = false;
- enchant = false;
- }
- if (pressTime == 0 && enchantrod == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant lure 3");
- }
- else if (pressTime == 40 && enchantrod == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant luckofthesea 3");
- }
- else if (pressTime == 80 && enchantrod == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant unbreaking 3");
- }
- else if (pressTime == 120 && enchantrod == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant mending 1");
- enchantrod = false;
- enchant = false;
- }
- if (pressTime == 0 && enchantother == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant unbreaking 3");
- }
- else if (pressTime == 40 && enchantother == true) {
- Minecraft.getMinecraft().player.sendChatMessage("/enchant mending 1");
- PrefixMod.enchantother = false;
- enchant = false;
- }
- pressTime++;
- }
- catch (Exception e) {
- ;
- }
- }
- }
- @SubscribeEvent
- public void editChat(ClientChatEvent event) {
- if (event.getMessage().startsWith("/")) {
- ;
- }
- else {
- event.setMessage(SetPrefix.ChatPrefix+event.getMessage());
- }
- }
- List<String> nicknames = new ArrayList<String>();
- nicknames.add("test");
- @SubscribeEvent
- public void onChat(ClientChatReceivedEvent event) {
- if (loggedin == false) {
- Minecraft.getMinecraft().player.sendChatMessage("/fly");
- loggedin = true;
- }
- event.setCanceled(false);
- boolean changechat = false;
- String message = event.getMessage().getFormattedText();
- String message2 = event.getMessage().getUnformattedText();
- String[] splitmessage2 = message2.split(" ");
- String[] splitmessage = message.split(" ");
- String newstring = "";
- String playername = Minecraft.getMinecraft().player.getName();
- if (message2.contains("[SBLottery]") && message2.startsWith("[S") && ToggleLottery.Toggled == true) {
- event.setCanceled(true);
- }
- try {
- if (splitmessage2[3].contains("vote.skyblock.net") && ToggleVote.Toggled == true) {
- event.setCanceled(true);
- }
- }
- catch (Exception e) {
- ;
- }
- if (message2.contains("[Skyblock]") && message2.startsWith("[S") && ToggleTips.Toggled == true) {
- event.setCanceled(true);
- }
- for (int i = 0; i < splitmessage.length; i++) {
- if ((splitmessage[i].startsWith("<") && splitmessage[i].endsWith(">")) || (splitmessage[i].endsWith(":"))) {
- newstring += " "+splitmessage[i];
- }
- else if (splitmessage[i].contains(playername) && toggled == true) {
- World world = Minecraft.getMinecraft().world;
- EntityPlayer player = Minecraft.getMinecraft().player;
- changechat = true;
- playsound = true;
- playSound(world, player);
- boolean success = true;
- try {
- String[] splitAgain = splitmessage[i].split(playername);
- String extra = splitAgain[1];
- String extra2 = splitAgain[0];
- newstring += extra2 + " §e"+playername + "§f" + extra;
- }
- catch (Exception e) {
- success = false;
- }
- if (success == false) {
- newstring += " §e"+playername +"§f" ;
- }
- }
- else {
- newstring += " "+splitmessage[i];
- }
- }
- if (changechat == true) {
- }
- ITextComponent newmessage = new TextComponentString(newstring);
- event.setMessage(newmessage);
- }
- private void playSound(World world, EntityPlayer player) {
- if (playsound == true) {
- world.playSound(player, player.getPosition(), SoundEvents.BLOCK_NOTE_BELL, SoundCategory.MUSIC, 10, 5);
- playsound = false;
- }
- }
- }
- package com.Traumatophobia.prefixmod;
- public class Reference {
- //Tells minecraft the details of mod
- public static final String MOD_ID = "tsb";
- public static final String NAME = "Skyblock Mod";
- public static final String VERSION = "0.1";
- public static final String ACCEPTED_VERSIONS = "[1.12,)";
- //Specific for proxies
- public static final String CLIENT_PROXY_CLASS = "com.Traumatophobia.SkyblockMod.proxy.ClientProxy";
- public static final String SERVER_PROXY_CLASS = "com.Traumatophobia.SkyblockMod.proxy.ServerProxy";
- }
- package com.Traumatophobia.prefixmod;
- import java.util.ArrayList;
- import java.util.List;
- import net.minecraft.client.Minecraft;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommand;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraft.util.text.TextFormatting;
- import net.minecraftforge.client.IClientCommand;
- public class SetPrefix implements IClientCommand {
- public static String ChatPrefix = "";
- private final List aliases;
- public SetPrefix()
- {
- aliases = new ArrayList();
- aliases.add("sprefix");
- aliases.add("scp");
- }
- @Override
- public boolean checkPermission(MinecraftServer arg0, ICommandSender arg1) {
- // TODO Auto-generated method stub
- return true;
- }
- @Override
- public void execute(MinecraftServer arg0, ICommandSender arg1, String[] arg2) throws CommandException {
- boolean nospace = false;
- if (arg2.length >= 2) {
- if (arg2[1].contains("nospace")) {
- nospace = true;
- Minecraft.getMinecraft().player.sendMessage(new TextComponentString("Space after message disabled"));
- }
- else {
- Minecraft.getMinecraft().player.sendMessage(new TextComponentString("Spaces are not allowed!"));
- }
- }
- if (arg2.length == 0) {
- Minecraft.getMinecraft().player.sendMessage(new TextComponentString("Prefix Reset"));
- ChatPrefix = "";
- }
- else {
- String rawstring = arg2[0];
- String[] splitformat = rawstring.split("&");
- String newstring = "";
- if (rawstring.contains("&")) {
- for (int i = 0; i < splitformat.length; i++) {
- if (splitformat[i].startsWith("a")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.GREEN + splitformat[i];
- }
- else if (splitformat[i].startsWith("b")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.AQUA + splitformat[i];
- }
- else if (splitformat[i].startsWith("c")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.RED + splitformat[i];
- }
- else if (splitformat[i].startsWith("d")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.LIGHT_PURPLE + splitformat[i];
- }
- else if (splitformat[i].startsWith("e")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.YELLOW + splitformat[i];
- }
- else if (splitformat[i].startsWith("f")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.WHITE + splitformat[i];
- }
- else if (splitformat[i].startsWith("0")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.BLACK + splitformat[i];
- }
- else if (splitformat[i].startsWith("1")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.DARK_BLUE + splitformat[i];
- }
- else if (splitformat[i].startsWith("2")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.DARK_GREEN + splitformat[i];
- }
- else if (splitformat[i].startsWith("3")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.DARK_AQUA + splitformat[i];
- }
- else if (splitformat[i].startsWith("4")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.DARK_RED + splitformat[i];
- }
- else if (splitformat[i].startsWith("5")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.DARK_PURPLE + splitformat[i];
- }
- else if (splitformat[i].startsWith("6")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.GOLD + splitformat[i];
- }
- else if (splitformat[i].startsWith("7")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.GRAY + splitformat[i];
- }
- else if (splitformat[i].startsWith("8")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.DARK_GRAY + splitformat[i];
- }
- else if (splitformat[i].startsWith("9")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.BLUE + splitformat[i];
- }
- else if (splitformat[i].startsWith("k")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.OBFUSCATED + splitformat[i];
- }
- else if (splitformat[i].startsWith("l")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.BOLD + splitformat[i];
- }
- else if (splitformat[i].startsWith("m")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.STRIKETHROUGH + splitformat[i];
- }
- else if (splitformat[i].startsWith("n")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.UNDERLINE + splitformat[i];
- }
- else if (splitformat[i].startsWith("o")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.ITALIC + splitformat[i];
- }
- else if (splitformat[i].startsWith("r")) {
- splitformat[i] = splitformat[i].substring(1);
- newstring += TextFormatting.RESET + splitformat[i];
- }
- else {
- newstring += splitformat[i];
- }
- }
- }
- else {
- newstring = rawstring;
- }
- if (nospace == false) {
- Minecraft.getMinecraft().player.sendMessage(new TextComponentString("Your prefix: "+newstring+" [Chat]"));
- ChatPrefix = rawstring+" ";
- }
- if (nospace == true) {
- Minecraft.getMinecraft().player.sendMessage(new TextComponentString("Your prefix: "+newstring+"[Chat]"));
- ChatPrefix = rawstring+"";
- }
- }
- }
- @Override
- public List<String> getAliases() {
- // TODO Auto-generated method stub
- return this.aliases;
- }
- @Override
- public String getName() {
- // TODO Auto-generated method stub
- return "setchatprefix";
- }
- @Override
- public List<String> getTabCompletions(MinecraftServer arg0, ICommandSender arg1, String[] arg2, BlockPos arg3) {
- // TODO Auto-generated method stub
- List<String> empty = new ArrayList<>();
- return empty;
- }
- @Override
- public String getUsage(ICommandSender arg0) {
- // TODO Auto-generated method stub
- return "setprefix <text>";
- }
- @Override
- public boolean isUsernameIndex(String[] arg0, int arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- @Override
- public int compareTo(ICommand arg0) {
- // TODO Auto-generated method stub
- return 0;
- }
- @Override
- public boolean allowUsageWithoutPrefix(ICommandSender arg0, String arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- }
- package com.Traumatophobia.prefixmod;
- import java.util.ArrayList;
- import java.util.List;
- import net.minecraft.client.Minecraft;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommand;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraftforge.client.IClientCommand;
- public class ToggleAll implements IClientCommand {
- public static boolean Toggled = false;
- private final List aliases;
- public ToggleAll()
- {
- aliases = new ArrayList();
- aliases.add("ta");
- aliases.add("togglea");
- }
- @Override
- public boolean checkPermission(MinecraftServer arg0, ICommandSender arg1) {
- // TODO Auto-generated method stub
- return true;
- }
- @Override
- public void execute(MinecraftServer arg0, ICommandSender arg1, String[] arg2) throws CommandException {
- ITextComponent telluser = new TextComponentString("");
- if (Toggled == true) {
- Toggled = false;
- ToggleLottery.Toggled = false;
- ToggleTips.Toggled = false;
- ToggleVote.Toggled = false;
- telluser.appendText("All notifications enabled");
- }
- else if (Toggled == false) {
- Toggled = true;
- ToggleLottery.Toggled = true;
- ToggleTips.Toggled = true;
- ToggleVote.Toggled = true;
- telluser.appendText("All notifications disabled");
- }
- Minecraft.getMinecraft().player.sendMessage(telluser);
- }
- @Override
- public List<String> getAliases() {
- // TODO Auto-generated method stub
- return this.aliases;
- }
- @Override
- public String getName() {
- // TODO Auto-generated method stub
- return "toggleall";
- }
- @Override
- public List<String> getTabCompletions(MinecraftServer arg0, ICommandSender arg1, String[] arg2, BlockPos arg3) {
- // TODO Auto-generated method stub
- List<String> empty = new ArrayList<>();
- return empty;
- }
- @Override
- public String getUsage(ICommandSender arg0) {
- // TODO Auto-generated method stub
- return "toggleall";
- }
- @Override
- public boolean isUsernameIndex(String[] arg0, int arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- @Override
- public int compareTo(ICommand arg0) {
- // TODO Auto-generated method stub
- return 0;
- }
- @Override
- public boolean allowUsageWithoutPrefix(ICommandSender arg0, String arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- }
- package com.Traumatophobia.prefixmod;
- import java.util.ArrayList;
- import java.util.List;
- import net.minecraft.client.Minecraft;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommand;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraftforge.client.IClientCommand;
- public class ToggleLottery implements IClientCommand {
- public static boolean Toggled = false;
- private final List aliases;
- public ToggleLottery()
- {
- aliases = new ArrayList();
- aliases.add("tl");
- aliases.add("togglelot");
- }
- @Override
- public boolean checkPermission(MinecraftServer arg0, ICommandSender arg1) {
- // TODO Auto-generated method stub
- return true;
- }
- @Override
- public void execute(MinecraftServer arg0, ICommandSender arg1, String[] arg2) throws CommandException {
- ITextComponent telluser = new TextComponentString("");
- if (Toggled == true) {
- Toggled = false;
- telluser.appendText("Lottery notifications enabled");
- }
- else if (Toggled == false) {
- Toggled = true;
- telluser.appendText("Lottery notifications disabled");
- }
- Minecraft.getMinecraft().player.sendMessage(telluser);
- }
- @Override
- public List<String> getAliases() {
- // TODO Auto-generated method stub
- return this.aliases;
- }
- @Override
- public String getName() {
- // TODO Auto-generated method stub
- return "togglelottery";
- }
- @Override
- public List<String> getTabCompletions(MinecraftServer arg0, ICommandSender arg1, String[] arg2, BlockPos arg3) {
- // TODO Auto-generated method stub
- List<String> empty = new ArrayList<>();
- return empty;
- }
- @Override
- public String getUsage(ICommandSender arg0) {
- // TODO Auto-generated method stub
- return "togglelottery";
- }
- @Override
- public boolean isUsernameIndex(String[] arg0, int arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- @Override
- public int compareTo(ICommand arg0) {
- // TODO Auto-generated method stub
- return 0;
- }
- @Override
- public boolean allowUsageWithoutPrefix(ICommandSender arg0, String arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- }
- package com.Traumatophobia.prefixmod;
- import java.util.List;
- import net.minecraft.client.Minecraft;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommand;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraftforge.client.IClientCommand;
- import java.util.ArrayList;
- public class ToggleNotify implements IClientCommand {
- private final List aliases;
- public ToggleNotify() {
- aliases = new ArrayList();
- aliases.add("togglenotify");
- aliases.add("alert");
- }
- @Override
- public boolean checkPermission(MinecraftServer arg0, ICommandSender arg1) {
- // TODO Auto-generated method stub
- return true;
- }
- @Override
- public void execute(MinecraftServer arg0, ICommandSender arg1, String[] arg2) throws CommandException {
- ITextComponent telluser = new TextComponentString("");
- if (PrefixMod.toggled == true) {
- PrefixMod.toggled = false;
- telluser.appendText("Username notifications disabled");
- }
- else if (PrefixMod.toggled == false) {
- PrefixMod.toggled = true;
- telluser.appendText("Username notifications enabled");
- }
- Minecraft.getMinecraft().player.sendMessage(telluser);
- }
- @Override
- public List<String> getAliases() {
- // TODO Auto-generated method stub
- return this.aliases;
- }
- @Override
- public String getName() {
- // TODO Auto-generated method stub
- return "notify";
- }
- @Override
- public List<String> getTabCompletions(MinecraftServer arg0, ICommandSender arg1, String[] arg2, BlockPos arg3) {
- // TODO Auto-generated method stub
- List<String> empty = new ArrayList<>();
- return empty;
- }
- @Override
- public String getUsage(ICommandSender arg0) {
- // TODO Auto-generated method stub
- return "notify";
- }
- @Override
- public boolean isUsernameIndex(String[] arg0, int arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- @Override
- public int compareTo(ICommand o) {
- // TODO Auto-generated method stub
- return 0;
- }
- @Override
- public boolean allowUsageWithoutPrefix(ICommandSender arg0, String arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- }
- package com.Traumatophobia.prefixmod;
- import java.util.ArrayList;
- import java.util.List;
- import net.minecraft.client.Minecraft;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommand;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraftforge.client.IClientCommand;
- public class ToggleTips implements IClientCommand {
- public static boolean Toggled = false;
- private final List aliases;
- public ToggleTips()
- {
- aliases = new ArrayList();
- aliases.add("tt");
- aliases.add("toggletip");
- }
- @Override
- public boolean checkPermission(MinecraftServer arg0, ICommandSender arg1) {
- // TODO Auto-generated method stub
- return true;
- }
- @Override
- public void execute(MinecraftServer arg0, ICommandSender arg1, String[] arg2) throws CommandException {
- ITextComponent telluser = new TextComponentString("");
- if (Toggled == true) {
- Toggled = false;
- telluser.appendText("Skyblock tips enabled");
- }
- else if (Toggled == false) {
- Toggled = true;
- telluser.appendText("Skyblock tips disabled");
- }
- Minecraft.getMinecraft().player.sendMessage(telluser);
- }
- @Override
- public List<String> getAliases() {
- // TODO Auto-generated method stub
- return this.aliases;
- }
- @Override
- public String getName() {
- // TODO Auto-generated method stub
- return "toggletips";
- }
- @Override
- public List<String> getTabCompletions(MinecraftServer arg0, ICommandSender arg1, String[] arg2, BlockPos arg3) {
- // TODO Auto-generated method stub
- List<String> empty = new ArrayList<>();
- return empty;
- }
- @Override
- public String getUsage(ICommandSender arg0) {
- // TODO Auto-generated method stub
- return "toggletips";
- }
- @Override
- public boolean isUsernameIndex(String[] arg0, int arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- @Override
- public int compareTo(ICommand arg0) {
- // TODO Auto-generated method stub
- return 0;
- }
- @Override
- public boolean allowUsageWithoutPrefix(ICommandSender arg0, String arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- }
- package com.Traumatophobia.prefixmod;
- import java.util.ArrayList;
- import java.util.List;
- import net.minecraft.client.Minecraft;
- import net.minecraft.command.CommandException;
- import net.minecraft.command.ICommand;
- import net.minecraft.command.ICommandSender;
- import net.minecraft.server.MinecraftServer;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.text.ITextComponent;
- import net.minecraft.util.text.TextComponentString;
- import net.minecraftforge.client.IClientCommand;
- public class ToggleVote implements IClientCommand {
- public static boolean Toggled = false;
- private final List aliases;
- public ToggleVote()
- {
- aliases = new ArrayList();
- aliases.add("tv");
- }
- @Override
- public boolean checkPermission(MinecraftServer arg0, ICommandSender arg1) {
- // TODO Auto-generated method stub
- return true;
- }
- @Override
- public void execute(MinecraftServer arg0, ICommandSender arg1, String[] arg2) throws CommandException {
- ITextComponent telluser = new TextComponentString("");
- if (Toggled == true) {
- Toggled = false;
- telluser.appendText("Voting notifications enabled");
- }
- else if (Toggled == false) {
- Toggled = true;
- telluser.appendText("Voting notifications disabled");
- }
- Minecraft.getMinecraft().player.sendMessage(telluser);
- }
- @Override
- public List<String> getAliases() {
- // TODO Auto-generated method stub
- return this.aliases;
- }
- @Override
- public String getName() {
- // TODO Auto-generated method stub
- return "togglevote";
- }
- @Override
- public List<String> getTabCompletions(MinecraftServer arg0, ICommandSender arg1, String[] arg2, BlockPos arg3) {
- // TODO Auto-generated method stub
- List<String> empty = new ArrayList<>();
- return empty;
- }
- @Override
- public String getUsage(ICommandSender arg0) {
- // TODO Auto-generated method stub
- return "togglevote";
- }
- @Override
- public boolean isUsernameIndex(String[] arg0, int arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- @Override
- public int compareTo(ICommand arg0) {
- // TODO Auto-generated method stub
- return 0;
- }
- @Override
- public boolean allowUsageWithoutPrefix(ICommandSender arg0, String arg1) {
- // TODO Auto-generated method stub
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement