Skip to content

Commit 5ac3e5a

Browse files
committed
MC-206922
1 parent 33c68e1 commit 5ac3e5a

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

PATCHED.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
| [MC-200418](https://bugs.mojang.com/browse/MC-200418) | Cured baby zombie villagers stay as jockey variant |
6767
| [MC-214147](https://bugs.mojang.com/browse/MC-214147) | Skeletons wearing leather armor still convert to strays in powder snow |
6868
| [MC-206705](https://bugs.mojang.com/browse/MC-206705) | Spyglasses stay in use in spectator mode |
69+
| [MC-206922](https://bugs.mojang.com/browse/MC-206922) | Items dropped by entities that are killed by lightning instantly disappear |
6970
| [MC-215530](https://bugs.mojang.com/browse/MC-215530) | The freezing effect isn't immediately removed when switching into spectator mode |
7071
| [MC-223153](https://bugs.mojang.com/browse/MC-223153) | Block of Raw Copper uses stone sounds instead of copper sounds |
7172
| [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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package cc.woverflow.debugify.mixins.server.mc206922;
2+
3+
import net.minecraft.entity.Entity;
4+
import net.minecraft.entity.LightningEntity;
5+
import net.minecraft.server.world.ServerWorld;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
import org.spongepowered.asm.mixin.Shadow;
8+
import org.spongepowered.asm.mixin.injection.At;
9+
import org.spongepowered.asm.mixin.injection.Inject;
10+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
11+
12+
@Mixin(Entity.class)
13+
public class EntityMixin {
14+
@Shadow public int age;
15+
16+
@Inject(method = "onStruckByLightning", at = @At("HEAD"), cancellable = true)
17+
protected void struckByLightningHead(ServerWorld world, LightningEntity lightning, CallbackInfo ci) {}
18+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package cc.woverflow.debugify.mixins.server.mc206922;
2+
3+
import net.minecraft.entity.ItemEntity;
4+
import net.minecraft.entity.LightningEntity;
5+
import net.minecraft.server.world.ServerWorld;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
8+
9+
@Mixin(ItemEntity.class)
10+
public abstract class ItemEntityMixin extends EntityMixin {
11+
@Override
12+
protected void struckByLightningHead(ServerWorld world, LightningEntity lightning, CallbackInfo ci) {
13+
if (age <= 8) {
14+
ci.cancel();
15+
}
16+
}
17+
}

common/src/main/resources/debugify-common.mixins.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
"server.mc193343.LivingEntityMixin",
5353
"server.mc199467.MathHelperMixin",
5454
"server.mc200418.ZombieVillagerEntityMixin",
55+
"server.mc206922.EntityMixin",
56+
"server.mc206922.ItemEntityMixin",
5557
"server.mc214147.SkeletonEntityMixin",
5658
"server.mc215530.ServerPlayerEntityMixin",
5759
"server.mc223153.BlocksMixin",

0 commit comments

Comments
 (0)