Skip to content

Commit

Permalink
Fix various issues with supplementaries
Browse files Browse the repository at this point in the history
  • Loading branch information
JustRed23 committed Nov 8, 2024
1 parent ec3f622 commit f1dc0b4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down
18 changes: 16 additions & 2 deletions patches/minecraft/net/minecraft/world/level/Level.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public static final Codec<ResourceKey<Level>> RESOURCE_KEY_CODEC = ResourceKey.codec(Registries.DIMENSION);
public static final ResourceKey<Level> OVERWORLD = ResourceKey.create(Registries.DIMENSION, new ResourceLocation("overworld"));
public static final ResourceKey<Level> 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;
Expand Down Expand Up @@ -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
+ }
+ }
+
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f1dc0b4

Please sign in to comment.