Part models

This commit is contained in:
Sebastian Hartte
2020-06-09 00:53:40 +02:00
parent 4b11b8857b
commit 97e065ea1f
154 changed files with 578 additions and 839 deletions
+17 -17
View File
@@ -39,39 +39,39 @@ import net.minecraft.item.DyeColor;
public enum AEColor public enum AEColor
{ {
WHITE( "gui.appliedenergistics2.White", "white_", DyeColor.WHITE, 0xBEBEBE, 0xDBDBDB, 0xFAFAFA ), WHITE( "gui.appliedenergistics2.White", "white", DyeColor.WHITE, 0xBEBEBE, 0xDBDBDB, 0xFAFAFA ),
ORANGE( "gui.appliedenergistics2.Orange", "orange_", DyeColor.ORANGE, 0xF99739, 0xFAAE44, 0xF4DEC3 ), ORANGE( "gui.appliedenergistics2.Orange", "orange", DyeColor.ORANGE, 0xF99739, 0xFAAE44, 0xF4DEC3 ),
MAGENTA( "gui.appliedenergistics2.Magenta", "magenta_", DyeColor.MAGENTA, 0x821E82, 0xB82AB8, 0xC598C8 ), MAGENTA( "gui.appliedenergistics2.Magenta", "magenta", DyeColor.MAGENTA, 0x821E82, 0xB82AB8, 0xC598C8 ),
LIGHT_BLUE( "gui.appliedenergistics2.LightBlue", "light_blue_", DyeColor.LIGHT_BLUE, 0x628DCB, 0x82ACE7, 0xD8F6FF ), LIGHT_BLUE( "gui.appliedenergistics2.LightBlue", "light_blue", DyeColor.LIGHT_BLUE, 0x628DCB, 0x82ACE7, 0xD8F6FF ),
YELLOW( "gui.appliedenergistics2.Yellow", "yellow_", DyeColor.YELLOW, 0xFFF7AA, 0xF8FF4A, 0xFFFFE8 ), YELLOW( "gui.appliedenergistics2.Yellow", "yellow", DyeColor.YELLOW, 0xFFF7AA, 0xF8FF4A, 0xFFFFE8 ),
LIME( "gui.appliedenergistics2.Lime", "lime_", DyeColor.LIME, 0x7CFF4A, 0xBBFF51, 0xE7F7D7 ), LIME( "gui.appliedenergistics2.Lime", "lime", DyeColor.LIME, 0x7CFF4A, 0xBBFF51, 0xE7F7D7 ),
PINK( "gui.appliedenergistics2.Pink", "pink_", DyeColor.PINK, 0xDC8DB5, 0xF8B5D7, 0xF7DEEB ), PINK( "gui.appliedenergistics2.Pink", "pink", DyeColor.PINK, 0xDC8DB5, 0xF8B5D7, 0xF7DEEB ),
GRAY( "gui.appliedenergistics2.Gray", "gray_", DyeColor.GRAY, 0x7C7C7C, 0xA0A0A0, 0xC9C9C9 ), GRAY( "gui.appliedenergistics2.Gray", "gray", DyeColor.GRAY, 0x7C7C7C, 0xA0A0A0, 0xC9C9C9 ),
LIGHT_GRAY( "gui.appliedenergistics2.LightGray", "light_gray_", DyeColor.LIGHT_GRAY, 0x9D9D9D, 0xCDCDCD, 0xEFEFEF ), LIGHT_GRAY( "gui.appliedenergistics2.LightGray", "light_gray", DyeColor.LIGHT_GRAY, 0x9D9D9D, 0xCDCDCD, 0xEFEFEF ),
CYAN( "gui.appliedenergistics2.Cyan", "cyan_", DyeColor.CYAN, 0x2F9BA5, 0x51AAC6, 0xAEDDF4 ), CYAN( "gui.appliedenergistics2.Cyan", "cyan", DyeColor.CYAN, 0x2F9BA5, 0x51AAC6, 0xAEDDF4 ),
PURPLE( "gui.appliedenergistics2.Purple", "purple_", DyeColor.PURPLE, 0x8230B2, 0xA453CE, 0xC7A3CC ), PURPLE( "gui.appliedenergistics2.Purple", "purple", DyeColor.PURPLE, 0x8230B2, 0xA453CE, 0xC7A3CC ),
BLUE( "gui.appliedenergistics2.Blue", "blue_", DyeColor.BLUE, 0x2D29A0, 0x514AFF, 0xDDE6FF ), BLUE( "gui.appliedenergistics2.Blue", "blue", DyeColor.BLUE, 0x2D29A0, 0x514AFF, 0xDDE6FF ),
BROWN( "gui.appliedenergistics2.Brown", "brown_", DyeColor.BROWN, 0x724E35, 0xB7967F, 0xE0D2C8 ), BROWN( "gui.appliedenergistics2.Brown", "brown", DyeColor.BROWN, 0x724E35, 0xB7967F, 0xE0D2C8 ),
GREEN( "gui.appliedenergistics2.Green", "green_", DyeColor.GREEN, 0x45A021, 0x60E32E, 0xE3F2E3 ), GREEN( "gui.appliedenergistics2.Green", "green", DyeColor.GREEN, 0x45A021, 0x60E32E, 0xE3F2E3 ),
RED( "gui.appliedenergistics2.Red", "red_", DyeColor.RED, 0xA50029, 0xFF003C, 0xFFE6ED ), RED( "gui.appliedenergistics2.Red", "red", DyeColor.RED, 0xA50029, 0xFF003C, 0xFFE6ED ),
BLACK( "gui.appliedenergistics2.Black", "black_", DyeColor.BLACK, 0x2B2B2B, 0x565656, 0x848484 ), BLACK( "gui.appliedenergistics2.Black", "black", DyeColor.BLACK, 0x2B2B2B, 0x565656, 0x848484 ),
TRANSPARENT( "gui.appliedenergistics2.Fluix", "", null, 0x1B2344, 0x895CA8, 0xD7BBEC ); TRANSPARENT( "gui.appliedenergistics2.Fluix", "fluix", null, 0x1B2344, 0x895CA8, 0xD7BBEC );
public static final List<AEColor> VALID_COLORS = Arrays.asList( WHITE, ORANGE, MAGENTA, LIGHT_BLUE, YELLOW, LIME, PINK, GRAY, LIGHT_GRAY, CYAN, PURPLE, public static final List<AEColor> VALID_COLORS = Arrays.asList( WHITE, ORANGE, MAGENTA, LIGHT_BLUE, YELLOW, LIME, PINK, GRAY, LIGHT_GRAY, CYAN, PURPLE,
BLUE, BROWN, GREEN, RED, BLACK ); BLUE, BROWN, GREEN, RED, BLACK );
+25 -43
View File
@@ -23,7 +23,9 @@ import java.util.List;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
import appeng.block.misc.BlockLightDetector;
import appeng.block.misc.BlockSkyCompass; import appeng.block.misc.BlockSkyCompass;
import appeng.block.networking.BlockWireless;
import appeng.me.helpers.IGridProxyable; import appeng.me.helpers.IGridProxyable;
import appeng.tile.AEBaseTile; import appeng.tile.AEBaseTile;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@@ -89,19 +91,19 @@ public class AEBaseBlockItem extends BlockItem
if( this.blockType instanceof AEBaseTileBlock ) if( this.blockType instanceof AEBaseTileBlock )
{ {
// FIXME if( this.blockType instanceof BlockLightDetector ) if( this.blockType instanceof BlockLightDetector)
// FIXME { {
// FIXME up = side; up = side;
// FIXME if( up == Direction.UP || up == Direction.DOWN ) if( up == Direction.UP || up == Direction.DOWN )
// FIXME { {
// FIXME forward = Direction.SOUTH; forward = Direction.SOUTH;
// FIXME } }
// FIXME else else
// FIXME { {
// FIXME forward = Direction.UP; forward = Direction.UP;
// FIXME } }
// FIXME } }
/* FIXME else */ if( /*this.blockType instanceof BlockWireless ||*/ this.blockType instanceof BlockSkyCompass) else if( this.blockType instanceof BlockWireless || this.blockType instanceof BlockSkyCompass)
{ {
forward = side; forward = side;
if( forward == Direction.UP || forward == Direction.DOWN ) if( forward == Direction.UP || forward == Direction.DOWN )
@@ -116,36 +118,16 @@ public class AEBaseBlockItem extends BlockItem
else else
{ {
up = Direction.UP; up = Direction.UP;
forward = context.getPlacementHorizontalFacing();
// FIXME: investigate placementYaw if (player != null) {
final byte rotation = (byte) ( MathHelper.floor( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 ); if (player.rotationPitch > 65) {
up = forward.getOpposite();
switch( rotation ) forward = Direction.UP;
{ } else if (player.rotationPitch < -65) {
default: up = forward.getOpposite();
case 0: forward = Direction.DOWN;
forward = Direction.SOUTH; }
break;
case 1:
forward = Direction.WEST;
break;
case 2:
forward = Direction.NORTH;
break;
case 3:
forward = Direction.EAST;
break;
}
if( player.rotationPitch > 65 )
{
up = forward.getOpposite();
forward = Direction.UP;
}
else if( player.rotationPitch < -65 )
{
up = forward.getOpposite();
forward = Direction.DOWN;
} }
} }
} }
@@ -172,7 +154,7 @@ public class AEBaseBlockItem extends BlockItem
return result; return result;
} }
if( this.blockType instanceof AEBaseTileBlock /* FIXME && !( this.blockType instanceof BlockLightDetector ) */ ) if( this.blockType instanceof AEBaseTileBlock && !( this.blockType instanceof BlockLightDetector ) )
{ {
final AEBaseTile tile = ( (AEBaseTileBlock<?>) this.blockType ).getTileEntity( context.getWorld(), context.getPos() ); final AEBaseTile tile = ( (AEBaseTileBlock<?>) this.blockType ).getTileEntity( context.getWorld(), context.getPos() );
ori = tile; ori = tile;
+26 -36
View File
@@ -19,52 +19,42 @@
package appeng.block; package appeng.block;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import appeng.block.networking.BlockCableBus;
import appeng.client.render.FacingToRotation;
import appeng.tile.networking.TileCableBus;
import appeng.tile.storage.TileSkyChest;
import com.google.common.collect.Lists;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.state.EnumProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
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.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
import net.minecraftforge.client.model.data.ModelProperty;
import net.minecraftforge.items.ItemHandlerHelper;
import appeng.api.implementations.items.IMemoryCard; import appeng.api.implementations.items.IMemoryCard;
import appeng.api.implementations.items.MemoryCardMessages; import appeng.api.implementations.items.MemoryCardMessages;
import appeng.api.implementations.tiles.IColorableTile; import appeng.api.implementations.tiles.IColorableTile;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.block.networking.BlockCableBus;
import appeng.tile.AEBaseInvTile; import appeng.tile.AEBaseInvTile;
import appeng.tile.AEBaseTile; import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus;
import appeng.tile.storage.TileSkyChest;
import appeng.util.Platform; import appeng.util.Platform;
import appeng.util.SettingsFrom; import appeng.util.SettingsFrom;
import com.google.common.collect.Lists;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType;
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 net.minecraftforge.items.ItemHandlerHelper;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;
public abstract class AEBaseTileBlock<T extends AEBaseTile> extends AEBaseBlock public abstract class AEBaseTileBlock<T extends AEBaseTile> extends AEBaseBlock
{ {
@@ -51,6 +51,7 @@ import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.DyeColor; import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.state.BooleanProperty;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResultType; import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
@@ -74,22 +75,12 @@ import java.util.List;
import java.util.Random; import java.util.Random;
public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implements IAEFacade */ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implements IAEFacade */ {
{
private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer(); private static final ICableBusContainer NULL_CABLE_BUS = new NullCableBusContainer();
private static Class<? extends AEBaseTile> noTesrTile; public BlockCableBus() {
super(Properties.create(AEGlassMaterial.INSTANCE).notSolid());
private static Class<? extends AEBaseTile> tesrTile;
public BlockCableBus()
{
super( Properties.create(AEGlassMaterial.INSTANCE).notSolid() );
// this will actually be overwritten later through setupTile and the
// combined layers
// FIXME ...uh this.setTileEntity( TileCableBus.class, TileCableBus::new );
} }
@Override @Override
@@ -98,56 +89,50 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
} }
@Override @Override
public void animateTick( final BlockState state, final World worldIn, final BlockPos pos, final Random rand ) public void animateTick(final BlockState state, final World worldIn, final BlockPos pos, final Random rand) {
{ this.cb(worldIn, pos).animateTick(worldIn, pos, rand);
this.cb( worldIn, pos ).animateTick( worldIn, pos, rand );
} }
@Override @Override
public void onNeighborChange(BlockState state, IWorldReader w, BlockPos pos, BlockPos neighbor) { public void onNeighborChange(BlockState state, IWorldReader w, BlockPos pos, BlockPos neighbor) {
this.cb( w, pos ).onNeighborChanged( w, pos, neighbor ); this.cb(w, pos).onNeighborChanged(w, pos, neighbor);
} }
@Override @Override
public int getWeakPower( final BlockState state, final IBlockReader w, final BlockPos pos, final Direction side ) public int getWeakPower(final BlockState state, final IBlockReader w, final BlockPos pos, final Direction side) {
{ return this.cb(w, pos).isProvidingWeakPower(side.getOpposite()); // TODO:
return this.cb( w, pos ).isProvidingWeakPower( side.getOpposite() ); // TODO:
// IS // IS
// OPPOSITE!? // OPPOSITE!?
} }
@Override @Override
public boolean canProvidePower( final BlockState state ) public boolean canProvidePower(final BlockState state) {
{
return true; return true;
} }
@Override @Override
public void onEntityCollision(BlockState state, World w, BlockPos pos, Entity entityIn) { public void onEntityCollision(BlockState state, World w, BlockPos pos, Entity entityIn) {
this.cb( w, pos ).onEntityCollision( entityIn ); this.cb(w, pos).onEntityCollision(entityIn);
} }
@Override @Override
public int getStrongPower( final BlockState state, final IBlockReader w, final BlockPos pos, final Direction side ) public int getStrongPower(final BlockState state, final IBlockReader w, final BlockPos pos, final Direction side) {
{ return this.cb(w, pos).isProvidingStrongPower(side.getOpposite()); // TODO:
return this.cb( w, pos ).isProvidingStrongPower( side.getOpposite() ); // TODO:
// IS // IS
// OPPOSITE!? // OPPOSITE!?
} }
@Override @Override
public int getLightValue( final BlockState state, final IBlockReader world, final BlockPos pos ) public int getLightValue(final BlockState state, final IBlockReader world, final BlockPos pos) {
{ if (state.getBlock() != this) {
if( state.getBlock() != this ) return state.getBlock().getLightValue(state, world, pos);
{
return state.getBlock().getLightValue( state, world, pos );
} }
return this.cb( world, pos ).getLightValue(); return this.cb(world, pos).getLightValue();
} }
@Override @Override
public boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, LivingEntity entity) { public boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, LivingEntity entity) {
return this.cb( world, pos ).isLadder( entity ); return this.cb(world, pos).isLadder(entity);
} }
// FIXME: This is now derived from the collision shape, and cannot be decided programatically anymore. // FIXME: This is now derived from the collision shape, and cannot be decided programatically anymore.
@@ -162,45 +147,38 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
@Override @Override
public boolean isReplaceable(BlockState state, BlockItemUseContext useContext) { public boolean isReplaceable(BlockState state, BlockItemUseContext useContext) {
// FIXME: Potentially check the fluid one too // FIXME: Potentially check the fluid one too
return super.isReplaceable(state, useContext) && this.cb( useContext.getWorld(), useContext.getPos() ).isEmpty(); return super.isReplaceable(state, useContext) && this.cb(useContext.getWorld(), useContext.getPos()).isEmpty();
} }
@Override @Override
public boolean removedByPlayer(BlockState state, World world, BlockPos pos, PlayerEntity player, boolean willHarvest, IFluidState fluid) { public boolean removedByPlayer(BlockState state, World world, BlockPos pos, PlayerEntity player, boolean willHarvest, IFluidState fluid) {
if( player.abilities.isCreativeMode ) if (player.abilities.isCreativeMode) {
{ final AEBaseTile tile = this.getTileEntity(world, pos);
final AEBaseTile tile = this.getTileEntity( world, pos ); if (tile != null) {
if( tile != null )
{
tile.disableDrops(); tile.disableDrops();
} }
// maybe ray trace? // maybe ray trace?
} }
return super.removedByPlayer( state, world, pos, player, willHarvest, fluid ); return super.removedByPlayer(state, world, pos, player, willHarvest, fluid);
} }
@Override @Override
public boolean canConnectRedstone( final BlockState state, final IBlockReader w, final BlockPos pos, Direction side ) public boolean canConnectRedstone(final BlockState state, final IBlockReader w, final BlockPos pos, Direction side) {
{ if (side == null) {
if( side == null )
{
side = Direction.UP; side = Direction.UP;
} }
return this.cb( w, pos ).canConnectRedstone( EnumSet.of( side ) ); return this.cb(w, pos).canConnectRedstone(EnumSet.of(side));
} }
@Override @Override
public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos, PlayerEntity player) { public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos, PlayerEntity player) {
final Vec3d v3 = target.getHitVec().subtract( pos.getX(), pos.getY(), pos.getZ() ); final Vec3d v3 = target.getHitVec().subtract(pos.getX(), pos.getY(), pos.getZ());
final SelectedPart sp = this.cb( world, pos ).selectPart( v3 ); final SelectedPart sp = this.cb(world, pos).selectPart(v3);
if( sp.part != null ) if (sp.part != null) {
{ return sp.part.getItemStack(PartItemStack.PICK);
return sp.part.getItemStack( PartItemStack.PICK ); } else if (sp.facade != null) {
}
else if( sp.facade != null )
{
return sp.facade.getItemStack(); return sp.facade.getItemStack();
} }
@@ -208,14 +186,12 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
} }
@Override @Override
@OnlyIn( Dist.CLIENT ) @OnlyIn(Dist.CLIENT)
public boolean addHitEffects( final BlockState state, final World world, final RayTraceResult target, final ParticleManager effectRenderer ) public boolean addHitEffects(final BlockState state, final World world, final RayTraceResult target, final ParticleManager effectRenderer) {
{
// Half the particle rate. Since we're spawning concentrated on a specific spot, // Half the particle rate. Since we're spawning concentrated on a specific spot,
// our particle effect otherwise looks too strong // our particle effect otherwise looks too strong
if( Platform.getRandom().nextBoolean() ) if (Platform.getRandom().nextBoolean()) {
{
return true; return true;
} }
@@ -224,14 +200,13 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
} }
BlockPos blockPos = new BlockPos(target.getHitVec().x, target.getHitVec().y, target.getHitVec().z); BlockPos blockPos = new BlockPos(target.getHitVec().x, target.getHitVec().y, target.getHitVec().z);
ICableBusContainer cb = this.cb( world, blockPos ); ICableBusContainer cb = this.cb(world, blockPos);
// Our built-in model has the actual baked sprites we need // Our built-in model has the actual baked sprites we need
IBakedModel model = Minecraft.getInstance().getBlockRendererDispatcher().getModelForState( this.getDefaultState() ); IBakedModel model = Minecraft.getInstance().getBlockRendererDispatcher().getModelForState(this.getDefaultState());
// We cannot add the effect if we don't have the model // We cannot add the effect if we don't have the model
if( !( model instanceof CableBusBakedModel ) ) if (!(model instanceof CableBusBakedModel)) {
{
return true; return true;
} }
@@ -240,15 +215,14 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
CableBusRenderState renderState = cb.getRenderState(); CableBusRenderState renderState = cb.getRenderState();
// Spawn a particle for one of the particle textures // Spawn a particle for one of the particle textures
TextureAtlasSprite texture = Platform.pickRandom( cableBusModel.getParticleTextures( renderState ) ); TextureAtlasSprite texture = Platform.pickRandom(cableBusModel.getParticleTextures(renderState));
if( texture != null ) if (texture != null) {
{
double x = target.getHitVec().x; double x = target.getHitVec().x;
double y = target.getHitVec().y; double y = target.getHitVec().y;
double z = target.getHitVec().z; double z = target.getHitVec().z;
// FIXME: Check how this looks, probably like shit, maybe provide parts the ability to supply particle textures??? // FIXME: Check how this looks, probably like shit, maybe provide parts the ability to supply particle textures???
effectRenderer.addEffect(new CableBusBreakingParticle(world, x, y, z, texture) effectRenderer.addEffect(new CableBusBreakingParticle(world, x, y, z, texture)
.multipleParticleScaleBy( 0.8F )); .multipleParticleScaleBy(0.8F));
} }
return true; return true;
@@ -256,14 +230,13 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
@Override @Override
public boolean addDestroyEffects(BlockState state, World world, BlockPos pos, ParticleManager effectRenderer) { public boolean addDestroyEffects(BlockState state, World world, BlockPos pos, ParticleManager effectRenderer) {
ICableBusContainer cb = this.cb( world, pos ); ICableBusContainer cb = this.cb(world, pos);
// Our built-in model has the actual baked sprites we need // Our built-in model has the actual baked sprites we need
IBakedModel model = Minecraft.getInstance().getBlockRendererDispatcher().getModelForState( this.getDefaultState() ); IBakedModel model = Minecraft.getInstance().getBlockRendererDispatcher().getModelForState(this.getDefaultState());
// We cannot add the effect if we dont have the model // We cannot add the effect if we dont have the model
if( !( model instanceof CableBusBakedModel ) ) if (!(model instanceof CableBusBakedModel)) {
{
return true; return true;
} }
@@ -271,23 +244,19 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
CableBusRenderState renderState = cb.getRenderState(); CableBusRenderState renderState = cb.getRenderState();
List<TextureAtlasSprite> textures = cableBusModel.getParticleTextures( renderState ); List<TextureAtlasSprite> textures = cableBusModel.getParticleTextures(renderState);
if( !textures.isEmpty() ) if (!textures.isEmpty()) {
{
// Shamelessly inspired by ParticleManager.addBlockDestroyEffects // Shamelessly inspired by ParticleManager.addBlockDestroyEffects
for( int j = 0; j < 4; ++j ) for (int j = 0; j < 4; ++j) {
{ for (int k = 0; k < 4; ++k) {
for( int k = 0; k < 4; ++k ) for (int l = 0; l < 4; ++l) {
{
for( int l = 0; l < 4; ++l )
{
// Randomly select one of the textures if the cable bus has more than just one possibility here // Randomly select one of the textures if the cable bus has more than just one possibility here
final TextureAtlasSprite texture = Platform.pickRandom( textures ); final TextureAtlasSprite texture = Platform.pickRandom(textures);
final double x = pos.getX() + ( j + 0.5D ) / 4.0D; final double x = pos.getX() + (j + 0.5D) / 4.0D;
final double y = pos.getY() + ( k + 0.5D ) / 4.0D; final double y = pos.getY() + (k + 0.5D) / 4.0D;
final double z = pos.getZ() + ( l + 0.5D ) / 4.0D; final double z = pos.getZ() + (l + 0.5D) / 4.0D;
// FIXME: Check how this looks, probably like shit, maybe provide parts the ability to supply particle textures??? // FIXME: Check how this looks, probably like shit, maybe provide parts the ability to supply particle textures???
Particle effect = new CableBusBreakingParticle(world, x, y, z, x - pos.getX() - 0.5D, Particle effect = new CableBusBreakingParticle(world, x, y, z, x - pos.getX() - 0.5D,
@@ -302,36 +271,30 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
} }
@Override @Override
public void neighborChanged( BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving ) public void neighborChanged(BlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) {
{ if (Platform.isServer()) {
if( Platform.isServer() ) this.cb(world, pos).onNeighborChanged(world, pos, fromPos);
{
this.cb( world, pos ).onNeighborChanged( world, pos, fromPos );
} }
} }
private ICableBusContainer cb( final IBlockReader w, final BlockPos pos ) private ICableBusContainer cb(final IBlockReader w, final BlockPos pos) {
{ final TileEntity te = w.getTileEntity(pos);
final TileEntity te = w.getTileEntity( pos );
ICableBusContainer out = null; ICableBusContainer out = null;
if( te instanceof TileCableBus ) if (te instanceof TileCableBus) {
{ out = ((TileCableBus) te).getCableBus();
out = ( (TileCableBus) te ).getCableBus();
} }
return out == null ? NULL_CABLE_BUS : out; return out == null ? NULL_CABLE_BUS : out;
} }
@Nullable @Nullable
private IFacadeContainer fc( final IBlockReader w, final BlockPos pos ) private IFacadeContainer fc(final IBlockReader w, final BlockPos pos) {
{ final TileEntity te = w.getTileEntity(pos);
final TileEntity te = w.getTileEntity( pos );
IFacadeContainer out = null; IFacadeContainer out = null;
if( te instanceof TileCableBus ) if (te instanceof TileCableBus) {
{ out = ((TileCableBus) te).getCableBus().getFacadeContainer();
out = ( (TileCableBus) te ).getCableBus().getFacadeContainer();
} }
return out; return out;
@@ -339,11 +302,9 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
@Override @Override
public void onBlockClicked(BlockState state, World worldIn, BlockPos pos, PlayerEntity player) { public void onBlockClicked(BlockState state, World worldIn, BlockPos pos, PlayerEntity player) {
if( worldIn.isRemote() ) if (worldIn.isRemote()) {
{
final RayTraceResult rtr = Minecraft.getInstance().objectMouseOver; final RayTraceResult rtr = Minecraft.getInstance().objectMouseOver;
if( rtr instanceof BlockRayTraceResult) if (rtr instanceof BlockRayTraceResult) {
{
BlockRayTraceResult brtr = (BlockRayTraceResult) rtr; BlockRayTraceResult brtr = (BlockRayTraceResult) rtr;
if (brtr.getPos().equals(pos)) { if (brtr.getPos().equals(pos)) {
final Vec3d hitVec = rtr.getHitVec().subtract(new Vec3d(pos)); final Vec3d hitVec = rtr.getHitVec().subtract(new Vec3d(pos));
@@ -358,15 +319,16 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
} }
} }
public void onBlockClickPacket( World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, Vec3d hitVec ) public void onBlockClickPacket(World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, Vec3d hitVec) {
{ this.cb(worldIn, pos).clicked(playerIn, hand, hitVec);
this.cb( worldIn, pos ).clicked( playerIn, hand, hitVec );
} }
@Override @Override
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
{ // Transform from world into block space
return this.cb( w, pos ).activate( player, hand, hit.getHitVec() ) ? ActionResultType.SUCCESS Vec3d hitVec = hit.getHitVec();
Vec3d hitInBlock = new Vec3d(hitVec.x - pos.getX(), hitVec.y - pos.getY(), hitVec.z - pos.getZ());
return this.cb(w, pos).activate(player, hand, hitInBlock) ? ActionResultType.SUCCESS
: ActionResultType.PASS; : ActionResultType.PASS;
} }
@@ -375,46 +337,20 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
return recolorBlock(world, pos, side, color, null); return recolorBlock(world, pos, side, color, null);
} }
public boolean recolorBlock(final IBlockReader world, final BlockPos pos, final Direction side, final DyeColor color, final PlayerEntity who ) public boolean recolorBlock(final IBlockReader world, final BlockPos pos, final Direction side, final DyeColor color, final PlayerEntity who) {
{ try {
try return this.cb(world, pos).recolourBlock(side, AEColor.values()[color.ordinal()], who);
{ } catch (final Throwable ignored) {
return this.cb( world, pos ).recolourBlock( side, AEColor.values()[color.ordinal()], who );
}
catch( final Throwable ignored )
{
} }
return false; return false;
} }
@Override @Override
@OnlyIn( Dist.CLIENT ) @OnlyIn(Dist.CLIENT)
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
{
// do nothing // do nothing
} }
public void setupTile()
{
noTesrTile = TileCableBus.class;
// FIXME ... uh ... this.setTileEntity( noTesrTile );
// FIXME oh no... GameRegistry.registerTileEntity( noTesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "BlockCableBus" );
if( Platform.isClient() )
{
setupTesr();
}
}
@OnlyIn( Dist.CLIENT )
private static void setupTesr()
{
tesrTile = TileCableBusTESR.class;
// FIXME oh no... GameRegistry.registerTileEntity( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus" );
// FIXME oh no... ClientRegistry.bindTileEntitySpecialRenderer( BlockCableBus.getTesrTile(), new CableBusTESR() );
}
// FIXME FACADES @Override // FIXME FACADES @Override
// FIXME FACADES public BlockState getFacadeState( IBlockReader world, BlockPos pos, Direction side ) // FIXME FACADES public BlockState getFacadeState( IBlockReader world, BlockPos pos, Direction side )
// FIXME FACADES { // FIXME FACADES {
@@ -433,16 +369,6 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
// FIXME FACADES return world.getBlockState( pos ); // FIXME FACADES return world.getBlockState( pos );
// FIXME FACADES } // FIXME FACADES }
public static Class<? extends AEBaseTile> getNoTesrTile()
{
return noTesrTile;
}
public static Class<? extends AEBaseTile> getTesrTile()
{
return tesrTile;
}
@Override @Override
public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) { public VoxelShape getShape(BlockState state, IBlockReader w, BlockPos pos, ISelectionContext context) {
@@ -478,4 +404,5 @@ public class BlockCableBus extends AEBaseTileBlock<TileCableBus> /* FIXME implem
return result; return result;
} }
} }
@@ -314,7 +314,7 @@ public class CableBusBakedModel implements IBakedModel
// If a part sub-model has no particle texture (indicated by it being the missing texture), // If a part sub-model has no particle texture (indicated by it being the missing texture),
// don't add it, so we don't get ugly missing texture break particles. // don't add it, so we don't get ugly missing texture break particles.
if( isMissingTexture(particleTexture) ) if( !isMissingTexture(particleTexture) )
{ {
result.add( particleTexture ); result.add( particleTexture );
} }
@@ -25,6 +25,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import appeng.core.AELog;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.mojang.datafixers.util.Pair; import com.mojang.datafixers.util.Pair;
@@ -76,7 +77,12 @@ public class CableBusModel implements IModelGeometry<CableBusModel>
for( ResourceLocation location : this.partModels.getModels() ) for( ResourceLocation location : this.partModels.getModels() )
{ {
result.put( location, bakery.getBakedModel( location, transformIn, spriteGetterIn ) ); IBakedModel bakedModel = bakery.getBakedModel(location, transformIn, spriteGetterIn);
if (bakedModel == null) {
AELog.warn("Failed to bake part model {}", location);
} else {
result.put(location, bakedModel);
}
} }
return result.build(); return result.build();
@@ -62,12 +62,12 @@ public class QuadRotator
CachedFormat format = CachedFormat.lookup( DefaultVertexFormats.BLOCK ); CachedFormat format = CachedFormat.lookup( DefaultVertexFormats.BLOCK );
BakedPipeline pipeline = pipelines.get(); BakedPipeline pipeline = pipelines.get();
Quad collector = collectors.get(); Quad collector = collectors.get();
pipeline.reset( format );
collector.reset( format );
QuadMatrixTransformer transformer = pipeline.getElement( "transformer", QuadMatrixTransformer.class ); QuadMatrixTransformer transformer = pipeline.getElement( "transformer", QuadMatrixTransformer.class );
for( BakedQuad quad : quads ) for( BakedQuad quad : quads )
{ {
pipeline.reset( format );
collector.reset( format );
transformer.setMatrix( rotation.getMat() ); transformer.setMatrix( rotation.getMat() );
pipeline.prepare( collector ); pipeline.prepare( collector );
quad.pipe( pipeline ); quad.pipe( pipeline );
@@ -6,6 +6,7 @@ import appeng.api.networking.IGridNode;
import appeng.api.networking.energy.IEnergyGrid; import appeng.api.networking.energy.IEnergyGrid;
import appeng.api.networking.security.IActionHost; import appeng.api.networking.security.IActionHost;
import appeng.api.networking.security.ISecurityGrid; import appeng.api.networking.security.ISecurityGrid;
import appeng.util.Platform;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.util.text.TranslationTextComponent;
@@ -20,36 +21,9 @@ abstract class AbstractContainerHelper {
protected boolean checkPermission(PlayerEntity player, Object accessInterface) { protected boolean checkPermission(PlayerEntity player, Object accessInterface) {
// FIXME: Check permissions... if (requiredPermission != null)
if (requiredPermission != null && accessInterface instanceof IActionHost)
{ {
final IGridNode gn = ( (IActionHost) accessInterface ).getActionableNode(); return Platform.checkPermissions(player, accessInterface, requiredPermission, true);
if( gn != null )
{
final IGrid g = gn.getGrid();
if( g != null )
{
final boolean requirePower = false;
if( requirePower )
{
final IEnergyGrid eg = g.getCache( IEnergyGrid.class );
if( !eg.isNetworkPowered() )
{
// FIXME trace logging?
return false;
}
}
final ISecurityGrid sg = g.getCache( ISecurityGrid.class );
if( !sg.hasPermission( player, this.requiredPermission ) )
{
player.sendMessage(new TranslationTextComponent("appliedenergistics2.permission_denied")
.applyTextStyle(TextFormatting.RED));
// FIXME trace logging?
return false;
}
}
}
} }
return true; return true;
@@ -29,8 +29,6 @@ public final class PartContainerHelper<C extends AEBaseContainer, P extends IPar
private final ContainerFactory<P, C> factory; private final ContainerFactory<P, C> factory;
private final SecurityPermissions requiredPermission;
public PartContainerHelper(ContainerFactory<P, C> factory, Class<P> partClass) { public PartContainerHelper(ContainerFactory<P, C> factory, Class<P> partClass) {
this(factory, partClass, null); this(factory, partClass, null);
} }
@@ -39,7 +37,6 @@ public final class PartContainerHelper<C extends AEBaseContainer, P extends IPar
super(requiredPermission); super(requiredPermission);
this.partClass = partClass; this.partClass = partClass;
this.factory = factory; this.factory = factory;
this.requiredPermission = requiredPermission;
} }
/** /**
@@ -88,11 +85,6 @@ public final class PartContainerHelper<C extends AEBaseContainer, P extends IPar
// FIXME: this is not right, we'd need to check the part's item stack, or custom naming interface impl // FIXME: this is not right, we'd need to check the part's item stack, or custom naming interface impl
ITextComponent title = player.world.getBlockState(locator.getBlockPos()).getBlock().getNameTextComponent(); ITextComponent title = player.world.getBlockState(locator.getBlockPos()).getBlock().getNameTextComponent();
// FIXME: Check permissions...
if (requiredPermission != null) {
throw new IllegalStateException(); // NOT YET IMPLEMENTED
}
INamedContainerProvider container = new SimpleNamedContainerProvider( INamedContainerProvider container = new SimpleNamedContainerProvider(
(wnd, p, pl) -> { (wnd, p, pl) -> {
C c = factory.create(wnd, p, actualPart); C c = factory.create(wnd, p, actualPart);
@@ -36,8 +36,6 @@ public final class PartOrTileContainerHelper<C extends AEBaseContainer, I> exten
private final ContainerFactory<C, I> factory; private final ContainerFactory<C, I> factory;
private final SecurityPermissions requiredPermission;
public PartOrTileContainerHelper(ContainerFactory<C, I> factory, Class<I> interfaceClass) { public PartOrTileContainerHelper(ContainerFactory<C, I> factory, Class<I> interfaceClass) {
this(factory, interfaceClass, null); this(factory, interfaceClass, null);
} }
@@ -46,7 +44,6 @@ public final class PartOrTileContainerHelper<C extends AEBaseContainer, I> exten
super(requiredPermission); super(requiredPermission);
this.interfaceClass = interfaceClass; this.interfaceClass = interfaceClass;
this.factory = factory; this.factory = factory;
this.requiredPermission = requiredPermission;
} }
/** /**
+2
View File
@@ -198,6 +198,8 @@ public final class AppEng
ModelLoaderRegistry.registerLoader(new ResourceLocation(AppEng.MOD_ID, "crafting_cube"), CraftingCubeModelLoader.INSTANCE); ModelLoaderRegistry.registerLoader(new ResourceLocation(AppEng.MOD_ID, "crafting_cube"), CraftingCubeModelLoader.INSTANCE);
ModelLoaderRegistry.registerLoader(new ResourceLocation(AppEng.MOD_ID, "uvlightmap"), UVLModelLoader.INSTANCE); ModelLoaderRegistry.registerLoader(new ResourceLocation(AppEng.MOD_ID, "uvlightmap"), UVLModelLoader.INSTANCE);
addBuiltInModel("cable_bus", () -> new CableBusModel((PartModels) Api.INSTANCE.registries().partModels())); addBuiltInModel("cable_bus", () -> new CableBusModel((PartModels) Api.INSTANCE.registries().partModels()));
} }
private static <T extends IModelGeometry<T>> void addBuiltInModel(String id, Supplier<T> modelFactory) { private static <T extends IModelGeometry<T>> void addBuiltInModel(String id, Supplier<T> modelFactory) {
@@ -284,6 +284,7 @@ final class Registration
PartModels partModels = (PartModels) Api.INSTANCE.registries().partModels(); PartModels partModels = (PartModels) Api.INSTANCE.registries().partModels();
partModels.getModels().forEach(ModelLoader::addSpecialModel); partModels.getModels().forEach(ModelLoader::addSpecialModel);
partModels.setInitialized(true);
} }
public void registerBlocks( RegistryEvent.Register<Block> event ) public void registerBlocks( RegistryEvent.Register<Block> event )
@@ -549,10 +549,15 @@ public final class ApiBlocks implements IBlocks
this.multiPart = registry.block( "cable_bus", BlockCableBus::new ) this.multiPart = registry.block( "cable_bus", BlockCableBus::new )
.rendering( new CableBusRendering() ) .rendering( new CableBusRendering() )
// (handled in BlockCableBus.java and its setupTile()) .tileEntity( registry.tileEntity( "cable_bus", TileCableBus.class, TileCableBus::new)
// .tileEntity( TileCableBus.class ) .rendering(new TileEntityRenderingCustomizer<TileCableBus>() {
// TODO: why the custom registration? @Override
.bootstrap( ( block, item ) -> (IInitComponent) ((BlockCableBus) block)::setupTile) @OnlyIn(Dist.CLIENT)
public void customize(TileEntityRendering<TileCableBus> rendering) {
rendering.tileEntityRenderer(CableBusTESR::new);
}
})
.build())
.build(); .build();
this.skyStoneSlab = deco.block( "sky_stone_slab", () -> new SlabBlock( SKYSTONE_PROPERTIES ) ) this.skyStoneSlab = deco.block( "sky_stone_slab", () -> new SlabBlock( SKYSTONE_PROPERTIES ) )
@@ -25,12 +25,14 @@ import appeng.api.parts.IPart;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
import appeng.api.util.AEColoredItemDefinition; import appeng.api.util.AEColoredItemDefinition;
import appeng.bootstrap.FeatureFactory; import appeng.bootstrap.FeatureFactory;
import appeng.core.AppEng;
import appeng.core.CreativeTab; import appeng.core.CreativeTab;
import appeng.core.features.*; import appeng.core.features.*;
import appeng.core.features.registries.PartModels; import appeng.core.features.registries.PartModels;
import appeng.fluids.parts.*; import appeng.fluids.parts.*;
import appeng.items.parts.ColoredPartItem; import appeng.items.parts.ColoredPartItem;
import appeng.items.parts.ItemPart; import appeng.items.parts.ItemPart;
import appeng.items.parts.ItemPartRendering;
import appeng.items.parts.PartType; import appeng.items.parts.PartType;
import appeng.parts.automation.*; import appeng.parts.automation.*;
import appeng.parts.misc.*; import appeng.parts.misc.*;
@@ -38,8 +40,12 @@ import appeng.parts.networking.*;
import appeng.parts.p2p.*; import appeng.parts.p2p.*;
import appeng.parts.reporting.*; import appeng.parts.reporting.*;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors;
/** /**
@@ -91,20 +97,12 @@ public final class ApiParts implements IParts
public ApiParts( FeatureFactory registry, PartModels partModels ) public ApiParts( FeatureFactory registry, PartModels partModels )
{ {
// IItemDefinition itemPartDef = registry.item( "part", ItemPart::new ) registerPartModels(partModels);
// .rendering( new ItemPartRendering( partModels ) )
// .build();
// Register all part models
for( PartType partType : PartType.values() )
{
partModels.registerModels( partType.getModels() );
}
this.cableSmart = constructColoredDefinition(registry, "smart_cable", PartType.CABLE_SMART, PartCableSmart::new); this.cableSmart = constructColoredDefinition(registry, "smart_cable", PartType.CABLE_SMART, PartCableSmart::new);
this.cableCovered = constructColoredDefinition(registry, "covered_cable", PartType.CABLE_COVERED, PartCableCovered::new); this.cableCovered = constructColoredDefinition(registry, "covered_cable", PartType.CABLE_COVERED, PartCableCovered::new);
this.cableGlass = constructColoredDefinition(registry, "glass_cable", PartType.CABLE_GLASS, PartCableGlass::new); this.cableGlass = constructColoredDefinition(registry, "glass_cable", PartType.CABLE_GLASS, PartCableGlass::new);
this.cableDenseCovered = constructColoredDefinition(registry, "dense_cable", PartType.CABLE_DENSE_COVERED, PartDenseCableCovered::new); this.cableDenseCovered = constructColoredDefinition(registry, "covered_dense_cable", PartType.CABLE_DENSE_COVERED, PartDenseCableCovered::new);
this.cableDenseSmart = constructColoredDefinition(registry, "smart_dense_cable", PartType.CABLE_DENSE_SMART, PartDenseCableSmart::new); this.cableDenseSmart = constructColoredDefinition(registry, "smart_dense_cable", PartType.CABLE_DENSE_SMART, PartDenseCableSmart::new);
this.quartzFiber = createPart(registry, "quartz_fiber", PartType.QUARTZ_FIBER, PartQuartzFiber::new ); this.quartzFiber = createPart(registry, "quartz_fiber", PartType.QUARTZ_FIBER, PartQuartzFiber::new );
this.toggleBus = createPart(registry, "toggle_bus", PartType.TOGGLE_BUS, PartToggleBus::new ); this.toggleBus = createPart(registry, "toggle_bus", PartType.TOGGLE_BUS, PartToggleBus::new );
@@ -122,7 +120,7 @@ public final class ApiParts implements IParts
this.levelEmitter = createPart(registry, "level_emitter", PartType.LEVEL_EMITTER, PartLevelEmitter::new ); this.levelEmitter = createPart(registry, "level_emitter", PartType.LEVEL_EMITTER, PartLevelEmitter::new );
this.fluidLevelEmitter = createPart(registry, "fluid_level_emitter", PartType.FLUID_LEVEL_EMITTER, PartFluidLevelEmitter::new ); this.fluidLevelEmitter = createPart(registry, "fluid_level_emitter", PartType.FLUID_LEVEL_EMITTER, PartFluidLevelEmitter::new );
this.annihilationPlane = createPart(registry, "annihilation_plane", PartType.ANNIHILATION_PLANE, PartAnnihilationPlane::new ); this.annihilationPlane = createPart(registry, "annihilation_plane", PartType.ANNIHILATION_PLANE, PartAnnihilationPlane::new );
this.identityAnnihilationPlane = createPart(registry, "identity_annihiliation_plane", PartType.IDENTITY_ANNIHILATION_PLANE, PartIdentityAnnihilationPlane::new ); this.identityAnnihilationPlane = createPart(registry, "identity_annihilation_plane", PartType.IDENTITY_ANNIHILATION_PLANE, PartIdentityAnnihilationPlane::new );
this.fluidAnnihilationPlane = createPart(registry, "fluid_annihilation_plane", PartType.FLUID_ANNIHILATION_PLANE, PartFluidAnnihilationPlane::new ); this.fluidAnnihilationPlane = createPart(registry, "fluid_annihilation_plane", PartType.FLUID_ANNIHILATION_PLANE, PartFluidAnnihilationPlane::new );
this.formationPlane = createPart(registry, "formation_plane", PartType.FORMATION_PLANE, PartFormationPlane::new ); this.formationPlane = createPart(registry, "formation_plane", PartType.FORMATION_PLANE, PartFormationPlane::new );
this.fluidFormationPlane = createPart(registry, "fluid_formation_plane", PartType.FLUID_FORMATION_PLANE, PartFluidFormationPlane::new ); this.fluidFormationPlane = createPart(registry, "fluid_formation_plane", PartType.FLUID_FORMATION_PLANE, PartFluidFormationPlane::new );
@@ -133,20 +131,97 @@ public final class ApiParts implements IParts
this.conversionMonitor = createPart(registry, "conversion_monitor", PartType.CONVERSION_MONITOR, PartConversionMonitor::new ); this.conversionMonitor = createPart(registry, "conversion_monitor", PartType.CONVERSION_MONITOR, PartConversionMonitor::new );
this.iface = createPart(registry, "cable_interface", PartType.INTERFACE, PartInterface::new ); this.iface = createPart(registry, "cable_interface", PartType.INTERFACE, PartInterface::new );
this.fluidIface = createPart(registry, "cable_fluid_interface", PartType.FLUID_INTERFACE, PartFluidInterface::new ); this.fluidIface = createPart(registry, "cable_fluid_interface", PartType.FLUID_INTERFACE, PartFluidInterface::new );
this.p2PTunnelME = createPart(registry, "me_tunnel", PartType.P2P_TUNNEL_ME, PartP2PTunnelME::new ); this.p2PTunnelME = createPart(registry, "me_p2p_tunnel", PartType.P2P_TUNNEL_ME, PartP2PTunnelME::new );
this.p2PTunnelRedstone = createPart(registry, "redstone_tunnel", PartType.P2P_TUNNEL_REDSTONE, PartP2PRedstone::new ); this.p2PTunnelRedstone = createPart(registry, "redstone_p2p_tunnel", PartType.P2P_TUNNEL_REDSTONE, PartP2PRedstone::new );
this.p2PTunnelItems = createPart(registry, "item_tunnel", PartType.P2P_TUNNEL_ITEMS, PartP2PItems::new ); this.p2PTunnelItems = createPart(registry, "item_p2p_tunnel", PartType.P2P_TUNNEL_ITEM, PartP2PItems::new );
this.p2PTunnelFluids = createPart(registry, "fluid_tunnel", PartType.P2P_TUNNEL_FLUIDS, PartP2PFluids::new ); this.p2PTunnelFluids = createPart(registry, "fluid_p2p_tunnel", PartType.P2P_TUNNEL_FLUID, PartP2PFluids::new );
this.p2PTunnelEU = null; // FIXME createPart( "tunnel.eu", PartType.P2P_TUNNEL_IC2, PartP2PIC2Power::new); this.p2PTunnelEU = null; // FIXME createPart( "ic2_p2p_tunnel", PartType.P2P_TUNNEL_IC2, PartP2PIC2Power::new);
this.p2PTunnelFE = createPart(registry, "fe_tunnel", PartType.P2P_TUNNEL_FE, PartP2PFEPower::new ); this.p2PTunnelFE = createPart(registry, "fe_p2p_tunnel", PartType.P2P_TUNNEL_FE, PartP2PFEPower::new );
this.p2PTunnelLight = createPart(registry, "light_tunnel", PartType.P2P_TUNNEL_LIGHT, PartP2PLight::new ); this.p2PTunnelLight = createPart(registry, "light_p2p_tunnel", PartType.P2P_TUNNEL_LIGHT, PartP2PLight::new );
this.interfaceTerminal = createPart(registry, "interface_terminal", PartType.INTERFACE_TERMINAL, PartInterfaceTerminal::new ); this.interfaceTerminal = createPart(registry, "interface_terminal", PartType.INTERFACE_TERMINAL, PartInterfaceTerminal::new );
this.fluidTerminal = createPart(registry, "fluid_terminal", PartType.FLUID_TERMINAL, PartFluidTerminal::new ); this.fluidTerminal = createPart(registry, "fluid_terminal", PartType.FLUID_TERMINAL, PartFluidTerminal::new );
} }
private void registerPartModels(PartModels partModels) {
// Register the built-in models for annihilation planes
ResourceLocation annihilationPlaneTexture = new ResourceLocation( AppEng.MOD_ID, "item/part/annihilation_plane" );
ResourceLocation annihilationPlaneOnTexture = new ResourceLocation( AppEng.MOD_ID, "parts/annihilation_plane_on" );
ResourceLocation fluidAnnihilationPlaneTexture = new ResourceLocation( AppEng.MOD_ID, "item/part/fluid_annihilation_plane" );
ResourceLocation fluidAnnihilationPlaneOnTexture = new ResourceLocation( AppEng.MOD_ID, "parts/fluid_annihilation_plane_on" );
ResourceLocation identityAnnihilationPlaneTexture = new ResourceLocation( AppEng.MOD_ID, "item/part/identity_annihilation_plane" );
ResourceLocation identityAnnihilationPlaneOnTexture = new ResourceLocation( AppEng.MOD_ID, "parts/identity_annihilation_plane_on" );
ResourceLocation formationPlaneTexture = new ResourceLocation( AppEng.MOD_ID, "item/part/formation_plane" );
ResourceLocation formationPlaneOnTexture = new ResourceLocation( AppEng.MOD_ID, "parts/formation_plane_on" );
ResourceLocation fluidFormationPlaneTexture = new ResourceLocation( AppEng.MOD_ID, "item/part/fluid_formation_plane" );
ResourceLocation fluidFormationPlaneOnTexture = new ResourceLocation( AppEng.MOD_ID, "parts/fluid_formation_plane_on" );
ResourceLocation sidesTexture = new ResourceLocation( AppEng.MOD_ID, "parts/plane_sides" );
ResourceLocation backTexture = new ResourceLocation( AppEng.MOD_ID, "parts/transition_plane_back" );
List<String> modelNames = new ArrayList<>();
// FIXME for( PlaneConnections connection : PlaneConnections.PERMUTATIONS )
// FIXME {
// FIXME PlaneModel model = new PlaneModel( annihilationPlaneTexture, sidesTexture, backTexture, connection );
// FIXME rendering.builtInModel( "models/part/annihilation_plane_" + connection.getFilenameSuffix(), model );
// FIXME modelNames.add( "part/annihilation_plane_" + connection.getFilenameSuffix() );
// FIXME
// FIXME model = new PlaneModel( annihilationPlaneOnTexture, sidesTexture, backTexture, connection );
// FIXME rendering.builtInModel( "models/part/annihilation_plane_on_" + connection.getFilenameSuffix(), model );
// FIXME modelNames.add( "part/annihilation_plane_on_" + connection.getFilenameSuffix() );
// FIXME
// FIXME model = new PlaneModel( fluidAnnihilationPlaneTexture, sidesTexture, backTexture, connection );
// FIXME rendering.builtInModel( "models/part/fluid_annihilation_plane_" + connection.getFilenameSuffix(), model );
// FIXME modelNames.add( "part/fluid_annihilation_plane_" + connection.getFilenameSuffix() );
// FIXME
// FIXME model = new PlaneModel( fluidAnnihilationPlaneOnTexture, sidesTexture, backTexture, connection );
// FIXME rendering.builtInModel( "models/part/fluid_annihilation_plane_on_" + connection.getFilenameSuffix(), model );
// FIXME modelNames.add( "part/fluid_annihilation_plane_on_" + connection.getFilenameSuffix() );
// FIXME
// FIXME model = new PlaneModel( identityAnnihilationPlaneTexture, sidesTexture, backTexture, connection );
// FIXME rendering.builtInModel( "models/part/identity_annihilation_plane_" + connection.getFilenameSuffix(), model );
// FIXME modelNames.add( "part/identity_annihilation_plane_" + connection.getFilenameSuffix() );
// FIXME
// FIXME model = new PlaneModel( identityAnnihilationPlaneOnTexture, sidesTexture, backTexture, connection );
// FIXME rendering.builtInModel( "models/part/identity_annihilation_plane_on_" + connection.getFilenameSuffix(), model );
// FIXME modelNames.add( "part/identity_annihilation_plane_on_" + connection.getFilenameSuffix() );
// FIXME
// FIXME model = new PlaneModel( formationPlaneTexture, sidesTexture, backTexture, connection );
// FIXME rendering.builtInModel( "models/part/formation_plane_" + connection.getFilenameSuffix(), model );
// FIXME modelNames.add( "part/formation_plane_" + connection.getFilenameSuffix() );
// FIXME
// FIXME model = new PlaneModel( formationPlaneOnTexture, sidesTexture, backTexture, connection );
// FIXME rendering.builtInModel( "models/part/formation_plane_on_" + connection.getFilenameSuffix(), model );
// FIXME modelNames.add( "part/formation_plane_on_" + connection.getFilenameSuffix() );
// FIXME
// FIXME model = new PlaneModel( fluidFormationPlaneTexture, sidesTexture, backTexture, connection );
// FIXME rendering.builtInModel( "models/part/fluid_formation_plane_" + connection.getFilenameSuffix(), model );
// FIXME modelNames.add( "part/fluid_formation_plane_" + connection.getFilenameSuffix() );
// FIXME
// FIXME model = new PlaneModel( fluidFormationPlaneOnTexture, sidesTexture, backTexture, connection );
// FIXME rendering.builtInModel( "models/part/fluid_formation_plane_on_" + connection.getFilenameSuffix(), model );
// FIXME modelNames.add( "part/fluid_formation_plane_on_" + connection.getFilenameSuffix() );
// FIXME }
// FIXME
// FIXME // base p2p model with frequency
// FIXME rendering.builtInModel( "models/part/builtin/p2p_tunnel_frequency", new P2PTunnelFrequencyModel() );
List<ResourceLocation> partResourceLocs = modelNames.stream()
.map( name -> new ResourceLocation( AppEng.MOD_ID, name ) )
.collect( Collectors.toList() );
partModels.registerModels( partResourceLocs );
// Register all part models
for( PartType partType : PartType.values() )
{
partModels.registerModels( partType.getModels() );
}
}
private <T extends IPart> IItemDefinition createPart(FeatureFactory registry, String id, PartType type, Function<ItemStack, T> factory) { private <T extends IPart> IItemDefinition createPart(FeatureFactory registry, String id, PartType type, Function<ItemStack, T> factory) {
return registry.item(id, props -> new ItemPart<>(props, type, factory)) return registry.item(id, props -> new ItemPart<>(props, type, factory))
.itemGroup(CreativeTab.instance) .itemGroup(CreativeTab.instance)
.rendering(new ItemPartRendering())
.build(); .build();
} }
@@ -156,10 +231,11 @@ public final class ApiParts implements IParts
for( final AEColor color : AEColor.values() ) for( final AEColor color : AEColor.values() )
{ {
String id = color.registryPrefix + idSuffix; String id = color.registryPrefix + '_' + idSuffix;
IItemDefinition itemDef = registry.item(id, props -> new ColoredPartItem<>(props, type, factory, color)) IItemDefinition itemDef = registry.item(id, props -> new ColoredPartItem<>(props, type, factory, color))
.itemGroup(CreativeTab.instance) .itemGroup(CreativeTab.instance)
.rendering(new ItemPartRendering(color))
.build(); .build();
definition.add( color, new ItemStackSrc(itemDef.item(), ActivityState.Enabled) ); definition.add( color, new ItemStackSrc(itemDef.item(), ActivityState.Enabled) );
@@ -19,7 +19,9 @@
package appeng.fluids.parts; package appeng.fluids.parts;
import appeng.fluids.container.ContainerFluidTerminal;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@@ -53,11 +55,11 @@ public class PartFluidTerminal extends AbstractPartTerminal
super( is ); super( is );
} }
// FIXME @Override @Override
// FIXME public GuiBridge getGui( PlayerEntity player ) public ContainerType<?> getContainerType(PlayerEntity player )
// FIXME { {
// FIXME return GuiBridge.GUI_FLUID_TERMINAL; return ContainerFluidTerminal.TYPE;
// FIXME } }
@Override @Override
public IPartModel getStaticModels() public IPartModel getStaticModels()
@@ -19,125 +19,31 @@
package appeng.items.parts; package appeng.items.parts;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
import appeng.bootstrap.IItemRendering; import appeng.bootstrap.IItemRendering;
import appeng.bootstrap.ItemRenderingCustomizer; import appeng.bootstrap.ItemRenderingCustomizer;
import appeng.client.render.StaticItemColor; import appeng.client.render.StaticItemColor;
import appeng.core.AppEng; import net.minecraftforge.api.distmarker.Dist;
import appeng.core.features.registries.PartModels; import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.parts.automation.PlaneConnections;
import appeng.parts.automation.PlaneModel;
public class ItemPartRendering extends ItemRenderingCustomizer public class ItemPartRendering extends ItemRenderingCustomizer
{ {
private final PartModels partModels; private final AEColor color;
public ItemPartRendering( PartModels partModels ) public ItemPartRendering() {
{ this.color = AEColor.TRANSPARENT;
this.partModels = partModels; }
public ItemPartRendering(AEColor color) {
this.color = color;
} }
@Override @Override
@OnlyIn( Dist.CLIENT ) @OnlyIn( Dist.CLIENT )
public void customize( IItemRendering rendering ) public void customize( IItemRendering rendering )
{ {
rendering.color( new StaticItemColor(color) );
// FIXME rendering.meshDefinition( this::getItemMeshDefinition );
rendering.color( new StaticItemColor( AEColor.TRANSPARENT ) );
// Register all item models as variants so they get loaded
rendering.variants( Arrays.stream( PartType.values() )
.filter( f -> f != PartType.INVALID_TYPE )
.flatMap( part -> part.getItemModels().stream() )
.collect( Collectors.toList() ) );
// Register the built-in models for annihilation planes
ResourceLocation annihilationPlaneTexture = new ResourceLocation( AppEng.MOD_ID, "item/part/annihilation_plane" );
ResourceLocation annihilationPlaneOnTexture = new ResourceLocation( AppEng.MOD_ID, "parts/annihilation_plane_on" );
ResourceLocation fluidAnnihilationPlaneTexture = new ResourceLocation( AppEng.MOD_ID, "item/part/fluid_annihilation_plane" );
ResourceLocation fluidAnnihilationPlaneOnTexture = new ResourceLocation( AppEng.MOD_ID, "parts/fluid_annihilation_plane_on" );
ResourceLocation identityAnnihilationPlaneTexture = new ResourceLocation( AppEng.MOD_ID, "item/part/identity_annihilation_plane" );
ResourceLocation identityAnnihilationPlaneOnTexture = new ResourceLocation( AppEng.MOD_ID, "parts/identity_annihilation_plane_on" );
ResourceLocation formationPlaneTexture = new ResourceLocation( AppEng.MOD_ID, "item/part/formation_plane" );
ResourceLocation formationPlaneOnTexture = new ResourceLocation( AppEng.MOD_ID, "parts/formation_plane_on" );
ResourceLocation fluidFormationPlaneTexture = new ResourceLocation( AppEng.MOD_ID, "item/part/fluid_formation_plane" );
ResourceLocation fluidFormationPlaneOnTexture = new ResourceLocation( AppEng.MOD_ID, "parts/fluid_formation_plane_on" );
ResourceLocation sidesTexture = new ResourceLocation( AppEng.MOD_ID, "parts/plane_sides" );
ResourceLocation backTexture = new ResourceLocation( AppEng.MOD_ID, "parts/transition_plane_back" );
List<String> modelNames = new ArrayList<>();
for( PlaneConnections connection : PlaneConnections.PERMUTATIONS )
{
PlaneModel model = new PlaneModel( annihilationPlaneTexture, sidesTexture, backTexture, connection );
rendering.builtInModel( "models/part/annihilation_plane_" + connection.getFilenameSuffix(), model );
modelNames.add( "part/annihilation_plane_" + connection.getFilenameSuffix() );
model = new PlaneModel( annihilationPlaneOnTexture, sidesTexture, backTexture, connection );
rendering.builtInModel( "models/part/annihilation_plane_on_" + connection.getFilenameSuffix(), model );
modelNames.add( "part/annihilation_plane_on_" + connection.getFilenameSuffix() );
model = new PlaneModel( fluidAnnihilationPlaneTexture, sidesTexture, backTexture, connection );
rendering.builtInModel( "models/part/fluid_annihilation_plane_" + connection.getFilenameSuffix(), model );
modelNames.add( "part/fluid_annihilation_plane_" + connection.getFilenameSuffix() );
model = new PlaneModel( fluidAnnihilationPlaneOnTexture, sidesTexture, backTexture, connection );
rendering.builtInModel( "models/part/fluid_annihilation_plane_on_" + connection.getFilenameSuffix(), model );
modelNames.add( "part/fluid_annihilation_plane_on_" + connection.getFilenameSuffix() );
model = new PlaneModel( identityAnnihilationPlaneTexture, sidesTexture, backTexture, connection );
rendering.builtInModel( "models/part/identity_annihilation_plane_" + connection.getFilenameSuffix(), model );
modelNames.add( "part/identity_annihilation_plane_" + connection.getFilenameSuffix() );
model = new PlaneModel( identityAnnihilationPlaneOnTexture, sidesTexture, backTexture, connection );
rendering.builtInModel( "models/part/identity_annihilation_plane_on_" + connection.getFilenameSuffix(), model );
modelNames.add( "part/identity_annihilation_plane_on_" + connection.getFilenameSuffix() );
model = new PlaneModel( formationPlaneTexture, sidesTexture, backTexture, connection );
rendering.builtInModel( "models/part/formation_plane_" + connection.getFilenameSuffix(), model );
modelNames.add( "part/formation_plane_" + connection.getFilenameSuffix() );
model = new PlaneModel( formationPlaneOnTexture, sidesTexture, backTexture, connection );
rendering.builtInModel( "models/part/formation_plane_on_" + connection.getFilenameSuffix(), model );
modelNames.add( "part/formation_plane_on_" + connection.getFilenameSuffix() );
model = new PlaneModel( fluidFormationPlaneTexture, sidesTexture, backTexture, connection );
rendering.builtInModel( "models/part/fluid_formation_plane_" + connection.getFilenameSuffix(), model );
modelNames.add( "part/fluid_formation_plane_" + connection.getFilenameSuffix() );
model = new PlaneModel( fluidFormationPlaneOnTexture, sidesTexture, backTexture, connection );
rendering.builtInModel( "models/part/fluid_formation_plane_on_" + connection.getFilenameSuffix(), model );
modelNames.add( "part/fluid_formation_plane_on_" + connection.getFilenameSuffix() );
}
// base p2p model with frequency
// FIXME rendering.builtInModel( "models/part/builtin/p2p_tunnel_frequency", new P2PTunnelFrequencyModel() );
List<ResourceLocation> partResourceLocs = modelNames.stream()
.map( name -> new ResourceLocation( AppEng.MOD_ID, name ) )
.collect( Collectors.toList() );
this.partModels.registerModels( partResourceLocs );
} }
// FIXME private ModelResourceLocation getItemMeshDefinition( ItemStack is )
// FIXME {
// FIXME PartType partType = this.item.getTypeByStack( is );
// FIXME int variant = this.item.variantOf( is.getDamage() );
// FIXME return partType.getItemModels().get( variant );
// FIXME }
} }
+50 -165
View File
@@ -19,28 +19,20 @@
package appeng.items.parts; package appeng.items.parts;
import java.lang.reflect.Constructor;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
import appeng.fluids.parts.*; import appeng.fluids.parts.*;
import appeng.parts.p2p.*; import appeng.parts.p2p.*;
import com.google.common.collect.ImmutableList;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.parts.IPart; import appeng.api.parts.IPart;
import appeng.api.util.AEColor;
import appeng.core.AEConfig; import appeng.core.AEConfig;
import appeng.core.AppEng;
import appeng.api.features.AEFeature; import appeng.api.features.AEFeature;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.parts.automation.PartAnnihilationPlane; import appeng.parts.automation.PartAnnihilationPlane;
@@ -69,68 +61,40 @@ import appeng.parts.reporting.PartPatternTerminal;
import appeng.parts.reporting.PartSemiDarkPanel; import appeng.parts.reporting.PartSemiDarkPanel;
import appeng.parts.reporting.PartStorageMonitor; import appeng.parts.reporting.PartStorageMonitor;
import appeng.parts.reporting.PartTerminal; import appeng.parts.reporting.PartTerminal;
import appeng.util.Platform;
public enum PartType public enum PartType
{ {
INVALID_TYPE( -1, "invalid", EnumSet.of( AEFeature.CORE ), EnumSet.noneOf( IntegrationType.class ), null ), INVALID_TYPE(EnumSet.of( AEFeature.CORE ), EnumSet.noneOf( IntegrationType.class ), null ),
CABLE_GLASS( 0, "cable_glass", EnumSet.of( AEFeature.GLASS_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableGlass.class ) CABLE_GLASS(EnumSet.of( AEFeature.GLASS_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableGlass.class )
{ {
@Override @Override
public boolean isCable() public boolean isCable()
{ {
return true; return true;
} }
@Override
@OnlyIn( Dist.CLIENT )
protected List<ModelResourceLocation> createItemModels( String baseName )
{
return Arrays.stream( AEColor.values() )
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
.collect( Collectors.toList() );
}
}, },
CABLE_COVERED( 20, "cable_covered", EnumSet.of( AEFeature.COVERED_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableCovered.class ) CABLE_COVERED(EnumSet.of( AEFeature.COVERED_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableCovered.class )
{ {
@Override @Override
public boolean isCable() public boolean isCable()
{ {
return true; return true;
} }
@Override
@OnlyIn( Dist.CLIENT )
protected List<ModelResourceLocation> createItemModels( String baseName )
{
return Arrays.stream( AEColor.values() )
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
.collect( Collectors.toList() );
}
}, },
CABLE_SMART( 40, "cable_smart", EnumSet.of( AEFeature.CHANNELS, AEFeature.SMART_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableSmart.class ) CABLE_SMART(EnumSet.of( AEFeature.CHANNELS, AEFeature.SMART_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableSmart.class )
{ {
@Override @Override
public boolean isCable() public boolean isCable()
{ {
return true; return true;
} }
@Override
@OnlyIn( Dist.CLIENT )
protected List<ModelResourceLocation> createItemModels( String baseName )
{
return Arrays.stream( AEColor.values() )
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
.collect( Collectors.toList() );
}
}, },
CABLE_DENSE_SMART( 60, "cable_dense_smart", EnumSet.of( AEFeature.CHANNELS, AEFeature.DENSE_CABLES ), EnumSet CABLE_DENSE_SMART(EnumSet.of( AEFeature.CHANNELS, AEFeature.DENSE_CABLES ), EnumSet
.noneOf( IntegrationType.class ), PartDenseCableSmart.class ) .noneOf( IntegrationType.class ), PartDenseCableSmart.class )
{ {
@Override @Override
@@ -138,18 +102,9 @@ public enum PartType
{ {
return true; return true;
} }
@Override
@OnlyIn( Dist.CLIENT )
protected List<ModelResourceLocation> createItemModels( String baseName )
{
return Arrays.stream( AEColor.values() )
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
.collect( Collectors.toList() );
}
}, },
CABLE_DENSE_COVERED( 500, "cable_dense_covered", EnumSet.of( AEFeature.CHANNELS, AEFeature.DENSE_CABLES ), EnumSet CABLE_DENSE_COVERED(EnumSet.of( AEFeature.CHANNELS, AEFeature.DENSE_CABLES ), EnumSet
.noneOf( IntegrationType.class ), PartDenseCableCovered.class ) .noneOf( IntegrationType.class ), PartDenseCableCovered.class )
{ {
@Override @Override
@@ -157,78 +112,69 @@ public enum PartType
{ {
return true; return true;
} }
@Override
@OnlyIn( Dist.CLIENT )
protected List<ModelResourceLocation> createItemModels( String baseName )
{
return Arrays.stream( AEColor.values() )
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
.collect( Collectors.toList() );
}
}, },
TOGGLE_BUS( 80, "toggle_bus", EnumSet.of( AEFeature.TOGGLE_BUS ), EnumSet.noneOf( IntegrationType.class ), PartToggleBus.class ), TOGGLE_BUS(EnumSet.of( AEFeature.TOGGLE_BUS ), EnumSet.noneOf( IntegrationType.class ), PartToggleBus.class ),
INVERTED_TOGGLE_BUS( 100, "inverted_toggle_bus", EnumSet.of( AEFeature.TOGGLE_BUS ), EnumSet.noneOf( IntegrationType.class ), PartInvertedToggleBus.class ), INVERTED_TOGGLE_BUS(EnumSet.of( AEFeature.TOGGLE_BUS ), EnumSet.noneOf( IntegrationType.class ), PartInvertedToggleBus.class ),
CABLE_ANCHOR( 120, "cable_anchor", EnumSet.of( AEFeature.CABLE_ANCHOR ), EnumSet.noneOf( IntegrationType.class ), PartCableAnchor.class ), CABLE_ANCHOR(EnumSet.of( AEFeature.CABLE_ANCHOR ), EnumSet.noneOf( IntegrationType.class ), PartCableAnchor.class ),
QUARTZ_FIBER( 140, "quartz_fiber", EnumSet.of( AEFeature.QUARTZ_FIBER ), EnumSet.noneOf( IntegrationType.class ), PartQuartzFiber.class ), QUARTZ_FIBER(EnumSet.of( AEFeature.QUARTZ_FIBER ), EnumSet.noneOf( IntegrationType.class ), PartQuartzFiber.class ),
MONITOR( 160, "monitor", EnumSet.of( AEFeature.PANELS ), EnumSet.noneOf( IntegrationType.class ), PartPanel.class, "itemIlluminatedPanel" ), MONITOR(EnumSet.of( AEFeature.PANELS ), EnumSet.noneOf( IntegrationType.class ), PartPanel.class, "itemIlluminatedPanel" ),
SEMI_DARK_MONITOR( 180, "semi_dark_monitor", EnumSet.of( AEFeature.PANELS ), EnumSet SEMI_DARK_MONITOR(EnumSet.of( AEFeature.PANELS ), EnumSet
.noneOf( IntegrationType.class ), PartSemiDarkPanel.class, "itemIlluminatedPanel" ), .noneOf( IntegrationType.class ), PartSemiDarkPanel.class, "itemIlluminatedPanel" ),
DARK_MONITOR( 200, "dark_monitor", EnumSet.of( AEFeature.PANELS ), EnumSet.noneOf( IntegrationType.class ), PartDarkPanel.class, "itemIlluminatedPanel" ), DARK_MONITOR(EnumSet.of( AEFeature.PANELS ), EnumSet.noneOf( IntegrationType.class ), PartDarkPanel.class, "itemIlluminatedPanel" ),
STORAGE_BUS( 220, "storage_bus", EnumSet.of( AEFeature.STORAGE_BUS ), EnumSet.noneOf( IntegrationType.class ), PartStorageBus.class ), STORAGE_BUS(EnumSet.of( AEFeature.STORAGE_BUS ), EnumSet.noneOf( IntegrationType.class ), PartStorageBus.class ),
FLUID_STORAGE_BUS( 221, "fluid_storage_bus", EnumSet.of( AEFeature.FLUID_STORAGE_BUS ), EnumSet FLUID_STORAGE_BUS(EnumSet.of( AEFeature.FLUID_STORAGE_BUS ), EnumSet
.noneOf( IntegrationType.class ), PartFluidStorageBus.class ), .noneOf( IntegrationType.class ), PartFluidStorageBus.class ),
IMPORT_BUS( 240, "import_bus", EnumSet.of( AEFeature.IMPORT_BUS ), EnumSet.noneOf( IntegrationType.class ), PartImportBus.class ), IMPORT_BUS(EnumSet.of( AEFeature.IMPORT_BUS ), EnumSet.noneOf( IntegrationType.class ), PartImportBus.class ),
FLUID_IMPORT_BUS( 241, "fluid_import_bus", EnumSet.of( AEFeature.FLUID_IMPORT_BUS ), EnumSet.noneOf( IntegrationType.class ), PartFluidImportBus.class ), FLUID_IMPORT_BUS(EnumSet.of( AEFeature.FLUID_IMPORT_BUS ), EnumSet.noneOf( IntegrationType.class ), PartFluidImportBus.class ),
EXPORT_BUS( 260, "export_bus", EnumSet.of( AEFeature.EXPORT_BUS ), EnumSet.noneOf( IntegrationType.class ), PartExportBus.class ), EXPORT_BUS(EnumSet.of( AEFeature.EXPORT_BUS ), EnumSet.noneOf( IntegrationType.class ), PartExportBus.class ),
FLUID_EXPORT_BUS( 261, "fluid_export_bus", EnumSet.of( AEFeature.FLUID_EXPORT_BUS ), EnumSet.noneOf( IntegrationType.class ), PartFluidExportBus.class ), FLUID_EXPORT_BUS(EnumSet.of( AEFeature.FLUID_EXPORT_BUS ), EnumSet.noneOf( IntegrationType.class ), PartFluidExportBus.class ),
LEVEL_EMITTER( 280, "level_emitter", EnumSet.of( AEFeature.LEVEL_EMITTER ), EnumSet.noneOf( IntegrationType.class ), PartLevelEmitter.class ), LEVEL_EMITTER(EnumSet.of( AEFeature.LEVEL_EMITTER ), EnumSet.noneOf( IntegrationType.class ), PartLevelEmitter.class ),
FLUID_LEVEL_EMITTER( 281, "fluid_level_emitter", EnumSet.of( AEFeature.FLUID_LEVEL_EMITTER ), EnumSet FLUID_LEVEL_EMITTER(EnumSet.of( AEFeature.FLUID_LEVEL_EMITTER ), EnumSet
.noneOf( IntegrationType.class ), PartFluidLevelEmitter.class ), .noneOf( IntegrationType.class ), PartFluidLevelEmitter.class ),
ANNIHILATION_PLANE( 300, "annihilation_plane", EnumSet.of( AEFeature.ANNIHILATION_PLANE ), EnumSet ANNIHILATION_PLANE(EnumSet.of( AEFeature.ANNIHILATION_PLANE ), EnumSet
.noneOf( IntegrationType.class ), PartAnnihilationPlane.class ), .noneOf( IntegrationType.class ), PartAnnihilationPlane.class ),
IDENTITY_ANNIHILATION_PLANE( 301, "identity_annihilation_plane", EnumSet.of( AEFeature.ANNIHILATION_PLANE, AEFeature.IDENTITY_ANNIHILATION_PLANE ), EnumSet IDENTITY_ANNIHILATION_PLANE(EnumSet.of( AEFeature.ANNIHILATION_PLANE, AEFeature.IDENTITY_ANNIHILATION_PLANE ), EnumSet
.noneOf( IntegrationType.class ), PartIdentityAnnihilationPlane.class ), .noneOf( IntegrationType.class ), PartIdentityAnnihilationPlane.class ),
FLUID_ANNIHILATION_PLANE( 302, "fluid_annihilation_plane", EnumSet.of( AEFeature.FLUID_ANNIHILATION_PLANE ), EnumSet FLUID_ANNIHILATION_PLANE(EnumSet.of( AEFeature.FLUID_ANNIHILATION_PLANE ), EnumSet
.noneOf( IntegrationType.class ), PartFluidAnnihilationPlane.class ), .noneOf( IntegrationType.class ), PartFluidAnnihilationPlane.class ),
FORMATION_PLANE( 320, "formation_plane", EnumSet.of( AEFeature.FORMATION_PLANE ), EnumSet.noneOf( IntegrationType.class ), PartFormationPlane.class ), FORMATION_PLANE(EnumSet.of( AEFeature.FORMATION_PLANE ), EnumSet.noneOf( IntegrationType.class ), PartFormationPlane.class ),
FLUID_FORMATION_PLANE( 321, "fluid_formation_plane", EnumSet.of( AEFeature.FLUID_FORMATION_PLANE ), EnumSet FLUID_FORMATION_PLANE(EnumSet.of( AEFeature.FLUID_FORMATION_PLANE ), EnumSet
.noneOf( IntegrationType.class ), PartFluidFormationPlane.class ), .noneOf( IntegrationType.class ), PartFluidFormationPlane.class ),
PATTERN_TERMINAL( 340, "pattern_terminal", EnumSet.of( AEFeature.PATTERNS ), EnumSet.noneOf( IntegrationType.class ), PartPatternTerminal.class ), PATTERN_TERMINAL(EnumSet.of( AEFeature.PATTERNS ), EnumSet.noneOf( IntegrationType.class ), PartPatternTerminal.class ),
CRAFTING_TERMINAL( 360, "crafting_terminal", EnumSet.of( AEFeature.CRAFTING_TERMINAL ), EnumSet CRAFTING_TERMINAL(EnumSet.of( AEFeature.CRAFTING_TERMINAL ), EnumSet
.noneOf( IntegrationType.class ), PartCraftingTerminal.class ), .noneOf( IntegrationType.class ), PartCraftingTerminal.class ),
TERMINAL( 380, "terminal", EnumSet.of( AEFeature.TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartTerminal.class ), TERMINAL(EnumSet.of( AEFeature.TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartTerminal.class ),
STORAGE_MONITOR( 400, "storage_monitor", EnumSet.of( AEFeature.STORAGE_MONITOR ), EnumSet.noneOf( IntegrationType.class ), PartStorageMonitor.class ), STORAGE_MONITOR(EnumSet.of( AEFeature.STORAGE_MONITOR ), EnumSet.noneOf( IntegrationType.class ), PartStorageMonitor.class ),
CONVERSION_MONITOR( 420, "conversion_monitor", EnumSet.of( AEFeature.PART_CONVERSION_MONITOR ), EnumSet CONVERSION_MONITOR(EnumSet.of( AEFeature.PART_CONVERSION_MONITOR ), EnumSet
.noneOf( IntegrationType.class ), PartConversionMonitor.class ), .noneOf( IntegrationType.class ), PartConversionMonitor.class ),
INTERFACE( 440, "interface", EnumSet.of( AEFeature.INTERFACE ), EnumSet.noneOf( IntegrationType.class ), PartInterface.class ), INTERFACE(EnumSet.of( AEFeature.INTERFACE ), EnumSet.noneOf( IntegrationType.class ), PartInterface.class ),
FLUID_INTERFACE( 441, "fluid_interface", EnumSet.of( AEFeature.FLUID_INTERFACE ), EnumSet.noneOf( IntegrationType.class ), PartFluidInterface.class ), FLUID_INTERFACE(EnumSet.of( AEFeature.FLUID_INTERFACE ), EnumSet.noneOf( IntegrationType.class ), PartFluidInterface.class ),
P2P_TUNNEL_ME( 460, "p2p_tunnel_me", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_ME ), EnumSet P2P_TUNNEL_ME(EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_ME ), EnumSet
.noneOf( IntegrationType.class ), PartP2PTunnelME.class, GuiText.METunnel ) .noneOf( IntegrationType.class ), PartP2PTunnelME.class, GuiText.METunnel )
{ {
@Override @Override
@@ -238,7 +184,7 @@ public enum PartType
} }
}, },
P2P_TUNNEL_REDSTONE( 461, "p2p_tunnel_redstone", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_REDSTONE ), EnumSet P2P_TUNNEL_REDSTONE(EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_REDSTONE ), EnumSet
.noneOf( IntegrationType.class ), PartP2PRedstone.class, GuiText.RedstoneTunnel ) .noneOf( IntegrationType.class ), PartP2PRedstone.class, GuiText.RedstoneTunnel )
{ {
@Override @Override
@@ -248,7 +194,7 @@ public enum PartType
} }
}, },
P2P_TUNNEL_ITEMS( 462, "p2p_tunnel_items", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_ITEMS ), EnumSet P2P_TUNNEL_ITEM(EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_ITEMS ), EnumSet
.noneOf( IntegrationType.class ), PartP2PItems.class, GuiText.ItemTunnel ) .noneOf( IntegrationType.class ), PartP2PItems.class, GuiText.ItemTunnel )
{ {
@Override @Override
@@ -258,7 +204,7 @@ public enum PartType
} }
}, },
P2P_TUNNEL_FLUIDS( 463, "p2p_tunnel_fluids", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_FLUIDS ), EnumSet P2P_TUNNEL_FLUID(EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_FLUIDS ), EnumSet
.noneOf( IntegrationType.class ), PartP2PFluids.class, GuiText.FluidTunnel ) .noneOf( IntegrationType.class ), PartP2PFluids.class, GuiText.FluidTunnel )
{ {
@Override @Override
@@ -278,7 +224,7 @@ public enum PartType
//FIXME } //FIXME }
//FIXME }, //FIXME },
P2P_TUNNEL_LIGHT( 467, "p2p_tunnel_light", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_LIGHT ), EnumSet P2P_TUNNEL_LIGHT(EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_LIGHT ), EnumSet
.noneOf( IntegrationType.class ), PartP2PLight.class, GuiText.LightTunnel ) .noneOf( IntegrationType.class ), PartP2PLight.class, GuiText.LightTunnel )
{ {
@Override @Override
@@ -288,7 +234,7 @@ public enum PartType
} }
}, },
P2P_TUNNEL_FE( 469, "p2p_tunnel_fe", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_FE ), EnumSet P2P_TUNNEL_FE(EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_FE ), EnumSet
.noneOf( IntegrationType.class ), PartP2PFEPower.class, GuiText.FETunnel ) .noneOf( IntegrationType.class ), PartP2PFEPower.class, GuiText.FETunnel )
{ {
@Override @Override
@@ -301,100 +247,50 @@ public enum PartType
// P2PTunnelOpenComputers( 468, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelOpenComputers ), EnumSet.of( // P2PTunnelOpenComputers( 468, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelOpenComputers ), EnumSet.of(
// IntegrationType.OpenComputers ), PartP2POpenComputers.class, GuiText.OCTunnel ), // IntegrationType.OpenComputers ), PartP2POpenComputers.class, GuiText.OCTunnel ),
INTERFACE_TERMINAL( 480, "interface_terminal", EnumSet.of( AEFeature.INTERFACE_TERMINAL ), EnumSet INTERFACE_TERMINAL(EnumSet.of( AEFeature.INTERFACE_TERMINAL ), EnumSet
.noneOf( IntegrationType.class ), PartInterfaceTerminal.class ), .noneOf( IntegrationType.class ), PartInterfaceTerminal.class ),
FLUID_TERMINAL( 520, "fluid_terminal", EnumSet.of( AEFeature.FLUID_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartFluidTerminal.class ); FLUID_TERMINAL(EnumSet.of( AEFeature.FLUID_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartFluidTerminal.class );
private final int baseDamage;
private final Set<AEFeature> features; private final Set<AEFeature> features;
private final Set<IntegrationType> integrations; private final Set<IntegrationType> integrations;
private final Class<? extends IPart> myPart;
private final GuiText extraName; private final GuiText extraName;
@OnlyIn( Dist.CLIENT ) @OnlyIn( Dist.CLIENT )
private List<ModelResourceLocation> itemModels;
private final Set<ResourceLocation> models; private final Set<ResourceLocation> models;
private final boolean enabled;
private Constructor<? extends IPart> constructor;
private final String oreName; private final String oreName;
PartType( final int baseMetaValue, final String itemModel, final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c ) PartType(final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c)
{ {
this( baseMetaValue, itemModel, features, integrations, c, null, null ); this(features, integrations, c, null, null );
} }
PartType( final int baseMetaValue, final String itemModel, final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c, final String oreDict ) PartType(final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c, final String oreDict)
{ {
this( baseMetaValue, itemModel, features, integrations, c, null, oreDict ); this(features, integrations, c, null, oreDict );
} }
PartType( final int baseMetaValue, final String itemModel, final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c, final GuiText en ) PartType(final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c, final GuiText en)
{ {
this( baseMetaValue, itemModel, features, integrations, c, en, null ); this(features, integrations, c, en, null );
} }
PartType( final int baseMetaValue, final String itemModel, final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c, final GuiText en, final String oreDict ) PartType(final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c, final GuiText en, final String oreDict)
{ {
this.baseDamage = baseMetaValue;
this.features = Collections.unmodifiableSet( features ); this.features = Collections.unmodifiableSet( features );
this.integrations = Collections.unmodifiableSet( integrations ); this.integrations = Collections.unmodifiableSet( integrations );
this.myPart = c;
this.extraName = en; this.extraName = en;
this.oreName = oreDict; this.oreName = oreDict;
// The part is enabled if all features + integrations it needs are enabled if( c != null )
this.enabled = features.stream().allMatch( AEConfig.instance()::isFeatureEnabled ); /* FIXME && integrations.stream()
.allMatch( IntegrationRegistry.INSTANCE::isEnabled ); */
if( this.enabled )
{ {
// Only load models if the part is enabled, otherwise we also run into class-loading issues while this.models = new HashSet<>( PartModelsHelper.createModels( c ) );
// scanning for annotations
if( Platform.isClientInstall() )
{
this.itemModels = this.createItemModels( itemModel );
}
if( c != null )
{
this.models = new HashSet<>( PartModelsHelper.createModels( c ) );
}
else
{
this.models = Collections.emptySet();
}
} }
else else
{ {
if( Platform.isClientInstall() )
{
this.itemModels = Collections.emptyList();
}
this.models = Collections.emptySet(); this.models = Collections.emptySet();
} }
} }
@OnlyIn( Dist.CLIENT )
protected List<ModelResourceLocation> createItemModels( String baseName )
{
return ImmutableList.of( modelFromBaseName( baseName ) );
}
@OnlyIn( Dist.CLIENT )
private static ModelResourceLocation modelFromBaseName( String baseName )
{
return new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, "part/" + baseName ), "inventory" );
}
public boolean isEnabled()
{
return this.enabled;
}
int getBaseDamage()
{
return this.baseDamage;
}
public boolean isCable() public boolean isCable()
{ {
return false; return false;
@@ -420,22 +316,11 @@ public enum PartType
return this.extraName; return this.extraName;
} }
void setConstructor( final Constructor<? extends IPart> constructor )
{
this.constructor = constructor;
}
public String getOreName() public String getOreName()
{ {
return this.oreName; return this.oreName;
} }
@OnlyIn( Dist.CLIENT )
public List<ModelResourceLocation> getItemModels()
{
return this.itemModels;
}
public Set<ResourceLocation> getModels() public Set<ResourceLocation> getModels()
{ {
return this.models; return this.models;
@@ -21,7 +21,11 @@ package appeng.parts.reporting;
import java.util.List; import java.util.List;
import appeng.container.ContainerLocator;
import appeng.container.ContainerOpener;
import appeng.container.implementations.ContainerMEMonitorable;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
@@ -115,18 +119,18 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
{ {
if( !super.onPartActivate( player, hand, pos ) ) if( !super.onPartActivate( player, hand, pos ) )
{ {
if( Platform.isServer() ) if( !player.world.isRemote )
{ {
// FIXME Platform.openGUI( player, this.getHost().getTile(), this.getSide(), this.getGui( player ) ); ContainerOpener.openContainer(getContainerType(player), player, ContainerLocator.forPart(this));
} }
} }
return true; return true;
} }
// FIXME public GuiBridge getGui( final PlayerEntity player ) public ContainerType<?> getContainerType(final PlayerEntity player )
// FIXME { {
// FIXME return GuiBridge.GUI_ME; return ContainerMEMonitorable.TYPE;
// FIXME } }
@Override @Override
public <T extends IAEStack<T>> IMEMonitor<T> getInventory( IStorageChannel<T> channel ) public <T extends IAEStack<T>> IMEMonitor<T> getInventory( IStorageChannel<T> channel )
@@ -21,7 +21,13 @@ package appeng.parts.reporting;
import java.util.List; import java.util.List;
import appeng.api.config.SecurityPermissions;
import appeng.api.networking.security.IActionHost;
import appeng.container.implementations.ContainerCraftingTerm;
import appeng.container.implementations.ContainerMEMonitorable;
import appeng.util.Platform;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@@ -84,25 +90,15 @@ public class PartCraftingTerminal extends AbstractPartTerminal
this.craftingGrid.writeToNBT( data, "craftingGrid" ); this.craftingGrid.writeToNBT( data, "craftingGrid" );
} }
// FIXME @Override @Override
// FIXME public GuiBridge getGui( final PlayerEntity p ) public ContainerType<?> getContainerType(final PlayerEntity p )
// FIXME { {
// FIXME int x = (int) p.getPosX(); if( Platform.checkPermissions( p, this, SecurityPermissions.CRAFT, false) )
// FIXME int y = (int) p.getPosY(); {
// FIXME int z = (int) p.getPosZ(); return ContainerCraftingTerm.TYPE;
// FIXME if( this.getHost().getTile() != null ) }
// FIXME { return ContainerMEMonitorable.TYPE;
// FIXME x = this.getTile().getPos().getX(); }
// FIXME y = this.getTile().getPos().getY();
// FIXME z = this.getTile().getPos().getZ();
// FIXME }
// FIXME
// FIXME if( GuiBridge.GUI_CRAFTING_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.getSide(), p ) )
// FIXME {
// FIXME return GuiBridge.GUI_CRAFTING_TERMINAL;
// FIXME }
// FIXME return GuiBridge.GUI_ME;
// FIXME }
@Override @Override
public IItemHandler getInventoryByName( final String name ) public IItemHandler getInventoryByName( final String name )
@@ -21,7 +21,12 @@ package appeng.parts.reporting;
import java.util.List; import java.util.List;
import appeng.api.config.SecurityPermissions;
import appeng.container.implementations.ContainerMEMonitorable;
import appeng.container.implementations.ContainerPatternTerm;
import appeng.util.Platform;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@@ -99,25 +104,15 @@ public class PartPatternTerminal extends AbstractPartTerminal
this.crafting.writeToNBT( data, "craftingGrid" ); this.crafting.writeToNBT( data, "craftingGrid" );
} }
// FIXME @Override @Override
// FIXME public GuiBridge getGui( final PlayerEntity p ) public ContainerType<?> getContainerType(final PlayerEntity p )
// FIXME { {
// FIXME int x = (int) p.getPosX(); if(Platform.checkPermissions(p, this, SecurityPermissions.CRAFT, false) )
// FIXME int y = (int) p.getPosY(); {
// FIXME int z = (int) p.getPosZ(); return ContainerPatternTerm.TYPE;
// FIXME if( this.getHost().getTile() != null ) }
// FIXME { return ContainerMEMonitorable.TYPE;
// FIXME x = this.getTile().getPos().getX(); }
// FIXME y = this.getTile().getPos().getY();
// FIXME z = this.getTile().getPos().getZ();
// FIXME }
// FIXME
// FIXME if( GuiBridge.GUI_PATTERN_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.getSide(), p ) )
// FIXME {
// FIXME return GuiBridge.GUI_PATTERN_TERMINAL;
// FIXME }
// FIXME return GuiBridge.GUI_ME;
// FIXME }
@Override @Override
public void onChangeInventory( final IItemHandler inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack ) public void onChangeInventory( final IItemHandler inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
@@ -29,7 +29,7 @@ import appeng.api.parts.IPart;
import appeng.tile.AEBaseTile; import appeng.tile.AEBaseTile;
public class CableBusTESR extends TileEntityRenderer<TileCableBusTESR> public class CableBusTESR extends TileEntityRenderer<TileCableBus>
{ {
public CableBusTESR(TileEntityRendererDispatcher rendererDispatcherIn) { public CableBusTESR(TileEntityRendererDispatcher rendererDispatcherIn) {
@@ -37,7 +37,11 @@ public class CableBusTESR extends TileEntityRenderer<TileCableBusTESR>
} }
@Override @Override
public void render(TileCableBusTESR te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int combinedLightIn, int combinedOverlayIn) { public void render(TileCableBus te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int combinedLightIn, int combinedOverlayIn) {
if (!te.getCableBus().isRequiresDynamicRender()) {
return;
}
for( Direction facing : Direction.values() ) for( Direction facing : Direction.values() )
{ {
IPart part = te.getPart( facing ); IPart part = te.getPart( facing );
@@ -62,8 +62,6 @@ import java.util.Set;
public class TileCableBus extends AEBaseTile implements AEMultiTile public class TileCableBus extends AEBaseTile implements AEMultiTile
{ {
public static final ModelProperty<CableBusRenderState> RENDER_STATE_PROPERTY = new ModelProperty<>();
private CableBusContainer cb = new CableBusContainer( this ); private CableBusContainer cb = new CableBusContainer( this );
private int oldLV = -1; // on re-calculate light when it changes private int oldLV = -1; // on re-calculate light when it changes
@@ -117,19 +115,19 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile
*/ */
protected void updateTileSetting() protected void updateTileSetting()
{ {
if( this.getCableBus().isRequiresDynamicRender() ) // FIXME if( this.getCableBus().isRequiresDynamicRender() )
{ // FIXME {
try // FIXME try
{ // FIXME {
final TileCableBus tcb = (TileCableBus) BlockCableBus.getTesrTile().newInstance(); // FIXME final TileCableBus tcb = (TileCableBus) BlockCableBus.getTesrTile().newInstance();
tcb.copyFrom( this ); // FIXME tcb.copyFrom( this );
this.getWorld().setTileEntity( this.pos, tcb ); // FIXME this.getWorld().setTileEntity( this.pos, tcb );
} // FIXME }
catch( final Throwable ignored ) // FIXME catch( final Throwable ignored )
{ // FIXME {
// FIXME
} // FIXME }
} // FIXME }
} }
protected void copyFrom( final TileCableBus oldTile ) protected void copyFrom( final TileCableBus oldTile )
@@ -401,7 +399,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile
renderState.setWorld(world); renderState.setWorld(world);
renderState.setPos(pos); renderState.setPos(pos);
return new ModelDataMap.Builder() return new ModelDataMap.Builder()
.withInitial(RENDER_STATE_PROPERTY, renderState) .withInitial(CableBusRenderState.PROPERTY, renderState)
.build(); .build();
} }
@@ -36,18 +36,18 @@ public class TileCableBusTESR extends TileCableBus
@Override @Override
protected void updateTileSetting() protected void updateTileSetting()
{ {
if( !this.getCableBus().isRequiresDynamicRender() ) // FIXME if( !this.getCableBus().isRequiresDynamicRender() )
{ // FIXME {
try // FIXME try
{ // FIXME {
final TileCableBus tcb = (TileCableBus) BlockCableBus.getNoTesrTile().newInstance(); // FIXME final TileCableBus tcb = (TileCableBus) BlockCableBus.getNoTesrTile().newInstance();
tcb.copyFrom( this ); // FIXME tcb.copyFrom( this );
this.getWorld().setTileEntity( this.pos, tcb ); // FIXME this.getWorld().setTileEntity( this.pos, tcb );
} // FIXME }
catch( final Throwable ignored ) // FIXME catch( final Throwable ignored )
{ // FIXME {
// FIXME
} // FIXME }
} // FIXME }
} }
} }
@@ -23,6 +23,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction; import net.minecraft.util.Direction;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandler;
@@ -43,15 +44,16 @@ public abstract class InventoryAdaptor implements Iterable<ItemSlot>
{ {
public static InventoryAdaptor getAdaptor( final TileEntity te, final Direction d ) public static InventoryAdaptor getAdaptor( final TileEntity te, final Direction d )
{ {
// FIXME if( te != null && te.getCapability( CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, d ) ) if( te != null )
// FIXME { {
// FIXME // Attempt getting an IItemHandler for the given side via caps LazyOptional<IItemHandler> cap = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, d);
// FIXME IItemHandler itemHandler = te.getCapability( CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, d );
// FIXME if( itemHandler != null ) // Attempt getting an IItemHandler for the given side via caps
// FIXME { if( cap.isPresent() )
// FIXME return new AdaptorItemHandler( itemHandler ); {
// FIXME } return new AdaptorItemHandler( cap.orElseThrow(IllegalStateException::new) );
// FIXME } }
}
return null; return null;
} }
+33 -38
View File
@@ -33,6 +33,7 @@ import appeng.api.networking.security.IActionHost;
import appeng.api.networking.security.IActionSource; import appeng.api.networking.security.IActionSource;
import appeng.api.networking.security.ISecurityGrid; import appeng.api.networking.security.ISecurityGrid;
import appeng.api.networking.storage.IStorageGrid; import appeng.api.networking.storage.IStorageGrid;
import appeng.api.parts.IPart;
import appeng.api.storage.IMEInventory; import appeng.api.storage.IMEInventory;
import appeng.api.storage.IMEMonitor; import appeng.api.storage.IMEMonitor;
import appeng.api.storage.IMEMonitorHandlerReceiver; import appeng.api.storage.IMEMonitorHandlerReceiver;
@@ -77,6 +78,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.*; import net.minecraft.util.math.*;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld; import net.minecraft.world.server.ServerWorld;
@@ -325,44 +327,6 @@ public class Platform
return false; return false;
} }
// public static void openGUI(@Nonnull final PlayerEntity p, @Nullable final TileEntity tile, @Nullable final AEPartLocation side, @Nonnull final ContainerType<?> type )
// {
// if( isClient() )
// {
// return;
// }
//
// int x = (int) p.getPosX();
// int y = (int) p.getPosY();
// int z = (int) p.getPosZ();
// if( tile != null )
// {
// x = tile.getPos().getX();
// y = tile.getPos().getY();
// z = tile.getPos().getZ();
// }
//
// if( ( type.getType().isItem() && tile == null ) || type.hasPermissions( tile, x, y, z, side, p ) )
// {
// if( tile == null && type.getType() == GuiHostType.ITEM )
// {
// NetworkHooks.openGui(p, );
// // FIXME NetworkHooks.openGui
// // p.openGui( AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), p.inventory.currentItem, 0, 0 );
// }
// else if( tile == null || type.getType() == GuiHostType.ITEM )
// {
// // FIXME NetworkHooks.openGui
// // p.openGui( AppEng.instance(), type.ordinal() << 4 | ( 1 << 3 ), p.getEntityWorld(), x, y, z );
// }
// else
// {
// // FIXME NetworkHooks.openGui
// // p.openGui( AppEng.instance(), type.ordinal() << 4 | ( side.ordinal() ), tile.getWorld(), x, y, z );
// }
// }
// }
/** /**
* @return True if client-side classes (such as Renderers) are available. * @return True if client-side classes (such as Renderers) are available.
*/ */
@@ -393,6 +357,37 @@ public class Platform
} }
return player.world.canMineBlockBody( player, dc.getPos() ); return player.world.canMineBlockBody( player, dc.getPos() );
} }
public static boolean checkPermissions(final PlayerEntity player, final Object accessInterface, SecurityPermissions requiredPermission, boolean notifyPlayer) {
// FIXME: Check permissions...
if (requiredPermission != null && accessInterface instanceof IActionHost) {
final IGridNode gn = ((IActionHost) accessInterface).getActionableNode();
if (gn != null) {
final IGrid g = gn.getGrid();
if (g != null) {
final boolean requirePower = false;
if (requirePower) {
final IEnergyGrid eg = g.getCache(IEnergyGrid.class);
if (!eg.isNetworkPowered()) {
// FIXME trace logging?
return false;
}
}
final ISecurityGrid sg = g.getCache(ISecurityGrid.class);
if (!sg.hasPermission(player, requiredPermission)) {
player.sendMessage(new TranslationTextComponent("appliedenergistics2.permission_denied")
.applyTextStyle(TextFormatting.RED));
// FIXME trace logging?
return false;
}
}
}
}
return true;
}
// //
// /* // /*
// * Checks to see if a block is air? // * Checks to see if a block is air?
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/plane_sides", "sides": "appliedenergistics2:parts/plane_sides",
"plane": "appliedenergistics2:item/part/annihilation_plane" "plane": "appliedenergistics2:item/part/annihilation_plane"
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_covered_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/black" "base": "appliedenergistics2:parts/cable/covered/black"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_covered_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/black" "base": "appliedenergistics2:parts/cable/dense_covered/black"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_glass_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/black" "base": "appliedenergistics2:parts/cable/glass/black"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_smart_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/black" "base": "appliedenergistics2:parts/cable/smart/black"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_smart_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/black" "base": "appliedenergistics2:parts/cable/dense_smart/black"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_covered_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/blue" "base": "appliedenergistics2:parts/cable/covered/blue"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_covered_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/blue" "base": "appliedenergistics2:parts/cable/dense_covered/blue"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_glass_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/blue" "base": "appliedenergistics2:parts/cable/glass/blue"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_smart_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/blue" "base": "appliedenergistics2:parts/cable/smart/blue"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_smart_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/blue" "base": "appliedenergistics2:parts/cable/dense_smart/blue"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_covered_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/brown" "base": "appliedenergistics2:parts/cable/covered/brown"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_covered_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/brown" "base": "appliedenergistics2:parts/cable/dense_covered/brown"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_glass_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/brown" "base": "appliedenergistics2:parts/cable/glass/brown"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_smart_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/brown" "base": "appliedenergistics2:parts/cable/smart/brown"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_smart_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/brown" "base": "appliedenergistics2:parts/cable/dense_smart/brown"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"all": "appliedenergistics2:parts/cable_anchor", "all": "appliedenergistics2:parts/cable_anchor",
"particle": "appliedenergistics2:parts/cable_anchor" "particle": "appliedenergistics2:parts/cable_anchor"
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/monitor_sides", "sides": "appliedenergistics2:parts/monitor_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:parts/monitor_back",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/monitor_sides", "sides": "appliedenergistics2:parts/monitor_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:parts/monitor_back",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/display", "parent": "appliedenergistics2:item/display_base",
"textures": { "textures": {
"front": "appliedenergistics2:item/part/conversion_monitor", "front": "appliedenergistics2:item/part/conversion_monitor",
"front_bright": "appliedenergistics2:parts/conversion_monitor_bright", "front_bright": "appliedenergistics2:parts/conversion_monitor_bright",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"elements": [ "elements": [
{ {
"name": "Element", "name": "Element",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"elements": [ "elements": [
{ {
"name": "Base", "name": "Base",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/display", "parent": "appliedenergistics2:item/display_base",
"textures": { "textures": {
"front": "appliedenergistics2:item/part/crafting_terminal", "front": "appliedenergistics2:item/part/crafting_terminal",
"front_bright": "appliedenergistics2:parts/crafting_terminal_bright", "front_bright": "appliedenergistics2:parts/crafting_terminal_bright",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_covered_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/cyan" "base": "appliedenergistics2:parts/cable/covered/cyan"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_covered_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/cyan" "base": "appliedenergistics2:parts/cable/dense_covered/cyan"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_glass_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/cyan" "base": "appliedenergistics2:parts/cable/glass/cyan"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_smart_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/cyan" "base": "appliedenergistics2:parts/cable/smart/cyan"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_smart_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/cyan" "base": "appliedenergistics2:parts/cable/dense_smart/cyan"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/display", "parent": "appliedenergistics2:item/display_base",
"textures": { "textures": {
"front": "appliedenergistics2:parts/monitor_front", "front": "appliedenergistics2:parts/monitor_front",
"front_bright": "appliedenergistics2:parts/monitor_colored", "front_bright": "appliedenergistics2:parts/monitor_colored",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/monitor_sides", "sides": "appliedenergistics2:parts/monitor_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:parts/monitor_back",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/export_bus_sides", "sides": "appliedenergistics2:parts/export_bus_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:parts/monitor_back",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/p2p_tunnel", "parent": "appliedenergistics2:item/p2p_tunnel_base",
"textures": { "textures": {
"type": "block/gold_block" "type": "block/gold_block"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/plane_sides", "sides": "appliedenergistics2:parts/plane_sides",
"plane": "appliedenergistics2:item/part/fluid_annihilation_plane" "plane": "appliedenergistics2:item/part/fluid_annihilation_plane"
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/export_bus_sides", "sides": "appliedenergistics2:parts/export_bus_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:parts/monitor_back",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/annihilation_plane", "parent": "appliedenergistics2:item/annihilation_plane",
"textures": { "textures": {
"plane": "appliedenergistics2:item/part/fluid_formation_plane" "plane": "appliedenergistics2:item/part/fluid_formation_plane"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/import_bus_sides", "sides": "appliedenergistics2:parts/import_bus_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:parts/monitor_back",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"emitter": "appliedenergistics2:item/part/level_emitter_off" "emitter": "appliedenergistics2:item/part/level_emitter_off"
}, },
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/p2p_tunnel", "parent": "appliedenergistics2:item/p2p_tunnel_base",
"textures": { "textures": {
"type": "block/lapis_block" "type": "block/lapis_block"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/storage_bus_sides", "sides": "appliedenergistics2:parts/storage_bus_sides",
"back": "appliedenergistics2:parts/storage_bus_back", "back": "appliedenergistics2:parts/storage_bus_back",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/display", "parent": "appliedenergistics2:item/display_base",
"textures": { "textures": {
"front": "appliedenergistics2:item/part/crafting_terminal", "front": "appliedenergistics2:item/part/crafting_terminal",
"front_bright": "appliedenergistics2:parts/fluid_terminal/lights_bright", "front_bright": "appliedenergistics2:parts/fluid_terminal/lights_bright",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_covered_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/transparent" "base": "appliedenergistics2:parts/cable/covered/transparent"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_covered_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/transparent" "base": "appliedenergistics2:parts/cable/dense_covered/transparent"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_glass_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/transparent" "base": "appliedenergistics2:parts/cable/glass/transparent"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_smart_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/transparent" "base": "appliedenergistics2:parts/cable/smart/transparent"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_smart_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/transparent" "base": "appliedenergistics2:parts/cable/dense_smart/transparent"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/annihilation_plane", "parent": "appliedenergistics2:item/annihilation_plane",
"textures": { "textures": {
"plane": "appliedenergistics2:item/part/formation_plane" "plane": "appliedenergistics2:item/part/formation_plane"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"elements": [ "elements": [
{ {
"from": [ "from": [
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_covered_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/gray" "base": "appliedenergistics2:parts/cable/covered/gray"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_covered_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/gray" "base": "appliedenergistics2:parts/cable/dense_covered/gray"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_glass_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/gray" "base": "appliedenergistics2:parts/cable/glass/gray"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_smart_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/gray" "base": "appliedenergistics2:parts/cable/smart/gray"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_smart_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/gray" "base": "appliedenergistics2:parts/cable/dense_smart/gray"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_covered_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/green" "base": "appliedenergistics2:parts/cable/covered/green"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_covered_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/green" "base": "appliedenergistics2:parts/cable/dense_covered/green"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_glass_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/green" "base": "appliedenergistics2:parts/cable/glass/green"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_smart_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/green" "base": "appliedenergistics2:parts/cable/smart/green"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_smart_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/green" "base": "appliedenergistics2:parts/cable/dense_smart/green"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/p2p_tunnel", "parent": "appliedenergistics2:item/p2p_tunnel_base",
"textures": { "textures": {
"type": "block/diamond_block" "type": "block/diamond_block"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/annihilation_plane", "parent": "appliedenergistics2:item/annihilation_plane",
"textures": { "textures": {
"plane": "appliedenergistics2:item/part/identity_annihilation_plane" "plane": "appliedenergistics2:item/part/identity_annihilation_plane"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"sides": "appliedenergistics2:parts/import_bus_sides", "sides": "appliedenergistics2:parts/import_bus_sides",
"back": "appliedenergistics2:parts/monitor_back", "back": "appliedenergistics2:parts/monitor_back",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/display", "parent": "appliedenergistics2:item/display_base",
"textures": { "textures": {
"front": "appliedenergistics2:item/part/interface_terminal", "front": "appliedenergistics2:item/part/interface_terminal",
"front_bright": "appliedenergistics2:parts/interface_terminal_bright", "front_bright": "appliedenergistics2:parts/interface_terminal_bright",
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/toggle_bus", "parent": "appliedenergistics2:item/toggle_bus",
"textures": { "textures": {
"bus": "appliedenergistics2:item/part/inverted_toggle_bus" "bus": "appliedenergistics2:item/part/inverted_toggle_bus"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/p2p_tunnel", "parent": "appliedenergistics2:item/p2p_tunnel_base",
"textures": { "textures": {
"type": "block/hopper_outside" "type": "block/hopper_outside"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/part", "parent": "appliedenergistics2:item/part_base",
"textures": { "textures": {
"emitter": "appliedenergistics2:item/part/level_emitter_off" "emitter": "appliedenergistics2:item/part/level_emitter_off"
}, },
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_covered_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/light_blue" "base": "appliedenergistics2:parts/cable/covered/light_blue"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_covered_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/light_blue" "base": "appliedenergistics2:parts/cable/dense_covered/light_blue"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_glass_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/light_blue" "base": "appliedenergistics2:parts/cable/glass/light_blue"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_smart_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/light_blue" "base": "appliedenergistics2:parts/cable/smart/light_blue"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_smart_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/light_blue" "base": "appliedenergistics2:parts/cable/dense_smart/light_blue"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_covered_base", "parent": "appliedenergistics2:item/covered_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/covered/light_gray" "base": "appliedenergistics2:parts/cable/covered/light_gray"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_covered_base", "parent": "appliedenergistics2:item/covered_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_covered/light_gray" "base": "appliedenergistics2:parts/cable/dense_covered/light_gray"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_glass_base", "parent": "appliedenergistics2:item/glass_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/glass/light_gray" "base": "appliedenergistics2:parts/cable/glass/light_gray"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_smart_base", "parent": "appliedenergistics2:item/smart_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/smart/light_gray" "base": "appliedenergistics2:parts/cable/smart/light_gray"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/cable_dense_smart_base", "parent": "appliedenergistics2:item/smart_dense_cable_base",
"textures": { "textures": {
"base": "appliedenergistics2:parts/cable/dense_smart/light_gray" "base": "appliedenergistics2:parts/cable/dense_smart/light_gray"
} }
@@ -1,5 +1,5 @@
{ {
"parent": "appliedenergistics2:item/part/p2p_tunnel", "parent": "appliedenergistics2:item/p2p_tunnel_base",
"textures": { "textures": {
"type": "block/quartz_block_top" "type": "block/quartz_block_top"
} }

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