Change all containers init to IContainerProvider + Add Enum for gui ids handling
This commit is contained in:
parent
b93fe6c5ad
commit
eb220643fc
114 changed files with 2155 additions and 2025 deletions
|
@ -5,10 +5,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileDieselGenerator;
|
||||
|
||||
|
@ -16,46 +18,46 @@ public class BlockDieselGenerator extends BlockMachineBase implements IAdvancedR
|
|||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
public BlockDieselGenerator(Material material) {
|
||||
public BlockDieselGenerator(final Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.dieselgenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setUnlocalizedName("techreborn.dieselgenerator");
|
||||
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||
return new TileDieselGenerator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||
final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.dieselGeneratorID, world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.DIESEL_GENERATOR.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "generator_machine_side";
|
||||
public String getFront(final boolean isActive) {
|
||||
return this.prefix + "generator_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "generator_machine_side";
|
||||
public String getSide(final boolean isActive) {
|
||||
return this.prefix + "generator_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "diesel_generator_top_off";
|
||||
public String getTop(final boolean isActive) {
|
||||
return this.prefix + "diesel_generator_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "generator_machine_bottom";
|
||||
public String getBottom(final boolean isActive) {
|
||||
return this.prefix + "generator_machine_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,10 +5,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileGasTurbine;
|
||||
|
||||
|
@ -16,46 +18,46 @@ public class BlockGasTurbine extends BlockMachineBase implements IAdvancedRotati
|
|||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
public BlockGasTurbine(Material material) {
|
||||
public BlockGasTurbine(final Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.gasTurbine");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setUnlocalizedName("techreborn.gasTurbine");
|
||||
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||
return new TileGasTurbine();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||
final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.gasTurbineID, world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.GAS_TURBINE.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "generator_machine_side";
|
||||
public String getFront(final boolean isActive) {
|
||||
return this.prefix + "generator_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "generator_machine_side";
|
||||
public String getSide(final boolean isActive) {
|
||||
return this.prefix + "generator_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "gas_generator_top";
|
||||
public String getTop(final boolean isActive) {
|
||||
return this.prefix + "gas_generator_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "gas_generator_bottom";
|
||||
public String getBottom(final boolean isActive) {
|
||||
return this.prefix + "gas_generator_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,10 +3,12 @@ package techreborn.blocks.generator;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileGenerator;
|
||||
|
||||
|
@ -16,46 +18,46 @@ public class BlockGenerator extends BlockMachineBase implements IRotationTexture
|
|||
|
||||
public BlockGenerator() {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.generator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setUnlocalizedName("techreborn.generator");
|
||||
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||
return new TileGenerator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, GuiHandler.generatorID, world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.GENERATOR.ordinal(), world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "generator_front_off";
|
||||
return this.prefix + "generator_front_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "generator_front_on";
|
||||
return this.prefix + "generator_front_on";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "generator_machine_side";
|
||||
return this.prefix + "generator_machine_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "generator_machine_top";
|
||||
return this.prefix + "generator_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "generator_machine_bottom";
|
||||
return this.prefix + "generator_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileSemifluidGenerator;
|
||||
|
||||
|
@ -16,46 +18,46 @@ public class BlockSemiFluidGenerator extends BlockMachineBase implements IAdvanc
|
|||
|
||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||
|
||||
public BlockSemiFluidGenerator(Material material) {
|
||||
public BlockSemiFluidGenerator(final Material material) {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.semifluidgenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setUnlocalizedName("techreborn.semifluidgenerator");
|
||||
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||
return new TileSemifluidGenerator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||
final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.semifluidGeneratorID, world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.SEMIFLUID_GENERATOR.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return prefix + "semifluid_generator_side";
|
||||
public String getFront(final boolean isActive) {
|
||||
return this.prefix + "semifluid_generator_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return prefix + "semifluid_generator_side";
|
||||
public String getSide(final boolean isActive) {
|
||||
return this.prefix + "semifluid_generator_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return prefix + "generator_machine_top";
|
||||
public String getTop(final boolean isActive) {
|
||||
return this.prefix + "generator_machine_top";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "generator_machine_bottom";
|
||||
public String getBottom(final boolean isActive) {
|
||||
return this.prefix + "generator_machine_bottom";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.generator.TileThermalGenerator;
|
||||
|
||||
|
@ -17,43 +19,43 @@ public class BlockThermalGenerator extends BlockMachineBase implements IAdvanced
|
|||
|
||||
public BlockThermalGenerator() {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.thermalGenerator");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setUnlocalizedName("techreborn.thermalGenerator");
|
||||
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||
return new TileThermalGenerator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||
final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, GuiHandler.thermalGeneratorID, world, x, y, z);
|
||||
player.openGui(Core.INSTANCE, EGui.THERMAL_GENERATOR.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFront(boolean isActive) {
|
||||
return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off";
|
||||
public String getFront(final boolean isActive) {
|
||||
return isActive ? this.prefix + "thermal_generator_side_on" : this.prefix + "thermal_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide(boolean isActive) {
|
||||
return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off";
|
||||
public String getSide(final boolean isActive) {
|
||||
return isActive ? this.prefix + "thermal_generator_side_on" : this.prefix + "thermal_generator_side_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop(boolean isActive) {
|
||||
return isActive ? prefix + "thermal_generator_top_on" : prefix + "thermal_generator_top_off";
|
||||
public String getTop(final boolean isActive) {
|
||||
return isActive ? this.prefix + "thermal_generator_top_on" : this.prefix + "thermal_generator_top_off";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom(boolean isActive) {
|
||||
return prefix + "generator_machine_bottom";
|
||||
public String getBottom(final boolean isActive) {
|
||||
return this.prefix + "generator_machine_bottom";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue