mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-11-26 22:55:39 +00:00
Limit save data for Bees and Vexes (#120)
This commit is contained in:
parent
5af8738efc
commit
a4ede7dc64
44
patches/server/0058-Limit-save-data-for-Bees-and-Vexes.patch
Normal file
44
patches/server/0058-Limit-save-data-for-Bees-and-Vexes.patch
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Allink <arclicious@vivaldi.net>
|
||||||
|
Date: Wed, 5 Jul 2023 22:58:24 +0100
|
||||||
|
Subject: [PATCH] Limit save data for Bees and Vexes
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||||
|
index 083640b7e4aee75db9b884aebd640c9410e669ca..76a2d683c7a32a8af2683cb2d7a3e33111064b27 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||||
|
@@ -223,8 +223,12 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
|
@Override
|
||||||
|
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||||
|
this.hivePos = null;
|
||||||
|
- if (nbt.contains("HivePos")) {
|
||||||
|
- this.hivePos = NbtUtils.readBlockPos(nbt.getCompound("HivePos"));
|
||||||
|
+ if (nbt.contains("HivePos"))
|
||||||
|
+ {
|
||||||
|
+ // Scissors start - Limit HivePos
|
||||||
|
+ final BlockPos savedHivePos = NbtUtils.readBlockPos(nbt.getCompound("HivePos"));
|
||||||
|
+ this.hivePos = this.level.isLoadedAndInBounds(savedHivePos) ? savedHivePos : null;
|
||||||
|
+ // Scissors end - Limit HivePos
|
||||||
|
}
|
||||||
|
|
||||||
|
this.savedFlowerPos = null;
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Vex.java b/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
||||||
|
index f78f3f2d740f7b4800e17d9bc64b7b4fedda49b9..a4c4c7cd5a4325916836728f11d2164ad211143b 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Vex.java
|
||||||
|
@@ -107,8 +107,12 @@ public class Vex extends Monster {
|
||||||
|
@Override
|
||||||
|
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||||
|
super.readAdditionalSaveData(nbt);
|
||||||
|
- if (nbt.contains("BoundX")) {
|
||||||
|
- this.boundOrigin = new BlockPos(nbt.getInt("BoundX"), nbt.getInt("BoundY"), nbt.getInt("BoundZ"));
|
||||||
|
+ if (nbt.contains("BoundX"))
|
||||||
|
+ {
|
||||||
|
+ // Scissors start - Limit Vex bound origin
|
||||||
|
+ final BlockPos savedBoundOrigin = new BlockPos(nbt.getInt("BoundX"), nbt.getInt("BoundY"), nbt.getInt("BoundZ"));
|
||||||
|
+ this.boundOrigin = this.level.isLoadedAndInBounds(savedBoundOrigin) ? savedBoundOrigin : null;
|
||||||
|
+ // Scissors end - Limit Vex bound origin
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nbt.contains("LifeTicks")) {
|
Loading…
Reference in New Issue
Block a user