mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-12 00:07:29 +00:00
Merge pull request #42 from GTNewHorizons/oc-api
fix no environement return
This commit is contained in:
1 file changed
+14
-1
+14
-1
@@ -34,7 +34,8 @@ public class DriverDualFluidInterface implements SidedBlock {
|
||||
|
||||
@Override
|
||||
public ManagedEnvironment createEnvironment(World world, int x, int y, int z, ForgeDirection side) {
|
||||
return null;
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
return new DriverDualFluidInterface.Environment(getInterface(te, side));
|
||||
}
|
||||
|
||||
public static class Environment extends ManagedTileEntityEnvironment<DualityFluidInterface> implements NamedBlock {
|
||||
@@ -110,6 +111,18 @@ public class DriverDualFluidInterface implements SidedBlock {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static DualityFluidInterface getInterface(TileEntity te, ForgeDirection face) {
|
||||
if (te != null) {
|
||||
if (te instanceof TileFluidInterface) {
|
||||
return ((TileFluidInterface) te).getDualityFluid();
|
||||
}
|
||||
if (te instanceof IPartHost && ((IPartHost) te).getPart(face) instanceof PartFluidInterface) {
|
||||
return ((PartFluidInterface) ((IPartHost) te).getPart(face)).getDualityFluid();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static class Provider implements EnvironmentProvider {
|
||||
Provider() {
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user