mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-02-04 09:50:16 +00:00
Clean up turtle/pocket computer item creation
- Remove ITurtleItem (and ITurtleBlockEntity): this was, AFAIK, mostly a relic of the pre-1.13 code where we had multiple turtle items. I do like the theory of abstracting everything out behind an interface, but given there's only one concrete implementation, I'm not convinced it's worth it right now. - Remove TurtleItemFactory/PocketComputerItemFactory: we now prefer calling the instance .create(...) method where we have the item available (for instance upgrade recipes). In the cases we don't (creating an item the first time round), we now move the static .create(...) method to the actual item class.
This commit is contained in:
@@ -39,7 +39,7 @@ import net.minecraft.world.phys.Vec3;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
|
||||
public class TurtleBlockEntity extends AbstractComputerBlockEntity implements BasicContainer, ITurtleBlockEntity {
|
||||
public class TurtleBlockEntity extends AbstractComputerBlockEntity implements BasicContainer {
|
||||
public static final int INVENTORY_SIZE = 16;
|
||||
public static final int INVENTORY_WIDTH = 4;
|
||||
public static final int INVENTORY_HEIGHT = 4;
|
||||
@@ -189,39 +189,30 @@ public class TurtleBlockEntity extends AbstractComputerBlockEntity implements Ba
|
||||
onTileEntityChange();
|
||||
}
|
||||
|
||||
// ITurtleTile
|
||||
|
||||
@Override
|
||||
public @Nullable ITurtleUpgrade getUpgrade(TurtleSide side) {
|
||||
return brain.getUpgrade(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return brain.getColour();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ResourceLocation getOverlay() {
|
||||
return brain.getOverlay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITurtleAccess getAccess() {
|
||||
return brain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3 getRenderOffset(float f) {
|
||||
return brain.getRenderOffset(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRenderYaw(float f) {
|
||||
return brain.getVisualYaw(f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getToolRenderAngle(TurtleSide side, float f) {
|
||||
return brain.getToolRenderAngle(side, f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user