Swap some nullable annotations (#10960)

This commit is contained in:
Lulu13022002
2024-06-24 00:42:44 +02:00
parent fed26cf9a8
commit acbaa46a96
6 changed files with 90 additions and 41 deletions

View File

@@ -1020,21 +1020,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Override
+ public org.bukkit.Location getAnchorLocation() {
+ net.minecraft.core.BlockPos pos = this.getHandle().anchorPoint;
+ if (pos == null) {
+ return null;
+ }
+
+ return io.papermc.paper.util.MCUtil.toLocation(this.getHandle().level(), pos);
+ }
+
+ @Override
+ public void setAnchorLocation(org.bukkit.Location location) {
+ net.minecraft.core.BlockPos pos = null;
+ if (location != null) {
+ pos = io.papermc.paper.util.MCUtil.toBlockPosition(location);
+ }
+
+ this.getHandle().anchorPoint = pos;
+ com.google.common.base.Preconditions.checkArgument(location != null, "location cannot be null");
+ this.getHandle().anchorPoint = io.papermc.paper.util.MCUtil.toBlockPosition(location);
+ }
// Paper end
}