rename TileLegacyMachineBase to TileMachineBase
This commit is contained in:
parent
714ddd075b
commit
f6d5d88a4b
32 changed files with 80 additions and 82 deletions
|
@ -32,7 +32,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
import org.apache.commons.lang3.Range;
|
||||
import org.apache.commons.lang3.tuple.MutableTriple;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.client.container.IRightClickHandler;
|
||||
|
||||
|
@ -56,11 +56,11 @@ public class BuiltContainer extends Container {
|
|||
private List<Consumer<InventoryCrafting>> craftEvents;
|
||||
private Integer[] integerParts;
|
||||
|
||||
private final TileLegacyMachineBase tile;
|
||||
private final TileMachineBase tile;
|
||||
|
||||
public BuiltContainer(final String name, final Predicate<EntityPlayer> canInteract,
|
||||
final List<Range<Integer>> playerSlotRange,
|
||||
final List<Range<Integer>> tileSlotRange, TileLegacyMachineBase tile) {
|
||||
final List<Range<Integer>> tileSlotRange, TileMachineBase tile) {
|
||||
this.name = name;
|
||||
|
||||
this.canInteract = canInteract;
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.inventory.InventoryCrafting;
|
|||
import net.minecraft.inventory.Slot;
|
||||
import org.apache.commons.lang3.Range;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -76,7 +76,7 @@ public class ContainerBuilder {
|
|||
return new ContainerPlayerInventoryBuilder(this, player);
|
||||
}
|
||||
|
||||
public ContainerTileInventoryBuilder tile(final TileLegacyMachineBase tile) {
|
||||
public ContainerTileInventoryBuilder tile(final TileMachineBase tile) {
|
||||
return new ContainerTileInventoryBuilder(this, tile);
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class ContainerBuilder {
|
|||
this.tileInventoryRanges.add(range);
|
||||
}
|
||||
|
||||
public BuiltContainer create(final TileLegacyMachineBase tile) {
|
||||
public BuiltContainer create(final TileMachineBase tile) {
|
||||
final BuiltContainer built = new BuiltContainer(this.name, this.canInteract,
|
||||
this.playerInventoryRanges,
|
||||
this.tileInventoryRanges, tile);
|
||||
|
|
|
@ -38,7 +38,7 @@ import reborncore.client.gui.slots.BaseSlot;
|
|||
import reborncore.client.gui.slots.SlotFake;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.container.builder.slot.FilteredSlot;
|
||||
import techreborn.client.container.builder.slot.FurnaceFuelSlot;
|
||||
|
@ -51,11 +51,11 @@ import java.util.function.Predicate;
|
|||
|
||||
public class ContainerTileInventoryBuilder {
|
||||
|
||||
private final TileLegacyMachineBase tile;
|
||||
private final TileMachineBase tile;
|
||||
private final ContainerBuilder parent;
|
||||
private final int rangeStart;
|
||||
|
||||
ContainerTileInventoryBuilder(final ContainerBuilder parent, final TileLegacyMachineBase tile) {
|
||||
ContainerTileInventoryBuilder(final ContainerBuilder parent, final TileMachineBase tile) {
|
||||
this.tile = tile;
|
||||
this.parent = parent;
|
||||
this.rangeStart = parent.slots.size();
|
||||
|
|
|
@ -36,7 +36,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import reborncore.api.tile.IUpgradeable;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.gui.slot.GuiFluidConfiguration;
|
||||
import techreborn.client.gui.slot.GuiSlotConfiguration;
|
||||
|
@ -318,8 +318,8 @@ public class GuiBase extends GuiContainer {
|
|||
return super.isPointInRegion(rectX, rectY, rectWidth, rectHeight, pointX, pointY);
|
||||
}
|
||||
|
||||
public TileLegacyMachineBase getMachine(){
|
||||
return (TileLegacyMachineBase) tile;
|
||||
public TileMachineBase getMachine(){
|
||||
return (TileMachineBase) tile;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import techreborn.client.gui.GuiBase;
|
||||
import techreborn.client.gui.slot.elements.ConfigFluidElement;
|
||||
import techreborn.client.gui.slot.elements.ElementBase;
|
||||
|
@ -138,15 +138,15 @@ public class GuiFluidConfiguration {
|
|||
}
|
||||
|
||||
@Nullable
|
||||
private static TileLegacyMachineBase getMachine() {
|
||||
private static TileMachineBase getMachine() {
|
||||
if (!(Minecraft.getMinecraft().currentScreen instanceof GuiBase)) {
|
||||
return null;
|
||||
}
|
||||
GuiBase base = (GuiBase) Minecraft.getMinecraft().currentScreen;
|
||||
if (!(base.tile instanceof TileLegacyMachineBase)) {
|
||||
if (!(base.tile instanceof TileMachineBase)) {
|
||||
return null;
|
||||
}
|
||||
TileLegacyMachineBase machineBase = (TileLegacyMachineBase) base.tile;
|
||||
TileMachineBase machineBase = (TileMachineBase) base.tile;
|
||||
return machineBase;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,14 +32,13 @@ import net.minecraft.inventory.Slot;
|
|||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.SlotItemHandler;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import reborncore.client.gui.GuiUtil;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import reborncore.common.network.packet.PacketConfigSave;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.gui.GuiBase;
|
||||
import techreborn.client.gui.slot.elements.ConfigSlotElement;
|
||||
|
@ -127,7 +126,7 @@ public class GuiSlotConfiguration {
|
|||
}
|
||||
|
||||
public static void copyToClipboard(){
|
||||
TileLegacyMachineBase machine = getMachine();
|
||||
TileMachineBase machine = getMachine();
|
||||
if(machine == null || machine.slotConfiguration == null){
|
||||
return;
|
||||
}
|
||||
|
@ -137,7 +136,7 @@ public class GuiSlotConfiguration {
|
|||
}
|
||||
|
||||
public static void pasteFromClipboard(){
|
||||
TileLegacyMachineBase machine = getMachine();
|
||||
TileMachineBase machine = getMachine();
|
||||
if(machine == null || machine.slotConfiguration == null){
|
||||
return;
|
||||
}
|
||||
|
@ -152,15 +151,15 @@ public class GuiSlotConfiguration {
|
|||
}
|
||||
|
||||
@Nullable
|
||||
private static TileLegacyMachineBase getMachine(){
|
||||
private static TileMachineBase getMachine(){
|
||||
if(!(Minecraft.getMinecraft().currentScreen instanceof GuiBase)){
|
||||
return null;
|
||||
}
|
||||
GuiBase base = (GuiBase) Minecraft.getMinecraft().currentScreen;
|
||||
if(!(base.tile instanceof TileLegacyMachineBase)){
|
||||
if(!(base.tile instanceof TileMachineBase)){
|
||||
return null;
|
||||
}
|
||||
TileLegacyMachineBase machineBase = (TileLegacyMachineBase) base.tile;
|
||||
TileMachineBase machineBase = (TileMachineBase) base.tile;
|
||||
return machineBase;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui.slot.elements;
|
||||
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import techreborn.client.gui.GuiBase;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
@ -32,12 +32,12 @@ import java.util.function.Predicate;
|
|||
public class CheckBoxElement extends ElementBase {
|
||||
public String label, type;
|
||||
public int labelColor, slotID;
|
||||
public TileLegacyMachineBase machineBase;
|
||||
public TileMachineBase machineBase;
|
||||
Predicate<CheckBoxElement> ticked;
|
||||
|
||||
private Sprite.CheckBox checkBoxSprite;
|
||||
|
||||
public CheckBoxElement(String label, int labelColor, int x, int y, String type, int slotID, Sprite.CheckBox checkBoxSprite, TileLegacyMachineBase machineBase, Predicate<CheckBoxElement> ticked) {
|
||||
public CheckBoxElement(String label, int labelColor, int x, int y, String type, int slotID, Sprite.CheckBox checkBoxSprite, TileMachineBase machineBase, Predicate<CheckBoxElement> ticked) {
|
||||
super(x, y, checkBoxSprite.getNormal());
|
||||
this.checkBoxSprite = checkBoxSprite;
|
||||
this.type = type;
|
||||
|
|
|
@ -31,7 +31,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.client.gui.GuiBase;
|
||||
|
||||
|
@ -110,7 +110,7 @@ public class ElementBase {
|
|||
return container;
|
||||
}
|
||||
|
||||
public void adjustDimensions(TileLegacyMachineBase provider) {
|
||||
public void adjustDimensions(TileMachineBase provider) {
|
||||
if (container.offsetSprites != null) {
|
||||
for (OffsetSprite offsetSprite : container.offsetSprites) {
|
||||
if (offsetSprite.getSprite().getSprite(provider).width + offsetSprite.getOffsetX(provider) > this.width) {
|
||||
|
@ -175,12 +175,12 @@ public class ElementBase {
|
|||
return this;
|
||||
}
|
||||
|
||||
public int getWidth(TileLegacyMachineBase provider) {
|
||||
public int getWidth(TileMachineBase provider) {
|
||||
adjustDimensions(provider);
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight(TileLegacyMachineBase provider) {
|
||||
public int getHeight(TileMachineBase provider) {
|
||||
adjustDimensions(provider);
|
||||
return height;
|
||||
}
|
||||
|
@ -218,28 +218,28 @@ public class ElementBase {
|
|||
return this;
|
||||
}
|
||||
|
||||
public boolean onHover(TileLegacyMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
public boolean onHover(TileMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
for (ElementBase.Action action : hoverActions) {
|
||||
action.execute(this, gui, provider, mouseX, mouseY);
|
||||
}
|
||||
return !hoverActions.isEmpty();
|
||||
}
|
||||
|
||||
public boolean onDrag(TileLegacyMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
public boolean onDrag(TileMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
for (ElementBase.Action action : dragActions) {
|
||||
action.execute(this, gui, provider, mouseX, mouseY);
|
||||
}
|
||||
return !dragActions.isEmpty();
|
||||
}
|
||||
|
||||
public boolean onStartPress(TileLegacyMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
public boolean onStartPress(TileMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
for (ElementBase.Action action : startPressActions) {
|
||||
action.execute(this, gui, provider, mouseX, mouseY);
|
||||
}
|
||||
return !startPressActions.isEmpty();
|
||||
}
|
||||
|
||||
public boolean onRelease(TileLegacyMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
public boolean onRelease(TileMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
for (ElementBase.Action action : releaseActions) {
|
||||
if(action.execute(this, gui, provider, mouseX, mouseY)){
|
||||
return true;
|
||||
|
@ -254,7 +254,7 @@ public class ElementBase {
|
|||
}
|
||||
|
||||
public interface Action {
|
||||
boolean execute(ElementBase element, GuiBase gui, TileLegacyMachineBase provider, int mouseX, int mouseY);
|
||||
boolean execute(ElementBase element, GuiBase gui, TileMachineBase provider, int mouseX, int mouseY);
|
||||
}
|
||||
|
||||
public interface UpdateAction {
|
||||
|
|
|
@ -39,7 +39,7 @@ import reborncore.common.network.NetworkManager;
|
|||
import reborncore.common.network.packet.PacketFluidConfigSave;
|
||||
import reborncore.common.network.packet.PacketFluidIOSave;
|
||||
import reborncore.common.tile.FluidConfiguration;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import reborncore.common.util.MachineFacing;
|
||||
import techreborn.client.gui.GuiBase;
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class FluidConfigPopupElement extends ElementBase {
|
|||
drawDefaultBackground(gui, adjustX(gui, getX() - 8), adjustY(gui, getY() - 7), 84, 105 + (filter ? 15 : 0));
|
||||
super.draw(gui);
|
||||
|
||||
TileLegacyMachineBase machine = ((TileLegacyMachineBase) gui.tile);
|
||||
TileMachineBase machine = ((TileMachineBase) gui.tile);
|
||||
IBlockAccess blockAccess = machine.getWorld();
|
||||
BlockPos pos = machine.getPos();
|
||||
IBlockState state = blockAccess.getBlockState(pos);
|
||||
|
@ -85,7 +85,7 @@ public class FluidConfigPopupElement extends ElementBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onRelease(TileLegacyMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
public boolean onRelease(TileMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
if (isInBox(23, 4, 16, 16, mouseX, mouseY, gui)) {
|
||||
cyleConfig(MachineFacing.UP.getFacing(provider), gui);
|
||||
} else if (isInBox(23, 23, 16, 16, mouseX, mouseY, gui)) {
|
||||
|
@ -130,13 +130,13 @@ public class FluidConfigPopupElement extends ElementBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onHover(TileLegacyMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
public boolean onHover(TileMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
lastMousex = mouseX;
|
||||
lastMousey = mouseY;
|
||||
return super.onHover(provider, gui, mouseX, mouseY);
|
||||
}
|
||||
|
||||
private void drawSateColor(TileLegacyMachineBase machineBase, EnumFacing side, int inx, int iny, GuiBase gui) {
|
||||
private void drawSateColor(TileMachineBase machineBase, EnumFacing side, int inx, int iny, GuiBase gui) {
|
||||
iny += 4;
|
||||
int sx = inx + getX() + gui.guiLeft;
|
||||
int sy = iny + getY() + gui.guiTop;
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
package techreborn.client.gui.slot.elements;
|
||||
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
|
||||
public interface ISprite {
|
||||
Sprite getSprite(TileLegacyMachineBase provider);
|
||||
Sprite getSprite(TileMachineBase provider);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
package techreborn.client.gui.slot.elements;
|
||||
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
|
||||
public class OffsetSprite {
|
||||
public ISprite sprite;
|
||||
|
@ -41,7 +41,7 @@ public class OffsetSprite {
|
|||
this.sprite = sprite;
|
||||
}
|
||||
|
||||
public OffsetSprite(Sprite sprite, TileLegacyMachineBase provider) {
|
||||
public OffsetSprite(Sprite sprite, TileMachineBase provider) {
|
||||
this.sprite = sprite;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class OffsetSprite {
|
|||
return sprite;
|
||||
}
|
||||
|
||||
public int getOffsetX(TileLegacyMachineBase provider) {
|
||||
public int getOffsetX(TileMachineBase provider) {
|
||||
return offsetX + sprite.getSprite(provider).offsetX;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class OffsetSprite {
|
|||
return this;
|
||||
}
|
||||
|
||||
public int getOffsetY(TileLegacyMachineBase provider) {
|
||||
public int getOffsetY(TileMachineBase provider) {
|
||||
return offsetY + sprite.getSprite(provider).offsetY;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ import reborncore.common.network.NetworkManager;
|
|||
import reborncore.common.network.packet.PacketIOSave;
|
||||
import reborncore.common.network.packet.PacketSlotSave;
|
||||
import reborncore.common.tile.SlotConfiguration;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import reborncore.common.util.MachineFacing;
|
||||
import techreborn.client.gui.GuiBase;
|
||||
|
||||
|
@ -63,7 +63,7 @@ public class SlotConfigPopupElement extends ElementBase {
|
|||
drawDefaultBackground(gui, adjustX(gui, getX() -8), adjustY(gui, getY() - 7), 84, 105 + (filter ? 15 : 0));
|
||||
super.draw(gui);
|
||||
|
||||
TileLegacyMachineBase machine = ((TileLegacyMachineBase) gui.tile);
|
||||
TileMachineBase machine = ((TileMachineBase) gui.tile);
|
||||
IBlockAccess blockAccess = machine.getWorld();
|
||||
BlockPos pos = machine.getPos();
|
||||
IBlockState state = blockAccess.getBlockState(pos);
|
||||
|
@ -88,7 +88,7 @@ public class SlotConfigPopupElement extends ElementBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onRelease(TileLegacyMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
public boolean onRelease(TileMachineBase provider, GuiBase gui, int mouseX, int mouseY) {
|
||||
if(isInBox(23 , 4, 16, 16, mouseX, mouseY, gui)){
|
||||
cyleSlotConfig(MachineFacing.UP.getFacing(provider), gui);
|
||||
} else if(isInBox(23 , 23, 16, 16, mouseX, mouseY, gui)){
|
||||
|
@ -135,7 +135,7 @@ public class SlotConfigPopupElement extends ElementBase {
|
|||
NetworkManager.sendToServer(packetSlotSave);
|
||||
}
|
||||
|
||||
private void drawSlotSateColor(TileLegacyMachineBase machineBase, EnumFacing side, int slotID, int inx, int iny, GuiBase gui){
|
||||
private void drawSlotSateColor(TileMachineBase machineBase, EnumFacing side, int slotID, int inx, int iny, GuiBase gui){
|
||||
iny += 4;
|
||||
int sx = inx + getX() + gui.guiLeft;
|
||||
int sy = iny + getY() + gui.guiTop;
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.init.Blocks;
|
|||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
|
||||
public class Sprite implements ISprite {
|
||||
public static final Sprite EMPTY = new Sprite(ElementBase.MECH_ELEMENTS, 0, 0, 0, 0);
|
||||
|
@ -103,7 +103,7 @@ public class Sprite implements ISprite {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Sprite getSprite(TileLegacyMachineBase provider) {
|
||||
public Sprite getSprite(TileMachineBase provider) {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue