Skip to content
This repository was archived by the owner on Jul 16, 2021. It is now read-only.

Commit e5726fa

Browse files
credits
1 parent 0650ae0 commit e5726fa

21 files changed

+39
-28
lines changed

src/main/java/games/bevs/minecraftbut/gui/SenerarioMenu.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ protected void drawSenerario(int slot, Senerario senerario)
4646
.displayName(CC.b + (senerario.isEnabled() ? CC.green : CC.red) + senerario.getName())
4747
.lore(senerario.getDescription())
4848
.addLore(CC.gray + "Id: " + senerario.getId())
49-
.addLore(CC.gray + "Click to " + (senerario.isEnabled() ? "disable" : "enable")),
49+
.addLore(CC.gray + "Click to " + (senerario.isEnabled() ? "disable" : "enable"))
50+
.addLore("")
51+
.addLore(CC.green + "Credit: " + senerario.getCredit()),
5052
(player) -> {
5153
if(senerario.isEnabled())
5254
{

src/main/java/games/bevs/minecraftbut/senerario/Senerario.java

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class Senerario implements Listener
3030
private @NonNull ButWorld butWorld;
3131
private @NonNull Material icon;
3232
private @NonNull String[] description;
33+
private @NonNull String credit;
3334
private boolean enabled = false;
3435
private ArrayList<Integer> runnableIds = new ArrayList<>();
3536

@@ -39,6 +40,11 @@ public void repeat(Runnable run, long sprints)
3940
this.runnableIds.add(id);
4041
}
4142

43+
public void delay(Runnable run, long sprints)
44+
{
45+
Bukkit.getScheduler().scheduleSyncDelayedTask(MinecraftButPlugin.getPlugin(), run, sprints);
46+
}
47+
4248
public void start()
4349
{
4450
if(this.enabled) return;

src/main/java/games/bevs/minecraftbut/senerario/senerarios/AnvilRain.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class AnvilRain extends Senerario {
2525

2626
public AnvilRain(ButWorld butWorld) {
2727
super("Anvil Rain", butWorld, XMaterial.ANVIL.parseMaterial(),
28-
new String[] { "Anvils will spawn from the sky every minute" });
28+
new String[] { "Anvils will spawn from the sky every minute" }, "BadBoyHalo");
2929
}
3030

3131
@Override

src/main/java/games/bevs/minecraftbut/senerario/senerarios/BedRockTrail.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class BedRockTrail extends Senerario
2727
private double bedrockCheckSpeed = 0.2;
2828
public BedRockTrail(ButWorld butWorld)
2929
{
30-
super("Bedrock Trail", butWorld, Material.BEDROCK, new String[] {"Where ever you move, you leave a bedrock trail"});
30+
super("Bedrock Trail", butWorld, Material.BEDROCK, new String[] {"Where ever you move, you leave a bedrock trail"}, "WilburSoot");
3131
}
3232

3333

src/main/java/games/bevs/minecraftbut/senerario/senerarios/BlockPotions.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class BlockPotions extends Senerario
2828

2929
public BlockPotions(ButWorld butWorld)
3030
{
31-
super("Block Potion", butWorld, XMaterial.POTION.parseMaterial(), new String[] {"Blocks with potion effects"});
31+
super("Block Potion", butWorld, XMaterial.POTION.parseMaterial(), new String[] {"Blocks with potion effects"}, "BajanCandian");
3232
}
3333

3434
@Override

src/main/java/games/bevs/minecraftbut/senerario/senerarios/EnderDragonAppears.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class EnderDragonAppears extends Senerario
1616
private int heightY = 140;
1717
public EnderDragonAppears(ButWorld butWorld)
1818
{
19-
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" });
19+
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");
2020
}
2121

2222

src/main/java/games/bevs/minecraftbut/senerario/senerarios/FasterAndFaster.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class FasterAndFaster extends Senerario
2323

2424
public FasterAndFaster(ButWorld butWorld)
2525
{
26-
super("Everyones Speed increases", butWorld, Material.LEATHER_BOOTS, new String[] { "Every minute your speed gets faster" });
26+
super("Everyones Speed increases", butWorld, Material.LEATHER_BOOTS, new String[] { "Every minute your speed gets faster" }, "Dream");
2727
}
2828

2929

src/main/java/games/bevs/minecraftbut/senerario/senerarios/LinkedDeaths.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class LinkedDeaths extends Senerario
2121

2222
public LinkedDeaths(ButWorld butWorld)
2323
{
24-
super("Linked Deaths", butWorld, Material.FISHING_ROD, new String[] {"One player dies, everyone dies"});
24+
super("Linked Deaths", butWorld, Material.FISHING_ROD, new String[] {"One player dies, everyone dies"}, "CallMeCarson");
2525
}
2626

2727

src/main/java/games/bevs/minecraftbut/senerario/senerarios/LinkedHealth.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class LinkedHealth extends Senerario
2323

2424
public LinkedHealth(ButWorld butWorld)
2525
{
26-
super("Linked Health", butWorld, Material.APPLE, new String[] {"All players share health"});
26+
super("Linked Health", butWorld, Material.APPLE, new String[] {"All players share health"}, "BadBoyHalo");
2727
}
2828

2929

src/main/java/games/bevs/minecraftbut/senerario/senerarios/MaducerWorld.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class MaducerWorld extends Senerario
2424

2525
public MaducerWorld(ButWorld butWorld)
2626
{
27-
super("Maducer World", butWorld, Material.BRICK, new String[] {"The world slowly turns to bedrock"});
27+
super("Maducer World", butWorld, Material.BRICK, new String[] {"The world slowly turns to bedrock"}, "Dream");
2828
}
2929

3030

src/main/java/games/bevs/minecraftbut/senerario/senerarios/NoJump.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class NoJump extends Senerario
1616
{
1717
public NoJump(ButWorld butWorld)
1818
{
19-
super("No Jump", butWorld, Material.RABBIT_FOOT, new String[] {"Jumping is disabled"});
19+
super("No Jump", butWorld, Material.RABBIT_FOOT, new String[] {"Jumping is disabled"}, "Sprock");
2020
}
2121

2222
private void applyNoJump(Player player)

src/main/java/games/bevs/minecraftbut/senerario/senerarios/OneHit.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class OneHit extends Senerario
1414
{
1515
public OneHit(ButWorld butWorld)
1616
{
17-
super("One Hit", butWorld, Material.BONE, new String[] {"You are given only one heart"});
17+
super("One Hit", butWorld, Material.BONE, new String[] {"You are given only one heart"}, "Sprock");
1818
}
1919

2020
private void applyOneHit(Player player)

src/main/java/games/bevs/minecraftbut/senerario/senerarios/RainingBlocks.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class RainingBlocks extends Senerario
1616

1717
public RainingBlocks(ButWorld butWorld)
1818
{
19-
super("Raining Blocks", butWorld, XMaterial.COMMAND_BLOCK.parseMaterial(), new String[] {"Random blocks will fall from the sky"} );
19+
super("Raining Blocks", butWorld, XMaterial.COMMAND_BLOCK.parseMaterial(), new String[] {"Random blocks will fall from the sky"}, "Sprock");
2020
}
2121

2222
@SuppressWarnings("deprecation")

src/main/java/games/bevs/minecraftbut/senerario/senerarios/TNTOnSelf.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class TNTOnSelf extends Senerario
2727

2828
public TNTOnSelf(ButWorld butWorld)
2929
{
30-
super("TNT On Self", butWorld, Material.TNT, new String[] {"TNT will spawn on you every minute"});
30+
super("TNT On Self", butWorld, Material.TNT, new String[] {"TNT will spawn on you every minute"}, "WilburSoot");
3131
}
3232

3333

src/main/java/games/bevs/minecraftbut/senerario/senerarios/TNTRain.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class TNTRain extends Senerario
1414
private int hieghtY = 140;
1515
public TNTRain(ButWorld butWorld)
1616
{
17-
super("TNT Rain", butWorld, XMaterial.TNT.parseMaterial(), new String[] {"TNT will rain from the sky continusly"});
17+
super("TNT Rain", butWorld, XMaterial.TNT.parseMaterial(), new String[] {"TNT will rain from the sky continusly"}, "WilburSoot");
1818
}
1919

2020
@Override

src/main/java/games/bevs/minecraftbut/senerario/senerarios/TheLavaRises.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class TheLavaRises extends Senerario
2626

2727
public TheLavaRises(ButWorld butWorld)
2828
{
29-
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"});
29+
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");
3030
}
3131

3232

src/main/java/games/bevs/minecraftbut/senerario/senerarios/TheWaterRises.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class TheWaterRises extends Senerario
2727

2828
public TheWaterRises(ButWorld butWorld)
2929
{
30-
super("The Water is rising", butWorld, Material.WATER_BUCKET, new String[] { "Every minute (or amount of time you set) the water level will raise" });
30+
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");
3131
}
3232

3333

src/main/java/games/bevs/minecraftbut/senerario/senerarios/WorldDecay.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class WorldDecay extends Senerario
2424

2525
public WorldDecay(ButWorld butWorld)
2626
{
27-
super("World Decay", butWorld, Material.BRICK, new String[] {"Every block the sun touches slowly breaks down"});
27+
super("World Decay", butWorld, Material.BRICK, new String[] {"Every block the sun touches slowly breaks down"}, "WilburSoot");
2828
}
2929

3030

src/main/java/games/bevs/minecraftbut/senerario/senerarios/deathout/DeathOut.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class DeathOut extends Senerario
2020

2121
public DeathOut(ButWorld butWorld)
2222
{
23-
super("Death Out", butWorld, XMaterial.CACTUS.parseMaterial(), new String[] {"You're out if you die"} );
23+
super("Death Out", butWorld, XMaterial.CACTUS.parseMaterial(), new String[] {"You're out if you die"}, "Skeppy" );
2424
}
2525

2626
@Override

src/main/java/games/bevs/minecraftbut/senerario/senerarios/gemeater/GemEater.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class GemEater extends Senerario
3131

3232
public GemEater(ButWorld butWorld)
3333
{
34-
super("Gem Eater", butWorld, Material.IRON_INGOT, new String[] {"You can only eat ores", "coal, iron, gold, diamond, redstone, lapis"});
34+
super("Gem Eater", butWorld, Material.IRON_INGOT, new String[] {"You can only eat ores", "coal, iron, gold, diamond, redstone, lapis"}, "WilburSoot");
3535

3636
this.gemManager = new GemManager();
3737

src/main/java/games/bevs/minecraftbut/senerario/senerarios/linkedinvs/LinkedInventories.java

+12-9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
77
import org.bukkit.entity.Player;
88
import org.bukkit.event.EventHandler;
9+
import org.bukkit.event.inventory.InventoryClickEvent;
910
import org.bukkit.event.inventory.InventoryEvent;
1011
import org.bukkit.event.player.PlayerInventoryEvent;
1112
import org.bukkit.event.player.PlayerJoinEvent;
@@ -23,7 +24,7 @@ public class LinkedInventories extends Senerario
2324
{
2425
public LinkedInventories(ButWorld butWorld)
2526
{
26-
super("Linked Inventories", butWorld, Material.CHEST, new String[] {"All players share Inventories"});
27+
super("Linked Inventories", butWorld, Material.CHEST, new String[] {"All players share Inventories"}, "GeorgeNotFound");
2728
}
2829

2930

@@ -40,14 +41,16 @@ public void onFinish()
4041
}
4142

4243
@EventHandler
43-
public void onInventory(PlayerInventoryEvent e)
44+
public void onInventory(InventoryClickEvent e)
4445
{
45-
Player player = e.getPlayer();
46-
for(Player onlinePlayer : Bukkit.getOnlinePlayers())
47-
{
48-
if(player == onlinePlayer) continue;
49-
onlinePlayer.getInventory().setArmorContents(player.getInventory().getArmorContents());
50-
onlinePlayer.getInventory().setContents(player.getInventory().getContents());
51-
}
46+
Player player = (Player) e.getWhoClicked();
47+
this.delay(() -> {
48+
for(Player onlinePlayer : Bukkit.getOnlinePlayers())
49+
{
50+
if(player == onlinePlayer) continue;
51+
onlinePlayer.getInventory().setArmorContents(player.getInventory().getArmorContents());
52+
onlinePlayer.getInventory().setContents(player.getInventory().getContents());
53+
}
54+
}, 1l);
5255
}
5356
}

0 commit comments

Comments
 (0)