Skip to content

Commit

Permalink
MC-206922
Browse files Browse the repository at this point in the history
  • Loading branch information
isXander committed Apr 5, 2022
1 parent 33c68e1 commit 5ac3e5a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions PATCHED.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
| [MC-200418](https://bugs.mojang.com/browse/MC-200418) | Cured baby zombie villagers stay as jockey variant |
| [MC-214147](https://bugs.mojang.com/browse/MC-214147) | Skeletons wearing leather armor still convert to strays in powder snow |
| [MC-206705](https://bugs.mojang.com/browse/MC-206705) | Spyglasses stay in use in spectator mode |
| [MC-206922](https://bugs.mojang.com/browse/MC-206922) | Items dropped by entities that are killed by lightning instantly disappear |
| [MC-215530](https://bugs.mojang.com/browse/MC-215530) | The freezing effect isn't immediately removed when switching into spectator mode |
| [MC-223153](https://bugs.mojang.com/browse/MC-223153) | Block of Raw Copper uses stone sounds instead of copper sounds |
| [MC-231743](https://bugs.mojang.com/browse/MC-231743) | minecraft.used:minecraft.POTTABLE_PLANT doesn't increase when placing plants into flower pots |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cc.woverflow.debugify.mixins.server.mc206922;

import net.minecraft.entity.Entity;
import net.minecraft.entity.LightningEntity;
import net.minecraft.server.world.ServerWorld;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(Entity.class)
public class EntityMixin {
@Shadow public int age;

@Inject(method = "onStruckByLightning", at = @At("HEAD"), cancellable = true)
protected void struckByLightningHead(ServerWorld world, LightningEntity lightning, CallbackInfo ci) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package cc.woverflow.debugify.mixins.server.mc206922;

import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.LightningEntity;
import net.minecraft.server.world.ServerWorld;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ItemEntity.class)
public abstract class ItemEntityMixin extends EntityMixin {
@Override
protected void struckByLightningHead(ServerWorld world, LightningEntity lightning, CallbackInfo ci) {
if (age <= 8) {
ci.cancel();
}
}
}
2 changes: 2 additions & 0 deletions common/src/main/resources/debugify-common.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
"server.mc193343.LivingEntityMixin",
"server.mc199467.MathHelperMixin",
"server.mc200418.ZombieVillagerEntityMixin",
"server.mc206922.EntityMixin",
"server.mc206922.ItemEntityMixin",
"server.mc214147.SkeletonEntityMixin",
"server.mc215530.ServerPlayerEntityMixin",
"server.mc223153.BlocksMixin",
Expand Down

0 comments on commit 5ac3e5a

Please sign in to comment.