Slight rework of the gui system, should fix some issues with wrenching. Should fix #1264 fixes #988 + a handful of weird gui de-syncs

This commit is contained in:
modmuss50 2017-09-06 13:46:12 +01:00
parent 8588a40474
commit 094b67e050
44 changed files with 183 additions and 229 deletions

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockAssemblingMachine extends BlockMachineBase {
}
@Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.ASSEMBLING_MACHINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
public IMachineGuiHandler getGui() {
return EGui.ASSEMBLING_MACHINE;
}
}

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockChargeOMat extends BlockMachineBase {
}
@Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.CHARGEBENCH.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
public IMachineGuiHandler getGui() {
return EGui.CHARGEBENCH;
}
}

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockChemicalReactor extends BlockMachineBase {
}
@Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.CHEMICAL_REACTOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
public IMachineGuiHandler getGui() {
return EGui.CHEMICAL_REACTOR;
}
}

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockChunkLoader extends BlockMachineBase {
}
@Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.CHUNK_LOADER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
public IMachineGuiHandler getGui() {
return EGui.CHUNK_LOADER;
}
}

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
@ -54,12 +55,8 @@ public class BlockMatterFabricator extends BlockMachineBase {
}
@Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.MATTER_FABRICATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
public IMachineGuiHandler getGui() {
return EGui.MATTER_FABRICATOR;
}
@Override

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
@ -54,11 +55,7 @@ public class BlockRollingMachine extends BlockMachineBase {
}
@Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.ROLLING_MACHINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
public IMachineGuiHandler getGui() {
return EGui.ROLLING_MACHINE;
}
}

View file

@ -36,6 +36,7 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
@ -59,13 +60,8 @@ public class BlockScrapboxinator extends BlockMachineBase {
}
@Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.SCRAPBOXINATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
}
return true;
public IMachineGuiHandler getGui() {
return EGui.SCRAPBOXINATOR;
}
@Override

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.api.tile.IMachineGuiHandler;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
@ -54,13 +55,7 @@ public class BlockVacuumFreezer extends BlockMachineBase {
}
@Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state,
final EntityPlayer player, final EnumHand hand, final EnumFacing side,
final float hitX, final float hitY, final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.VACUUM_FREEZER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;
}
return false;
public IMachineGuiHandler getGui() {
return EGui.VACUUM_FREEZER;
}
}