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

Commit

Permalink
credits
Browse files Browse the repository at this point in the history
  • Loading branch information
HeathLoganCampbell committed Nov 19, 2019
1 parent 0650ae0 commit e5726fa
Show file tree
Hide file tree
Showing 21 changed files with 39 additions and 28 deletions.
4 changes: 3 additions & 1 deletion src/main/java/games/bevs/minecraftbut/gui/SenerarioMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Integer> runnableIds = new ArrayList<>();

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
}


Expand All @@ -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);
}
}

0 comments on commit e5726fa

Please sign in to comment.