Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
Merged #353 and resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
RadBuilder committed Oct 22, 2017
2 parents 8682702 + e1ce6b9 commit 4338445
Show file tree
Hide file tree
Showing 223 changed files with 1,477 additions and 2,542 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
allprojects { apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' group = 'be.isach' version = '2.4.9-RELEASE' compileJava.options.encoding = 'UTF-8' sourceCompatibility = 1.8 targetCompatibility = 1.8 configurations { shaded compile.extendsFrom shaded } afterEvaluate { jar { dependsOn configurations.shaded from configurations.shaded.collect { it.isDirectory() ? it : zipTree(it) } } }}boolean local = falseif (local) libsDirName = '/Users/sacha/Documents/Development/Java/UC_1_11/testserver/plugins'dependencies { subprojects.each { p -> shaded(p) { transitive false } }}subprojects { repositories { mavenLocal() mavenCentral() // Vault maven { url 'http://nexus.hc.to/content/repositories/pub_releases' } // Lib's Disguises maven { url 'http://repo.md-5.net/content/groups/public/' } // Use BuildTools to download Spigot to your local maven repository. More information: https://www.spigotmc.org/wiki/buildtools/ // BungeeCord maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } }}
allprojects { apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' group = 'be.isach' version = '2.5.0-RELEASE' compileJava.options.encoding = 'UTF-8' sourceCompatibility = 1.8 targetCompatibility = 1.8 configurations { shaded compile.extendsFrom shaded } afterEvaluate { jar { dependsOn configurations.shaded from configurations.shaded.collect { it.isDirectory() ? it : zipTree(it) } } }}boolean local = falseif (local) libsDirName = '/Users/sacha/Documents/Development/Java/UC_1_11/testserver/plugins'dependencies { subprojects.each { p -> shaded(p) { transitive false } }}subprojects { repositories { mavenLocal() mavenCentral() // Vault maven { url 'http://nexus.hc.to/content/repositories/pub_releases' } // Lib's Disguises maven { url 'http://repo.md-5.net/content/groups/public/' } // Use BuildTools to download Spigot to your local maven repository. More information: https://www.spigotmc.org/wiki/buildtools/ // BungeeCord maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } }}
Expand Down
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies {
compile 'org.spigotmc:spigot:1.12-R0.1-SNAPSHOT'
compile('LibsDisguises:LibsDisguises:9.0.7') {
compile('LibsDisguises:LibsDisguises:9.4.0') {
exclude group: 'org.spigotmc'
exclude group: 'com.comphenix.protocol'
}
Expand Down
26 changes: 11 additions & 15 deletions core/src/main/java/be/isach/ultracosmetics/CosmeticManager.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
package be.isach.ultracosmetics;

import be.isach.ultracosmetics.cosmetics.Category;
import be.isach.ultracosmetics.cosmetics.type.EmoteType;
import be.isach.ultracosmetics.cosmetics.type.GadgetType;
import be.isach.ultracosmetics.cosmetics.type.HatType;
import be.isach.ultracosmetics.cosmetics.type.MorphType;
import be.isach.ultracosmetics.cosmetics.type.MountType;
import be.isach.ultracosmetics.cosmetics.type.ParticleEffectType;
import be.isach.ultracosmetics.cosmetics.type.PetType;
import be.isach.ultracosmetics.cosmetics.type.SuitType;
import be.isach.ultracosmetics.cosmetics.Cosmetic;
import be.isach.ultracosmetics.cosmetics.type.*;

import java.io.IOException;
import java.util.ArrayList;
Expand Down Expand Up @@ -45,22 +39,24 @@ public void setupCosmeticsConfigs() {
ultraCosmetics.getConfig().addDefault("Ammo-System-For-Gadgets.Show-Ammo-In-Menu-As-Item-Amount", true, "Do you want that in the gadgets menu", "each gadget item has an amount", "corresponding to your ammo.");

// CALL STATIC BLOCK.
GadgetType.ANTIGRAVITY.getConfigName();
MountType.DRAGON.getConfigName();
ParticleEffectType.ANGELWINGS.getConfigName();
PetType.CHICK.getConfigName();
SuitType.ASTRONAUT.getConfigName();
GadgetType.register();
MountType.register();
ParticleEffectType.register();
PetType.register();
HatType.register();
SuitType.register();
EmoteType.ANGRY.getConfigName();
if (Category.MORPHS.isEnabled()) {
MorphType.BAT.getConfigName();
MorphType.register();
// MorphType.valueOf("bat").getConfigName();
}

for (GadgetType gadgetType : GadgetType.values()) {
ultraCosmetics.getConfig().addDefault("Gadgets." + gadgetType.getConfigName() + ".Affect-Players", true, "Should it affect players? (Velocity, etc.)");
ultraCosmetics.getConfig().addDefault("Gadgets." + gadgetType.getConfigName() + ".Enabled", true, "if true, the gadget will be enabled.");
ultraCosmetics.getConfig().addDefault("Gadgets." + gadgetType.getConfigName() + ".Show-Description", true, "if true, the description of gadget will be showed.");
ultraCosmetics.getConfig().addDefault("Gadgets." + gadgetType.getConfigName() + ".Can-Be-Found-In-Treasure-Chests", true, "if true, it'll be possible to find", "it in treasure chests");
if (gadgetType == GadgetType.PAINTBALLGUN) {
if (gadgetType == GadgetType.valueOf("paintballgun")) {
ultraCosmetics.getConfig().addDefault("Gadgets." + gadgetType.getConfigName() + ".Block-Type", "STAINED_CLAY", "With what block will it paint?");
ultraCosmetics.getConfig().addDefault("Gadgets." + gadgetType.getConfigName() + ".Particle.Enabled", false, "Should it display particles?");
ultraCosmetics.getConfig().addDefault("Gadgets." + gadgetType.getConfigName() + ".Particle.Effect", "FIREWORKS_SPARK", "what particles? (List: http://pastebin.com/CVKkufck)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import be.isach.ultracosmetics.UltraCosmetics;
import be.isach.ultracosmetics.command.SubCommand;
import be.isach.ultracosmetics.cosmetics.suits.ArmorSlot;
import be.isach.ultracosmetics.player.UltraPlayer;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
Expand Down Expand Up @@ -57,12 +58,13 @@ private void common(CommandSender sender, String... args) {
else if (s.startsWith("pa")) up.removeParticleEffect();
else if (s.startsWith("pe")) up.removePet();
else if (s.startsWith("h")) up.removeHat();
else if (s.startsWith("s")) up.removeSuit();
else if (s.startsWith("s") && !s.contains(":")) up.removeSuit();
else if (s.startsWith("s") && s.contains(":")) up.removeSuit(ArmorSlot.getByName(s.split(":")[1]));
else if (s.startsWith("mor")) up.removeMorph();
else if (s.startsWith("mou")) up.removeMount();
else if (s.startsWith("e")) up.removeEmote();
else {
sender.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "/uc menu <menu>\n" + ChatColor.RED + "" + ChatColor.BOLD + "Invalid Type.\n" + ChatColor.RED + "" + ChatColor.BOLD + "Available types: gadgets, particleeffects, pets, mounts, suits, hats, morphs");
sender.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "/uc clear <player> <type>\n" + ChatColor.RED + "" + ChatColor.BOLD + "Invalid Type.\n" + ChatColor.RED + "" + ChatColor.BOLD + "Available types: gadgets, particleeffects, pets, mounts, suits, hats, morphs");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ protected void onExePlayer(Player sender, String... args) {
return;
}
}
Object[] cosmeticTypes = category.getEnabled().stream().filter(cosmeticType -> cosmeticType.isEnabled() && cosmeticType.toString().toLowerCase().contains(cosm)).toArray();
Object[] cosmeticTypes = category.getEnabled().stream().filter(cosmeticType -> cosmeticType.isEnabled() && cosmeticType.toString().toLowerCase().contains(cosm.split(":")[0])).toArray();
if (cosmeticTypes.length == 1) {
CosmeticType cosmeticType = (CosmeticType) cosmeticTypes[0];
if (args.length > 3) {
try {
UltraPlayer other = getUltraCosmetics().getPlayerManager().getUltraPlayer(Bukkit.getPlayer(args[3]));
if (cosmeticType.getCategory() == Category.SUITS) {
try {
ArmorSlot armorSlot = ArmorSlot.getByName(args[2].split(":")[1]);
SuitType suitType = SuitType.valueOf(args[2].split(":")[0]);
ArmorSlot armorSlot = ArmorSlot.getByName(cosm.split(":")[1]);
SuitType suitType = SuitType.valueOf(cosm.split(":")[0]);
suitType.equip(other, getUltraCosmetics(), armorSlot);
} catch (Exception ex) {
sender.sendMessage(MessageManager.getMessage("Prefix") + " §c§l/uc toggle suit <suit type:suit piece> <player>.");
Expand Down Expand Up @@ -148,8 +148,7 @@ protected void onExeConsole(ConsoleCommandSender sender, String... args) {
if (!UltraCosmeticsData.get().getEnabledWorlds().contains(Bukkit.getPlayer(args[3]).getWorld().getName())) {
sender.sendMessage(MessageManager.getMessage("World-Disabled"));
return;
}
} catch (Exception e) {
} } catch (Exception e) {
sender.sendMessage(MessageManager.getMessage("Prefix") + " §c§lInvalid player.");
return;
}
Expand All @@ -174,7 +173,7 @@ protected void onExeConsole(ConsoleCommandSender sender, String... args) {
sender.sendMessage(MessageManager.getMessage("Prefix") + " §c§lInvalid player.");
return;
}
Object[] cosmeticTypes = category.getEnabled().stream().filter(cosmeticType -> cosmeticType.isEnabled() && cosmeticType.toString().toLowerCase().startsWith(cosm)).toArray();
Object[] cosmeticTypes = category.getEnabled().stream().filter(cosmeticType -> cosmeticType.isEnabled() && cosmeticType.toString().toLowerCase().startsWith(cosm.split(":")[0])).toArray();
if (cosmeticTypes.length == 1) {
CosmeticType cosmeticType = (CosmeticType) cosmeticTypes[0];
try {
Expand All @@ -200,4 +199,4 @@ protected void onExeConsole(ConsoleCommandSender sender, String... args) {
sender.sendMessage(MessageManager.getMessage("Prefix") + " §c§lInvalid category.");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,20 @@ private void loadMessages() {
addMessage("Pets.ChristmasElf.entity-displayname", "&l%playername%'s Christmas elf");
addMessage("Pets.Mooshroom.menu-name", "&4&lMooshroom");
addMessage("Pets.Mooshroom.entity-displayname", "&l%playername%'s Mooshroom");
addMessage("Pets.IronGolem.menu-name", "&7&lIronGolem");
addMessage("Pets.IronGolem.entity-displayname", "&l%playername%'s IronGolem");
addMessage("Pets.Snowman.menu-name", "&f&lSnowman");
addMessage("Pets.Snowman.entity-displayname", "&l%playername%'s Snowman");
addMessage("Pets.Villager.menu-name", "&a&lVillager");
addMessage("Pets.Villager.entity-displayname", "&l%playername%'s Villager");
addMessage("Pets.Bat.menu-name", "&8&lBat");
addMessage("Pets.Bat.entity-displayname", "&l%playername%'s Bat");
addMessage("Pets.PolarBear.menu-name", "&b&lPolarBear");
addMessage("Pets.PolarBear.entity-displayname", "&l%playername%'s PolarBear");
addMessage("Pets.Llama.menu-name", "&7&lLlama");
addMessage("Pets.Llama.entity-displayname", "&l%playername%'s Llama");
addMessage("Pets.Parrot.menu-name", "&a&lParrot");
addMessage("Pets.Parrot.entity-displayname", "&l%playername%'s Parrot");
addMessage("Pets.Spawn", "%prefix% &9You spawned %petname%");
addMessage("Pets.Despawn", "%prefix% &9You despawned %petname%");

Expand Down Expand Up @@ -300,6 +314,54 @@ private void loadMessages() {
addMessage("Hats.Present.Name", "&c&lPresent");
addMessage("Hats.Elf.Name", "&a&lElf");
addMessage("Hats.Bedrock.Name", "&8&lBedrock");
addMessage("Hats.Bread.Name", "&f&lBread");
addMessage("Hats.Cheese.Name", "&e&lCheese");
addMessage("Hats.Pancakes.Name", "&f&lPancakes");
addMessage("Hats.Cake.Name", "&c&lCake");
addMessage("Hats.Cookie.Name", "&6&lCookie");
addMessage("Hats.CandyCane.Name", "&c&lCandy &f&lCane");
addMessage("Hats.Chocolate.Name", "&a&lChocolate");
addMessage("Hats.WhiteChocolate.Name", "&f&lWhite Chocolate");
addMessage("Hats.Apple.Name", "&4&lApple");
addMessage("Hats.Melon.Name", "&a&lMelon");
addMessage("Hats.CarvedPumpkin.Name", "&6&lCarved Pumpkin");
addMessage("Hats.Strawberry.Name", "&c&lStrawberry");
addMessage("Hats.Coconut.Name", "&f&lCoconut");
addMessage("Hats.Taco.Name", "&e&lTaco");
addMessage("Hats.Bacon.Name", "&f&lBacon");
addMessage("Hats.Fries.Name", "&6&lFries");
addMessage("Hats.Hamburger.Name", "&6&lHamburger");
addMessage("Hats.Popcorn.Name", "&6&lPopcorn");
addMessage("Hats.WhiteDonut.Name", "&f&lWhite Donut");
addMessage("Hats.PinkDonut.Name", "&d&lPink Donut");
addMessage("Hats.ChocolateDonut.Name", "&a&lChocolate Donut");
addMessage("Hats.Pie.Name", "&4&lPie");
addMessage("Hats.A.Name", "&6&lA");
addMessage("Hats.B.Name", "&4&lB");
addMessage("Hats.C.Name", "&2&lC");
addMessage("Hats.D.Name", "&b&lD");
addMessage("Hats.E.Name", "&e&lE");
addMessage("Hats.F.Name", "&5&lF");
addMessage("Hats.G.Name", "&d&lG");
addMessage("Hats.H.Name", "&a&lH");
addMessage("Hats.I.Name", "&6&lI");
addMessage("Hats.J.Name", "&4&lJ");
addMessage("Hats.K.Name", "&2&lK");
addMessage("Hats.L.Name", "&b&lL");
addMessage("Hats.M.Name", "&e&lM");
addMessage("Hats.N.Name", "&5&lN");
addMessage("Hats.O.Name", "&d&lO");
addMessage("Hats.P.Name", "&a&lP");
addMessage("Hats.Q.Name", "&6&lQ");
addMessage("Hats.R.Name", "&4&lR");
addMessage("Hats.S.Name", "&2&lS");
addMessage("Hats.T.Name", "&b&lT");
addMessage("Hats.U.Name", "&e&lU");
addMessage("Hats.V.Name", "&5&lV");
addMessage("Hats.W.Name", "&d&lW");
addMessage("Hats.X.Name", "&a&lX");
addMessage("Hats.Y.Name", "&6&lY");
addMessage("Hats.Z.Name", "&4&lZ");
addMessage("Hats.Must-Remove-Hat", "%prefix% &c&lYou must remove your helmet to equip a hat!");

//SUITS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import be.isach.ultracosmetics.cosmetics.type.MountType;
import be.isach.ultracosmetics.cosmetics.type.ParticleEffectType;
import be.isach.ultracosmetics.cosmetics.type.PetType;
import be.isach.ultracosmetics.cosmetics.type.SuitType;
import be.isach.ultracosmetics.menu.CosmeticMenu;
import be.isach.ultracosmetics.util.ItemFactory;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -106,7 +107,7 @@ public CosmeticMenu getMenu(UltraCosmetics ultraCosmetics) {

@Override
public List<? extends CosmeticType> getEnabled() {
return EmoteType.enabled();
return SuitType.enabled();
}
},
EMOTES("Emotes", "Equip", "Unequip", "Clear-Emote", "%emotename%", "Equip", "Unequip") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class GadgetAntiGravity extends Gadget {
private boolean running;

public GadgetAntiGravity(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.ANTIGRAVITY, ultraCosmetics);
super(owner, GadgetType.valueOf("antigravity"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class GadgetBatBlaster extends Gadget {
private List<Bat> bats;

public GadgetBatBlaster(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.BATBLASTER, ultraCosmetics);
super(owner, GadgetType.valueOf("batblaster"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class GadgetBlackHole extends Gadget {
private Item item;

public GadgetBlackHole(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.BLACKHOLE, ultraCosmetics);
super(owner, GadgetType.valueOf("blackhole"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class GadgetBlizzardBlaster extends Gadget {
private Vector vector;

public GadgetBlizzardBlaster(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.BLIZZARDBLASTER, ultraCosmetics);
super(owner, GadgetType.valueOf("blizzardblaster"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class GadgetChickenator extends Gadget {
private List<Item> items = new ArrayList<>();

public GadgetChickenator(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.CHICKENATOR, ultraCosmetics);
super(owner, GadgetType.valueOf("chickenator"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class GadgetChristmasTree extends Gadget {
private static final Color LOG_COLOR = Color.fromRGB(101, 67, 33);

public GadgetChristmasTree(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.CHRISTMASTREE, ultraCosmetics);
super(owner, GadgetType.valueOf("christmastree"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class GadgetColorBomb extends Gadget {
private boolean running = false;

public GadgetColorBomb(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.COLORBOMB, ultraCosmetics);
super(owner, GadgetType.valueOf("colorbomb"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class GadgetDiscoBall extends Gadget {
private boolean running = false;

public GadgetDiscoBall(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.DISCOBALL, ultraCosmetics);
super(owner, GadgetType.valueOf("discoball"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class GadgetEtherealPearl extends Gadget implements Listener {
private EnderPearl pearl;

public GadgetEtherealPearl(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.ETHEREALPEARL, ultraCosmetics);
super(owner, GadgetType.valueOf("etherealpearl"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class GadgetExplosiveSheep extends Gadget {
private ArrayList<Sheep> sheepArrayList = new ArrayList<>();

public GadgetExplosiveSheep(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.EXPLOSIVESHEEP, ultraCosmetics);
super(owner, GadgetType.valueOf("explosivesheep"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class GadgetFirework extends Gadget {
private static Random random = new Random();

public GadgetFirework(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.FIREWORK, ultraCosmetics);
super(owner, GadgetType.valueOf("firework"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class GadgetFleshHook extends Gadget implements Listener {
private ArrayList<Item> items = new ArrayList<>();

public GadgetFleshHook(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.FLESHHOOK, ultraCosmetics);
super(owner, GadgetType.valueOf("fleshhook"), ultraCosmetics);
}

@EventHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class GadgetFreezeCannon extends Gadget {
private List<Item> queue;

public GadgetFreezeCannon(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.FREEZECANNON, ultraCosmetics);
super(owner, GadgetType.valueOf("freezecannon"), ultraCosmetics);
if (owner == null) return;
items = new ArrayList<>();
queue = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class GadgetFunGun extends Gadget {
private List<Projectile> projectiles = new ArrayList<>();

public GadgetFunGun(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.FUNGUN, ultraCosmetics);
super(owner, GadgetType.valueOf("fungun"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class GadgetGhostParty extends Gadget {
Map<Bat, ArmorStand> bats = new HashMap<>();

public GadgetGhostParty(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.GHOSTPARTY, ultraCosmetics);
super(owner, GadgetType.valueOf("ghostparty"), ultraCosmetics);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class GadgetMelonThrower extends Gadget implements Listener {
private World world = null;

public GadgetMelonThrower(UltraPlayer owner, UltraCosmetics ultraCosmetics) {
super(owner, GadgetType.MELONTHROWER, ultraCosmetics);
super(owner, GadgetType.valueOf("melonthrower"), ultraCosmetics);
}

@EventHandler
Expand Down
Loading

0 comments on commit 4338445

Please sign in to comment.