-
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.
- Loading branch information
Showing
8 changed files
with
123 additions
and
34 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/main/java/com/pancake/surviving_the_aftermath/api/PortalShapeAccessor.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 com.pancake.surviving_the_aftermath.api; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.Direction; | ||
|
||
public interface PortalShapeAccessor { | ||
//bottomLeft | ||
BlockPos survivingTheAftermath$getBottomLeft(); | ||
|
||
//height | ||
int survivingTheAftermath$getHeight(); | ||
|
||
//width | ||
int survivingTheAftermath$getWidth(); | ||
|
||
//rightDir | ||
Direction survivingTheAftermath$getRightDir(); | ||
} |
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
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
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
53 changes: 53 additions & 0 deletions
53
src/main/java/com/pancake/surviving_the_aftermath/common/mixin/PortalShapeMixin.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,53 @@ | ||
package com.pancake.surviving_the_aftermath.common.mixin; | ||
|
||
import com.pancake.surviving_the_aftermath.api.PortalShapeAccessor; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.level.portal.PortalShape; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
@Mixin(PortalShape.class) | ||
public class PortalShapeMixin implements PortalShapeAccessor { | ||
//bottomLeft | ||
@Shadow | ||
private BlockPos bottomLeft; | ||
|
||
//height | ||
@Shadow | ||
private int height; | ||
|
||
//width | ||
@Final | ||
@Shadow | ||
private int width; | ||
|
||
//rightDir | ||
@Final | ||
@Shadow | ||
private Direction rightDir; | ||
|
||
|
||
@Override | ||
public BlockPos survivingTheAftermath$getBottomLeft() { | ||
return bottomLeft; | ||
} | ||
|
||
@Override | ||
public int survivingTheAftermath$getHeight() { | ||
return height; | ||
} | ||
|
||
@Override | ||
public int survivingTheAftermath$getWidth() { | ||
return width; | ||
} | ||
|
||
@Override | ||
public Direction survivingTheAftermath$getRightDir() { | ||
return rightDir; | ||
} | ||
} | ||
|
||
|
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
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
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