mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 19:07:44 +01:00
make it compile \o/
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
CompoundTag data = this.getData();
|
||||
if (data == null) {
|
||||
return null;
|
||||
@@ -571,4 +_,191 @@
|
||||
@@ -571,4 +_,183 @@
|
||||
manager.save();
|
||||
}
|
||||
}
|
||||
@@ -26,9 +26,8 @@
|
||||
+ } else {
|
||||
+ CompoundTag data = this.getData();
|
||||
+ if (data == null) return false;
|
||||
+ if (!data.contains("abilities")) return false;
|
||||
+ CompoundTag abilities = data.getCompound("abilities");
|
||||
+ return abilities.getByte("mayfly") == (byte) 1;
|
||||
+ if (!(data.get("abilities") instanceof CompoundTag abilities)) return false;
|
||||
+ return abilities.getByteOr("mayfly", (byte) 0) == (byte) 1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -39,8 +38,7 @@
|
||||
+ } else {
|
||||
+ CompoundTag data = this.getData();
|
||||
+ if (data == null) return;
|
||||
+ if (!data.contains("abilities")) return;
|
||||
+ CompoundTag abilities = data.getCompound("abilities");
|
||||
+ if (!(data.get("abilities") instanceof CompoundTag abilities)) return;
|
||||
+ abilities.putByte("mayfly", (byte) (flight ? 1 : 0));
|
||||
+ data.put("abilities", abilities);
|
||||
+ save(data);
|
||||
@@ -54,9 +52,8 @@
|
||||
+ } else {
|
||||
+ CompoundTag data = this.getData();
|
||||
+ if (data == null) return false;
|
||||
+ if (!data.contains("abilities")) return false;
|
||||
+ CompoundTag abilities = data.getCompound("abilities");
|
||||
+ return abilities.getByte("flying") == (byte) 1;
|
||||
+ if (!(data.get("abilities") instanceof CompoundTag abilities)) return false;
|
||||
+ return abilities.getByteOr("flying", (byte) 0) == (byte) 1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -67,8 +64,7 @@
|
||||
+ } else {
|
||||
+ CompoundTag data = this.getData();
|
||||
+ if (data == null) return;
|
||||
+ if (!data.contains("abilities")) return;
|
||||
+ CompoundTag abilities = data.getCompound("abilities");
|
||||
+ if (!(data.get("abilities") instanceof CompoundTag abilities)) return;
|
||||
+ abilities.putByte("mayfly", (byte) (value ? 1 : 0));
|
||||
+ data.put("abilities", abilities);
|
||||
+ save(data);
|
||||
@@ -83,8 +79,7 @@
|
||||
+ } else {
|
||||
+ CompoundTag data = this.getData();
|
||||
+ if (data == null) return;
|
||||
+ if (!data.contains("abilities")) return;
|
||||
+ CompoundTag abilities = data.getCompound("abilities");
|
||||
+ if (!(data.get("abilities") instanceof CompoundTag abilities)) return;
|
||||
+ abilities.putFloat("flySpeed", value);
|
||||
+ data.put("abilities", abilities);
|
||||
+ save(data);
|
||||
@@ -98,9 +93,8 @@
|
||||
+ } else {
|
||||
+ CompoundTag data = this.getData();
|
||||
+ if (data == null) return 0;
|
||||
+ if (!data.contains("abilities")) return 0;
|
||||
+ CompoundTag abilities = data.getCompound("abilities");
|
||||
+ return abilities.getFloat("flySpeed");
|
||||
+ if (!(data.get("abilities") instanceof CompoundTag abilities)) return 0;
|
||||
+ return abilities.getFloatOr("flySpeed", 0);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -112,8 +106,7 @@
|
||||
+ } else {
|
||||
+ CompoundTag data = this.getData();
|
||||
+ if (data == null) return;
|
||||
+ if (!data.contains("abilities")) return;
|
||||
+ CompoundTag abilities = data.getCompound("abilities");
|
||||
+ if (!(data.get("abilities") instanceof CompoundTag abilities)) return;
|
||||
+ abilities.putFloat("walkSpeed", value);
|
||||
+ data.put("abilities", abilities);
|
||||
+ save(data);
|
||||
@@ -127,9 +120,8 @@
|
||||
+ } else {
|
||||
+ CompoundTag data = this.getData();
|
||||
+ if (data == null) return 0;
|
||||
+ if (!data.contains("abilities")) return 0;
|
||||
+ CompoundTag abilities = data.getCompound("abilities");
|
||||
+ return abilities.getFloat("walkSpeed");
|
||||
+ if (!(data.get("abilities") instanceof CompoundTag abilities)) return 0;
|
||||
+ return abilities.getFloatOr("walkSpeed", 0);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
+ // Purpur start - Add local difficulty api
|
||||
+ public float getLocalDifficultyAt(Location location) {
|
||||
+ return getHandle().getCurrentDifficultyAt(io.papermc.paper.util.MCUtil.toBlockPosition(location)).getEffectiveDifficulty();
|
||||
+ return getHandle().getCurrentDifficultyAt(org.bukkit.craftbukkit.util.CraftLocation.toBlockPosition(location)).getEffectiveDifficulty();
|
||||
+ }
|
||||
+ // Purpur end - Add local difficulty api
|
||||
+
|
||||
@@ -28,7 +28,7 @@
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, String text, int argb) {
|
||||
+ net.minecraft.network.protocol.game.DebugPackets.sendGameTestAddMarker(getHandle(), io.papermc.paper.util.MCUtil.toBlockPosition(location), text, argb, duration);
|
||||
+ net.minecraft.network.protocol.game.DebugPackets.sendGameTestAddMarker(getHandle(), org.bukkit.craftbukkit.util.CraftLocation.toBlockPosition(location), text, argb, duration);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, String text, int argb) {
|
||||
+ if (this.getHandle().connection == null) return;
|
||||
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestAddMarkerDebugPayload(io.papermc.paper.util.MCUtil.toBlockPosition(location), argb, text, duration)));
|
||||
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestAddMarkerDebugPayload(org.bukkit.craftbukkit.util.CraftLocation.toBlockPosition(location), argb, text, duration)));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
||||
Reference in New Issue
Block a user