-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
530 additions
and
485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
src/main/java/eu/billyinc/mineralcontest/command/TeamCommandExecutor.java
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
src/main/java/eu/billyinc/mineralcontest/listener/BlockListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package eu.billyinc.mineralcontest.listener; | ||
|
||
import org.bukkit.block.Chest; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.block.BlockBreakEvent; | ||
|
||
import eu.billyinc.mineralcontest.manager.MineralContestManager; | ||
import eu.billyinc.mineralcontest.model.MineralContestChest; | ||
|
||
public class BlockListener implements Listener { | ||
|
||
@EventHandler | ||
public void onBreakChest(BlockBreakEvent e) { | ||
if (e.getBlock().getState() instanceof Chest) { | ||
Chest chest = (Chest) e.getBlock().getState(); | ||
if(MineralContestManager.getMineralContestChestManager().getMineralContestChestByChest(chest) instanceof MineralContestChest) { | ||
MineralContestManager.getMineralContestChestManager().removeMineralContestChest(chest); | ||
} | ||
} | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/eu/billyinc/mineralcontest/listener/EntityListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package eu.billyinc.mineralcontest.listener; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.entity.EntityDamageEvent; | ||
|
||
import eu.billyinc.mineralcontest.manager.MineralContestManager; | ||
import eu.billyinc.mineralcontest.model.MineralContestPlayer; | ||
|
||
public class EntityListener implements Listener { | ||
|
||
@EventHandler | ||
public void onPlayerDamaged(EntityDamageEvent e) { | ||
if (e.getEntity() instanceof Player) { | ||
Player player = (Player) e.getEntity(); | ||
MineralContestPlayer mineralContestPlayer = MineralContestManager.getMineralContestPlayerManager().getMineralContestPlayerByUUID(player.getUniqueId()); | ||
|
||
player.closeInventory(); | ||
mineralContestPlayer.removeAllTasks(); | ||
} | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/eu/billyinc/mineralcontest/listener/FurnaceListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package eu.billyinc.mineralcontest.listener; | ||
|
||
import org.bukkit.Material; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.inventory.FurnaceSmeltEvent; | ||
|
||
import eu.billyinc.mineralcontest.GameState; | ||
import eu.billyinc.mineralcontest.manager.MineralContestManager; | ||
|
||
public class FurnaceListener implements Listener { | ||
|
||
@EventHandler | ||
public void onFurnaceBurn(FurnaceSmeltEvent e) { | ||
if (MineralContestManager.getApp().getGameState() == GameState.PLAYING) { | ||
if ( | ||
e.getSource().getType().equals(Material.IRON_SWORD) || | ||
e.getSource().getType().equals(Material.IRON_HELMET) || | ||
e.getSource().getType().equals(Material.IRON_BOOTS) || | ||
e.getSource().getType().equals(Material.IRON_LEGGINGS) || | ||
e.getSource().getType().equals(Material.IRON_CHESTPLATE) | ||
) { | ||
e.setCancelled(true); | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.