Fixes anchor rendering (#2698)

* Fixes #2680: Use a shorter cable anchor model when blocked by a facade.
* Fixes #2664: Prevent anchors from creating intersection.

Replaced the simple List<ResourceLocation> for the static models with a
new container also indicating a solid part, which can be used to prevent
the creation of an intersection.
This commit is contained in:
yueh
2016-12-14 22:37:10 +01:00
committed by GitHub
parent 8bed7f223e
commit a14cf2204d
74 changed files with 525 additions and 320 deletions
@@ -25,6 +25,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.util.Set;
import javax.annotation.Nullable;
import io.netty.buffer.ByteBuf;
+80
View File
@@ -0,0 +1,80 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.parts;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.util.ResourceLocation;
import appeng.api.parts.IPartModel;
public class PartModel implements IPartModel
{
private final boolean isSolid;
private final List<ResourceLocation> resources;
public PartModel( ResourceLocation resource )
{
this( true, resource );
}
public PartModel( ResourceLocation... resources )
{
this( true, resources );
}
public PartModel( boolean isSolid, ResourceLocation resource )
{
this( isSolid, ImmutableList.of( resource ) );
}
public PartModel( boolean isSolid, ResourceLocation... resources )
{
this( isSolid, ImmutableList.copyOf( resources ) );
}
public PartModel( List<ResourceLocation> resources )
{
this( true, resources );
}
public PartModel( boolean isSolid, List<ResourceLocation> resources )
{
this.isSolid = isSolid;
this.resources = resources;
}
@Override
public boolean requireCableConnection()
{
return this.isSolid;
}
@Override
public List<ResourceLocation> getModels()
{
return this.resources;
}
}
@@ -31,7 +31,6 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -53,6 +52,7 @@ import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartModel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.AECableType;
import appeng.api.util.AEPartLocation;
@@ -74,7 +74,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
private static final PlaneModels MODELS = new PlaneModels( "part/annihilation_plane_", "part/annihilation_plane_on_" );
@PartModels
public static List<ResourceLocation> getModels()
public static List<IPartModel> getModels()
{
return MODELS.getModels();
}
@@ -233,8 +233,9 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
boolean capture = false;
final BlockPos pos = this.getTile().getPos();
// This is the middle point of the entities BB, which is better suited for comparisons that don't rely on it "touching" the plane
double posYMiddle = (entity.getEntityBoundingBox().minY + entity.getEntityBoundingBox().maxY) / 2.0D;
// This is the middle point of the entities BB, which is better suited for comparisons that don't rely on it
// "touching" the plane
double posYMiddle = ( entity.getEntityBoundingBox().minY + entity.getEntityBoundingBox().maxY ) / 2.0D;
switch( this.getSide() )
{
@@ -244,7 +245,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
if( entity.posZ > pos.getZ() && entity.posZ < pos.getZ() + 1 )
{
if( ( entity.posY > pos.getY() + 0.9 && this.getSide() == AEPartLocation.UP ) || ( entity.posY < pos.getY() + 0.1 && this.getSide() == AEPartLocation.DOWN ) )
if( ( entity.posY > pos.getY() + 0.9 && this.getSide() == AEPartLocation.UP ) || ( entity.posY < pos.getY() + 0.1 && this
.getSide() == AEPartLocation.DOWN ) )
{
capture = true;
}
@@ -257,7 +259,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
if( posYMiddle > pos.getY() && posYMiddle < pos.getY() + 1 )
{
if( ( entity.posZ > pos.getZ() + 0.9 && this.getSide() == AEPartLocation.SOUTH ) || ( entity.posZ < pos.getZ() + 0.1 && this.getSide() == AEPartLocation.NORTH ) )
if( ( entity.posZ > pos.getZ() + 0.9 && this.getSide() == AEPartLocation.SOUTH ) || ( entity.posZ < pos.getZ() + 0.1 && this
.getSide() == AEPartLocation.NORTH ) )
{
capture = true;
}
@@ -270,7 +273,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
if( posYMiddle > pos.getY() && posYMiddle < pos.getY() + 1 )
{
if( ( entity.posX > pos.getX() + 0.9 && this.getSide() == AEPartLocation.EAST ) || ( entity.posX < pos.getX() + 0.1 && this.getSide() == AEPartLocation.WEST ) )
if( ( entity.posX > pos.getX() + 0.9 && this.getSide() == AEPartLocation.EAST ) || ( entity.posX < pos.getX() + 0.1 && this
.getSide() == AEPartLocation.WEST ) )
{
capture = true;
}
@@ -288,7 +292,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
if( changed )
{
ServerHelper.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, this.getTile().getWorld(), new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, this.getSide(), false ) );
ServerHelper.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, this.getTile().getWorld(),
new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, this.getSide(), false ) );
}
}
}
@@ -452,7 +457,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
energy.extractAEPower( requiredPower, Actionable.MODULATE, PowerMultiplier.CONFIG );
this.breakBlockAndStoreItems( w, pos, items );
ServerHelper.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, w, new PacketTransitionEffect( pos.getX(), pos.getY(), pos.getZ(), this.getSide(), true ) );
ServerHelper.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, w,
new PacketTransitionEffect( pos.getX(), pos.getY(), pos.getZ(), this.getSide(), true ) );
}
else
{
@@ -500,9 +506,12 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
final Material material = state.getMaterial();
final float hardness = state.getBlockHardness( w, pos );
final boolean ignoreMaterials = material == Material.AIR || material == Material.LAVA || material == Material.WATER || material.isLiquid();
final boolean ignoreBlocks = state.getBlock() == Blocks.BEDROCK || state.getBlock() == Blocks.END_PORTAL || state.getBlock() == Blocks.END_PORTAL_FRAME || state.getBlock() == Blocks.COMMAND_BLOCK;
final boolean ignoreBlocks = state.getBlock() == Blocks.BEDROCK || state.getBlock() == Blocks.END_PORTAL || state
.getBlock() == Blocks.END_PORTAL_FRAME || state.getBlock() == Blocks.COMMAND_BLOCK;
return !ignoreMaterials && !ignoreBlocks && !w.isAirBlock( pos ) && w.isBlockLoaded( pos ) && w.canMineBlockBody( Platform.getPlayer( w ), pos ) && hardness >= 0f;
return !ignoreMaterials && !ignoreBlocks && hardness >= 0f && !w.isAirBlock( pos ) && w.isBlockLoaded( pos ) && w.canMineBlockBody(
Platform.getPlayer( w ),
pos );
}
protected List<ItemStack> obtainBlockDrops( final WorldServer w, final BlockPos pos )
@@ -568,7 +577,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
w.setBlockToAir( pos );
final AxisAlignedBB box = new AxisAlignedBB( pos.getX() - 0.2, pos.getY() - 0.2, pos.getZ() - 0.2, pos.getX() + 1.2, pos.getY() + 1.2, pos.getZ() + 1.2 );
final AxisAlignedBB box = new AxisAlignedBB( pos.getX() - 0.2, pos.getY() - 0.2, pos.getZ() - 0.2, pos.getX() + 1.2, pos.getY() + 1.2, pos
.getZ() + 1.2 );
for( final Object ei : w.getEntitiesWithinAABB( EntityItem.class, box ) )
{
if( ei instanceof EntityItem )
@@ -586,7 +596,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return MODELS.getModel( getConnections(), isPowered(), isActive() );
}
@@ -19,8 +19,6 @@
package appeng.parts.automation;
import java.util.List;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
@@ -49,6 +47,7 @@ import appeng.api.networking.security.MachineSource;
import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartModel;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.data.IAEItemStack;
@@ -61,6 +60,7 @@ import appeng.helpers.MultiCraftingTracker;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
import appeng.parts.PartModel;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
@@ -70,22 +70,16 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
{
public static final ResourceLocation MODEL_BASE = new ResourceLocation( AppEng.MOD_ID, "part/export_bus_base" );
@PartModels
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/export_bus_off" )
);
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/export_bus_off" ) );
@PartModels
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/export_bus_on" )
);
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/export_bus_on" ) );
@PartModels
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/export_bus_has_channel" )
);
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/export_bus_has_channel" ) );
private final MultiCraftingTracker craftingTracker = new MultiCraftingTracker( this, 9 );
private final BaseActionSource mySrc;
private long itemToSend = 1;
@@ -154,7 +148,8 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
{
if( this.isCraftingEnabled() )
{
this.didSomething = this.craftingTracker.handleCrafting( slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(), this.getProxy().getGrid(), cg, this.mySrc ) || this.didSomething;
this.didSomething = this.craftingTracker.handleCrafting( slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(),
this.getProxy().getGrid(), cg, this.mySrc ) || this.didSomething;
}
continue;
}
@@ -179,7 +174,8 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
if( this.itemToSend == before && this.isCraftingEnabled() )
{
this.didSomething = this.craftingTracker.handleCrafting( slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(), this.getProxy().getGrid(), cg, this.mySrc ) || this.didSomething;
this.didSomething = this.craftingTracker.handleCrafting( slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(),
this.getProxy().getGrid(), cg, this.mySrc ) || this.didSomething;
}
}
@@ -362,7 +358,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
if( isActive() && isPowered() )
{
@@ -37,7 +37,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
@@ -62,6 +61,7 @@ import appeng.api.parts.IPart;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartItem;
import appeng.api.parts.IPartModel;
import appeng.api.storage.ICellContainer;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.IMEInventoryHandler;
@@ -90,7 +90,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
private static final PlaneModels MODELS = new PlaneModels( "part/formation_plane_", "part/formation_plane_on_" );
@PartModels
public static List<ResourceLocation> getModels()
public static List<IPartModel> getModels()
{
return MODELS.getModels();
}
@@ -447,8 +447,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
if( w.getBlockState( tePos ).getBlock().isReplaceable( w, tePos ) )
{
if( placeBlock == YesNo.YES && ( i instanceof ItemBlock || i instanceof IPlantable || i instanceof ItemSkull || i instanceof ItemFirework || i instanceof IPartItem || i == Item.getItemFromBlock(
Blocks.REEDS ) ) )
if( placeBlock == YesNo.YES && ( i instanceof ItemBlock || i instanceof IPlantable || i instanceof ItemSkull || i instanceof ItemFirework || i instanceof IPartItem || i == Item
.getItemFromBlock(
Blocks.REEDS ) ) )
{
final EntityPlayer player = Platform.getPlayer( (WorldServer) w );
Platform.configurePlayer( player, side, this.getTile() );
@@ -614,7 +615,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return MODELS.getModel( getConnections(), isPowered(), isActive() );
}
@@ -26,7 +26,6 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayer;
@@ -34,6 +33,7 @@ import net.minecraftforge.common.util.FakePlayerFactory;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartModel;
import appeng.api.util.AEPartLocation;
import appeng.items.parts.PartModels;
@@ -44,7 +44,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane
private static final PlaneModels MODELS = new PlaneModels( "part/identity_annihilation_plane_", "part/identity_annihilation_plane_on_" );
@PartModels
public static List<ResourceLocation> getModels()
public static List<IPartModel> getModels()
{
return MODELS.getModels();
}
@@ -105,7 +105,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return MODELS.getModel( getConnections(), isPowered(), isActive() );
}
@@ -19,10 +19,6 @@
package appeng.parts.automation;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
@@ -44,6 +40,7 @@ import appeng.api.networking.security.MachineSource;
import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartModel;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.data.IAEItemStack;
@@ -54,6 +51,7 @@ import appeng.core.sync.GuiBridge;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
import appeng.parts.PartModel;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
import appeng.util.inv.IInventoryDestination;
@@ -65,21 +63,12 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
public static final ResourceLocation MODEL_BASE = new ResourceLocation( AppEng.MOD_ID, "part/import_bus_base" );
@PartModels
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/import_bus_off" )
);
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/import_bus_off" ) );
@PartModels
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/import_bus_on" )
);
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/import_bus_on" ) );
@PartModels
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/import_bus_has_channel" )
);
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/import_bus_has_channel" ) );
private final BaseActionSource source;
private IMEInventory<IAEItemStack> destination = null;
private IAEItemStack lastItemChecked = null;
@@ -104,7 +93,8 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
return false;
}
final IAEItemStack out = this.destination.injectItems( this.lastItemChecked = AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE, this.source );
final IAEItemStack out = this.destination.injectItems( this.lastItemChecked = AEApi.instance().storage().createItemStack( stack ), Actionable.SIMULATE,
this.source );
if( out == null )
{
return true;
@@ -173,7 +163,8 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
try
{
this.itemToSend = this.calculateItemsToSend();
this.itemToSend = Math.min( this.itemToSend, (int) ( 0.01 + this.getProxy().getEnergy().extractAEPower( this.itemToSend, Actionable.SIMULATE, PowerMultiplier.CONFIG ) ) );
this.itemToSend = Math.min( this.itemToSend,
(int) ( 0.01 + this.getProxy().getEnergy().extractAEPower( this.itemToSend, Actionable.SIMULATE, PowerMultiplier.CONFIG ) ) );
final IMEMonitor<IAEItemStack> inv = this.getProxy().getStorage().getItemInventory();
final IEnergyGrid energy = this.getProxy().getEnergy();
@@ -235,7 +226,8 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
if( newItems != null )
{
newItems.stackSize = (int) ( Math.min( newItems.stackSize, energy.extractAEPower( newItems.stackSize, Actionable.SIMULATE, PowerMultiplier.CONFIG ) ) + 0.01 );
newItems.stackSize = (int) ( Math.min( newItems.stackSize,
energy.extractAEPower( newItems.stackSize, Actionable.SIMULATE, PowerMultiplier.CONFIG ) ) + 0.01 );
this.itemToSend -= newItems.stackSize;
if( this.lastItemChecked == null || !this.lastItemChecked.isSameType( newItems ) )
@@ -321,7 +313,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
if( isActive() && isPowered() )
{
@@ -20,11 +20,8 @@ package appeng.parts.automation;
import java.util.Collection;
import java.util.List;
import java.util.Random;
import com.google.common.collect.ImmutableList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
@@ -62,6 +59,7 @@ import appeng.api.networking.storage.IBaseMonitor;
import appeng.api.networking.storage.IStackWatcher;
import appeng.api.networking.storage.IStackWatcherHost;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartModel;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.IMEMonitorHandlerReceiver;
import appeng.api.storage.StorageChannel;
@@ -76,6 +74,7 @@ import appeng.core.sync.GuiBridge;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
import appeng.parts.PartModel;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.tile.inventory.InvOperation;
import appeng.util.Platform;
@@ -95,12 +94,12 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
@PartModels
public static final ResourceLocation MODEL_STATUS_HAS_CHANNEL = new ResourceLocation( AppEng.MOD_ID, "part/level_emitter_status_has_channel" );
public static final List<ResourceLocation> MODEL_OFF_OFF = ImmutableList.of( MODEL_BASE_OFF, MODEL_STATUS_OFF );
public static final List<ResourceLocation> MODEL_OFF_ON = ImmutableList.of( MODEL_BASE_OFF, MODEL_STATUS_ON );
public static final List<ResourceLocation> MODEL_OFF_HAS_CHANNEL = ImmutableList.of( MODEL_BASE_OFF, MODEL_STATUS_HAS_CHANNEL );
public static final List<ResourceLocation> MODEL_ON_OFF = ImmutableList.of( MODEL_BASE_ON, MODEL_STATUS_OFF );
public static final List<ResourceLocation> MODEL_ON_ON = ImmutableList.of( MODEL_BASE_ON, MODEL_STATUS_ON );
public static final List<ResourceLocation> MODEL_ON_HAS_CHANNEL = ImmutableList.of( MODEL_BASE_ON, MODEL_STATUS_HAS_CHANNEL );
public static final PartModel MODEL_OFF_OFF = new PartModel( MODEL_BASE_OFF, MODEL_STATUS_OFF );
public static final PartModel MODEL_OFF_ON = new PartModel( MODEL_BASE_OFF, MODEL_STATUS_ON );
public static final PartModel MODEL_OFF_HAS_CHANNEL = new PartModel( MODEL_BASE_OFF, MODEL_STATUS_HAS_CHANNEL );
public static final PartModel MODEL_ON_OFF = new PartModel( MODEL_BASE_ON, MODEL_STATUS_OFF );
public static final PartModel MODEL_ON_ON = new PartModel( MODEL_BASE_ON, MODEL_STATUS_ON );
public static final PartModel MODEL_ON_HAS_CHANNEL = new PartModel( MODEL_BASE_ON, MODEL_STATUS_HAS_CHANNEL );
private static final int FLAG_ON = 4;
@@ -445,7 +444,8 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
final double d1 = d.yOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
final double d2 = d.zOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
world.spawnParticle( EnumParticleTypes.REDSTONE, 0.5 + pos.getX() + d0, 0.5 + pos.getY() + d1, 0.5 + pos.getZ() + d2, 0.0D, 0.0D, 0.0D, new int[0] );
world.spawnParticle( EnumParticleTypes.REDSTONE, 0.5 + pos.getX() + d0, 0.5 + pos.getY() + d1, 0.5 + pos.getZ() + d2, 0.0D, 0.0D, 0.0D,
new int[0] );
}
}
@@ -561,7 +561,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
if( isActive() && isPowered() )
{
@@ -24,12 +24,13 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import net.minecraft.util.ResourceLocation;
import appeng.api.parts.IPartModel;
import appeng.core.AppEng;
import appeng.parts.PartModel;
/**
@@ -42,26 +43,26 @@ class PlaneModels
public static final ResourceLocation MODEL_CHASSIS_ON = new ResourceLocation( AppEng.MOD_ID, "part/transition_plane_on" );
public static final ResourceLocation MODEL_CHASSIS_HAS_CHANNEL = new ResourceLocation( AppEng.MOD_ID, "part/transition_plane_has_channel" );
private final Map<PlaneConnections, List<ResourceLocation>> modelsOff;
private final Map<PlaneConnections, IPartModel> modelsOff;
private final Map<PlaneConnections, List<ResourceLocation>> modelsOn;
private final Map<PlaneConnections, IPartModel> modelsOn;
private final Map<PlaneConnections, List<ResourceLocation>> modelsHasChannel;
private final Map<PlaneConnections, IPartModel> modelsHasChannel;
public PlaneModels( String prefixOff, String prefixOn )
{
Map<PlaneConnections, List<ResourceLocation>> modelsOff = new HashMap<>();
Map<PlaneConnections, List<ResourceLocation>> modelsOn = new HashMap<>();
Map<PlaneConnections, List<ResourceLocation>> modelsHasChannel = new HashMap<>();
Map<PlaneConnections, IPartModel> modelsOff = new HashMap<>();
Map<PlaneConnections, IPartModel> modelsOn = new HashMap<>();
Map<PlaneConnections, IPartModel> modelsHasChannel = new HashMap<>();
for( PlaneConnections permutation : PlaneConnections.PERMUTATIONS )
{
ResourceLocation planeOff = new ResourceLocation( AppEng.MOD_ID, prefixOff + permutation.getFilenameSuffix() );
ResourceLocation planeOn = new ResourceLocation( AppEng.MOD_ID, prefixOn + permutation.getFilenameSuffix() );
modelsOff.put( permutation, ImmutableList.of( MODEL_CHASSIS_OFF, planeOff ) );
modelsOn.put( permutation, ImmutableList.of( MODEL_CHASSIS_ON, planeOff ) );
modelsHasChannel.put( permutation, ImmutableList.of( MODEL_CHASSIS_HAS_CHANNEL, planeOn ) );
modelsOff.put( permutation, new PartModel( MODEL_CHASSIS_OFF, planeOff ) );
modelsOn.put( permutation, new PartModel( MODEL_CHASSIS_ON, planeOff ) );
modelsHasChannel.put( permutation, new PartModel( MODEL_CHASSIS_HAS_CHANNEL, planeOn ) );
}
this.modelsOff = ImmutableMap.copyOf( modelsOff );
@@ -69,7 +70,7 @@ class PlaneModels
this.modelsHasChannel = ImmutableMap.copyOf( modelsHasChannel );
}
public List<ResourceLocation> getModel( PlaneConnections connections, boolean hasPower, boolean hasChannel )
public IPartModel getModel( PlaneConnections connections, boolean hasPower, boolean hasChannel )
{
if( hasPower && hasChannel )
{
@@ -85,12 +86,12 @@ class PlaneModels
}
}
public List<ResourceLocation> getModels()
public List<IPartModel> getModels()
{
List<ResourceLocation> result = new ArrayList<>();
modelsOff.values().forEach( result::addAll );
modelsOn.values().forEach( result::addAll );
modelsHasChannel.values().forEach( result::addAll );
List<IPartModel> result = new ArrayList<>();
modelsOff.values().forEach( result::add );
modelsOn.values().forEach( result::add );
modelsHasChannel.values().forEach( result::add );
return result;
}
@@ -23,8 +23,6 @@ import java.io.IOException;
import java.util.List;
import java.util.Random;
import com.google.common.collect.ImmutableList;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
@@ -44,18 +42,23 @@ import appeng.api.parts.BusSupport;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartModel;
import appeng.api.parts.PartItemStack;
import appeng.api.util.AECableType;
import appeng.api.util.AEPartLocation;
import appeng.core.AppEng;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
public class PartCableAnchor implements IPart
{
@PartModels
public static final List<ResourceLocation> MODELS = ImmutableList.of( new ResourceLocation( AppEng.MOD_ID, "part/cable_anchor" ) );
public static final PartModel DEFAULT_MODELS = new PartModel( false, new ResourceLocation( AppEng.MOD_ID, "part/cable_anchor" ) );
@PartModels
public static final PartModel FACADE_MODELS = new PartModel( false, new ResourceLocation( AppEng.MOD_ID, "part/cable_anchor_short" ) );
private ItemStack is = null;
private IPartHost host = null;
@@ -237,9 +240,16 @@ public class PartCableAnchor implements IPart
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return MODELS;
if( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null )
{
return FACADE_MODELS;
}
else
{
return DEFAULT_MODELS;
}
}
}
@@ -22,7 +22,6 @@ package appeng.parts.misc;
import java.util.EnumSet;
import java.util.List;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import net.minecraft.entity.player.EntityPlayer;
@@ -52,6 +51,7 @@ import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartModel;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.IStorageMonitorable;
import appeng.api.storage.data.IAEFluidStack;
@@ -66,6 +66,7 @@ import appeng.helpers.IPriorityHost;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.parts.PartBasicState;
import appeng.parts.PartModel;
import appeng.tile.inventory.IAEAppEngInventory;
import appeng.tile.inventory.InvOperation;
import appeng.util.Platform;
@@ -76,21 +77,15 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
{
public static final ResourceLocation MODEL_BASE = new ResourceLocation( AppEng.MOD_ID, "part/interface_base" );
@PartModels
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/interface_off" )
);
public static final PartModel MODELS_OFF = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/interface_off" ) );
@PartModels
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/interface_on" )
);
public static final PartModel MODELS_ON = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/interface_on" ) );
@PartModels
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/interface_has_channel" )
);
public static final PartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/interface_has_channel" ) );
private final DualityInterface duality = new DualityInterface( this.getProxy(), this );
@@ -421,7 +416,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
if( isActive() && isPowered() )
{
@@ -19,16 +19,14 @@
package appeng.parts.misc;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import appeng.api.parts.IPartModel;
import appeng.core.AppEng;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
public class PartInvertedToggleBus extends PartToggleBus
@@ -36,9 +34,9 @@ public class PartInvertedToggleBus extends PartToggleBus
@PartModels
public static final ResourceLocation MODEL_BASE = new ResourceLocation( AppEng.MOD_ID, "part/inverted_toggle_bus_base" );
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of(MODEL_BASE, MODEL_STATUS_OFF);
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of(MODEL_BASE, MODEL_STATUS_ON);
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of(MODEL_BASE, MODEL_STATUS_HAS_CHANNEL);
public static final PartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_STATUS_OFF );
public static final PartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_STATUS_ON );
public static final PartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_STATUS_HAS_CHANNEL );
@Reflected
public PartInvertedToggleBus( final ItemStack is )
@@ -57,7 +55,7 @@ public class PartInvertedToggleBus extends PartToggleBus
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
if( hasRedstoneFlag() && isActive() && isPowered() )
{
@@ -23,8 +23,6 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -58,6 +56,7 @@ import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartModel;
import appeng.api.storage.ICellContainer;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.IMEInventoryHandler;
@@ -84,6 +83,7 @@ import appeng.me.GridAccessException;
import appeng.me.storage.ITickingMonitor;
import appeng.me.storage.MEInventoryHandler;
import appeng.me.storage.MEMonitorIInventory;
import appeng.parts.PartModel;
import appeng.parts.automation.PartUpgradeable;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.tile.inventory.InvOperation;
@@ -96,22 +96,16 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
{
public static final ResourceLocation MODEL_BASE = new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_base" );
@PartModels
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_off" )
);
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_off" ) ) ;
@PartModels
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_on" )
);
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_on" ) ) ;
@PartModels
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of(
MODEL_BASE,
new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_has_channel" )
);
public static final IPartModel MODELS_HAS_CHANNEL =new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_has_channel" ) );
private final BaseActionSource mySrc;
private final AppEngInternalAEInventory Config = new AppEngInternalAEInventory( this, 63 );
private int priority = 0;
@@ -223,7 +217,9 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
private void resetCache( final boolean fullReset )
{
if( this.getHost() == null || this.getHost().getTile() == null || this.getHost().getTile().getWorld() == null || this.getHost().getTile().getWorld().isRemote )
if( this.getHost() == null || this.getHost().getTile() == null || this.getHost().getTile().getWorld() == null || this.getHost()
.getTile()
.getWorld().isRemote )
{
return;
}
@@ -465,7 +461,8 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
{
this.handler.setPartitionList( new FuzzyPriorityList( priorityList, (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) ) );
this.handler
.setPartitionList( new FuzzyPriorityList( priorityList, (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) ) );
}
else
{
@@ -587,7 +584,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
if( isActive() && isPowered() )
{
@@ -602,5 +599,5 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
return MODELS_OFF;
}
}
}
@@ -23,8 +23,6 @@ import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -38,6 +36,7 @@ import appeng.api.networking.IGridConnection;
import appeng.api.networking.IGridNode;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartModel;
import appeng.api.util.AECableType;
import appeng.api.util.AEPartLocation;
import appeng.core.AppEng;
@@ -45,6 +44,7 @@ import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.me.helpers.AENetworkProxy;
import appeng.parts.PartBasicState;
import appeng.parts.PartModel;
import appeng.util.Platform;
@@ -60,9 +60,9 @@ public class PartToggleBus extends PartBasicState
@PartModels
public static final ResourceLocation MODEL_STATUS_HAS_CHANNEL = new ResourceLocation( AppEng.MOD_ID, "part/toggle_bus_status_has_channel" );
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of(MODEL_BASE, MODEL_STATUS_OFF);
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of(MODEL_BASE, MODEL_STATUS_ON);
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of(MODEL_BASE, MODEL_STATUS_HAS_CHANNEL);
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_STATUS_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_STATUS_ON );
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_STATUS_HAS_CHANNEL );
private static final int REDSTONE_FLAG = 4;
private final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", null, true );
@@ -86,8 +86,9 @@ public class PartToggleBus extends PartBasicState
return cf | ( this.getIntention() ? REDSTONE_FLAG : 0 );
}
public boolean hasRedstoneFlag() {
return (getClientFlags() & REDSTONE_FLAG) == REDSTONE_FLAG;
public boolean hasRedstoneFlag()
{
return ( getClientFlags() & REDSTONE_FLAG ) == REDSTONE_FLAG;
}
protected boolean getIntention()
@@ -222,7 +223,7 @@ public class PartToggleBus extends PartBasicState
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
if( hasRedstoneFlag() && isActive() && isPowered() )
{
@@ -43,6 +43,7 @@ import appeng.api.parts.BusSupport;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartModel;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.api.util.AEPartLocation;
@@ -56,7 +57,8 @@ import appeng.util.Platform;
public class PartCable extends AEBasePart implements IPartCable
{
private static final ImmutableSet<AEPartLocation> STRAIGHT_PART_LOCATIONS = ImmutableSet.of( AEPartLocation.DOWN, AEPartLocation.NORTH, AEPartLocation.EAST );
private static final ImmutableSet<AEPartLocation> STRAIGHT_PART_LOCATIONS = ImmutableSet.of( AEPartLocation.DOWN, AEPartLocation.NORTH,
AEPartLocation.EAST );
private final int[] channelsOnSide = { 0, 0, 0, 0, 0, 0 };
@@ -388,10 +390,10 @@ public class PartCable extends AEBasePart implements IPartCable
ch = ( (int) data.readByte() ) & 0xFF;
}
if( ch != this.getChannelsOnSide(d.ordinal()) )
if( ch != this.getChannelsOnSide( d.ordinal() ) )
{
channelsChanged = true;
this.setChannelsOnSide(d.ordinal(), ch);
this.setChannelsOnSide( d.ordinal(), ch );
}
}
}
@@ -427,4 +429,5 @@ public class PartCable extends AEBasePart implements IPartCable
{
this.connections = connections;
}
}
@@ -19,9 +19,7 @@
package appeng.parts.networking;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayer;
@@ -38,6 +36,7 @@ import appeng.api.networking.energy.IEnergyGrid;
import appeng.api.networking.energy.IEnergyGridProvider;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartModel;
import appeng.api.util.AECableType;
import appeng.api.util.AEPartLocation;
import appeng.core.AppEng;
@@ -45,13 +44,14 @@ import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
import appeng.me.helpers.AENetworkProxy;
import appeng.parts.AEBasePart;
import appeng.parts.PartModel;
public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
{
@PartModels
private static final List<ResourceLocation> MODELS = Collections.singletonList( new ResourceLocation( AppEng.MOD_ID, "part/quartz_fiber" ) );
private static final IPartModel MODELS = new PartModel( new ResourceLocation( AppEng.MOD_ID, "part/quartz_fiber" ) );
private final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", this.getProxy().getMachineRepresentation(), true );
@@ -220,7 +220,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return MODELS;
}
+15 -14
View File
@@ -22,11 +22,11 @@ package appeng.parts.p2p;
import java.util.ArrayList;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.util.ResourceLocation;
import appeng.api.parts.IPartModel;
import appeng.core.AppEng;
import appeng.parts.PartModel;
/**
@@ -39,19 +39,19 @@ class P2PModels
public static final ResourceLocation MODEL_STATUS_ON = new ResourceLocation( AppEng.MOD_ID, "part/p2p/p2p_tunnel_status_on" );
public static final ResourceLocation MODEL_STATUS_HAS_CHANNEL = new ResourceLocation( AppEng.MOD_ID, "part/p2p/p2p_tunnel_status_has_channel" );
private final List<ResourceLocation> modelsOff;
private final List<ResourceLocation> modelsOn;
private final List<ResourceLocation> modelsHasChannel;
private final IPartModel modelsOff;
private final IPartModel modelsOn;
private final IPartModel modelsHasChannel;
public P2PModels( String frontModelPath )
{
ResourceLocation frontModel = new ResourceLocation( AppEng.MOD_ID, frontModelPath );
modelsOff = ImmutableList.of( MODEL_STATUS_OFF, frontModel );
modelsOn = ImmutableList.of( MODEL_STATUS_ON, frontModel );
modelsHasChannel = ImmutableList.of( MODEL_STATUS_HAS_CHANNEL, frontModel );
modelsOff = new PartModel( MODEL_STATUS_OFF, frontModel );
modelsOn = new PartModel( MODEL_STATUS_ON, frontModel );
modelsHasChannel = new PartModel( MODEL_STATUS_HAS_CHANNEL, frontModel );
}
public List<ResourceLocation> getModel( boolean hasPower, boolean hasChannel )
public IPartModel getModel( boolean hasPower, boolean hasChannel )
{
if( hasPower && hasChannel )
{
@@ -67,11 +67,12 @@ class P2PModels
}
}
public List<ResourceLocation> getModels() {
List<ResourceLocation> result = new ArrayList<>();
result.addAll( modelsOff );
result.addAll( modelsOn );
result.addAll( modelsHasChannel );
public List<IPartModel> getModels()
{
List<IPartModel> result = new ArrayList<>();
result.add( modelsOff );
result.add( modelsOn );
result.add( modelsHasChannel );
return result;
}
@@ -25,7 +25,6 @@ import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import ic2.api.energy.tile.IEnergyAcceptor;
import ic2.api.energy.tile.IEnergyEmitter;
@@ -33,6 +32,7 @@ import ic2.api.energy.tile.IEnergySink;
import ic2.api.energy.tile.IEnergySource;
import appeng.api.config.PowerUnits;
import appeng.api.parts.IPartModel;
import appeng.coremod.annotations.Integration.Interface;
import appeng.coremod.annotations.Integration.InterfaceList;
import appeng.integration.IntegrationType;
@@ -57,7 +57,7 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements I
private static final P2PModels MODELS = new P2PModels( "part/p2p/p2p_tunnel_ic2" );
@PartModels
public static List<ResourceLocation> getModels()
public static List<IPartModel> getModels()
{
return MODELS.getModels();
}
@@ -255,7 +255,7 @@ public class PartP2PIC2Power extends PartP2PTunnel<PartP2PIC2Power> implements I
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
}
@@ -29,7 +29,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import appeng.api.networking.IGridNode;
@@ -40,6 +39,7 @@ import appeng.api.networking.events.MENetworkPowerStatusChange;
import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.IPartModel;
import appeng.core.settings.TickRates;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
@@ -58,7 +58,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /* IPip
private static final P2PModels MODELS = new P2PModels( "part/p2p/p2p_tunnel_items" );
@PartModels
public static List<ResourceLocation> getModels()
public static List<IPartModel> getModels()
{
return MODELS.getModels();
}
@@ -390,16 +390,8 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /* IPip
return null;
}
// TODO: BC Integration
// @Override
// @Method( iname = "BuildCraftTransport" )
// public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
// {
// return this.side == with && type == PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT;
// }
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
}
@@ -27,7 +27,6 @@ import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import appeng.api.networking.IGridNode;
@@ -36,6 +35,7 @@ import appeng.api.networking.events.MENetworkPowerStatusChange;
import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.IPartModel;
import appeng.core.settings.TickRates;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
@@ -47,7 +47,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
private static final P2PModels MODELS = new P2PModels( "part/p2p/p2p_tunnel_light" );
@PartModels
public static List<ResourceLocation> getModels()
public static List<IPartModel> getModels()
{
return MODELS.getModels();
}
@@ -226,7 +226,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
}
@@ -27,12 +27,12 @@ import java.util.Stack;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import appeng.api.parts.IPartModel;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
@@ -43,7 +43,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
private static final P2PModels MODELS = new P2PModels( "part/p2p/p2p_tunnel_liquids" );
@PartModels
public static List<ResourceLocation> getModels()
public static List<IPartModel> getModels()
{
return MODELS.getModels();
}
@@ -304,7 +304,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
}
@@ -27,7 +27,6 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -35,6 +34,7 @@ import appeng.api.networking.events.MENetworkBootingStatusChange;
import appeng.api.networking.events.MENetworkChannelsChanged;
import appeng.api.networking.events.MENetworkEventSubscribe;
import appeng.api.networking.events.MENetworkPowerStatusChange;
import appeng.api.parts.IPartModel;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
import appeng.util.Platform;
@@ -46,7 +46,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
private static final P2PModels MODELS = new P2PModels( "part/p2p/p2p_tunnel_redstone" );
@PartModels
public static List<ResourceLocation> getModels()
public static List<IPartModel> getModels()
{
return MODELS.getModels();
}
@@ -209,7 +209,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
}
@@ -29,7 +29,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import appeng.api.AEApi;
import appeng.api.exceptions.FailedConnection;
@@ -39,6 +38,7 @@ import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.IPartHost;
import appeng.api.parts.IPartModel;
import appeng.api.util.AECableType;
import appeng.api.util.AEPartLocation;
import appeng.core.AELog;
@@ -57,7 +57,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
private static final P2PModels MODELS = new P2PModels( "part/p2p/p2p_tunnel_me" );
@PartModels
public static List<ResourceLocation> getModels()
public static List<IPartModel> getModels()
{
return MODELS.getModels();
}
@@ -239,14 +239,17 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
{
try
{
connections.getConnections().put( me.getGridNode(), new TunnelConnection( me, AEApi.instance().createGridConnection( this.outerProxy.getNode(), me.outerProxy.getNode() ) ) );
connections.getConnections().put( me.getGridNode(),
new TunnelConnection( me, AEApi.instance().createGridConnection( this.outerProxy.getNode(), me.outerProxy.getNode() ) ) );
}
catch( final FailedConnection e )
{
final TileEntity start = this.getTile();
final TileEntity end = me.getTile();
AELog.warn( "Failed to establish a ME P2P Tunnel between the tunnels at [x=%d, y=%d, z=%d] and [x=%d, y=%d, z=%d]", start.getPos().getX(), start.getPos().getY(), start.getPos().getZ(), end.getPos().getX(), end.getPos().getY(), end.getPos().getZ() );
AELog.warn( "Failed to establish a ME P2P Tunnel between the tunnels at [x=%d, y=%d, z=%d] and [x=%d, y=%d, z=%d]",
start.getPos().getX(), start.getPos().getY(), start.getPos().getZ(), end.getPos().getX(), end.getPos().getY(),
end.getPos().getZ() );
// :(
}
}
@@ -259,7 +262,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
}
@@ -20,7 +20,6 @@ package appeng.parts.reporting;
import java.io.IOException;
import java.util.List;
import io.netty.buffer.ByteBuf;
@@ -31,7 +30,6 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.relauncher.Side;
@@ -41,6 +39,7 @@ import appeng.api.implementations.parts.IPartStorageMonitor;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.storage.IStackWatcher;
import appeng.api.networking.storage.IStackWatcherHost;
import appeng.api.parts.IPartModel;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEItemStack;
@@ -146,7 +145,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
@Override
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
{
if( Platform.isClient() )
{
return true;
@@ -318,8 +317,8 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
return false;
}
protected List<ResourceLocation> selectModel(List<ResourceLocation> off, List<ResourceLocation> on, List<ResourceLocation> hasChannel,
List<ResourceLocation> lockedOff, List<ResourceLocation> lockedOn, List<ResourceLocation> lockedHasChannel) {
protected IPartModel selectModel( IPartModel off, IPartModel on, IPartModel hasChannel, IPartModel lockedOff, IPartModel lockedOn, IPartModel lockedHasChannel )
{
if( isActive() )
{
if( isLocked() )
@@ -20,7 +20,6 @@ package appeng.parts.reporting;
import java.io.IOException;
import java.util.List;
import io.netty.buffer.ByteBuf;
@@ -29,7 +28,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
@@ -40,6 +38,7 @@ import appeng.api.networking.events.MENetworkBootingStatusChange;
import appeng.api.networking.events.MENetworkEventSubscribe;
import appeng.api.networking.events.MENetworkPowerStatusChange;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartModel;
import appeng.api.util.AEPartLocation;
import appeng.me.GridAccessException;
import appeng.parts.AEBasePart;
@@ -291,7 +290,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
}
}
protected List<ResourceLocation> selectModel( List<ResourceLocation> offModels, List<ResourceLocation> onModels, List<ResourceLocation> hasChannelModels )
protected IPartModel selectModel( IPartModel offModels, IPartModel onModels, IPartModel hasChannelModels )
{
if( isActive() )
{
@@ -22,8 +22,6 @@ package appeng.parts.reporting;
import java.util.Collections;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -34,12 +32,14 @@ import net.minecraft.util.math.Vec3d;
import appeng.api.networking.energy.IEnergySource;
import appeng.api.networking.security.PlayerSource;
import appeng.api.parts.IPartModel;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.data.IAEItemStack;
import appeng.core.AppEng;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
import appeng.parts.PartModel;
import appeng.util.InventoryAdaptor;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
@@ -57,13 +57,13 @@ public class PartConversionMonitor extends AbstractPartMonitor
@PartModels
public static final ResourceLocation MODEL_LOCKED_ON = new ResourceLocation( AppEng.MOD_ID, "part/conversion_monitor_locked_on" );
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
public static final List<ResourceLocation> MODELS_LOCKED_OFF = ImmutableList.of( MODEL_BASE, MODEL_LOCKED_OFF, MODEL_STATUS_OFF );
public static final List<ResourceLocation> MODELS_LOCKED_ON = ImmutableList.of( MODEL_BASE, MODEL_LOCKED_ON, MODEL_STATUS_ON );
public static final List<ResourceLocation> MODELS_LOCKED_HAS_CHANNEL = ImmutableList.of( MODEL_BASE, MODEL_LOCKED_ON, MODEL_STATUS_HAS_CHANNEL );
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
public static final IPartModel MODELS_LOCKED_OFF = new PartModel( MODEL_BASE, MODEL_LOCKED_OFF, MODEL_STATUS_OFF );
public static final IPartModel MODELS_LOCKED_ON = new PartModel( MODEL_BASE, MODEL_LOCKED_ON, MODEL_STATUS_ON );
public static final IPartModel MODELS_LOCKED_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_LOCKED_ON, MODEL_STATUS_HAS_CHANNEL );
@Reflected
public PartConversionMonitor( final ItemStack is )
{
@@ -184,10 +184,10 @@ public class PartConversionMonitor extends AbstractPartMonitor
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL,
MODELS_LOCKED_OFF, MODELS_LOCKED_ON, MODELS_LOCKED_HAS_CHANNEL );
}
}
@@ -21,18 +21,18 @@ package appeng.parts.reporting;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import appeng.api.parts.IPartModel;
import appeng.core.AppEng;
import appeng.core.sync.GuiBridge;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
import appeng.tile.inventory.AppEngInternalInventory;
@@ -44,9 +44,9 @@ public class PartCraftingTerminal extends AbstractPartTerminal
@PartModels
public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/crafting_terminal_on" );
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
private final AppEngInternalInventory craftingGrid = new AppEngInternalInventory( this, 9 );
@@ -115,7 +115,7 @@ public class PartCraftingTerminal extends AbstractPartTerminal
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
}
@@ -19,16 +19,14 @@
package appeng.parts.reporting;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import appeng.api.parts.IPartModel;
import appeng.core.AppEng;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
public class PartDarkPanel extends AbstractPartPanel
@@ -39,8 +37,8 @@ public class PartDarkPanel extends AbstractPartPanel
@PartModels
public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/monitor_dark_on" );
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of( MODEL_BASE, MODEL_OFF );
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of( MODEL_BASE, MODEL_ON );
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON );
@Reflected
public PartDarkPanel( final ItemStack is )
@@ -55,7 +53,7 @@ public class PartDarkPanel extends AbstractPartPanel
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return isPowered() ? MODELS_ON : MODELS_OFF;
}
@@ -19,19 +19,17 @@
package appeng.parts.reporting;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.Vec3d;
import appeng.api.parts.IPartModel;
import appeng.core.AppEng;
import appeng.core.sync.GuiBridge;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
import appeng.util.Platform;
@@ -43,9 +41,9 @@ public class PartInterfaceTerminal extends AbstractPartDisplay
@PartModels
public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/interface_terminal_on" );
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
public PartInterfaceTerminal( final ItemStack is )
{
@@ -74,7 +72,7 @@ public class PartInterfaceTerminal extends AbstractPartDisplay
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
}
@@ -19,16 +19,14 @@
package appeng.parts.reporting;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import appeng.api.parts.IPartModel;
import appeng.core.AppEng;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
public class PartPanel extends AbstractPartPanel
@@ -39,8 +37,8 @@ public class PartPanel extends AbstractPartPanel
@PartModels
public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/monitor_bright_on" );
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of( MODEL_BASE, MODEL_OFF );
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of( MODEL_BASE, MODEL_ON );
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON );
@Reflected
public PartPanel( final ItemStack is )
@@ -55,7 +53,7 @@ public class PartPanel extends AbstractPartPanel
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return isPowered() ? MODELS_ON : MODELS_OFF;
}
@@ -21,8 +21,6 @@ package appeng.parts.reporting;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -31,11 +29,13 @@ import net.minecraft.util.ResourceLocation;
import appeng.api.implementations.ICraftingPatternItem;
import appeng.api.networking.crafting.ICraftingPatternDetails;
import appeng.api.parts.IPartModel;
import appeng.api.storage.data.IAEItemStack;
import appeng.core.AppEng;
import appeng.core.sync.GuiBridge;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.inventory.InvOperation;
@@ -48,9 +48,9 @@ public class PartPatternTerminal extends AbstractPartTerminal
@PartModels
public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/pattern_terminal_on" );
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON ) ;
public static final IPartModel MODELS_HAS_CHANNEL =new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL ) ;
private final AppEngInternalInventory crafting = new AppEngInternalInventory( this, 9 );
private final AppEngInternalInventory output = new AppEngInternalInventory( this, 3 );
@@ -214,7 +214,7 @@ public class PartPatternTerminal extends AbstractPartTerminal
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
}
@@ -19,16 +19,14 @@
package appeng.parts.reporting;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import appeng.api.parts.IPartModel;
import appeng.core.AppEng;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
public class PartSemiDarkPanel extends AbstractPartPanel
@@ -38,8 +36,8 @@ public class PartSemiDarkPanel extends AbstractPartPanel
@PartModels
public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/monitor_medium_on" );
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of( MODEL_BASE, MODEL_OFF );
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of( MODEL_BASE, MODEL_ON );
public static final PartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON );
@Reflected
public PartSemiDarkPanel( final ItemStack is )
@@ -56,7 +54,7 @@ public class PartSemiDarkPanel extends AbstractPartPanel
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return isPowered() ? MODELS_ON : MODELS_OFF;
}
@@ -19,16 +19,14 @@
package appeng.parts.reporting;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import appeng.api.parts.IPartModel;
import appeng.core.AppEng;
import appeng.helpers.Reflected;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
/**
@@ -49,13 +47,13 @@ public class PartStorageMonitor extends AbstractPartMonitor
@PartModels
public static final ResourceLocation MODEL_LOCKED_ON = new ResourceLocation( AppEng.MOD_ID, "part/storage_monitor_locked_on" );
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
public static final List<ResourceLocation> MODELS_LOCKED_OFF = ImmutableList.of( MODEL_BASE, MODEL_LOCKED_OFF, MODEL_STATUS_OFF );
public static final List<ResourceLocation> MODELS_LOCKED_ON = ImmutableList.of( MODEL_BASE, MODEL_LOCKED_ON, MODEL_STATUS_ON );
public static final List<ResourceLocation> MODELS_LOCKED_HAS_CHANNEL = ImmutableList.of( MODEL_BASE, MODEL_LOCKED_ON, MODEL_STATUS_HAS_CHANNEL );
public static final IPartModel MODELS_LOCKED_OFF = new PartModel( MODEL_BASE, MODEL_LOCKED_OFF, MODEL_STATUS_OFF );
public static final IPartModel MODELS_LOCKED_ON = new PartModel( MODEL_BASE, MODEL_LOCKED_ON, MODEL_STATUS_ON );
public static final IPartModel MODELS_LOCKED_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_LOCKED_ON, MODEL_STATUS_HAS_CHANNEL );
@Reflected
public PartStorageMonitor( final ItemStack is )
@@ -64,7 +62,7 @@ public class PartStorageMonitor extends AbstractPartMonitor
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL,
MODELS_LOCKED_OFF, MODELS_LOCKED_ON, MODELS_LOCKED_HAS_CHANNEL );
@@ -19,15 +19,13 @@
package appeng.parts.reporting;
import java.util.List;
import com.google.common.collect.ImmutableList;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import appeng.api.parts.IPartModel;
import appeng.core.AppEng;
import appeng.items.parts.PartModels;
import appeng.parts.PartModel;
public class PartTerminal extends AbstractPartTerminal
@@ -38,9 +36,9 @@ public class PartTerminal extends AbstractPartTerminal
@PartModels
public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/terminal_on" );
public static final List<ResourceLocation> MODELS_OFF = ImmutableList.of( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final List<ResourceLocation> MODELS_ON = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final List<ResourceLocation> MODELS_HAS_CHANNEL = ImmutableList.of( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
public PartTerminal( final ItemStack is )
{
@@ -48,7 +46,7 @@ public class PartTerminal extends AbstractPartTerminal
}
@Override
public List<ResourceLocation> getStaticModels()
public IPartModel getStaticModels()
{
return selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL );
}