Vanishing
This commit is contained in:
30
patches/api/0021-Vanish.patch
Normal file
30
patches/api/0021-Vanish.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cryptite <cryptite@gmail.com>
|
||||
Date: Sun, 7 Jan 2024 08:27:00 -0600
|
||||
Subject: [PATCH] Vanish
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 0b057d6be0d55c275867bd1cb98387bc3237d881..2f1c4ecb27d47745fa9bad3a36f006103aaf79b2 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1122,4 +1122,19 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
void setSaveable(boolean saveable);
|
||||
// Slice end
|
||||
+
|
||||
+ // Slice start
|
||||
+ /**
|
||||
+ * Returns true if the entity is vanished and cannot emit sounds, effects, etc.
|
||||
+ */
|
||||
+ boolean isVanished();
|
||||
+
|
||||
+ /**
|
||||
+ * Sets whether the entity is vanished and cannot emit sounds, effects, etc.
|
||||
+ *
|
||||
+ * @param vanished the saveable status
|
||||
+ * @see #isVanished()
|
||||
+ */
|
||||
+ void setVanished(boolean vanished);
|
||||
+ // Slice end
|
||||
}
|
||||
@@ -27,7 +27,7 @@ index 14a5492428eac823a295ef3746d0aca6fbdab4ec..46051d555432aeedba3a4b38f4f72b8a
|
||||
return false;
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 8848eeda7a89d445e370626182f9bb4710e5edd4..fe62e872f0c989f612dcbfc58894bd1787345d25 100644
|
||||
index 6403341f2e9d7ac4251336cb0bcc5d79dbb7bb0e..9141d18b8e592f926356705cd9369226d89cddf9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -906,12 +906,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -46,8 +46,8 @@ index 8848eeda7a89d445e370626182f9bb4710e5edd4..fe62e872f0c989f612dcbfc58894bd17
|
||||
// CraftBukkit start - tree generation
|
||||
if (this.captureTreeGeneration) {
|
||||
// Paper start
|
||||
@@ -1102,7 +1102,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
Block.dropResources(iblockdata, this, pos, tileentity, breakingEntity, ItemStack.EMPTY);
|
||||
@@ -1107,7 +1107,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
iblockdata.getBlock().popExperience((ServerLevel) this, pos, xp, breakingEntity); // Paper - handle drop experience logic, custom amount
|
||||
}
|
||||
|
||||
- boolean flag1 = this.setBlock(pos, fluid.createLegacyBlock(), 3, maxUpdateDepth);
|
||||
@@ -77,7 +77,7 @@ index 134e5ec79bf2dddd4e31930f8a7cb2c02fa29518..fd72d278a2719911a46b6bc9e7da2dc2
|
||||
|
||||
boolean removeBlock(BlockPos pos, boolean move);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index 4d50dd92a7f3187ee1d8edb926e7c273c8156549..4dc96e83f14a1b31d720f9915f7541d4d86e5c30 100644
|
||||
index e21867d3956078bb0db4ceed45e5811e9acd7377..4b2d6aa89678d60f362015497bda83b255ce9c57 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -201,7 +201,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -103,7 +103,7 @@ index 45fd28f26aa2e53785919abbfe42bb237131e453..150b649c457ab4a17e9d72a21f7d06b8
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
index e5506a7d074a9f89d41f4d5d7549a458779bef20..5b0a5c6ba424eeeb071f362f4ffc856b50dd7b2f 100644
|
||||
index 520b53bc604e6755251f0b14e91dce56bc5501ce..aba4f2a089faa94ffe63841b23b0ae977d85bb51 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -183,15 +183,20 @@ public class CraftBlock implements Block {
|
||||
@@ -154,10 +154,10 @@ index 390e1b7fd2721b99cb3ce268c6bc1bf0a38e08a3..f3c42e65c6c731e1f0f3d36f16c35b7d
|
||||
this.world.getHandle().sendBlockUpdated(
|
||||
this.position,
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
||||
index a650411e3fa7e2a045ac55502c77028be348acf1..715fd6cfb8f5c4c3dbb39e0de9b43faad2add9ba 100644
|
||||
index 0f115d555cbc9fed224c9e8b0fab5fae6b0e7ff2..4b38672b5c772df4997120b71c87940eede5193f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
|
||||
@@ -801,8 +801,8 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
|
||||
@@ -803,8 +803,8 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -182,12 +182,12 @@ index a5e34c25e00e7f770bcb6e15ed0bbfe8f369a68a..572e52c494ead11d0fa84cf324f2c862
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/TransformerGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/TransformerGeneratorAccess.java
|
||||
index b4b297945fb601701aac845d09e88fb74b09c3fa..1a7d90c36c203d0ff6fc67f6ce59a746010952d4 100644
|
||||
index 0762140eb66e9d4dedeb6d12270bdca4c88558f5..0bdedeeb46c6a8ee0689dba4786b105bf0edba2d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/TransformerGeneratorAccess.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/TransformerGeneratorAccess.java
|
||||
@@ -55,14 +55,14 @@ public class TransformerGeneratorAccess extends DelegatedGeneratorAccess {
|
||||
super.addFreshEntityWithPassengers(arg0, arg1);
|
||||
}
|
||||
@@ -57,14 +57,14 @@ public class TransformerGeneratorAccess extends DelegatedGeneratorAccess {
|
||||
// }
|
||||
// Paper end - don't override these methods
|
||||
|
||||
- public boolean setCraftBlock(BlockPos position, CraftBlockState craftBlockState, int i, int j) {
|
||||
+ public boolean setCraftBlock(BlockPos position, CraftBlockState craftBlockState, int i, int j, boolean checkLight) {
|
||||
@@ -202,7 +202,7 @@ index b4b297945fb601701aac845d09e88fb74b09c3fa..1a7d90c36c203d0ff6fc67f6ce59a746
|
||||
FluidState fluid = this.getFluidState(position);
|
||||
if (!fluid.isEmpty()) {
|
||||
this.scheduleTick(position, fluid.getType(), 0);
|
||||
@@ -78,19 +78,19 @@ public class TransformerGeneratorAccess extends DelegatedGeneratorAccess {
|
||||
@@ -80,19 +80,19 @@ public class TransformerGeneratorAccess extends DelegatedGeneratorAccess {
|
||||
}
|
||||
|
||||
public boolean setCraftBlock(BlockPos position, CraftBlockState craftBlockState, int i) {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't send fire packets if player has FR
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 0c46a4aeafd03fbbfd590b0362d41bf2b1d5ca74..91fc0da2cc01c24f9d69ef008a8f6a79c6eaaa5e 100644
|
||||
index 1be10c57e374ad4018c08d96cfb69397a2f541d3..14f54b038d2cd9f3ca7f81f2b556bc4e71701cb6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -872,7 +872,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -876,7 +876,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
|
||||
this.checkBelowWorld();
|
||||
if (!this.level().isClientSide) {
|
||||
|
||||
@@ -144,10 +144,10 @@ index 35674f92a67f93382103c2766df4b678ba5c862f..97dbcb6f527bd5c567e77200d7f6cbc1
|
||||
|
||||
if (this.entity instanceof LivingEntity) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 25c28dd37e729627739c91e929c208f6aa2539c0..34f3ddb22febc0aea7d3059b2cbbd84554fd03b4 100644
|
||||
index 84d88e71a187e74a40faa1aa9a6a300cdeb8fd60..35fa9a43154b08bccc50d7c626c4b10289ef61da 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3384,7 +3384,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -3388,7 +3388,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
this.entityData.markDirty(Entity.DATA_AIR_SUPPLY_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ Subject: [PATCH] Add canDespawn to Warden
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index 940b8d0b89d7e55c938aefbe80ee71b0db3dacb8..ed5521bda42708b22e1128069d7b47d051c3358c 100644
|
||||
index 00389d7ec3e8b059d5591a2019ba240fda2901fe..f7530dd768353921465a887d161845c1a943e527 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -593,7 +593,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
}), (entity) -> {
|
||||
@@ -599,7 +599,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
if (generation) entity.generation = true; // Paper - add generation bool param
|
||||
entity.load(nbt);
|
||||
}, () -> {
|
||||
- EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id"));
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Save DimensionDataStorage async
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index ad868de68ecc5eee9701f8fe3d48e9fb3ed422d8..ef2d88765dbcc36ca3a1f36101e389799241bcde 100644
|
||||
index 386cb2cc6c6490be8bea6abf5fa0e1d3166c2365..2f7190b0f8957d5da2ed122a91e7047e80f2ab6f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -2142,8 +2142,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -2143,8 +2143,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
if (existing == null && !storage.cache.containsKey(id)) {
|
||||
final net.minecraft.world.level.saveddata.SavedData.Factory<MapItemSavedData> factory = MapItemSavedData.factory();
|
||||
final MapItemSavedData map = storage.readSavedData(factory.deserializer(), factory.type(), id);
|
||||
|
||||
@@ -18,7 +18,7 @@ index 7e8dc9e8f381abfdcce2746edc93122d623622d1..303e5ed4d5cf2a64b998656bfd189f19
|
||||
if (entity.isVehicle()) {
|
||||
// we cannot assume that these entities are contained within this chunk, because entities can
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 34f3ddb22febc0aea7d3059b2cbbd84554fd03b4..a6db17c51d6b8e58936e52e7f6cbe07dcebd5418 100644
|
||||
index 35fa9a43154b08bccc50d7c626c4b10289ef61da..3179abc5b548cc203bd68aeb77fdd558c2df3c4a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -422,6 +422,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -29,7 +29,7 @@ index 34f3ddb22febc0aea7d3059b2cbbd84554fd03b4..a6db17c51d6b8e58936e52e7f6cbe07d
|
||||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -4819,7 +4820,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -4830,7 +4831,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
|
||||
@Override
|
||||
public boolean shouldBeSaved() {
|
||||
|
||||
@@ -83,10 +83,10 @@ index 04c6357d24a095bcff40e267cd40920e3b3c3c5d..1c0b55cb77616811270c9b3ee1223184
|
||||
this.isSaving = false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index ef2d88765dbcc36ca3a1f36101e389799241bcde..4493b34e457e47f6923c4febf8ddcf9c4f70d575 100644
|
||||
index 2f7190b0f8957d5da2ed122a91e7047e80f2ab6f..be9f021333add074a5e2f0dca1e559c3735d436a 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -2136,7 +2136,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -2137,7 +2137,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@Override
|
||||
public MapItemSavedData getMapData(String id) {
|
||||
// Paper start - Call missing map initialize event & set id
|
||||
@@ -95,7 +95,7 @@ index ef2d88765dbcc36ca3a1f36101e389799241bcde..4493b34e457e47f6923c4febf8ddcf9c
|
||||
|
||||
final net.minecraft.world.level.saveddata.SavedData existing = storage.cache.get(id);
|
||||
if (existing == null && !storage.cache.containsKey(id)) {
|
||||
@@ -2163,12 +2163,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -2164,12 +2164,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
MapInitializeEvent event = new MapInitializeEvent(state.mapView);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
// CraftBukkit end
|
||||
|
||||
48
patches/server/0043-Vanish.patch
Normal file
48
patches/server/0043-Vanish.patch
Normal file
@@ -0,0 +1,48 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cryptite <cryptite@gmail.com>
|
||||
Date: Sun, 7 Jan 2024 08:26:59 -0600
|
||||
Subject: [PATCH] Vanish
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index cb10e801216d89041c38798be0a2b7f59b73d2fb..91285d21c0f3398a3841d1e17b377845feebd78a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -424,6 +424,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
public boolean fixedPose = false; // Paper
|
||||
public boolean saveable = true; // Slice
|
||||
public boolean sendMovementPackets = true; // Slice
|
||||
+ public boolean vanished; // Slice
|
||||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -1311,7 +1312,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
|
||||
private boolean vibrationAndSoundEffectsFromBlock(BlockPos pos, BlockState state, boolean playSound, boolean emitEvent, Vec3 movement) {
|
||||
- if (state.isAir()) {
|
||||
+ if (vanished || state.isAir()) { // Slice
|
||||
return false;
|
||||
} else {
|
||||
boolean flag2 = this.isStateClimbable(state);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 19c56ef79cacfb6d65dea5741d9ce71998c1eacc..c8939926605d6500076c9eae0f0cc008a095ab68 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1239,4 +1239,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
this.entity.saveable = saveable;
|
||||
}
|
||||
// Slice end
|
||||
+
|
||||
+ // Slice start
|
||||
+ @Override
|
||||
+ public boolean isVanished() {
|
||||
+ return this.entity.vanished;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setVanished(boolean vanished) {
|
||||
+ this.entity.vanished = vanished;
|
||||
+ }
|
||||
+ // Slice end
|
||||
}
|
||||
Reference in New Issue
Block a user