The Great Renamening of 2020
This commit is contained in:
@@ -36,11 +36,11 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.misc.BlockLightDetector;
|
||||
import appeng.block.misc.BlockSkyCompass;
|
||||
import appeng.block.networking.BlockWireless;
|
||||
import appeng.block.misc.LightDetectorBlock;
|
||||
import appeng.block.misc.SkyCompassBlock;
|
||||
import appeng.block.networking.WirelessBlock;
|
||||
import appeng.me.helpers.IGridProxyable;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
|
||||
public class AEBaseBlockItem extends BlockItem {
|
||||
|
||||
@@ -84,14 +84,14 @@ public class AEBaseBlockItem extends BlockItem {
|
||||
PlayerEntity player = context.getPlayer();
|
||||
|
||||
if (this.blockType instanceof AEBaseTileBlock) {
|
||||
if (this.blockType instanceof BlockLightDetector) {
|
||||
if (this.blockType instanceof LightDetectorBlock) {
|
||||
up = side;
|
||||
if (up == Direction.UP || up == Direction.DOWN) {
|
||||
forward = Direction.SOUTH;
|
||||
} else {
|
||||
forward = Direction.UP;
|
||||
}
|
||||
} else if (this.blockType instanceof BlockWireless || this.blockType instanceof BlockSkyCompass) {
|
||||
} else if (this.blockType instanceof WirelessBlock || this.blockType instanceof SkyCompassBlock) {
|
||||
forward = side;
|
||||
if (forward == Direction.UP || forward == Direction.DOWN) {
|
||||
up = Direction.SOUTH;
|
||||
@@ -133,8 +133,8 @@ public class AEBaseBlockItem extends BlockItem {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (this.blockType instanceof AEBaseTileBlock && !(this.blockType instanceof BlockLightDetector)) {
|
||||
final AEBaseTile tile = ((AEBaseTileBlock<?>) this.blockType).getTileEntity(context.getWorld(),
|
||||
if (this.blockType instanceof AEBaseTileBlock && !(this.blockType instanceof LightDetectorBlock)) {
|
||||
final AEBaseTileEntity tile = ((AEBaseTileBlock<?>) this.blockType).getTileEntity(context.getWorld(),
|
||||
context.getPos());
|
||||
ori = tile;
|
||||
|
||||
|
||||
@@ -52,15 +52,15 @@ import appeng.api.implementations.items.MemoryCardMessages;
|
||||
import appeng.api.implementations.tiles.IColorableTile;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.block.networking.BlockCableBus;
|
||||
import appeng.tile.AEBaseInvTile;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
import appeng.block.networking.CableBusBlock;
|
||||
import appeng.tile.AEBaseInvTileEntity;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
import appeng.tile.networking.CableBusTileEntity;
|
||||
import appeng.tile.storage.SkyChestTileEntity;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.SettingsFrom;
|
||||
|
||||
public abstract class AEBaseTileBlock<T extends AEBaseTile> extends AEBaseBlock {
|
||||
public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBaseBlock {
|
||||
|
||||
@Nonnull
|
||||
private Class<T> tileEntityClass;
|
||||
@@ -75,7 +75,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTile> extends AEBaseBlock
|
||||
public void setTileEntity(final Class<T> tileEntityClass, Supplier<T> factory) {
|
||||
this.tileEntityClass = tileEntityClass;
|
||||
this.tileEntityFactory = factory;
|
||||
this.setInventory(AEBaseInvTile.class.isAssignableFrom(tileEntityClass));
|
||||
this.setInventory(AEBaseInvTileEntity.class.isAssignableFrom(tileEntityClass));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -127,7 +127,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTile> extends AEBaseBlock
|
||||
return; // Just a block state change
|
||||
}
|
||||
|
||||
final AEBaseTile te = this.getTileEntity(w, pos);
|
||||
final AEBaseTileEntity te = this.getTileEntity(w, pos);
|
||||
if (te != null) {
|
||||
final ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
if (te.dropItems()) {
|
||||
@@ -167,8 +167,8 @@ public abstract class AEBaseTileBlock<T extends AEBaseTile> extends AEBaseBlock
|
||||
@Override
|
||||
public int getComparatorInputOverride(BlockState state, final World w, final BlockPos pos) {
|
||||
final TileEntity te = this.getTileEntity(w, pos);
|
||||
if (te instanceof AEBaseInvTile) {
|
||||
AEBaseInvTile invTile = (AEBaseInvTile) te;
|
||||
if (te instanceof AEBaseInvTileEntity) {
|
||||
AEBaseInvTileEntity invTile = (AEBaseInvTileEntity) te;
|
||||
if (invTile.getInternalInventory().getSlots() > 0) {
|
||||
return ItemHandlerHelper.calcRedstoneFromInventory(invTile.getInternalInventory());
|
||||
}
|
||||
@@ -192,7 +192,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTile> extends AEBaseBlock
|
||||
// than a translation component, since our custom naming cannot handle
|
||||
// untranslated
|
||||
// I18N strings and we would translate it using the server's locale :-(
|
||||
AEBaseTile te = this.getTileEntity(w, pos);
|
||||
AEBaseTileEntity te = this.getTileEntity(w, pos);
|
||||
if (te != null && is.hasDisplayName()) {
|
||||
ITextComponent displayName = is.getDisplayName();
|
||||
if (displayName instanceof StringTextComponent) {
|
||||
@@ -212,13 +212,13 @@ public abstract class AEBaseTileBlock<T extends AEBaseTile> extends AEBaseBlock
|
||||
final BlockState blockState = world.getBlockState(pos);
|
||||
final Block block = blockState.getBlock();
|
||||
|
||||
final AEBaseTile tile = this.getTileEntity(world, pos);
|
||||
final AEBaseTileEntity tile = this.getTileEntity(world, pos);
|
||||
|
||||
if (tile == null) {
|
||||
return ActionResultType.FAIL;
|
||||
}
|
||||
|
||||
if (tile instanceof TileCableBus || tile instanceof TileSkyChest) {
|
||||
if (tile instanceof CableBusTileEntity || tile instanceof SkyChestTileEntity) {
|
||||
return ActionResultType.FAIL;
|
||||
}
|
||||
|
||||
@@ -243,9 +243,9 @@ public abstract class AEBaseTileBlock<T extends AEBaseTile> extends AEBaseBlock
|
||||
return ActionResultType.FAIL;
|
||||
}
|
||||
|
||||
if (heldItem.getItem() instanceof IMemoryCard && !(this instanceof BlockCableBus)) {
|
||||
if (heldItem.getItem() instanceof IMemoryCard && !(this instanceof CableBusBlock)) {
|
||||
final IMemoryCard memoryCard = (IMemoryCard) heldItem.getItem();
|
||||
final AEBaseTile tileEntity = this.getTileEntity(world, pos);
|
||||
final AEBaseTileEntity tileEntity = this.getTileEntity(world, pos);
|
||||
|
||||
if (tileEntity == null) {
|
||||
return ActionResultType.FAIL;
|
||||
|
||||
@@ -32,10 +32,10 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerCraftingCPU;
|
||||
import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.container.implementations.CraftingCPUContainer;
|
||||
import appeng.tile.crafting.CraftingTileEntity;
|
||||
|
||||
public abstract class AbstractCraftingUnitBlock<T extends TileCraftingTile> extends AEBaseTileBlock<T> {
|
||||
public abstract class AbstractCraftingUnitBlock<T extends CraftingTileEntity> extends AEBaseTileBlock<T> {
|
||||
public static final BooleanProperty FORMED = BooleanProperty.create("formed");
|
||||
public static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
|
||||
@@ -57,7 +57,7 @@ public abstract class AbstractCraftingUnitBlock<T extends TileCraftingTile> exte
|
||||
@Override
|
||||
public void neighborChanged(final BlockState state, final World worldIn, final BlockPos pos, final Block blockIn,
|
||||
final BlockPos fromPos, boolean isMoving) {
|
||||
final TileCraftingTile cp = this.getTileEntity(worldIn, pos);
|
||||
final CraftingTileEntity cp = this.getTileEntity(worldIn, pos);
|
||||
if (cp != null) {
|
||||
cp.updateMultiBlock();
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public abstract class AbstractCraftingUnitBlock<T extends TileCraftingTile> exte
|
||||
return; // Just a block state change
|
||||
}
|
||||
|
||||
final TileCraftingTile cp = this.getTileEntity(w, pos);
|
||||
final CraftingTileEntity cp = this.getTileEntity(w, pos);
|
||||
if (cp != null) {
|
||||
cp.breakCluster();
|
||||
}
|
||||
@@ -80,11 +80,11 @@ public abstract class AbstractCraftingUnitBlock<T extends TileCraftingTile> exte
|
||||
@Override
|
||||
public ActionResultType onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity p, Hand hand,
|
||||
BlockRayTraceResult hit) {
|
||||
final TileCraftingTile tg = this.getTileEntity(w, pos);
|
||||
final CraftingTileEntity tg = this.getTileEntity(w, pos);
|
||||
|
||||
if (tg != null && !p.isCrouching() && tg.isFormed() && tg.isActive()) {
|
||||
if (!w.isRemote()) {
|
||||
ContainerOpener.openContainer(ContainerCraftingCPU.TYPE, p,
|
||||
ContainerOpener.openContainer(CraftingCPUContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -18,10 +18,10 @@
|
||||
|
||||
package appeng.block.crafting;
|
||||
|
||||
import appeng.tile.crafting.TileCraftingMonitorTile;
|
||||
import appeng.tile.crafting.CraftingMonitorTileEntity;
|
||||
|
||||
public class BlockCraftingMonitor extends AbstractCraftingUnitBlock<TileCraftingMonitorTile> {
|
||||
public BlockCraftingMonitor(Properties props) {
|
||||
public class CraftingMonitorBlock extends AbstractCraftingUnitBlock<CraftingMonitorTileEntity> {
|
||||
public CraftingMonitorBlock(Properties props) {
|
||||
super(props, CraftingUnitType.MONITOR);
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -18,11 +18,11 @@
|
||||
|
||||
package appeng.block.crafting;
|
||||
|
||||
import appeng.tile.crafting.TileCraftingStorageTile;
|
||||
import appeng.tile.crafting.CraftingStorageTileEntity;
|
||||
|
||||
public class BlockCraftingStorage extends AbstractCraftingUnitBlock<TileCraftingStorageTile> {
|
||||
public class CraftingStorageBlock extends AbstractCraftingUnitBlock<CraftingStorageTileEntity> {
|
||||
|
||||
public BlockCraftingStorage(Properties props, CraftingUnitType type) {
|
||||
public CraftingStorageBlock(Properties props, CraftingUnitType type) {
|
||||
super(props, type);
|
||||
}
|
||||
|
||||
+2
-2
@@ -26,9 +26,9 @@ import appeng.api.features.AEFeature;
|
||||
import appeng.block.AEBaseBlockItem;
|
||||
import appeng.core.AEConfig;
|
||||
|
||||
public class ItemCraftingStorage extends AEBaseBlockItem {
|
||||
public class CraftingStorageItem extends AEBaseBlockItem {
|
||||
|
||||
public ItemCraftingStorage(Block id, Properties props) {
|
||||
public CraftingStorageItem(Block id, Properties props) {
|
||||
super(id, props);
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package appeng.block.crafting;
|
||||
|
||||
import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.tile.crafting.CraftingTileEntity;
|
||||
|
||||
public class CraftingUnitBlock extends AbstractCraftingUnitBlock<TileCraftingTile> {
|
||||
public class CraftingUnitBlock extends AbstractCraftingUnitBlock<CraftingTileEntity> {
|
||||
|
||||
public CraftingUnitBlock(Properties props, CraftingUnitType type) {
|
||||
super(props, type);
|
||||
|
||||
+7
-7
@@ -32,14 +32,14 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerMolecularAssembler;
|
||||
import appeng.tile.crafting.TileMolecularAssembler;
|
||||
import appeng.container.implementations.MolecularAssemblerContainer;
|
||||
import appeng.tile.crafting.MolecularAssemblerTileEntity;
|
||||
|
||||
public class BlockMolecularAssembler extends AEBaseTileBlock<TileMolecularAssembler> {
|
||||
public class MolecularAssemblerBlock extends AEBaseTileBlock<MolecularAssemblerTileEntity> {
|
||||
|
||||
public static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
|
||||
public BlockMolecularAssembler(Block.Properties props) {
|
||||
public MolecularAssemblerBlock(Block.Properties props) {
|
||||
super(props);
|
||||
setDefaultState(getDefaultState().with(POWERED, false));
|
||||
}
|
||||
@@ -51,17 +51,17 @@ public class BlockMolecularAssembler extends AEBaseTileBlock<TileMolecularAssemb
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, TileMolecularAssembler te) {
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, MolecularAssemblerTileEntity te) {
|
||||
return currentState.with(POWERED, te.isPowered());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity p, Hand hand,
|
||||
BlockRayTraceResult hit) {
|
||||
final TileMolecularAssembler tg = this.getTileEntity(w, pos);
|
||||
final MolecularAssemblerTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null && !p.isCrouching()) {
|
||||
if (!tg.isRemote()) {
|
||||
ContainerOpener.openContainer(ContainerMolecularAssembler.TYPE, p,
|
||||
ContainerOpener.openContainer(MolecularAssemblerContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
+9
-9
@@ -45,12 +45,12 @@ import net.minecraftforge.common.util.FakePlayer;
|
||||
import appeng.api.implementations.tiles.ICrankable;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.stats.AeStats;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.grindstone.TileCrank;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
import appeng.tile.grindstone.CrankTileEntity;
|
||||
|
||||
public class BlockCrank extends AEBaseTileBlock<TileCrank> {
|
||||
public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
|
||||
|
||||
public BlockCrank(Properties props) {
|
||||
public CrankBlock(Properties props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class BlockCrank extends AEBaseTileBlock<TileCrank> {
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
final TileCrank tile = this.getTileEntity(w, pos);
|
||||
final CrankTileEntity tile = this.getTileEntity(w, pos);
|
||||
if (tile != null) {
|
||||
if (tile.power()) {
|
||||
AeStats.TurnedCranks.addToPlayer(player, 1);
|
||||
@@ -81,7 +81,7 @@ public class BlockCrank extends AEBaseTileBlock<TileCrank> {
|
||||
@Override
|
||||
public void onBlockPlacedBy(final World world, final BlockPos pos, final BlockState state,
|
||||
final LivingEntity placer, final ItemStack stack) {
|
||||
final AEBaseTile tile = this.getTileEntity(world, pos);
|
||||
final AEBaseTileEntity tile = this.getTileEntity(world, pos);
|
||||
if (tile != null) {
|
||||
final Direction mnt = this.findCrankable(world, pos);
|
||||
Direction forward = Direction.UP;
|
||||
@@ -97,7 +97,7 @@ public class BlockCrank extends AEBaseTileBlock<TileCrank> {
|
||||
@Override
|
||||
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
final TileEntity te = w.getTileEntity(pos);
|
||||
return !(te instanceof TileCrank) || this.isCrankable(w, pos, up.getOpposite());
|
||||
return !(te instanceof CrankTileEntity) || this.isCrankable(w, pos, up.getOpposite());
|
||||
}
|
||||
|
||||
private Direction findCrankable(final IBlockReader world, final BlockPos pos) {
|
||||
@@ -124,7 +124,7 @@ public class BlockCrank extends AEBaseTileBlock<TileCrank> {
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final AEBaseTile tile = this.getTileEntity(world, pos);
|
||||
final AEBaseTileEntity tile = this.getTileEntity(world, pos);
|
||||
if (tile != null) {
|
||||
if (!this.isCrankable(world, pos, tile.getUp().getOpposite())) {
|
||||
this.dropCrank(world, pos);
|
||||
@@ -140,7 +140,7 @@ public class BlockCrank extends AEBaseTileBlock<TileCrank> {
|
||||
}
|
||||
|
||||
private Direction getUp(IBlockReader world, BlockPos pos) {
|
||||
TileCrank crank = getTileEntity(world, pos);
|
||||
CrankTileEntity crank = getTileEntity(world, pos);
|
||||
return crank != null ? crank.getUp() : null;
|
||||
}
|
||||
|
||||
+6
-6
@@ -32,22 +32,22 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerGrinder;
|
||||
import appeng.tile.grindstone.TileGrinder;
|
||||
import appeng.container.implementations.GrinderContainer;
|
||||
import appeng.tile.grindstone.GrinderTileEntity;
|
||||
|
||||
public class BlockGrinder extends AEBaseTileBlock<TileGrinder> {
|
||||
public class GrinderBlock extends AEBaseTileBlock<GrinderTileEntity> {
|
||||
|
||||
public BlockGrinder(Properties props) {
|
||||
public GrinderBlock(Properties props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
|
||||
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
|
||||
final TileGrinder tg = this.getTileEntity(w, pos);
|
||||
final GrinderTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null && !p.isCrouching()) {
|
||||
if (p instanceof ServerPlayerEntity) {
|
||||
ContainerOpener.openContainer(ContainerGrinder.TYPE, p,
|
||||
ContainerOpener.openContainer(GrinderContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
+6
-6
@@ -31,13 +31,13 @@ import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.implementations.ContainerCellWorkbench;
|
||||
import appeng.tile.misc.TileCellWorkbench;
|
||||
import appeng.container.implementations.CellWorkbenchContainer;
|
||||
import appeng.tile.misc.CellWorkbenchTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockCellWorkbench extends AEBaseTileBlock<TileCellWorkbench> {
|
||||
public class CellWorkbenchBlock extends AEBaseTileBlock<CellWorkbenchTileEntity> {
|
||||
|
||||
public BlockCellWorkbench() {
|
||||
public CellWorkbenchBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
}
|
||||
|
||||
@@ -48,10 +48,10 @@ public class BlockCellWorkbench extends AEBaseTileBlock<TileCellWorkbench> {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
final TileCellWorkbench tg = this.getTileEntity(w, pos);
|
||||
final CellWorkbenchTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerCellWorkbench.open(p, ContainerLocator.forTileEntity(tg));
|
||||
CellWorkbenchContainer.open(p, ContainerLocator.forTileEntity(tg));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
+9
-9
@@ -57,12 +57,12 @@ import appeng.client.render.renderable.ItemRenderable;
|
||||
import appeng.client.render.tesr.ModularTESR;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.tile.misc.TileCharger;
|
||||
import appeng.tile.misc.ChargerTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockCharger extends AEBaseTileBlock<TileCharger> {
|
||||
public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
|
||||
|
||||
public BlockCharger() {
|
||||
public ChargerBlock() {
|
||||
super(defaultProps(Material.IRON).notSolid());
|
||||
|
||||
this.setFullSize(this.setOpaque(false));
|
||||
@@ -81,7 +81,7 @@ public class BlockCharger extends AEBaseTileBlock<TileCharger> {
|
||||
}
|
||||
|
||||
if (Platform.isServer()) {
|
||||
final TileCharger tc = this.getTileEntity(w, pos);
|
||||
final ChargerTileEntity tc = this.getTileEntity(w, pos);
|
||||
if (tc != null) {
|
||||
tc.activate(player);
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class BlockCharger extends AEBaseTileBlock<TileCharger> {
|
||||
return;
|
||||
}
|
||||
|
||||
final TileCharger tile = this.getTileEntity(w, pos);
|
||||
final ChargerTileEntity tile = this.getTileEntity(w, pos);
|
||||
if (tile != null) {
|
||||
if (AEApi.instance().definitions().materials().certusQuartzCrystalCharged()
|
||||
.isSameAs(tile.getInternalInventory().getStackInSlot(0))) {
|
||||
@@ -122,7 +122,7 @@ public class BlockCharger extends AEBaseTileBlock<TileCharger> {
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) {
|
||||
|
||||
final TileCharger tile = this.getTileEntity(w, pos);
|
||||
final ChargerTileEntity tile = this.getTileEntity(w, pos);
|
||||
if (tile != null) {
|
||||
final double twoPixels = 2.0 / 16.0;
|
||||
final Direction up = tile.getUp();
|
||||
@@ -178,12 +178,12 @@ public class BlockCharger extends AEBaseTileBlock<TileCharger> {
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public static Function<TileEntityRendererDispatcher, TileEntityRenderer<TileCharger>> createTesr() {
|
||||
return dispatcher -> new ModularTESR<>(dispatcher, new ItemRenderable<>(BlockCharger::getRenderedItem));
|
||||
public static Function<TileEntityRendererDispatcher, TileEntityRenderer<ChargerTileEntity>> createTesr() {
|
||||
return dispatcher -> new ModularTESR<>(dispatcher, new ItemRenderable<>(ChargerBlock::getRenderedItem));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
private static Pair<ItemStack, TransformationMatrix> getRenderedItem(TileCharger tile) {
|
||||
private static Pair<ItemStack, TransformationMatrix> getRenderedItem(ChargerTileEntity tile) {
|
||||
TransformationMatrix transform = new TransformationMatrix(new Vector3f(0.5f, 0.375f, 0.5f), null, null, null);
|
||||
return new ImmutablePair<>(tile.getInternalInventory().getStackInSlot(0), transform);
|
||||
}
|
||||
+6
-6
@@ -32,13 +32,13 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerCondenser;
|
||||
import appeng.tile.misc.TileCondenser;
|
||||
import appeng.container.implementations.CondenserContainer;
|
||||
import appeng.tile.misc.CondenserTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockCondenser extends AEBaseTileBlock<TileCondenser> {
|
||||
public class CondenserBlock extends AEBaseTileBlock<CondenserTileEntity> {
|
||||
|
||||
public BlockCondenser() {
|
||||
public CondenserBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ public class BlockCondenser extends AEBaseTileBlock<TileCondenser> {
|
||||
}
|
||||
|
||||
if (Platform.isServer()) {
|
||||
final TileCondenser tc = this.getTileEntity(w, pos);
|
||||
final CondenserTileEntity tc = this.getTileEntity(w, pos);
|
||||
if (tc != null && !player.isCrouching()) {
|
||||
ContainerOpener.openContainer(ContainerCondenser.TYPE, player,
|
||||
ContainerOpener.openContainer(CondenserContainer.TYPE, player,
|
||||
ContainerLocator.forTileEntitySide(tc, hit.getFace()));
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
+6
-6
@@ -33,12 +33,12 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerInscriber;
|
||||
import appeng.tile.misc.TileInscriber;
|
||||
import appeng.container.implementations.InscriberContainer;
|
||||
import appeng.tile.misc.InscriberTileEntity;
|
||||
|
||||
public class BlockInscriber extends AEBaseTileBlock<TileInscriber> {
|
||||
public class InscriberBlock extends AEBaseTileBlock<InscriberTileEntity> {
|
||||
|
||||
public BlockInscriber(Properties props) {
|
||||
public InscriberBlock(Properties props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
@@ -52,10 +52,10 @@ public class BlockInscriber extends AEBaseTileBlock<TileInscriber> {
|
||||
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
|
||||
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
|
||||
if (!p.isCrouching()) {
|
||||
final TileInscriber tg = this.getTileEntity(w, pos);
|
||||
final InscriberTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null) {
|
||||
if (!tg.isRemote()) {
|
||||
ContainerOpener.openContainer(ContainerInscriber.TYPE, p,
|
||||
ContainerOpener.openContainer(InscriberContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
@@ -7,13 +7,13 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import appeng.bootstrap.TileEntityRendering;
|
||||
import appeng.bootstrap.TileEntityRenderingCustomizer;
|
||||
import appeng.client.render.tesr.InscriberTESR;
|
||||
import appeng.tile.misc.TileInscriber;
|
||||
import appeng.tile.misc.InscriberTileEntity;
|
||||
|
||||
public class InscriberRendering extends TileEntityRenderingCustomizer<TileInscriber> {
|
||||
public class InscriberRendering extends TileEntityRenderingCustomizer<InscriberTileEntity> {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void customize(TileEntityRendering<TileInscriber> rendering) {
|
||||
public void customize(TileEntityRendering<InscriberTileEntity> rendering) {
|
||||
rendering.tileEntityRenderer(InscriberTESR::new);
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -38,15 +38,15 @@ import appeng.api.util.IOrientable;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerInterface;
|
||||
import appeng.tile.misc.TileInterface;
|
||||
import appeng.container.implementations.InterfaceContainer;
|
||||
import appeng.tile.misc.InterfaceTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockInterface extends AEBaseTileBlock<TileInterface> {
|
||||
public class InterfaceBlock extends AEBaseTileBlock<InterfaceTileEntity> {
|
||||
|
||||
private static final BooleanProperty OMNIDIRECTIONAL = BooleanProperty.create("omnidirectional");
|
||||
|
||||
public BlockInterface() {
|
||||
public InterfaceBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class BlockInterface extends AEBaseTileBlock<TileInterface> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, TileInterface te) {
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, InterfaceTileEntity te) {
|
||||
return currentState.with(OMNIDIRECTIONAL, te.isOmniDirectional());
|
||||
}
|
||||
|
||||
@@ -68,10 +68,10 @@ public class BlockInterface extends AEBaseTileBlock<TileInterface> {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
final TileInterface tg = this.getTileEntity(w, pos);
|
||||
final InterfaceTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(ContainerInterface.TYPE, p,
|
||||
ContainerOpener.openContainer(InterfaceContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
@@ -86,8 +86,8 @@ public class BlockInterface extends AEBaseTileBlock<TileInterface> {
|
||||
|
||||
@Override
|
||||
protected void customRotateBlock(final IOrientable rotatable, final Direction axis) {
|
||||
if (rotatable instanceof TileInterface) {
|
||||
((TileInterface) rotatable).setSide(axis);
|
||||
if (rotatable instanceof InterfaceTileEntity) {
|
||||
((InterfaceTileEntity) rotatable).setSide(axis);
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -41,14 +41,14 @@ import appeng.api.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.MetaRotation;
|
||||
import appeng.tile.misc.TileLightDetector;
|
||||
import appeng.tile.misc.LightDetectorTileEntity;
|
||||
|
||||
public class BlockLightDetector extends AEBaseTileBlock<TileLightDetector> implements IOrientableBlock {
|
||||
public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity> implements IOrientableBlock {
|
||||
|
||||
// Used to alternate between two variants of the fixture on adjacent blocks
|
||||
public static final BooleanProperty ODD = BooleanProperty.create("odd");
|
||||
|
||||
public BlockLightDetector() {
|
||||
public LightDetectorBlock() {
|
||||
super(defaultProps(Material.MISCELLANEOUS).notSolid());
|
||||
|
||||
this.setDefaultState(this.getDefaultState().with(BlockStateProperties.FACING, Direction.UP).with(ODD, false));
|
||||
@@ -75,7 +75,7 @@ public class BlockLightDetector extends AEBaseTileBlock<TileLightDetector> imple
|
||||
public void onNeighborChange(BlockState state, IWorldReader world, BlockPos pos, BlockPos neighbor) {
|
||||
super.onNeighborChange(state, world, pos, neighbor);
|
||||
|
||||
final TileLightDetector tld = this.getTileEntity(world, pos);
|
||||
final LightDetectorTileEntity tld = this.getTileEntity(world, pos);
|
||||
if (tld != null) {
|
||||
tld.updateLight();
|
||||
}
|
||||
+2
-2
@@ -55,7 +55,7 @@ import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.MetaRotation;
|
||||
|
||||
public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock {
|
||||
public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock {
|
||||
|
||||
// Cache VoxelShapes for each facing
|
||||
private static final Map<Direction, VoxelShape> SHAPES;
|
||||
@@ -79,7 +79,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock
|
||||
// Used to alternate between two variants of the fixture on adjacent blocks
|
||||
public static final BooleanProperty ODD = BooleanProperty.create("odd");
|
||||
|
||||
public BlockQuartzFixture() {
|
||||
public QuartzFixtureBlock() {
|
||||
super(defaultProps(Material.MISCELLANEOUS).doesNotBlockMovement().hardnessAndResistance(0).lightValue(14)
|
||||
.sound(SoundType.GLASS));
|
||||
|
||||
+5
-5
@@ -38,21 +38,21 @@ import appeng.block.AEBaseTileBlock;
|
||||
import appeng.client.render.effects.ParticleTypes;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.tile.misc.TileQuartzGrowthAccelerator;
|
||||
import appeng.tile.misc.QuartzGrowthAcceleratorTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock<TileQuartzGrowthAccelerator>
|
||||
public class QuartzGrowthAcceleratorBlock extends AEBaseTileBlock<QuartzGrowthAcceleratorTileEntity>
|
||||
implements IOrientableBlock {
|
||||
|
||||
private static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
|
||||
public BlockQuartzGrowthAccelerator() {
|
||||
public QuartzGrowthAcceleratorBlock() {
|
||||
super(defaultProps(Material.ROCK).sound(SoundType.METAL));
|
||||
this.setDefaultState(this.getDefaultState().with(POWERED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, TileQuartzGrowthAccelerator te) {
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, QuartzGrowthAcceleratorTileEntity te) {
|
||||
return currentState.with(POWERED, te.isPowered());
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock<TileQuartzGrow
|
||||
return;
|
||||
}
|
||||
|
||||
final TileQuartzGrowthAccelerator cga = this.getTileEntity(w, pos);
|
||||
final QuartzGrowthAcceleratorTileEntity cga = this.getTileEntity(w, pos);
|
||||
|
||||
if (cga != null && cga.isPowered() && AppEng.proxy.shouldAddParticles(r)) {
|
||||
final double d0 = r.nextFloat() - 0.5F;
|
||||
+7
-7
@@ -36,14 +36,14 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerSecurityStation;
|
||||
import appeng.tile.misc.TileSecurityStation;
|
||||
import appeng.container.implementations.SecurityStationContainer;
|
||||
import appeng.tile.misc.SecurityStationTileEntity;
|
||||
|
||||
public class BlockSecurityStation extends AEBaseTileBlock<TileSecurityStation> {
|
||||
public class SecurityStationBlock extends AEBaseTileBlock<SecurityStationTileEntity> {
|
||||
|
||||
private static final BooleanProperty POWERED = BooleanProperty.create("powered");
|
||||
|
||||
public BlockSecurityStation() {
|
||||
public SecurityStationBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
|
||||
this.setDefaultState(this.getDefaultState().with(POWERED, false));
|
||||
@@ -56,7 +56,7 @@ public class BlockSecurityStation extends AEBaseTileBlock<TileSecurityStation> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, TileSecurityStation te) {
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, SecurityStationTileEntity te) {
|
||||
return currentState.with(POWERED, te.isActive());
|
||||
}
|
||||
|
||||
@@ -67,13 +67,13 @@ public class BlockSecurityStation extends AEBaseTileBlock<TileSecurityStation> {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
final TileSecurityStation tg = this.getTileEntity(w, pos);
|
||||
final SecurityStationTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null) {
|
||||
if (w.isRemote()) {
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
ContainerOpener.openContainer(ContainerSecurityStation.TYPE, p,
|
||||
ContainerOpener.openContainer(SecurityStationContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
+6
-6
@@ -33,17 +33,17 @@ import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.tile.misc.TileSkyCompass;
|
||||
import appeng.tile.misc.SkyCompassTileEntity;
|
||||
|
||||
public class BlockSkyCompass extends AEBaseTileBlock<TileSkyCompass> {
|
||||
public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
|
||||
|
||||
public BlockSkyCompass(Block.Properties props) {
|
||||
public SkyCompassBlock(Block.Properties props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) {
|
||||
final TileSkyCompass sc = this.getTileEntity(w, pos);
|
||||
final SkyCompassTileEntity sc = this.getTileEntity(w, pos);
|
||||
if (sc != null) {
|
||||
return false;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ public class BlockSkyCompass extends AEBaseTileBlock<TileSkyCompass> {
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final TileSkyCompass sc = this.getTileEntity(world, pos);
|
||||
final SkyCompassTileEntity sc = this.getTileEntity(world, pos);
|
||||
final Direction forward = sc.getForward();
|
||||
if (!this.canPlaceAt(world, pos, forward.getOpposite())) {
|
||||
this.dropTorch(world, pos);
|
||||
@@ -87,7 +87,7 @@ public class BlockSkyCompass extends AEBaseTileBlock<TileSkyCompass> {
|
||||
|
||||
// TODO: This definitely needs to be memoized
|
||||
|
||||
final TileSkyCompass tile = this.getTileEntity(w, pos);
|
||||
final SkyCompassTileEntity tile = this.getTileEntity(w, pos);
|
||||
if (tile != null) {
|
||||
final Direction forward = tile.getForward();
|
||||
|
||||
@@ -24,13 +24,13 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import appeng.bootstrap.TileEntityRendering;
|
||||
import appeng.bootstrap.TileEntityRenderingCustomizer;
|
||||
import appeng.client.render.tesr.SkyCompassTESR;
|
||||
import appeng.tile.misc.TileSkyCompass;
|
||||
import appeng.tile.misc.SkyCompassTileEntity;
|
||||
|
||||
public class SkyCompassRendering extends TileEntityRenderingCustomizer<TileSkyCompass> {
|
||||
public class SkyCompassRendering extends TileEntityRenderingCustomizer<SkyCompassTileEntity> {
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void customize(TileEntityRendering<TileSkyCompass> rendering) {
|
||||
public void customize(TileEntityRendering<SkyCompassTileEntity> rendering) {
|
||||
rendering.tileEntityRenderer(SkyCompassTESR::new);
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -44,14 +44,14 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.entity.EntityTinyTNTPrimed;
|
||||
import appeng.entity.TinyTNTPrimedEntity;
|
||||
|
||||
public class BlockTinyTNT extends AEBaseBlock {
|
||||
public class TinyTNTBlock extends AEBaseBlock {
|
||||
|
||||
private static final VoxelShape SHAPE = VoxelShapes
|
||||
.create(new AxisAlignedBB(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f));
|
||||
|
||||
public BlockTinyTNT(Block.Properties props) {
|
||||
public TinyTNTBlock(Block.Properties props) {
|
||||
super(props);
|
||||
setFullSize(setOpaque(false));
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class BlockTinyTNT extends AEBaseBlock {
|
||||
|
||||
public void startFuse(final World w, final BlockPos pos, final LivingEntity igniter) {
|
||||
if (!w.isRemote) {
|
||||
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed(w, pos.getX() + 0.5F,
|
||||
final TinyTNTPrimedEntity primedTinyTNTEntity = new TinyTNTPrimedEntity(w, pos.getX() + 0.5F,
|
||||
pos.getY() + 0.5F, pos.getZ() + 0.5F, igniter);
|
||||
w.addEntity(primedTinyTNTEntity);
|
||||
w.playSound(null, primedTinyTNTEntity.getPosX(), primedTinyTNTEntity.getPosY(),
|
||||
@@ -141,7 +141,7 @@ public class BlockTinyTNT extends AEBaseBlock {
|
||||
public void onExplosionDestroy(final World w, final BlockPos pos, final Explosion exp) {
|
||||
super.onExplosionDestroy(w, pos, exp);
|
||||
if (!w.isRemote) {
|
||||
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed(w, pos.getX() + 0.5F,
|
||||
final TinyTNTPrimedEntity primedTinyTNTEntity = new TinyTNTPrimedEntity(w, pos.getX() + 0.5F,
|
||||
pos.getY() + 0.5F, pos.getZ() + 0.5F, exp.getExplosivePlacedBy());
|
||||
primedTinyTNTEntity
|
||||
.setFuse(w.rand.nextInt(primedTinyTNTEntity.getFuse() / 4) + primedTinyTNTEntity.getFuse() / 8);
|
||||
+11
-11
@@ -40,24 +40,24 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerVibrationChamber;
|
||||
import appeng.container.implementations.VibrationChamberContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.misc.TileVibrationChamber;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
import appeng.tile.misc.VibrationChamberTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public final class BlockVibrationChamber extends AEBaseTileBlock<TileVibrationChamber> {
|
||||
public final class VibrationChamberBlock extends AEBaseTileBlock<VibrationChamberTileEntity> {
|
||||
|
||||
// Indicates that the vibration chamber is currently working
|
||||
private static final BooleanProperty ACTIVE = BooleanProperty.create("active");
|
||||
|
||||
public BlockVibrationChamber() {
|
||||
public VibrationChamberBlock() {
|
||||
super(defaultProps(Material.IRON).hardnessAndResistance(4.2F));
|
||||
this.setDefaultState(this.getDefaultState().with(ACTIVE, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, TileVibrationChamber te) {
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, VibrationChamberTileEntity te) {
|
||||
return currentState.with(ACTIVE, te.isOn);
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ public final class BlockVibrationChamber extends AEBaseTileBlock<TileVibrationCh
|
||||
}
|
||||
|
||||
if (Platform.isServer()) {
|
||||
final TileVibrationChamber tc = this.getTileEntity(w, pos);
|
||||
final VibrationChamberTileEntity tc = this.getTileEntity(w, pos);
|
||||
if (tc != null && !player.isCrouching()) {
|
||||
ContainerOpener.openContainer(ContainerVibrationChamber.TYPE, player,
|
||||
ContainerOpener.openContainer(VibrationChamberContainer.TYPE, player,
|
||||
ContainerLocator.forTileEntitySide(tc, hit.getFace()));
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
@@ -92,9 +92,9 @@ public final class BlockVibrationChamber extends AEBaseTileBlock<TileVibrationCh
|
||||
return;
|
||||
}
|
||||
|
||||
final AEBaseTile tile = this.getTileEntity(w, pos);
|
||||
if (tile instanceof TileVibrationChamber) {
|
||||
final TileVibrationChamber tc = (TileVibrationChamber) tile;
|
||||
final AEBaseTileEntity tile = this.getTileEntity(w, pos);
|
||||
if (tile instanceof VibrationChamberTileEntity) {
|
||||
final VibrationChamberTileEntity tc = (VibrationChamberTileEntity) tile;
|
||||
if (tc.isOn) {
|
||||
double f1 = pos.getX() + 0.5F;
|
||||
double f2 = pos.getY() + 0.5F;
|
||||
+13
-13
@@ -67,20 +67,20 @@ import appeng.client.render.cablebus.CableBusBakedModel;
|
||||
import appeng.client.render.cablebus.CableBusBreakingParticle;
|
||||
import appeng.client.render.cablebus.CableBusRenderState;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketClick;
|
||||
import appeng.core.sync.packets.ClickPacket;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.integration.abstraction.IAEFacade;
|
||||
import appeng.parts.ICableBusContainer;
|
||||
import appeng.parts.NullCableBusContainer;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
import appeng.tile.networking.CableBusTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockCableBus extends AEBaseTileBlock<TileCableBus> implements IAEFacade {
|
||||
public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implements IAEFacade {
|
||||
|
||||
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
|
||||
|
||||
public BlockCableBus() {
|
||||
public CableBusBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE).notSolid().noDrops());
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> implements IAEF
|
||||
public boolean removedByPlayer(BlockState state, World world, BlockPos pos, PlayerEntity player,
|
||||
boolean willHarvest, IFluidState fluid) {
|
||||
if (player.abilities.isCreativeMode) {
|
||||
final AEBaseTile tile = this.getTileEntity(world, pos);
|
||||
final AEBaseTileEntity tile = this.getTileEntity(world, pos);
|
||||
if (tile != null) {
|
||||
tile.disableDrops();
|
||||
}
|
||||
@@ -284,8 +284,8 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> implements IAEF
|
||||
final TileEntity te = w.getTileEntity(pos);
|
||||
ICableBusContainer out = null;
|
||||
|
||||
if (te instanceof TileCableBus) {
|
||||
out = ((TileCableBus) te).getCableBus();
|
||||
if (te instanceof CableBusTileEntity) {
|
||||
out = ((CableBusTileEntity) te).getCableBus();
|
||||
}
|
||||
|
||||
return out == null ? NULL_CABLE_BUS : out;
|
||||
@@ -296,8 +296,8 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> implements IAEF
|
||||
final TileEntity te = w.getTileEntity(pos);
|
||||
IFacadeContainer out = null;
|
||||
|
||||
if (te instanceof TileCableBus) {
|
||||
out = ((TileCableBus) te).getCableBus().getFacadeContainer();
|
||||
if (te instanceof CableBusTileEntity) {
|
||||
out = ((CableBusTileEntity) te).getCableBus().getFacadeContainer();
|
||||
}
|
||||
|
||||
return out;
|
||||
@@ -313,7 +313,7 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> implements IAEF
|
||||
final Vec3d hitVec = rtr.getHitVec().subtract(new Vec3d(pos));
|
||||
|
||||
if (this.cb(worldIn, pos).clicked(player, Hand.MAIN_HAND, hitVec)) {
|
||||
NetworkHandler.instance().sendToServer(new PacketClick(pos, brtr.getFace(), (float) hitVec.x,
|
||||
NetworkHandler.instance().sendToServer(new ClickPacket(pos, brtr.getFace(), (float) hitVec.x,
|
||||
(float) hitVec.y, (float) hitVec.z, Hand.MAIN_HAND, true));
|
||||
}
|
||||
}
|
||||
@@ -372,7 +372,7 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> implements IAEF
|
||||
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) {
|
||||
|
||||
// FIXME: this has to be cached, optimized, fixed in all kinds of ways
|
||||
TileCableBus te = getTileEntity(w, pos);
|
||||
CableBusTileEntity te = getTileEntity(w, pos);
|
||||
VoxelShape result = VoxelShapes.empty();
|
||||
if (te != null) {
|
||||
for (final AxisAlignedBB bx : te.getCableBus().getSelectedBoundingBoxesFromPool(false, true,
|
||||
@@ -389,7 +389,7 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> implements IAEF
|
||||
public VoxelShape getCollisionShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) {
|
||||
|
||||
// FIXME: this has to be cached, optimized, fixed in all kinds of ways
|
||||
TileCableBus te = getTileEntity(w, pos);
|
||||
CableBusTileEntity te = getTileEntity(w, pos);
|
||||
VoxelShape result = VoxelShapes.empty();
|
||||
if (te != null) {
|
||||
for (final AxisAlignedBB bx : te.getCableBus().getSelectedBoundingBoxesFromPool(false, true,
|
||||
@@ -30,7 +30,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.parts.CableBusContainer;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.tile.networking.CableBusTileEntity;
|
||||
|
||||
/**
|
||||
* Exposes the cable bus color as tint indices 0 (dark variant), 1 (medium
|
||||
@@ -46,8 +46,8 @@ public class CableBusColor implements IBlockColor {
|
||||
|
||||
if (worldIn != null && pos != null) {
|
||||
TileEntity tileEntity = worldIn.getTileEntity(pos);
|
||||
if (tileEntity instanceof TileCableBus) {
|
||||
CableBusContainer container = ((TileCableBus) tileEntity).getCableBus();
|
||||
if (tileEntity instanceof CableBusTileEntity) {
|
||||
CableBusContainer container = ((CableBusTileEntity) tileEntity).getCableBus();
|
||||
busColor = container.getColor();
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -30,9 +30,9 @@ import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.tile.networking.TileController;
|
||||
import appeng.tile.networking.ControllerTileEntity;
|
||||
|
||||
public class BlockController extends AEBaseTileBlock<TileController> {
|
||||
public class ControllerBlock extends AEBaseTileBlock<ControllerTileEntity> {
|
||||
|
||||
public enum ControllerBlockState implements IStringSerializable {
|
||||
offline, online, conflicted;
|
||||
@@ -66,7 +66,7 @@ public class BlockController extends AEBaseTileBlock<TileController> {
|
||||
public static final EnumProperty<ControllerRenderType> CONTROLLER_TYPE = EnumProperty.create("type",
|
||||
ControllerRenderType.class);
|
||||
|
||||
public BlockController() {
|
||||
public ControllerBlock() {
|
||||
super(defaultProps(Material.IRON).hardnessAndResistance(6));
|
||||
this.setDefaultState(this.getDefaultState().with(CONTROLLER_STATE, ControllerBlockState.offline)
|
||||
.with(CONTROLLER_TYPE, ControllerRenderType.block));
|
||||
@@ -132,7 +132,7 @@ public class BlockController extends AEBaseTileBlock<TileController> {
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final TileController tc = this.getTileEntity(world, pos);
|
||||
final ControllerTileEntity tc = this.getTileEntity(world, pos);
|
||||
if (tc != null) {
|
||||
tc.onNeighborChange(false);
|
||||
}
|
||||
+3
-3
@@ -20,11 +20,11 @@ package appeng.block.networking;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.networking.TileCreativeEnergyCell;
|
||||
import appeng.tile.networking.CreativeEnergyCellTileEntity;
|
||||
|
||||
public class BlockCreativeEnergyCell extends AEBaseTileBlock<TileCreativeEnergyCell> {
|
||||
public class CreativeEnergyCellBlock extends AEBaseTileBlock<CreativeEnergyCellTileEntity> {
|
||||
|
||||
public BlockCreativeEnergyCell() {
|
||||
public CreativeEnergyCellBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -18,9 +18,9 @@
|
||||
|
||||
package appeng.block.networking;
|
||||
|
||||
public class BlockDenseEnergyCell extends BlockEnergyCell {
|
||||
public class DenseEnergyCellBlock extends EnergyCellBlock {
|
||||
|
||||
public BlockDenseEnergyCell() {
|
||||
public DenseEnergyCellBlock() {
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -21,11 +21,11 @@ package appeng.block.networking;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.tile.networking.TileEnergyAcceptor;
|
||||
import appeng.tile.networking.EnergyAcceptorTileEntity;
|
||||
|
||||
public class BlockEnergyAcceptor extends AEBaseTileBlock<TileEnergyAcceptor> {
|
||||
public class EnergyAcceptorBlock extends AEBaseTileBlock<EnergyAcceptorTileEntity> {
|
||||
|
||||
public BlockEnergyAcceptor() {
|
||||
public EnergyAcceptorBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -31,13 +31,13 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.networking.TileEnergyCell;
|
||||
import appeng.tile.networking.EnergyCellTileEntity;
|
||||
|
||||
public class BlockEnergyCell extends AEBaseTileBlock<TileEnergyCell> {
|
||||
public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellTileEntity> {
|
||||
|
||||
public static final IntegerProperty ENERGY_STORAGE = IntegerProperty.create("fullness", 0, 7);
|
||||
|
||||
public BlockEnergyCell() {
|
||||
public EnergyCellBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
||||
}
|
||||
|
||||
+9
-9
@@ -39,12 +39,12 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerWireless;
|
||||
import appeng.container.implementations.WirelessContainer;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
import appeng.tile.networking.WirelessTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockWireless extends AEBaseTileBlock<TileWireless> {
|
||||
public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
|
||||
|
||||
enum State implements IStringSerializable {
|
||||
OFF, ON, HAS_CHANNEL;
|
||||
@@ -57,7 +57,7 @@ public class BlockWireless extends AEBaseTileBlock<TileWireless> {
|
||||
|
||||
public static final EnumProperty<State> STATE = EnumProperty.create("state", State.class);
|
||||
|
||||
public BlockWireless() {
|
||||
public WirelessBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE).notSolid());
|
||||
this.setFullSize(false);
|
||||
this.setOpaque(false);
|
||||
@@ -65,7 +65,7 @@ public class BlockWireless extends AEBaseTileBlock<TileWireless> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, TileWireless te) {
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, WirelessTileEntity te) {
|
||||
State teState = State.OFF;
|
||||
|
||||
if (te.isActive()) {
|
||||
@@ -86,11 +86,11 @@ public class BlockWireless extends AEBaseTileBlock<TileWireless> {
|
||||
@Override
|
||||
public ActionResultType onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity player, Hand hand,
|
||||
BlockRayTraceResult hit) {
|
||||
final TileWireless tg = this.getTileEntity(w, pos);
|
||||
final WirelessTileEntity tg = this.getTileEntity(w, pos);
|
||||
|
||||
if (tg != null && !player.isCrouching()) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(ContainerWireless.TYPE, player,
|
||||
ContainerOpener.openContainer(WirelessContainer.TYPE, player,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
@@ -101,7 +101,7 @@ public class BlockWireless extends AEBaseTileBlock<TileWireless> {
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) {
|
||||
final TileWireless tile = this.getTileEntity(w, pos);
|
||||
final WirelessTileEntity tile = this.getTileEntity(w, pos);
|
||||
if (tile != null) {
|
||||
final Direction forward = tile.getForward();
|
||||
|
||||
@@ -161,7 +161,7 @@ public class BlockWireless extends AEBaseTileBlock<TileWireless> {
|
||||
@Override
|
||||
public VoxelShape getCollisionShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) {
|
||||
|
||||
final TileWireless tile = this.getTileEntity(w, pos);
|
||||
final WirelessTileEntity tile = this.getTileEntity(w, pos);
|
||||
if (tile != null) {
|
||||
final Direction forward = tile.getForward();
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.minecraftforge.client.model.data.IModelData;
|
||||
import appeng.client.render.cablebus.CubeBuilder;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.Splotch;
|
||||
import appeng.tile.misc.TilePaint;
|
||||
import appeng.tile.misc.PaintSplotchesTileEntity;
|
||||
|
||||
/**
|
||||
* Renders paint blocks, which render multiple "splotches" that have been
|
||||
@@ -58,7 +58,7 @@ class PaintSplotchesBakedModel implements IDynamicBakedModel {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
PaintSplotches splotchesState = extraData.getData(TilePaint.SPLOTCHES);
|
||||
PaintSplotches splotchesState = extraData.getData(PaintSplotchesTileEntity.SPLOTCHES);
|
||||
|
||||
if (splotchesState == null) {
|
||||
// This is the inventory model which should usually not be used other than in
|
||||
|
||||
+5
-5
@@ -37,11 +37,11 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.tile.misc.TilePaint;
|
||||
import appeng.tile.misc.PaintSplotchesTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockPaint extends AEBaseTileBlock<TilePaint> {
|
||||
public BlockPaint() {
|
||||
public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesTileEntity> {
|
||||
public PaintSplotchesBlock() {
|
||||
super(defaultProps(Material.WATER, MaterialColor.AIR));
|
||||
this.setFullSize(false);
|
||||
this.setOpaque(false);
|
||||
@@ -61,7 +61,7 @@ public class BlockPaint extends AEBaseTileBlock<TilePaint> {
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final TilePaint tp = this.getTileEntity(world, pos);
|
||||
final PaintSplotchesTileEntity tp = this.getTileEntity(world, pos);
|
||||
|
||||
if (tp != null) {
|
||||
tp.neighborChanged();
|
||||
@@ -77,7 +77,7 @@ public class BlockPaint extends AEBaseTileBlock<TilePaint> {
|
||||
|
||||
@Override
|
||||
public int getLightValue(final BlockState state, final IBlockReader w, final BlockPos pos) {
|
||||
final TilePaint tp = this.getTileEntity(w, pos);
|
||||
final PaintSplotchesTileEntity tp = this.getTileEntity(w, pos);
|
||||
|
||||
if (tp != null) {
|
||||
return tp.getLightLevel();
|
||||
+1
-1
@@ -9,7 +9,7 @@ import appeng.bootstrap.BlockRenderingCustomizer;
|
||||
import appeng.bootstrap.IBlockRendering;
|
||||
import appeng.bootstrap.IItemRendering;
|
||||
|
||||
public class PaintRendering extends BlockRenderingCustomizer {
|
||||
public class PaintSplotchesRendering extends BlockRenderingCustomizer {
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -28,7 +28,7 @@ import net.minecraftforge.client.model.data.IModelData;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.client.render.cablebus.CubeBuilder;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
import appeng.tile.qnb.QuantumBridgeTileEntity;
|
||||
|
||||
class QnbFormedBakedModel implements IDynamicBakedModel {
|
||||
|
||||
@@ -79,7 +79,7 @@ class QnbFormedBakedModel implements IDynamicBakedModel {
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, Random rand,
|
||||
IModelData modelData) {
|
||||
QnbFormedState formedState = modelData.getData(TileQuantumBridge.FORMED_STATE);
|
||||
QnbFormedState formedState = modelData.getData(QuantumBridgeTileEntity.FORMED_STATE);
|
||||
|
||||
if (formedState == null) {
|
||||
return this.baseModel.getQuads(state, side, rand);
|
||||
|
||||
+6
-6
@@ -31,9 +31,9 @@ import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
import appeng.tile.qnb.QuantumBridgeTileEntity;
|
||||
|
||||
public abstract class BlockQuantumBase extends AEBaseTileBlock<TileQuantumBridge> {
|
||||
public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeTileEntity> {
|
||||
|
||||
public static final BooleanProperty FORMED = BooleanProperty.create("formed");
|
||||
|
||||
@@ -44,7 +44,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock<TileQuantumBridge
|
||||
SHAPE = VoxelShapes.create(new AxisAlignedBB(shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave));
|
||||
}
|
||||
|
||||
public BlockQuantumBase(Block.Properties props) {
|
||||
public QuantumBaseBlock(Block.Properties props) {
|
||||
super(props);
|
||||
this.setFullSize(this.setOpaque(false));
|
||||
this.setDefaultState(this.getDefaultState().with(FORMED, false));
|
||||
@@ -62,14 +62,14 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock<TileQuantumBridge
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, TileQuantumBridge te) {
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, QuantumBridgeTileEntity te) {
|
||||
return currentState.with(FORMED, te.isFormed());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final TileQuantumBridge bridge = this.getTileEntity(world, pos);
|
||||
final QuantumBridgeTileEntity bridge = this.getTileEntity(world, pos);
|
||||
if (bridge != null) {
|
||||
bridge.neighborUpdate();
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock<TileQuantumBridge
|
||||
return; // Just a block state change
|
||||
}
|
||||
|
||||
final TileQuantumBridge bridge = this.getTileEntity(w, pos);
|
||||
final QuantumBridgeTileEntity bridge = this.getTileEntity(w, pos);
|
||||
if (bridge != null) {
|
||||
bridge.breakCluster();
|
||||
}
|
||||
+7
-7
@@ -39,13 +39,13 @@ import net.minecraft.world.World;
|
||||
import appeng.client.EffectType;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerQNB;
|
||||
import appeng.container.implementations.QNBContainer;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
import appeng.tile.qnb.QuantumBridgeTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockQuantumLinkChamber extends BlockQuantumBase {
|
||||
public class QuantumLinkChamberBlock extends QuantumBaseBlock {
|
||||
|
||||
private static final VoxelShape SHAPE;
|
||||
|
||||
@@ -55,13 +55,13 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase {
|
||||
new AxisAlignedBB(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel));
|
||||
}
|
||||
|
||||
public BlockQuantumLinkChamber() {
|
||||
public QuantumLinkChamberBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random rand) {
|
||||
final TileQuantumBridge bridge = this.getTileEntity(w, pos);
|
||||
final QuantumBridgeTileEntity bridge = this.getTileEntity(w, pos);
|
||||
if (bridge != null) {
|
||||
if (bridge.hasQES()) {
|
||||
if (AppEng.proxy.shouldAddParticles(rand)) {
|
||||
@@ -79,10 +79,10 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
final TileQuantumBridge tg = this.getTileEntity(w, pos);
|
||||
final QuantumBridgeTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(ContainerQNB.TYPE, p, ContainerLocator.forTileEntity(tg));
|
||||
ContainerOpener.openContainer(QNBContainer.TYPE, p, ContainerLocator.forTileEntity(tg));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
+4
-4
@@ -27,21 +27,21 @@ import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.util.math.shapes.VoxelShapes;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
import appeng.tile.qnb.QuantumBridgeTileEntity;
|
||||
|
||||
public class BlockQuantumRing extends BlockQuantumBase {
|
||||
public class QuantumRingBlock extends QuantumBaseBlock {
|
||||
|
||||
private static final VoxelShape SHAPE = createShape(2.0 / 16.0);
|
||||
private static final VoxelShape SHAPE_CORNER = createShape(4.0 / 16.0);
|
||||
private static final VoxelShape SHAPE_FORMED = createShape(1.0 / 16.0);
|
||||
|
||||
public BlockQuantumRing() {
|
||||
public QuantumRingBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) {
|
||||
final TileQuantumBridge bridge = this.getTileEntity(w, pos);
|
||||
final QuantumBridgeTileEntity bridge = this.getTileEntity(w, pos);
|
||||
if (bridge != null && bridge.isCorner()) {
|
||||
return SHAPE_CORNER;
|
||||
} else if (bridge != null && bridge.isFormed()) {
|
||||
+2
-2
@@ -44,12 +44,12 @@ import appeng.block.AEBaseBlock;
|
||||
* This block is used to fill empty space in spatial dimensions and delinates
|
||||
* the border of a spatial dimensions's usable space.
|
||||
*/
|
||||
public class BlockMatrixFrame extends AEBaseBlock {
|
||||
public class MatrixFrameBlock extends AEBaseBlock {
|
||||
|
||||
private static final Material MATERIAL = new Material(MaterialColor.AIR, false, true, true, false, false, false,
|
||||
false, PushReaction.PUSH_ONLY);
|
||||
|
||||
public BlockMatrixFrame() {
|
||||
public MatrixFrameBlock() {
|
||||
super(Properties.create(MATERIAL).hardnessAndResistance(-1.0F, 6000000.0F).notSolid().noDrops());
|
||||
}
|
||||
|
||||
+7
-7
@@ -34,20 +34,20 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerSpatialIOPort;
|
||||
import appeng.tile.spatial.TileSpatialIOPort;
|
||||
import appeng.container.implementations.SpatialIOPortContainer;
|
||||
import appeng.tile.spatial.SpatialIOPortTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockSpatialIOPort extends AEBaseTileBlock<TileSpatialIOPort> {
|
||||
public class SpatialIOPortBlock extends AEBaseTileBlock<SpatialIOPortTileEntity> {
|
||||
|
||||
public BlockSpatialIOPort() {
|
||||
public SpatialIOPortBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final TileSpatialIOPort te = this.getTileEntity(world, pos);
|
||||
final SpatialIOPortTileEntity te = this.getTileEntity(world, pos);
|
||||
if (te != null) {
|
||||
te.updateRedstoneState();
|
||||
}
|
||||
@@ -60,10 +60,10 @@ public class BlockSpatialIOPort extends AEBaseTileBlock<TileSpatialIOPort> {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
final TileSpatialIOPort tg = this.getTileEntity(w, pos);
|
||||
final SpatialIOPortTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(ContainerSpatialIOPort.TYPE, p,
|
||||
ContainerOpener.openContainer(SpatialIOPortContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
+5
-5
@@ -26,18 +26,18 @@ import net.minecraft.world.World;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.spatial.TileSpatialPylon;
|
||||
import appeng.tile.spatial.SpatialPylonTileEntity;
|
||||
|
||||
public class BlockSpatialPylon extends AEBaseTileBlock<TileSpatialPylon> {
|
||||
public class SpatialPylonBlock extends AEBaseTileBlock<SpatialPylonTileEntity> {
|
||||
|
||||
public BlockSpatialPylon() {
|
||||
public SpatialPylonBlock() {
|
||||
super(defaultProps(AEGlassMaterial.INSTANCE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final TileSpatialPylon tsp = this.getTileEntity(world, pos);
|
||||
final SpatialPylonTileEntity tsp = this.getTileEntity(world, pos);
|
||||
if (tsp != null) {
|
||||
tsp.neighborChanged();
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class BlockSpatialPylon extends AEBaseTileBlock<TileSpatialPylon> {
|
||||
|
||||
@Override
|
||||
public int getLightValue(final BlockState state, final IBlockReader w, final BlockPos pos) {
|
||||
final TileSpatialPylon tsp = this.getTileEntity(w, pos);
|
||||
final SpatialPylonTileEntity tsp = this.getTileEntity(w, pos);
|
||||
if (tsp != null) {
|
||||
return tsp.getLightValue();
|
||||
}
|
||||
+7
-7
@@ -36,16 +36,16 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerChest;
|
||||
import appeng.container.implementations.ChestContainer;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.tile.storage.TileChest;
|
||||
import appeng.tile.storage.ChestTileEntity;
|
||||
|
||||
public class BlockChest extends AEBaseTileBlock<TileChest> {
|
||||
public class ChestBlock extends AEBaseTileBlock<ChestTileEntity> {
|
||||
|
||||
private final static EnumProperty<DriveSlotState> SLOT_STATE = EnumProperty.create("slot_state",
|
||||
DriveSlotState.class);
|
||||
|
||||
public BlockChest() {
|
||||
public ChestBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
this.setDefaultState(this.getDefaultState().with(SLOT_STATE, DriveSlotState.EMPTY));
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class BlockChest extends AEBaseTileBlock<TileChest> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, TileChest te) {
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, ChestTileEntity te) {
|
||||
DriveSlotState slotState = DriveSlotState.EMPTY;
|
||||
|
||||
if (te.getCellCount() >= 1) {
|
||||
@@ -74,7 +74,7 @@ public class BlockChest extends AEBaseTileBlock<TileChest> {
|
||||
@Override
|
||||
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity p, final Hand hand,
|
||||
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
|
||||
final TileChest tg = this.getTileEntity(w, pos);
|
||||
final ChestTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null && !p.isCrouching()) {
|
||||
if (w.isRemote()) {
|
||||
return ActionResultType.SUCCESS;
|
||||
@@ -85,7 +85,7 @@ public class BlockChest extends AEBaseTileBlock<TileChest> {
|
||||
p.sendMessage(PlayerMessages.ChestCannotReadStorageCell.get());
|
||||
}
|
||||
} else {
|
||||
ContainerOpener.openContainer(ContainerChest.TYPE, p,
|
||||
ContainerOpener.openContainer(ChestContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
|
||||
+6
-6
@@ -32,13 +32,13 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerDrive;
|
||||
import appeng.tile.storage.TileDrive;
|
||||
import appeng.container.implementations.DriveContainer;
|
||||
import appeng.tile.storage.DriveTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockDrive extends AEBaseTileBlock<TileDrive> {
|
||||
public class DriveBlock extends AEBaseTileBlock<DriveTileEntity> {
|
||||
|
||||
public BlockDrive() {
|
||||
public DriveBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ public class BlockDrive extends AEBaseTileBlock<TileDrive> {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
final TileDrive tg = this.getTileEntity(w, pos);
|
||||
final DriveTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(ContainerDrive.TYPE, p, ContainerLocator.forTileEntity(tg));
|
||||
ContainerOpener.openContainer(DriveContainer.TYPE, p, ContainerLocator.forTileEntity(tg));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
+7
-7
@@ -34,20 +34,20 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerIOPort;
|
||||
import appeng.tile.storage.TileIOPort;
|
||||
import appeng.container.implementations.IOPortContainer;
|
||||
import appeng.tile.storage.IOPortTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockIOPort extends AEBaseTileBlock<TileIOPort> {
|
||||
public class IOPortBlock extends AEBaseTileBlock<IOPortTileEntity> {
|
||||
|
||||
public BlockIOPort() {
|
||||
public IOPortBlock() {
|
||||
super(defaultProps(Material.IRON));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos,
|
||||
boolean isMoving) {
|
||||
final TileIOPort te = this.getTileEntity(world, pos);
|
||||
final IOPortTileEntity te = this.getTileEntity(world, pos);
|
||||
if (te != null) {
|
||||
te.updateRedstoneState();
|
||||
}
|
||||
@@ -60,10 +60,10 @@ public class BlockIOPort extends AEBaseTileBlock<TileIOPort> {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
final TileIOPort tg = this.getTileEntity(w, pos);
|
||||
final IOPortTileEntity tg = this.getTileEntity(w, pos);
|
||||
if (tg != null) {
|
||||
if (Platform.isServer()) {
|
||||
ContainerOpener.openContainer(ContainerIOPort.TYPE, p,
|
||||
ContainerOpener.openContainer(IOPortContainer.TYPE, p,
|
||||
ContainerLocator.forTileEntitySide(tg, hit.getFace()));
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
+7
-7
@@ -39,11 +39,11 @@ import net.minecraft.world.World;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerSkyChest;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
import appeng.container.implementations.SkyChestContainer;
|
||||
import appeng.tile.storage.SkyChestTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class BlockSkyChest extends AEBaseTileBlock<TileSkyChest> {
|
||||
public class SkyChestBlock extends AEBaseTileBlock<SkyChestTileEntity> {
|
||||
|
||||
private static final double AABB_OFFSET_BOTTOM = 0.00;
|
||||
private static final double AABB_OFFSET_SIDES = 0.06;
|
||||
@@ -55,7 +55,7 @@ public class BlockSkyChest extends AEBaseTileBlock<TileSkyChest> {
|
||||
|
||||
public final SkyChestType type;
|
||||
|
||||
public BlockSkyChest(final SkyChestType type, Properties props) {
|
||||
public SkyChestBlock(final SkyChestType type, Properties props) {
|
||||
super(props);
|
||||
this.type = type;
|
||||
}
|
||||
@@ -74,12 +74,12 @@ public class BlockSkyChest extends AEBaseTileBlock<TileSkyChest> {
|
||||
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
|
||||
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
|
||||
if (Platform.isServer()) {
|
||||
TileSkyChest tile = getTileEntity(w, pos);
|
||||
SkyChestTileEntity tile = getTileEntity(w, pos);
|
||||
if (tile == null) {
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
ContainerOpener.openContainer(ContainerSkyChest.TYPE, player, ContainerLocator.forTileEntity(tile));
|
||||
ContainerOpener.openContainer(SkyChestContainer.TYPE, player, ContainerLocator.forTileEntity(tile));
|
||||
}
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
@@ -93,7 +93,7 @@ public class BlockSkyChest extends AEBaseTileBlock<TileSkyChest> {
|
||||
}
|
||||
|
||||
private AxisAlignedBB computeAABB(final IBlockReader w, final BlockPos pos) {
|
||||
final TileSkyChest sk = this.getTileEntity(w, pos);
|
||||
final SkyChestTileEntity sk = this.getTileEntity(w, pos);
|
||||
Direction o = Direction.UP;
|
||||
|
||||
if (sk != null) {
|
||||
@@ -42,7 +42,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.features.AEFeature;
|
||||
import appeng.bootstrap.components.ModelOverrideComponent;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class FeatureFactory {
|
||||
@@ -85,8 +85,8 @@ public class FeatureFactory {
|
||||
return new EntityBuilder<T>(this, id, factory, classification).features(this.defaultFeatures);
|
||||
}
|
||||
|
||||
public <T extends AEBaseTile> TileEntityBuilder<T> tileEntity(String id, Class<T> teClass,
|
||||
Function<TileEntityType<T>, T> factory) {
|
||||
public <T extends AEBaseTileEntity> TileEntityBuilder<T> tileEntity(String id, Class<T> teClass,
|
||||
Function<TileEntityType<T>, T> factory) {
|
||||
return new TileEntityBuilder<>(this, id, teClass, factory).features(this.defaultFeatures);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import appeng.bootstrap.definitions.TileEntityDefinition;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.features.ActivityState;
|
||||
import appeng.core.features.BlockStackSrc;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
import appeng.util.Platform;
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ import appeng.util.Platform;
|
||||
*
|
||||
* @param <T>
|
||||
*/
|
||||
public class TileEntityBuilder<T extends AEBaseTile> {
|
||||
public class TileEntityBuilder<T extends AEBaseTileEntity> {
|
||||
|
||||
private final FeatureFactory factory;
|
||||
|
||||
@@ -95,7 +95,7 @@ public class TileEntityBuilder<T extends AEBaseTile> {
|
||||
type.setRegistryName(AppEng.MOD_ID, registryName);
|
||||
registry.register(type);
|
||||
|
||||
AEBaseTile.registerTileItem(tileClass, new BlockStackSrc(blocks.get(0), ActivityState.Enabled));
|
||||
AEBaseTileEntity.registerTileItem(tileClass, new BlockStackSrc(blocks.get(0), ActivityState.Enabled));
|
||||
|
||||
for (Block block : blocks) {
|
||||
if (block instanceof AEBaseTileBlock) {
|
||||
|
||||
@@ -25,9 +25,9 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
|
||||
public class TileEntityRendering<T extends AEBaseTile> {
|
||||
public class TileEntityRendering<T extends AEBaseTileEntity> {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
Function<TileEntityRendererDispatcher, TileEntityRenderer<T>> tileEntityRenderer;
|
||||
|
||||
@@ -21,14 +21,14 @@ package appeng.bootstrap;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
|
||||
/**
|
||||
* A callback that allows the rendering of a tile entity to be customized. Sadly
|
||||
* this class is required and no lambdas can be used due to them not being able
|
||||
* to be annotated with @OnlyIn(CLIENT).
|
||||
*/
|
||||
public abstract class TileEntityRenderingCustomizer<T extends AEBaseTile> {
|
||||
public abstract class TileEntityRenderingCustomizer<T extends AEBaseTileEntity> {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public abstract void customize(TileEntityRendering<T> rendering);
|
||||
|
||||
@@ -43,7 +43,7 @@ import appeng.client.render.effects.*;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
import appeng.helpers.IMouseWheelItem;
|
||||
import appeng.server.ServerHelper;
|
||||
import appeng.util.Platform;
|
||||
@@ -222,7 +222,7 @@ public class ClientHelper extends ServerHelper {
|
||||
|
||||
if (mainHand || offHand) {
|
||||
NetworkHandler.instance()
|
||||
.sendToServer(new PacketValueConfig("Item", me.getScrollDelta() > 0 ? "WheelUp" : "WheelDown"));
|
||||
.sendToServer(new ConfigValuePacket("Item", me.getScrollDelta() > 0 ? "WheelUp" : "WheelDown"));
|
||||
me.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -34,9 +34,9 @@ import appeng.container.AEBaseContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
|
||||
public abstract class AEBaseMEGui<T extends AEBaseContainer> extends AEBaseGui<T> {
|
||||
public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseScreen<T> {
|
||||
|
||||
public AEBaseMEGui(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public AEBaseMEScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
+41
-41
@@ -59,8 +59,8 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.widgets.GuiCustomSlot;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.CustomSlotWidget;
|
||||
import appeng.client.gui.widgets.Scrollbar;
|
||||
import appeng.client.gui.widgets.ITooltip;
|
||||
import appeng.client.me.InternalSlotME;
|
||||
import appeng.client.me.SlotDisconnected;
|
||||
@@ -71,36 +71,36 @@ import appeng.container.slot.AppEngCraftingSlot;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.container.slot.AppEngSlot.CalculatedValidity;
|
||||
import appeng.container.slot.IOptionalSlot;
|
||||
import appeng.container.slot.SlotCraftingTerm;
|
||||
import appeng.container.slot.SlotDisabled;
|
||||
import appeng.container.slot.SlotFake;
|
||||
import appeng.container.slot.SlotInaccessible;
|
||||
import appeng.container.slot.SlotOutput;
|
||||
import appeng.container.slot.SlotPatternTerm;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.container.slot.CraftingTermSlot;
|
||||
import appeng.container.slot.DisabledSlot;
|
||||
import appeng.container.slot.FakeSlot;
|
||||
import appeng.container.slot.InaccessibleSlot;
|
||||
import appeng.container.slot.OutputSlot;
|
||||
import appeng.container.slot.PatternTermSlot;
|
||||
import appeng.container.slot.RestrictedInputSlot;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.core.sync.packets.PacketSwapSlots;
|
||||
import appeng.core.sync.packets.InventoryActionPacket;
|
||||
import appeng.core.sync.packets.SwapSlotsPacket;
|
||||
import appeng.fluids.client.render.FluidStackSizeRenderer;
|
||||
import appeng.fluids.container.slots.IMEFluidSlot;
|
||||
import appeng.helpers.InventoryAction;
|
||||
|
||||
public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScreen<T> {
|
||||
public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerScreen<T> {
|
||||
private final List<InternalSlotME> meSlots = new ArrayList<>();
|
||||
// drag y
|
||||
private final Set<Slot> drag_click = new HashSet<>();
|
||||
private final StackSizeRenderer stackSizeRenderer = new StackSizeRenderer();
|
||||
private final FluidStackSizeRenderer fluidStackSizeRenderer = new FluidStackSizeRenderer();
|
||||
private GuiScrollbar myScrollBar = null;
|
||||
private Scrollbar myScrollBar = null;
|
||||
private boolean disableShiftClick = false;
|
||||
private Stopwatch dbl_clickTimer = Stopwatch.createStarted();
|
||||
private ItemStack dbl_whichItem = ItemStack.EMPTY;
|
||||
private Slot bl_clicked;
|
||||
protected final List<GuiCustomSlot> guiSlots = new ArrayList<>();
|
||||
protected final List<CustomSlotWidget> guiSlots = new ArrayList<>();
|
||||
|
||||
public AEBaseGui(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public AEBaseScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@@ -128,11 +128,11 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
RenderSystem.pushMatrix();
|
||||
RenderSystem.translatef(this.guiLeft, this.guiTop, 0.0F);
|
||||
RenderSystem.enableDepthTest();
|
||||
for (final GuiCustomSlot c : this.guiSlots) {
|
||||
for (final CustomSlotWidget c : this.guiSlots) {
|
||||
this.drawGuiSlot(c, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
RenderSystem.disableDepthTest();
|
||||
for (final GuiCustomSlot c : this.guiSlots) {
|
||||
for (final CustomSlotWidget c : this.guiSlots) {
|
||||
this.drawTooltip(c, mouseX - this.guiLeft, mouseY - this.guiTop);
|
||||
}
|
||||
RenderSystem.popMatrix();
|
||||
@@ -147,7 +147,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiSlot(GuiCustomSlot slot, int mouseX, int mouseY, float partialTicks) {
|
||||
protected void drawGuiSlot(CustomSlotWidget slot, int mouseX, int mouseY, float partialTicks) {
|
||||
if (slot.isSlotEnabled()) {
|
||||
final int left = slot.xPos();
|
||||
final int top = slot.yPos();
|
||||
@@ -250,7 +250,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
}
|
||||
}
|
||||
|
||||
for (final GuiCustomSlot slot : this.guiSlots) {
|
||||
for (final CustomSlotWidget slot : this.guiSlots) {
|
||||
slot.drawBackground(ox, oy, getBlitOffset());
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
}
|
||||
}
|
||||
|
||||
for (GuiCustomSlot slot : this.guiSlots) {
|
||||
for (CustomSlotWidget slot : this.guiSlots) {
|
||||
if (this.isPointInRegion(slot.xPos(), slot.yPos(), slot.getWidth(), slot.getHeight(), xCoord, yCoord)
|
||||
&& slot.canClick(getPlayer())) {
|
||||
slot.slotClicked(getPlayer().inventory.getItemStack(), btn);
|
||||
@@ -294,11 +294,11 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
this.getScrollBar().click((int) mouseX - this.guiLeft, (int) mouseY - this.guiTop);
|
||||
}
|
||||
|
||||
if (slot instanceof SlotFake && !itemstack.isEmpty()) {
|
||||
if (slot instanceof FakeSlot && !itemstack.isEmpty()) {
|
||||
this.drag_click.add(slot);
|
||||
if (this.drag_click.size() > 1) {
|
||||
for (final Slot dr : this.drag_click) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(
|
||||
final InventoryActionPacket p = new InventoryActionPacket(
|
||||
mouseButton == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE,
|
||||
dr.slotNumber, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
@@ -317,7 +317,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
final ClickType clickType) {
|
||||
final PlayerEntity player = getPlayer();
|
||||
|
||||
if (slot instanceof SlotFake) {
|
||||
if (slot instanceof FakeSlot) {
|
||||
final InventoryAction action = mouseButton == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE
|
||||
: InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
|
||||
@@ -325,19 +325,19 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
return;
|
||||
}
|
||||
|
||||
final PacketInventoryAction p = new PacketInventoryAction(action, slotIdx, 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(action, slotIdx, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (slot instanceof SlotPatternTerm) {
|
||||
if (slot instanceof PatternTermSlot) {
|
||||
if (mouseButton == 6) {
|
||||
return; // prevent weird double clicks..
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendToServer(((SlotPatternTerm) slot).getRequest(hasShiftDown()));
|
||||
} else if (slot instanceof SlotCraftingTerm) {
|
||||
NetworkHandler.instance().sendToServer(((PatternTermSlot) slot).getRequest(hasShiftDown()));
|
||||
} else if (slot instanceof CraftingTermSlot) {
|
||||
if (mouseButton == 6) {
|
||||
return; // prevent weird double clicks..
|
||||
}
|
||||
@@ -350,7 +350,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
action = (mouseButton == 1) ? InventoryAction.CRAFT_STACK : InventoryAction.CRAFT_ITEM;
|
||||
}
|
||||
|
||||
final PacketInventoryAction p = new PacketInventoryAction(action, slotIdx, 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(action, slotIdx, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
|
||||
return;
|
||||
@@ -370,7 +370,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
}
|
||||
|
||||
((AEBaseContainer) this.container).setTargetStack(stack);
|
||||
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.MOVE_REGION, slotNum, 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(InventoryAction.MOVE_REGION, slotNum, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
return;
|
||||
}
|
||||
@@ -401,7 +401,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
}
|
||||
|
||||
if (action != null) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(action, slot.getSlotIndex(),
|
||||
final InventoryActionPacket p = new InventoryActionPacket(action, slot.getSlotIndex(),
|
||||
((SlotDisconnected) slot).getSlot().getId());
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
}
|
||||
@@ -449,7 +449,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
|
||||
if (action != null) {
|
||||
this.container.setTargetStack(stack);
|
||||
final PacketInventoryAction p = new PacketInventoryAction(action, this.getInventorySlots().size(), 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(action, this.getInventorySlots().size(), 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
if (s.getSlotIndex() == j
|
||||
&& s.inventory == ((AEBaseContainer) this.container).getPlayerInv()) {
|
||||
NetworkHandler.instance()
|
||||
.sendToServer(new PacketSwapSlots(s.slotNumber, theSlot.slotNumber));
|
||||
.sendToServer(new SwapSlotsPacket(s.slotNumber, theSlot.slotNumber));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -575,7 +575,7 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
final int times = (int) Math.abs(wheel);
|
||||
final int inventorySize = this.getInventorySlots().size();
|
||||
for (int h = 0; h < times; h++) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(direction, inventorySize, 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(direction, inventorySize, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
}
|
||||
}
|
||||
@@ -716,13 +716,13 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
if (!is.isEmpty() && s instanceof AppEngSlot) {
|
||||
AppEngSlot aeSlot = (AppEngSlot) s;
|
||||
if (aeSlot.getIsValid() == CalculatedValidity.NotAvailable) {
|
||||
boolean isValid = s.isItemValid(is) || s instanceof SlotOutput
|
||||
|| s instanceof AppEngCraftingSlot || s instanceof SlotDisabled
|
||||
|| s instanceof SlotInaccessible || s instanceof SlotFake
|
||||
|| s instanceof SlotRestrictedInput || s instanceof SlotDisconnected;
|
||||
if (isValid && s instanceof SlotRestrictedInput) {
|
||||
boolean isValid = s.isItemValid(is) || s instanceof OutputSlot
|
||||
|| s instanceof AppEngCraftingSlot || s instanceof DisabledSlot
|
||||
|| s instanceof InaccessibleSlot || s instanceof FakeSlot
|
||||
|| s instanceof RestrictedInputSlot || s instanceof SlotDisconnected;
|
||||
if (isValid && s instanceof RestrictedInputSlot) {
|
||||
try {
|
||||
isValid = ((SlotRestrictedInput) s).isValid(is, getMinecraft().world);
|
||||
isValid = ((RestrictedInputSlot) s).isValid(is, getMinecraft().world);
|
||||
} catch (final Exception err) {
|
||||
AELog.debug(err);
|
||||
}
|
||||
@@ -770,11 +770,11 @@ public abstract class AEBaseGui<T extends AEBaseContainer> extends ContainerScre
|
||||
getMinecraft().getTextureManager().bindTexture(loc);
|
||||
}
|
||||
|
||||
protected GuiScrollbar getScrollBar() {
|
||||
protected Scrollbar getScrollBar() {
|
||||
return this.myScrollBar;
|
||||
}
|
||||
|
||||
protected void setScrollBar(final GuiScrollbar myScrollBar) {
|
||||
protected void setScrollBar(final Scrollbar myScrollBar) {
|
||||
this.myScrollBar = myScrollBar;
|
||||
}
|
||||
|
||||
+28
-28
@@ -11,29 +11,29 @@ import net.minecraft.item.ItemStack;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerChest;
|
||||
import appeng.container.implementations.ContainerCraftingTerm;
|
||||
import appeng.container.implementations.ContainerMEMonitorable;
|
||||
import appeng.container.implementations.ContainerPatternTerm;
|
||||
import appeng.container.implementations.ContainerWirelessTerm;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.ChestContainer;
|
||||
import appeng.container.implementations.CraftingTermContainer;
|
||||
import appeng.container.implementations.MEMonitorableContainer;
|
||||
import appeng.container.implementations.PatternTermContainer;
|
||||
import appeng.container.implementations.WirelessTermContainer;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.parts.reporting.PartCraftingTerminal;
|
||||
import appeng.parts.reporting.PartPatternTerminal;
|
||||
import appeng.parts.reporting.PartTerminal;
|
||||
import appeng.tile.storage.TileChest;
|
||||
import appeng.parts.reporting.CraftingTerminalPart;
|
||||
import appeng.parts.reporting.PatternTerminalPart;
|
||||
import appeng.parts.reporting.TerminalPart;
|
||||
import appeng.tile.storage.ChestTileEntity;
|
||||
|
||||
/**
|
||||
* Utility class for sub-screens of other containers that allow returning to the
|
||||
* primary container UI.
|
||||
*/
|
||||
final class AESubGui {
|
||||
final class AESubScreen {
|
||||
|
||||
private final AEBaseGui<?> gui;
|
||||
private final AEBaseScreen<?> gui;
|
||||
private final ContainerType<?> previousContainerType;
|
||||
private final ItemStack previousContainerIcon;
|
||||
|
||||
@@ -41,19 +41,19 @@ final class AESubGui {
|
||||
* Based on the container we're opening for, try to determine what it's
|
||||
* "primary" GUI would be so that we can go back to it.
|
||||
*/
|
||||
public AESubGui(AEBaseGui<?> gui, Object containerTarget) {
|
||||
public AESubScreen(AEBaseScreen<?> gui, Object containerTarget) {
|
||||
this.gui = gui;
|
||||
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
final IParts parts = definitions.parts();
|
||||
|
||||
if (containerTarget instanceof TileChest) {
|
||||
if (containerTarget instanceof ChestTileEntity) {
|
||||
// A chest is also a priority host, but the priority _interface_ can only be
|
||||
// opened from the
|
||||
// chest ui that doesn't actually show the contents of the inserted cell.
|
||||
IPriorityHost priorityHost = (IPriorityHost) containerTarget;
|
||||
this.previousContainerIcon = priorityHost.getItemStackRepresentation();
|
||||
this.previousContainerType = ContainerChest.TYPE;
|
||||
this.previousContainerType = ChestContainer.TYPE;
|
||||
}
|
||||
|
||||
else if (containerTarget instanceof IPriorityHost) {
|
||||
@@ -64,22 +64,22 @@ final class AESubGui {
|
||||
|
||||
else if (containerTarget instanceof WirelessTerminalGuiObject) {
|
||||
this.previousContainerIcon = definitions.items().wirelessTerminal().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
this.previousContainerType = ContainerWirelessTerm.TYPE;
|
||||
this.previousContainerType = WirelessTermContainer.TYPE;
|
||||
}
|
||||
|
||||
else if (containerTarget instanceof PartTerminal) {
|
||||
else if (containerTarget instanceof TerminalPart) {
|
||||
this.previousContainerIcon = parts.terminal().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
this.previousContainerType = ContainerMEMonitorable.TYPE;
|
||||
this.previousContainerType = MEMonitorableContainer.TYPE;
|
||||
}
|
||||
|
||||
else if (containerTarget instanceof PartCraftingTerminal) {
|
||||
else if (containerTarget instanceof CraftingTerminalPart) {
|
||||
this.previousContainerIcon = parts.craftingTerminal().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
this.previousContainerType = ContainerCraftingTerm.TYPE;
|
||||
this.previousContainerType = CraftingTermContainer.TYPE;
|
||||
}
|
||||
|
||||
else if (containerTarget instanceof PartPatternTerminal) {
|
||||
else if (containerTarget instanceof PatternTerminalPart) {
|
||||
this.previousContainerIcon = parts.patternTerminal().maybeStack(1).orElse(ItemStack.EMPTY);
|
||||
this.previousContainerType = ContainerPatternTerm.TYPE;
|
||||
this.previousContainerType = PatternTermContainer.TYPE;
|
||||
}
|
||||
|
||||
else {
|
||||
@@ -88,17 +88,17 @@ final class AESubGui {
|
||||
}
|
||||
}
|
||||
|
||||
public final GuiTabButton addBackButton(Consumer<GuiTabButton> buttonAdder, int x, int y) {
|
||||
public final TabButton addBackButton(Consumer<TabButton> buttonAdder, int x, int y) {
|
||||
return addBackButton(buttonAdder, x, y, null);
|
||||
}
|
||||
|
||||
public final GuiTabButton addBackButton(Consumer<GuiTabButton> buttonAdder, int x, int y, @Nullable String label) {
|
||||
public final TabButton addBackButton(Consumer<TabButton> buttonAdder, int x, int y, @Nullable String label) {
|
||||
if (this.previousContainerType != null && !previousContainerIcon.isEmpty()) {
|
||||
if (label == null) {
|
||||
label = previousContainerIcon.getDisplayName().getString();
|
||||
}
|
||||
ItemRenderer itemRenderer = gui.getMinecraft().getItemRenderer();
|
||||
GuiTabButton button = new GuiTabButton(gui.getGuiLeft() + x, gui.getGuiTop() + y, previousContainerIcon,
|
||||
TabButton button = new TabButton(gui.getGuiLeft() + x, gui.getGuiTop() + y, previousContainerIcon,
|
||||
label, itemRenderer, btn -> goBack());
|
||||
buttonAdder.accept(button);
|
||||
return button;
|
||||
@@ -107,7 +107,7 @@ final class AESubGui {
|
||||
}
|
||||
|
||||
public final void goBack() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(this.previousContainerType));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(this.previousContainerType));
|
||||
}
|
||||
|
||||
}
|
||||
+15
-15
@@ -30,32 +30,32 @@ import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.items.IUpgradeModule;
|
||||
import appeng.client.gui.widgets.GuiActionButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiToggleButton;
|
||||
import appeng.container.implementations.ContainerCellWorkbench;
|
||||
import appeng.client.gui.widgets.ActionButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.client.gui.widgets.ToggleButton;
|
||||
import appeng.container.implementations.CellWorkbenchContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiCellWorkbench extends GuiUpgradeable<ContainerCellWorkbench> {
|
||||
public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContainer> {
|
||||
|
||||
private GuiToggleButton copyMode;
|
||||
private ToggleButton copyMode;
|
||||
|
||||
public GuiCellWorkbench(ContainerCellWorkbench container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CellWorkbenchScreen(CellWorkbenchContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.fuzzyMode = this.addButton(new GuiSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
this.fuzzyMode = this.addButton(new SettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL, this::toggleFuzzyMode));
|
||||
this.addButton(new GuiActionButton(this.guiLeft - 18, this.guiTop + 28, ActionItems.WRENCH,
|
||||
this.addButton(new ActionButton(this.guiLeft - 18, this.guiTop + 28, ActionItems.WRENCH,
|
||||
act1 -> action("Partition")));
|
||||
this.addButton(
|
||||
new GuiActionButton(this.guiLeft - 18, this.guiTop + 8, ActionItems.CLOSE, act -> action("Clear")));
|
||||
this.copyMode = this.addButton(new GuiToggleButton(this.guiLeft - 18, this.guiTop + 48, 11 * 16 + 5,
|
||||
new ActionButton(this.guiLeft - 18, this.guiTop + 8, ActionItems.CLOSE, act -> action("Clear")));
|
||||
this.copyMode = this.addButton(new ToggleButton(this.guiLeft - 18, this.guiTop + 48, 11 * 16 + 5,
|
||||
12 * 16 + 5, GuiText.CopyMode.getLocal(), GuiText.CopyModeDesc.getLocal(), act -> action("CopyMode")));
|
||||
}
|
||||
|
||||
@@ -146,12 +146,12 @@ public class GuiCellWorkbench extends GuiUpgradeable<ContainerCellWorkbench> {
|
||||
}
|
||||
|
||||
private void action(String type) {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("CellWorkbench.Action", type));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("CellWorkbench.Action", type));
|
||||
}
|
||||
|
||||
private void toggleFuzzyMode(GuiSettingToggleButton<FuzzyMode> button, boolean backwards) {
|
||||
private void toggleFuzzyMode(SettingToggleButton<FuzzyMode> button, boolean backwards) {
|
||||
FuzzyMode fz = button.getNextValue(backwards);
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("CellWorkbench.Fuzzy", fz.name()));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("CellWorkbench.Fuzzy", fz.name()));
|
||||
}
|
||||
|
||||
}
|
||||
+9
-9
@@ -22,17 +22,17 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerChest;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.ChestContainer;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
|
||||
public class GuiChest extends AEBaseGui<ContainerChest> {
|
||||
public class ChestScreen extends AEBaseScreen<ChestContainer> {
|
||||
|
||||
public GuiChest(ContainerChest container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public ChestScreen(ChestContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
@@ -41,12 +41,12 @@ public class GuiChest extends AEBaseGui<ContainerChest> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.addButton(new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.itemRenderer, btn -> openPriority()));
|
||||
}
|
||||
|
||||
private void openPriority() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerPriority.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(PriorityContainer.TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
+11
-11
@@ -24,19 +24,19 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.api.config.CondenserOutput;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiProgressBar;
|
||||
import appeng.client.gui.widgets.GuiProgressBar.Direction;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.container.implementations.ContainerCondenser;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.ProgressBar;
|
||||
import appeng.client.gui.widgets.ProgressBar.Direction;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.container.implementations.CondenserContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiCondenser extends AEBaseGui<ContainerCondenser> {
|
||||
public class CondenserScreen extends AEBaseScreen<CondenserContainer> {
|
||||
|
||||
private GuiSettingToggleButton<CondenserOutput> mode;
|
||||
private SettingToggleButton<CondenserOutput> mode;
|
||||
|
||||
public GuiCondenser(ContainerCondenser container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CondenserScreen(CondenserContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 197;
|
||||
}
|
||||
@@ -45,10 +45,10 @@ public class GuiCondenser extends AEBaseGui<ContainerCondenser> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.mode = new GuiServerSettingToggleButton<>(128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT,
|
||||
this.mode = new ServerSettingToggleButton<>(128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT,
|
||||
this.container.getOutput());
|
||||
|
||||
this.addButton(new GuiProgressBar(this.container, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop,
|
||||
this.addButton(new ProgressBar(this.container, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop,
|
||||
178, 25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.getLocal()));
|
||||
this.addButton(this.mode);
|
||||
}
|
||||
+11
-11
@@ -24,24 +24,24 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiNumberBox;
|
||||
import appeng.container.implementations.ContainerCraftAmount;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.NumberBox;
|
||||
import appeng.container.implementations.CraftAmountContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketCraftRequest;
|
||||
import appeng.core.sync.packets.CraftRequestPacket;
|
||||
|
||||
public class GuiCraftAmount extends AEBaseGui<ContainerCraftAmount> {
|
||||
private final AESubGui subGui;
|
||||
public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
|
||||
private final AESubScreen subGui;
|
||||
|
||||
private GuiNumberBox amountToCraft;
|
||||
private NumberBox amountToCraft;
|
||||
|
||||
private Button next;
|
||||
|
||||
public GuiCraftAmount(ContainerCraftAmount container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftAmountScreen(CraftAmountContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.subGui = new AESubGui(this, container.getTarget());
|
||||
this.subGui = new AESubScreen(this, container.getTarget());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,7 +68,7 @@ public class GuiCraftAmount extends AEBaseGui<ContainerCraftAmount> {
|
||||
|
||||
subGui.addBackButton(this::addButton, 154, 0);
|
||||
|
||||
this.amountToCraft = new GuiNumberBox(this.font, this.guiLeft + 62, this.guiTop + 57, 59, this.font.FONT_HEIGHT,
|
||||
this.amountToCraft = new NumberBox(this.font, this.guiLeft + 62, this.guiTop + 57, 59, this.font.FONT_HEIGHT,
|
||||
Integer.class);
|
||||
this.amountToCraft.setEnableBackgroundDrawing(false);
|
||||
this.amountToCraft.setMaxStringLength(16);
|
||||
@@ -80,7 +80,7 @@ public class GuiCraftAmount extends AEBaseGui<ContainerCraftAmount> {
|
||||
|
||||
private void confirm(Button button) {
|
||||
NetworkHandler.instance()
|
||||
.sendToServer(new PacketCraftRequest(Integer.parseInt(this.amountToCraft.getText()), hasShiftDown()));
|
||||
.sendToServer(new CraftRequestPacket(Integer.parseInt(this.amountToCraft.getText()), hasShiftDown()));
|
||||
}
|
||||
|
||||
@Override
|
||||
+11
-11
@@ -37,17 +37,17 @@ import appeng.api.AEApi;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.container.implementations.ContainerCraftConfirm;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.Scrollbar;
|
||||
import appeng.container.implementations.CraftConfirmContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiCraftConfirm extends AEBaseGui<ContainerCraftConfirm> {
|
||||
public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
||||
|
||||
private final AESubGui subGui;
|
||||
private final AESubScreen subGui;
|
||||
|
||||
private final int rows = 5;
|
||||
|
||||
@@ -64,13 +64,13 @@ public class GuiCraftConfirm extends AEBaseGui<ContainerCraftConfirm> {
|
||||
private Button selectCPU;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiCraftConfirm(ContainerCraftConfirm container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftConfirmScreen(CraftConfirmContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.subGui = new AESubGui(this, container.getTarget());
|
||||
this.subGui = new AESubScreen(this, container.getTarget());
|
||||
this.xSize = 238;
|
||||
this.ySize = 206;
|
||||
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
final Scrollbar scrollbar = new Scrollbar();
|
||||
this.setScrollBar(scrollbar);
|
||||
}
|
||||
|
||||
@@ -450,11 +450,11 @@ public class GuiCraftConfirm extends AEBaseGui<ContainerCraftConfirm> {
|
||||
|
||||
private void selectNextCpu() {
|
||||
final boolean backwards = minecraft.mouseHelper.isRightDown();
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
}
|
||||
|
||||
private void start() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("Terminal.Start", "Start"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("Terminal.Start", "Start"));
|
||||
}
|
||||
|
||||
}
|
||||
+8
-8
@@ -42,18 +42,18 @@ import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.Scrollbar;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.container.implementations.ContainerCraftingCPU;
|
||||
import appeng.container.implementations.CraftingCPUContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.ReadableNumberConverter;
|
||||
|
||||
public class GuiCraftingCPU<T extends ContainerCraftingCPU> extends AEBaseGui<T> implements ISortSource {
|
||||
public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScreen<T> implements ISortSource {
|
||||
private static final int GUI_HEIGHT = 184;
|
||||
private static final int GUI_WIDTH = 238;
|
||||
|
||||
@@ -90,12 +90,12 @@ public class GuiCraftingCPU<T extends ContainerCraftingCPU> extends AEBaseGui<T>
|
||||
private Button cancel;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiCraftingCPU(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftingCPUScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = GUI_HEIGHT;
|
||||
this.xSize = GUI_WIDTH;
|
||||
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
final Scrollbar scrollbar = new Scrollbar();
|
||||
this.setScrollBar(scrollbar);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class GuiCraftingCPU<T extends ContainerCraftingCPU> extends AEBaseGui<T>
|
||||
}
|
||||
|
||||
private void cancel() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("TileCrafting.Cancel", "Cancel"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("TileCrafting.Cancel", "Cancel"));
|
||||
}
|
||||
|
||||
@Override
|
||||
+7
-7
@@ -26,20 +26,20 @@ import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.container.implementations.ContainerCraftingStatus;
|
||||
import appeng.container.implementations.CraftingStatusContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiCraftingStatus extends GuiCraftingCPU<ContainerCraftingStatus> {
|
||||
public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContainer> {
|
||||
|
||||
private final AESubGui subGui;
|
||||
private final AESubScreen subGui;
|
||||
|
||||
private Button selectCPU;
|
||||
|
||||
public GuiCraftingStatus(ContainerCraftingStatus container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftingStatusScreen(CraftingStatusContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.subGui = new AESubGui(this, container.getTarget());
|
||||
this.subGui = new AESubScreen(this, container.getTarget());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,7 +90,7 @@ public class GuiCraftingStatus extends GuiCraftingCPU<ContainerCraftingStatus> {
|
||||
// FIXME: Extract to separate class? Shared with GuiCraftConfirm
|
||||
private void selectNextCpu() {
|
||||
final boolean backwards = minecraft.mouseHelper.isRightDown();
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("Terminal.Cpu", backwards ? "Prev" : "Next"));
|
||||
}
|
||||
|
||||
}
|
||||
+9
-9
@@ -23,17 +23,17 @@ import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.client.gui.widgets.GuiActionButton;
|
||||
import appeng.container.implementations.ContainerCraftingTerm;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.client.gui.widgets.ActionButton;
|
||||
import appeng.container.implementations.CraftingTermContainer;
|
||||
import appeng.container.slot.CraftingMatrixSlot;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.core.sync.packets.InventoryActionPacket;
|
||||
import appeng.helpers.InventoryAction;
|
||||
|
||||
public class GuiCraftingTerm extends GuiMEMonitorable<ContainerCraftingTerm> {
|
||||
public class CraftingTermScreen extends MEMonitorableScreen<CraftingTermContainer> {
|
||||
|
||||
public GuiCraftingTerm(ContainerCraftingTerm container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public CraftingTermScreen(CraftingTermContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.setReservedSpace(73);
|
||||
}
|
||||
@@ -41,13 +41,13 @@ public class GuiCraftingTerm extends GuiMEMonitorable<ContainerCraftingTerm> {
|
||||
private void clear() {
|
||||
Slot s = null;
|
||||
for (final Object j : this.container.inventorySlots) {
|
||||
if (j instanceof SlotCraftingMatrix) {
|
||||
if (j instanceof CraftingMatrixSlot) {
|
||||
s = (Slot) j;
|
||||
}
|
||||
}
|
||||
|
||||
if (s != null) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.MOVE_REGION, s.slotNumber, 0);
|
||||
final InventoryActionPacket p = new InventoryActionPacket(InventoryAction.MOVE_REGION, s.slotNumber, 0);
|
||||
NetworkHandler.instance().sendToServer(p);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable<ContainerCraftingTerm> {
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
GuiActionButton clearBtn = this.addButton(new GuiActionButton(this.guiLeft + 92, this.guiTop + this.ySize - 156,
|
||||
ActionButton clearBtn = this.addButton(new ActionButton(this.guiLeft + 92, this.guiTop + this.ySize - 156,
|
||||
ActionItems.STASH, btn -> clear()));
|
||||
clearBtn.setHalfSize(true);
|
||||
}
|
||||
+9
-9
@@ -22,17 +22,17 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerDrive;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.DriveContainer;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
|
||||
public class GuiDrive extends AEBaseGui<ContainerDrive> {
|
||||
public class DriveScreen extends AEBaseScreen<DriveContainer> {
|
||||
|
||||
public GuiDrive(ContainerDrive container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public DriveScreen(DriveContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 199;
|
||||
}
|
||||
@@ -41,12 +41,12 @@ public class GuiDrive extends AEBaseGui<ContainerDrive> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.addButton(new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
}
|
||||
|
||||
private void openPriorityGui() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerPriority.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(PriorityContainer.TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
+14
-14
@@ -24,32 +24,32 @@ import net.minecraft.util.text.ITextComponent;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerFormationPlane;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.FormationPlaneContainer;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
|
||||
public class GuiFormationPlane extends GuiUpgradeable<ContainerFormationPlane> {
|
||||
public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContainer> {
|
||||
|
||||
private GuiSettingToggleButton<YesNo> placeMode;
|
||||
private SettingToggleButton<YesNo> placeMode;
|
||||
|
||||
public GuiFormationPlane(ContainerFormationPlane container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public FormationPlaneScreen(FormationPlaneContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.placeMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28, Settings.PLACE_BLOCK,
|
||||
this.placeMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28, Settings.PLACE_BLOCK,
|
||||
YesNo.YES);
|
||||
this.fuzzyMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
|
||||
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
|
||||
FuzzyMode.IGNORE_ALL);
|
||||
|
||||
this.addButton(new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
|
||||
this.addButton(this.placeMode);
|
||||
@@ -66,7 +66,7 @@ public class GuiFormationPlane extends GuiUpgradeable<ContainerFormationPlane> {
|
||||
}
|
||||
|
||||
if (this.placeMode != null) {
|
||||
this.placeMode.set(((ContainerFormationPlane) this.cvb).getPlaceMode());
|
||||
this.placeMode.set(((FormationPlaneContainer) this.cvb).getPlaceMode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class GuiFormationPlane extends GuiUpgradeable<ContainerFormationPlane> {
|
||||
}
|
||||
|
||||
private void openPriorityGui() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerPriority.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(PriorityContainer.TYPE));
|
||||
}
|
||||
|
||||
}
|
||||
+4
-4
@@ -22,13 +22,13 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerGrinder;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.container.implementations.GrinderContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiGrinder extends AEBaseGui<ContainerGrinder> {
|
||||
public class GrinderScreen extends AEBaseScreen<GrinderContainer> {
|
||||
|
||||
public GuiGrinder(ContainerGrinder container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public GrinderScreen(GrinderContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 176;
|
||||
}
|
||||
+12
-12
@@ -27,31 +27,31 @@ import appeng.api.config.OperationMode;
|
||||
import appeng.api.config.RedstoneMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.container.implementations.ContainerIOPort;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.container.implementations.IOPortContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiIOPort extends GuiUpgradeable<ContainerIOPort> {
|
||||
public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
|
||||
|
||||
private GuiSettingToggleButton<FullnessMode> fullMode;
|
||||
private GuiSettingToggleButton<OperationMode> operationMode;
|
||||
private SettingToggleButton<FullnessMode> fullMode;
|
||||
private SettingToggleButton<OperationMode> operationMode;
|
||||
|
||||
public GuiIOPort(ContainerIOPort container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public IOPortScreen(IOPortContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.fullMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.FULLNESS_MODE,
|
||||
this.fullMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.FULLNESS_MODE,
|
||||
FullnessMode.EMPTY);
|
||||
this.operationMode = new GuiServerSettingToggleButton<>(this.guiLeft + 80, this.guiTop + 17,
|
||||
this.operationMode = new ServerSettingToggleButton<>(this.guiLeft + 80, this.guiTop + 17,
|
||||
Settings.OPERATION_MODE, OperationMode.EMPTY);
|
||||
|
||||
this.addButton(this.operationMode);
|
||||
this.addButton(this.fullMode);
|
||||
this.redstoneMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28,
|
||||
this.redstoneMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28,
|
||||
Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE);
|
||||
addButton(this.redstoneMode);
|
||||
}
|
||||
@@ -66,11 +66,11 @@ public class GuiIOPort extends GuiUpgradeable<ContainerIOPort> {
|
||||
}
|
||||
|
||||
if (this.operationMode != null) {
|
||||
this.operationMode.set(((ContainerIOPort) this.cvb).getOperationMode());
|
||||
this.operationMode.set(((IOPortContainer) this.cvb).getOperationMode());
|
||||
}
|
||||
|
||||
if (this.fullMode != null) {
|
||||
this.fullMode.set(((ContainerIOPort) this.cvb).getFullMode());
|
||||
this.fullMode.set(((IOPortContainer) this.cvb).getFullMode());
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -22,17 +22,17 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiProgressBar;
|
||||
import appeng.client.gui.widgets.GuiProgressBar.Direction;
|
||||
import appeng.container.implementations.ContainerInscriber;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.ProgressBar;
|
||||
import appeng.client.gui.widgets.ProgressBar.Direction;
|
||||
import appeng.container.implementations.InscriberContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiInscriber extends AEBaseGui<ContainerInscriber> {
|
||||
public class InscriberScreen extends AEBaseScreen<InscriberContainer> {
|
||||
|
||||
private GuiProgressBar pb;
|
||||
private ProgressBar pb;
|
||||
|
||||
public GuiInscriber(ContainerInscriber container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public InscriberScreen(InscriberContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 176;
|
||||
this.xSize = this.hasToolbox() ? 246 : 211;
|
||||
@@ -46,7 +46,7 @@ public class GuiInscriber extends AEBaseGui<ContainerInscriber> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar(this.container, "guis/inscriber.png", 135, 39, 135, 177, 6, 18,
|
||||
this.pb = new ProgressBar(this.container, "guis/inscriber.png", 135, 39, 135, 177, 6, 18,
|
||||
Direction.VERTICAL);
|
||||
this.addButton(this.pb);
|
||||
}
|
||||
+19
-19
@@ -23,37 +23,37 @@ import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.gui.widgets.GuiToggleButton;
|
||||
import appeng.container.implementations.ContainerInterface;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.client.gui.widgets.ToggleButton;
|
||||
import appeng.container.implementations.InterfaceContainer;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketConfigButton;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.ConfigButtonPacket;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
|
||||
public class GuiInterface extends GuiUpgradeable<ContainerInterface> {
|
||||
public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
|
||||
|
||||
private GuiSettingToggleButton<YesNo> blockMode;
|
||||
private GuiToggleButton interfaceMode;
|
||||
private SettingToggleButton<YesNo> blockMode;
|
||||
private ToggleButton interfaceMode;
|
||||
|
||||
public GuiInterface(ContainerInterface container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public InterfaceScreen(InterfaceContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 211;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.addButton(new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
|
||||
this.blockMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK,
|
||||
this.blockMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK,
|
||||
YesNo.NO);
|
||||
this.addButton(this.blockMode);
|
||||
|
||||
this.interfaceMode = new GuiToggleButton(this.guiLeft - 18, this.guiTop + 26, 84, 85,
|
||||
this.interfaceMode = new ToggleButton(this.guiLeft - 18, this.guiTop + 26, 84, 85,
|
||||
GuiText.InterfaceTerminal.getLocal(), GuiText.InterfaceTerminalHint.getLocal(),
|
||||
btn -> selectNextInterfaceMode());
|
||||
this.addButton(this.interfaceMode);
|
||||
@@ -62,11 +62,11 @@ public class GuiInterface extends GuiUpgradeable<ContainerInterface> {
|
||||
@Override
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
if (this.blockMode != null) {
|
||||
this.blockMode.set(((ContainerInterface) this.cvb).getBlockingMode());
|
||||
this.blockMode.set(((InterfaceContainer) this.cvb).getBlockingMode());
|
||||
}
|
||||
|
||||
if (this.interfaceMode != null) {
|
||||
this.interfaceMode.setState(((ContainerInterface) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
|
||||
this.interfaceMode.setState(((InterfaceContainer) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
|
||||
}
|
||||
|
||||
this.font.drawString(this.getGuiDisplayName(GuiText.Interface.getLocal()), 8, 6, 4210752);
|
||||
@@ -84,12 +84,12 @@ public class GuiInterface extends GuiUpgradeable<ContainerInterface> {
|
||||
}
|
||||
|
||||
private void openPriorityGui() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerPriority.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(PriorityContainer.TYPE));
|
||||
}
|
||||
|
||||
private void selectNextInterfaceMode() {
|
||||
final boolean backwards = getMinecraft().mouseHelper.isRightDown();
|
||||
NetworkHandler.instance().sendToServer(new PacketConfigButton(Settings.INTERFACE_TERMINAL, backwards));
|
||||
NetworkHandler.instance().sendToServer(new ConfigButtonPacket(Settings.INTERFACE_TERMINAL, backwards));
|
||||
}
|
||||
|
||||
}
|
||||
+10
-10
@@ -43,17 +43,17 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.client.ActionKey;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.MEGuiTextField;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.Scrollbar;
|
||||
import appeng.client.gui.widgets.AETextField;
|
||||
import appeng.client.me.ClientDCInternalInv;
|
||||
import appeng.client.me.SlotDisconnected;
|
||||
import appeng.container.implementations.ContainerInterfaceTerminal;
|
||||
import appeng.container.implementations.InterfaceTerminalContainer;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal> {
|
||||
public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalContainer> {
|
||||
|
||||
private static final int LINES_ON_PAGE = 6;
|
||||
|
||||
@@ -65,12 +65,12 @@ public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal>
|
||||
private final Map<String, Set<Object>> cachedSearches = new WeakHashMap<>();
|
||||
|
||||
private boolean refreshList = false;
|
||||
private MEGuiTextField searchField;
|
||||
private AETextField searchField;
|
||||
|
||||
public GuiInterfaceTerminal(ContainerInterfaceTerminal container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
public InterfaceTerminalScreen(InterfaceTerminalContainer container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
final Scrollbar scrollbar = new Scrollbar();
|
||||
this.setScrollBar(scrollbar);
|
||||
this.xSize = 195;
|
||||
this.ySize = 222;
|
||||
@@ -84,7 +84,7 @@ public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal>
|
||||
this.getScrollBar().setHeight(106);
|
||||
this.getScrollBar().setTop(18);
|
||||
|
||||
this.searchField = new MEGuiTextField(this.font, this.guiLeft + 104, this.guiTop + 4, 65, 12);
|
||||
this.searchField = new AETextField(this.font, this.guiLeft + 104, this.guiTop + 4, 65, 12);
|
||||
this.searchField.setEnableBackgroundDrawing(false);
|
||||
this.searchField.setMaxStringLength(25);
|
||||
this.searchField.setTextColor(0xFFFFFF);
|
||||
+18
-18
@@ -29,18 +29,18 @@ import appeng.api.config.RedstoneMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.client.gui.widgets.GuiNumberBox;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.container.implementations.ContainerLevelEmitter;
|
||||
import appeng.client.gui.widgets.NumberBox;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.container.implementations.LevelEmitterContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer> {
|
||||
|
||||
private GuiNumberBox level;
|
||||
private NumberBox level;
|
||||
|
||||
private Button plus1;
|
||||
private Button plus10;
|
||||
@@ -51,10 +51,10 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
private Button minus100;
|
||||
private Button minus1000;
|
||||
|
||||
private GuiSettingToggleButton<LevelType> levelMode;
|
||||
private GuiSettingToggleButton<YesNo> craftingMode;
|
||||
private SettingToggleButton<LevelType> levelMode;
|
||||
private SettingToggleButton<YesNo> craftingMode;
|
||||
|
||||
public GuiLevelEmitter(ContainerLevelEmitter container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public LevelEmitterScreen(LevelEmitterContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.level = new GuiNumberBox(this.font, this.guiLeft + 24, this.guiTop + 43, 79, this.font.FONT_HEIGHT,
|
||||
this.level = new NumberBox(this.font, this.guiLeft + 24, this.guiTop + 43, 79, this.font.FONT_HEIGHT,
|
||||
Long.class);
|
||||
this.level.setEnableBackgroundDrawing(false);
|
||||
this.level.setMaxStringLength(16);
|
||||
@@ -74,13 +74,13 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.levelMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.LEVEL_TYPE,
|
||||
this.levelMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.LEVEL_TYPE,
|
||||
LevelType.ITEM_LEVEL);
|
||||
this.redstoneMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28,
|
||||
this.redstoneMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28,
|
||||
Settings.REDSTONE_EMITTER, RedstoneMode.LOW_SIGNAL);
|
||||
this.fuzzyMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
|
||||
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
|
||||
FuzzyMode.IGNORE_ALL);
|
||||
this.craftingMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48,
|
||||
this.craftingMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48,
|
||||
Settings.CRAFT_VIA_REDSTONE, YesNo.NO);
|
||||
|
||||
final int a = AEConfig.instance().levelByStackAmounts(0);
|
||||
@@ -134,7 +134,7 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
}
|
||||
|
||||
if (this.levelMode != null) {
|
||||
this.levelMode.set(((ContainerLevelEmitter) this.cvb).getLevelMode());
|
||||
this.levelMode.set(((LevelEmitterContainer) this.cvb).getLevelMode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
|
||||
this.level.setText(Out = Long.toString(result));
|
||||
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("LevelEmitter.Value", Out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("LevelEmitter.Value", Out));
|
||||
} catch (final NumberFormatException e) {
|
||||
// nope..
|
||||
this.level.setText("0");
|
||||
@@ -219,7 +219,7 @@ public class GuiLevelEmitter extends GuiUpgradeable<ContainerLevelEmitter> {
|
||||
Out = "0";
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("LevelEmitter.Value", Out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("LevelEmitter.Value", Out));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+36
-36
@@ -36,29 +36,29 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigurableObject;
|
||||
import appeng.client.ActionKey;
|
||||
import appeng.client.gui.AEBaseMEGui;
|
||||
import appeng.client.gui.AEBaseMEScreen;
|
||||
import appeng.client.gui.widgets.*;
|
||||
import appeng.client.me.InternalSlotME;
|
||||
import appeng.client.me.ItemRepo;
|
||||
import appeng.container.implementations.ContainerCraftingStatus;
|
||||
import appeng.container.implementations.ContainerMEMonitorable;
|
||||
import appeng.container.implementations.CraftingStatusContainer;
|
||||
import appeng.container.implementations.MEMonitorableContainer;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
import appeng.container.slot.CraftingMatrixSlot;
|
||||
import appeng.container.slot.FakeCraftingMatrixSlot;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.integration.abstraction.JEIFacade;
|
||||
import appeng.parts.reporting.AbstractPartTerminal;
|
||||
import appeng.tile.misc.TileSecurityStation;
|
||||
import appeng.parts.reporting.AbstractTerminalPart;
|
||||
import appeng.tile.misc.SecurityStationTileEntity;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseMEGui<T>
|
||||
public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBaseMEScreen<T>
|
||||
implements ISortSource, IConfigManagerHost {
|
||||
|
||||
private static int craftingGridOffsetX;
|
||||
@@ -71,8 +71,8 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
private final IConfigManager configSrc;
|
||||
private final boolean viewCell;
|
||||
private final ItemStack[] myCurrentViewCells = new ItemStack[5];
|
||||
private GuiTabButton craftingStatusBtn;
|
||||
private MEGuiTextField searchField;
|
||||
private TabButton craftingStatusBtn;
|
||||
private AETextField searchField;
|
||||
private GuiText myName;
|
||||
private int perRow = 9;
|
||||
private int reservedSpace = 0;
|
||||
@@ -80,17 +80,17 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
private int rows = 0;
|
||||
private int maxRows = Integer.MAX_VALUE;
|
||||
private int standardSize;
|
||||
private GuiSettingToggleButton<ViewItems> viewModeToggle;
|
||||
private GuiSettingToggleButton<SortOrder> sortByToggle;
|
||||
private GuiSettingToggleButton<SortDir> sortDirToggle;
|
||||
private SettingToggleButton<ViewItems> viewModeToggle;
|
||||
private SettingToggleButton<SortOrder> sortByToggle;
|
||||
private SettingToggleButton<SortDir> sortDirToggle;
|
||||
private boolean isAutoFocus = false;
|
||||
private int currentMouseX = 0;
|
||||
private int currentMouseY = 0;
|
||||
|
||||
public GuiMEMonitorable(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public MEMonitorableScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
final Scrollbar scrollbar = new Scrollbar();
|
||||
this.setScrollBar(scrollbar);
|
||||
this.repo = new ItemRepo(scrollbar, this);
|
||||
setScrollBar();
|
||||
@@ -110,7 +110,7 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
|
||||
this.viewCell = te instanceof IViewCellStorage;
|
||||
|
||||
if (te instanceof TileSecurityStation) {
|
||||
if (te instanceof SecurityStationTileEntity) {
|
||||
this.myName = GuiText.Security;
|
||||
} else if (te instanceof WirelessTerminalGuiObject) {
|
||||
this.myName = GuiText.WirelessTerminal;
|
||||
@@ -118,7 +118,7 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
this.myName = GuiText.PortableCell;
|
||||
} else if (te instanceof IMEChest) {
|
||||
this.myName = GuiText.Chest;
|
||||
} else if (te instanceof AbstractPartTerminal) {
|
||||
} else if (te instanceof AbstractTerminalPart) {
|
||||
this.myName = GuiText.Terminal;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Invalid GUI target given: " + te);
|
||||
@@ -141,7 +141,7 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
}
|
||||
|
||||
private void showCraftingStatus() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerCraftingStatus.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(CraftingStatusContainer.TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -189,33 +189,33 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
int offset = this.guiTop + 8;
|
||||
|
||||
if (this.customSortOrder) {
|
||||
this.sortByToggle = this.addButton(new GuiSettingToggleButton<>(this.guiLeft - 18, offset, Settings.SORT_BY,
|
||||
this.sortByToggle = this.addButton(new SettingToggleButton<>(this.guiLeft - 18, offset, Settings.SORT_BY,
|
||||
getSortBy(), Platform::isSortOrderAvailable, this::toggleServerSetting));
|
||||
offset += 20;
|
||||
}
|
||||
|
||||
if (this.viewCell || this instanceof GuiWirelessTerm) {
|
||||
this.viewModeToggle = this.addButton(new GuiSettingToggleButton<>(this.guiLeft - 18, offset,
|
||||
if (this.viewCell || this instanceof WirelessTermScreen) {
|
||||
this.viewModeToggle = this.addButton(new SettingToggleButton<>(this.guiLeft - 18, offset,
|
||||
Settings.VIEW_MODE, getSortDisplay(), this::toggleServerSetting));
|
||||
offset += 20;
|
||||
}
|
||||
|
||||
this.addButton(this.sortDirToggle = new GuiSettingToggleButton<>(this.guiLeft - 18, offset,
|
||||
this.addButton(this.sortDirToggle = new SettingToggleButton<>(this.guiLeft - 18, offset,
|
||||
Settings.SORT_DIRECTION, getSortDir(), this::toggleServerSetting));
|
||||
offset += 20;
|
||||
|
||||
SearchBoxMode searchMode = AEConfig.instance().getTerminalSearchMode();
|
||||
this.addButton(new GuiSettingToggleButton<>(this.guiLeft - 18, offset, Settings.SEARCH_MODE, searchMode,
|
||||
this.addButton(new SettingToggleButton<>(this.guiLeft - 18, offset, Settings.SEARCH_MODE, searchMode,
|
||||
Platform::isSearchModeAvailable, this::toggleTerminalSearchMode));
|
||||
|
||||
offset += 20;
|
||||
|
||||
if (!(this instanceof GuiMEPortableCell) || this instanceof GuiWirelessTerm) {
|
||||
this.addButton(new GuiSettingToggleButton<>(this.guiLeft - 18, offset, Settings.TERMINAL_STYLE,
|
||||
if (!(this instanceof MEPortableCellScreen) || this instanceof WirelessTermScreen) {
|
||||
this.addButton(new SettingToggleButton<>(this.guiLeft - 18, offset, Settings.TERMINAL_STYLE,
|
||||
terminalStyle, this::toggleTerminalStyle));
|
||||
}
|
||||
|
||||
this.searchField = new MEGuiTextField(this.font, this.guiLeft + Math.max(80, this.offsetX), this.guiTop + 4, 90,
|
||||
this.searchField = new AETextField(this.font, this.guiLeft + Math.max(80, this.offsetX), this.guiTop + 4, 90,
|
||||
12);
|
||||
this.searchField.setEnableBackgroundDrawing(false);
|
||||
this.searchField.setMaxStringLength(25);
|
||||
@@ -223,8 +223,8 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
this.searchField.setSelectionColor(0xFF008000);
|
||||
this.searchField.setVisible(true);
|
||||
|
||||
if (this.viewCell || this instanceof GuiWirelessTerm) {
|
||||
this.craftingStatusBtn = this.addButton(new GuiTabButton(this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16,
|
||||
if (this.viewCell || this instanceof WirelessTermScreen) {
|
||||
this.craftingStatusBtn = this.addButton(new TabButton(this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16,
|
||||
GuiText.CraftingStatus.getLocal(), this.itemRenderer, btn -> showCraftingStatus()));
|
||||
this.craftingStatusBtn.setHideEdge(13);
|
||||
}
|
||||
@@ -261,7 +261,7 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
}
|
||||
}
|
||||
|
||||
if (s instanceof SlotCraftingMatrix || s instanceof SlotFakeCraftingMatrix) {
|
||||
if (s instanceof CraftingMatrixSlot || s instanceof FakeCraftingMatrixSlot) {
|
||||
if (s.xPos > 0 && s.yPos > 0) {
|
||||
craftingGridOffsetX = Math.min(craftingGridOffsetX, s.xPos);
|
||||
craftingGridOffsetY = Math.min(craftingGridOffsetY, s.yPos);
|
||||
@@ -312,7 +312,7 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
final int x_width = 197;
|
||||
blit(offsetX, offsetY, 0, 0, x_width, 18);
|
||||
|
||||
if (this.viewCell || (this instanceof GuiSecurityStation)) {
|
||||
if (this.viewCell || (this instanceof SecurityStationScreen)) {
|
||||
blit(offsetX + x_width, offsetY, x_width, 0, 46, 128);
|
||||
}
|
||||
|
||||
@@ -482,23 +482,23 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
this.standardSize = standardSize;
|
||||
}
|
||||
|
||||
private void toggleTerminalSearchMode(GuiSettingToggleButton<SearchBoxMode> btn, boolean backwards) {
|
||||
private void toggleTerminalSearchMode(SettingToggleButton<SearchBoxMode> btn, boolean backwards) {
|
||||
SearchBoxMode next = btn.getNextValue(backwards);
|
||||
AEConfig.instance().setTerminalSearchMode(next);
|
||||
btn.set(next);
|
||||
this.reinitalize();
|
||||
}
|
||||
|
||||
private void toggleTerminalStyle(GuiSettingToggleButton<TerminalStyle> btn, boolean backwards) {
|
||||
private void toggleTerminalStyle(SettingToggleButton<TerminalStyle> btn, boolean backwards) {
|
||||
TerminalStyle next = btn.getNextValue(backwards);
|
||||
AEConfig.instance().setTerminalStyle(next);
|
||||
btn.set(next);
|
||||
this.reinitalize();
|
||||
}
|
||||
|
||||
private <S extends Enum<S>> void toggleServerSetting(GuiSettingToggleButton<S> btn, boolean backwards) {
|
||||
private <S extends Enum<S>> void toggleServerSetting(SettingToggleButton<S> btn, boolean backwards) {
|
||||
S next = btn.getNextValue(backwards);
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig(btn.getSetting().name(), next.name()));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket(btn.getSetting().name(), next.name()));
|
||||
btn.set(next);
|
||||
}
|
||||
|
||||
+3
-3
@@ -21,11 +21,11 @@ package appeng.client.gui.implementations;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.container.implementations.ContainerMEPortableCell;
|
||||
import appeng.container.implementations.MEPortableCellContainer;
|
||||
|
||||
public class GuiMEPortableCell extends GuiMEMonitorable<ContainerMEPortableCell> {
|
||||
public class MEPortableCellScreen extends MEMonitorableScreen<MEPortableCellContainer> {
|
||||
|
||||
public GuiMEPortableCell(ContainerMEPortableCell container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public MEPortableCellScreen(MEPortableCellContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
+10
-10
@@ -23,18 +23,18 @@ import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.api.config.RedstoneMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.client.gui.widgets.GuiProgressBar;
|
||||
import appeng.client.gui.widgets.GuiProgressBar.Direction;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.container.implementations.ContainerMolecularAssembler;
|
||||
import appeng.client.gui.widgets.ProgressBar;
|
||||
import appeng.client.gui.widgets.ProgressBar.Direction;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.container.implementations.MolecularAssemblerContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiMolecularAssembler extends GuiUpgradeable<ContainerMolecularAssembler> {
|
||||
public class MolecularAssemblerScreen extends UpgradeableScreen<MolecularAssemblerContainer> {
|
||||
|
||||
private GuiProgressBar pb;
|
||||
private ProgressBar pb;
|
||||
|
||||
public GuiMolecularAssembler(ContainerMolecularAssembler container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
public MolecularAssemblerScreen(MolecularAssemblerContainer container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 197;
|
||||
}
|
||||
@@ -43,14 +43,14 @@ public class GuiMolecularAssembler extends GuiUpgradeable<ContainerMolecularAsse
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar(this.container, "guis/molecular_assembler.png", 139, 36, 148, 201, 6, 18,
|
||||
this.pb = new ProgressBar(this.container, "guis/molecular_assembler.png", 139, 36, 148, 201, 6, 18,
|
||||
Direction.VERTICAL);
|
||||
this.addButton(this.pb);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.redstoneMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8,
|
||||
this.redstoneMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8,
|
||||
Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE);
|
||||
addButton(this.redstoneMode);
|
||||
}
|
||||
+6
-6
@@ -32,25 +32,25 @@ import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.CommonButtons;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.Scrollbar;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.client.me.ItemRepo;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.container.implementations.ContainerNetworkStatus;
|
||||
import appeng.container.implementations.NetworkStatusContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiNetworkStatus extends AEBaseGui<ContainerNetworkStatus> implements ISortSource {
|
||||
public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> implements ISortSource {
|
||||
|
||||
private final ItemRepo repo;
|
||||
private final int rows = 4;
|
||||
private int tooltip = -1;
|
||||
|
||||
public GuiNetworkStatus(ContainerNetworkStatus container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public NetworkStatusScreen(NetworkStatusContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
final GuiScrollbar scrollbar = new GuiScrollbar();
|
||||
final Scrollbar scrollbar = new Scrollbar();
|
||||
|
||||
this.setScrollBar(scrollbar);
|
||||
this.repo = new ItemRepo(scrollbar, this);
|
||||
+9
-9
@@ -22,18 +22,18 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiToggleButton;
|
||||
import appeng.container.implementations.ContainerNetworkTool;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.ToggleButton;
|
||||
import appeng.container.implementations.NetworkToolContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiNetworkTool extends AEBaseGui<ContainerNetworkTool> {
|
||||
public class NetworkToolScreen extends AEBaseScreen<NetworkToolContainer> {
|
||||
|
||||
private GuiToggleButton tFacades;
|
||||
private ToggleButton tFacades;
|
||||
|
||||
public GuiNetworkTool(ContainerNetworkTool container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public NetworkToolScreen(NetworkToolContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class GuiNetworkTool extends AEBaseGui<ContainerNetworkTool> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.tFacades = new GuiToggleButton(this.guiLeft - 18, this.guiTop + 8, 23, 22,
|
||||
this.tFacades = new ToggleButton(this.guiLeft - 18, this.guiTop + 8, 23, 22,
|
||||
GuiText.TransparentFacades.getLocal(), GuiText.TransparentFacadesHint.getLocal(),
|
||||
btn -> toggleFacades());
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GuiNetworkTool extends AEBaseGui<ContainerNetworkTool> {
|
||||
}
|
||||
|
||||
private void toggleFacades() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("NetworkTool", "Toggle"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("NetworkTool", "Toggle"));
|
||||
}
|
||||
|
||||
@Override
|
||||
+20
-20
@@ -24,15 +24,15 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.client.gui.widgets.GuiActionButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerPatternTerm;
|
||||
import appeng.client.gui.widgets.ActionButton;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.PatternTermContainer;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiPatternTerm extends GuiMEMonitorable<ContainerPatternTerm> {
|
||||
public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer> {
|
||||
|
||||
private static final String BACKGROUND_CRAFTING_MODE = "guis/pattern.png";
|
||||
private static final String BACKGROUND_PROCESSING_MODE = "guis/pattern2.png";
|
||||
@@ -43,12 +43,12 @@ public class GuiPatternTerm extends GuiMEMonitorable<ContainerPatternTerm> {
|
||||
private static final String CRAFTMODE_CRFTING = "1";
|
||||
private static final String CRAFTMODE_PROCESSING = "0";
|
||||
|
||||
private GuiTabButton tabCraftButton;
|
||||
private GuiTabButton tabProcessButton;
|
||||
private GuiActionButton substitutionsEnabledBtn;
|
||||
private GuiActionButton substitutionsDisabledBtn;
|
||||
private TabButton tabCraftButton;
|
||||
private TabButton tabProcessButton;
|
||||
private ActionButton substitutionsEnabledBtn;
|
||||
private ActionButton substitutionsDisabledBtn;
|
||||
|
||||
public GuiPatternTerm(ContainerPatternTerm container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public PatternTermScreen(PatternTermContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.setReservedSpace(81);
|
||||
}
|
||||
@@ -57,50 +57,50 @@ public class GuiPatternTerm extends GuiMEMonitorable<ContainerPatternTerm> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.tabCraftButton = new GuiTabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
|
||||
this.tabCraftButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
|
||||
new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.getLocal(), this.itemRenderer,
|
||||
btn -> toggleCraftMode(CRAFTMODE_PROCESSING));
|
||||
this.addButton(this.tabCraftButton);
|
||||
|
||||
this.tabProcessButton = new GuiTabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
|
||||
this.tabProcessButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
|
||||
new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.getLocal(), this.itemRenderer,
|
||||
btn -> toggleCraftMode(CRAFTMODE_CRFTING));
|
||||
this.addButton(this.tabProcessButton);
|
||||
|
||||
this.substitutionsEnabledBtn = new GuiActionButton(this.guiLeft + 84, this.guiTop + this.ySize - 163,
|
||||
this.substitutionsEnabledBtn = new ActionButton(this.guiLeft + 84, this.guiTop + this.ySize - 163,
|
||||
ActionItems.ENABLE_SUBSTITUTION, act -> toggleSubstitutions(SUBSITUTION_DISABLE));
|
||||
this.substitutionsEnabledBtn.setHalfSize(true);
|
||||
this.addButton(this.substitutionsEnabledBtn);
|
||||
|
||||
this.substitutionsDisabledBtn = new GuiActionButton(this.guiLeft + 84, this.guiTop + this.ySize - 163,
|
||||
this.substitutionsDisabledBtn = new ActionButton(this.guiLeft + 84, this.guiTop + this.ySize - 163,
|
||||
ActionItems.DISABLE_SUBSTITUTION, act -> toggleSubstitutions(SUBSITUTION_ENABLE));
|
||||
this.substitutionsDisabledBtn.setHalfSize(true);
|
||||
this.addButton(this.substitutionsDisabledBtn);
|
||||
|
||||
GuiActionButton clearBtn = new GuiActionButton(this.guiLeft + 74, this.guiTop + this.ySize - 163,
|
||||
ActionButton clearBtn = new ActionButton(this.guiLeft + 74, this.guiTop + this.ySize - 163,
|
||||
ActionItems.CLOSE, act -> clear());
|
||||
clearBtn.setHalfSize(true);
|
||||
this.addButton(clearBtn);
|
||||
|
||||
GuiActionButton encodeBtn = new GuiActionButton(this.guiLeft + 147, this.guiTop + this.ySize - 142,
|
||||
ActionButton encodeBtn = new ActionButton(this.guiLeft + 147, this.guiTop + this.ySize - 142,
|
||||
ActionItems.ENCODE, act -> encode());
|
||||
this.addButton(encodeBtn);
|
||||
}
|
||||
|
||||
private void toggleCraftMode(String mode) {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PatternTerminal.CraftMode", mode));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PatternTerminal.CraftMode", mode));
|
||||
}
|
||||
|
||||
private void toggleSubstitutions(String mode) {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PatternTerminal.Substitute", mode));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PatternTerminal.Substitute", mode));
|
||||
}
|
||||
|
||||
private void encode() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PatternTerminal.Encode", "1"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PatternTerminal.Encode", "1"));
|
||||
}
|
||||
|
||||
private void clear() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PatternTerminal.Clear", "1"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PatternTerminal.Clear", "1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
+13
-13
@@ -23,23 +23,23 @@ import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiNumberBox;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.NumberBox;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiPriority extends AEBaseGui<ContainerPriority> {
|
||||
public class PriorityScreen extends AEBaseScreen<PriorityContainer> {
|
||||
|
||||
private final AESubGui subGui;
|
||||
private final AESubScreen subGui;
|
||||
|
||||
private GuiNumberBox priority;
|
||||
private NumberBox priority;
|
||||
|
||||
public GuiPriority(ContainerPriority container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public PriorityScreen(PriorityContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.subGui = new AESubGui(this, container.getPriorityHost());
|
||||
this.subGui = new AESubScreen(this, container.getPriorityHost());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +63,7 @@ public class GuiPriority extends AEBaseGui<ContainerPriority> {
|
||||
|
||||
this.subGui.addBackButton(this::addButton, 154, 0);
|
||||
|
||||
this.priority = new GuiNumberBox(this.font, this.guiLeft + 62, this.guiTop + 57, 59, this.font.FONT_HEIGHT,
|
||||
this.priority = new NumberBox(this.font, this.guiLeft + 62, this.guiTop + 57, 59, this.font.FONT_HEIGHT,
|
||||
Long.class);
|
||||
this.priority.setEnableBackgroundDrawing(false);
|
||||
this.priority.setMaxStringLength(16);
|
||||
@@ -109,7 +109,7 @@ public class GuiPriority extends AEBaseGui<ContainerPriority> {
|
||||
|
||||
this.priority.setText(out = Long.toString(result));
|
||||
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PriorityHost.Priority", out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PriorityHost.Priority", out));
|
||||
} catch (final NumberFormatException e) {
|
||||
// nope..
|
||||
this.priority.setText("0");
|
||||
@@ -135,7 +135,7 @@ public class GuiPriority extends AEBaseGui<ContainerPriority> {
|
||||
out = "0";
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PriorityHost.Priority", out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PriorityHost.Priority", out));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -162,7 +162,7 @@ public class GuiPriority extends AEBaseGui<ContainerPriority> {
|
||||
out = "0";
|
||||
}
|
||||
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("PriorityHost.Priority", out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("PriorityHost.Priority", out));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -22,13 +22,13 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerQNB;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.container.implementations.QNBContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiQNB extends AEBaseGui<ContainerQNB> {
|
||||
public class QNBScreen extends AEBaseScreen<QNBContainer> {
|
||||
|
||||
public GuiQNB(ContainerQNB container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public QNBScreen(QNBContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
+7
-7
@@ -27,18 +27,18 @@ import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.ActionKey;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerQuartzKnife;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.container.implementations.QuartzKnifeContainer;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiQuartzKnife extends AEBaseGui<ContainerQuartzKnife> {
|
||||
public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
|
||||
|
||||
private TextFieldWidget name;
|
||||
|
||||
public GuiQuartzKnife(ContainerQuartzKnife container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public QuartzKnifeScreen(QuartzKnifeContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 184;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class GuiQuartzKnife extends AEBaseGui<ContainerQuartzKnife> {
|
||||
if (this.name.isFocused() && this.name.charTyped(character, key)) {
|
||||
final String Out = this.name.getText();
|
||||
container.setName(Out);
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("QuartzKnife.Name", Out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("QuartzKnife.Name", Out));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class GuiQuartzKnife extends AEBaseGui<ContainerQuartzKnife> {
|
||||
if (this.name.keyPressed(keyCode, scanCode, p_keyPressed_3_)) {
|
||||
final String Out = this.name.getText();
|
||||
container.setName(Out);
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("QuartzKnife.Name", Out));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("QuartzKnife.Name", Out));
|
||||
return true;
|
||||
}
|
||||
|
||||
+17
-17
@@ -23,22 +23,22 @@ import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.client.gui.widgets.GuiToggleButton;
|
||||
import appeng.container.implementations.ContainerSecurityStation;
|
||||
import appeng.client.gui.widgets.ToggleButton;
|
||||
import appeng.container.implementations.SecurityStationContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiSecurityStation extends GuiMEMonitorable<ContainerSecurityStation> {
|
||||
public class SecurityStationScreen extends MEMonitorableScreen<SecurityStationContainer> {
|
||||
|
||||
private GuiToggleButton inject;
|
||||
private GuiToggleButton extract;
|
||||
private GuiToggleButton craft;
|
||||
private GuiToggleButton build;
|
||||
private GuiToggleButton security;
|
||||
private ToggleButton inject;
|
||||
private ToggleButton extract;
|
||||
private ToggleButton craft;
|
||||
private ToggleButton build;
|
||||
private ToggleButton security;
|
||||
|
||||
public GuiSecurityStation(ContainerSecurityStation container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
public SecurityStationScreen(SecurityStationContainer container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.setCustomSortOrder(false);
|
||||
this.setReservedSpace(33);
|
||||
@@ -50,7 +50,7 @@ public class GuiSecurityStation extends GuiMEMonitorable<ContainerSecurityStatio
|
||||
|
||||
private void toggleOption(SecurityPermissions permission) {
|
||||
NetworkHandler.instance()
|
||||
.sendToServer(new PacketValueConfig("TileSecurityStation.ToggleOption", permission.name()));
|
||||
.sendToServer(new ConfigValuePacket("TileSecurityStation.ToggleOption", permission.name()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,23 +58,23 @@ public class GuiSecurityStation extends GuiMEMonitorable<ContainerSecurityStatio
|
||||
super.init();
|
||||
|
||||
final int top = this.guiTop + this.ySize - 116;
|
||||
this.inject = this.addButton(new GuiToggleButton(this.guiLeft + 56, top, 11 * 16, 12 * 16,
|
||||
this.inject = this.addButton(new ToggleButton(this.guiLeft + 56, top, 11 * 16, 12 * 16,
|
||||
SecurityPermissions.INJECT.getTranslatedName(), SecurityPermissions.INJECT.getTranslatedTip(),
|
||||
btn -> toggleOption(SecurityPermissions.INJECT)));
|
||||
|
||||
this.extract = this.addButton(new GuiToggleButton(this.guiLeft + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1,
|
||||
this.extract = this.addButton(new ToggleButton(this.guiLeft + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1,
|
||||
SecurityPermissions.EXTRACT.getTranslatedName(), SecurityPermissions.EXTRACT.getTranslatedTip(),
|
||||
btn -> toggleOption(SecurityPermissions.EXTRACT)));
|
||||
|
||||
this.craft = this.addButton(new GuiToggleButton(this.guiLeft + 56 + 18 * 2, top, 11 * 16 + 2, 12 * 16 + 2,
|
||||
this.craft = this.addButton(new ToggleButton(this.guiLeft + 56 + 18 * 2, top, 11 * 16 + 2, 12 * 16 + 2,
|
||||
SecurityPermissions.CRAFT.getTranslatedName(), SecurityPermissions.CRAFT.getTranslatedTip(),
|
||||
btn -> toggleOption(SecurityPermissions.CRAFT)));
|
||||
|
||||
this.build = this.addButton(new GuiToggleButton(this.guiLeft + 56 + 18 * 3, top, 11 * 16 + 3, 12 * 16 + 3,
|
||||
this.build = this.addButton(new ToggleButton(this.guiLeft + 56 + 18 * 3, top, 11 * 16 + 3, 12 * 16 + 3,
|
||||
SecurityPermissions.BUILD.getTranslatedName(), SecurityPermissions.BUILD.getTranslatedTip(),
|
||||
btn -> toggleOption(SecurityPermissions.BUILD)));
|
||||
|
||||
this.security = this.addButton(new GuiToggleButton(this.guiLeft + 56 + 18 * 4, top, 11 * 16 + 4, 12 * 16 + 4,
|
||||
this.security = this.addButton(new ToggleButton(this.guiLeft + 56 + 18 * 4, top, 11 * 16 + 4, 12 * 16 + 4,
|
||||
SecurityPermissions.SECURITY.getTranslatedName(), SecurityPermissions.SECURITY.getTranslatedTip(),
|
||||
btn -> toggleOption(SecurityPermissions.SECURITY)));
|
||||
}
|
||||
+4
-4
@@ -23,16 +23,16 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.implementations.ContainerSkyChest;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.container.implementations.SkyChestContainer;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiSkyChest extends AEBaseGui<ContainerSkyChest> {
|
||||
public class SkyChestScreen extends AEBaseScreen<SkyChestContainer> {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation(AppEng.MOD_ID, "textures/guis/skychest.png");
|
||||
|
||||
public GuiSkyChest(ContainerSkyChest container, PlayerInventory playerInv, ITextComponent title) {
|
||||
public SkyChestScreen(SkyChestContainer container, PlayerInventory playerInv, ITextComponent title) {
|
||||
super(container, playerInv, title);
|
||||
this.ySize = 195;
|
||||
}
|
||||
+4
-4
@@ -22,15 +22,15 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.CommonButtons;
|
||||
import appeng.container.implementations.ContainerSpatialIOPort;
|
||||
import appeng.container.implementations.SpatialIOPortContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiSpatialIOPort extends AEBaseGui<ContainerSpatialIOPort> {
|
||||
public class SpatialIOPortScreen extends AEBaseScreen<SpatialIOPortContainer> {
|
||||
|
||||
public GuiSpatialIOPort(ContainerSpatialIOPort container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public SpatialIOPortScreen(SpatialIOPortContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 199;
|
||||
}
|
||||
+23
-23
@@ -26,39 +26,39 @@ import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.StorageFilter;
|
||||
import appeng.client.gui.widgets.GuiActionButton;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.container.implementations.ContainerStorageBus;
|
||||
import appeng.client.gui.widgets.ActionButton;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.client.gui.widgets.TabButton;
|
||||
import appeng.container.implementations.PriorityContainer;
|
||||
import appeng.container.implementations.StorageBusContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
import appeng.core.sync.packets.SwitchGuisPacket;
|
||||
import appeng.core.sync.packets.ConfigValuePacket;
|
||||
|
||||
public class GuiStorageBus extends GuiUpgradeable<ContainerStorageBus> {
|
||||
public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
|
||||
|
||||
private GuiSettingToggleButton<AccessRestriction> rwMode;
|
||||
private GuiSettingToggleButton<StorageFilter> storageFilter;
|
||||
private SettingToggleButton<AccessRestriction> rwMode;
|
||||
private SettingToggleButton<StorageFilter> storageFilter;
|
||||
|
||||
public GuiStorageBus(ContainerStorageBus container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public StorageBusScreen(StorageBusContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 251;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
addButton(new GuiActionButton(this.guiLeft - 18, this.guiTop + 8, ActionItems.CLOSE, btn -> clear()));
|
||||
addButton(new GuiActionButton(this.guiLeft - 18, this.guiTop + 28, ActionItems.WRENCH, btn -> partition()));
|
||||
this.rwMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS,
|
||||
addButton(new ActionButton(this.guiLeft - 18, this.guiTop + 8, ActionItems.CLOSE, btn -> clear()));
|
||||
addButton(new ActionButton(this.guiLeft - 18, this.guiTop + 28, ActionItems.WRENCH, btn -> partition()));
|
||||
this.rwMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.ACCESS,
|
||||
AccessRestriction.READ_WRITE);
|
||||
this.storageFilter = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
this.storageFilter = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY);
|
||||
this.fuzzyMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE,
|
||||
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE,
|
||||
FuzzyMode.IGNORE_ALL);
|
||||
|
||||
this.addButton(new GuiTabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
|
||||
this.addButton(this.storageFilter);
|
||||
@@ -76,11 +76,11 @@ public class GuiStorageBus extends GuiUpgradeable<ContainerStorageBus> {
|
||||
}
|
||||
|
||||
if (this.storageFilter != null) {
|
||||
this.storageFilter.set(((ContainerStorageBus) this.cvb).getStorageFilter());
|
||||
this.storageFilter.set(((StorageBusContainer) this.cvb).getStorageFilter());
|
||||
}
|
||||
|
||||
if (this.rwMode != null) {
|
||||
this.rwMode.set(((ContainerStorageBus) this.cvb).getReadWriteMode());
|
||||
this.rwMode.set(((StorageBusContainer) this.cvb).getReadWriteMode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,15 +90,15 @@ public class GuiStorageBus extends GuiUpgradeable<ContainerStorageBus> {
|
||||
}
|
||||
|
||||
private void partition() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("StorageBus.Action", "Partition"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("StorageBus.Action", "Partition"));
|
||||
}
|
||||
|
||||
private void clear() {
|
||||
NetworkHandler.instance().sendToServer(new PacketValueConfig("StorageBus.Action", "Clear"));
|
||||
NetworkHandler.instance().sendToServer(new ConfigValuePacket("StorageBus.Action", "Clear"));
|
||||
}
|
||||
|
||||
private void openPriorityGui() {
|
||||
NetworkHandler.instance().sendToServer(new PacketSwitchGuis(ContainerPriority.TYPE));
|
||||
NetworkHandler.instance().sendToServer(new SwitchGuisPacket(PriorityContainer.TYPE));
|
||||
}
|
||||
|
||||
}
|
||||
+19
-19
@@ -29,25 +29,25 @@ import appeng.api.config.Settings;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.GuiSettingToggleButton;
|
||||
import appeng.container.implementations.ContainerUpgradeable;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.ServerSettingToggleButton;
|
||||
import appeng.client.gui.widgets.SettingToggleButton;
|
||||
import appeng.container.implementations.UpgradeableContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.parts.automation.PartExportBus;
|
||||
import appeng.parts.automation.PartImportBus;
|
||||
import appeng.parts.automation.ExportBusPart;
|
||||
import appeng.parts.automation.ImportBusPart;
|
||||
|
||||
public class GuiUpgradeable<T extends ContainerUpgradeable> extends AEBaseGui<T> {
|
||||
public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScreen<T> {
|
||||
|
||||
protected final ContainerUpgradeable cvb;
|
||||
protected final UpgradeableContainer cvb;
|
||||
protected final IUpgradeableHost bc;
|
||||
|
||||
protected GuiSettingToggleButton<RedstoneMode> redstoneMode;
|
||||
protected GuiSettingToggleButton<FuzzyMode> fuzzyMode;
|
||||
protected GuiSettingToggleButton<YesNo> craftMode;
|
||||
protected GuiSettingToggleButton<SchedulingMode> schedulingMode;
|
||||
protected SettingToggleButton<RedstoneMode> redstoneMode;
|
||||
protected SettingToggleButton<FuzzyMode> fuzzyMode;
|
||||
protected SettingToggleButton<YesNo> craftMode;
|
||||
protected SettingToggleButton<SchedulingMode> schedulingMode;
|
||||
|
||||
public GuiUpgradeable(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public UpgradeableScreen(T container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.cvb = container;
|
||||
|
||||
@@ -67,16 +67,16 @@ public class GuiUpgradeable<T extends ContainerUpgradeable> extends AEBaseGui<T>
|
||||
}
|
||||
|
||||
protected void addButtons() {
|
||||
this.redstoneMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8,
|
||||
this.redstoneMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8,
|
||||
Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE);
|
||||
addButton(this.redstoneMode);
|
||||
this.fuzzyMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28, Settings.FUZZY_MODE,
|
||||
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 28, Settings.FUZZY_MODE,
|
||||
FuzzyMode.IGNORE_ALL);
|
||||
addButton(this.fuzzyMode);
|
||||
this.craftMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_ONLY,
|
||||
this.craftMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_ONLY,
|
||||
YesNo.NO);
|
||||
addButton(this.craftMode);
|
||||
this.schedulingMode = new GuiServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
this.schedulingMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 68,
|
||||
Settings.SCHEDULING_MODE, SchedulingMode.DEFAULT);
|
||||
addButton(this.schedulingMode);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public class GuiUpgradeable<T extends ContainerUpgradeable> extends AEBaseGui<T>
|
||||
}
|
||||
if (this.schedulingMode != null) {
|
||||
this.schedulingMode.setVisibility(
|
||||
this.bc.getInstalledUpgrades(Upgrades.CAPACITY) > 0 && this.bc instanceof PartExportBus);
|
||||
this.bc.getInstalledUpgrades(Upgrades.CAPACITY) > 0 && this.bc instanceof ExportBusPart);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class GuiUpgradeable<T extends ContainerUpgradeable> extends AEBaseGui<T>
|
||||
}
|
||||
|
||||
protected GuiText getName() {
|
||||
return this.bc instanceof PartImportBus ? GuiText.ImportBus : GuiText.ExportBus;
|
||||
return this.bc instanceof ImportBusPart ? GuiText.ImportBus : GuiText.ExportBus;
|
||||
}
|
||||
|
||||
}
|
||||
+12
-12
@@ -24,19 +24,19 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiProgressBar;
|
||||
import appeng.client.gui.widgets.GuiProgressBar.Direction;
|
||||
import appeng.container.implementations.ContainerVibrationChamber;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.ProgressBar;
|
||||
import appeng.client.gui.widgets.ProgressBar.Direction;
|
||||
import appeng.container.implementations.VibrationChamberContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.tile.misc.TileVibrationChamber;
|
||||
import appeng.tile.misc.VibrationChamberTileEntity;
|
||||
|
||||
public class GuiVibrationChamber extends AEBaseGui<ContainerVibrationChamber> {
|
||||
public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContainer> {
|
||||
|
||||
private GuiProgressBar pb;
|
||||
private ProgressBar pb;
|
||||
|
||||
public GuiVibrationChamber(ContainerVibrationChamber container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
public VibrationChamberScreen(VibrationChamberContainer container, PlayerInventory playerInventory,
|
||||
ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class GuiVibrationChamber extends AEBaseGui<ContainerVibrationChamber> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar(this.container, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL);
|
||||
this.pb = new ProgressBar(this.container, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL);
|
||||
this.addButton(this.pb);
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ public class GuiVibrationChamber extends AEBaseGui<ContainerVibrationChamber> {
|
||||
this.font.drawString(this.getGuiDisplayName(GuiText.VibrationChamber.getLocal()), 8, 6, 4210752);
|
||||
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
this.pb.setFullMsg(TileVibrationChamber.POWER_PER_TICK * this.container.getCurrentProgress()
|
||||
/ TileVibrationChamber.DILATION_SCALING + " AE/t");
|
||||
this.pb.setFullMsg(VibrationChamberTileEntity.POWER_PER_TICK * this.container.getCurrentProgress()
|
||||
/ VibrationChamberTileEntity.DILATION_SCALING + " AE/t");
|
||||
|
||||
if (this.container.getRemainingBurnTime() > 0) {
|
||||
final int i1 = this.container.getRemainingBurnTime() * 12 / 100;
|
||||
+4
-4
@@ -22,15 +22,15 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import appeng.client.gui.widgets.CommonButtons;
|
||||
import appeng.container.implementations.ContainerWireless;
|
||||
import appeng.container.implementations.WirelessContainer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class GuiWireless extends AEBaseGui<ContainerWireless> {
|
||||
public class WirelessScreen extends AEBaseScreen<WirelessContainer> {
|
||||
|
||||
public GuiWireless(ContainerWireless container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public WirelessScreen(WirelessContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
this.ySize = 166;
|
||||
}
|
||||
+3
-3
@@ -21,12 +21,12 @@ package appeng.client.gui.implementations;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
|
||||
import appeng.container.implementations.ContainerMEPortableCell;
|
||||
import appeng.container.implementations.MEPortableCellContainer;
|
||||
|
||||
// FIXME: Extended from GuiPortableCell before... Why?
|
||||
public class GuiWirelessTerm extends GuiMEMonitorable<ContainerMEPortableCell> {
|
||||
public class WirelessTermScreen extends MEMonitorableScreen<MEPortableCellContainer> {
|
||||
|
||||
public GuiWirelessTerm(ContainerMEPortableCell container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
public WirelessTermScreen(MEPortableCellContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
+3
-3
@@ -34,7 +34,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
*
|
||||
* The rendering does pay attention to the size of the '_' caret.
|
||||
*/
|
||||
public class MEGuiTextField extends TextFieldWidget {
|
||||
public class AETextField extends TextFieldWidget {
|
||||
private static final int PADDING = 2;
|
||||
|
||||
private final int _fontPad;
|
||||
@@ -50,8 +50,8 @@ public class MEGuiTextField extends TextFieldWidget {
|
||||
* @param width absolute width
|
||||
* @param height absolute height
|
||||
*/
|
||||
public MEGuiTextField(final FontRenderer fontRenderer, final int xPos, final int yPos, final int width,
|
||||
final int height) {
|
||||
public AETextField(final FontRenderer fontRenderer, final int xPos, final int yPos, final int width,
|
||||
final int height) {
|
||||
super(fontRenderer, xPos + PADDING, yPos + PADDING, width - 2 * PADDING - (int) fontRenderer.getCharWidth('_'),
|
||||
height - 2 * PADDING, "");
|
||||
|
||||
+2
-2
@@ -24,11 +24,11 @@ import java.util.regex.Pattern;
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
|
||||
public class GuiActionButton extends GuiIconButton implements ITooltip {
|
||||
public class ActionButton extends IconButton implements ITooltip {
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
private final int iconIndex;
|
||||
|
||||
public GuiActionButton(final int x, final int y, final ActionItems action, Consumer<ActionItems> onPress) {
|
||||
public ActionButton(final int x, final int y, final ActionItems action, Consumer<ActionItems> onPress) {
|
||||
super(x, y, btn -> onPress.accept(action));
|
||||
|
||||
ButtonToolTips displayName;
|
||||
@@ -9,12 +9,12 @@ public final class CommonButtons {
|
||||
private CommonButtons() {
|
||||
}
|
||||
|
||||
public static GuiSettingToggleButton<PowerUnits> togglePowerUnit(int x, int y) {
|
||||
return new GuiSettingToggleButton<>(x, y, Settings.POWER_UNITS, AEConfig.instance().getSelectedPowerUnit(),
|
||||
public static SettingToggleButton<PowerUnits> togglePowerUnit(int x, int y) {
|
||||
return new SettingToggleButton<>(x, y, Settings.POWER_UNITS, AEConfig.instance().getSelectedPowerUnit(),
|
||||
CommonButtons::togglePowerUnit);
|
||||
}
|
||||
|
||||
private static void togglePowerUnit(GuiSettingToggleButton<PowerUnits> button, boolean backwards) {
|
||||
private static void togglePowerUnit(SettingToggleButton<PowerUnits> button, boolean backwards) {
|
||||
AEConfig.instance().nextPowerUnit(backwards);
|
||||
button.set(AEConfig.instance().getSelectedPowerUnit());
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,12 +6,12 @@ import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class GuiCustomSlot extends AbstractGui implements ITooltip {
|
||||
public abstract class CustomSlotWidget extends AbstractGui implements ITooltip {
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int id;
|
||||
|
||||
public GuiCustomSlot(final int id, final int x, final int y) {
|
||||
public CustomSlotWidget(final int id, final int x, final int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.id = id;
|
||||
+2
-2
@@ -26,13 +26,13 @@ import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
public abstract class GuiIconButton extends Button implements ITooltip {
|
||||
public abstract class IconButton extends Button implements ITooltip {
|
||||
public static final ResourceLocation TEXTURE_STATES = new ResourceLocation("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
|
||||
private boolean halfSize = false;
|
||||
|
||||
public GuiIconButton(final int x, final int y, IPressable onPress) {
|
||||
public IconButton(final int x, final int y, IPressable onPress) {
|
||||
super(x, y, 16, 16, "", onPress);
|
||||
}
|
||||
|
||||
+3
-3
@@ -22,12 +22,12 @@ import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
|
||||
// FIXME: Fix this piece of crap (i.e. onChange listener)
|
||||
public class GuiNumberBox extends TextFieldWidget {
|
||||
public class NumberBox extends TextFieldWidget {
|
||||
|
||||
private final Class type;
|
||||
|
||||
public GuiNumberBox(final FontRenderer fontRenderer, final int x, final int y, final int width, final int height,
|
||||
final Class type) {
|
||||
public NumberBox(final FontRenderer fontRenderer, final int x, final int y, final int width, final int height,
|
||||
final Class type) {
|
||||
super(fontRenderer, x, y, width, height, "0");
|
||||
this.type = type;
|
||||
}
|
||||
+5
-5
@@ -26,7 +26,7 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import appeng.container.interfaces.IProgressProvider;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiProgressBar extends Widget implements ITooltip {
|
||||
public class ProgressBar extends Widget implements ITooltip {
|
||||
|
||||
private final IProgressProvider source;
|
||||
private final ResourceLocation texture;
|
||||
@@ -36,13 +36,13 @@ public class GuiProgressBar extends Widget implements ITooltip {
|
||||
private final String titleName;
|
||||
private String fullMsg;
|
||||
|
||||
public GuiProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir) {
|
||||
public ProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir) {
|
||||
this(source, texture, posX, posY, u, y, width, height, dir, null);
|
||||
}
|
||||
|
||||
public GuiProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir, final String title) {
|
||||
public ProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir, final String title) {
|
||||
super(posX, posY, width, height, "");
|
||||
this.source = source;
|
||||
this.texture = new ResourceLocation("appliedenergistics2", "textures/" + texture);
|
||||
+7
-7
@@ -22,9 +22,9 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
|
||||
public class GuiScrollbar implements IScrollSource {
|
||||
public class Scrollbar implements IScrollSource {
|
||||
|
||||
private int displayX = 0;
|
||||
private int displayY = 0;
|
||||
@@ -36,7 +36,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
private int minScroll = 0;
|
||||
private int currentScroll = 0;
|
||||
|
||||
public void draw(final AEBaseGui<?> g) {
|
||||
public void draw(final AEBaseScreen<?> g) {
|
||||
g.bindTexture("minecraft", "gui/container/creative_inventory/tabs.png");
|
||||
RenderSystem.color4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.displayX;
|
||||
}
|
||||
|
||||
public GuiScrollbar setLeft(final int v) {
|
||||
public Scrollbar setLeft(final int v) {
|
||||
this.displayX = v;
|
||||
return this;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.displayY;
|
||||
}
|
||||
|
||||
public GuiScrollbar setTop(final int v) {
|
||||
public Scrollbar setTop(final int v) {
|
||||
this.displayY = v;
|
||||
return this;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.width;
|
||||
}
|
||||
|
||||
public GuiScrollbar setWidth(final int v) {
|
||||
public Scrollbar setWidth(final int v) {
|
||||
this.width = v;
|
||||
return this;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.height;
|
||||
}
|
||||
|
||||
public GuiScrollbar setHeight(final int v) {
|
||||
public Scrollbar setHeight(final int v) {
|
||||
this.height = v;
|
||||
return this;
|
||||
}
|
||||
+6
-6
@@ -20,19 +20,19 @@ package appeng.client.gui.widgets;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketConfigButton;
|
||||
import appeng.core.sync.packets.ConfigButtonPacket;
|
||||
|
||||
/**
|
||||
* Convenience button that automatically sends settings changes to the server.
|
||||
*/
|
||||
public class GuiServerSettingToggleButton<T extends Enum<T>> extends GuiSettingToggleButton<T> {
|
||||
public class ServerSettingToggleButton<T extends Enum<T>> extends SettingToggleButton<T> {
|
||||
|
||||
public GuiServerSettingToggleButton(final int x, final int y, final Settings setting, final T val) {
|
||||
super(x, y, setting, val, GuiServerSettingToggleButton::sendToServer);
|
||||
public ServerSettingToggleButton(final int x, final int y, final Settings setting, final T val) {
|
||||
super(x, y, setting, val, ServerSettingToggleButton::sendToServer);
|
||||
}
|
||||
|
||||
private static <T extends Enum<T>> void sendToServer(GuiSettingToggleButton<T> button, boolean backwards) {
|
||||
NetworkHandler.instance().sendToServer(new PacketConfigButton(button.getSetting(), backwards));
|
||||
private static <T extends Enum<T>> void sendToServer(SettingToggleButton<T> button, boolean backwards) {
|
||||
NetworkHandler.instance().sendToServer(new ConfigButtonPacket(button.getSetting(), backwards));
|
||||
}
|
||||
|
||||
}
|
||||
+10
-10
@@ -49,29 +49,29 @@ import appeng.api.config.YesNo;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import appeng.util.EnumCycler;
|
||||
|
||||
public class GuiSettingToggleButton<T extends Enum<T>> extends GuiIconButton {
|
||||
public class SettingToggleButton<T extends Enum<T>> extends IconButton {
|
||||
private static final Pattern COMPILE = Pattern.compile("%s");
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
private static Map<EnumPair, ButtonAppearance> appearances;
|
||||
private final Settings buttonSetting;
|
||||
private final IHandler<GuiSettingToggleButton<T>> onPress;
|
||||
private final IHandler<SettingToggleButton<T>> onPress;
|
||||
private final EnumSet<T> validValues;
|
||||
private String fillVar;
|
||||
private T currentValue;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface IHandler<T extends GuiSettingToggleButton<?>> {
|
||||
public interface IHandler<T extends SettingToggleButton<?>> {
|
||||
void handle(T button, boolean backwards);
|
||||
}
|
||||
|
||||
public GuiSettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
IHandler<GuiSettingToggleButton<T>> onPress) {
|
||||
public SettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
IHandler<SettingToggleButton<T>> onPress) {
|
||||
this(x, y, setting, val, t -> true, onPress);
|
||||
}
|
||||
|
||||
public GuiSettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
Predicate<T> isValidValue, IHandler<GuiSettingToggleButton<T>> onPress) {
|
||||
super(x, y, GuiSettingToggleButton::onPress);
|
||||
public SettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
Predicate<T> isValidValue, IHandler<SettingToggleButton<T>> onPress) {
|
||||
super(x, y, SettingToggleButton::onPress);
|
||||
this.onPress = onPress;
|
||||
|
||||
// Build a list of values (in order) that are valid w.r.t. the given predicate
|
||||
@@ -223,8 +223,8 @@ public class GuiSettingToggleButton<T extends Enum<T>> extends GuiIconButton {
|
||||
}
|
||||
|
||||
private static void onPress(Button btn) {
|
||||
if (btn instanceof GuiSettingToggleButton) {
|
||||
((GuiSettingToggleButton<?>) btn).triggerPress();
|
||||
if (btn instanceof SettingToggleButton) {
|
||||
((SettingToggleButton<?>) btn).triggerPress();
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -27,7 +27,7 @@ import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GuiTabButton extends Button implements ITooltip {
|
||||
public class TabButton extends Button implements ITooltip {
|
||||
public static final ResourceLocation TEXTURE_STATES = new ResourceLocation("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
private final ItemRenderer itemRenderer;
|
||||
@@ -35,8 +35,8 @@ public class GuiTabButton extends Button implements ITooltip {
|
||||
private int myIcon = -1;
|
||||
private ItemStack myItem;
|
||||
|
||||
public GuiTabButton(final int x, final int y, final int ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
public TabButton(final int x, final int y, final int ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
super(x, y, 22, 22, message, onPress);
|
||||
|
||||
this.myIcon = ico;
|
||||
@@ -52,8 +52,8 @@ public class GuiTabButton extends Button implements ITooltip {
|
||||
* @param message mouse over message
|
||||
* @param ir renderer
|
||||
*/
|
||||
public GuiTabButton(final int x, final int y, final ItemStack ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
public TabButton(final int x, final int y, final ItemStack ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
super(x, y, 22, 22, message, onPress);
|
||||
this.myItem = ico;
|
||||
this.itemRenderer = ir;
|
||||
+3
-3
@@ -28,7 +28,7 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
public class GuiToggleButton extends Button implements ITooltip {
|
||||
public class ToggleButton extends Button implements ITooltip {
|
||||
public static final ResourceLocation TEXTURE_STATES = new ResourceLocation("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
@@ -40,8 +40,8 @@ public class GuiToggleButton extends Button implements ITooltip {
|
||||
|
||||
private boolean isActive;
|
||||
|
||||
public GuiToggleButton(final int x, final int y, final int on, final int off, final String displayName,
|
||||
final String displayHint, IPressable onPress) {
|
||||
public ToggleButton(final int x, final int y, final int on, final int off, final String displayName,
|
||||
final String displayHint, IPressable onPress) {
|
||||
super(x, y, 16, 16, "", onPress);
|
||||
this.iconIdxOn = on;
|
||||
this.iconIdxOff = off;
|
||||
@@ -40,7 +40,7 @@ import appeng.client.gui.widgets.IScrollSource;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.integration.abstraction.JEIFacade;
|
||||
import appeng.items.storage.ItemViewCell;
|
||||
import appeng.items.storage.ViewCellItem;
|
||||
import appeng.util.ItemSorters;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.prioritylist.IPartitionList;
|
||||
@@ -90,7 +90,7 @@ public class ItemRepo {
|
||||
}
|
||||
|
||||
public void setViewCell(final ItemStack[] list) {
|
||||
this.myPartitionList = ItemViewCell.createFilter(list);
|
||||
this.myPartitionList = ViewCellItem.createFilter(list);
|
||||
this.updateView();
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user