Added Rule lightningKillsDrops
Which fixes [MC-206922](https://bugs.mojang.com/browse/MC-206922)
This commit is contained in:
1 parent
edd203a1f8
commit
680916880e
2 files changed
+20
No files matched your search
@@ -7,8 +7,10 @@ import net.minecraft.block.ShulkerBoxBlock;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.ItemEntity;
|
||||
import net.minecraft.entity.LightningEntity;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -29,6 +31,17 @@ public abstract class ItemEntityMixin extends Entity implements ItemEntityInterf
|
||||
super(entityType_1, world_1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStruckByLightning(ServerWorld world, LightningEntity lightning) {
|
||||
if (CarpetSettings.lightningKillsDropsFix) {
|
||||
if (this.age > 8) { //Only kill item if its older then 8 ticks
|
||||
super.onStruckByLightning(world, lightning);
|
||||
}
|
||||
} else {
|
||||
super.onStruckByLightning(world, lightning);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAgeCM() {
|
||||
return this.age;
|
||||
|
||||
Reference in new issue
Block a user