Refactor mixin methods: streamline parameter formatting in DataTrackerMixin and PlayerEntityMixin
This commit is contained in:
parent
64fc1eea2d
commit
613965f989
@ -16,10 +16,7 @@ public abstract class DataTrackerMixin {
|
|||||||
protected abstract <T> DataTracker.Entry<T> getEntry(TrackedData<T> data);
|
protected abstract <T> DataTracker.Entry<T> getEntry(TrackedData<T> data);
|
||||||
|
|
||||||
@Inject(method = "get", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "get", at = @At("HEAD"), cancellable = true)
|
||||||
private <T> void chipi$nullSafeGet(
|
private <T> void chipi$nullSafeGet(TrackedData<T> data, CallbackInfoReturnable<T> cir) {
|
||||||
TrackedData<T> data,
|
|
||||||
CallbackInfoReturnable<T> cir
|
|
||||||
) {
|
|
||||||
DataTracker.Entry<T> entry = this.getEntry(data);
|
DataTracker.Entry<T> entry = this.getEntry(data);
|
||||||
|
|
||||||
if (entry == null) {
|
if (entry == null) {
|
||||||
|
|||||||
@ -15,13 +15,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
public abstract class PlayerEntityMixin {
|
public abstract class PlayerEntityMixin {
|
||||||
|
|
||||||
@Inject(method = "<init>", at = @At("TAIL"))
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
private void chipi$initTrackedData(
|
private void chipi$initTrackedData(World world, BlockPos pos, float yaw, GameProfile profile, CallbackInfo ci) {
|
||||||
World world,
|
|
||||||
BlockPos pos,
|
|
||||||
float yaw,
|
|
||||||
GameProfile profile,
|
|
||||||
CallbackInfo ci
|
|
||||||
) {
|
|
||||||
PlayerEntity self = (PlayerEntity)(Object)this;
|
PlayerEntity self = (PlayerEntity)(Object)this;
|
||||||
DataTracker tracker = self.getDataTracker();
|
DataTracker tracker = self.getDataTracker();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user