Skip to content

Commit 5513a05

Browse files
committed
merge: tag '1.8.1' into develop
1.8.1 1.8.1
2 parents d4a6fdf + 427b71e commit 5513a05

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
java
33
id("com.gradleup.shadow") version ("8.3.5")
4-
id("io.papermc.paperweight.userdev") version ("2.0.0-beta.9")
4+
id("io.papermc.paperweight.userdev") version ("2.0.0-beta.10")
55
}
66

77
group = "team.devblook"

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
org.gradle.caching=true
22
org.gradle.parallel=true
33
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
4-
projectVersion=1.8.0
4+
projectVersion=1.8.1
55
libsPackage=team.devblook.akropolis.libs

src/main/java/team/devblook/akropolis/module/modules/player/PlayerListener.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
package team.devblook.akropolis.module.modules.player;
2121

2222
import net.kyori.adventure.text.Component;
23-
import org.bukkit.Bukkit;
24-
import org.bukkit.Color;
25-
import org.bukkit.FireworkEffect;
23+
import org.bukkit.*;
2624
import org.bukkit.attribute.Attribute;
2725
import org.bukkit.attribute.AttributeInstance;
2826
import org.bukkit.configuration.ConfigurationSection;
@@ -45,6 +43,7 @@
4543

4644
import java.util.ArrayList;
4745
import java.util.List;
46+
import java.util.Objects;
4847

4948
public class PlayerListener extends Module {
5049
private ConfigurationSection playersSection;
@@ -128,7 +127,13 @@ public void onPlayerJoin(PlayerJoinEvent event) {
128127
if (spawnHeal) {
129128
player.setFoodLevel(20);
130129

131-
AttributeInstance maxHealth = player.getAttribute(Attribute.MAX_HEALTH);
130+
Attribute legacyMaxHealth = Registry.ATTRIBUTE.get(NamespacedKey.minecraft("generic.max_health"));
131+
Attribute maxHealthAttribute = legacyMaxHealth;
132+
133+
if (legacyMaxHealth == null) maxHealthAttribute = Registry.ATTRIBUTE.get(NamespacedKey.minecraft("max_health"));
134+
if (maxHealthAttribute == null) return;
135+
136+
AttributeInstance maxHealth = player.getAttribute(maxHealthAttribute);
132137
if (maxHealth == null) return;
133138

134139
player.setHealth(maxHealth.getBaseValue());

src/main/java/team/devblook/akropolis/module/modules/world/WorldProtect.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@
4646
import team.devblook.akropolis.module.ModuleType;
4747
import team.devblook.akropolis.module.modules.hologram.Hologram;
4848

49+
import java.util.Arrays;
50+
import java.util.List;
51+
import java.util.Objects;
4952
import java.util.Set;
53+
import java.util.stream.Collectors;
5054

5155
@SuppressWarnings({"deprecation", "ConstantConditions"})
5256
public class WorldProtect extends Module {
@@ -71,8 +75,8 @@ public class WorldProtect extends Module {
7175
private static final Set<Material> INTERACTABLE;
7276

7377
static {
74-
INTERACTABLE = Set.of(XMaterial.ANVIL.get(), XMaterial.BLACK_BED.get(), XMaterial.BLUE_BED.get(),
75-
XMaterial.BROWN_BED.get(), XMaterial.CYAN_BED.get(), XMaterial.GRAY_BED.get(),
78+
List<Material> rawInteractable = Arrays.asList(XMaterial.ANVIL.get(), XMaterial.BLACK_BED.get(),
79+
XMaterial.BLUE_BED.get(), XMaterial.BROWN_BED.get(), XMaterial.CYAN_BED.get(), XMaterial.GRAY_BED.get(),
7680
XMaterial.GREEN_BED.get(), XMaterial.LIGHT_BLUE_BED.get(), XMaterial.LIME_BED.get(),
7781
XMaterial.MAGENTA_BED.get(), XMaterial.ORANGE_BED.get(), XMaterial.PINK_BED.get(),
7882
XMaterial.PURPLE_BED.get(), XMaterial.RED_BED.get(), XMaterial.WHITE_BED.get(),
@@ -152,6 +156,8 @@ public class WorldProtect extends Module {
152156
XMaterial.WARPED_WALL_SIGN.get(), XMaterial.PALE_OAK_HANGING_SIGN.get(),
153157
XMaterial.PALE_OAK_SIGN.get(), XMaterial.PALE_OAK_WALL_HANGING_SIGN.get(),
154158
XMaterial.PALE_OAK_WALL_SIGN.get());
159+
160+
INTERACTABLE = rawInteractable.stream().filter(Objects::nonNull).collect(Collectors.toUnmodifiableSet());
155161
}
156162

157163
public WorldProtect(AkropolisPlugin plugin) {

0 commit comments

Comments
 (0)