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
public class Events implements Listener { | |
HashMap<String, Long> cooldownJump = new HashMap<String, Long>(); | |
HashMap<String, Long> cooldownSponge = new HashMap<String, Long>(); | |
public JMod plugin; | |
public Events(JMod instance) { | |
plugin = instance; | |
} |
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
public void chainHat() { | |
ShapedRecipe chainHat = new ShapedRecipe(new ItemStack(Material.CHAINMAIL_HELMET)); | |
chainHat.shape("ISI", | |
"SXS", | |
"XXX"); | |
chainHat.setIngredient('I', Material.IRON_INGOT); | |
chainHat.setIngredient('S', Material.STRING); | |
chainHat.setIngredient('X', Material.AIR); | |
Util.logger("Loaded recipe for: Chainmail Helmet"); | |
} |
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.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() { | |
@Override | |
public void run() { | |
checkForIron(); | |
} | |
}, 20L, 20L); | |
public void checkForIron() { | |
for (Player p : getServer().getOnlinePlayers()) { | |
if (ArmourAbilities.hasIron(p)) { //Checks if player is wearing full set of iron |
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
messageStaff("Message"); | |
public void messageStaff(String message) { | |
for (Player p : getServer().getOnlinePlayers()) { | |
if (p.hasPermission("your.permission")) { | |
p.sendMessage(message); |
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
@EventHandler | |
public void onBlockBreak(BlockBreakEvent event) { | |
Block block = event.getBlock(); | |
Player player = event.getPlayer(); | |
if (block.getType() == Material.DIAMOND_ORE) { | |
player.sendMessage("I can has diamonds!"); | |
} | |
} |
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
/msg $player $shit = >>> | |
msg('[me -> ' pinfo($player, 0), '] ' $) | |
tmsg($player, '[me <- ' pinfo($player, 0), '] ' $) | |
<<< |
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 set of commands, /msg, /r, and /cmsg replaces the built in message system | |
#and allows for colored messages by mods, so they are more prominent | |
mods:/cmsg $player [$] = >>> | |
tmsg($player, concat('[', color(red), player(), color(white), '->Me] ', color(green), $)) | |
msg(concat('[', color(red), 'Me', color(white), '->', pinfo($player, 0), '] ', color(green), $)) | |
store_value(concat('last_message_', pinfo($player, 0)), player()) | |
<<< | |
all:/msg $player [$] = >>> | |
try( |
NewerOlder