From f1dc0b49f05e6f10f72f41063e7c203225404b25 Mon Sep 17 00:00:00 2001 From: JustRed23 Date: Fri, 8 Nov 2024 20:34:12 +0100 Subject: [PATCH] Fix various issues with supplementaries --- .../minecraft/world/entity/Entity.java.patch | 2 +- .../world/entity/monster/Creeper.java.patch | 7 +++++-- .../net/minecraft/world/level/Level.java.patch | 18 ++++++++++++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/patches/minecraft/net/minecraft/world/entity/Entity.java.patch b/patches/minecraft/net/minecraft/world/entity/Entity.java.patch index b74c8d62eb..3445904a40 100644 --- a/patches/minecraft/net/minecraft/world/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/Entity.java.patch @@ -95,7 +95,7 @@ this.blockPosition = BlockPos.ZERO; this.chunkPosition = ChunkPos.ZERO; + // Spigot start -+ if (p_19871_ != null) { ++ if (p_19871_ != null && p_19871_.spigotConfig != null) { //Ketting - null check + this.defaultActivationState = org.spigotmc.ActivationRange.initializeEntityActivationState(this, p_19871_.spigotConfig); + } else { + this.defaultActivationState = false; diff --git a/patches/minecraft/net/minecraft/world/entity/monster/Creeper.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/Creeper.java.patch index c3f3613e52..0beb563613 100644 --- a/patches/minecraft/net/minecraft/world/entity/monster/Creeper.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/monster/Creeper.java.patch @@ -21,7 +21,7 @@ protected InteractionResult mobInteract(Player p_32301_, InteractionHand p_32302_) { ItemStack itemstack = p_32301_.getItemInHand(p_32302_); if (itemstack.is(ItemTags.CREEPER_IGNITERS)) { -@@ -224,10 +_,19 @@ +@@ -224,10 +_,22 @@ public void explodeCreeper() { if (!this.level().isClientSide) { float f = this.isPowered() ? 2.0F : 1.0F; @@ -31,7 +31,10 @@ this.dead = true; - this.level().explode(this, this.getX(), this.getY(), this.getZ(), (float)this.explosionRadius * f, Level.ExplosionInteraction.MOB); + // CraftBukkit end -+ this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB); // CraftBukkit ++ //Ketting start - mixin inject ++ this.level().explode$fire.set(event.getFire()); ++ this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), Level.ExplosionInteraction.MOB); ++ //Ketting end + // CraftBukkit start this.discard(); this.spawnLingeringCloud(); diff --git a/patches/minecraft/net/minecraft/world/level/Level.java.patch b/patches/minecraft/net/minecraft/world/level/Level.java.patch index 6702fa4dd5..a64530c207 100644 --- a/patches/minecraft/net/minecraft/world/level/Level.java.patch +++ b/patches/minecraft/net/minecraft/world/level/Level.java.patch @@ -9,7 +9,7 @@ public static final Codec> RESOURCE_KEY_CODEC = ResourceKey.codec(Registries.DIMENSION); public static final ResourceKey OVERWORLD = ResourceKey.create(Registries.DIMENSION, new ResourceLocation("overworld")); public static final ResourceKey NETHER = ResourceKey.create(Registries.DIMENSION, new ResourceLocation("the_nether")); -@@ -110,8 +_,122 @@ +@@ -110,8 +_,123 @@ private final RegistryAccess registryAccess; private final DamageSources damageSources; private long subTickCount; @@ -124,7 +124,8 @@ + // CraftBukkit Ticks things + for (org.bukkit.entity.SpawnCategory spawnCategory : org.bukkit.entity.SpawnCategory.values()) { + if (org.bukkit.craftbukkit.v1_20_R1.util.CraftSpawnCategory.isValidForLimits(spawnCategory)) { -+ this.ticksPerSpawnCategory.put(spawnCategory, (long) this.getCraftServer().getTicksPerSpawns(spawnCategory)); ++ this.ticksPerSpawnCategory.put(spawnCategory, ++ this.getCraftServer() == null ? 400L : (long) this.getCraftServer().getTicksPerSpawns(spawnCategory)); //Ketting - null check for fake worlds + } + } + @@ -425,6 +426,19 @@ } } +@@ -445,8 +_,11 @@ + return this.shouldTickBlocksAt(ChunkPos.asLong(p_220394_)); + } + ++ //Ketting start - mixin inject ++ public java.util.concurrent.atomic.AtomicBoolean explode$fire = new java.util.concurrent.atomic.AtomicBoolean(false); + public Explosion explode(@Nullable Entity p_256599_, double p_255914_, double p_255684_, double p_255843_, float p_256310_, Level.ExplosionInteraction p_256178_) { +- return this.explode(p_256599_, (DamageSource)null, (ExplosionDamageCalculator)null, p_255914_, p_255684_, p_255843_, p_256310_, false, p_256178_); ++ return this.explode(p_256599_, (DamageSource)null, (ExplosionDamageCalculator)null, p_255914_, p_255684_, p_255843_, p_256310_, explode$fire.getAndSet(false), p_256178_); ++ //Ketting end + } + + public Explosion explode(@Nullable Entity p_255682_, double p_255803_, double p_256403_, double p_256538_, float p_255674_, boolean p_256634_, Level.ExplosionInteraction p_256111_) { @@ -471,7 +_,7 @@ explosion$blockinteraction1 = this.getDestroyType(GameRules.RULE_BLOCK_EXPLOSION_DROP_DECAY); break;