-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Deleted useless Dispenser Mixin)
- Loading branch information
Showing
4 changed files
with
29 additions
and
46 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
45 changes: 0 additions & 45 deletions
45
src/main/java/net/rober/robercarpet/mixin/FarmableClayMixin.java
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
src/main/java/net/rober/robercarpet/mixin/KeepInventoryMixin.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,24 @@ | ||
package net.rober.robercarpet.mixin; | ||
|
||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import net.rober.robercarpet.RoberCarpetSettings; | ||
import org.objectweb.asm.Opcodes; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(ServerPlayerEntity.class) | ||
public abstract class KeepInventoryMixin { | ||
@Redirect(method= "copyFrom(Lnet/minecraft/server/network/ServerPlayerEntity;Z)V",at=@At(value = "FIELD",target = "Lnet/minecraft/server/network/ServerPlayerEntity;experienceLevel:I", opcode = Opcodes.PUTFIELD)) | ||
private void LevelMixin(ServerPlayerEntity player, int original){ | ||
player.experienceLevel = RoberCarpetSettings.KeepInventoryResetXP?0:original; | ||
} | ||
@Redirect(method= "copyFrom(Lnet/minecraft/server/network/ServerPlayerEntity;Z)V",at=@At(value = "FIELD",target = "Lnet/minecraft/server/network/ServerPlayerEntity;totalExperience:I", opcode = Opcodes.PUTFIELD)) | ||
private void TotalMixin(ServerPlayerEntity player, int original){ | ||
player.totalExperience = RoberCarpetSettings.KeepInventoryResetXP?0:original; | ||
} | ||
@Redirect(method= "copyFrom(Lnet/minecraft/server/network/ServerPlayerEntity;Z)V",at=@At(value = "FIELD",target = "Lnet/minecraft/server/network/ServerPlayerEntity;experienceProgress:F", opcode = Opcodes.PUTFIELD)) | ||
private void ProgressMixin(ServerPlayerEntity player, float original){ | ||
player.experienceProgress = RoberCarpetSettings.KeepInventoryResetXP?0:original; | ||
} | ||
} |
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