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
case DENY: | |
switch (action) { | |
// Modified other slots | |
case MOVE_TO_OTHER_INVENTORY: | |
case HOTBAR_MOVE_AND_READD: | |
case HOTBAR_SWAP: | |
case COLLECT_TO_CURSOR: | |
case PLACE_DRAG_SINGLE: | |
case PLACE_DRAG_EVEN: | |
case UNKNOWN: |
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 purgePowerlessUsers() { | |
mcMMO.p.getLogger().info("Purging powerless users..."); | |
try { | |
// This does the deleting and returns the usernames of who we deleted | |
ResultSet result = SQLStatements.getInstance().getStatement("powerlessPurge").executeQuery(); | |
int purgeCount = 0; | |
while (result.next()) { | |
Misc.profileCleanup(result.getString(0)); | |
purgeCount++; | |
} |
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
Parameters: | |
Count: This is literal. The count parameter specifies how many particles to spawn at once | |
with these exact same parameters. | |
Spread: The starting position of each particle is a normal number with mean of the Location | |
and standard deviation of the Spread, e.g. (Norm(Loc.X, Spread.X), Norm(Loc.Y, | |
Spread.Y), Norm(Loc.Z, Spread.Z)). This means that 68% of the particles will be | |
within the bounding box of +/- 1*Spread, 95% will be within +/- 2*Spread, and 99.7% | |
will be within +/- 3*Spread for each coordinate. | |
Speed: The effect of this is determined by each particle. |
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
//v1.7 | |
// Flash Player Version Detection | |
// Detect Client Browser type | |
// Copyright 2005-2007 Adobe Systems Incorporated. All rights reserved. | |
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; | |
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; | |
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; | |
function ControlVersion() | |
{ |
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
/** | |
* .... | |
* <p> | |
* This event is the first in the login process lifecycle. The lifecycle goes | |
* as follows: | |
* <ol> | |
* <li>Username verification with Mojang (unless in offline/insecure mode)</li> | |
* <li>AsyncPlayerPreLoginEvent<br> | |
* <b>Only if necessary:</b> | |
* <ol> |
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 logColor(String s) { | |
ConsoleCommandSender c = Bukkit.getConsoleSender(); | |
if (c != null) { | |
c.sendMessage(s); | |
} else { | |
getLogger().info(ChatColor.stripColor(s)); | |
} | |
} |
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
@@ -15,8 +15,10 @@ public class CraftCreature extends CraftLivingEntity implements Creature { | |
EntityCreature entity = getHandle(); | |
if (target == null) { | |
entity.target = null; | |
+ entity.setGoalTarget(null); | |
} else if (target instanceof CraftLivingEntity) { | |
entity.target = ((CraftLivingEntity) target).getHandle(); | |
+ entity.setGoalTarget(((CraftLivingEntity) target).getHandle()); | |
entity.pathEntity = entity.world.findPath(entity, entity.target, 16.0F, true, false, false, true); | |
} |
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
///////////////////////////// | |
// An API method /////////// | |
///////////////////////////// | |
/** | |
* Reads the player's rank in each Skill from the database and runs the | |
* callback on the main thread. | |
*/ | |
public void readRankAsync(String playerName, Function<Map<SkillType, Integer>, Void> callback); |
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
case RANK_BOARD: | |
Bukkit.getScheduler().runTaskAsynchronously(mcMMO.p, new ReadRankAsyncTask(targetPlayer == null ? playerName : targetPlayer, new Function<Map<String, Integer>, Void>() { | |
@Override | |
public Void apply(Map<String, Integer> rankData) { | |
Integer rank; | |
Player bPlayer = Bukkit.getPlayerExact(playerName); | |
if (bPlayer == null) return null; | |
for (SkillType skill : SkillType.nonChildSkills()) { |
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
package me.riking.templateworlds.api; | |
import java.util.Collection; | |
import org.bukkit.Location; | |
import org.bukkit.World; | |
import org.bukkit.generator.BlockPopulator; | |
public interface ApiMain { | |
/** |