本文整理汇总了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);
}
}
}