Skip to content

Commit 8a2329e

Browse files
committed
Adapt for more API breakages
1 parent e421c52 commit 8a2329e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/main/java/com/sk89q/craftbook/mechanics/Chair.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ public void run() {
303303
else {
304304
addChair(p, pl.getValue().location, null); // For any new players.
305305

306-
if (chairHealth && p.getHealth() < p.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue())
307-
p.setHealth(Math.min(p.getHealth() + chairHealAmount, p.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()));
306+
if (chairHealth && p.getHealth() < p.getAttribute(Attribute.MAX_HEALTH).getValue())
307+
p.setHealth(Math.min(p.getHealth() + chairHealAmount, p.getAttribute(Attribute.MAX_HEALTH).getValue()));
308308
if (p.getExhaustion() > -20d) p.setExhaustion((float)(p.getExhaustion() - 0.1d));
309309
}
310310
}
@@ -395,7 +395,7 @@ public void loadConfiguration (YAMLProcessor config, String path) {
395395

396396
config.setComment(path + "blocks", "A list of blocks that can be sat on.");
397397
chairBlocks =
398-
BlockSyntax.getBlocks(config.getStringList(path + "blocks", BlockCategories.STAIRS.getAll().stream().map(BlockType::getId).sorted(String::compareToIgnoreCase).collect(Collectors.toList())), true);
398+
BlockSyntax.getBlocks(config.getStringList(path + "blocks", BlockCategories.STAIRS.getAll().stream().map(BlockType::id).sorted(String::compareToIgnoreCase).collect(Collectors.toList())), true);
399399

400400
config.setComment(path + "face-correct-direction", "When the player sits, automatically face them the direction of the chair. (If possible)");
401401
chairFacing = config.getBoolean(path + "face-correct-direction", true);

src/main/java/com/sk89q/craftbook/util/EntityUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ public static void setEntityData(Entity ent, String bit) {
156156
if (ent instanceof LivingEntity && data[0].equalsIgnoreCase("health")) {
157157
try {
158158
double health = Double.parseDouble(data[1]);
159-
if(((LivingEntity) ent).getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue() < health)
160-
((LivingEntity) ent).getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(health);
159+
if(((LivingEntity) ent).getAttribute(Attribute.MAX_HEALTH).getBaseValue() < health)
160+
((LivingEntity) ent).getAttribute(Attribute.MAX_HEALTH).setBaseValue(health);
161161
((LivingEntity) ent).setHealth(health);
162162
} catch (Exception ignored) {
163163
}

0 commit comments

Comments
 (0)