Refactor guis

This commit is contained in:
modmuss50 2020-03-31 10:40:19 +01:00
parent 36506aac6b
commit bb6ff90f9b
21 changed files with 321 additions and 374 deletions

View file

@ -26,7 +26,7 @@ package techreborn.blocks;
import net.minecraft.util.Identifier;
import techreborn.blockentity.data.DataDrivenBEProvider;
import techreborn.client.EGui;
import techreborn.client.GuiType;
/**
* @author modmuss50
@ -37,7 +37,7 @@ public class DataDrivenMachineBlock extends GenericMachineBlock {
private final DataDrivenBEProvider provider;
public DataDrivenMachineBlock(String ident){
super(EGui.DATA_DRIVEN, null);
super(GuiType.DATA_DRIVEN, null);
provider = DataDrivenBEProvider.create(this, new Identifier(ident));
blockEntityClass = provider;
}

View file

@ -28,7 +28,6 @@ import net.minecraft.block.entity.BlockEntity;
import net.minecraft.world.BlockView;
import reborncore.api.blockentity.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.EGui;
import java.util.function.Supplier;
@ -38,10 +37,10 @@ import java.util.function.Supplier;
*/
public class GenericMachineBlock extends BlockMachineBase {
private EGui gui;
private IMachineGuiHandler gui;
Supplier<BlockEntity> blockEntityClass;
public GenericMachineBlock(EGui gui, Supplier<BlockEntity> blockEntityClass) {
public GenericMachineBlock(IMachineGuiHandler gui, Supplier<BlockEntity> blockEntityClass) {
super();
this.blockEntityClass = blockEntityClass;
this.gui = gui;

View file

@ -39,9 +39,9 @@ import net.minecraft.world.World;
import reborncore.api.blockentity.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.util.Torus;
import techreborn.client.EGui;
import techreborn.init.TRContent;
import techreborn.blockentity.machine.multiblock.FusionControlComputerBlockEntity;
import techreborn.client.GuiType;
import techreborn.init.TRContent;
import techreborn.utils.damageSources.FusionDamageSource;
import java.util.List;
@ -78,7 +78,7 @@ public class BlockFusionControlComputer extends BlockMachineBase {
@Override
public IMachineGuiHandler getGui() {
return EGui.FUSION_CONTROLLER;
return GuiType.FUSION_CONTROLLER;
}
@Override

View file

@ -33,7 +33,7 @@ import reborncore.api.blockentity.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import techreborn.blockentity.generator.SolarPanelBlockEntity;
import techreborn.client.EGui;
import techreborn.client.GuiType;
import techreborn.init.TRContent.SolarPanels;
/**
@ -58,7 +58,7 @@ public class BlockSolarPanel extends BlockMachineBase {
if(this.panelType == SolarPanels.CREATIVE){
return null;
}
return EGui.SOLAR_PANEL;
return GuiType.SOLAR_PANEL;
}
@Override

View file

@ -28,9 +28,9 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.api.blockentity.IMachineGuiHandler;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import techreborn.blocks.GenericMachineBlock;
import techreborn.client.EGui;
import java.util.function.Supplier;
@ -39,7 +39,7 @@ import java.util.function.Supplier;
* for generators, like comparator output based on energy.
*/
public class GenericGeneratorBlock extends GenericMachineBlock {
public GenericGeneratorBlock(EGui gui, Supplier<BlockEntity> blockEntityClass) {
public GenericGeneratorBlock(IMachineGuiHandler gui, Supplier<BlockEntity> blockEntityClass) {
super(gui, blockEntityClass);
}

View file

@ -24,8 +24,6 @@
package techreborn.blocks.machine.tier0;
import java.util.Random;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.BlockState;
@ -35,14 +33,16 @@ import net.minecraft.sound.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.blockentity.machine.iron.IronAlloyFurnaceBlockEntity;
import techreborn.blocks.GenericMachineBlock;
import techreborn.client.GuiType;
import java.util.Random;
public class IronAlloyFurnaceBlock extends GenericMachineBlock {
public IronAlloyFurnaceBlock() {
super(EGui.ALLOY_FURNACE, IronAlloyFurnaceBlockEntity::new);
super(GuiType.ALLOY_FURNACE, IronAlloyFurnaceBlockEntity::new);
}
// Block

View file

@ -33,16 +33,16 @@ import net.minecraft.sound.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.blockentity.machine.iron.IronFurnaceBlockEntity;
import techreborn.blocks.GenericMachineBlock;
import techreborn.client.GuiType;
import java.util.Random;
public class IronFurnaceBlock extends GenericMachineBlock {
public IronFurnaceBlock() {
super(EGui.IRON_FURNACE, IronFurnaceBlockEntity::new);
super(GuiType.IRON_FURNACE, IronFurnaceBlockEntity::new);
}
// Block

View file

@ -24,17 +24,16 @@
package techreborn.blocks.storage;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import techreborn.blocks.GenericMachineBlock;
import techreborn.client.EGui;
import techreborn.client.GuiType;
import java.util.function.Supplier;
@Deprecated
public class OldBlock extends GenericMachineBlock {
public OldBlock(EGui gui, Supplier<BlockEntity> blockEntityClass) {
public OldBlock(GuiType gui, Supplier<BlockEntity> blockEntityClass) {
super(gui, blockEntityClass);
}
}

View file

@ -27,12 +27,12 @@ package techreborn.blocks.storage.energy;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.world.BlockView;
import techreborn.blockentity.storage.energy.AdjustableSUBlockEntity;
import techreborn.client.EGui;
import techreborn.client.GuiType;
public class AdjustableSUBlock extends EnergyStorageBlock {
public AdjustableSUBlock() {
super("AESU", EGui.AESU);
super("AESU", GuiType.AESU);
}
@Override

View file

@ -27,7 +27,7 @@ package techreborn.blocks.storage.energy;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.world.BlockView;
import techreborn.blockentity.storage.energy.HighVoltageSUBlockEntity;
import techreborn.client.EGui;
import techreborn.client.GuiType;
/**
* Created by modmuss50 on 14/03/2016.
@ -35,7 +35,7 @@ import techreborn.client.EGui;
public class HighVoltageSUBlock extends EnergyStorageBlock {
public HighVoltageSUBlock() {
super("high_voltage_su", EGui.HIGH_VOLTAGE_SU);
super("high_voltage_su", GuiType.HIGH_VOLTAGE_SU);
}
@Override

View file

@ -33,12 +33,12 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import techreborn.blockentity.storage.energy.idsu.InterdimensionalSUBlockEntity;
import techreborn.client.EGui;
import techreborn.client.GuiType;
public class InterdimensionalSUBlock extends EnergyStorageBlock {
public InterdimensionalSUBlock() {
super("IDSU", EGui.IDSU);
super("IDSU", GuiType.IDSU);
}
@Override

View file

@ -27,12 +27,12 @@ package techreborn.blocks.storage.energy;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.world.BlockView;
import techreborn.blockentity.storage.energy.lesu.LapotronicSUBlockEntity;
import techreborn.client.EGui;
import techreborn.client.GuiType;
public class LapotronicSUBlock extends EnergyStorageBlock {
public LapotronicSUBlock() {
super("LESU", EGui.LESU);
super("LESU", GuiType.LESU);
}
@Override

View file

@ -26,8 +26,8 @@ package techreborn.blocks.storage.energy;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.world.BlockView;
import techreborn.client.EGui;
import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity;
import techreborn.client.GuiType;
/**
* Created by modmuss50 on 14/03/2016.
@ -35,7 +35,7 @@ import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity;
public class LowVoltageSUBlock extends EnergyStorageBlock {
public LowVoltageSUBlock() {
super("low_voltage_su", EGui.LOW_VOLTAGE_SU);
super("low_voltage_su", GuiType.LOW_VOLTAGE_SU);
}
@Override

View file

@ -27,7 +27,7 @@ package techreborn.blocks.storage.energy;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.world.BlockView;
import techreborn.blockentity.storage.energy.MediumVoltageSUBlockEntity;
import techreborn.client.EGui;
import techreborn.client.GuiType;
/**
* Created by modmuss50 on 14/03/2016.
@ -35,7 +35,7 @@ import techreborn.client.EGui;
public class MediumVoltageSUBlock extends EnergyStorageBlock {
public MediumVoltageSUBlock() {
super("medium_voltage_su", EGui.MEDIUM_VOLTAGE_SU);
super("medium_voltage_su", GuiType.MEDIUM_VOLTAGE_SU);
}
@Override

View file

@ -29,7 +29,7 @@ import net.minecraft.world.BlockView;
import reborncore.api.blockentity.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity;
import techreborn.client.EGui;
import techreborn.client.GuiType;
import techreborn.init.TRContent;
public class TankUnitBlock extends BlockMachineBase {
@ -48,6 +48,6 @@ public class TankUnitBlock extends BlockMachineBase {
@Override
public IMachineGuiHandler getGui() {
return EGui.TANK_UNIT;
return GuiType.TANK_UNIT;
}
}

View file

@ -37,7 +37,7 @@ import net.minecraft.world.World;
import reborncore.api.blockentity.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity;
import techreborn.client.EGui;
import techreborn.client.GuiType;
import techreborn.init.TRContent;
public class StorageUnitBlock extends BlockMachineBase {
@ -80,6 +80,6 @@ public class StorageUnitBlock extends BlockMachineBase {
@Override
public IMachineGuiHandler getGui() {
return EGui.STORAGE_UNIT;
return GuiType.STORAGE_UNIT;
}
}