Compiles again.

This commit is contained in:
Sebastian Hartte
2020-06-04 19:58:58 +02:00
parent 237463dd94
commit c402390282
89 changed files with 1353 additions and 1772 deletions
@@ -19,56 +19,48 @@
package appeng.block.storage;
import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
import appeng.block.AEBaseTileBlock;
import appeng.core.localization.PlayerMessages;
import appeng.tile.storage.TileChest;
import appeng.util.Platform;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.state.EnumProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.Direction;
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.IWorld;
import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.core.localization.PlayerMessages;
import appeng.tile.storage.TileChest;
import appeng.util.Platform;
import javax.annotation.Nullable;
public class BlockChest extends AEBaseTileBlock
public class BlockChest extends AEBaseTileBlock<TileChest>
{
private final static PropertyEnum<DriveSlotState> SLOT_STATE = PropertyEnum.create( "slot_state", DriveSlotState.class );
private final static EnumProperty<DriveSlotState> SLOT_STATE = EnumProperty.create( "slot_state", DriveSlotState.class );
public BlockChest()
{
super( Material.IRON );
super( Properties.create(Material.IRON) );
this.setDefaultState( this.getDefaultState().with( SLOT_STATE, DriveSlotState.EMPTY ) );
}
@Override
protected IProperty[] getAEStates()
{
return new IProperty[] { SLOT_STATE };
protected void fillStateContainer(StateContainer.Builder builder) {
super.fillStateContainer(builder);
builder.add(SLOT_STATE);
}
@Override
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.CUTOUT;
}
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld worldIn, BlockPos pos, BlockPos facingPos) {
// FIXME Check tile-entity updated prop
@Override
public BlockState getActualState( BlockState state, IBlockReader worldIn, BlockPos pos )
{
DriveSlotState slotState = DriveSlotState.EMPTY;
TileChest te = this.getTileEntity( worldIn, pos );
@@ -86,8 +78,7 @@ public class BlockChest extends AEBaseTileBlock
}
}
return super.getActualState( state, worldIn, pos )
.with( SLOT_STATE, slotState );
return state.with( SLOT_STATE, slotState );
}
@Override
@@ -101,9 +92,9 @@ public class BlockChest extends AEBaseTileBlock
return ActionResultType.SUCCESS;
}
if( hit != tg.getUp() )
if( hit.getFace() != tg.getUp() )
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_CHEST );
// FIXME Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_CHEST );
}
else
{
@@ -19,64 +19,27 @@
package appeng.block.storage;
import javax.annotation.Nullable;
import appeng.block.AEBaseTileBlock;
import appeng.tile.storage.TileDrive;
import appeng.util.Platform;
import net.minecraft.block.material.Material;
import net.minecraft.block.BlockStateContainer;
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.BlockRenderLayer;
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 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.tile.storage.TileDrive;
import appeng.util.Platform;
import javax.annotation.Nullable;
public class BlockDrive extends AEBaseTileBlock
public class BlockDrive extends AEBaseTileBlock<TileDrive>
{
public static final UnlistedProperty<DriveSlotsState> SLOTS_STATE = new UnlistedProperty<>( "drive_slots_state", DriveSlotsState.class );
public BlockDrive()
{
super( Material.IRON );
}
@Override
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.CUTOUT;
}
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
SLOTS_STATE,
FORWARD,
UP
} );
}
@Override
public BlockState getExtendedState( BlockState state, IBlockReader world, BlockPos pos )
{
TileDrive te = this.getTileEntity( world, pos );
IExtendedBlockState extState = (IExtendedBlockState) super.getExtendedState( state, world, pos );
return extState.with( SLOTS_STATE, te == null ? DriveSlotsState.createEmpty( 10 ) : DriveSlotsState.fromChestOrDrive( te ) );
super( Properties.create(Material.IRON) );
}
@Override
@@ -92,7 +55,7 @@ public class BlockDrive extends AEBaseTileBlock
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_DRIVE );
// FIXME Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_DRIVE );
}
return ActionResultType.SUCCESS;
}
@@ -19,11 +19,12 @@
package appeng.block.storage;
import javax.annotation.Nullable;
import appeng.block.AEBaseTileBlock;
import appeng.tile.storage.TileIOPort;
import appeng.util.Platform;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType;
@@ -32,19 +33,15 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.block.AEBaseTileBlock;
import appeng.tile.storage.TileIOPort;
import appeng.util.Platform;
import javax.annotation.Nullable;
public class BlockIOPort extends AEBaseTileBlock
public class BlockIOPort extends AEBaseTileBlock<TileIOPort>
{
public BlockIOPort()
{
super( Material.IRON );
super( Properties.create(Material.IRON) );
}
@Override
@@ -70,7 +67,7 @@ public class BlockIOPort extends AEBaseTileBlock
{
if( Platform.isServer() )
{
Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_IOPORT );
// FIXME Platform.openGUI( p, tg, AEPartLocation.fromFacing(hit), GuiBridge.GUI_IOPORT );
}
return ActionResultType.SUCCESS;
}
@@ -19,15 +19,14 @@
package appeng.block.storage;
import javax.annotation.Nullable;
import appeng.block.AEBaseTileBlock;
import appeng.container.implementations.ContainerSkyChest;
import appeng.tile.storage.TileSkyChest;
import appeng.util.Platform;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.inventory.container.SimpleNamedContainerProvider;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
@@ -41,10 +40,7 @@ import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock;
import appeng.tile.storage.TileSkyChest;
import appeng.util.Platform;
import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
public class BlockSkyChest extends AEBaseTileBlock<TileSkyChest>
@@ -19,6 +19,7 @@
package appeng.block.storage;
import net.minecraft.client.renderer.RenderType;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -37,6 +38,8 @@ public class ChestRendering extends BlockRenderingCustomizer
@OnlyIn( Dist.CLIENT )
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
rendering.renderType(RenderType.getCutout());
// I checked, the ME chest doesn't keep its color in item form
itemRendering.color( new StaticItemColor( AEColor.TRANSPARENT ) );
rendering.blockColor( new ColorableTileBlockColor() );
@@ -22,7 +22,7 @@ package appeng.block.storage;
import appeng.bootstrap.BlockRenderingCustomizer;
import appeng.bootstrap.IBlockRendering;
import appeng.bootstrap.IItemRendering;
import appeng.client.render.model.DriveModel;
import net.minecraft.client.renderer.RenderType;
public class DriveRendering extends BlockRenderingCustomizer
@@ -30,6 +30,7 @@ public class DriveRendering extends BlockRenderingCustomizer
@Override
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
rendering.builtInModel( "models/block/builtin/drive", new DriveModel() );
rendering.renderType(RenderType.getCutout());
// FIXME rendering.builtInModel( "models/block/builtin/drive", new DriveModel() );
}
}