diff --git a/src/main/java/games/bevs/minecraftbut/gui/SenerarioMenu.java b/src/main/java/games/bevs/minecraftbut/gui/SenerarioMenu.java index 1396092..59ff021 100644 --- a/src/main/java/games/bevs/minecraftbut/gui/SenerarioMenu.java +++ b/src/main/java/games/bevs/minecraftbut/gui/SenerarioMenu.java @@ -46,7 +46,9 @@ protected void drawSenerario(int slot, Senerario senerario) .displayName(CC.b + (senerario.isEnabled() ? CC.green : CC.red) + senerario.getName()) .lore(senerario.getDescription()) .addLore(CC.gray + "Id: " + senerario.getId()) - .addLore(CC.gray + "Click to " + (senerario.isEnabled() ? "disable" : "enable")), + .addLore(CC.gray + "Click to " + (senerario.isEnabled() ? "disable" : "enable")) + .addLore("") + .addLore(CC.green + "Credit: " + senerario.getCredit()), (player) -> { if(senerario.isEnabled()) { diff --git a/src/main/java/games/bevs/minecraftbut/senerario/Senerario.java b/src/main/java/games/bevs/minecraftbut/senerario/Senerario.java index 86179a5..ec3dcab 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/Senerario.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/Senerario.java @@ -30,6 +30,7 @@ public class Senerario implements Listener private @NonNull ButWorld butWorld; private @NonNull Material icon; private @NonNull String[] description; + private @NonNull String credit; private boolean enabled = false; private ArrayList runnableIds = new ArrayList<>(); @@ -39,6 +40,11 @@ public void repeat(Runnable run, long sprints) this.runnableIds.add(id); } + public void delay(Runnable run, long sprints) + { + Bukkit.getScheduler().scheduleSyncDelayedTask(MinecraftButPlugin.getPlugin(), run, sprints); + } + public void start() { if(this.enabled) return; diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/AnvilRain.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/AnvilRain.java index 6d025c8..ed23269 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/AnvilRain.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/AnvilRain.java @@ -25,7 +25,7 @@ public class AnvilRain extends Senerario { public AnvilRain(ButWorld butWorld) { super("Anvil Rain", butWorld, XMaterial.ANVIL.parseMaterial(), - new String[] { "Anvils will spawn from the sky every minute" }); + new String[] { "Anvils will spawn from the sky every minute" }, "BadBoyHalo"); } @Override diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/BedRockTrail.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/BedRockTrail.java index 7383111..e64c94f 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/BedRockTrail.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/BedRockTrail.java @@ -27,7 +27,7 @@ public class BedRockTrail extends Senerario private double bedrockCheckSpeed = 0.2; public BedRockTrail(ButWorld butWorld) { - super("Bedrock Trail", butWorld, Material.BEDROCK, new String[] {"Where ever you move, you leave a bedrock trail"}); + super("Bedrock Trail", butWorld, Material.BEDROCK, new String[] {"Where ever you move, you leave a bedrock trail"}, "WilburSoot"); } diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/BlockPotions.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/BlockPotions.java index fb16bd4..9d64940 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/BlockPotions.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/BlockPotions.java @@ -28,7 +28,7 @@ public class BlockPotions extends Senerario public BlockPotions(ButWorld butWorld) { - super("Block Potion", butWorld, XMaterial.POTION.parseMaterial(), new String[] {"Blocks with potion effects"}); + super("Block Potion", butWorld, XMaterial.POTION.parseMaterial(), new String[] {"Blocks with potion effects"}, "BajanCandian"); } @Override diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/EnderDragonAppears.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/EnderDragonAppears.java index 8124206..9389fe0 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/EnderDragonAppears.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/EnderDragonAppears.java @@ -16,7 +16,7 @@ public class EnderDragonAppears extends Senerario private int heightY = 140; public EnderDragonAppears(ButWorld butWorld) { - super("An Enderdragon appears", butWorld, Material.DRAGON_EGG, new String[]{ "Every 3 minutes (Or the amount of time you set) an ender dragon will spawn" }); + super("An Enderdragon appears", butWorld, Material.DRAGON_EGG, new String[]{ "Every 3 minutes (Or the amount of time you set) an ender dragon will spawn" }, "Sprock"); } diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/FasterAndFaster.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/FasterAndFaster.java index 0bf576b..9c92606 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/FasterAndFaster.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/FasterAndFaster.java @@ -23,7 +23,7 @@ public class FasterAndFaster extends Senerario public FasterAndFaster(ButWorld butWorld) { - super("Everyones Speed increases", butWorld, Material.LEATHER_BOOTS, new String[] { "Every minute your speed gets faster" }); + super("Everyones Speed increases", butWorld, Material.LEATHER_BOOTS, new String[] { "Every minute your speed gets faster" }, "Dream"); } diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/LinkedDeaths.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/LinkedDeaths.java index c21554b..0cc8041 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/LinkedDeaths.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/LinkedDeaths.java @@ -21,7 +21,7 @@ public class LinkedDeaths extends Senerario public LinkedDeaths(ButWorld butWorld) { - super("Linked Deaths", butWorld, Material.FISHING_ROD, new String[] {"One player dies, everyone dies"}); + super("Linked Deaths", butWorld, Material.FISHING_ROD, new String[] {"One player dies, everyone dies"}, "CallMeCarson"); } diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/LinkedHealth.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/LinkedHealth.java index 821f0e4..d55228e 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/LinkedHealth.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/LinkedHealth.java @@ -23,7 +23,7 @@ public class LinkedHealth extends Senerario public LinkedHealth(ButWorld butWorld) { - super("Linked Health", butWorld, Material.APPLE, new String[] {"All players share health"}); + super("Linked Health", butWorld, Material.APPLE, new String[] {"All players share health"}, "BadBoyHalo"); } diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/MaducerWorld.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/MaducerWorld.java index 32a6185..be3b36a 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/MaducerWorld.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/MaducerWorld.java @@ -24,7 +24,7 @@ public class MaducerWorld extends Senerario public MaducerWorld(ButWorld butWorld) { - super("Maducer World", butWorld, Material.BRICK, new String[] {"The world slowly turns to bedrock"}); + super("Maducer World", butWorld, Material.BRICK, new String[] {"The world slowly turns to bedrock"}, "Dream"); } diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/NoJump.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/NoJump.java index 05e7b6c..f492b1b 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/NoJump.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/NoJump.java @@ -16,7 +16,7 @@ public class NoJump extends Senerario { public NoJump(ButWorld butWorld) { - super("No Jump", butWorld, Material.RABBIT_FOOT, new String[] {"Jumping is disabled"}); + super("No Jump", butWorld, Material.RABBIT_FOOT, new String[] {"Jumping is disabled"}, "Sprock"); } private void applyNoJump(Player player) diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/OneHit.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/OneHit.java index 2cf7bea..2f3e742 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/OneHit.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/OneHit.java @@ -14,7 +14,7 @@ public class OneHit extends Senerario { public OneHit(ButWorld butWorld) { - super("One Hit", butWorld, Material.BONE, new String[] {"You are given only one heart"}); + super("One Hit", butWorld, Material.BONE, new String[] {"You are given only one heart"}, "Sprock"); } private void applyOneHit(Player player) diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/RainingBlocks.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/RainingBlocks.java index ca30082..630c846 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/RainingBlocks.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/RainingBlocks.java @@ -16,7 +16,7 @@ public class RainingBlocks extends Senerario public RainingBlocks(ButWorld butWorld) { - super("Raining Blocks", butWorld, XMaterial.COMMAND_BLOCK.parseMaterial(), new String[] {"Random blocks will fall from the sky"} ); + super("Raining Blocks", butWorld, XMaterial.COMMAND_BLOCK.parseMaterial(), new String[] {"Random blocks will fall from the sky"}, "Sprock"); } @SuppressWarnings("deprecation") diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TNTOnSelf.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TNTOnSelf.java index a903b66..78f1541 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TNTOnSelf.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TNTOnSelf.java @@ -27,7 +27,7 @@ public class TNTOnSelf extends Senerario public TNTOnSelf(ButWorld butWorld) { - super("TNT On Self", butWorld, Material.TNT, new String[] {"TNT will spawn on you every minute"}); + super("TNT On Self", butWorld, Material.TNT, new String[] {"TNT will spawn on you every minute"}, "WilburSoot"); } diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TNTRain.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TNTRain.java index 599541b..0a938d3 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TNTRain.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TNTRain.java @@ -14,7 +14,7 @@ public class TNTRain extends Senerario private int hieghtY = 140; public TNTRain(ButWorld butWorld) { - super("TNT Rain", butWorld, XMaterial.TNT.parseMaterial(), new String[] {"TNT will rain from the sky continusly"}); + super("TNT Rain", butWorld, XMaterial.TNT.parseMaterial(), new String[] {"TNT will rain from the sky continusly"}, "WilburSoot"); } @Override diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TheLavaRises.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TheLavaRises.java index 8dec885..6e3dfa7 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TheLavaRises.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TheLavaRises.java @@ -26,7 +26,7 @@ public class TheLavaRises extends Senerario public TheLavaRises(ButWorld butWorld) { - super("The Lava is rising", butWorld, Material.LAVA_BUCKET, new String[] {"Every minute (or the amount of time you set) the lava level will riase"}); + super("The Lava is rising", butWorld, Material.LAVA_BUCKET, new String[] {"Every minute (or the amount of time you set) the lava level will riase"}, "WilburSoot"); } diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TheWaterRises.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TheWaterRises.java index cfe0093..459166b 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TheWaterRises.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/TheWaterRises.java @@ -27,7 +27,7 @@ public class TheWaterRises extends Senerario public TheWaterRises(ButWorld butWorld) { - super("The Water is rising", butWorld, Material.WATER_BUCKET, new String[] { "Every minute (or amount of time you set) the water level will raise" }); + super("The Water is rising", butWorld, Material.WATER_BUCKET, new String[] { "Every minute (or amount of time you set) the water level will raise" }, "WilburSoot"); } diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/WorldDecay.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/WorldDecay.java index fa9bb73..f3c5442 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/WorldDecay.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/WorldDecay.java @@ -24,7 +24,7 @@ public class WorldDecay extends Senerario public WorldDecay(ButWorld butWorld) { - super("World Decay", butWorld, Material.BRICK, new String[] {"Every block the sun touches slowly breaks down"}); + super("World Decay", butWorld, Material.BRICK, new String[] {"Every block the sun touches slowly breaks down"}, "WilburSoot"); } diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/deathout/DeathOut.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/deathout/DeathOut.java index 1571cb0..06eb0af 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/deathout/DeathOut.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/deathout/DeathOut.java @@ -20,7 +20,7 @@ public class DeathOut extends Senerario public DeathOut(ButWorld butWorld) { - super("Death Out", butWorld, XMaterial.CACTUS.parseMaterial(), new String[] {"You're out if you die"} ); + super("Death Out", butWorld, XMaterial.CACTUS.parseMaterial(), new String[] {"You're out if you die"}, "Skeppy" ); } @Override diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/gemeater/GemEater.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/gemeater/GemEater.java index d0c4498..02c55e0 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/gemeater/GemEater.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/gemeater/GemEater.java @@ -31,7 +31,7 @@ public class GemEater extends Senerario public GemEater(ButWorld butWorld) { - super("Gem Eater", butWorld, Material.IRON_INGOT, new String[] {"You can only eat ores", "coal, iron, gold, diamond, redstone, lapis"}); + super("Gem Eater", butWorld, Material.IRON_INGOT, new String[] {"You can only eat ores", "coal, iron, gold, diamond, redstone, lapis"}, "WilburSoot"); this.gemManager = new GemManager(); diff --git a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/linkedinvs/LinkedInventories.java b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/linkedinvs/LinkedInventories.java index aab023d..53ac160 100644 --- a/src/main/java/games/bevs/minecraftbut/senerario/senerarios/linkedinvs/LinkedInventories.java +++ b/src/main/java/games/bevs/minecraftbut/senerario/senerarios/linkedinvs/LinkedInventories.java @@ -6,6 +6,7 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryEvent; import org.bukkit.event.player.PlayerInventoryEvent; import org.bukkit.event.player.PlayerJoinEvent; @@ -23,7 +24,7 @@ public class LinkedInventories extends Senerario { public LinkedInventories(ButWorld butWorld) { - super("Linked Inventories", butWorld, Material.CHEST, new String[] {"All players share Inventories"}); + super("Linked Inventories", butWorld, Material.CHEST, new String[] {"All players share Inventories"}, "GeorgeNotFound"); } @@ -40,14 +41,16 @@ public void onFinish() } @EventHandler - public void onInventory(PlayerInventoryEvent e) + public void onInventory(InventoryClickEvent e) { - Player player = e.getPlayer(); - for(Player onlinePlayer : Bukkit.getOnlinePlayers()) - { - if(player == onlinePlayer) continue; - onlinePlayer.getInventory().setArmorContents(player.getInventory().getArmorContents()); - onlinePlayer.getInventory().setContents(player.getInventory().getContents()); - } + Player player = (Player) e.getWhoClicked(); + this.delay(() -> { + for(Player onlinePlayer : Bukkit.getOnlinePlayers()) + { + if(player == onlinePlayer) continue; + onlinePlayer.getInventory().setArmorContents(player.getInventory().getArmorContents()); + onlinePlayer.getInventory().setContents(player.getInventory().getContents()); + } + }, 1l); } }