-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add methods for GlobalPos class->record change
- Loading branch information
Showing
8 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
iCommon-API/src/main/java/me/isaiah/common/cmixin/IMixinGlobalPos.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,20 @@ | ||
package me.isaiah.common.cmixin; | ||
|
||
import net.minecraft.util.math.BlockPos; | ||
|
||
public interface IMixinGlobalPos { | ||
|
||
/** | ||
* convince method. | ||
* | ||
* <=1.20.4 is method_19446 | ||
* >=1.20.5 is comp_2208 | ||
* | ||
*/ | ||
public BlockPos IC$get_pos(); | ||
|
||
/** | ||
*/ | ||
public Object IC$get_dimension(); | ||
|
||
} |
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
22 changes: 22 additions & 0 deletions
22
iCommon-Fabric-1.18.2/src/main/java/me/isaiah/common/mixin/R1_18/MixinGlobalPos.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,22 @@ | ||
package me.isaiah.common.mixin.R1_18; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
import me.isaiah.common.cmixin.IMixinGlobalPos; | ||
import net.minecraft.util.dynamic.GlobalPos; | ||
import net.minecraft.util.math.BlockPos; | ||
|
||
@Mixin(GlobalPos.class) | ||
public class MixinGlobalPos implements IMixinGlobalPos { | ||
|
||
@Override | ||
public BlockPos IC$get_pos() { | ||
return ((GlobalPos)(Object)this).getPos(); | ||
} | ||
|
||
@Override | ||
public Object IC$get_dimension() { | ||
return ((GlobalPos)(Object)this).getDimension(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
iCommon-Fabric-1.19.4/src/main/java/me/isaiah/common/mixin/R1_19/MixinGlobalPos.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,22 @@ | ||
package me.isaiah.common.mixin.R1_19; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
import me.isaiah.common.cmixin.IMixinGlobalPos; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.GlobalPos; | ||
|
||
@Mixin(GlobalPos.class) | ||
public class MixinGlobalPos implements IMixinGlobalPos { | ||
|
||
@Override | ||
public BlockPos IC$get_pos() { | ||
return ((GlobalPos)(Object)this).getPos(); | ||
} | ||
|
||
@Override | ||
public Object IC$get_dimension() { | ||
return ((GlobalPos)(Object)this).getDimension(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
iCommon-Fabric-1.19/src/main/java/me/isaiah/common/mixin/R1_19/MixinGlobalPos.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,22 @@ | ||
package me.isaiah.common.mixin.R1_19; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
import me.isaiah.common.cmixin.IMixinGlobalPos; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.GlobalPos; | ||
|
||
@Mixin(GlobalPos.class) | ||
public class MixinGlobalPos implements IMixinGlobalPos { | ||
|
||
@Override | ||
public BlockPos IC$get_pos() { | ||
return ((GlobalPos)(Object)this).getPos(); | ||
} | ||
|
||
@Override | ||
public Object IC$get_dimension() { | ||
return ((GlobalPos)(Object)this).getDimension(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
iCommon-Fabric-1.20.1/src/main/java/me/isaiah/common/mixin/R1_20/MixinGlobalPos.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,22 @@ | ||
package me.isaiah.common.mixin.R1_20; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
import me.isaiah.common.cmixin.IMixinGlobalPos; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.GlobalPos; | ||
|
||
@Mixin(GlobalPos.class) | ||
public class MixinGlobalPos implements IMixinGlobalPos { | ||
|
||
@Override | ||
public BlockPos IC$get_pos() { | ||
return ((GlobalPos)(Object)this).getPos(); | ||
} | ||
|
||
@Override | ||
public Object IC$get_dimension() { | ||
return ((GlobalPos)(Object)this).getDimension(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
iCommon-Fabric-1.20.2/src/main/java/me/isaiah/common/mixin/R1_20/MixinGlobalPos.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,22 @@ | ||
package me.isaiah.common.mixin.R1_20; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
import me.isaiah.common.cmixin.IMixinGlobalPos; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.GlobalPos; | ||
|
||
@Mixin(GlobalPos.class) | ||
public class MixinGlobalPos implements IMixinGlobalPos { | ||
|
||
@Override | ||
public BlockPos IC$get_pos() { | ||
return ((GlobalPos)(Object)this).getPos(); | ||
} | ||
|
||
@Override | ||
public Object IC$get_dimension() { | ||
return ((GlobalPos)(Object)this).getDimension(); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
iCommon-Fabric-1.20.5/src/main/java/me/isaiah/common/mixin/R1_20/MixinGlobalPos.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,26 @@ | ||
package me.isaiah.common.mixin.R1_20; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
import me.isaiah.common.cmixin.IMixinGlobalPos; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.GlobalPos; | ||
|
||
@Mixin(GlobalPos.class) | ||
public class MixinGlobalPos implements IMixinGlobalPos { | ||
|
||
@Override | ||
public BlockPos IC$get_pos() { | ||
// <=1.20.4 is method_19446 / getPos() | ||
// >=1.20.5 is comp_2208 / pos() | ||
return ((GlobalPos)(Object)this).comp_2208(); | ||
} | ||
|
||
@Override | ||
public Object IC$get_dimension() { | ||
// <=1.20.4 is method_19442 / getDimension() | ||
// >=1.20.5 is comp_2207 / dimension() | ||
return ((GlobalPos)(Object)this).comp_2207(); | ||
} | ||
|
||
} |