Working on drive design.
Several particle crash fixes.
This commit is contained in:
@@ -27,6 +27,9 @@ package appeng.api.implementations.tiles;
|
|||||||
import appeng.api.networking.IGridHost;
|
import appeng.api.networking.IGridHost;
|
||||||
import appeng.api.storage.ICellContainer;
|
import appeng.api.storage.ICellContainer;
|
||||||
import appeng.api.util.IOrientable;
|
import appeng.api.util.IOrientable;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
|
||||||
public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable
|
public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable
|
||||||
@@ -63,4 +66,11 @@ public interface IChestOrDrive extends ICellContainer, IGridHost, IOrientable
|
|||||||
* @return is the cell currently blinking to show activity.
|
* @return is the cell currently blinking to show activity.
|
||||||
*/
|
*/
|
||||||
boolean isCellBlinking( int slot );
|
boolean isCellBlinking( int slot );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the item of the cell in the given slot or null.
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
Item getCellItem(int slot );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ package appeng.block.misc;
|
|||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.api.util.AEAxisAlignedBB;
|
import appeng.api.util.AEAxisAlignedBB;
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.AEBaseTileBlock;
|
||||||
|
import appeng.client.render.effects.ChargedOreFX;
|
||||||
import appeng.client.render.effects.LightningFX;
|
import appeng.client.render.effects.LightningFX;
|
||||||
import appeng.client.render.renderable.ItemRenderable;
|
import appeng.client.render.renderable.ItemRenderable;
|
||||||
import appeng.client.render.tesr.ModularTESR;
|
import appeng.client.render.tesr.ModularTESR;
|
||||||
@@ -121,9 +122,8 @@ public class BlockCharger extends AEBaseTileBlock<TileCharger>
|
|||||||
{
|
{
|
||||||
if( AppEng.proxy.shouldAddParticles( r ) )
|
if( AppEng.proxy.shouldAddParticles( r ) )
|
||||||
{
|
{
|
||||||
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos
|
Minecraft.getInstance().particles.addParticle(LightningFX.TYPE, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos
|
||||||
.getZ(), 0.0, 0.0, 0.0 );
|
.getZ(), 0.0, 0.0, 0.0);
|
||||||
Minecraft.getInstance().particles.addEffect( fx );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,8 +142,7 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock<TileQuartzGrow
|
|||||||
ry += dz * forward.getYOffset();
|
ry += dz * forward.getYOffset();
|
||||||
rz += dz * forward.getZOffset();
|
rz += dz * forward.getZOffset();
|
||||||
|
|
||||||
final LightningFX fx = new LightningFX( w, rx, ry, rz, 0.0D, 0.0D, 0.0D );
|
Minecraft.getInstance().particles.addParticle(LightningFX.TYPE, rx, ry, rz, 0.0D, 0.0D, 0.0D);
|
||||||
Minecraft.getInstance().particles.addEffect( fx );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of Applied Energistics 2.
|
||||||
|
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||||
|
*
|
||||||
|
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package appeng.block.storage;
|
||||||
|
|
||||||
|
|
||||||
|
import net.minecraft.util.IStringSerializable;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Describes the type of cell present in a slot.
|
||||||
|
*/
|
||||||
|
public enum DriveSlotCellType implements IStringSerializable
|
||||||
|
{
|
||||||
|
|
||||||
|
EMPTY("empty"),
|
||||||
|
|
||||||
|
ITEM("item"),
|
||||||
|
|
||||||
|
FLUID("fluid");
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
DriveSlotCellType(String name )
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -20,6 +20,9 @@ package appeng.block.storage;
|
|||||||
|
|
||||||
|
|
||||||
import appeng.api.implementations.tiles.IChestOrDrive;
|
import appeng.api.implementations.tiles.IChestOrDrive;
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,25 +31,37 @@ import appeng.api.implementations.tiles.IChestOrDrive;
|
|||||||
public class DriveSlotsState
|
public class DriveSlotsState
|
||||||
{
|
{
|
||||||
|
|
||||||
private final DriveSlotState[] slots;
|
private final Item[] cells;
|
||||||
|
|
||||||
private DriveSlotsState( DriveSlotState[] slots )
|
private final DriveSlotState[] states;
|
||||||
{
|
|
||||||
this.slots = slots;
|
public DriveSlotsState(Item[] cells, DriveSlotState[] states) {
|
||||||
|
Preconditions.checkArgument(cells.length == states.length);
|
||||||
|
this.cells = cells;
|
||||||
|
this.states = states;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DriveSlotState getState( int index )
|
public DriveSlotState getState(int index )
|
||||||
{
|
{
|
||||||
if( index >= this.slots.length )
|
if( index >= this.states.length )
|
||||||
{
|
{
|
||||||
return DriveSlotState.EMPTY;
|
return DriveSlotState.EMPTY;
|
||||||
}
|
}
|
||||||
return this.slots[index];
|
return this.states[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
public Item getCell(int index )
|
||||||
|
{
|
||||||
|
if( index >= this.cells.length )
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.cells[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSlotCount()
|
public int getSlotCount()
|
||||||
{
|
{
|
||||||
return this.slots.length;
|
return this.cells.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,35 +69,39 @@ public class DriveSlotsState
|
|||||||
*/
|
*/
|
||||||
public static DriveSlotsState fromChestOrDrive( IChestOrDrive chestOrDrive )
|
public static DriveSlotsState fromChestOrDrive( IChestOrDrive chestOrDrive )
|
||||||
{
|
{
|
||||||
DriveSlotState[] slots = new DriveSlotState[chestOrDrive.getCellCount()];
|
DriveSlotState[] states = new DriveSlotState[chestOrDrive.getCellCount()];
|
||||||
|
Item[] cells = new Item[chestOrDrive.getCellCount()];
|
||||||
for( int i = 0; i < chestOrDrive.getCellCount(); i++ )
|
for( int i = 0; i < chestOrDrive.getCellCount(); i++ )
|
||||||
{
|
{
|
||||||
|
cells[i] = chestOrDrive.getCellItem(i);
|
||||||
|
|
||||||
if( !chestOrDrive.isPowered() )
|
if( !chestOrDrive.isPowered() )
|
||||||
{
|
{
|
||||||
if( chestOrDrive.getCellStatus( i ) != 0 )
|
if( chestOrDrive.getCellStatus( i ) != 0 )
|
||||||
{
|
{
|
||||||
slots[i] = DriveSlotState.OFFLINE;
|
states[i] = DriveSlotState.OFFLINE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
slots[i] = DriveSlotState.EMPTY;
|
states[i] = DriveSlotState.EMPTY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
slots[i] = DriveSlotState.fromCellStatus( chestOrDrive.getCellStatus( i ) );
|
states[i] = DriveSlotState.fromCellStatus( chestOrDrive.getCellStatus( i ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new DriveSlotsState( slots );
|
return new DriveSlotsState( cells, states );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DriveSlotsState createEmpty( int slotCount )
|
public static DriveSlotsState createEmpty( int slotCount )
|
||||||
{
|
{
|
||||||
DriveSlotState[] slots = new DriveSlotState[slotCount];
|
DriveSlotState[] states = new DriveSlotState[slotCount];
|
||||||
|
Item[] cells = new Item[slotCount];
|
||||||
for( int i = 0; i < slotCount; i++ )
|
for( int i = 0; i < slotCount; i++ )
|
||||||
{
|
{
|
||||||
slots[i] = DriveSlotState.EMPTY;
|
states[i] = DriveSlotState.EMPTY;
|
||||||
}
|
}
|
||||||
return new DriveSlotsState( slots );
|
return new DriveSlotsState( cells, states );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class LightningFX extends SpriteTexturedParticle
|
|||||||
private final double[] verticesWithUV = new double[3];
|
private final double[] verticesWithUV = new double[3];
|
||||||
private boolean hasData = false;
|
private boolean hasData = false;
|
||||||
|
|
||||||
public LightningFX( final World w, final double x, final double y, final double z, final double r, final double g, final double b )
|
private LightningFX( final World w, final double x, final double y, final double z, final double r, final double g, final double b )
|
||||||
{
|
{
|
||||||
this( w, x, y, z, r, g, b, 6 );
|
this( w, x, y, z, r, g, b, 6 );
|
||||||
this.regen();
|
this.regen();
|
||||||
@@ -117,7 +117,6 @@ public class LightningFX extends SpriteTexturedParticle
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderParticle(IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks) {
|
public void renderParticle(IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks) {
|
||||||
|
|
||||||
Vec3d vec3d = renderInfo.getProjectedView();
|
Vec3d vec3d = renderInfo.getProjectedView();
|
||||||
float centerX = (float)(MathHelper.lerp(partialTicks, this.prevPosX, this.posX) - vec3d.getX());
|
float centerX = (float)(MathHelper.lerp(partialTicks, this.prevPosX, this.posX) - vec3d.getX());
|
||||||
float centerY = (float)(MathHelper.lerp(partialTicks, this.prevPosY, this.posY) - vec3d.getY());
|
float centerY = (float)(MathHelper.lerp(partialTicks, this.prevPosY, this.posY) - vec3d.getY());
|
||||||
|
|||||||
@@ -74,6 +74,11 @@ public class AutoRotatingBakedModel implements IBakedModel
|
|||||||
private List<BakedQuad> getRotatedModel(BlockState state, Direction side, Random rand, AEModelData modelData)
|
private List<BakedQuad> getRotatedModel(BlockState state, Direction side, Random rand, AEModelData modelData)
|
||||||
{
|
{
|
||||||
FacingToRotation f2r = FacingToRotation.get( modelData.getForward(), modelData.getUp() );
|
FacingToRotation f2r = FacingToRotation.get( modelData.getForward(), modelData.getUp() );
|
||||||
|
|
||||||
|
if (f2r.isRedundant()) {
|
||||||
|
return AutoRotatingBakedModel.this.parent.getQuads( state, side, rand, modelData );
|
||||||
|
}
|
||||||
|
|
||||||
List<BakedQuad> original = AutoRotatingBakedModel.this.parent.getQuads( state, f2r.resultingRotate( side ), rand, modelData );
|
List<BakedQuad> original = AutoRotatingBakedModel.this.parent.getQuads( state, f2r.resultingRotate( side ), rand, modelData );
|
||||||
List<BakedQuad> rotated = new ArrayList<>( original.size() );
|
List<BakedQuad> rotated = new ArrayList<>( original.size() );
|
||||||
for( BakedQuad quad : original )
|
for( BakedQuad quad : original )
|
||||||
|
|||||||
@@ -19,14 +19,17 @@
|
|||||||
package appeng.client.render.model;
|
package appeng.client.render.model;
|
||||||
|
|
||||||
|
|
||||||
import appeng.block.storage.DriveSlotState;
|
import appeng.api.definitions.IItems;
|
||||||
|
import appeng.block.storage.DriveSlotCellType;
|
||||||
import appeng.block.storage.DriveSlotsState;
|
import appeng.block.storage.DriveSlotsState;
|
||||||
import appeng.client.render.DelegateBakedModel;
|
import appeng.client.render.DelegateBakedModel;
|
||||||
import appeng.tile.storage.TileDrive;
|
import appeng.core.Api;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.client.renderer.Matrix4f;
|
import net.minecraft.client.renderer.Matrix4f;
|
||||||
import net.minecraft.client.renderer.model.BakedQuad;
|
import net.minecraft.client.renderer.model.BakedQuad;
|
||||||
import net.minecraft.client.renderer.model.IBakedModel;
|
import net.minecraft.client.renderer.model.IBakedModel;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
import net.minecraftforge.client.model.data.IModelData;
|
import net.minecraftforge.client.model.data.IModelData;
|
||||||
import net.minecraftforge.client.model.pipeline.BakedQuadBuilder;
|
import net.minecraftforge.client.model.pipeline.BakedQuadBuilder;
|
||||||
@@ -41,13 +44,11 @@ import java.util.Random;
|
|||||||
|
|
||||||
public class DriveBakedModel extends DelegateBakedModel
|
public class DriveBakedModel extends DelegateBakedModel
|
||||||
{
|
{
|
||||||
private final IBakedModel bakedBase;
|
private final Map<DriveSlotCellType, IBakedModel> bakedCells;
|
||||||
private final Map<DriveSlotState, IBakedModel> bakedCells;
|
|
||||||
|
|
||||||
public DriveBakedModel( IBakedModel bakedBase, Map<DriveSlotState, IBakedModel> bakedCells )
|
public DriveBakedModel( IBakedModel bakedBase, Map<DriveSlotCellType, IBakedModel> bakedCells )
|
||||||
{
|
{
|
||||||
super(bakedBase);
|
super(bakedBase);
|
||||||
this.bakedBase = bakedBase;
|
|
||||||
this.bakedCells = bakedCells;
|
this.bakedCells = bakedCells;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +56,7 @@ public class DriveBakedModel extends DelegateBakedModel
|
|||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, @Nonnull Random rand, @Nonnull IModelData extraData) {
|
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, @Nonnull Random rand, @Nonnull IModelData extraData) {
|
||||||
|
|
||||||
List<BakedQuad> result = new ArrayList<>(this.bakedBase.getQuads(state, side, rand, extraData));
|
List<BakedQuad> result = new ArrayList<>(super.getQuads(state, side, rand, extraData));
|
||||||
|
|
||||||
if (!(extraData instanceof DriveModelData)) {
|
if (!(extraData instanceof DriveModelData)) {
|
||||||
return result;
|
return result;
|
||||||
@@ -70,29 +71,20 @@ public class DriveBakedModel extends DelegateBakedModel
|
|||||||
{
|
{
|
||||||
for( int col = 0; col < 2; col++ )
|
for( int col = 0; col < 2; col++ )
|
||||||
{
|
{
|
||||||
DriveSlotState slotState = slotsState.getState( row * 2 + col );
|
|
||||||
|
|
||||||
IBakedModel bakedCell = this.bakedCells.get( slotState );
|
|
||||||
|
|
||||||
Matrix4f transform = new Matrix4f();
|
Matrix4f transform = new Matrix4f();
|
||||||
transform.setIdentity();
|
|
||||||
|
|
||||||
// Position this drive model copy at the correct slot. The transform is based on the
|
// Position this drive model copy at the correct slot. The transform is based on the
|
||||||
// cell-model being in slot 0,0 at the top left of the drive.
|
// cell-model being in slot 0,0 at the top left of the drive.
|
||||||
float xOffset = -col * 7 / 16.0f;
|
float xOffset = -col * 7 / 16.0f;
|
||||||
float yOffset = -row * 3 / 16.0f;
|
float yOffset = -row * 3 / 16.0f;
|
||||||
|
|
||||||
transform.setTranslation( xOffset, yOffset, 0 );
|
transform.setTranslation( xOffset, yOffset, 0 );
|
||||||
|
|
||||||
MatrixVertexTransformer transformer = new MatrixVertexTransformer( transform );
|
int slot = row * 2 + col;
|
||||||
for( BakedQuad bakedQuad : bakedCell.getQuads( state, null, rand, extraData ) )
|
|
||||||
{
|
// Add the drive chassis
|
||||||
BakedQuadBuilder builder = new BakedQuadBuilder();
|
Item cell = slotsState.getCell(slot);
|
||||||
transformer.setParent( builder );
|
IBakedModel cellChassisModel = getCellChassisModel(cell);
|
||||||
transformer.setVertexFormat( builder.getVertexFormat() );
|
addModel(state, rand, extraData, result, cellChassisModel, transform);
|
||||||
bakedQuad.pipe( transformer );
|
|
||||||
result.add( builder.build() );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,4 +92,40 @@ public class DriveBakedModel extends DelegateBakedModel
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAmbientOcclusion() {
|
||||||
|
// We have faces inside the chassis that are facing east, but should not receive
|
||||||
|
// ambient occlusion from the east-side, but sadly this cannot be fine-tuned on a
|
||||||
|
// face-by-face basis.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine which drive chassis to show based on the used cell
|
||||||
|
private IBakedModel getCellChassisModel(Item cell) {
|
||||||
|
IItems items = Api.INSTANCE.definitions().items();
|
||||||
|
if (cell == null) {
|
||||||
|
return bakedCells.get(DriveSlotCellType.EMPTY);
|
||||||
|
} else if (items.fluidCell1k().item() == cell
|
||||||
|
|| items.fluidCell4k().item() == cell
|
||||||
|
|| items.fluidCell16k().item() == cell
|
||||||
|
|| items.fluidCell64k().item() == cell) {
|
||||||
|
return bakedCells.get(DriveSlotCellType.FLUID);
|
||||||
|
} else {
|
||||||
|
// Fall back to an item model
|
||||||
|
return bakedCells.get(DriveSlotCellType.ITEM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void addModel(@Nullable BlockState state, @Nonnull Random rand, @Nonnull IModelData extraData, List<BakedQuad> result, IBakedModel bakedCell, Matrix4f transform) {
|
||||||
|
MatrixVertexTransformer transformer = new MatrixVertexTransformer( transform );
|
||||||
|
for( BakedQuad bakedQuad : bakedCell.getQuads( state, null, rand, extraData ) )
|
||||||
|
{
|
||||||
|
BakedQuadBuilder builder = new BakedQuadBuilder();
|
||||||
|
transformer.setParent( builder );
|
||||||
|
transformer.setVertexFormat( builder.getVertexFormat() );
|
||||||
|
bakedQuad.pipe( transformer );
|
||||||
|
result.add( builder.build() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
package appeng.client.render.model;
|
package appeng.client.render.model;
|
||||||
|
|
||||||
|
|
||||||
|
import appeng.block.storage.DriveSlotCellType;
|
||||||
import appeng.block.storage.DriveSlotState;
|
import appeng.block.storage.DriveSlotState;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
@@ -36,14 +37,13 @@ import java.util.function.Function;
|
|||||||
public class DriveModel implements IModelGeometry<DriveModel>
|
public class DriveModel implements IModelGeometry<DriveModel>
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final ResourceLocation MODEL_BASE = new ResourceLocation( "appliedenergistics2:block/drive_base" );
|
private static final ResourceLocation MODEL_BASE = new ResourceLocation( "appliedenergistics2:block/drive/drive_base" );
|
||||||
|
|
||||||
private static final Map<DriveSlotState, ResourceLocation> MODELS_CELLS = ImmutableMap.of(
|
private static final Map<DriveSlotCellType, ResourceLocation> MODELS_CELLS = ImmutableMap.of(
|
||||||
DriveSlotState.EMPTY, new ResourceLocation( "appliedenergistics2:block/drive_cell_empty" ),
|
DriveSlotCellType.EMPTY, new ResourceLocation( "appliedenergistics2:block/drive/drive_cell_empty" ),
|
||||||
DriveSlotState.OFFLINE, new ResourceLocation( "appliedenergistics2:block/drive_cell_off" ),
|
DriveSlotCellType.ITEM, new ResourceLocation( "appliedenergistics2:block/drive/drive_cell_items" ),
|
||||||
DriveSlotState.ONLINE, new ResourceLocation( "appliedenergistics2:block/drive_cell_on" ),
|
DriveSlotCellType.FLUID, new ResourceLocation( "appliedenergistics2:block/drive/drive_cell_fluids" )
|
||||||
DriveSlotState.TYPES_FULL, new ResourceLocation( "appliedenergistics2:block/drive_cell_types_full" ),
|
);
|
||||||
DriveSlotState.FULL, new ResourceLocation( "appliedenergistics2:block/drive_cell_full" ) );
|
|
||||||
|
|
||||||
public static final Set<ResourceLocation> DEPENDENCIES = ImmutableSet.<ResourceLocation>builder()
|
public static final Set<ResourceLocation> DEPENDENCIES = ImmutableSet.<ResourceLocation>builder()
|
||||||
.addAll(MODELS_CELLS.values())
|
.addAll(MODELS_CELLS.values())
|
||||||
@@ -52,13 +52,13 @@ public class DriveModel implements IModelGeometry<DriveModel>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation) {
|
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation) {
|
||||||
EnumMap<DriveSlotState, IBakedModel> cellModels = new EnumMap<>( DriveSlotState.class );
|
EnumMap<DriveSlotCellType, IBakedModel> cellModels = new EnumMap<>( DriveSlotCellType.class );
|
||||||
|
|
||||||
// Load the base model and the model for each cell state.
|
// Load the base model and the model for each cell state.
|
||||||
for( DriveSlotState slotState : MODELS_CELLS.keySet() )
|
for( DriveSlotCellType cellType : MODELS_CELLS.keySet() )
|
||||||
{
|
{
|
||||||
IBakedModel cellModel = bakery.getBakedModel( MODELS_CELLS.get( slotState ), modelTransform, spriteGetter );
|
IBakedModel cellModel = bakery.getBakedModel( MODELS_CELLS.get( cellType ), modelTransform, spriteGetter );
|
||||||
cellModels.put( slotState, cellModel );
|
cellModels.put( cellType, cellModel );
|
||||||
}
|
}
|
||||||
|
|
||||||
IBakedModel baseModel = bakery.getBakedModel( MODEL_BASE, modelTransform, spriteGetter );
|
IBakedModel baseModel = bakery.getBakedModel( MODEL_BASE, modelTransform, spriteGetter );
|
||||||
|
|||||||
@@ -0,0 +1,158 @@
|
|||||||
|
package appeng.client.render.tesr;
|
||||||
|
|
||||||
|
import appeng.block.storage.DriveSlotState;
|
||||||
|
import appeng.client.render.FacingToRotation;
|
||||||
|
import appeng.client.render.cablebus.CubeBuilder;
|
||||||
|
import appeng.tile.storage.TileDrive;
|
||||||
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
|
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||||
|
import javafx.scene.DepthTest;
|
||||||
|
import net.minecraft.client.renderer.*;
|
||||||
|
import net.minecraft.client.renderer.model.BakedQuad;
|
||||||
|
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||||
|
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||||
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||||
|
import org.lwjgl.system.MathUtil;
|
||||||
|
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the drive cell status indicators.
|
||||||
|
*/
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
public class DriveLedTileEntityRenderer extends TileEntityRenderer<TileDrive> {
|
||||||
|
|
||||||
|
private static final EnumMap<DriveSlotState, Vector3f> STATE_COLORS;
|
||||||
|
|
||||||
|
// Color used for the cell indicator for blinking during recent activity
|
||||||
|
private static final Vector3f BLINK_COLOR = new Vector3f(1, 0.5f, 0.5f);
|
||||||
|
|
||||||
|
static {
|
||||||
|
STATE_COLORS = new EnumMap<>(DriveSlotState.class);
|
||||||
|
STATE_COLORS.put(DriveSlotState.OFFLINE, new Vector3f(0, 0, 0));
|
||||||
|
STATE_COLORS.put(DriveSlotState.ONLINE, new Vector3f(0, 1, 0));
|
||||||
|
STATE_COLORS.put(DriveSlotState.TYPES_FULL, new Vector3f(0, 0.667f, 0));
|
||||||
|
STATE_COLORS.put(DriveSlotState.FULL, new Vector3f(1, 0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final float L = 14/16.f; // left (x-axis)
|
||||||
|
private static final float R = 13/16.f; // right (x-axis)
|
||||||
|
private static final float T = 14/16.f; // top (x-axis)
|
||||||
|
private static final float B = 12.999f/16.f; // bottom (x-axis)
|
||||||
|
private static final float FR = 0.4f/16.f; // front (z-axis)
|
||||||
|
private static final float BA = 1/16.f; // back (z-axis)
|
||||||
|
|
||||||
|
// Vertex data for the LED cuboid (has no back)
|
||||||
|
// Directions are when looking from the front onto the LED
|
||||||
|
private static final float[] LED_QUADS = {
|
||||||
|
// Front Face
|
||||||
|
R, T, FR,
|
||||||
|
L, T, FR,
|
||||||
|
L, B, FR,
|
||||||
|
R, B, FR,
|
||||||
|
// Left Face
|
||||||
|
L, T, FR,
|
||||||
|
L, T, BA,
|
||||||
|
L, B, BA,
|
||||||
|
L, B, FR,
|
||||||
|
// Right Face
|
||||||
|
R, T, BA,
|
||||||
|
R, T, FR,
|
||||||
|
R, B, FR,
|
||||||
|
R, B, BA,
|
||||||
|
// Top Face
|
||||||
|
R, T, BA,
|
||||||
|
L, T, BA,
|
||||||
|
L, T, FR,
|
||||||
|
R, T, FR,
|
||||||
|
// Bottom Face
|
||||||
|
R, B, FR,
|
||||||
|
L, B, FR,
|
||||||
|
L, B, BA,
|
||||||
|
R, B, BA,
|
||||||
|
};
|
||||||
|
|
||||||
|
private static final RenderType STATE = RenderType.makeType("ae_drive_leds", DefaultVertexFormats.POSITION_COLOR, 7, 32565, false, true, RenderType.State.getBuilder()
|
||||||
|
.build(false));
|
||||||
|
|
||||||
|
public DriveLedTileEntityRenderer(TileEntityRendererDispatcher rendererDispatcherIn) {
|
||||||
|
super(rendererDispatcherIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render(TileDrive drive, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int combinedLightIn, int combinedOverlayIn) {
|
||||||
|
|
||||||
|
if (drive.getCellCount() != 10) {
|
||||||
|
throw new IllegalStateException("Expected drive to have 10 slots");
|
||||||
|
}
|
||||||
|
|
||||||
|
ms.push();
|
||||||
|
ms.translate(0.5, 0.5, 0.5);
|
||||||
|
FacingToRotation.get(drive.getForward(), drive.getUp()).push(ms);
|
||||||
|
ms.translate(-0.5, -0.5, -0.5);
|
||||||
|
|
||||||
|
RenderState.TransparencyState TRANSLUCENT_TRANSPARENCY = ObfuscationReflectionHelper.getPrivateValue(RenderState.class, null, "field_228515_g_");
|
||||||
|
RenderType rt =RenderType.makeType("ae_drive_leds", DefaultVertexFormats.POSITION_COLOR, 7, 32565, false, true, RenderType.State.getBuilder()
|
||||||
|
.transparency(TRANSLUCENT_TRANSPARENCY)
|
||||||
|
.build(false));
|
||||||
|
IVertexBuilder buffer = buffers.getBuffer(STATE);
|
||||||
|
|
||||||
|
for (int row = 0; row < 5; row++) {
|
||||||
|
for (int col = 0; col < 2; col++) {
|
||||||
|
int slot = row * 2 + col;
|
||||||
|
Vector3f color = getColorForSlot(drive, slot, partialTicks);
|
||||||
|
if (color == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ms.push();
|
||||||
|
|
||||||
|
// Position this drive model copy at the correct slot. The transform is based on the
|
||||||
|
// cell-model being in slot 0,0 at the top left of the drive.
|
||||||
|
float xOffset = -col * 7 / 16.0f;
|
||||||
|
float yOffset = -row * 3 / 16.0f;
|
||||||
|
ms.translate(xOffset, yOffset, 0);
|
||||||
|
|
||||||
|
for (int i = 0; i < LED_QUADS.length; i += 3) {
|
||||||
|
float x = LED_QUADS[i];
|
||||||
|
float y = LED_QUADS[i+1];
|
||||||
|
float z = LED_QUADS[i+2];
|
||||||
|
buffer.pos(ms.getLast().getMatrix(), x, y, z).color(color.getX(), color.getY(), color.getZ(), 1.f).endVertex();
|
||||||
|
}
|
||||||
|
|
||||||
|
ms.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ms.pop();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Vector3f getColorForSlot(TileDrive drive, int slot, float partialTicks) {
|
||||||
|
DriveSlotState state = DriveSlotState.fromCellStatus(drive.getCellStatus(slot));
|
||||||
|
if (state == DriveSlotState.EMPTY) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Vector3f col = STATE_COLORS.get(state);
|
||||||
|
if (drive.isCellBlinking(slot)) {
|
||||||
|
// 200 ms interval (100ms to get to red, then 100ms back)
|
||||||
|
long t = System.currentTimeMillis() % 200;
|
||||||
|
float f = (t - 100) / 200.0f + 0.5f;
|
||||||
|
f = easeInOutCubic(f);
|
||||||
|
col = col.copy();
|
||||||
|
col.lerp(BLINK_COLOR, f);
|
||||||
|
}
|
||||||
|
|
||||||
|
return col;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static float easeInOutCubic(float x) {
|
||||||
|
return x < 0.5f ? 4 * x * x * x : 1 - (float) Math.pow(-2 * x + 2, 3) / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -39,7 +39,6 @@ import appeng.block.spatial.BlockSpatialIOPort;
|
|||||||
import appeng.block.spatial.BlockSpatialPylon;
|
import appeng.block.spatial.BlockSpatialPylon;
|
||||||
import appeng.block.storage.*;
|
import appeng.block.storage.*;
|
||||||
import appeng.bootstrap.*;
|
import appeng.bootstrap.*;
|
||||||
import appeng.bootstrap.components.IEntityRegistrationComponent;
|
|
||||||
import appeng.bootstrap.components.IInitComponent;
|
import appeng.bootstrap.components.IInitComponent;
|
||||||
import appeng.bootstrap.definitions.TileEntityDefinition;
|
import appeng.bootstrap.definitions.TileEntityDefinition;
|
||||||
import appeng.client.render.crafting.CraftingCubeRendering;
|
import appeng.client.render.crafting.CraftingCubeRendering;
|
||||||
@@ -48,16 +47,15 @@ import appeng.client.render.crafting.MonitorBakedModel;
|
|||||||
import appeng.client.render.model.AutoRotatingBakedModel;
|
import appeng.client.render.model.AutoRotatingBakedModel;
|
||||||
import appeng.client.render.spatial.SpatialPylonRendering;
|
import appeng.client.render.spatial.SpatialPylonRendering;
|
||||||
import appeng.client.render.tesr.CrankTESR;
|
import appeng.client.render.tesr.CrankTESR;
|
||||||
|
import appeng.client.render.tesr.DriveLedTileEntityRenderer;
|
||||||
import appeng.client.render.tesr.SkyChestTESR;
|
import appeng.client.render.tesr.SkyChestTESR;
|
||||||
import appeng.core.AppEng;
|
import appeng.core.AppEng;
|
||||||
import appeng.core.features.registries.PartModels;
|
|
||||||
import appeng.debug.*;
|
import appeng.debug.*;
|
||||||
import appeng.decorative.AEDecorativeBlock;
|
import appeng.decorative.AEDecorativeBlock;
|
||||||
import appeng.decorative.solid.*;
|
import appeng.decorative.solid.*;
|
||||||
import appeng.entity.EntityTinyTNTPrimed;
|
import appeng.entity.EntityTinyTNTPrimed;
|
||||||
import appeng.fluids.block.BlockFluidInterface;
|
import appeng.fluids.block.BlockFluidInterface;
|
||||||
import appeng.fluids.tile.TileFluidInterface;
|
import appeng.fluids.tile.TileFluidInterface;
|
||||||
import appeng.helpers.AEGlassMaterial;
|
|
||||||
import appeng.hooks.DispenserBehaviorTinyTNT;
|
import appeng.hooks.DispenserBehaviorTinyTNT;
|
||||||
import appeng.tile.crafting.TileCraftingMonitorTile;
|
import appeng.tile.crafting.TileCraftingMonitorTile;
|
||||||
import appeng.tile.crafting.TileCraftingStorageTile;
|
import appeng.tile.crafting.TileCraftingStorageTile;
|
||||||
@@ -78,7 +76,6 @@ import net.minecraft.block.*;
|
|||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.entity.EntityClassification;
|
import net.minecraft.entity.EntityClassification;
|
||||||
import net.minecraft.entity.EntityType;
|
|
||||||
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;
|
||||||
@@ -365,7 +362,15 @@ public final class ApiBlocks implements IBlocks
|
|||||||
.build();
|
.build();
|
||||||
this.drive = registry.block( "drive", BlockDrive::new )
|
this.drive = registry.block( "drive", BlockDrive::new )
|
||||||
.features( AEFeature.STORAGE_CELLS, AEFeature.ME_DRIVE )
|
.features( AEFeature.STORAGE_CELLS, AEFeature.ME_DRIVE )
|
||||||
.tileEntity( registry.tileEntity("drive", TileDrive.class, TileDrive::new).build() )
|
.tileEntity( registry.tileEntity("drive", TileDrive.class, TileDrive::new)
|
||||||
|
.rendering(new TileEntityRenderingCustomizer<TileDrive>() {
|
||||||
|
@Override
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
public void customize(TileEntityRendering<TileDrive> rendering) {
|
||||||
|
rendering.tileEntityRenderer(DriveLedTileEntityRenderer::new);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.build() )
|
||||||
.rendering( new DriveRendering() )
|
.rendering( new DriveRendering() )
|
||||||
.build();
|
.build();
|
||||||
this.chest = registry.block( "chest", BlockChest::new )
|
this.chest = registry.block( "chest", BlockChest::new )
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ public abstract class AbstractStorageCell<T extends IAEStack<T>> extends AEBaseI
|
|||||||
|
|
||||||
public AbstractStorageCell(Properties properties, final MaterialType whichCell, final int kilobytes ) {
|
public AbstractStorageCell(Properties properties, final MaterialType whichCell, final int kilobytes ) {
|
||||||
super(properties);
|
super(properties);
|
||||||
// FIXME this.setMaxStackSize( 1 ); ---- see point of registration
|
|
||||||
this.totalBytes = kilobytes * 1024;
|
this.totalBytes = kilobytes * 1024;
|
||||||
this.component = whichCell;
|
this.component = whichCell;
|
||||||
}
|
}
|
||||||
@@ -244,4 +243,7 @@ public abstract class AbstractStorageCell<T extends IAEStack<T>> extends AEBaseI
|
|||||||
{
|
{
|
||||||
return AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING );
|
return AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import appeng.container.implementations.ContainerMEMonitorable;
|
|||||||
import appeng.fluids.container.ContainerFluidTerminal;
|
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.inventory.container.ContainerType;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
@@ -290,6 +291,16 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Item getCellItem(int slot) {
|
||||||
|
if (slot != 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ItemStack cell = getCell();
|
||||||
|
return cell.isEmpty() ? null : cell.getItem();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPowered()
|
public boolean isPowered()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,18 +27,18 @@ import java.util.IdentityHashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import appeng.block.AEBaseTileBlock;
|
import appeng.block.storage.DriveSlotCellType;
|
||||||
import appeng.block.storage.DriveSlotsState;
|
import appeng.block.storage.DriveSlotsState;
|
||||||
import appeng.client.render.model.DriveModelData;
|
import appeng.client.render.model.DriveModelData;
|
||||||
import appeng.container.implementations.ContainerDrive;
|
import appeng.container.implementations.ContainerDrive;
|
||||||
import net.minecraft.inventory.container.ContainerType;
|
import net.minecraft.inventory.container.ContainerType;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.model.data.IModelData;
|
import net.minecraftforge.client.model.data.IModelData;
|
||||||
import net.minecraftforge.client.model.data.ModelDataMap;
|
|
||||||
import net.minecraftforge.client.model.data.ModelProperty;
|
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
@@ -70,8 +70,10 @@ import appeng.tile.inventory.AppEngCellInventory;
|
|||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
import appeng.util.inv.InvOperation;
|
import appeng.util.inv.InvOperation;
|
||||||
import appeng.util.inv.filter.IAEItemFilter;
|
import appeng.util.inv.filter.IAEItemFilter;
|
||||||
|
import net.minecraftforge.registries.ForgeRegistries;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
|
||||||
public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPriorityHost
|
public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPriorityHost
|
||||||
@@ -89,6 +91,8 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
|||||||
private Map<IStorageChannel<? extends IAEStack<?>>, List<IMEInventoryHandler>> inventoryHandlers;
|
private Map<IStorageChannel<? extends IAEStack<?>>, List<IMEInventoryHandler>> inventoryHandlers;
|
||||||
private int priority = 0;
|
private int priority = 0;
|
||||||
private boolean wasActive = false;
|
private boolean wasActive = false;
|
||||||
|
// This is only used on the client
|
||||||
|
private final Item[] cellItems = new Item[10];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The state of all cells inside a drive as bitset, using the following format.
|
* The state of all cells inside a drive as bitset, using the following format.
|
||||||
@@ -123,29 +127,101 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
|||||||
{
|
{
|
||||||
newState |= BIT_POWER_MASK;
|
newState |= BIT_POWER_MASK;
|
||||||
}
|
}
|
||||||
|
for( int x = 0; x < this.getCellCount(); x++ ) {
|
||||||
|
newState |= (this.getCellStatus(x) << (3 * x));
|
||||||
|
}
|
||||||
|
data.writeInt( newState );
|
||||||
|
|
||||||
for( int x = 0; x < this.getCellCount(); x++ )
|
writeCellItemIds(data);
|
||||||
{
|
}
|
||||||
newState |= ( this.getCellStatus( x ) << ( 3 * x ) );
|
|
||||||
|
private void writeCellItemIds(PacketBuffer data) {
|
||||||
|
List<ResourceLocation> cellItemIds = new ArrayList<>(getCellCount());
|
||||||
|
byte[] bm = new byte[getCellCount()];
|
||||||
|
for( int x = 0; x < this.getCellCount(); x++ ) {
|
||||||
|
Item item = getCellItem(x);
|
||||||
|
if (item != null && item.getRegistryName() != null) {
|
||||||
|
ResourceLocation itemId = item.getRegistryName();
|
||||||
|
int idx = cellItemIds.indexOf(itemId);
|
||||||
|
if (idx == -1) {
|
||||||
|
cellItemIds.add(itemId);
|
||||||
|
bm[x] = (byte) cellItemIds.size(); // We use 1-based in bm[]
|
||||||
|
} else {
|
||||||
|
bm[x] = (byte)(1 + idx); // 1-based indexing!!
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data.writeInt( newState );
|
// Write out the list of unique cell item ids
|
||||||
|
data.writeByte(cellItemIds.size());
|
||||||
|
for (ResourceLocation itemId : cellItemIds) {
|
||||||
|
data.writeResourceLocation(itemId);
|
||||||
|
}
|
||||||
|
// Then the lookup table for each slot
|
||||||
|
for (int i = 0; i < getCellCount(); i++) {
|
||||||
|
data.writeByte(bm[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean readFromStream( final PacketBuffer data ) throws IOException
|
protected boolean readFromStream( final PacketBuffer data ) throws IOException
|
||||||
{
|
{
|
||||||
final boolean c = super.readFromStream( data );
|
boolean c = super.readFromStream( data );
|
||||||
final int oldState = this.state;
|
final int oldState = this.state;
|
||||||
this.state = data.readInt();
|
this.state = data.readInt();
|
||||||
|
|
||||||
|
c |= this.readCellItemIDs(data);
|
||||||
|
|
||||||
return ( this.state & BIT_STATE_MASK ) != ( oldState & BIT_STATE_MASK ) || c;
|
return ( this.state & BIT_STATE_MASK ) != ( oldState & BIT_STATE_MASK ) || c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean readCellItemIDs(final PacketBuffer data ) {
|
||||||
|
int uniqueStrCount = data.readByte();
|
||||||
|
String[] uniqueStrs = new String[uniqueStrCount];
|
||||||
|
for (int i = 0; i < uniqueStrCount; i++) {
|
||||||
|
uniqueStrs[i] = data.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean changed = false;
|
||||||
|
for (int i = 0; i < getCellCount(); i++) {
|
||||||
|
byte idx = data.readByte();
|
||||||
|
|
||||||
|
// an index of 0 indicates the slot is empty
|
||||||
|
Item item = null;
|
||||||
|
if (idx > 0) {
|
||||||
|
--idx;
|
||||||
|
String itemId = uniqueStrs[idx];
|
||||||
|
item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(itemId));
|
||||||
|
}
|
||||||
|
if (cellItems[i] != item) {
|
||||||
|
changed = true;
|
||||||
|
cellItems[i] = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCellCount()
|
public int getCellCount()
|
||||||
{
|
{
|
||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Item getCellItem(int slot) {
|
||||||
|
// Client-side we'll need to actually use the synced state
|
||||||
|
if (world == null || world.isRemote) {
|
||||||
|
return cellItems[slot];
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack stackInSlot = inv.getStackInSlot(slot);
|
||||||
|
if (!stackInSlot.isEmpty()) {
|
||||||
|
return stackInSlot.getItem();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCellStatus( final int slot )
|
public int getCellStatus( final int slot )
|
||||||
@@ -427,3 +503,4 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
|||||||
return ContainerDrive.TYPE;
|
return ContainerDrive.TYPE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,121 @@
|
|||||||
|
{
|
||||||
|
"credit": "Made with Blockbench",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"4": "appliedenergistics2:block/drive/drive_inside",
|
||||||
|
"particle": "appliedenergistics2:block/drive/drive_side",
|
||||||
|
"side": "appliedenergistics2:block/drive/drive_side",
|
||||||
|
"bottom": "appliedenergistics2:block/drive/drive_bottom",
|
||||||
|
"top": "appliedenergistics2:block/drive/drive_top",
|
||||||
|
"front": "appliedenergistics2:block/drive/drive_front"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"name": "Right Side Panel",
|
||||||
|
"from": [0, 1, 0],
|
||||||
|
"to": [1.5, 15, 16],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [14, 1, 16, 15], "texture": "#front"},
|
||||||
|
"east": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#4"},
|
||||||
|
"south": {"uv": [0, 1, 2, 15], "texture": "#side"},
|
||||||
|
"west": {"uv": [0, 1, 16, 15], "texture": "#side"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Left Side Panel",
|
||||||
|
"from": [14.5, 1, 0],
|
||||||
|
"to": [16, 15, 16],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0, 1, 2, 15], "texture": "#front"},
|
||||||
|
"east": {"uv": [0, 1, 16, 15], "texture": "#side"},
|
||||||
|
"south": {"uv": [14, 1, 16, 15], "texture": "#side"},
|
||||||
|
"west": {"uv": [0, 0, 16, 16], "texture": "#4"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Back Panel",
|
||||||
|
"from": [1.5, 1, 6],
|
||||||
|
"to": [14.5, 15, 16],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [2, 1, 15, 15], "texture": "#4"},
|
||||||
|
"south": {"uv": [1.5, 1, 14.5, 15], "texture": "#side"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Bottom Panel",
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 1, 16],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0, 15, 16, 16], "texture": "#front"},
|
||||||
|
"east": {"uv": [0, 15, 16, 16], "texture": "#side"},
|
||||||
|
"south": {"uv": [0, 15, 16, 16], "texture": "#side"},
|
||||||
|
"west": {"uv": [0, 15, 16, 16], "texture": "#side"},
|
||||||
|
"up": {"uv": [0, 0, 16, 16], "rotation": 90, "texture": "#4"},
|
||||||
|
"down": {"uv": [0, 0, 16, 16], "texture": "#bottom"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Top Panel",
|
||||||
|
"from": [0, 15, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0, 0, 16, 1], "texture": "#front"},
|
||||||
|
"east": {"uv": [0, 0, 16, 1], "texture": "#side"},
|
||||||
|
"south": {"uv": [0, 0, 16, 1], "texture": "#side"},
|
||||||
|
"west": {"uv": [0, 0, 16, 1], "texture": "#side"},
|
||||||
|
"up": {"uv": [0, 0, 16, 16], "texture": "#top"},
|
||||||
|
"down": {"uv": [0, 0, 16, 16], "rotation": 270, "texture": "#4"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Middle Strut",
|
||||||
|
"from": [7.5, 1, 0],
|
||||||
|
"to": [8.5, 15, 8],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [7, 1, 9, 15], "texture": "#front"},
|
||||||
|
"east": {"uv": [0, 0, 8, 14], "rotation": 180, "texture": "#4"},
|
||||||
|
"west": {"uv": [0, 1, 8, 15], "texture": "#4"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Separator",
|
||||||
|
"from": [1.5, 3, 1],
|
||||||
|
"to": [14.5, 4, 8],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [1.5, 12, 14.5, 13], "texture": "#front"},
|
||||||
|
"up": {"uv": [2.5, 1, 13.5, 8], "texture": "#bottom"},
|
||||||
|
"down": {"uv": [2.5, 8, 13.5, 15], "texture": "#bottom"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Separator",
|
||||||
|
"from": [1.5, 6, 1],
|
||||||
|
"to": [14.5, 7, 8],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [1.5, 9, 14.5, 10], "texture": "#front"},
|
||||||
|
"up": {"uv": [2.5, 1, 13.5, 8], "texture": "#bottom"},
|
||||||
|
"down": {"uv": [2.5, 8, 13.5, 15], "texture": "#bottom"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Separator",
|
||||||
|
"from": [1.5, 9, 1],
|
||||||
|
"to": [14.5, 10, 8],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [1.5, 6, 14.5, 7], "texture": "#front"},
|
||||||
|
"up": {"uv": [2.5, 1, 13.5, 8], "texture": "#bottom"},
|
||||||
|
"down": {"uv": [2.5, 8, 13.5, 15], "texture": "#bottom"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Separator",
|
||||||
|
"from": [1.5, 12, 1],
|
||||||
|
"to": [14.5, 13, 8],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [1.5, 3, 14.5, 4], "texture": "#front"},
|
||||||
|
"up": {"uv": [2.5, 1, 13.5, 8], "texture": "#bottom"},
|
||||||
|
"down": {"uv": [2.5, 8, 13.5, 15], "texture": "#bottom"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"textures": {
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
]
|
||||||
|
}
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"textures": {
|
||||||
|
"front": "appliedenergistics2:block/drive/drive_cell_states"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"name": "Cell Backdrop",
|
||||||
|
"from": [
|
||||||
|
8.5,
|
||||||
|
13.0,
|
||||||
|
0.5
|
||||||
|
],
|
||||||
|
"to": [
|
||||||
|
14.5,
|
||||||
|
15.0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"faces": {
|
||||||
|
"north": {
|
||||||
|
"texture": "#front",
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
12,
|
||||||
|
5,
|
||||||
|
14
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"up": {
|
||||||
|
"texture": "#front",
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
12,
|
||||||
|
5,
|
||||||
|
14
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"down": {
|
||||||
|
"texture": "#front",
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
12,
|
||||||
|
5,
|
||||||
|
14
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"textures": {
|
||||||
|
"front": "appliedenergistics2:block/drive/drive_cell_states"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"name": "Cell Backdrop",
|
||||||
|
"from": [
|
||||||
|
8.5,
|
||||||
|
13.0,
|
||||||
|
0.5
|
||||||
|
],
|
||||||
|
"to": [
|
||||||
|
14.5,
|
||||||
|
15.0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"faces": {
|
||||||
|
"north": {
|
||||||
|
"texture": "#front",
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
8,
|
||||||
|
5,
|
||||||
|
10
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"up": {
|
||||||
|
"texture": "#front",
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
8,
|
||||||
|
5,
|
||||||
|
10
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"down": {
|
||||||
|
"texture": "#front",
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
8,
|
||||||
|
5,
|
||||||
|
10
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+88
@@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"loader": "appliedenergistics2:uvlightmap",
|
||||||
|
"textures": {
|
||||||
|
"front": "appliedenergistics2:block/drive/drive/cell_state_offline"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"name": "Cell Light",
|
||||||
|
"from": [
|
||||||
|
9.0,
|
||||||
|
13.0,
|
||||||
|
0.0
|
||||||
|
],
|
||||||
|
"to": [
|
||||||
|
14.0,
|
||||||
|
15.0,
|
||||||
|
1.0
|
||||||
|
],
|
||||||
|
"faces": {
|
||||||
|
"north": {
|
||||||
|
"texture": "#front",
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
16,
|
||||||
|
16
|
||||||
|
],
|
||||||
|
"uvlightmap": {
|
||||||
|
"sky": 0.007,
|
||||||
|
"block": 0.007
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"up": {
|
||||||
|
"texture": "#front",
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
16,
|
||||||
|
16
|
||||||
|
],
|
||||||
|
"uvlightmap": {
|
||||||
|
"sky": 0.007,
|
||||||
|
"block": 0.007
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"down": {
|
||||||
|
"texture": "#front",
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
16,
|
||||||
|
16
|
||||||
|
],
|
||||||
|
"uvlightmap": {
|
||||||
|
"sky": 0.007,
|
||||||
|
"block": 0.007
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"west": {
|
||||||
|
"texture": "#front",
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
16,
|
||||||
|
16
|
||||||
|
],
|
||||||
|
"uvlightmap": {
|
||||||
|
"sky": 0.007,
|
||||||
|
"block": 0.007
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"east": {
|
||||||
|
"texture": "#front",
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
16,
|
||||||
|
16
|
||||||
|
],
|
||||||
|
"uvlightmap": {
|
||||||
|
"sky": 0.007,
|
||||||
|
"block": 0.007
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,172 +0,0 @@
|
|||||||
{
|
|
||||||
"parent": "block/block",
|
|
||||||
"textures": {
|
|
||||||
"particle": "appliedenergistics2:block/drive_side",
|
|
||||||
"side": "appliedenergistics2:block/drive_side",
|
|
||||||
"bottom": "appliedenergistics2:block/drive_bottom",
|
|
||||||
"top": "appliedenergistics2:block/drive_top",
|
|
||||||
"front": "appliedenergistics2:block/drive_front",
|
|
||||||
"inner": "appliedenergistics2:block/drive_bottom"
|
|
||||||
},
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"name": "Right Side Panel",
|
|
||||||
"from": [
|
|
||||||
0.0,
|
|
||||||
1.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
2.0,
|
|
||||||
15.0,
|
|
||||||
16.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
"texture": "#inner"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
"texture": "#side"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Left Side Panel",
|
|
||||||
"from": [
|
|
||||||
14.0,
|
|
||||||
1.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
16.0,
|
|
||||||
15.0,
|
|
||||||
16.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
"texture": "#inner"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Back Panel",
|
|
||||||
"from": [
|
|
||||||
2.0,
|
|
||||||
1.0,
|
|
||||||
8.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
15.0,
|
|
||||||
16.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#inner"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"texture": "#side"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Bottom Panel",
|
|
||||||
"from": [
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
16.0,
|
|
||||||
1.0,
|
|
||||||
16.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
"texture": "#inner"
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
"texture": "#bottom"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Top Panel",
|
|
||||||
"from": [
|
|
||||||
0.0,
|
|
||||||
15.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
16.0,
|
|
||||||
16.0,
|
|
||||||
16.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
"texture": "#top"
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
"texture": "#inner"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Front Panel",
|
|
||||||
"from": [
|
|
||||||
2.0,
|
|
||||||
1.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
15.0,
|
|
||||||
8.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,273 +0,0 @@
|
|||||||
{
|
|
||||||
"parent": "block/block",
|
|
||||||
"textures": {
|
|
||||||
"side": "appliedenergistics2:block/drive_side",
|
|
||||||
"bottom": "appliedenergistics2:block/drive_bottom",
|
|
||||||
"top": "appliedenergistics2:block/drive_top",
|
|
||||||
"front": "appliedenergistics2:block/drive_front",
|
|
||||||
"inner": "appliedenergistics2:block/drive_bottom"
|
|
||||||
},
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"name": "Right Side Panel",
|
|
||||||
"from": [
|
|
||||||
0.0,
|
|
||||||
1.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
2.0,
|
|
||||||
15.0,
|
|
||||||
16.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
"texture": "#inner"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
"texture": "#side"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Left Side Panel",
|
|
||||||
"from": [
|
|
||||||
14.0,
|
|
||||||
1.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
16.0,
|
|
||||||
15.0,
|
|
||||||
16.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
"texture": "#inner"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Back Panel",
|
|
||||||
"from": [
|
|
||||||
2.0,
|
|
||||||
1.0,
|
|
||||||
8.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
15.0,
|
|
||||||
16.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#inner"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"texture": "#side"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Bottom Panel",
|
|
||||||
"from": [
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
16.0,
|
|
||||||
1.0,
|
|
||||||
16.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
"texture": "#inner"
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
"texture": "#bottom"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Top Panel",
|
|
||||||
"from": [
|
|
||||||
0.0,
|
|
||||||
15.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
16.0,
|
|
||||||
16.0,
|
|
||||||
16.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"south": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
"texture": "#side"
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
"texture": "#top"
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
"texture": "#inner"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Middle Strut",
|
|
||||||
"from": [
|
|
||||||
7.0,
|
|
||||||
1.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
9.0,
|
|
||||||
15.0,
|
|
||||||
8.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"east": {
|
|
||||||
"texture": "#inner"
|
|
||||||
},
|
|
||||||
"west": {
|
|
||||||
"texture": "#inner"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Separator",
|
|
||||||
"from": [
|
|
||||||
2.0,
|
|
||||||
3.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
4.0,
|
|
||||||
8.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
"texture": "#inner"
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
"texture": "#inner"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Separator",
|
|
||||||
"from": [
|
|
||||||
2.0,
|
|
||||||
6.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
7.0,
|
|
||||||
8.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
"texture": "#inner"
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
"texture": "#inner"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Separator",
|
|
||||||
"from": [
|
|
||||||
2.0,
|
|
||||||
9.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
10.0,
|
|
||||||
8.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
"texture": "#inner"
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
"texture": "#inner"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Separator",
|
|
||||||
"from": [
|
|
||||||
2.0,
|
|
||||||
12.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
13.0,
|
|
||||||
8.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front"
|
|
||||||
},
|
|
||||||
"up": {
|
|
||||||
"texture": "#inner"
|
|
||||||
},
|
|
||||||
"down": {
|
|
||||||
"texture": "#inner"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"loader": "appliedenergistics2:uvlightmap",
|
|
||||||
"textures": {
|
|
||||||
"front": "appliedenergistics2:block/drive_cell_states"
|
|
||||||
},
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"name": "Cell Backdrop",
|
|
||||||
"from": [
|
|
||||||
9.0,
|
|
||||||
13.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
15.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front",
|
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
10,
|
|
||||||
5,
|
|
||||||
12
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"loader": "appliedenergistics2:uvlightmap",
|
|
||||||
"textures": {
|
|
||||||
"front": "appliedenergistics2:block/drive_cell_states"
|
|
||||||
},
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"name": "Cell Backdrop",
|
|
||||||
"from": [
|
|
||||||
9.0,
|
|
||||||
13.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
15.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front",
|
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
8,
|
|
||||||
5,
|
|
||||||
10
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Cell Light",
|
|
||||||
"from": [
|
|
||||||
9.0,
|
|
||||||
13.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
15.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front",
|
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
6,
|
|
||||||
5,
|
|
||||||
8
|
|
||||||
],
|
|
||||||
"uvlightmap": {
|
|
||||||
"sky": 0.007,
|
|
||||||
"block": 0.007
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"textures": {
|
|
||||||
"front": "appliedenergistics2:block/drive_cell_states"
|
|
||||||
},
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"name": "Cell",
|
|
||||||
"from": [
|
|
||||||
9.0,
|
|
||||||
13.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
15.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front",
|
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
5,
|
|
||||||
2
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"loader": "appliedenergistics2:uvlightmap",
|
|
||||||
"textures": {
|
|
||||||
"front": "appliedenergistics2:block/drive_cell_states"
|
|
||||||
},
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"name": "Cell Backdrop",
|
|
||||||
"from": [
|
|
||||||
9.0,
|
|
||||||
13.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
15.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front",
|
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
8,
|
|
||||||
5,
|
|
||||||
10
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Cell Light",
|
|
||||||
"from": [
|
|
||||||
9.0,
|
|
||||||
13.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
15.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front",
|
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
2,
|
|
||||||
5,
|
|
||||||
4
|
|
||||||
],
|
|
||||||
"uvlightmap": {
|
|
||||||
"sky": 0.007,
|
|
||||||
"block": 0.007
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"loader": "appliedenergistics2:uvlightmap",
|
|
||||||
"textures": {
|
|
||||||
"front": "appliedenergistics2:block/drive_cell_states"
|
|
||||||
},
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"name": "Cell Backdrop",
|
|
||||||
"from": [
|
|
||||||
9.0,
|
|
||||||
13.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
15.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front",
|
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
8,
|
|
||||||
5,
|
|
||||||
10
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Cell Light",
|
|
||||||
"from": [
|
|
||||||
9.0,
|
|
||||||
13.0,
|
|
||||||
0.0
|
|
||||||
],
|
|
||||||
"to": [
|
|
||||||
14.0,
|
|
||||||
15.0,
|
|
||||||
1.0
|
|
||||||
],
|
|
||||||
"faces": {
|
|
||||||
"north": {
|
|
||||||
"texture": "#front",
|
|
||||||
"uv": [
|
|
||||||
0,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6
|
|
||||||
],
|
|
||||||
"uvlightmap": {
|
|
||||||
"sky": 0.007,
|
|
||||||
"block": 0.007
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"parent": "appliedenergistics2:block/drive_base",
|
"parent": "appliedenergistics2:block/drive/drive_base",
|
||||||
"textures": {
|
"textures": {
|
||||||
"front": "appliedenergistics2:block/drive_front_flat"
|
"front": "appliedenergistics2:block/block/drive_front_flat"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 398 B |
Binary file not shown.
|
Before Width: | Height: | Size: 182 B |
Binary file not shown.
|
Before Width: | Height: | Size: 442 B |
Binary file not shown.
|
Before Width: | Height: | Size: 274 B |
Binary file not shown.
|
Before Width: | Height: | Size: 438 B |
Binary file not shown.
|
Before Width: | Height: | Size: 398 B |
Reference in New Issue
Block a user