Skip to content

Commit d35020c

Browse files
fix MC-221257 (#430)
1 parent 67679d0 commit d35020c

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

PATCHED.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
| Basic | [MC-206705](https://bugs.mojang.com/browse/MC-206705) | Spyglasses stay in use in spectator mode |
6767
| Basic | [MC-206922](https://bugs.mojang.com/browse/MC-206922) | Items dropped by entities that are killed by lightning instantly disappear |
6868
| Basic | [MC-215530](https://bugs.mojang.com/browse/MC-215530) | The freezing effect isn't immediately removed when switching into spectator mode |
69+
| Basic | [MC-221257](https://bugs.mojang.com/browse/MC-221257) | Shulker bullets don't produce bubble particles when moving through water |
6970
| Basic | [MC-223153](https://bugs.mojang.com/browse/MC-223153) | Block of Raw Copper uses stone sounds instead of copper sounds |
7071
| Basic | [MC-224729](https://bugs.mojang.com/browse/MC-224729) | Partially generated chunks are not saved in some situations |
7172
| Basic | [MC-231743](https://bugs.mojang.com/browse/MC-231743) | minecraft.used:minecraft.POTTABLE_PLANT doesn't increase when placing plants into flower pots |
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package dev.isxander.debugify.mixins.basic.mc221257;
2+
3+
import dev.isxander.debugify.fixes.BugFix;
4+
import dev.isxander.debugify.fixes.FixCategory;
5+
import net.minecraft.core.particles.ParticleTypes;
6+
import net.minecraft.world.entity.EntityType;
7+
import net.minecraft.world.entity.projectile.Projectile;
8+
import net.minecraft.world.entity.projectile.ShulkerBullet;
9+
import net.minecraft.world.level.Level;
10+
import net.minecraft.world.phys.Vec3;
11+
import org.spongepowered.asm.mixin.Mixin;
12+
import org.spongepowered.asm.mixin.injection.At;
13+
import org.spongepowered.asm.mixin.injection.Inject;
14+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
15+
16+
@BugFix(id = "MC-221257", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "Shulker bullets don't produce bubble particles when moving through water")
17+
@Mixin(ShulkerBullet.class)
18+
public abstract class ShulkerBulletMixin extends Projectile {
19+
public ShulkerBulletMixin(EntityType<? extends Projectile> entityType, Level level) {
20+
super(entityType, level);
21+
}
22+
23+
/**
24+
* Code taken from {@link net.minecraft.world.entity.projectile.AbstractArrow}
25+
*/
26+
@Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/projectile/ShulkerBullet;setPos(Lnet/minecraft/world/phys/Vec3;)V"))
27+
private void addMissingBubbleParticles(CallbackInfo ci) {
28+
if (this.isInWater()) {
29+
Vec3 vec3 = this.position();
30+
Vec3 vec32 = this.getDeltaMovement();
31+
32+
for (int i = 0; i < 4; ++i) {
33+
this.level().addParticle(ParticleTypes.BUBBLE, vec3.x - vec32.x * (double) 0.25F, vec3.y - vec32.y * (double) 0.25F, vec3.z - vec32.z * (double) 0.25F, vec32.x, vec32.y, vec32.z);
34+
}
35+
}
36+
}
37+
}

src/main/resources/debugify.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"basic.mc206922.EntityMixin",
2828
"basic.mc206922.ItemEntityMixin",
2929
"basic.mc215530.ServerPlayerMixin",
30+
"basic.mc221257.ShulkerBulletMixin",
3031
"basic.mc223153.BlocksMixin",
3132
"basic.mc224729.ChunkMapMixin",
3233
"basic.mc231743.FlowerPotBlockMixin",

0 commit comments

Comments
 (0)