generated from isXander/FabricKotlinTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
common/src/main/java/cc/woverflow/debugify/mixins/server/mc206922/EntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) {} | ||
} |
17 changes: 17 additions & 0 deletions
17
common/src/main/java/cc/woverflow/debugify/mixins/server/mc206922/ItemEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters