|
8 | 8 | import li.cil.oc.api.machine.Arguments;
|
9 | 9 | import li.cil.oc.api.machine.Callback;
|
10 | 10 | import li.cil.oc.api.machine.Context;
|
11 |
| -import li.cil.oc.api.network.ManagedEnvironment; |
12 |
| -import li.cil.oc.api.prefab.DriverSidedTileEntity; |
13 | 11 | import net.minecraft.tileentity.TileEntity;
|
14 | 12 | import net.minecraft.util.EnumFacing;
|
15 | 13 | import net.minecraft.util.math.BlockPos;
|
16 | 14 | import net.minecraft.world.World;
|
17 | 15 | import pl.asie.computronics.integration.CCMultiPeripheral;
|
| 16 | +import pl.asie.computronics.integration.DriverSpecificTileEntity; |
18 | 17 | import pl.asie.computronics.integration.NamedManagedEnvironment;
|
19 | 18 | import pl.asie.computronics.reference.Names;
|
20 | 19 |
|
@@ -112,7 +111,7 @@ private static Object[] modes() {
|
112 | 111 | return new Object[] { modes };
|
113 | 112 | }
|
114 | 113 |
|
115 |
| - public static class OCDriver extends DriverSidedTileEntity { |
| 114 | + public static class OCDriver extends DriverSpecificTileEntity<TileCapBank> { |
116 | 115 |
|
117 | 116 | public static class InternalManagedEnvironment extends NamedManagedEnvironment<TileCapBank> {
|
118 | 117 |
|
@@ -176,14 +175,13 @@ public Object[] redstone_modes(Context c, Arguments a) {
|
176 | 175 | }
|
177 | 176 | }
|
178 | 177 |
|
179 |
| - @Override |
180 |
| - public Class<?> getTileEntityClass() { |
181 |
| - return TileCapBank.class; |
| 178 | + public OCDriver(){ |
| 179 | + super(TileCapBank.class); |
182 | 180 | }
|
183 | 181 |
|
184 | 182 | @Override
|
185 |
| - public ManagedEnvironment createEnvironment(World world, BlockPos pos, EnumFacing side) { |
186 |
| - return new InternalManagedEnvironment(((TileCapBank) world.getTileEntity(pos))); |
| 183 | + public InternalManagedEnvironment createEnvironment(World world, BlockPos pos, EnumFacing side, TileCapBank tile) { |
| 184 | + return new InternalManagedEnvironment(tile); |
187 | 185 | }
|
188 | 186 | }
|
189 | 187 |
|
@@ -270,7 +268,7 @@ public Object[] callMethod(IComputerAccess computer, ILuaContext context, int me
|
270 | 268 | return DriverCapacitorBank.modes();
|
271 | 269 | }
|
272 | 270 | }
|
273 |
| - return null; |
| 271 | + return new Object[] {}; |
274 | 272 | }
|
275 | 273 | }
|
276 | 274 | }
|
0 commit comments