-
Notifications
You must be signed in to change notification settings - Fork 178
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
1 parent
3789f4b
commit 308d436
Showing
13 changed files
with
71 additions
and
118 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
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
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
package gregtech.api.util; | ||
|
||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.math.Vec3i; | ||
|
||
import java.util.function.Function; | ||
|
||
/** | ||
* Relative direction when facing horizontally | ||
*/ | ||
public enum RelativeDirection { | ||
UP(f -> EnumFacing.UP), | ||
DOWN(f -> EnumFacing.DOWN), | ||
LEFT(EnumFacing::rotateYCCW), | ||
RIGHT(EnumFacing::rotateY), | ||
FRONT(Function.identity()), | ||
BACK(EnumFacing::getOpposite); | ||
|
||
final Function<EnumFacing, EnumFacing> actualFacing; | ||
|
||
RelativeDirection(Function<EnumFacing, EnumFacing> actualFacing) { | ||
this.actualFacing = actualFacing; | ||
} | ||
|
||
public EnumFacing getActualFacing(EnumFacing facing) { | ||
return actualFacing.apply(facing); | ||
} | ||
|
||
public EnumFacing apply(EnumFacing facing) { | ||
return actualFacing.apply(facing); | ||
} | ||
|
||
public Vec3i applyVec3i(EnumFacing facing) { | ||
return apply(facing).getDirectionVec(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package gregtech.api.util.function; | ||
|
||
@FunctionalInterface | ||
public interface Task { | ||
|
||
boolean run(); | ||
|
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
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