第57批续11:PVP弃用API修复(Paper 26.x)
- GameRule.DO_DAYLIGHT_CYCLE → GameRules.ADVANCE_TIME - GameRule.DO_WEATHER_CYCLE → GameRules.ADVANCE_WEATHER - GameRule.DO_MOB_SPAWNING → GameRules.SPAWN_MONSTERS - GameRule.KEEP_INVENTORY → GameRules.KEEP_INVENTORY - AttributeModifier(String,...) → AttributeModifier(NamespacedKey,...)
This commit is contained in:
@@ -550,8 +550,8 @@ public class PVPArenaManager implements Listener {
|
|||||||
w.setPVP(true);
|
w.setPVP(true);
|
||||||
// ★ 和平模式:排除敌对生物干扰PVP
|
// ★ 和平模式:排除敌对生物干扰PVP
|
||||||
w.setDifficulty(Difficulty.PEACEFUL);
|
w.setDifficulty(Difficulty.PEACEFUL);
|
||||||
w.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, false);
|
w.setGameRule(GameRules.ADVANCE_TIME, false);
|
||||||
w.setGameRule(GameRule.DO_WEATHER_CYCLE, false);
|
w.setGameRule(GameRules.ADVANCE_WEATHER, false);
|
||||||
w.setTime(6000);
|
w.setTime(6000);
|
||||||
// ★ 不常驻出生点区块(与 WorldCreator.keepSpawnInMemory(false) 一致),避免同步加载区块卡主线程
|
// ★ 不常驻出生点区块(与 WorldCreator.keepSpawnInMemory(false) 一致),避免同步加载区块卡主线程
|
||||||
w.setKeepSpawnInMemory(false);
|
w.setKeepSpawnInMemory(false);
|
||||||
|
|||||||
@@ -182,10 +182,10 @@ public class PVPTestManager implements Listener {
|
|||||||
// 世界规则:常昼 / 无天气 / 关闭自然刷怪(只有我们生成的练习生物)/ PVP 开启
|
// 世界规则:常昼 / 无天气 / 关闭自然刷怪(只有我们生成的练习生物)/ PVP 开启
|
||||||
// ★ KEEP_INVENTORY=false:死亡掉落由事件处理器清空掉落物+复活时还原,避免gamerule与事件冲突
|
// ★ KEEP_INVENTORY=false:死亡掉落由事件处理器清空掉落物+复活时还原,避免gamerule与事件冲突
|
||||||
w.setPVP(true);
|
w.setPVP(true);
|
||||||
w.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, false);
|
w.setGameRule(GameRules.ADVANCE_TIME, false);
|
||||||
w.setGameRule(GameRule.DO_WEATHER_CYCLE, false);
|
w.setGameRule(GameRules.ADVANCE_WEATHER, false);
|
||||||
w.setGameRule(GameRule.DO_MOB_SPAWNING, false);
|
w.setGameRule(GameRules.SPAWN_MONSTERS, false);
|
||||||
w.setGameRule(GameRule.KEEP_INVENTORY, false);
|
w.setGameRule(GameRules.KEEP_INVENTORY, false);
|
||||||
w.setTime(6000);
|
w.setTime(6000);
|
||||||
w.setKeepSpawnInMemory(false);
|
w.setKeepSpawnInMemory(false);
|
||||||
|
|
||||||
@@ -895,7 +895,7 @@ public class PVPTestManager implements Listener {
|
|||||||
// 抵消皮革帽自带的1点护甲,使其不增加玩家对练习生物的伤害减免(纯用于挡太阳)
|
// 抵消皮革帽自带的1点护甲,使其不增加玩家对练习生物的伤害减免(纯用于挡太阳)
|
||||||
hm.addAttributeModifier(Attribute.ARMOR,
|
hm.addAttributeModifier(Attribute.ARMOR,
|
||||||
new AttributeModifier(
|
new AttributeModifier(
|
||||||
"pvp_test_no_armor", -1.0,
|
new NamespacedKey(plugin, "pvp_test_no_armor"), -1.0,
|
||||||
AttributeModifier.Operation.ADD_NUMBER));
|
AttributeModifier.Operation.ADD_NUMBER));
|
||||||
hat.setItemMeta(hm);
|
hat.setItemMeta(hm);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user