mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-20 03:59:55 +00:00
refactor 4
This commit is contained in:
1 parent
b9b8ac3b43
commit
d9449622b9
22 files changed
+350
-579
No files matched your search
@@ -1,7 +1,7 @@
|
||||
package com.glodblock.github.inventory.gui;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.TankDumpable;
|
||||
import com.glodblock.github.client.gui.ITankDump;
|
||||
import com.glodblock.github.network.CPacketDumpTank;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import java.util.Collections;
|
||||
@@ -36,7 +36,7 @@ public class ButtonMouseHandler implements MouseRegionManager.Handler {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static ButtonMouseHandler dumpTank(TankDumpable host, int index) {
|
||||
public static ButtonMouseHandler dumpTank(ITankDump host, int index) {
|
||||
return new ButtonMouseHandler(NameConst.TT_DUMP_TANK, () -> {
|
||||
if (host.canDumpTank(index)) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketDumpTank(index));
|
||||
|
||||
@@ -102,7 +102,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
DUAL_INTERFACE_PRIORITY_PART(new PartGuiFactory<IPriorityHost>(IPriorityHost.class) {
|
||||
PRIORITY_PART(new PartGuiFactory<IPriorityHost>(IPriorityHost.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IPriorityHost inv) {
|
||||
return new ContainerPriority(player.inventory, inv);
|
||||
@@ -114,19 +114,7 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
DUAL_INTERFACE_PRIORITY(new TileGuiFactory<IPriorityHost>(IPriorityHost.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IPriorityHost inv) {
|
||||
return new ContainerPriority(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, IPriorityHost inv) {
|
||||
return new GuiFCPriority(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_STORAGE_BUS_PRIORITY(new PartGuiFactory<IPriorityHost>(IPriorityHost.class) {
|
||||
PRIORITY_TILE(new TileGuiFactory<IPriorityHost>(IPriorityHost.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IPriorityHost inv) {
|
||||
return new ContainerPriority(player.inventory, inv);
|
||||
@@ -301,9 +289,9 @@ public enum GuiType {
|
||||
return ordinal < 0 || ordinal >= VALUES.size() ? null : VALUES.get(ordinal);
|
||||
}
|
||||
|
||||
public final GuiFactory guiFactory;
|
||||
public final IGuiFactory guiFactory;
|
||||
|
||||
GuiType(GuiFactory guiFactory) {
|
||||
GuiType(IGuiFactory guiFactory) {
|
||||
this.guiFactory = guiFactory;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface GuiFactory {
|
||||
public interface IGuiFactory {
|
||||
|
||||
@Nullable
|
||||
Object createServerGui(EntityPlayer player, World world, int x, int y, int z, EnumFacing face);
|
||||
@@ -9,7 +9,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class TileGuiFactory<T> implements GuiFactory {
|
||||
public abstract class TileGuiFactory<T> implements IGuiFactory {
|
||||
|
||||
protected final Class<T> invClass;
|
||||
|
||||
|
||||
Reference in new issue
Block a user