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);
|
||||
|
||||
@Inject(method = "get", at = @At("HEAD"), cancellable = true)
|
||||
private <T> void chipi$nullSafeGet(
|
||||
TrackedData<T> data,
|
||||
CallbackInfoReturnable<T> cir
|
||||
) {
|
||||
private <T> void chipi$nullSafeGet(TrackedData<T> data, CallbackInfoReturnable<T> cir) {
|
||||
DataTracker.Entry<T> entry = this.getEntry(data);
|
||||
|
||||
if (entry == null) {
|
||||
|
||||
@ -15,13 +15,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
public abstract class PlayerEntityMixin {
|
||||
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void chipi$initTrackedData(
|
||||
World world,
|
||||
BlockPos pos,
|
||||
float yaw,
|
||||
GameProfile profile,
|
||||
CallbackInfo ci
|
||||
) {
|
||||
private void chipi$initTrackedData(World world, BlockPos pos, float yaw, GameProfile profile, CallbackInfo ci) {
|
||||
PlayerEntity self = (PlayerEntity)(Object)this;
|
||||
DataTracker tracker = self.getDataTracker();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user