Lots of compile fixes

This commit is contained in:
Sebastian Hartte
2020-06-04 03:02:48 +02:00
parent 6eb2a9504a
commit 237463dd94
241 changed files with 3438 additions and 3474 deletions
+55
View File
@@ -92,6 +92,14 @@ sourceSets {
include 'appeng/block/AEBaseBlock.java'
include 'appeng/block/AEBaseBlockItem.java'
include 'appeng/block/AEBaseTileBlock.java'
include 'appeng/tile/**'
include 'appeng/parts/**'
include 'appeng/helpers/**'
include 'appeng/items/**'
include 'appeng/util/**'
include 'appeng/core/localization/**'
exclude 'appeng/parts/p2p/PartP2PFluids.java'
exclude 'appeng/parts/p2p/PartP2PItems.java'
include 'appeng/tile/AEBaseTile.java'
include 'appeng/tile/AEBaseInvTile.java'
include 'appeng/util/Platform.java'
@@ -194,6 +202,20 @@ sourceSets {
include 'appeng/container/AEBaseContainer*'
include 'appeng/helpers/InventoryAction.java'
include 'appeng/container/guisync/**'
include 'appeng/fluids/**'
exclude 'appeng/fluids/client/gui/**'
include 'appeng/core/features/**'
include 'appeng/entity/**'
include 'appeng/facade/**'
include 'appeng/hooks/**'
include 'appeng/client/render/cablebus/**'
include 'appeng/client/render/effects/EnergyFx.java'
include 'appeng/client/render/TesrRenderHelper.java'
include 'appeng/core/stats/IAdvancementTrigger.java'
include 'appeng/client/render/StaticItemColor.java'
include 'appeng/core/FacadeConfig.java'
include 'appeng/spatial/DefaultSpatialHandler.java'
exclude 'appeng/core/sync/packets/PacketSwitchGuis.java'
include 'appeng/core/sync/network/NetworkHandler.java'
include 'appeng/core/sync/packets/PacketProgressBar.java'
include 'appeng/container/slot/SlotDisabled.java'
@@ -205,6 +227,8 @@ sourceSets {
include 'appeng/core/sync/packets/PacketSwapSlots.java'
include 'appeng/core/sync/packets/PacketInventoryAction.java'
include 'appeng/container/implementations/ContainerCraftAmount.java'
include 'appeng/container/implementations/ContainerCraftConfirm.java'
include 'appeng/helpers/WirelessTerminalGuiObject.java'
include 'appeng/core/sync/packets/PacketValueConfig.java'
include 'appeng/client/render/StackSizeRenderer.java'
include 'appeng/fluids/client/render/FluidStackSizeRenderer.java'
@@ -242,6 +266,37 @@ sourceSets {
include 'appeng/client/render/cablebus/QuadRotator.java'
include 'appeng/thirdparty/codechicken/lib/**'
include 'appeng/client/render/model/AutoRotatingCacheKey.java'
include 'appeng/tile/misc/TileInscriber.java'
include 'appeng/parts/automation/DefinitionUpgradeInventory.java'
include 'appeng/core/sync/packets/PacketAssemblerAnimation.java'
include 'appeng/tile/grid/**'
include 'appeng/tile/powersink/AEBasePoweredTile.java'
include 'appeng/tile/powersink/IExternalPowerSink.java'
include 'appeng/block/misc/BlockInscriber.java'
include 'appeng/tile/powersink/ForgeEnergyAdapter.java'
include 'appeng/block/misc/InscriberRendering.java'
include 'appeng/client/render/tesr/InscriberTESR.java'
include 'appeng/hooks/TickHandler.java'
include 'appeng/me/**'
include 'appeng/util/IWorldCallable.java'
include 'appeng/crafting/**'
include 'appeng/util/ReadOnlyCollection.java'
include 'appeng/me/NetworkEventBus.java'
include 'appeng/container/ContainerNull.java'
include 'appeng/tile/crafting/**'
include 'appeng/block/crafting/**'
include 'appeng/client/render/crafting/CraftingCubeState.java'
include 'appeng/items/misc/ItemEncodedPattern.java'
include 'appeng/client/render/crafting/CraftingCubeRendering.java'
include 'appeng/core/sync/packets/**'
include 'appeng/hooks/CompassResult.java'
include 'appeng/container/implementations/CraftingCPURecord.java'
include 'appeng/fluids/container/IFluidSyncContainer.java'
include 'appeng/helpers/IContainerCraftingPacket.java'
include 'appeng/parts/PartPlacement.java'
include 'appeng/container/implementations/ContainerPatternTerm.java'
include 'appeng/parts/reporting/**'
include 'appeng/container/**'
}
compileClasspath += sourceSets.api.output
runtimeClasspath += sourceSets.api.output
@@ -53,7 +53,7 @@ public interface IMovableHandler
* <pre>
* {
* &#064;code
* Chunk c = world.getChunkFromBlockCoords( x, z );
* Chunk c = world.getChunkAt( x, z );
* c.setChunkBlockTileEntity( x &amp; 0xF, y + y, z &amp; 0xF, tile );
*
* if( c.isChunkLoaded )
@@ -27,6 +27,7 @@ package appeng.api.networking.crafting;
import appeng.api.networking.security.IActionSource;
import appeng.api.networking.storage.IBaseMonitor;
import appeng.api.storage.data.IAEItemStack;
import net.minecraft.util.text.ITextComponent;
public interface ICraftingCPU extends IBaseMonitor<IAEItemStack>
@@ -53,7 +54,7 @@ public interface ICraftingCPU extends IBaseMonitor<IAEItemStack>
int getCoProcessors();
/**
* @return an empty string or the name of the cpu.
* @return a null or the name of the cpu.
*/
String getName();
ITextComponent getName();
}
@@ -40,6 +40,6 @@ public interface IActionHost
* @return the the gridnode that actions from this IGridHost are preformed
* by.
*/
@Nonnull
@Nonnull // FIXME fishy annotation, every caller seems to check for null
IGridNode getActionableNode();
}
+7 -18
View File
@@ -30,6 +30,8 @@ import java.util.Random;
import javax.annotation.Nonnull;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
@@ -50,6 +52,7 @@ import appeng.api.networking.IGridNode;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.api.util.AEPartLocation;
import net.minecraftforge.common.util.LazyOptional;
public interface IPart extends IBoxProvider, ICustomCableConnection
@@ -75,7 +78,7 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
* this method to be called.
*/
@OnlyIn( Dist.CLIENT )
default void renderDynamic( double x, double y, double z, float partialTicks, int destroyStage )
default void renderDynamic(float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer buffers, int combinedLightIn, int combinedOverlayIn)
{
}
@@ -333,27 +336,13 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
* forwarded to parts on the appropriate
* side.
*
* @see TileEntity#hasCapability(Capability, EnumFacing)
*
* @return True if your part has the requested capability.
*/
default boolean hasCapability( Capability<?> capabilityClass )
{
return false;
}
/**
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be
* forwarded to parts on the appropriate
* side.
*
* @see TileEntity#getCapability(Capability, EnumFacing)
* @see TileEntity#getCapability(Capability, net.minecraft.util.Direction)
*
* @return The capability or null.
*/
default <T> T getCapability( Capability<T> capabilityClass )
default <T> LazyOptional<T> getCapability(Capability<T> capabilityClass )
{
return null;
return LazyOptional.empty();
}
/**
+1 -1
View File
@@ -42,7 +42,7 @@ import net.minecraft.item.ItemStack;
* <code>
*
* {@literal @}Override
* public default EnumActionResult onItemUse(ItemStack is, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
* public default ActionResultType onItemUse(ItemStack is, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
* {
* return Api.INSTANCE.partHelper().placeBus( is, pos, side, player, hand, world );
* }
@@ -0,0 +1,99 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.block.crafting;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.state.BooleanProperty;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.StateContainer;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock;
import appeng.tile.crafting.TileCraftingTile;
public abstract class AbstractCraftingUnitBlock<T extends TileCraftingTile> extends AEBaseTileBlock<T>
{
public static final BooleanProperty FORMED = BooleanProperty.create( "formed" );
public static final BooleanProperty POWERED = BooleanProperty.create( "powered" );
public final CraftingUnitType type;
public AbstractCraftingUnitBlock(Block.Properties props, final CraftingUnitType type )
{
super( props );
this.type = type;
}
@Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
super.fillStateContainer(builder);
builder.add(POWERED);
builder.add(FORMED);
}
@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 );
if( cp != null )
{
cp.updateMultiBlock();
}
}
@Override
public void onReplaced(BlockState state, World w, BlockPos pos, BlockState newState, boolean isMoving)
{
final TileCraftingTile cp = this.getTileEntity( w, pos );
if( cp != null )
{
cp.breakCluster();
}
super.onReplaced( state, w, pos, newState, isMoving );
}
@Override
public ActionResultType onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity p, Hand hand, BlockRayTraceResult hit) {
final TileCraftingTile tg = this.getTileEntity( w, pos );
if( tg != null && !p.isCrouching() && tg.isFormed() && tg.isActive() )
{
if ( !w.isRemote() )
{
// FIXME Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_CRAFTING_CPU );
}
return ActionResultType.SUCCESS;
}
return super.onBlockActivated(state, w, pos, p, hand, hit);
}
public enum CraftingUnitType
{
UNIT, ACCELERATOR, STORAGE_1K, STORAGE_4K, STORAGE_16K, STORAGE_64K, MONITOR
}
}
@@ -19,72 +19,12 @@
package appeng.block.crafting;
import net.minecraft.block.BlockStateContainer;
import net.minecraft.block.BlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.util.AEColor;
import appeng.client.UnlistedProperty;
import appeng.tile.crafting.TileCraftingMonitorTile;
public class BlockCraftingMonitor extends BlockCraftingUnit
public class BlockCraftingMonitor extends AbstractCraftingUnitBlock<TileCraftingMonitorTile>
{
public static final UnlistedProperty<AEColor> COLOR = new UnlistedProperty<>( "color", AEColor.class );
public BlockCraftingMonitor()
public BlockCraftingMonitor(Properties props)
{
super( CraftingUnitType.MONITOR );
}
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
STATE,
COLOR,
FORWARD,
UP
} );
}
@Override
public IExtendedBlockState getExtendedState( BlockState state, IBlockReader world, BlockPos pos )
{
AEColor color = AEColor.TRANSPARENT;
Direction forward = Direction.NORTH;
Direction up = Direction.UP;
TileCraftingMonitorTile te = this.getTileEntity( world, pos );
if( te != null )
{
color = te.getColor();
forward = te.getForward();
up = te.getUp();
}
return super.getExtendedState( state, world, pos )
.with( COLOR, color )
.with( FORWARD, forward )
.with( UP, up );
}
@Override
@OnlyIn( Dist.CLIENT )
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks)
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
super( props, CraftingUnitType.MONITOR );
}
}
@@ -19,12 +19,13 @@
package appeng.block.crafting;
public class BlockCraftingStorage extends BlockCraftingUnit
import appeng.tile.crafting.TileCraftingStorageTile;
public class BlockCraftingStorage extends AbstractCraftingUnitBlock<TileCraftingStorageTile>
{
public BlockCraftingStorage( final CraftingUnitType type )
{
super( type );
public BlockCraftingStorage(Properties props, CraftingUnitType type) {
super(props, type);
}
}
@@ -1,167 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.block.crafting;
import java.util.EnumSet;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockStateContainer;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.BooleanProperty;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.state.IProperty;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.client.UnlistedProperty;
import appeng.client.render.crafting.CraftingCubeState;
import appeng.core.sync.GuiBridge;
import appeng.tile.crafting.TileCraftingTile;
import appeng.util.Platform;
public class BlockCraftingUnit extends AEBaseTileBlock
{
public static final BooleanProperty FORMED = BooleanProperty.create( "formed" );
public static final BooleanProperty POWERED = BooleanProperty.create( "powered" );
public static final UnlistedProperty<CraftingCubeState> STATE = new UnlistedProperty<>( "state", CraftingCubeState.class );
public final CraftingUnitType type;
public BlockCraftingUnit( final CraftingUnitType type )
{
super( Material.IRON );
this.type = type;
}
@Override
protected IProperty[] getAEStates()
{
return new IProperty[] { POWERED, FORMED };
}
@Override
public IExtendedBlockState getExtendedState( BlockState state, IBlockReader world, BlockPos pos )
{
EnumSet<Direction> connections = EnumSet.noneOf( Direction.class );
for( Direction facing : Direction.values() )
{
if( this.isConnected( world, pos, facing ) )
{
connections.add( facing );
}
}
IExtendedBlockState extState = (IExtendedBlockState) state;
return extState.with( STATE, new CraftingCubeState( connections ) );
}
private boolean isConnected( IBlockReader world, BlockPos pos, Direction side )
{
BlockPos adjacentPos = pos.offset( side );
return world.getBlockState( adjacentPos ).getBlock() instanceof BlockCraftingUnit;
}
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { STATE } );
}
@Override
public BlockState getStateFromMeta( final int meta )
{
return this.getDefaultState().with( POWERED, ( meta & 1 ) == 1 ).with( FORMED, ( meta & 2 ) == 2 );
}
@Override
public int getMetaFromState( final BlockState state )
{
boolean p = state.getValue( POWERED );
boolean f = state.getValue( FORMED );
return ( p ? 1 : 0 ) | ( f ? 2 : 0 );
}
@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 );
if( cp != null )
{
cp.updateMultiBlock();
}
}
@Override
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.CUTOUT;
}
@Override
public void onReplaced(BlockState state, World w, BlockPos pos, BlockState newState, boolean isMoving)
{
final TileCraftingTile cp = this.getTileEntity( w, pos );
if( cp != null )
{
cp.breakCluster();
}
super.onReplaced( state, w, pos, newState, isMoving );
}
@Override
public boolean onBlockActivated( final World w, final BlockPos pos, final BlockState state, final PlayerEntity p, final Hand hand, final Direction side, final float hitX, final float hitY, final float hitZ )
{
final TileCraftingTile tg = this.getTileEntity( w, pos );
if( tg != null && !p.isCrouching() && tg.isFormed() && tg.isActive() )
{
if( Platform.isClient() )
{
return true;
}
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_CRAFTING_CPU );
return true;
}
return super.onBlockActivated( w, pos, state, p, hand, side, hitX, hitY, hitZ );
}
public enum CraftingUnitType
{
UNIT, ACCELERATOR, STORAGE_1K, STORAGE_4K, STORAGE_16K, STORAGE_64K, MONITOR
}
}
@@ -19,93 +19,62 @@
package appeng.block.crafting;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.BooleanProperty;
import appeng.block.AEBaseTileBlock;
import appeng.tile.crafting.TileMolecularAssembler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Direction;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.core.sync.GuiBridge;
import appeng.tile.crafting.TileMolecularAssembler;
import appeng.util.Platform;
public class BlockMolecularAssembler extends AEBaseTileBlock
public class BlockMolecularAssembler extends AEBaseTileBlock<TileMolecularAssembler>
{
public static final BooleanProperty POWERED = BooleanProperty.create( "powered" );
public BlockMolecularAssembler()
public BlockMolecularAssembler(Block.Properties props)
{
super( Material.IRON );
this.setOpaque( false );
this.lightOpacity = 1;
super( props );
}
@Override
protected IProperty[] getAEStates()
{
return new IProperty[] { POWERED };
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
super.fillStateContainer(builder);
builder.add(POWERED);
}
@Override
public BlockState getActualState( BlockState state, IBlockReader worldIn, BlockPos pos )
{
boolean powered = false;
TileMolecularAssembler te = this.getTileEntity( worldIn, pos );
if( te != null )
{
powered = te.isPowered();
}
return super.getActualState( state, worldIn, pos ).with( POWERED, powered );
}
/**
* NOTE: This is only used to determine how to render an item being held in hand.
* For determining block rendering, the method below is used (canRenderInLayer).
*/
@OnlyIn( Dist.CLIENT )
@Override
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.CUTOUT;
}
@OnlyIn( Dist.CLIENT )
@Override
public boolean canRenderInLayer( BlockState state, BlockRenderLayer layer )
{
return layer == BlockRenderLayer.CUTOUT || layer == BlockRenderLayer.TRANSLUCENT;
}
// FIXME: This apparently was used to update block states purely client-side... this wont work anymore :|
// FIXME @Override
// FIXME public BlockState getActualState( BlockState state, IBlockReader worldIn, BlockPos pos )
// FIXME {
// FIXME boolean powered = false;
// FIXME TileMolecularAssembler te = this.getTileEntity( worldIn, pos );
// FIXME if( te != null )
// FIXME {
// FIXME powered = te.isPowered();
// FIXME }
// FIXME
// FIXME return super.getActualState( state, worldIn, pos ).with( POWERED, powered );
// FIXME }
@Override
public boolean isFullCube( BlockState state )
{
return false;
}
@Override
public boolean onBlockActivated( final World w, final BlockPos pos, final BlockState state, final PlayerEntity p, final Hand hand, final Direction side, final float hitX, final float hitY, final float hitZ )
{
public ActionResultType onBlockActivated(BlockState state, World w, BlockPos pos, PlayerEntity p, Hand hand, BlockRayTraceResult hit) {
final TileMolecularAssembler tg = this.getTileEntity( w, pos );
if( tg != null && !p.isCrouching() )
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_MAC );
return true;
if (!tg.isRemote()) {
// FIXME Platform.openGUI(p, tg, AEPartLocation.fromFacing(side), GuiBridge.GUI_MAC);
}
return ActionResultType.SUCCESS;
}
return super.onBlockActivated( w, pos, state, p, hand, side, hitX, hitY, hitZ );
return super.onBlockActivated(state, w, pos, p, hand, hit);
}
}
@@ -16,52 +16,17 @@
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.client;
package appeng.block.crafting;
import net.minecraftforge.common.property.IUnlistedProperty;
import appeng.tile.crafting.TileCraftingTile;
/**
* A generic implementation for {@link IUnlistedProperty}.
*
* @param <T>
*/
public class UnlistedProperty<T> implements IUnlistedProperty<T>
public class CraftingUnitBlock extends AbstractCraftingUnitBlock<TileCraftingTile>
{
private final String name;
private final Class<T> clazz;
public UnlistedProperty( String name, Class<T> clazz )
{
this.name = name;
this.clazz = clazz;
}
@Override
public String getName()
{
return this.name;
}
@Override
public boolean isValid( T value )
{
return value != null;
}
@Override
public Class<T> getType()
{
return this.clazz;
}
@Override
public String valueToString( T value )
{
return value.toString();
public CraftingUnitBlock(Properties props, CraftingUnitType type) {
super(props, type);
}
}
@@ -19,6 +19,7 @@
package appeng.block.crafting;
import appeng.core.Api;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
@@ -30,9 +31,8 @@ import appeng.api.features.AEFeature;
public class ItemCraftingStorage extends AEBaseBlockItem
{
public ItemCraftingStorage( final Block id )
{
super( id );
public ItemCraftingStorage(Block id, Properties props) {
super(id, props);
}
@Override
@@ -32,7 +32,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileCellWorkbench;
import appeng.util.Platform;
@@ -32,7 +32,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileCondenser;
import appeng.util.Platform;
@@ -19,66 +19,44 @@
package appeng.block.misc;
import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
import appeng.block.AEBaseTileBlock;
import appeng.tile.misc.TileInscriber;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.BlockRenderType;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileInscriber;
import appeng.util.Platform;
import javax.annotation.Nullable;
public class BlockInscriber extends AEBaseTileBlock<TileInscriber> {
public class BlockInscriber extends AEBaseTileBlock
{
public BlockInscriber(Properties props) {
super(props);
}
public BlockInscriber()
{
super( Material.IRON );
@Override
public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) {
return 2; // FIXME validate this. a) possibly not required because of getShape b) value range. was 2 in 1.10
}
this.setLightOpacity( 2 );
this.setFullSize( this.setOpaque( false ) );
}
@Override
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);
if (tg != null) {
if (!tg.isRemote()) {
// FIXME Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit.getFace()), GuiBridge.GUI_INSCRIBER );
}
return ActionResultType.SUCCESS;
}
}
return ActionResultType.PASS;
@Override
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() )
{
return ActionResultType.PASS;
}
}
final TileInscriber tg = this.getTileEntity( w, pos );
if( tg != null )
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_INSCRIBER );
}
return ActionResultType.SUCCESS;
}
return ActionResultType.PASS;
}
@Override
public BlockRenderType getRenderType( BlockState state )
{
return BlockRenderType.MODEL;
}
@Override
public String getTranslationKey( final ItemStack is )
{
return super.getTranslationKey( is );
}
}
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.BooleanProperty;
import net.minecraft.state.BooleanProperty;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
@@ -38,7 +38,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.api.util.IOrientable;
import appeng.block.AEBaseTileBlock;
import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileInterface;
import appeng.util.Platform;
@@ -26,7 +26,7 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.BooleanProperty;
import net.minecraft.state.BooleanProperty;
import net.minecraft.block.properties.DirectionProperty;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
@@ -71,7 +71,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
@Override
public int getMetaFromState( final BlockState state )
{
return state.getValue( FACING ).ordinal();
return state.get( FACING ).ordinal();
}
@Override
@@ -24,7 +24,7 @@ import java.util.Random;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.BooleanProperty;
import net.minecraft.state.BooleanProperty;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.util.Direction;
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.BooleanProperty;
import net.minecraft.state.BooleanProperty;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
@@ -37,7 +37,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileSecurityStation;
import appeng.util.Platform;
@@ -19,9 +19,6 @@
package appeng.block.misc;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
@@ -33,15 +30,19 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.AbstractArrowEntity;
import net.minecraft.item.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import appeng.block.AEBaseBlock;
@@ -50,27 +51,24 @@ import appeng.helpers.ICustomCollision;
import net.minecraft.world.server.ServerWorld;
public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
public class BlockTinyTNT 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()
{
super( Material.TNT );
this.boundingBox = new AxisAlignedBB( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
this.setLightOpacity( 2 );
this.setFullSize( false );
this.setOpaque( false );
this.setSoundType( SoundType.GROUND );
this.setHardness( 0F );
super( Properties.create(Material.TNT).hardnessAndResistance(0).sound(SoundType.GROUND).notSolid() );
}
@Override
public boolean isFullCube( BlockState state )
{
return false;
public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) {
return 2; // FIXME: Validate that this is the correct value range
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
return SHAPE;
}
@Override
@@ -80,7 +78,9 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
{
this.startFuse( w, pos, player );
w.removeBlock(pos, false);
heldItem.damageItem( 1, player );
heldItem.damageItem( 1, player, p -> {
p.sendBreakAnimation(hand);
} ); // FIXME Check if onBroken is equivalent
return ActionResultType.SUCCESS;
}
else
@@ -103,7 +103,7 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
@Override
public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving )
{
if( world.isBlockIndirectlyGettingPowered( pos ) > 0 )
if( world.getRedstonePowerFromNeighbors( pos ) > 0 )
{
this.startFuse( world, pos, null );
world.removeBlock(pos, false);
@@ -111,11 +111,10 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
@Override
public void onBlockAdded( final World w, final BlockPos pos, final BlockState state )
{
super.onBlockAdded( w, pos, state );
public void onBlockAdded(BlockState state, World w, BlockPos pos, BlockState oldState, boolean isMoving) {
super.onBlockAdded( state, w, pos, oldState, isMoving );
if( w.isBlockIndirectlyGettingPowered( pos ) > 0 )
if( w.getRedstonePowerFromNeighbors( pos ) > 0 )
{
this.startFuse( w, pos, null );
w.removeBlock(pos, false);
@@ -166,15 +165,4 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
}
}
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b )
{
return Collections.singletonList( new AxisAlignedBB( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
}
@Override
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
out.add( new AxisAlignedBB( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) );
}
}
@@ -25,7 +25,7 @@ import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.BooleanProperty;
import net.minecraft.state.BooleanProperty;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
@@ -41,7 +41,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.core.AEConfig;
import appeng.core.sync.GuiBridge;
import appeng.tile.AEBaseTile;
import appeng.tile.misc.TileVibrationChamber;
import appeng.util.Platform;
@@ -2,23 +2,21 @@
package appeng.block.misc;
import appeng.bootstrap.*;
import appeng.tile.misc.TileInscriber;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.bootstrap.BlockRenderingCustomizer;
import appeng.bootstrap.IBlockRendering;
import appeng.bootstrap.IItemRendering;
import appeng.client.render.tesr.InscriberTESR;
public class InscriberRendering extends BlockRenderingCustomizer
public class InscriberRendering extends TileEntityRenderingCustomizer<TileInscriber>
{
@OnlyIn( Dist.CLIENT )
@Override
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
rendering.tileEntityRenderer( new InscriberTESR() );
public void customize(TileEntityRendering<TileInscriber> rendering) {
rendering.tileEntityRenderer( InscriberTESR::new );
}
}
@@ -38,9 +38,8 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.*;
import net.minecraft.item.DyeColor;
import net.minecraft.state.IProperty;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
@@ -48,12 +47,13 @@ import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.*;
import net.minecraft.util.math.RayTraceResult.Type;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -87,7 +87,7 @@ import appeng.tile.networking.TileCableBusTESR;
import appeng.util.Platform;
public class BlockCableBus extends AEBaseTileBlock implements IAEFacade
public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implements IAEFacade */
{
public static final UnlistedProperty<CableBusRenderState> RENDER_STATE_PROPERTY = new UnlistedProperty<>( "cable_bus_render_state", CableBusRenderState.class );
@@ -409,12 +409,11 @@ public class BlockCableBus extends AEBaseTileBlock implements IAEFacade
}
@Override
public boolean recolorBlock( final World world, final BlockPos pos, final Direction side, final EnumDyeColor color )
{
return this.recolorBlock( world, pos, side, color, null );
public boolean recolorBlock(BlockState state, IWorld world, BlockPos pos, Direction side, DyeColor color) {
return recolorBlock(world, pos, side, color, null);
}
public boolean recolorBlock( final World world, final BlockPos pos, final Direction side, final EnumDyeColor color, final PlayerEntity who )
public boolean recolorBlock(final IBlockReader world, final BlockPos pos, final Direction side, final DyeColor color, final PlayerEntity who )
{
try
{
@@ -497,4 +496,40 @@ public class BlockCableBus extends AEBaseTileBlock implements IAEFacade
super( worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, state );
}
}
@Override
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);
VoxelShape result = VoxelShapes.empty();
if (te != null) {
for (final AxisAlignedBB bx : te.getCableBus().getSelectedBoundingBoxesFromPool(false, true, context.getEntity(), true)) {
result = VoxelShapes.or(
result,
VoxelShapes.create(new AxisAlignedBB(bx.minX, bx.minY, bx.minZ, bx.maxX, bx.maxY, bx.maxZ))
);
}
}
return result;
}
@Override
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);
VoxelShape result = VoxelShapes.empty();
if (te != null) {
for (final AxisAlignedBB bx : te.getCableBus().getSelectedBoundingBoxesFromPool(false, true, context.getEntity(), false)) {
result = VoxelShapes.or(
result,
VoxelShapes.create(new AxisAlignedBB(bx.minX, bx.minY, bx.minZ, bx.maxX, bx.maxY, bx.maxZ))
);
}
}
return result;
}
}
@@ -156,7 +156,7 @@ public class BlockController extends AEBaseTileBlock
@Override
public int getMetaFromState( final BlockState state )
{
return state.getValue( CONTROLLER_STATE ).ordinal();
return state.get( CONTROLLER_STATE ).ordinal();
}
@Override
@@ -41,7 +41,7 @@ public class BlockEnergyCell extends AEBaseTileBlock
@Override
public int getMetaFromState( final BlockState state )
{
return state.getValue( ENERGY_STORAGE );
return state.get( ENERGY_STORAGE );
}
@Override
@@ -38,7 +38,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.core.sync.GuiBridge;
import appeng.helpers.AEGlassMaterial;
import appeng.helpers.ICustomCollision;
import appeng.tile.networking.TileWireless;
@@ -22,7 +22,7 @@ package appeng.block.qnb;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.BooleanProperty;
import net.minecraft.state.BooleanProperty;
import net.minecraft.block.BlockStateContainer;
import net.minecraft.block.BlockState;
import net.minecraft.util.BlockRenderLayer;
@@ -39,7 +39,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.client.EffectType;
import appeng.core.AppEng;
import appeng.core.sync.GuiBridge;
import appeng.helpers.AEGlassMaterial;
import appeng.tile.qnb.TileQuantumBridge;
import appeng.util.Platform;
@@ -34,7 +34,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.core.sync.GuiBridge;
import appeng.tile.spatial.TileSpatialIOPort;
import appeng.util.Platform;
@@ -38,7 +38,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.core.localization.PlayerMessages;
import appeng.core.sync.GuiBridge;
import appeng.tile.storage.TileChest;
import appeng.util.Platform;
@@ -40,7 +40,7 @@ import net.minecraftforge.common.property.IUnlistedProperty;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.client.UnlistedProperty;
import appeng.core.sync.GuiBridge;
import appeng.tile.storage.TileDrive;
import appeng.util.Platform;
@@ -34,7 +34,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.core.sync.GuiBridge;
import appeng.tile.storage.TileIOPort;
import appeng.util.Platform;
@@ -21,6 +21,7 @@ package appeng.bootstrap;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.color.IBlockColor;
@@ -55,4 +56,7 @@ public interface IBlockRendering
@OnlyIn( Dist.CLIENT )
IBlockRendering renderType(RenderType type);
@OnlyIn( Dist.CLIENT )
IBlockRendering renderType(Predicate<RenderType> type);
}
@@ -28,7 +28,7 @@ import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerChest;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketSwitchGuis;
import appeng.tile.storage.TileChest;
@@ -36,7 +36,7 @@ import appeng.container.AEBaseContainer;
import appeng.container.implementations.ContainerCraftAmount;
import appeng.core.AEConfig;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketCraftRequest;
import appeng.core.sync.packets.PacketSwitchGuis;
@@ -47,7 +47,7 @@ import appeng.client.gui.widgets.GuiScrollbar;
import appeng.container.implementations.ContainerCraftConfirm;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketSwitchGuis;
import appeng.core.sync.packets.PacketValueConfig;
@@ -41,7 +41,7 @@ import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerCraftingStatus;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketSwitchGuis;
import appeng.core.sync.packets.PacketValueConfig;
@@ -28,7 +28,7 @@ import appeng.client.gui.AEBaseGui;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerDrive;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketSwitchGuis;
import appeng.tile.storage.TileDrive;
@@ -34,7 +34,7 @@ import appeng.client.gui.widgets.GuiImgButton;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerFormationPlane;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketConfigButton;
import appeng.core.sync.packets.PacketSwitchGuis;
@@ -34,7 +34,7 @@ import appeng.client.gui.widgets.GuiTabButton;
import appeng.client.gui.widgets.GuiToggleButton;
import appeng.container.implementations.ContainerInterface;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketConfigButton;
import appeng.core.sync.packets.PacketSwitchGuis;
@@ -218,7 +218,7 @@ public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal>
this.refreshList = true;
}
for( final Object oKey : in.getKeySet() )
for( final Object oKey : in.keySet() )
{
final String key = (String) oKey;
if( key.startsWith( "=" ) )
@@ -226,7 +226,7 @@ public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal>
try
{
final long id = Long.parseLong( key.substring( 1 ), Character.MAX_RADIX );
final CompoundNBT invData = in.getCompoundTag( key );
final CompoundNBT invData = in.getCompound( key );
final ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) );
for( int x = 0; x < current.getInventory().getSlots(); x++ )
@@ -234,7 +234,7 @@ public class GuiInterfaceTerminal extends AEBaseGui<ContainerInterfaceTerminal>
final String which = Integer.toString( x );
if( invData.contains(which) )
{
current.getInventory().setStackInSlot( x, new ItemStack( invData.getCompoundTag( which ) ) );
current.getInventory().setStackInSlot( x, ItemStack.read( invData.getCompound( which ) ) );
}
}
}
@@ -59,7 +59,7 @@ import appeng.core.AEConfig;
import appeng.core.AELog;
import appeng.core.AppEng;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketSwitchGuis;
import appeng.core.sync.packets.PacketValueConfig;
@@ -32,7 +32,7 @@ import appeng.container.implementations.ContainerPriority;
import appeng.core.AEConfig;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketSwitchGuis;
import appeng.core.sync.packets.PacketValueConfig;
@@ -21,7 +21,7 @@ package appeng.client.gui.implementations;
import java.io.IOException;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.entity.player.PlayerInventory;
import appeng.client.gui.AEBaseGui;
@@ -38,7 +38,7 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
public class GuiQuartzKnife extends AEBaseGui<ContainerQuartzKnife>
{
private GuiTextField name;
private TextFieldWidget name;
public GuiQuartzKnife(ContainerQuartzKnife container, PlayerInventory playerInventory, ITextComponent title) {
super(container, playerInventory, title);
@@ -50,7 +50,7 @@ public class GuiQuartzKnife extends AEBaseGui<ContainerQuartzKnife>
{
super.init();
this.name = new GuiTextField( 0, this.font, this.guiLeft + 24, this.guiTop + 32, 79, this.font.FONT_HEIGHT );
this.name = new TextFieldWidget( 0, this.font, this.guiLeft + 24, this.guiTop + 32, 79, this.font.FONT_HEIGHT );
this.name.setEnableBackgroundDrawing( false );
this.name.setMaxStringLength( 32 );
this.name.setTextColor( 0xFFFFFF );
@@ -37,7 +37,7 @@ import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerStorageBus;
import appeng.core.AELog;
import appeng.core.localization.GuiText;
import appeng.core.sync.GuiBridge;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketConfigButton;
import appeng.core.sync.packets.PacketSwitchGuis;
@@ -39,7 +39,7 @@ public class StaticItemColor implements IItemColor
}
@Override
public int colorMultiplier( ItemStack stack, int tintIndex )
public int getColor( ItemStack stack, int tintIndex )
{
return this.color.getVariantByTintIndex( tintIndex );
}
@@ -19,9 +19,14 @@
package appeng.client.render;
import appeng.api.storage.data.IAEItemStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import appeng.util.IWideReadableNumberConverter;
@@ -91,52 +96,50 @@ public class TesrRenderHelper
}
//TODO, A different approach will have to be used for this from TESRs, -covers, i have ideas.
// /**
// * Render an item in 2D.
// */
// public static void renderItem2d( ItemStack itemStack, float scale )
// {
// if( !itemStack.isEmpty() )
// {
// RenderSystem.glMultiTexCoord2f( GL13.GL_TEXTURE22, 240.f, 240.0f );
//
// RenderSystem.pushMatrix();
//
// // The Z-scaling by 0.0001 causes the model to be visually "flattened"
// // This cannot replace a proper projection, but it's cheap and gives the desired
// // effect at least from head-on
// RenderSystem.scaled( scale / 32.0f, scale / 32.0f, 0.0001f );
// // Position the item icon at the top middle of the panel
// RenderSystem.translated( -8, -11, 0 );
//
// ItemRenderer renderItem = Minecraft.getInstance().getItemRenderer();
// renderItem.renderItemAndEffectIntoGUI( itemStack, 0, 0 );
//
// RenderSystem.popMatrix();
// }
// }
//
// /**
// * Render an item in 2D and the given text below it.
// *
// * @param spacing Specifies how far apart the item and the item stack amount are rendered.
// */
// public static void renderItem2dWithAmount( IAEItemStack itemStack, float itemScale, float spacing )
// {
// final ItemStack renderStack = itemStack.asItemStackRepresentation();
//
// TesrRenderHelper.renderItem2d( renderStack, itemScale );
//
// final long stackSize = itemStack.getStackSize();
// final String renderedStackSize = NUMBER_CONVERTER.toWideReadableForm( stackSize );
//
// // Render the item count
// final FontRenderer fr = Minecraft.getInstance().fontRenderer;
// final int width = fr.getStringWidth( renderedStackSize );
// RenderSystem.translated( 0.0f, spacing, 0 );
// RenderSystem.scaled( 1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f );
// RenderSystem.translated( -0.5f * width, 0.0f, 0.5f );
// fr.drawString( renderedStackSize, 0, 0, 0 );
//
// }
/**
* Render an item in 2D.
*/
public static void renderItem2d(MatrixStack matrixStack, IRenderTypeBuffer buffers, ItemStack itemStack, float scale)
{
if( !itemStack.isEmpty() )
{
// FIXME RenderSystem.glMultiTexCoord2f( GL13.GL_TEXTURE22, 240.f, 240.0f );
// FIXME RenderSystem.pushMatrix();
// FIXME // The Z-scaling by 0.0001 causes the model to be visually "flattened"
// FIXME // This cannot replace a proper projection, but it's cheap and gives the desired
// FIXME // effect at least from head-on
// FIXME RenderSystem.scaled( scale / 32.0f, scale / 32.0f, 0.0001f );
// FIXME // Position the item icon at the top middle of the panel
// FIXME RenderSystem.translated( -8, -11, 0 );
// FIXME ItemRenderer renderItem = Minecraft.getInstance().getItemRenderer();
// FIXME renderItem.renderItemAndEffectIntoGUI( itemStack, 0, 0 );
// FIXME RenderSystem.popMatrix();
}
}
/**
* Render an item in 2D and the given text below it.
*
* @param matrixStack
* @param buffers
* @param spacing Specifies how far apart the item and the item stack amount are rendered.
*/
public static void renderItem2dWithAmount(MatrixStack matrixStack, IRenderTypeBuffer buffers, IAEItemStack itemStack, float itemScale, float spacing)
{
final ItemStack renderStack = itemStack.asItemStackRepresentation();
TesrRenderHelper.renderItem2d( matrixStack, buffers, renderStack, itemScale );
final long stackSize = itemStack.getStackSize();
final String renderedStackSize = NUMBER_CONVERTER.toWideReadableForm( stackSize );
// Render the item count
final FontRenderer fr = Minecraft.getInstance().fontRenderer;
final int width = fr.getStringWidth( renderedStackSize );
matrixStack.translate( 0.0f, spacing, 0 );
matrixStack.scale( 1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f );
matrixStack.translate( -0.5f * width, 0.0f, 0.5f );
fr.drawString( renderedStackSize, 0, 0, 0 );
}
}
@@ -29,7 +29,6 @@ import java.util.Objects;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.ILightReader;
import net.minecraftforge.client.model.data.ModelProperty;
@@ -36,7 +36,7 @@ import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.util.Direction;
import net.minecraftforge.common.property.IExtendedBlockState;
import appeng.block.crafting.BlockCraftingUnit;
import appeng.block.crafting.AbstractCraftingUnitBlock;
import appeng.client.render.cablebus.CubeBuilder;
@@ -264,7 +264,7 @@ abstract class CraftingCubeBakedModel implements IBakedModel
}
IExtendedBlockState extState = (IExtendedBlockState) state;
CraftingCubeState cubeState = extState.getValue( BlockCraftingUnit.STATE );
CraftingCubeState cubeState = extState.getValue( AbstractCraftingUnitBlock.STATE );
if( cubeState == null )
{
return EnumSet.noneOf( Direction.class );
@@ -33,7 +33,7 @@ import net.minecraftforge.client.model.IModel;
import net.minecraftforge.common.model.IModelState;
import net.minecraftforge.common.model.TRSRTransformation;
import appeng.block.crafting.BlockCraftingUnit;
import appeng.block.crafting.AbstractCraftingUnitBlock;
import appeng.core.AppEng;
@@ -58,9 +58,9 @@ class CraftingCubeModel implements IModel
private final static ResourceLocation MONITOR_LIGHT_MEDIUM = texture( "monitor_light_medium" );
private final static ResourceLocation MONITOR_LIGHT_BRIGHT = texture( "monitor_light_bright" );
private final BlockCraftingUnit.CraftingUnitType type;
private final AbstractCraftingUnitBlock.CraftingUnitType type;
CraftingCubeModel( BlockCraftingUnit.CraftingUnitType type )
CraftingCubeModel( AbstractCraftingUnitBlock.CraftingUnitType type )
{
this.type = type;
}
@@ -106,7 +106,7 @@ class CraftingCubeModel implements IModel
}
}
private static TextureAtlasSprite getLightTexture( Function<ResourceLocation, TextureAtlasSprite> textureGetter, BlockCraftingUnit.CraftingUnitType type )
private static TextureAtlasSprite getLightTexture( Function<ResourceLocation, TextureAtlasSprite> textureGetter, AbstractCraftingUnitBlock.CraftingUnitType type )
{
switch( type )
{
@@ -19,21 +19,15 @@
package appeng.client.render.crafting;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.block.crafting.BlockCraftingUnit;
import appeng.block.crafting.AbstractCraftingUnitBlock;
import appeng.bootstrap.BlockRenderingCustomizer;
import appeng.bootstrap.IBlockRendering;
import appeng.bootstrap.IItemRendering;
import appeng.core.AppEng;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
/**
@@ -44,9 +38,9 @@ public class CraftingCubeRendering extends BlockRenderingCustomizer
private final String registryName;
private final BlockCraftingUnit.CraftingUnitType type;
private final AbstractCraftingUnitBlock.CraftingUnitType type;
public CraftingCubeRendering( String registryName, BlockCraftingUnit.CraftingUnitType type )
public CraftingCubeRendering( String registryName, AbstractCraftingUnitBlock.CraftingUnitType type )
{
this.registryName = registryName;
this.type = type;
@@ -56,48 +50,47 @@ public class CraftingCubeRendering extends BlockRenderingCustomizer
@OnlyIn( Dist.CLIENT )
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
if (type != AbstractCraftingUnitBlock.CraftingUnitType.MONITOR) {
rendering.renderType(RenderType.getCutout());
}
ResourceLocation baseName = new ResourceLocation( AppEng.MOD_ID, this.registryName );
// Disable auto-rotation
if( this.type != BlockCraftingUnit.CraftingUnitType.MONITOR )
if( this.type != AbstractCraftingUnitBlock.CraftingUnitType.MONITOR )
{
rendering.modelCustomizer( ( loc, model ) -> model );
}
// This is the standard blockstate model
ModelResourceLocation defaultModel = new ModelResourceLocation( baseName, "normal" );
// This is the built-in model
String builtInName = "models/block/crafting/" + this.registryName + "/builtin";
ModelResourceLocation builtInModelName = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, builtInName ), "normal" );
rendering.builtInModel( builtInName, new CraftingCubeModel( this.type ) );
rendering.stateMapper( block -> this.mapState( block, defaultModel, builtInModelName ) );
if( this.type == BlockCraftingUnit.CraftingUnitType.MONITOR )
{
rendering.tileEntityRenderer( new CraftingMonitorTESR() );
}
// FIXME // This is the standard blockstate model
// FIXME ModelResourceLocation defaultModel = new ModelResourceLocation( baseName, "normal" );
// FIXME
// FIXME // This is the built-in model
// FIXME String builtInName = "models/block/crafting/" + this.registryName + "/builtin";
// FIXME ModelResourceLocation builtInModelName = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, builtInName ), "normal" );
// FIXME
// FIXME rendering.builtInModel( builtInName, new CraftingCubeModel( this.type ) );
// FIXME
// FIXME rendering.stateMapper( block -> this.mapState( block, defaultModel, builtInModelName ) );
}
private Map<BlockState, ModelResourceLocation> mapState( Block block, ModelResourceLocation defaultModel, ModelResourceLocation formedModel )
{
Map<BlockState, ModelResourceLocation> result = new HashMap<>();
for( BlockState state : block.getBlockState().getValidStates() )
{
if( state.getValue( BlockCraftingUnit.FORMED ) )
{
// Always use the builtin model if the multiblock is formed
result.put( state, formedModel );
}
else
{
// Use the default model
result.put( state, defaultModel );
}
}
return result;
}
// FIXME private Map<BlockState, ModelResourceLocation> mapState( Block block, ModelResourceLocation defaultModel, ModelResourceLocation formedModel )
// FIXME {
// FIXME Map<BlockState, ModelResourceLocation> result = new HashMap<>();
// FIXME for( BlockState state : block.getBlockState().getValidStates() )
// FIXME {
// FIXME if( state.get( AbstractCraftingUnitBlock.FORMED ) )
// FIXME {
// FIXME // Always use the builtin model if the multiblock is formed
// FIXME result.put( state, formedModel );
// FIXME }
// FIXME else
// FIXME {
// FIXME // Use the default model
// FIXME result.put( state, defaultModel );
// FIXME }
// FIXME }
// FIXME return result;
// FIXME }
}
@@ -19,8 +19,10 @@
package appeng.client.render.crafting;
import net.minecraft.client.renderer.GlStateManager;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.util.Direction;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -37,27 +39,26 @@ import appeng.tile.crafting.TileCraftingMonitorTile;
public class CraftingMonitorTESR extends TileEntityRenderer<TileCraftingMonitorTile>
{
public CraftingMonitorTESR(TileEntityRendererDispatcher rendererDispatcherIn) {
super(rendererDispatcherIn);
}
@Override
public void render( TileCraftingMonitorTile te, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_ )
{
if( te == null )
{
return;
}
public void render(TileCraftingMonitorTile te, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer buffers, int combinedLight, int combinedOverlay) {
Direction facing = te.getForward();
IAEItemStack jobProgress = te.getJobProgress();
if( jobProgress != null )
{
GlStateManager.pushMatrix();
GlStateManager.translate( x + 0.5, y + 0.5, z + 0.5 );
matrixStack.push();
matrixStack.translate(0.5, 0.5, 0.5);
TesrRenderHelper.moveToFace( facing );
TesrRenderHelper.rotateToFace( facing, (byte) 0 );
TesrRenderHelper.renderItem2dWithAmount( jobProgress, 0.7f, 0.1f );
TesrRenderHelper.moveToFace( matrixStack, facing );
TesrRenderHelper.rotateToFace( matrixStack, facing, (byte) 0 );
TesrRenderHelper.renderItem2dWithAmount(matrixStack, buffers, jobProgress, 0.7f, 0.1f );
GlStateManager.popMatrix();
matrixStack.pop();
}
}
}
@@ -24,7 +24,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.util.Direction;
import appeng.block.crafting.BlockCraftingUnit;
import appeng.block.crafting.AbstractCraftingUnitBlock;
import appeng.client.render.cablebus.CubeBuilder;
@@ -52,7 +52,7 @@ class LightBakedModel extends CraftingCubeBakedModel
builder.setTexture( this.baseTexture );
builder.addCube( x1, y1, z1, x2, y2, z2 );
boolean powered = state.getValue( BlockCraftingUnit.POWERED );
boolean powered = state.get( AbstractCraftingUnitBlock.POWERED );
builder.setRenderFullBright( powered );
builder.setTexture( this.lightTexture );
builder.addCube( x1, y1, z1, x2, y2, z2 );
@@ -78,7 +78,7 @@ class MonitorBakedModel extends CraftingCubeBakedModel
// Now add the three layered light textures
AEColor color = getColor( state );
boolean powered = state.getValue( BlockCraftingMonitor.POWERED );
boolean powered = state.get( BlockCraftingMonitor.POWERED );
builder.setRenderFullBright( powered );
@@ -25,26 +25,26 @@ import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.util.AEPartLocation;
import appeng.client.render.textures.ParticleTextures;
@OnlyIn( Dist.CLIENT )
public class EnergyFx extends BreakingParticle
{
private final TextureAtlasSprite particleTextureIndex;
// FIXME private final TextureAtlasSprite particleTextureIndex;
private final int startBlkX;
private final int startBlkY;
private final int startBlkZ;
public EnergyFx( final World par1World, final double par2, final double par4, final double par6, final Item par8Item )
public EnergyFx( final World par1World, final double par2, final double par4, final double par6, final ItemStack par8Item )
{
super( par1World, par2, par4, par6, par8Item );
this.particleGravity = 0;
@@ -53,102 +53,102 @@ public class EnergyFx extends BreakingParticle
this.particleRed = 1;
this.particleAlpha = 1.4f;
this.particleScale = 3.5f;
this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
// FIXME this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
this.startBlkX = MathHelper.floor( this.getPosX() );
this.startBlkY = MathHelper.floor( this.getPosY() );
this.startBlkZ = MathHelper.floor( this.getPosZ() );
}
@Override
public int getFXLayer()
{
return 1;
}
@Override
public IParticleRenderType getRenderType() {
// TODO: FIXME
return IParticleRenderType.NO_RENDER;
}
@Override
public void renderParticle( final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float partialTicks, final float par3, final float par4, final float par5, final float par6, final float par7 )
{
final float f6 = this.particleTextureIndex.getMinU();
final float f7 = this.particleTextureIndex.getMaxU();
final float f8 = this.particleTextureIndex.getMinV();
final float f9 = this.particleTextureIndex.getMaxV();
final float f10 = 0.1F * this.particleScale;
final float f11 = (float) ( this.prevPosX + ( this.getPosX() - this.prevPosX ) * partialTicks - interpPosX );
final float f12 = (float) ( this.prevPosY + ( this.getPosY() - this.prevPosY ) * partialTicks - interpPosY );
final float f13 = (float) ( this.prevPosZ + ( this.getPosZ() - this.prevPosZ ) * partialTicks - interpPosZ );
final int blkX = MathHelper.floor( this.getPosX() );
final int blkY = MathHelper.floor( this.getPosY() );
final int blkZ = MathHelper.floor( this.getPosZ() );
if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
{
int i = this.getBrightnessForRender( partialTicks );
int j = i >> 16 & 65535;
int k = i & 65535;
final float f14 = 1.0F;
par1Tessellator.pos( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10 )
.tex( f7, f9 )
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
.lightmap( j, k )
.endVertex();
par1Tessellator.pos( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10 )
.tex( f7, f8 )
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
.lightmap( j, k )
.endVertex();
par1Tessellator.pos( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10 )
.tex( f6, f8 )
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
.lightmap( j, k )
.endVertex();
par1Tessellator.pos( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10 )
.tex( f6, f9 )
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
.lightmap( j, k )
.endVertex();
}
}
public void fromItem( final AEPartLocation d )
{
this.getPosX() += 0.2 * d.xOffset;
this.getPosY() += 0.2 * d.yOffset;
this.getPosZ() += 0.2 * d.zOffset;
this.particleScale *= 0.8f;
}
@Override
public void tick()
{
this.prevPosX = this.getPosX();
this.prevPosY = this.getPosY();
this.prevPosZ = this.getPosZ();
if( this.age++ >= this.maxAge )
{
this.setExpired();
}
this.motionY -= 0.04D * this.particleGravity;
this.move( this.motionX, this.motionY, this.motionZ );
this.motionX *= 0.9800000190734863D;
this.motionY *= 0.9800000190734863D;
this.motionZ *= 0.9800000190734863D;
this.particleScale *= 0.89f;
this.particleAlpha *= 0.89f;
this.startBlkX = MathHelper.floor( this.posX );
this.startBlkY = MathHelper.floor( this.posY );
this.startBlkZ = MathHelper.floor( this.posZ );
}
// FIXME @Override
// FIXME public int getFXLayer()
// FIXME {
// FIXME return 1;
// FIXME }
// FIXME
// FIXME @Override
// FIXME public IParticleRenderType getRenderType() {
// FIXME // TODO: FIXME
// FIXME return IParticleRenderType.NO_RENDER;
// FIXME }
// FIXME
// FIXME @Override
// FIXME public void renderParticle( final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float partialTicks, final float par3, final float par4, final float par5, final float par6, final float par7 )
// FIXME {
// FIXME final float f6 = this.particleTextureIndex.getMinU();
// FIXME final float f7 = this.particleTextureIndex.getMaxU();
// FIXME final float f8 = this.particleTextureIndex.getMinV();
// FIXME final float f9 = this.particleTextureIndex.getMaxV();
// FIXME final float f10 = 0.1F * this.particleScale;
// FIXME
// FIXME final float f11 = (float) ( this.prevPosX + ( this.getPosX() - this.prevPosX ) * partialTicks - interpPosX );
// FIXME final float f12 = (float) ( this.prevPosY + ( this.getPosY() - this.prevPosY ) * partialTicks - interpPosY );
// FIXME final float f13 = (float) ( this.prevPosZ + ( this.getPosZ() - this.prevPosZ ) * partialTicks - interpPosZ );
// FIXME
// FIXME final int blkX = MathHelper.floor( this.getPosX() );
// FIXME final int blkY = MathHelper.floor( this.getPosY() );
// FIXME final int blkZ = MathHelper.floor( this.getPosZ() );
// FIXME
// FIXME if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
// FIXME {
// FIXME int i = this.getBrightnessForRender( partialTicks );
// FIXME int j = i >> 16 & 65535;
// FIXME int k = i & 65535;
// FIXME
// FIXME final float f14 = 1.0F;
// FIXME par1Tessellator.pos( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10 )
// FIXME .tex( f7, f9 )
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
// FIXME .lightmap( j, k )
// FIXME .endVertex();
// FIXME par1Tessellator.pos( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10 )
// FIXME .tex( f7, f8 )
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
// FIXME .lightmap( j, k )
// FIXME .endVertex();
// FIXME par1Tessellator.pos( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10 )
// FIXME .tex( f6, f8 )
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
// FIXME .lightmap( j, k )
// FIXME .endVertex();
// FIXME par1Tessellator.pos( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10 )
// FIXME .tex( f6, f9 )
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
// FIXME .lightmap( j, k )
// FIXME .endVertex();
// FIXME }
// FIXME }
// FIXME
public void fromItem( final AEPartLocation d )
{
this.posX += 0.2 * d.xOffset;
this.posY += 0.2 * d.yOffset;
this.posZ += 0.2 * d.zOffset;
this.particleScale *= 0.8f;
}
// FIXME
// FIXME @Override
// FIXME public void tick()
// FIXME {
// FIXME this.prevPosX = this.getPosX();
// FIXME this.prevPosY = this.getPosY();
// FIXME this.prevPosZ = this.getPosZ();
// FIXME
// FIXME if( this.age++ >= this.maxAge )
// FIXME {
// FIXME this.setExpired();
// FIXME }
// FIXME
// FIXME this.motionY -= 0.04D * this.particleGravity;
// FIXME this.move( this.motionX, this.motionY, this.motionZ );
// FIXME this.motionX *= 0.9800000190734863D;
// FIXME this.motionY *= 0.9800000190734863D;
// FIXME this.motionZ *= 0.9800000190734863D;
// FIXME
// FIXME this.particleScale *= 0.89f;
// FIXME this.particleAlpha *= 0.89f;
// FIXME }
// FIXME
public void setMotionX( float motionX )
{
this.motionX = motionX;
@@ -2,18 +2,15 @@
package appeng.client.render.tesr;
import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
@@ -39,32 +36,35 @@ public final class InscriberTESR extends TileEntityRenderer<TileInscriber>
private static TextureAtlasSprite textureInside;
public InscriberTESR(TileEntityRendererDispatcher rendererDispatcherIn) {
super(rendererDispatcherIn);
}
@Override
public void render( final TileInscriber tile, final double x, final double y, final double z, final float partialTicks, final int destroyStage, final float p_render_10_ )
{
public void render(TileInscriber tile, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int combinedLight, int combinedOverlay) {
// render inscriber
GlStateManager.pushMatrix();
GlStateManager.translate( x, y, z );
GlStateManager.translate( 0.5F, 0.5F, 0.5F );
FacingToRotation.get( tile.getForward(), tile.getUp() ).push(matrixStack);
GlStateManager.translate( -0.5F, -0.5F, -0.5F );
ms.push();
ms.translate( 0.5F, 0.5F, 0.5F );
FacingToRotation.get( tile.getForward(), tile.getUp() ).push(ms);
ms.translate( -0.5F, -0.5F, -0.5F );
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
RenderSystem.disableLighting();
GlStateManager.disableRescaleNormal();
// FIXME RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
// FIXME RenderSystem.disableLighting();
// FIXME RenderSystem.disableRescaleNormal();
// render sides of stamps
Minecraft mc = Minecraft.getInstance();
mc.renderEngine.bindTexture( AtlasTexture.LOCATION_BLOCKS_TEXTURE );
// FIXME RenderingEngine.getInstance().bindTexture( AtlasTexture.LOCATION_BLOCKS_TEXTURE );
// << 20 | light << 4;
final int br = tile.getWorld().getCombinedLight( tile.getPos(), 0 );
final int var11 = br % 65536;
final int var12 = br / 65536;
// FIXME final int br = combinedLight;
// FIXME final int var11 = br % 65536;
// FIXME final int var12 = br / 65536;
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 );
// FIXME OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 );
long absoluteProgress = 0;
@@ -88,8 +88,10 @@ public final class InscriberTESR extends TileEntityRenderer<TileInscriber>
float press = 0.2f;
press -= progress / 5.0f;
final BufferBuilder buffer = Tessellator.getInstance().getBuffer();
buffer.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX );
IVertexBuilder buffer = buffers.getBuffer(RenderType.getSolid());
// final BufferBuilder buffer = Tessellator.getInstance().getBuffer();
// FIXME buffer.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX );
float middle = 0.5f;
middle += 0.02f;
@@ -128,7 +130,7 @@ public final class InscriberTESR extends TileEntityRenderer<TileInscriber>
Tessellator.getInstance().draw();
// render items.
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
// FIXME RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
IItemHandler tileInv = tile.getInternalInventory();
@@ -159,46 +161,46 @@ public final class InscriberTESR extends TileEntityRenderer<TileInscriber>
}
}
this.renderItem( is, 0.0f, tile, x, y, z );
this.renderItem( ms, is, 0.0f, buffers, combinedLight, combinedOverlay );
}
else
{
this.renderItem( tileInv.getStackInSlot( 0 ), press, tile, x, y, z );
this.renderItem( tileInv.getStackInSlot( 1 ), -press, tile, x, y, z );
this.renderItem( tileInv.getStackInSlot( 2 ), 0.0f, tile, x, y, z );
this.renderItem( ms, tileInv.getStackInSlot( 0 ), press, buffers, combinedLight, combinedOverlay );
this.renderItem( ms, tileInv.getStackInSlot( 1 ), -press, buffers, combinedLight, combinedOverlay );
this.renderItem( ms, tileInv.getStackInSlot( 2 ), 0.0f, buffers, combinedLight, combinedOverlay );
}
GlStateManager.popMatrix();
RenderSystem.enableLighting();
GlStateManager.enableRescaleNormal();
ms.pop();
// FIXME RenderSystem.enableLighting();
// FIXME GlStateManager.enableRescaleNormal();
}
private void renderItem( final ItemStack stack, final float o, final AEBaseTile tile, final double x, final double y, final double z )
private void renderItem( MatrixStack ms, final ItemStack stack, final float o, IRenderTypeBuffer buffers, int combinedLight, int combinedOverlay )
{
if( !stack.isEmpty() )
{
final ItemStack sis = stack.copy();
final ItemStack sis = stack.copy(); // FIXME WHY????
GlStateManager.pushMatrix();
ms.push();
// move to center
GlStateManager.translate( 0.5f, 0.5f + o, 0.5f );
GlStateManager.rotate( 90, 1, 0, 0 );
ms.translate( 0.5f, 0.5f + o, 0.5f );
ms.rotate( new Quaternion(90, 0, 0, true) );
// set scale
GlStateManager.scale( ITEM_RENDER_SCALE, ITEM_RENDER_SCALE, ITEM_RENDER_SCALE );
ms.scale( ITEM_RENDER_SCALE, ITEM_RENDER_SCALE, ITEM_RENDER_SCALE );
// heuristic to scale items down much further than blocks
if( !( sis.getItem() instanceof BlockItem ) )
{
GlStateManager.scale( 0.5, 0.5, 0.5 );
ms.scale( 0.5f, 0.5f, 0.5f );
}
Minecraft.getInstance().getRenderItem().renderItem( sis, ItemCameraTransforms.TransformType.FIXED );
GlStateManager.popMatrix();
Minecraft.getInstance().getItemRenderer().renderItem(sis, ItemCameraTransforms.TransformType.FIXED, combinedLight, combinedOverlay, ms, buffers);
ms.pop();
}
}
public static void registerTexture( TextureStitchEvent.Pre event )
{
textureInside = event.getMap().registerSprite( TEXTURE_INSIDE );
// FIXME textureInside = event.getMap().registerSprite( TEXTURE_INSIDE );
}
}
@@ -21,10 +21,12 @@ package appeng.container.implementations;
import java.util.Iterator;
import appeng.core.Api;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.EmptyHandler;
@@ -58,9 +60,9 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
private ItemStack prevStack = ItemStack.EMPTY;
private int lastUpgrades = 0;
public ContainerCellWorkbench( final PlayerInventory ip, final TileCellWorkbench te )
public ContainerCellWorkbench(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileCellWorkbench te )
{
super( ip, te );
super( containerType, id, ip, te );
this.workBench = te;
}
@@ -24,6 +24,7 @@ import net.minecraft.entity.player.PlayerInventory;
import appeng.container.AEBaseContainer;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.storage.TileChest;
import net.minecraft.inventory.container.ContainerType;
public class ContainerChest extends AEBaseContainer
@@ -31,9 +32,9 @@ public class ContainerChest extends AEBaseContainer
private final TileChest chest;
public ContainerChest( final PlayerInventory ip, final TileChest chest )
public ContainerChest( ContainerType<?> containerType, int id, final PlayerInventory ip, final TileChest chest )
{
super( ip, chest, null );
super( containerType, id, ip, chest, null );
this.chest = chest;
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, this.chest.getInternalInventory(), 1, 80, 37, this
@@ -20,6 +20,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.CondenserOutput;
@@ -44,9 +45,9 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv
@GuiSync( 2 )
public CondenserOutput output = CondenserOutput.TRASH;
public ContainerCondenser( final PlayerInventory ip, final TileCondenser condenser )
public ContainerCondenser(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileCondenser condenser )
{
super( ip, condenser, null );
super( containerType, id, ip, condenser, null );
this.condenser = condenser;
IItemHandler inv = condenser.getInternalInventory();
@@ -19,24 +19,6 @@
package appeng.container.implementations;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.concurrent.Future;
import javax.annotation.Nonnull;
import com.google.common.collect.ImmutableSet;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.config.SecurityPermissions;
import appeng.api.networking.IGrid;
@@ -55,15 +37,26 @@ import appeng.api.storage.data.IItemList;
import appeng.container.AEBaseContainer;
import appeng.container.guisync.GuiSync;
import appeng.core.AELog;
import appeng.core.sync.GuiBridge;
import appeng.core.Api;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketMEInventoryUpdate;
import appeng.helpers.WirelessTerminalGuiObject;
import appeng.me.helpers.PlayerSource;
import appeng.parts.reporting.PartCraftingTerminal;
import appeng.parts.reporting.PartPatternTerminal;
import appeng.parts.reporting.PartTerminal;
import appeng.util.Platform;
import com.google.common.collect.ImmutableSet;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.concurrent.Future;
public class ContainerCraftConfirm extends AEBaseContainer
@@ -89,9 +82,8 @@ public class ContainerCraftConfirm extends AEBaseContainer
@GuiSync( 7 )
public String myName = "";
public ContainerCraftConfirm( final PlayerInventory ip, final ITerminalHost te )
{
super( ip, te );
public ContainerCraftConfirm(ContainerType<?> containerType, int id, PlayerInventory ip, ITerminalHost te) {
super(containerType, id, ip, te);
}
public void cycleCpu( final boolean next )
@@ -279,7 +271,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
}
catch( final Throwable e )
{
this.getPlayerInv().player.sendMessage( new TextComponentString( "Error: " + e.toString() ) );
this.getPlayerInv().player.sendMessage( new StringTextComponent( "Error: " + e.toString() ) );
AELog.debug( e );
this.setValidContainer( false );
this.result = null;
@@ -322,28 +314,28 @@ public class ContainerCraftConfirm extends AEBaseContainer
public void startJob()
{
GuiBridge originalGui = null;
/* FIXME GuiBridge */ Object originalGui = null;
final IActionHost ah = this.getActionHost();
if( ah instanceof WirelessTerminalGuiObject )
{
originalGui = GuiBridge.GUI_WIRELESS_TERM;
}
if( ah instanceof PartTerminal )
{
originalGui = GuiBridge.GUI_ME;
}
if( ah instanceof PartCraftingTerminal )
{
originalGui = GuiBridge.GUI_CRAFTING_TERMINAL;
}
if( ah instanceof PartPatternTerminal )
{
originalGui = GuiBridge.GUI_PATTERN_TERMINAL;
}
// FIXME if( ah instanceof WirelessTerminalGuiObject )
// FIXME {
// FIXME originalGui = GuiBridge.GUI_WIRELESS_TERM;
// FIXME }
// FIXME
// FIXME if( ah instanceof PartTerminal )
// FIXME {
// FIXME originalGui = GuiBridge.GUI_ME;
// FIXME }
// FIXME
// FIXME if( ah instanceof PartCraftingTerminal )
// FIXME {
// FIXME originalGui = GuiBridge.GUI_CRAFTING_TERMINAL;
// FIXME }
// FIXME
// FIXME if( ah instanceof PartPatternTerminal )
// FIXME {
// FIXME originalGui = GuiBridge.GUI_PATTERN_TERMINAL;
// FIXME }
if( this.result != null && !this.isSimulation() )
{
@@ -354,7 +346,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
if( g != null && originalGui != null && this.getOpenContext() != null )
{
final TileEntity te = this.getOpenContext().getTile();
Platform.openGUI( this.getPlayerInventory().player, te, this.getOpenContext().getSide(), originalGui );
// FIXME Platform.openGUI( this.getPlayerInventory().player, te, this.getOpenContext().getSide(), originalGui );
}
}
}
@@ -21,12 +21,11 @@ package appeng.container.implementations;
import java.io.IOException;
import appeng.core.Api;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IContainerListener;
import appeng.api.AEApi;
import appeng.api.networking.IGrid;
import appeng.api.networking.crafting.CraftingItemList;
import appeng.api.networking.crafting.ICraftingCPU;
@@ -48,6 +47,9 @@ import appeng.me.cluster.IAEMultiBlock;
import appeng.me.cluster.implementations.CraftingCPUCluster;
import appeng.tile.crafting.TileCraftingTile;
import appeng.util.Platform;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.util.text.ITextComponent;
public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorHandlerReceiver<IAEItemStack>, ICustomNameObject
@@ -56,14 +58,14 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
private final IItemList<IAEItemStack> list = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
private IGrid network;
private CraftingCPUCluster monitor = null;
private String cpuName = null;
private ITextComponent cpuName = null;
@GuiSync( 0 )
public long eta = -1;
public ContainerCraftingCPU( final PlayerInventory ip, final Object te )
public ContainerCraftingCPU(ContainerType<?> containerType, int id, final PlayerInventory ip, final Object te )
{
super( ip, te );
super( containerType, id, ip, te );
final IActionHost host = (IActionHost) ( te instanceof IActionHost ? te : null );
if( host != null && host.getActionableNode() != null )
@@ -121,7 +123,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
else
{
this.setMonitor( null );
this.cpuName = "";
this.cpuName = null;
this.setEstimatedTime( -1 );
}
}
@@ -238,7 +240,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
}
@Override
public String getCustomInventoryName()
public ITextComponent getCustomInventoryName()
{
return this.cpuName;
}
@@ -246,7 +248,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
@Override
public boolean hasCustomInventoryName()
{
return this.cpuName != null && this.cpuName.length() > 0;
return this.cpuName != null;
}
public long getEstimatedTime()
@@ -32,6 +32,7 @@ import appeng.api.networking.crafting.ICraftingGrid;
import appeng.api.storage.ITerminalHost;
import appeng.container.guisync.GuiSync;
import appeng.util.Platform;
import net.minecraft.inventory.container.ContainerType;
public class ContainerCraftingStatus extends ContainerCraftingCPU
@@ -45,9 +46,9 @@ public class ContainerCraftingStatus extends ContainerCraftingCPU
@GuiSync( 7 )
public String myName = "";
public ContainerCraftingStatus( final PlayerInventory ip, final ITerminalHost te )
public ContainerCraftingStatus(ContainerType<?> containerType, int id, final PlayerInventory ip, final ITerminalHost te )
{
super( ip, te );
super( containerType, id, ip, te );
}
@Override
@@ -22,9 +22,11 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
@@ -47,11 +49,11 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
private final AppEngInternalInventory output = new AppEngInternalInventory( this, 1 );
private final SlotCraftingMatrix[] craftingSlots = new SlotCraftingMatrix[9];
private final SlotCraftingTerm outputSlot;
private IRecipe currentRecipe;
private IRecipe<CraftingInventory> currentRecipe;
public ContainerCraftingTerm( final PlayerInventory ip, final ITerminalHost monitorable )
public ContainerCraftingTerm(ContainerType<?> containerType, int id, final PlayerInventory ip, final ITerminalHost monitorable )
{
super( ip, monitorable, false );
super( containerType, id, ip, monitorable, false );
this.ct = (PartCraftingTerminal) monitorable;
final IItemHandler crafting = this.ct.getInventoryByName( "crafting" );
@@ -89,7 +91,8 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
if( this.currentRecipe == null || !this.currentRecipe.matches( ic, this.getPlayerInv().player.world ) )
{
this.currentRecipe = CraftingManager.findMatchingRecipe( ic, this.getPlayerInv().player.world );
World world = this.getPlayerInv().player.world;
this.currentRecipe = world.getRecipeManager().getRecipe(IRecipeType.CRAFTING, ic, world).orElse(null);
}
if( this.currentRecipe == null )
@@ -132,7 +135,7 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
return true;
}
public IRecipe getCurrentRecipe()
public IRecipe<CraftingInventory> getCurrentRecipe()
{
return this.currentRecipe;
}
@@ -24,14 +24,15 @@ import net.minecraft.entity.player.PlayerInventory;
import appeng.container.AEBaseContainer;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.storage.TileDrive;
import net.minecraft.inventory.container.ContainerType;
public class ContainerDrive extends AEBaseContainer
{
public ContainerDrive( final PlayerInventory ip, final TileDrive drive )
public ContainerDrive(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileDrive drive )
{
super( ip, drive, null );
super( containerType, id, ip, drive, null );
for( int y = 0; y < 5; y++ )
{
@@ -20,6 +20,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.FuzzyMode;
@@ -41,9 +42,9 @@ public class ContainerFormationPlane extends ContainerUpgradeable
@GuiSync( 6 )
public YesNo placeMode;
public ContainerFormationPlane( final PlayerInventory ip, final PartFormationPlane te )
public ContainerFormationPlane(ContainerType<?> containerType, int id, final PlayerInventory ip, final PartFormationPlane te )
{
super( ip, te );
super( containerType, id, ip, te );
}
@Override
@@ -20,6 +20,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.FullnessMode;
@@ -42,9 +43,9 @@ public class ContainerIOPort extends ContainerUpgradeable
@GuiSync( 3 )
public OperationMode opMode = OperationMode.EMPTY;
public ContainerIOPort( final PlayerInventory ip, final TileIOPort te )
public ContainerIOPort(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileIOPort te )
{
super( ip, te );
super( containerType, id, ip, te );
}
@Override
@@ -19,8 +19,10 @@
package appeng.container.implementations;
import appeng.core.Api;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
@@ -55,9 +57,9 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres
@GuiSync( 3 )
public int processingTime = -1;
public ContainerInscriber( final PlayerInventory ip, final TileInscriber te )
public ContainerInscriber(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileInscriber te )
{
super( ip, te );
super( containerType, id, ip, te );
this.ti = te;
IItemHandler inv = te.getInternalInventory();
@@ -31,6 +31,7 @@ import appeng.container.slot.SlotNormal;
import appeng.container.slot.SlotRestrictedInput;
import appeng.helpers.DualityInterface;
import appeng.helpers.IInterfaceHost;
import net.minecraft.inventory.container.ContainerType;
public class ContainerInterface extends ContainerUpgradeable
@@ -44,9 +45,9 @@ public class ContainerInterface extends ContainerUpgradeable
@GuiSync( 4 )
public YesNo iTermMode = YesNo.YES;
public ContainerInterface( final PlayerInventory ip, final IInterfaceHost te )
public ContainerInterface(ContainerType<?> containerType, int id, final PlayerInventory ip, final IInterfaceHost te )
{
super( ip, te.getInterfaceDuality().getHost() );
super( containerType, id, ip, te.getInterfaceDuality().getHost() );
this.myDuality = te.getInterfaceDuality();
@@ -26,6 +26,7 @@ import java.util.Map.Entry;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraftforge.items.IItemHandler;
@@ -69,9 +70,9 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
private IGrid grid;
private CompoundNBT data = new CompoundNBT();
public ContainerInterfaceTerminal( final PlayerInventory ip, final PartInterfaceTerminal anchor )
public ContainerInterfaceTerminal(ContainerType<?> containerType, int id, final PlayerInventory ip, final PartInterfaceTerminal anchor )
{
super( ip, anchor );
super( containerType, id, ip, anchor );
if( Platform.isServer() )
{
@@ -372,7 +373,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
private void addItems( final CompoundNBT data, final InvTracker inv, final int offset, final int length )
{
final String name = '=' + Long.toString( inv.which, Character.MAX_RADIX );
final CompoundNBT tag = data.getCompoundTag( name );
final CompoundNBT tag = data.getCompound( name );
if( tag.isEmpty() )
{
@@ -394,10 +395,10 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
is.write(itemNBT);
}
tag.setTag( Integer.toString( x + offset ), itemNBT );
tag.put( Integer.toString( x + offset ), itemNBT );
}
data.setTag( name, tag );
data.put( name, tag );
}
private static class InvTracker
@@ -19,9 +19,10 @@
package appeng.container.implementations;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.items.IItemHandler;
@@ -45,7 +46,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
private final PartLevelEmitter lvlEmitter;
@OnlyIn( Dist.CLIENT )
private GuiTextField textField;
private TextFieldWidget textField;
@GuiSync( 2 )
public LevelType lvType;
@GuiSync( 3 )
@@ -53,14 +54,14 @@ public class ContainerLevelEmitter extends ContainerUpgradeable
@GuiSync( 4 )
public YesNo cmType;
public ContainerLevelEmitter( final PlayerInventory ip, final PartLevelEmitter te )
public ContainerLevelEmitter( ContainerType<?> containerType, int id, final PlayerInventory ip, final PartLevelEmitter te )
{
super( ip, te );
super( containerType, id, ip, te );
this.lvlEmitter = te;
}
@OnlyIn( Dist.CLIENT )
public void setTextField( final GuiTextField level )
public void setTextField( final TextFieldWidget level )
{
this.textField = level;
this.textField.setText( String.valueOf( this.EmitterValue ) );
@@ -20,6 +20,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
@@ -46,9 +47,9 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi
@GuiSync( 4 )
public int craftProgress = 0;
public ContainerMAC( final PlayerInventory ip, final TileMolecularAssembler te )
public ContainerMAC(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileMolecularAssembler te )
{
super( ip, te );
super( containerType, id, ip, te );
this.tma = te;
}
@@ -24,10 +24,12 @@ import java.nio.BufferOverflowException;
import javax.annotation.Nonnull;
import appeng.core.Api;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -88,14 +90,18 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
private IConfigManager serverCM;
private IGridNode networkNode;
public ContainerMEMonitorable( final PlayerInventory ip, final ITerminalHost monitorable )
public ContainerMEMonitorable( ContainerType<?> containerType, int id, final PlayerInventory ip, final ITerminalHost monitorable )
{
this( ip, monitorable, true );
this( containerType, id, ip, monitorable, true );
}
protected ContainerMEMonitorable( final PlayerInventory ip, final ITerminalHost monitorable, final boolean bindInventory )
{
super( ip, monitorable instanceof TileEntity ? (TileEntity) monitorable : null, monitorable instanceof IPart ? (IPart) monitorable : null );
public ContainerMEMonitorable(ContainerType<?> containerType, int id, PlayerInventory ip, final ITerminalHost monitorable, final boolean bindInventory ) {
super( containerType,
id,
ip,
monitorable instanceof TileEntity ? (TileEntity) monitorable : null,
monitorable instanceof IPart ? (IPart) monitorable : null );
this.host = monitorable;
this.clientCM = new ConfigManager( this );
@@ -20,6 +20,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import appeng.api.config.Actionable;
@@ -37,9 +38,9 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable
private int ticks = 0;
private final int slot;
public ContainerMEPortableCell( final PlayerInventory ip, final IPortableCell monitorable )
public ContainerMEPortableCell(ContainerType<?> containerType, int id, final PlayerInventory ip, final IPortableCell monitorable )
{
super( ip, monitorable, false );
super( containerType, id, ip, monitorable, false );
if( monitorable instanceof IInventorySlotAware )
{
final int slotIndex = ( (IInventorySlotAware) monitorable ).getInventorySlot();
@@ -21,9 +21,12 @@ package appeng.container.implementations;
import java.io.IOException;
import appeng.api.parts.IPart;
import appeng.core.Api;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import appeng.api.AEApi;
@@ -43,6 +46,7 @@ import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketMEInventoryUpdate;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
import net.minecraft.tileentity.TileEntity;
public class ContainerNetworkStatus extends AEBaseContainer
@@ -59,9 +63,8 @@ public class ContainerNetworkStatus extends AEBaseContainer
private IGrid network;
private int delay = 40;
public ContainerNetworkStatus( final PlayerInventory ip, final INetworkTool te )
{
super( ip, null, null );
public ContainerNetworkStatus(ContainerType<?> containerType, int id, PlayerInventory ip, final INetworkTool te) {
super(containerType, id, ip, null, null);
final IGridHost host = te.getGridHost();
if( host != null )
@@ -20,6 +20,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
@@ -37,9 +38,9 @@ public class ContainerNetworkTool extends AEBaseContainer
@GuiSync( 1 )
public boolean facadeMode;
public ContainerNetworkTool( final PlayerInventory ip, final INetworkTool te )
public ContainerNetworkTool(ContainerType<?> containerType, int id, final PlayerInventory ip, final INetworkTool te )
{
super( ip, null, null );
super( containerType, id, ip, null, null );
this.toolInv = te;
this.lockPlayerInventorySlot( ip.currentItem );
@@ -19,28 +19,6 @@
package appeng.container.implementations;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.InventoryCraftResult;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.SlotCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
import appeng.api.config.Actionable;
import appeng.api.definitions.IDefinitions;
import appeng.api.storage.IMEMonitor;
@@ -50,12 +28,8 @@ import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.container.ContainerNull;
import appeng.container.guisync.GuiSync;
import appeng.container.slot.IOptionalSlotHost;
import appeng.container.slot.OptionalSlotFake;
import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.container.slot.SlotPatternOutputs;
import appeng.container.slot.SlotPatternTerm;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.*;
import appeng.core.Api;
import appeng.core.sync.packets.PacketPatternSlot;
import appeng.helpers.IContainerCraftingPacket;
import appeng.items.storage.ItemViewCell;
@@ -69,6 +43,28 @@ import appeng.util.inv.IAEAppEngInventory;
import appeng.util.inv.InvOperation;
import appeng.util.inv.WrapperCursorItemHandler;
import appeng.util.item.AEItemStack;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.CraftResultInventory;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.CraftingResultSlot;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEAppEngInventory, IOptionalSlotHost, IContainerCraftingPacket
@@ -83,15 +79,15 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
private final SlotRestrictedInput patternSlotIN;
private final SlotRestrictedInput patternSlotOUT;
private IRecipe currentRecipe;
private IRecipe<CraftingInventory> currentRecipe;
@GuiSync( 97 )
public boolean craftingMode = true;
@GuiSync( 96 )
public boolean substitute = false;
public ContainerPatternTerm( final PlayerInventory ip, final ITerminalHost monitorable )
public ContainerPatternTerm(ContainerType<?> type, int id, final PlayerInventory ip, final ITerminalHost monitorable )
{
super( ip, monitorable, false );
super( type, id, ip, monitorable, false );
this.patternTerminal = (PartPatternTerminal) monitorable;
final IItemHandler patternInv = this.getPatternTerminal().getInventoryByName( "pattern" );
@@ -135,20 +131,20 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
{
if( !this.isCraftingMode() )
{
this.craftSlot.xPos = -9000;
// FIXME this.craftSlot.xPos = -9000;
for( int y = 0; y < 3; y++ )
{
this.outputSlots[y].xPos = this.outputSlots[y].getX();
// FIXME this.outputSlots[y].xPos = this.outputSlots[y].getX();
}
}
else
{
this.craftSlot.xPos = this.craftSlot.getX();
// FIXME this.craftSlot.xPos = this.craftSlot.getX();
for( int y = 0; y < 3; y++ )
{
this.outputSlots[y].xPos = -9000;
// FIXME this.outputSlots[y].xPos = -9000;
}
}
}
@@ -172,7 +168,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
if( this.currentRecipe == null || !this.currentRecipe.matches( ic, world ) )
{
this.currentRecipe = CraftingManager.findMatchingRecipe( ic, world );
this.currentRecipe = world.getRecipeManager().getRecipe(IRecipeType.CRAFTING, ic, world).orElse(null);
}
final ItemStack is;
@@ -252,20 +248,20 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
for( final ItemStack i : in )
{
tagIn.appendTag( this.createItemTag( i ) );
tagIn.add( this.createItemTag( i ) );
}
for( final ItemStack i : out )
{
tagOut.appendTag( this.createItemTag( i ) );
tagOut.add( this.createItemTag( i ) );
}
encodedValue.setTag( "in", tagIn );
encodedValue.setTag( "out", tagOut );
encodedValue.put( "in", tagIn );
encodedValue.put( "out", tagOut );
encodedValue.putBoolean("crafting", this.isCraftingMode());
encodedValue.putBoolean("substitute", this.isSubstitute());
output.setTagCompound( encodedValue );
output.setTag( encodedValue );
}
private ItemStack[] getInputs()
@@ -341,7 +337,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
return isPattern;
}
private NBTBase createItemTag( final ItemStack i )
private INBT createItemTag( final ItemStack i )
{
final CompoundNBT c = new CompoundNBT();
@@ -410,7 +406,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
ic.setInventorySlotContents( x, packetPatternSlot.pattern[x] == null ? ItemStack.EMPTY : packetPatternSlot.pattern[x].createItemStack() );
}
final IRecipe r = CraftingManager.findMatchingRecipe( ic, p.world );
final IRecipe<CraftingInventory> r = p.world.getRecipeManager().getRecipe(IRecipeType.CRAFTING, ic, p.world).orElse(null);
if( r == null )
{
@@ -433,14 +429,14 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
}
}
final IRecipe rr = CraftingManager.findMatchingRecipe( real, p.world );
final IRecipe<CraftingInventory> rr = p.world.getRecipeManager().getRecipe(IRecipeType.CRAFTING, real, p.world).orElse(null);
if( rr == r && Platform.itemComparisons().isSameItem( rr.getCraftingResult( real ), is ) )
{
final InventoryCraftResult craftingResult = new InventoryCraftResult();
final CraftResultInventory craftingResult = new CraftResultInventory();
craftingResult.setRecipeUsed( rr );
final SlotCrafting sc = new SlotCrafting( p, real, craftingResult, 0, 0, 0 );
final CraftingResultSlot sc = new CraftingResultSlot( p, real, craftingResult, 0, 0, 0 );
sc.onTake( p, is );
for( int x = 0; x < real.getSizeInventory(); x++ )
@@ -504,6 +500,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
}
}
@Override
public void onSlotChange( final Slot s )
{
@@ -19,9 +19,10 @@
package appeng.container.implementations;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -40,18 +41,18 @@ public class ContainerPriority extends AEBaseContainer
private final IPriorityHost priHost;
@OnlyIn( Dist.CLIENT )
private GuiTextField textField;
private TextFieldWidget textField;
@GuiSync( 2 )
public long PriorityValue = -1;
public ContainerPriority( final PlayerInventory ip, final IPriorityHost te )
public ContainerPriority(ContainerType<?> containerType, int id, final PlayerInventory ip, final IPriorityHost te )
{
super( ip, (TileEntity) ( te instanceof TileEntity ? te : null ), (IPart) ( te instanceof IPart ? te : null ) );
super( containerType, id, ip, (TileEntity) ( te instanceof TileEntity ? te : null ), (IPart) ( te instanceof IPart ? te : null ) );
this.priHost = te;
}
@OnlyIn( Dist.CLIENT )
public void setTextField( final GuiTextField level )
public void setTextField( final TextFieldWidget level )
{
this.textField = level;
this.textField.setText( String.valueOf( this.PriorityValue ) );
@@ -24,14 +24,15 @@ import net.minecraft.entity.player.PlayerInventory;
import appeng.container.AEBaseContainer;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.qnb.TileQuantumBridge;
import net.minecraft.inventory.container.ContainerType;
public class ContainerQNB extends AEBaseContainer
{
public ContainerQNB( final PlayerInventory ip, final TileQuantumBridge quantumBridge )
public ContainerQNB(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileQuantumBridge quantumBridge )
{
super( ip, quantumBridge, null );
super( containerType, id, ip, quantumBridge, null );
this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.QE_SINGULARITY, quantumBridge
.getInternalInventory(), 0, 80, 37, this.getPlayerInventory() ) ).setStackLimit( 1 ) );
@@ -21,8 +21,10 @@ package appeng.container.implementations;
import javax.annotation.Nonnull;
import appeng.core.Api;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraftforge.common.MinecraftForge;
@@ -45,9 +47,9 @@ public class ContainerQuartzKnife extends AEBaseContainer
private final IItemHandler inSlot = new AppEngInternalInventory( null, 1, 1 );
private String myName = "";
public ContainerQuartzKnife( final PlayerInventory ip, final QuartzKnifeObj te )
public ContainerQuartzKnife(ContainerType<?> containerType, int id, final PlayerInventory ip, final QuartzKnifeObj te )
{
super( ip, null, null );
super( containerType, id, ip, null, null );
this.toolInv = te;
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.METAL_INGOTS, this.inSlot, 0, 94, 44, ip ) );
@@ -120,7 +122,7 @@ public class ContainerQuartzKnife extends AEBaseContainer
{
if( ContainerQuartzKnife.this.myName.length() > 0 )
{
return Api.INSTANCE.definitions().materials().namePress().maybeStack( 1 ).map( namePressStack ->
return Api.INSTANCE.definitions().materials().namePress().maybeStack( 1 ).map(namePressStack ->
{
final CompoundNBT compound = namePressStack.getOrCreateTag();
compound.putString("InscribeName", ContainerQuartzKnife.this.myName);
@@ -161,14 +163,11 @@ public class ContainerQuartzKnife extends AEBaseContainer
{
final ItemStack item = ContainerQuartzKnife.this.toolInv.getItemStack();
final ItemStack before = item.copy();
item.damageItem( 1, ContainerQuartzKnife.this.getPlayerInv().player );
if( item.getCount() == 0 )
{
item.damageItem( 1, ContainerQuartzKnife.this.getPlayerInv().player, p -> {
ContainerQuartzKnife.this.getPlayerInv()
.setInventorySlotContents( ContainerQuartzKnife.this.getPlayerInv().currentItem, ItemStack.EMPTY );
MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( ContainerQuartzKnife.this.getPlayerInv().player, before, null ) );
}
} );
ContainerQuartzKnife.this.detectAndSendChanges();
}
@@ -19,9 +19,11 @@
package appeng.container.implementations;
import appeng.core.Api;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.IContainerListener;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
@@ -53,9 +55,9 @@ public class ContainerSecurityStation extends ContainerMEMonitorable implements
@GuiSync( 0 )
public int permissionMode = 0;
public ContainerSecurityStation( final PlayerInventory ip, final ITerminalHost monitorable )
public ContainerSecurityStation(ContainerType<?> containerType, int id, final PlayerInventory ip, final ITerminalHost monitorable )
{
super( ip, monitorable, false );
super( containerType, id, ip, monitorable, false );
this.securityBox = (TileSecurityStation) monitorable;
@@ -33,6 +33,7 @@ import appeng.container.slot.SlotOutput;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.spatial.TileSpatialIOPort;
import appeng.util.Platform;
import net.minecraft.inventory.container.ContainerType;
public class ContainerSpatialIOPort extends AEBaseContainer
@@ -56,9 +57,9 @@ public class ContainerSpatialIOPort extends AEBaseContainer
@GuiSync( 33 )
public int zSize;
public ContainerSpatialIOPort( final PlayerInventory ip, final TileSpatialIOPort spatialIOPort )
public ContainerSpatialIOPort(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileSpatialIOPort spatialIOPort )
{
super( ip, spatialIOPort, null );
super( containerType, id, ip, spatialIOPort, null );
if( Platform.isServer() )
{
@@ -21,7 +21,9 @@ package appeng.container.implementations;
import java.util.Iterator;
import appeng.core.Api;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
@@ -56,9 +58,9 @@ public class ContainerStorageBus extends ContainerUpgradeable
@GuiSync( 4 )
public StorageFilter storageFilter = StorageFilter.EXTRACTABLE_ONLY;
public ContainerStorageBus( final PlayerInventory ip, final PartStorageBus te )
public ContainerStorageBus(ContainerType<?> containerType, int id, final PlayerInventory ip, final PartStorageBus te )
{
super( ip, te );
super( containerType, id, ip, te );
this.storageBus = te;
}
@@ -21,6 +21,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
@@ -66,9 +67,9 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
private int tbSlot;
private NetworkToolViewer tbInventory;
public ContainerUpgradeable( final PlayerInventory ip, final IUpgradeableHost te )
public ContainerUpgradeable(ContainerType<?> containerType, int id, final PlayerInventory ip, final IUpgradeableHost te )
{
super( ip, (TileEntity) ( te instanceof TileEntity ? te : null ), (IPart) ( te instanceof IPart ? te : null ) );
super( containerType, id, ip, (TileEntity) ( te instanceof TileEntity ? te : null ), (IPart) ( te instanceof IPart ? te : null ) );
this.upgradeable = te;
World w = null;
@@ -27,6 +27,7 @@ import appeng.container.interfaces.IProgressProvider;
import appeng.container.slot.SlotRestrictedInput;
import appeng.tile.misc.TileVibrationChamber;
import appeng.util.Platform;
import net.minecraft.inventory.container.ContainerType;
public class ContainerVibrationChamber extends AEBaseContainer implements IProgressProvider
@@ -37,9 +38,9 @@ public class ContainerVibrationChamber extends AEBaseContainer implements IProgr
@GuiSync( 1 )
public int remainingBurnTime = 0;
public ContainerVibrationChamber( final PlayerInventory ip, final TileVibrationChamber vibrationChamber )
public ContainerVibrationChamber(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileVibrationChamber vibrationChamber )
{
super( ip, vibrationChamber, null );
super( containerType, id, ip, vibrationChamber, null );
this.vibrationChamber = vibrationChamber;
this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.FUEL, vibrationChamber.getInternalInventory(), 0, 80, 37, this
@@ -26,6 +26,7 @@ import appeng.container.guisync.GuiSync;
import appeng.container.slot.SlotRestrictedInput;
import appeng.core.AEConfig;
import appeng.tile.networking.TileWireless;
import net.minecraft.inventory.container.ContainerType;
public class ContainerWireless extends AEBaseContainer
@@ -38,9 +39,9 @@ public class ContainerWireless extends AEBaseContainer
@GuiSync( 2 )
public long drain = 0;
public ContainerWireless( final PlayerInventory ip, final TileWireless te )
public ContainerWireless(ContainerType<?> containerType, int id, final PlayerInventory ip, final TileWireless te )
{
super( ip, te, null );
super( containerType, id, ip, te, null );
this.wirelessTerminal = te;
this.addSlot( this.boosterSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.RANGE_BOOSTER, this.wirelessTerminal
@@ -25,6 +25,7 @@ import appeng.core.AEConfig;
import appeng.core.localization.PlayerMessages;
import appeng.helpers.WirelessTerminalGuiObject;
import appeng.util.Platform;
import net.minecraft.inventory.container.ContainerType;
public class ContainerWirelessTerm extends ContainerMEPortableCell
@@ -32,9 +33,9 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell
private final WirelessTerminalGuiObject wirelessTerminalGUIObject;
public ContainerWirelessTerm( final PlayerInventory ip, final WirelessTerminalGuiObject gui )
public ContainerWirelessTerm(ContainerType<?> containerType, int id, final PlayerInventory ip, final WirelessTerminalGuiObject gui )
{
super( ip, gui );
super( containerType, id, ip, gui );
this.wirelessTerminalGUIObject = gui;
}
@@ -22,12 +22,13 @@ package appeng.container.implementations;
import javax.annotation.Nonnull;
import appeng.api.networking.crafting.ICraftingCPU;
import net.minecraft.util.text.ITextComponent;
public class CraftingCPURecord implements Comparable<CraftingCPURecord>
{
private final String myName;
private final ITextComponent myName;
private final ICraftingCPU cpu;
private final long size;
private final int processors;
@@ -56,7 +57,7 @@ public class CraftingCPURecord implements Comparable<CraftingCPURecord>
return this.cpu;
}
String getName()
ITextComponent getName()
{
return this.myName;
}
@@ -19,13 +19,11 @@
package appeng.container.interfaces;
import appeng.client.gui.widgets.GuiProgressBar;
/**
* This interface provides the data for anything simulating a progress.
*
* Its main use is in combination with the {@link GuiProgressBar}, which ensures to scale it to a percentage of 0 to
* Its main use is in combination with the {@link appeng.client.gui.widgets.GuiProgressBar}, which ensures to scale it to a percentage of 0 to
* 100.
*/
public interface IProgressProvider
@@ -28,14 +28,13 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.networking.energy.IEnergySource;
import appeng.api.networking.security.IActionSource;
@@ -161,12 +160,12 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
}
// TODO: This is really hacky and NEEDS to be solved with a full container/gui refactoring.
protected IRecipe findRecipe( CraftingInventory ic, World world )
protected IRecipe<CraftingInventory> findRecipe( CraftingInventory ic, World world )
{
if( this.container instanceof ContainerCraftingTerm )
{
final ContainerCraftingTerm containerTerminal = (ContainerCraftingTerm) this.container;
final IRecipe recipe = containerTerminal.getCurrentRecipe();
final IRecipe<CraftingInventory> recipe = containerTerminal.getCurrentRecipe();
if( recipe != null && recipe.matches( ic, world ) )
{
@@ -174,7 +173,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
}
}
return CraftingManager.findMatchingRecipe( ic, world );
return world.getRecipeManager().getRecipe( IRecipeType.CRAFTING, ic, world ).orElse(null);
}
// TODO: This is really hacky and NEEDS to be solved with a full container/gui refactoring.
@@ -184,7 +183,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
if( this.container instanceof ContainerCraftingTerm )
{
final ContainerCraftingTerm containerTerminal = (ContainerCraftingTerm) this.container;
final IRecipe recipe = containerTerminal.getCurrentRecipe();
final IRecipe<CraftingInventory> recipe = containerTerminal.getCurrentRecipe();
if( recipe != null && recipe.matches( ic, world ) )
{
@@ -192,7 +191,9 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
}
}
return CraftingManager.getRemainingItems( ic, world );
return world.getRecipeManager().getRecipe(IRecipeType.CRAFTING, ic, world)
.map(r -> r.getRemainingItems(ic))
.orElse(NonNullList.create());
}
private int capCraftingAttempts( final int maxTimesToCraft )
@@ -220,12 +221,12 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
ic.setInventorySlotContents( x, this.getPattern().getStackInSlot( x ) );
}
final IRecipe r = this.findRecipe( ic, p.world );
final IRecipe<CraftingInventory> r = this.findRecipe( ic, p.world );
if( r == null )
{
final Item target = request.getItem();
if( target.isDamageable() && target.isRepairable() )
if( target.isDamageable() && target.isRepairable(request) )
{
boolean isBad = false;
for( int x = 0; x < ic.getSizeInventory(); x++ )
@@ -21,6 +21,7 @@ package appeng.container.slot;
import java.io.IOException;
import appeng.core.Api;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
+12 -6
View File
@@ -51,6 +51,8 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import javax.annotation.Nonnull;
@Mod(AppEng.MOD_ID)
public final class AppEng
@@ -83,6 +85,7 @@ public final class AppEng
if (INSTANCE != null) {
throw new IllegalStateException();
}
INSTANCE = this;
ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, AEConfig.CLIENT_SPEC);
@@ -126,12 +129,15 @@ public final class AppEng
ModelLoaderRegistry.registerLoader(new ResourceLocation(AppEng.MOD_ID, "sky_compass"), SkyCompassModelLoader.INSTANCE);
}
// @Nonnull
// public static AppEng instance()
// {
// return INSTANCE;
// }
//
@Nonnull
public static AppEng instance()
{
if (INSTANCE == null) {
throw new IllegalStateException();
}
return INSTANCE;
}
// public Biome getStorageBiome()
// {
// return this.registration.storageBiome;
+68 -76
View File
@@ -19,20 +19,12 @@
package appeng.core;
import java.io.File;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.common.config.Property.Type;
import it.unimi.dsi.fastutil.objects.Object2IntArrayMap;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import net.minecraft.block.Block;
import net.minecraft.util.ResourceLocation;
import java.io.File;
public class FacadeConfig
@@ -72,73 +64,73 @@ public class FacadeConfig
*/
public static void init( final File configFile )
{
final Configuration configurartion = migrate( new Configuration( configFile, CONFIG_VERSION ) );
// FIXME final Configuration configurartion = migrate( new Configuration( configFile, CONFIG_VERSION ) );
// FIXME
// FIXME final boolean allowTileEntityFacades = configurartion
// FIXME .get( CONFIG_COMMON_KEY, CONFIG_COMMON_ALLOW_TILEENTITIES_KEY, false, CONFIG_COMMON_ALLOW_TILEENTITIES_COMMENT )
// FIXME .setRequiresMcRestart( true )
// FIXME .setShowInGui( false )
// FIXME .getBoolean();
// FIXME
// FIXME final Object2IntMap<ResourceLocation> configWhiteList = new Object2IntArrayMap<>();
// FIXME
// FIXME final Set<ConfigCategory> whitelist = configurartion.getCategory( CONFIG_FACADES_KEY ).getChildren();
// FIXME for( ConfigCategory configCategory : whitelist )
// FIXME {
// FIXME final String domain = configCategory.getName();
// FIXME final Map<String, Property> values = configCategory.getValues();
// FIXME
// FIXME for( Entry<String, Property> entry : values.entrySet() )
// FIXME {
// FIXME configWhiteList.put( new ResourceLocation( domain, entry.getKey() ), entry.getValue().getInt() );
// FIXME }
// FIXME }
// FIXME
// FIXME if( configurartion.hasChanged() )
// FIXME {
// FIXME configurartion.save();
// FIXME }
final boolean allowTileEntityFacades = configurartion
.get( CONFIG_COMMON_KEY, CONFIG_COMMON_ALLOW_TILEENTITIES_KEY, false, CONFIG_COMMON_ALLOW_TILEENTITIES_COMMENT )
.setRequiresMcRestart( true )
.setShowInGui( false )
.getBoolean();
final Object2IntMap<ResourceLocation> configWhiteList = new Object2IntArrayMap<>();
final Set<ConfigCategory> whitelist = configurartion.getCategory( CONFIG_FACADES_KEY ).getChildren();
for( ConfigCategory configCategory : whitelist )
{
final String domain = configCategory.getName();
final Map<String, Property> values = configCategory.getValues();
for( Entry<String, Property> entry : values.entrySet() )
{
configWhiteList.put( new ResourceLocation( domain, entry.getKey() ), entry.getValue().getInt() );
}
}
if( configurartion.hasChanged() )
{
configurartion.save();
}
instance = new FacadeConfig( allowTileEntityFacades, configWhiteList );
instance = new FacadeConfig( false, new Object2IntArrayMap<>() ); // FIXME
}
private static Configuration migrate( Configuration configurartion )
{
// Clear pre rv6 configs.
if( configurartion.getLoadedConfigVersion() == null )
{
for( String category : configurartion.getCategoryNames() )
{
final ConfigCategory c = configurartion.getCategory( category );
configurartion.removeCategory( c );
}
}
// Create general category, if missing
if( !configurartion.hasCategory( CONFIG_COMMON_KEY ) )
{
configurartion.getCategory( CONFIG_COMMON_KEY ).setComment( CONFIG_COMMON_COMMENT );
}
// Create whitelist, if missing
if( !configurartion.hasCategory( CONFIG_FACADES_KEY ) )
{
final ConfigCategory category = configurartion.getCategory( CONFIG_FACADES_KEY );
category.setComment( CONFIG_FACADES_COMMENT );
// Whitelist some vanilla blocks like glass
final ConfigCategory minecraft = new ConfigCategory( "minecraft", category );
minecraft.put( "glass", new Property( "glass", "16", Type.INTEGER ) );
minecraft.put( "stained_glass", new Property( "stained_glass", "16", Type.INTEGER ) );
// Whitelist some AE2 blocks like quartz glass
final ConfigCategory appliedenergistics = new ConfigCategory( "appliedenergistics2", category );
appliedenergistics.put( "quartz_glass", new Property( "quartz_glass", "16", Type.INTEGER ) );
appliedenergistics.put( "quartz_vibrant_glass", new Property( "quartz_vibrant_glass", "16", Type.INTEGER ) );
}
return configurartion;
}
// FIXME private static Configuration migrate( Configuration configurartion )
// FIXME {
// FIXME // Clear pre rv6 configs.
// FIXME if( configurartion.getLoadedConfigVersion() == null )
// FIXME {
// FIXME for( String category : configurartion.getCategoryNames() )
// FIXME {
// FIXME final ConfigCategory c = configurartion.getCategory( category );
// FIXME configurartion.removeCategory( c );
// FIXME }
// FIXME }
// FIXME
// FIXME // Create general category, if missing
// FIXME if( !configurartion.hasCategory( CONFIG_COMMON_KEY ) )
// FIXME {
// FIXME configurartion.getCategory( CONFIG_COMMON_KEY ).setComment( CONFIG_COMMON_COMMENT );
// FIXME }
// FIXME
// FIXME // Create whitelist, if missing
// FIXME if( !configurartion.hasCategory( CONFIG_FACADES_KEY ) )
// FIXME {
// FIXME final ConfigCategory category = configurartion.getCategory( CONFIG_FACADES_KEY );
// FIXME category.setComment( CONFIG_FACADES_COMMENT );
// FIXME
// FIXME // Whitelist some vanilla blocks like glass
// FIXME final ConfigCategory minecraft = new ConfigCategory( "minecraft", category );
// FIXME minecraft.put( "glass", new Property( "glass", "16", Type.INTEGER ) );
// FIXME minecraft.put( "stained_glass", new Property( "stained_glass", "16", Type.INTEGER ) );
// FIXME
// FIXME // Whitelist some AE2 blocks like quartz glass
// FIXME final ConfigCategory appliedenergistics = new ConfigCategory( "appliedenergistics2", category );
// FIXME appliedenergistics.put( "quartz_glass", new Property( "quartz_glass", "16", Type.INTEGER ) );
// FIXME appliedenergistics.put( "quartz_vibrant_glass", new Property( "quartz_vibrant_glass", "16", Type.INTEGER ) );
// FIXME }
// FIXME
// FIXME return configurartion;
// FIXME }
public static FacadeConfig instance()
{
@@ -22,23 +22,28 @@ package appeng.core.api.definitions;
import appeng.api.definitions.IBlockDefinition;
import appeng.api.definitions.IBlocks;
import appeng.api.definitions.ITileDefinition;
import appeng.block.crafting.*;
import appeng.block.grindstone.BlockCrank;
import appeng.block.grindstone.BlockGrinder;
import appeng.block.misc.BlockQuartzFixture;
import appeng.block.misc.BlockSkyCompass;
import appeng.block.misc.SkyCompassRendering;
import appeng.block.misc.*;
import appeng.block.spatial.BlockMatrixFrame;
import appeng.block.storage.BlockSkyChest;
import appeng.bootstrap.*;
import appeng.bootstrap.definitions.TileEntityDefinition;
import appeng.client.render.crafting.CraftingCubeRendering;
import appeng.client.render.tesr.CrankTESR;
import appeng.client.render.tesr.SkyChestTESR;
import appeng.api.features.AEFeature;
import appeng.core.features.registries.PartModels;
import appeng.decorative.AEDecorativeBlock;
import appeng.decorative.solid.*;
import appeng.tile.crafting.TileCraftingMonitorTile;
import appeng.tile.crafting.TileCraftingStorageTile;
import appeng.tile.crafting.TileCraftingTile;
import appeng.tile.crafting.TileMolecularAssembler;
import appeng.tile.grindstone.TileCrank;
import appeng.tile.grindstone.TileGrinder;
import appeng.tile.misc.TileInscriber;
import appeng.tile.misc.TileSkyCompass;
import appeng.tile.storage.TileSkyChest;
import net.minecraft.block.Block;
@@ -50,7 +55,7 @@ import net.minecraft.client.renderer.RenderType;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.ToolType;
import static appeng.block.crafting.AbstractCraftingUnitBlock.CraftingUnitType;
import static appeng.decorative.solid.BlockSkyStone.SkystoneType;
@@ -254,11 +259,12 @@ public final class ApiBlocks implements IBlocks
})
.build() )
.build();
// this.inscriber = registry.block( "inscriber", BlockInscriber::new )
// .features( AEFeature.INSCRIBER )
// .tileEntity( registry.tileEntity("", TileInscriber.class, TileInscriber::new).build() )
// .rendering( new InscriberRendering() )
// .build();
this.inscriber = registry.block( "inscriber", () -> new BlockInscriber(Block.Properties.create(Material.IRON)) )
.features( AEFeature.INSCRIBER )
.tileEntity( registry.tileEntity("inscriber", TileInscriber.class, TileInscriber::new)
.rendering(new InscriberRendering())
.build() )
.build();
// this.wirelessAccessPoint = registry.block( "wireless_access_point", BlockWireless::new )
// .features( AEFeature.WIRELESS_ACCESS_TERMINAL )
// .tileEntity( registry.tileEntity("", TileWireless.class, TileWireless::new).build() )
@@ -299,12 +305,12 @@ public final class ApiBlocks implements IBlocks
// .build();
// this.quantumRing = registry.block( "quantum_ring", BlockQuantumRing::new )
// .features( AEFeature.QUANTUM_NETWORK_BRIDGE )
// .tileEntity( new TileEntityDefinition( TileQuantumBridge.class, "quantum_ring" ) )
// .tileEntity( registry.tileEntity( TileQuantumBridge.class, "quantum_ring" ) )
// .rendering( new QuantumBridgeRendering() )
// .build();
// this.quantumLink = registry.block( "quantum_link", BlockQuantumLinkChamber::new )
// .features( AEFeature.QUANTUM_NETWORK_BRIDGE )
// .tileEntity( new TileEntityDefinition( TileQuantumBridge.class, "quantum_ring" ) )
// .tileEntity( registry.tileEntity( TileQuantumBridge.class, "quantum_ring" ) )
// .rendering( new QuantumBridgeRendering() )
// .build();
// this.spatialPylon = registry.block( "spatial_pylon", BlockSpatialPylon::new )
@@ -384,51 +390,74 @@ public final class ApiBlocks implements IBlocks
// .tileEntity( registry.tileEntity("", TileCreativeEnergyCell.class, TileCreativeEnergyCell::new).build() )
// .build();
//
// FeatureFactory crafting = registry.features( AEFeature.CRAFTING_CPU );
// this.craftingUnit = crafting.block( "crafting_unit", () -> new BlockCraftingUnit( CraftingUnitType.UNIT ) )
// .rendering( new CraftingCubeRendering( "crafting_unit", CraftingUnitType.UNIT ) )
// .tileEntity( new TileEntityDefinition( TileCraftingTile.class, "crafting_unit" ) )
// .useCustomItemModel()
// .build();
// this.craftingAccelerator = crafting.block( "crafting_accelerator", () -> new BlockCraftingUnit( CraftingUnitType.ACCELERATOR ) )
// .rendering( new CraftingCubeRendering( "crafting_accelerator", CraftingUnitType.ACCELERATOR ) )
// .tileEntity( new TileEntityDefinition( TileCraftingTile.class, "crafting_unit" ) )
// .useCustomItemModel()
// .build();
// this.craftingStorage1k = crafting.block( "crafting_storage_1k", () -> new BlockCraftingStorage( CraftingUnitType.STORAGE_1K ) )
// .item( ItemCraftingStorage::new )
// .tileEntity( new TileEntityDefinition( TileCraftingStorageTile.class, "crafting_storage" ) )
// .rendering( new CraftingCubeRendering( "crafting_storage_1k", CraftingUnitType.STORAGE_1K ) )
// .useCustomItemModel()
// .build();
// this.craftingStorage4k = crafting.block( "crafting_storage_4k", () -> new BlockCraftingStorage( CraftingUnitType.STORAGE_4K ) )
// .item( ItemCraftingStorage::new )
// .tileEntity( new TileEntityDefinition( TileCraftingStorageTile.class, "crafting_storage" ) )
// .rendering( new CraftingCubeRendering( "crafting_storage_4k", CraftingUnitType.STORAGE_4K ) )
// .useCustomItemModel()
// .build();
// this.craftingStorage16k = crafting.block( "crafting_storage_16k", () -> new BlockCraftingStorage( CraftingUnitType.STORAGE_16K ) )
// .item( ItemCraftingStorage::new )
// .tileEntity( new TileEntityDefinition( TileCraftingStorageTile.class, "crafting_storage" ) )
// .rendering( new CraftingCubeRendering( "crafting_storage_16k", CraftingUnitType.STORAGE_16K ) )
// .useCustomItemModel()
// .build();
// this.craftingStorage64k = crafting.block( "crafting_storage_64k", () -> new BlockCraftingStorage( CraftingUnitType.STORAGE_64K ) )
// .item( ItemCraftingStorage::new )
// .tileEntity( new TileEntityDefinition( TileCraftingStorageTile.class, "crafting_storage" ) )
// .rendering( new CraftingCubeRendering( "crafting_storage_64k", CraftingUnitType.STORAGE_64K ) )
// .useCustomItemModel()
// .build();
// this.craftingMonitor = crafting.block( "crafting_monitor", BlockCraftingMonitor::new )
// .tileEntity( registry.tileEntity("", TileCraftingMonitorTile.class, TileCraftingMonitorTile::new).build() )
// .rendering( new CraftingCubeRendering( "crafting_monitor", CraftingUnitType.MONITOR ) )
// .useCustomItemModel()
// .build();
//
// this.molecularAssembler = registry.block( "molecular_assembler", BlockMolecularAssembler::new )
// .features( AEFeature.MOLECULAR_ASSEMBLER )
// .tileEntity( registry.tileEntity("", TileMolecularAssembler.class, TileMolecularAssembler::new).build() )
// .build();
TileEntityDefinition craftingUnit = registry.tileEntity("crafting_unit", TileCraftingTile.class, TileCraftingTile::new)
.build();
FeatureFactory crafting = registry.features( AEFeature.CRAFTING_CPU );
Block.Properties craftingBlockProps = Block.Properties.create(Material.IRON);
this.craftingUnit = crafting.block( "crafting_unit", () -> new CraftingUnitBlock( craftingBlockProps, CraftingUnitType.UNIT ) )
.rendering( new CraftingCubeRendering( "crafting_unit", CraftingUnitType.UNIT ) )
.tileEntity( craftingUnit )
.build();
this.craftingAccelerator = crafting.block( "crafting_accelerator", () -> new CraftingUnitBlock( craftingBlockProps, CraftingUnitType.ACCELERATOR ) )
.rendering( new CraftingCubeRendering( "crafting_accelerator", CraftingUnitType.ACCELERATOR ) )
.tileEntity( craftingUnit )
.build();
TileEntityDefinition craftingStorage = registry.tileEntity("crafting_storage", TileCraftingStorageTile.class, TileCraftingStorageTile::new)
.build();
this.craftingStorage1k = crafting.block( "crafting_storage_1k", () -> new BlockCraftingStorage( craftingBlockProps, CraftingUnitType.STORAGE_1K ) )
.item( ItemCraftingStorage::new )
.tileEntity(craftingStorage)
.rendering( new CraftingCubeRendering( "crafting_storage_1k", CraftingUnitType.STORAGE_1K ) )
.build();
this.craftingStorage4k = crafting.block( "crafting_storage_4k", () -> new BlockCraftingStorage( craftingBlockProps, CraftingUnitType.STORAGE_4K ) )
.item( ItemCraftingStorage::new )
.tileEntity(craftingStorage)
.rendering( new CraftingCubeRendering( "crafting_storage_4k", CraftingUnitType.STORAGE_4K ) )
.build();
this.craftingStorage16k = crafting.block( "crafting_storage_16k", () -> new BlockCraftingStorage( craftingBlockProps, CraftingUnitType.STORAGE_16K ) )
.item( ItemCraftingStorage::new )
.tileEntity(craftingStorage)
.rendering( new CraftingCubeRendering( "crafting_storage_16k", CraftingUnitType.STORAGE_16K ) )
.build();
this.craftingStorage64k = crafting.block( "crafting_storage_64k", () -> new BlockCraftingStorage( craftingBlockProps, CraftingUnitType.STORAGE_64K ) )
.item( ItemCraftingStorage::new )
.tileEntity(craftingStorage)
.rendering( new CraftingCubeRendering( "crafting_storage_64k", CraftingUnitType.STORAGE_64K ) )
.build();
this.craftingMonitor = crafting.block( "crafting_monitor", () -> new BlockCraftingMonitor(craftingBlockProps) )
.tileEntity( registry.tileEntity("", TileCraftingMonitorTile.class, TileCraftingMonitorTile::new)
.rendering(new TileEntityRenderingCustomizer<TileCraftingMonitorTile>() {
@OnlyIn(Dist.CLIENT)
@Override
public void customize(TileEntityRendering<TileCraftingMonitorTile> rendering) {
// FIXME rendering.tileEntityRenderer(CraftingMonitorTESR::new);
}
})
.build() )
.rendering( new CraftingCubeRendering( "crafting_monitor", CraftingUnitType.MONITOR ) )
.build();
this.molecularAssembler = registry.block( "molecular_assembler", () -> new BlockMolecularAssembler(Block.Properties.create(Material.IRON).notSolid()) )
.features( AEFeature.MOLECULAR_ASSEMBLER )
.rendering(new BlockRenderingCustomizer() {
@OnlyIn(Dist.CLIENT)
@Override
public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
// FIXME: This is an old comment, check if it still applies
/**
* NOTE: This is only used to determine how to render an item being held in hand.
* For determining block rendering, the method below is used (canRenderInLayer).
*/
rendering.renderType(RenderType.getCutout());
rendering.renderType(rt -> rt == RenderType.getCutout() || rt == RenderType.getTranslucent());
}
})
.tileEntity( registry.tileEntity("molecular_assembler", TileMolecularAssembler.class, TileMolecularAssembler::new).build() )
.build();
// this.lightDetector = registry.block( "light_detector", BlockLightDetector::new )
// .features( AEFeature.LIGHT_DETECTOR )
// .tileEntity( registry.tileEntity("", TileLightDetector.class, TileLightDetector::new).build() )
@@ -25,17 +25,16 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import appeng.api.features.IMatterCannonAmmoRegistry;
import appeng.recipes.ores.IOreListener;
public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmoRegistry
public class MatterCannonAmmoRegistry implements /* FIXME IOreListener, */ IMatterCannonAmmoRegistry
{
private final HashMap<ItemStack, Double> DamageModifiers = new HashMap<>();
public MatterCannonAmmoRegistry()
{
OreDictionaryHandler.INSTANCE.observe( this );
// FIXME OreDictionaryHandler.INSTANCE.observe( this );
this.registerAmmo( new ItemStack( Items.GOLD_NUGGET ), 196.96655 );
}
@@ -58,86 +57,86 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo
return 0;
}
@Override
public void oreRegistered( final String name, final ItemStack item )
{
if( !( name.startsWith( "berry" ) || name.startsWith( "nugget" ) ) )
{
return;
}
// addNugget( "Cobble", 18 ); // ?
this.considerItem( name, item, "MeatRaw", 32 );
this.considerItem( name, item, "MeatCooked", 32 );
this.considerItem( name, item, "Meat", 32 );
this.considerItem( name, item, "Chicken", 32 );
this.considerItem( name, item, "Beef", 32 );
this.considerItem( name, item, "Sheep", 32 );
this.considerItem( name, item, "Fish", 32 );
// real world...
this.considerItem( name, item, "Lithium", 6.941 );
this.considerItem( name, item, "Beryllium", 9.0122 );
this.considerItem( name, item, "Boron", 10.811 );
this.considerItem( name, item, "Carbon", 12.0107 );
this.considerItem( name, item, "Coal", 12.0107 );
this.considerItem( name, item, "Charcoal", 12.0107 );
this.considerItem( name, item, "Sodium", 22.9897 );
this.considerItem( name, item, "Magnesium", 24.305 );
this.considerItem( name, item, "Aluminum", 26.9815 );
this.considerItem( name, item, "SILICON", 28.0855 );
this.considerItem( name, item, "Phosphorus", 30.9738 );
this.considerItem( name, item, "Sulfur", 32.065 );
this.considerItem( name, item, "Potassium", 39.0983 );
this.considerItem( name, item, "Calcium", 40.078 );
this.considerItem( name, item, "Scandium", 44.9559 );
this.considerItem( name, item, "Titanium", 47.867 );
this.considerItem( name, item, "Vanadium", 50.9415 );
this.considerItem( name, item, "Manganese", 54.938 );
this.considerItem( name, item, "Iron", 55.845 );
this.considerItem( name, item, "Nickel", 58.6934 );
this.considerItem( name, item, "Cobalt", 58.9332 );
this.considerItem( name, item, "Copper", 63.546 );
this.considerItem( name, item, "Zinc", 65.39 );
this.considerItem( name, item, "Gallium", 69.723 );
this.considerItem( name, item, "Germanium", 72.64 );
this.considerItem( name, item, "Bromine", 79.904 );
this.considerItem( name, item, "Krypton", 83.8 );
this.considerItem( name, item, "Rubidium", 85.4678 );
this.considerItem( name, item, "Strontium", 87.62 );
this.considerItem( name, item, "Yttrium", 88.9059 );
this.considerItem( name, item, "Zirconiumm", 91.224 );
this.considerItem( name, item, "Niobiumm", 92.9064 );
this.considerItem( name, item, "Technetium", 98 );
this.considerItem( name, item, "Ruthenium", 101.07 );
this.considerItem( name, item, "Rhodium", 102.9055 );
this.considerItem( name, item, "Palladium", 106.42 );
this.considerItem( name, item, "Silver", 107.8682 );
this.considerItem( name, item, "Cadmium", 112.411 );
this.considerItem( name, item, "Indium", 114.818 );
this.considerItem( name, item, "Tin", 118.71 );
this.considerItem( name, item, "Antimony", 121.76 );
this.considerItem( name, item, "Iodine", 126.9045 );
this.considerItem( name, item, "Tellurium", 127.6 );
this.considerItem( name, item, "Xenon", 131.293 );
this.considerItem( name, item, "Cesium", 132.9055 );
this.considerItem( name, item, "Barium", 137.327 );
this.considerItem( name, item, "Lanthanum", 138.9055 );
this.considerItem( name, item, "Cerium", 140.116 );
this.considerItem( name, item, "Tantalum", 180.9479 );
this.considerItem( name, item, "Tungsten", 183.84 );
this.considerItem( name, item, "Osmium", 190.23 );
this.considerItem( name, item, "Iridium", 192.217 );
this.considerItem( name, item, "Platinum", 195.078 );
this.considerItem( name, item, "Lead", 207.2 );
this.considerItem( name, item, "Bismuth", 208.9804 );
this.considerItem( name, item, "Uranium", 238.0289 );
this.considerItem( name, item, "Plutonium", 244 );
// TE stuff...
this.considerItem( name, item, "Invar", ( 58.6934 + 55.845 + 55.845 ) / 3.0 );
this.considerItem( name, item, "Electrum", ( 107.8682 + 196.96655 ) / 2.0 );
}
// FIXME @Override
// FIXME public void oreRegistered( final String name, final ItemStack item )
// FIXME {
// FIXME if( !( name.startsWith( "berry" ) || name.startsWith( "nugget" ) ) )
// FIXME {
// FIXME return;
// FIXME }
// FIXME
// FIXME // addNugget( "Cobble", 18 ); // ?
// FIXME this.considerItem( name, item, "MeatRaw", 32 );
// FIXME this.considerItem( name, item, "MeatCooked", 32 );
// FIXME this.considerItem( name, item, "Meat", 32 );
// FIXME this.considerItem( name, item, "Chicken", 32 );
// FIXME this.considerItem( name, item, "Beef", 32 );
// FIXME this.considerItem( name, item, "Sheep", 32 );
// FIXME this.considerItem( name, item, "Fish", 32 );
// FIXME
// FIXME // real world...
// FIXME this.considerItem( name, item, "Lithium", 6.941 );
// FIXME this.considerItem( name, item, "Beryllium", 9.0122 );
// FIXME this.considerItem( name, item, "Boron", 10.811 );
// FIXME this.considerItem( name, item, "Carbon", 12.0107 );
// FIXME this.considerItem( name, item, "Coal", 12.0107 );
// FIXME this.considerItem( name, item, "Charcoal", 12.0107 );
// FIXME this.considerItem( name, item, "Sodium", 22.9897 );
// FIXME this.considerItem( name, item, "Magnesium", 24.305 );
// FIXME this.considerItem( name, item, "Aluminum", 26.9815 );
// FIXME this.considerItem( name, item, "SILICON", 28.0855 );
// FIXME this.considerItem( name, item, "Phosphorus", 30.9738 );
// FIXME this.considerItem( name, item, "Sulfur", 32.065 );
// FIXME this.considerItem( name, item, "Potassium", 39.0983 );
// FIXME this.considerItem( name, item, "Calcium", 40.078 );
// FIXME this.considerItem( name, item, "Scandium", 44.9559 );
// FIXME this.considerItem( name, item, "Titanium", 47.867 );
// FIXME this.considerItem( name, item, "Vanadium", 50.9415 );
// FIXME this.considerItem( name, item, "Manganese", 54.938 );
// FIXME this.considerItem( name, item, "Iron", 55.845 );
// FIXME this.considerItem( name, item, "Nickel", 58.6934 );
// FIXME this.considerItem( name, item, "Cobalt", 58.9332 );
// FIXME this.considerItem( name, item, "Copper", 63.546 );
// FIXME this.considerItem( name, item, "Zinc", 65.39 );
// FIXME this.considerItem( name, item, "Gallium", 69.723 );
// FIXME this.considerItem( name, item, "Germanium", 72.64 );
// FIXME this.considerItem( name, item, "Bromine", 79.904 );
// FIXME this.considerItem( name, item, "Krypton", 83.8 );
// FIXME this.considerItem( name, item, "Rubidium", 85.4678 );
// FIXME this.considerItem( name, item, "Strontium", 87.62 );
// FIXME this.considerItem( name, item, "Yttrium", 88.9059 );
// FIXME this.considerItem( name, item, "Zirconiumm", 91.224 );
// FIXME this.considerItem( name, item, "Niobiumm", 92.9064 );
// FIXME this.considerItem( name, item, "Technetium", 98 );
// FIXME this.considerItem( name, item, "Ruthenium", 101.07 );
// FIXME this.considerItem( name, item, "Rhodium", 102.9055 );
// FIXME this.considerItem( name, item, "Palladium", 106.42 );
// FIXME this.considerItem( name, item, "Silver", 107.8682 );
// FIXME this.considerItem( name, item, "Cadmium", 112.411 );
// FIXME this.considerItem( name, item, "Indium", 114.818 );
// FIXME this.considerItem( name, item, "Tin", 118.71 );
// FIXME this.considerItem( name, item, "Antimony", 121.76 );
// FIXME this.considerItem( name, item, "Iodine", 126.9045 );
// FIXME this.considerItem( name, item, "Tellurium", 127.6 );
// FIXME this.considerItem( name, item, "Xenon", 131.293 );
// FIXME this.considerItem( name, item, "Cesium", 132.9055 );
// FIXME this.considerItem( name, item, "Barium", 137.327 );
// FIXME this.considerItem( name, item, "Lanthanum", 138.9055 );
// FIXME this.considerItem( name, item, "Cerium", 140.116 );
// FIXME this.considerItem( name, item, "Tantalum", 180.9479 );
// FIXME this.considerItem( name, item, "Tungsten", 183.84 );
// FIXME this.considerItem( name, item, "Osmium", 190.23 );
// FIXME this.considerItem( name, item, "Iridium", 192.217 );
// FIXME this.considerItem( name, item, "Platinum", 195.078 );
// FIXME this.considerItem( name, item, "Lead", 207.2 );
// FIXME this.considerItem( name, item, "Bismuth", 208.9804 );
// FIXME this.considerItem( name, item, "Uranium", 238.0289 );
// FIXME this.considerItem( name, item, "Plutonium", 244 );
// FIXME
// FIXME // TE stuff...
// FIXME this.considerItem( name, item, "Invar", ( 58.6934 + 55.845 + 55.845 ) / 3.0 );
// FIXME this.considerItem( name, item, "Electrum", ( 107.8682 + 196.96655 ) / 2.0 );
// FIXME }
private void considerItem( final String ore, final ItemStack item, final String name, final double weight )
{
@@ -77,22 +77,22 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
this.addNewAttunement( blocks.energyCell(), TunnelType.FE_POWER );
this.addNewAttunement( blocks.energyCellCreative(), TunnelType.FE_POWER );
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 0 ), TunnelType.FE_POWER );
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 1 ), TunnelType.FE_POWER );
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 2 ), TunnelType.FE_POWER );
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 3 ), TunnelType.FE_POWER );
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 4 ), TunnelType.FE_POWER );
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 5 ), TunnelType.FE_POWER );
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 0 ), TunnelType.FE_POWER );
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 1 ), TunnelType.FE_POWER );
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 2 ), TunnelType.FE_POWER );
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 3 ), TunnelType.FE_POWER );
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 4 ), TunnelType.FE_POWER );
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_0", 5 ), TunnelType.FE_POWER );
/**
* EU tunnel items
*/
this.addNewAttunement( this.getModItem( "ic2", "cable", 0 ), TunnelType.IC2_POWER ); // Copper cable
this.addNewAttunement( this.getModItem( "ic2", "cable", 1 ), TunnelType.IC2_POWER ); // Glass fibre cable
this.addNewAttunement( this.getModItem( "ic2", "cable", 2 ), TunnelType.IC2_POWER ); // Gold cable
this.addNewAttunement( this.getModItem( "ic2", "cable", 3 ), TunnelType.IC2_POWER ); // HV cable
this.addNewAttunement( this.getModItem( "ic2", "cable", 4 ), TunnelType.IC2_POWER ); // Tin cable
// FIXME this.addNewAttunement( this.getModItem( "ic2", "cable", 0 ), TunnelType.IC2_POWER ); // Copper cable
// FIXME this.addNewAttunement( this.getModItem( "ic2", "cable", 1 ), TunnelType.IC2_POWER ); // Glass fibre cable
// FIXME this.addNewAttunement( this.getModItem( "ic2", "cable", 2 ), TunnelType.IC2_POWER ); // Gold cable
// FIXME this.addNewAttunement( this.getModItem( "ic2", "cable", 3 ), TunnelType.IC2_POWER ); // HV cable
// FIXME this.addNewAttunement( this.getModItem( "ic2", "cable", 4 ), TunnelType.IC2_POWER ); // Tin cable
/**
* attune based on most redstone base items.
@@ -119,15 +119,15 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
this.addNewAttunement( new ItemStack( Blocks.HOPPER ), TunnelType.ITEM );
this.addNewAttunement( new ItemStack( Blocks.CHEST ), TunnelType.ITEM );
this.addNewAttunement( new ItemStack( Blocks.TRAPPED_CHEST ), TunnelType.ITEM );
this.addNewAttunement( this.getModItem( "extrautilities", "extractor_base", 0 ), TunnelType.ITEM );
this.addNewAttunement( this.getModItem( "mekanism", "parttransmitter", 9 ), TunnelType.ITEM );
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 0 ), TunnelType.ITEM ); // itemduct
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 1 ), TunnelType.ITEM ); // itemduct
// (opaque)
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 2 ), TunnelType.ITEM ); // impulse
// itemduct
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 3 ), TunnelType.ITEM ); // impulse
// itemduct
// FIXME this.addNewAttunement( this.getModItem( "extrautilities", "extractor_base", 0 ), TunnelType.ITEM );
// FIXME this.addNewAttunement( this.getModItem( "mekanism", "parttransmitter", 9 ), TunnelType.ITEM );
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 0 ), TunnelType.ITEM ); // itemduct
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 1 ), TunnelType.ITEM ); // itemduct
// FIXME // (opaque)
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 2 ), TunnelType.ITEM ); // impulse
// FIXME // itemduct
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 3 ), TunnelType.ITEM ); // impulse
// FIXME // itemduct
// (opaque)
/**
@@ -137,18 +137,18 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
this.addNewAttunement( new ItemStack( Items.LAVA_BUCKET ), TunnelType.FLUID );
this.addNewAttunement( new ItemStack( Items.MILK_BUCKET ), TunnelType.FLUID );
this.addNewAttunement( new ItemStack( Items.WATER_BUCKET ), TunnelType.FLUID );
this.addNewAttunement( this.getModItem( "mekanism", "machineblock2", 11 ), TunnelType.FLUID );
this.addNewAttunement( this.getModItem( "mekanism", "parttransmitter", 4 ), TunnelType.FLUID );
this.addNewAttunement( this.getModItem( "extrautilities", "extractor_base", 6 ), TunnelType.FLUID );
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 0 ), TunnelType.FLUID ); // fluiduct
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 1 ), TunnelType.FLUID ); // fluiduct
// (opaque)
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 2 ), TunnelType.FLUID ); // fluiduct
// hardened
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 3 ), TunnelType.FLUID ); // fluiduct
// hardened
// (opaque)
// FIXME this.addNewAttunement( this.getModItem( "mekanism", "machineblock2", 11 ), TunnelType.FLUID );
// FIXME this.addNewAttunement( this.getModItem( "mekanism", "parttransmitter", 4 ), TunnelType.FLUID );
// FIXME this.addNewAttunement( this.getModItem( "extrautilities", "extractor_base", 6 ), TunnelType.FLUID );
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 0 ), TunnelType.FLUID ); // fluiduct
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 1 ), TunnelType.FLUID ); // fluiduct
// FIXME // (opaque)
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 2 ), TunnelType.FLUID ); // fluiduct
// FIXME // hardened
// FIXME this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 3 ), TunnelType.FLUID ); // fluiduct
// FIXME // hardened
// FIXME // (opaque)
// FIXME
for( final AEColor c : AEColor.values() )
{
this.addNewAttunement( parts.cableGlass().stack( c, 1 ), TunnelType.ME );
@@ -32,7 +32,7 @@ import appeng.api.features.IWirelessTermHandler;
import appeng.api.features.IWirelessTermRegistry;
import appeng.core.Api;
import appeng.core.localization.PlayerMessages;
import appeng.core.sync.GuiBridge;
import appeng.util.Platform;
@@ -112,7 +112,7 @@ public final class WirelessRegistry implements IWirelessTermRegistry
if( handler.hasPower( player, 0.5, item ) )
{
Platform.openGUI( player, null, null, GuiBridge.GUI_WIRELESS_TERM );
// FIXME Platform.openGUI( player, null, null, GuiBridge.GUI_WIRELESS_TERM );
}
else
{
@@ -16,7 +16,7 @@ import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEStack;
import appeng.api.util.AEPartLocation;
import appeng.core.Api;
import appeng.core.sync.GuiBridge;
import appeng.util.Platform;
@@ -31,6 +31,6 @@ public class BasicItemCellGuiHandler implements ICellGuiHandler
@Override
public void openChestGui( final PlayerEntity player, final IChestOrDrive chest, final ICellHandler cellHandler, final IMEInventoryHandler inv, final ItemStack is, final IStorageChannel chan )
{
Platform.openGUI( player, (TileEntity) chest, AEPartLocation.fromFacing( chest.getUp() ), GuiBridge.GUI_ME );
// FIXME Platform.openGUI( player, (TileEntity) chest, AEPartLocation.fromFacing( chest.getUp() ), GuiBridge.GUI_ME );
}
}
@@ -41,11 +41,10 @@ import appeng.api.features.IInscriberRecipe;
import appeng.api.features.IInscriberRecipeBuilder;
import appeng.core.AEConfig;
import appeng.core.AELog;
import appeng.recipes.ores.IOreListener;
import appeng.util.Platform;
public final class GrinderRecipeManager implements IGrinderRegistry, IOreListener
public final class GrinderRecipeManager implements IGrinderRegistry // FIXME, IOreListener
{
private final Map<CacheKey, IGrinderRecipe> recipes;
private final Map<ItemStack, String> ores;
@@ -84,7 +83,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
this.addIngot( "Wheat", new ItemStack( Items.WHEAT ) );
OreDictionaryHandler.INSTANCE.observe( this );
// FIXME OreDictionaryHandler.INSTANCE.observe( this );
}
@Override
@@ -162,29 +161,29 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
return this.dustToOreRatio.remove( oredictName ) != null;
}
@Override
public void oreRegistered( final String name, final ItemStack item )
{
if( !AEConfig.instance().getGrinderBlackList().contains( name ) && ( name.startsWith( "ore" ) || name.startsWith( "crystal" ) || name
.startsWith( "gem" ) || name.startsWith( "ingot" ) || name.startsWith( "dust" ) ) )
{
for( final String ore : AEConfig.instance().getGrinderOres() )
{
if( name.equals( "ore" + ore ) )
{
this.addOre( ore, item );
}
else if( name.equals( "crystal" + ore ) || name.equals( "ingot" + ore ) || name.equals( "gem" + ore ) )
{
this.addIngot( ore, item );
}
else if( name.equals( "dust" + ore ) )
{
this.addDust( ore, item );
}
}
}
}
// FIXME @Override
// FIXME public void oreRegistered( final String name, final ItemStack item )
// FIXME {
// FIXME if( !AEConfig.instance().getGrinderBlackList().contains( name ) && ( name.startsWith( "ore" ) || name.startsWith( "crystal" ) || name
// FIXME .startsWith( "gem" ) || name.startsWith( "ingot" ) || name.startsWith( "dust" ) ) )
// FIXME {
// FIXME for( final String ore : AEConfig.instance().getGrinderOres() )
// FIXME {
// FIXME if( name.equals( "ore" + ore ) )
// FIXME {
// FIXME this.addOre( ore, item );
// FIXME }
// FIXME else if( name.equals( "crystal" + ore ) || name.equals( "ingot" + ore ) || name.equals( "gem" + ore ) )
// FIXME {
// FIXME this.addIngot( ore, item );
// FIXME }
// FIXME else if( name.equals( "dust" + ore ) )
// FIXME {
// FIXME this.addDust( ore, item );
// FIXME }
// FIXME }
// FIXME }
// FIXME }
private boolean injectRecipe( final IGrinderRecipe grinderRecipe )
{
@@ -20,6 +20,8 @@ package appeng.core.localization;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
public enum GuiText
@@ -220,4 +222,8 @@ public enum GuiText
return this.root + '.' + this.toString();
}
public ITextComponent textComponent() {
return new TranslationTextComponent(getTranslationKey());
}
}

Some files were not shown because too many files have changed in this diff Show More