本文整理匯總了Java中org.bukkit.entity.Player.setSprinting方法的典型用法代碼示例。如果您正苦於以下問題:Java Player.setSprinting方法的具體用法?Java Player.setSprinting怎麽用?Java Player.setSprinting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.entity.Player
的用法示例。
在下文中一共展示了Player.setSprinting方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: reset
import org.bukkit.entity.Player; //導入方法依賴的package包/類
public void reset() {
final Player bukkit = getBukkit();
bukkit.closeInventory();
clearInventory();
bukkit.setExhaustion(0);
bukkit.setFallDistance(0);
bukkit.setFireTicks(0);
bukkit.setFoodLevel(20); // full
bukkit.setMaxHealth(20);
bukkit.setHealth(bukkit.getMaxHealth());
bukkit.setAbsorption(0);
bukkit.setLevel(0);
bukkit.setExp(0); // clear xp
bukkit.setSaturation(5); // default
bukkit.setFastNaturalRegeneration(false);
bukkit.setSlowNaturalRegeneration(true);
bukkit.setAllowFlight(false);
bukkit.setFlying(false);
bukkit.setSneaking(false);
bukkit.setSprinting(false);
bukkit.setFlySpeed(0.1f);
bukkit.setKnockbackReduction(0);
bukkit.setWalkSpeed(WalkSpeedKit.BUKKIT_DEFAULT);
AttributeUtils.removeAllModifiers(bukkit);
resetPotions();
// we only reset bed spawn here so people don't have to see annoying messages when they respawn
bukkit.setBedSpawnLocation(null);
match.callEvent(new PlayerResetEvent(this));
}
示例2: run
import org.bukkit.entity.Player; //導入方法依賴的package包/類
@Override
public void run() {
Set<UUID> players=rs.getPlayerDatas().keySet();
for(UUID ps:players){
Player p = rs.getServer().getPlayer(ps);
if(p==null||p.isDead())continue;
if ((p.hasPermission("RealSurvival.unlimited")||p.hasPermission("RealSurvival.Admin"))&&!TestCMD.contains(p))
continue;
PlayerData pd=rs.getPlayerData(p);
if(p.isSneaking())
if(pd.getPhysical_strength()<rs.getSneaking())
p.setSneaking(false);
else{
pd.changePS(-rs.getSneaking());
continue;
}
else if(p.isSprinting())
if(pd.getPhysical_strength()<rs.getSprinting())
p.setSprinting(false);
else{
pd.changePS(-rs.getSprinting());
continue;
}
else
pd.changePS(rs.getPhysical_strength_add());
}
}
示例3: run
import org.bukkit.entity.Player; //導入方法依賴的package包/類
@Override
public void run() {
Set<UUID> players=rs.getPlayerDatas().keySet();
for(UUID ps:players){
Player p = rs.getServer().getPlayer(ps);
if(p==null||p.isDead())continue;
if ((p.hasPermission("RealSurvival.unlimited")||p.hasPermission("RealSurvival.Admin"))&&!TestCMD.contains(p))
continue;
PlayerData pd=rs.getPlayerData(p);
//Sleep
sleep=pd.getSleep();
if(sleep>=rs.getSleepMax()*0.8)
Utils.addPotionEffect(p, rs.getEffects("SleepMax"));
else if(sleep<=rs.getSleepMin())
Utils.addPotionEffect(p,rs.getEffects("SleepMin"));
//Thirst
thirst=pd.getThirst();
if(thirst>=rs.getThirstMax()*0.8)
Utils.addPotionEffect(p, rs.getEffects("ThirstMax"));
else if(thirst<=rs.getThirstMin())
Utils.addPotionEffect(p, rs.getEffects("ThirstMin"));
//Temperature
temperature=pd.getTemperature();
if(temperature>38)
Utils.addPotionEffect(p, rs.getEffects("Fever"));
else if(temperature<36)
Utils.addPotionEffect(p, rs.getEffects("Cold"));
//PhysicalStrength
if(pd.getPhysical_strength()==0)
Utils.addPotionEffect(p, rs.getEffects("PhysicalStrengthMin"));
//Sick
if(pd.isSick())
for(String sick:pd.getSickKindList())
Utils.addPotionEffect(p, rs.getEffects(sick));
//weight
if(pd.getWeight()>rs.getWeight()){
Utils.addPotionEffect(p, rs.getEffects("Weight"));
p.setSprinting(false);
}
}
}