forked from AE2-UEL/AE2FluidCraft-Rework
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'Laiff/feature/level-maintainer-terminal…
…' into dev
- Loading branch information
Showing
63 changed files
with
4,090 additions
and
464 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.glodblock.github.api; | ||
|
||
import net.minecraftforge.common.util.ForgeDirection; | ||
|
||
public interface ISide { | ||
|
||
ForgeDirection getSide(); | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/glodblock/github/api/registries/ILevelTerminalRegistry.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 com.glodblock.github.api.registries; | ||
|
||
import java.util.Set; | ||
|
||
import appeng.api.networking.IGridHost; | ||
|
||
public interface ILevelTerminalRegistry { | ||
|
||
void register(Class<? extends ILevelViewable> clazz); | ||
|
||
void register(Class<? extends IGridHost> aeClass, ILevelViewableAdapter adapter); | ||
|
||
Set<Class<? extends ILevelViewable>> getSupportedClasses(); | ||
|
||
boolean isAdopted(Class<? extends ILevelViewable> clazz); | ||
|
||
Class<? extends IGridHost> getAdopted(Class<? extends ILevelViewable> clazz); | ||
|
||
ILevelViewableAdapter getAdapter(Class<? extends ILevelViewable> clazz); | ||
} |
53 changes: 53 additions & 0 deletions
53
src/main/java/com/glodblock/github/api/registries/ILevelViewable.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.glodblock.github.api.registries; | ||
|
||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntity; | ||
|
||
import com.glodblock.github.api.ISide; | ||
|
||
import appeng.api.implementations.tiles.ISegmentedInventory; | ||
import appeng.api.networking.IGridHost; | ||
import appeng.api.util.DimensionalCoord; | ||
import appeng.helpers.ICustomNameObject; | ||
|
||
public interface ILevelViewable extends IGridHost, ISide, ISegmentedInventory, ICustomNameObject { | ||
|
||
DimensionalCoord getLocation(); | ||
|
||
TileEntity getTile(); | ||
|
||
default long getSortValue() { | ||
TileEntity te = getTile(); | ||
return ((long) te.zCoord << 24) ^ ((long) te.xCoord << 8) ^ te.yCoord; | ||
} | ||
|
||
default boolean shouldDisplay() { | ||
return true; | ||
} | ||
|
||
/** | ||
* Number of rows to expect. This is used with {@link #rowSize()} to determine how to render the slots. | ||
*/ | ||
default int rows() { | ||
return 1; | ||
}; | ||
|
||
/** | ||
* Number of slots per row. | ||
*/ | ||
default int rowSize() { | ||
return 1; | ||
}; | ||
|
||
default ItemStack getSelfItemStack() { | ||
return null; | ||
} | ||
|
||
/** | ||
* "Target" Display representation | ||
*/ | ||
default ItemStack getDisplayItemStack() { | ||
return null; | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/glodblock/github/api/registries/ILevelViewableAdapter.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,8 @@ | ||
package com.glodblock.github.api.registries; | ||
|
||
import appeng.api.networking.IGridHost; | ||
|
||
public interface ILevelViewableAdapter extends ILevelViewable { | ||
|
||
ILevelViewable adapt(IGridHost gridHost); | ||
} |
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
Oops, something went wrong.