Fixed controller model warning during launch + Improved memory usage of some models

This commit is contained in:
raoulvdberge
2017-04-01 15:53:39 +02:00
parent 5ef0da5988
commit 6c8b0ac057
41 changed files with 87 additions and 133 deletions

View File

@@ -14,6 +14,8 @@
- Autocrafting bugfixes (way2muchnoise) - Autocrafting bugfixes (way2muchnoise)
- Fire event on completion of an autocrafting task (way2muchnoise) - Fire event on completion of an autocrafting task (way2muchnoise)
- Fire playerCrafting event when shift clicking in the grid (way2muchnoise) - Fire playerCrafting event when shift clicking in the grid (way2muchnoise)
- Fixed controller model warning during launch (raoulvdberge)
- Improved memory usage of some models (raoulvdberge)
### 1.4.1 ### 1.4.1
- Added Storage Monitor (raoulvdberge) - Added Storage Monitor (raoulvdberge)

View File

@@ -12,7 +12,6 @@ import com.raoulvdberge.refinedstorage.proxy.CapabilityNetworkNodeProxy;
import com.raoulvdberge.refinedstorage.tile.TileBase; import com.raoulvdberge.refinedstorage.tile.TileBase;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -28,8 +27,6 @@ import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.IItemHandler;
public abstract class BlockBase extends Block { public abstract class BlockBase extends Block {
public static final PropertyDirection DIRECTION = PropertyDirection.create("direction");
private final String name; private final String name;
public BlockBase(String name) { public BlockBase(String name) {
@@ -50,8 +47,8 @@ public abstract class BlockBase extends Block {
protected BlockStateContainer.Builder createBlockStateBuilder() { protected BlockStateContainer.Builder createBlockStateBuilder() {
BlockStateContainer.Builder builder = new BlockStateContainer.Builder(this); BlockStateContainer.Builder builder = new BlockStateContainer.Builder(this);
if (getPlacementType() != null) { if (getDirection() != null) {
builder.add(DIRECTION); builder.add(getDirection().getProperty());
} }
return builder; return builder;
@@ -63,7 +60,7 @@ public abstract class BlockBase extends Block {
} }
public Item createItem() { public Item createItem() {
return new ItemBlockBase(this, getPlacementType(), false); return new ItemBlockBase(this, getDirection(), false);
} }
@Override @Override
@@ -80,11 +77,11 @@ public abstract class BlockBase extends Block {
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
if (getPlacementType() != null) { if (getDirection() != null) {
TileEntity tile = IntegrationMCMP.isLoaded() ? RSMCMPAddon.unwrapTile(world, pos) : world.getTileEntity(pos); TileEntity tile = IntegrationMCMP.isLoaded() ? RSMCMPAddon.unwrapTile(world, pos) : world.getTileEntity(pos);
if (tile instanceof TileBase) { if (tile instanceof TileBase) {
return state.withProperty(DIRECTION, ((TileBase) tile).getDirection()); return state.withProperty(getDirection().getProperty(), ((TileBase) tile).getDirection());
} }
} }
@@ -98,10 +95,10 @@ public abstract class BlockBase extends Block {
@Override @Override
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) { public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) {
if (!world.isRemote && getPlacementType() != null) { if (!world.isRemote && getDirection() != null) {
TileBase tile = (TileBase) world.getTileEntity(pos); TileBase tile = (TileBase) world.getTileEntity(pos);
tile.setDirection(getPlacementType().cycle(tile.getDirection())); tile.setDirection(getDirection().cycle(tile.getDirection()));
RSUtils.updateBlock(world, pos); RSUtils.updateBlock(world, pos);
@@ -192,7 +189,7 @@ public abstract class BlockBase extends Block {
return super.canEntityDestroy(state, world, pos, entity); return super.canEntityDestroy(state, world, pos, entity);
} }
public PlacementType getPlacementType() { public Direction getDirection() {
return PlacementType.HORIZONTAL; return Direction.HORIZONTAL;
} }
} }

View File

@@ -60,20 +60,14 @@ public class BlockCable extends BlockNode {
@Override @Override
protected BlockStateContainer createBlockState() { protected BlockStateContainer createBlockState() {
BlockStateContainer.Builder builder = super.createBlockStateBuilder(); return super.createBlockStateBuilder()
.add(NORTH)
builder.add(NORTH)
.add(EAST) .add(EAST)
.add(SOUTH) .add(SOUTH)
.add(WEST) .add(WEST)
.add(UP) .add(UP)
.add(DOWN); .add(DOWN)
.build();
if (getPlacementType() != null) {
builder.add(DIRECTION);
}
return builder.build();
} }
@Override @Override
@@ -114,7 +108,7 @@ public class BlockCable extends BlockNode {
EnumFacing otherTileSide = direction.getOpposite(); EnumFacing otherTileSide = direction.getOpposite();
if (otherTile != null && otherTile.hasCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, otherTileSide)) { if (otherTile != null && otherTile.hasCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, otherTileSide)) {
if (getPlacementType() != null && ((TileNode) tile).getNode().getFacingTile() == otherTile) { if (getDirection() != null && ((TileNode) tile).getNode().getFacingTile() == otherTile) {
return false; return false;
} }
@@ -219,8 +213,8 @@ public class BlockCable extends BlockNode {
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase entity) { public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase entity) {
IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, entity); IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, entity);
if (getPlacementType() != null) { if (getDirection() != null) {
return state.withProperty(DIRECTION, getPlacementType().getFrom(facing, pos, entity)); return state.withProperty(getDirection().getProperty(), getDirection().getFrom(facing, pos, entity));
} }
return state; return state;
@@ -232,7 +226,7 @@ public class BlockCable extends BlockNode {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }

View File

@@ -38,7 +38,7 @@ public class BlockConstructor extends BlockCable {
public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) { public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) {
List<AxisAlignedBB> boxes = new ArrayList<>(); List<AxisAlignedBB> boxes = new ArrayList<>();
switch (state.getValue(DIRECTION)) { switch (state.getValue(getDirection().getProperty())) {
case NORTH: case NORTH:
boxes.add(HOLDER_NORTH_AABB); boxes.add(HOLDER_NORTH_AABB);
boxes.add(HEAD_NORTH_AABB); boxes.add(HEAD_NORTH_AABB);
@@ -92,7 +92,7 @@ public class BlockConstructor extends BlockCable {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return PlacementType.ANY; return Direction.ANY;
} }
} }

View File

@@ -30,8 +30,8 @@ public class BlockCrafter extends BlockNode {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return PlacementType.ANY_FACE_PLAYER; return Direction.ANY_FACE_PLAYER;
} }
public boolean hasConnectivityState() { public boolean hasConnectivityState() {

View File

@@ -48,7 +48,7 @@ public class BlockDestructor extends BlockCable {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return PlacementType.ANY; return Direction.ANY;
} }
} }

View File

@@ -87,7 +87,7 @@ public class BlockDetector extends BlockNode {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }
} }

View File

@@ -64,9 +64,4 @@ public class BlockDiskManipulator extends BlockNode {
public boolean hasConnectivityState() { public boolean hasConnectivityState() {
return true; return true;
} }
@Override
public PlacementType getPlacementType() {
return PlacementType.HORIZONTAL;
}
} }

View File

@@ -43,7 +43,7 @@ public class BlockExporter extends BlockCable {
public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) { public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) {
List<AxisAlignedBB> boxes = new ArrayList<>(); List<AxisAlignedBB> boxes = new ArrayList<>();
switch (state.getValue(DIRECTION)) { switch (state.getValue(getDirection().getProperty())) {
case NORTH: case NORTH:
boxes.add(LINE_NORTH_1_AABB); boxes.add(LINE_NORTH_1_AABB);
boxes.add(LINE_NORTH_2_AABB); boxes.add(LINE_NORTH_2_AABB);
@@ -98,7 +98,7 @@ public class BlockExporter extends BlockCable {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return PlacementType.ANY; return Direction.ANY;
} }
} }

View File

@@ -33,7 +33,7 @@ public class BlockExternalStorage extends BlockCable {
public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) { public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) {
List<AxisAlignedBB> boxes = new ArrayList<>(); List<AxisAlignedBB> boxes = new ArrayList<>();
switch (state.getValue(DIRECTION)) { switch (state.getValue(getDirection().getProperty())) {
case NORTH: case NORTH:
boxes.add(BlockConstructor.HOLDER_NORTH_AABB); boxes.add(BlockConstructor.HOLDER_NORTH_AABB);
boxes.add(HEAD_NORTH_AABB); boxes.add(HEAD_NORTH_AABB);
@@ -96,7 +96,7 @@ public class BlockExternalStorage extends BlockCable {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return PlacementType.ANY; return Direction.ANY;
} }
} }

View File

@@ -36,7 +36,7 @@ public class BlockFluidInterface extends BlockNode {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }
} }

View File

@@ -112,7 +112,7 @@ public class BlockFluidStorage extends BlockNode {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }
} }

View File

@@ -69,6 +69,6 @@ public class BlockGrid extends BlockNode {
@Override @Override
public Item createItem() { public Item createItem() {
return new ItemBlockBase(this, getPlacementType(), true); return new ItemBlockBase(this, getDirection(), true);
} }
} }

View File

@@ -43,7 +43,7 @@ public class BlockImporter extends BlockCable {
public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) { public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) {
List<AxisAlignedBB> boxes = new ArrayList<>(); List<AxisAlignedBB> boxes = new ArrayList<>();
switch (state.getValue(DIRECTION)) { switch (state.getValue(getDirection().getProperty())) {
case NORTH: case NORTH:
boxes.add(LINE_NORTH_1_AABB); boxes.add(LINE_NORTH_1_AABB);
boxes.add(LINE_NORTH_2_AABB); boxes.add(LINE_NORTH_2_AABB);
@@ -98,7 +98,7 @@ public class BlockImporter extends BlockCable {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return PlacementType.ANY; return Direction.ANY;
} }
} }

View File

@@ -36,7 +36,7 @@ public class BlockInterface extends BlockNode {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }
} }

View File

@@ -6,7 +6,7 @@ public class BlockMachineCasing extends BlockBase {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }
} }

View File

@@ -16,7 +16,7 @@ public class BlockNetworkReceiver extends BlockNode {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }

View File

@@ -30,7 +30,7 @@ public class BlockNetworkTransmitter extends BlockNode {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }

View File

@@ -49,7 +49,7 @@ public class BlockProcessingPatternEncoder extends BlockBase {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }
} }

View File

@@ -6,7 +6,7 @@ public class BlockQuartzEnrichedIron extends BlockBase {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }
} }

View File

@@ -70,7 +70,7 @@ public class BlockReader extends BlockCable {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return PlacementType.ANY_FACE_PLAYER; return Direction.ANY_FACE_PLAYER;
} }
} }

View File

@@ -30,7 +30,7 @@ public class BlockRelay extends BlockNode {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }

View File

@@ -61,7 +61,7 @@ public class BlockSolderer extends BlockNode {
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileSolderer && ((TileSolderer) tile).isWorking()) { if (tile instanceof TileSolderer && ((TileSolderer) tile).isWorking()) {
EnumFacing direction = getActualState(state, world, pos).getValue(DIRECTION); EnumFacing direction = getActualState(state, world, pos).getValue(getDirection().getProperty());
double x = 0; double x = 0;
double y = (double) pos.getY() + 0.6D + rand.nextDouble() / 32F; double y = (double) pos.getY() + 0.6D + rand.nextDouble() / 32F;
@@ -108,9 +108,4 @@ public class BlockSolderer extends BlockNode {
public boolean isFullCube(IBlockState state) { public boolean isFullCube(IBlockState state) {
return false; return false;
} }
@Override
public PlacementType getPlacementType() {
return PlacementType.HORIZONTAL;
}
} }

View File

@@ -112,7 +112,7 @@ public class BlockStorage extends BlockNode {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }
} }

View File

@@ -85,7 +85,7 @@ public class BlockWirelessTransmitter extends BlockNode {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return null; return null;
} }

View File

@@ -91,7 +91,7 @@ public class BlockWriter extends BlockCable {
} }
@Override @Override
public PlacementType getPlacementType() { public Direction getDirection() {
return PlacementType.ANY_FACE_PLAYER; return Direction.ANY_FACE_PLAYER;
} }
} }

View File

@@ -1,27 +1,24 @@
package com.raoulvdberge.refinedstorage.block; package com.raoulvdberge.refinedstorage.block;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import scala.actors.threadpool.Arrays;
public enum PlacementType { public enum Direction {
ANY( ANY(EnumFacing.VALUES),
EnumFacing.VALUES ANY_FACE_PLAYER(EnumFacing.VALUES),
), HORIZONTAL(EnumFacing.NORTH, EnumFacing.EAST, EnumFacing.SOUTH, EnumFacing.WEST);
ANY_FACE_PLAYER(
EnumFacing.VALUES
),
HORIZONTAL(
EnumFacing.NORTH,
EnumFacing.EAST,
EnumFacing.SOUTH,
EnumFacing.WEST
);
final EnumFacing[] allowed; private final PropertyDirection property;
PlacementType(EnumFacing... allowed) { Direction(EnumFacing... allowed) {
this.allowed = allowed; this.property = PropertyDirection.create("direction", Arrays.asList(allowed));
}
public PropertyDirection getProperty() {
return property;
} }
public EnumFacing getFrom(EnumFacing facing, BlockPos pos, EntityLivingBase entity) { public EnumFacing getFrom(EnumFacing facing, BlockPos pos, EntityLivingBase entity) {

View File

@@ -1,6 +1,6 @@
package com.raoulvdberge.refinedstorage.item; package com.raoulvdberge.refinedstorage.item;
import com.raoulvdberge.refinedstorage.block.PlacementType; import com.raoulvdberge.refinedstorage.block.Direction;
import com.raoulvdberge.refinedstorage.tile.TileBase; import com.raoulvdberge.refinedstorage.tile.TileBase;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@@ -13,14 +13,14 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
public class ItemBlockBase extends ItemBlock { public class ItemBlockBase extends ItemBlock {
private PlacementType placementType; private Direction direction;
public ItemBlockBase(Block block, PlacementType placementType, boolean subtypes) { public ItemBlockBase(Block block, Direction direction, boolean subtypes) {
super(block); super(block);
setRegistryName(block.getRegistryName()); setRegistryName(block.getRegistryName());
this.placementType = placementType; this.direction = direction;
if (subtypes) { if (subtypes) {
setMaxDamage(0); setMaxDamage(0);
@@ -46,11 +46,11 @@ public class ItemBlockBase extends ItemBlock {
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) { public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) {
boolean result = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState); boolean result = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState);
if (result && placementType != null) { if (result && direction != null) {
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileBase) { if (tile instanceof TileBase) {
((TileBase) tile).setDirection(placementType.getFrom(side, pos, player)); ((TileBase) tile).setDirection(direction.getFrom(side, pos, player));
} }
} }

View File

@@ -14,7 +14,7 @@ import java.util.List;
public class ItemBlockController extends ItemBlockBase { public class ItemBlockController extends ItemBlockBase {
public ItemBlockController() { public ItemBlockController() {
super(RSBlocks.CONTROLLER, RSBlocks.CONTROLLER.getPlacementType(), true); super(RSBlocks.CONTROLLER, RSBlocks.CONTROLLER.getDirection(), true);
} }
@Override @Override

View File

@@ -20,7 +20,7 @@ import java.util.List;
public class ItemBlockFluidStorage extends ItemBlockBase { public class ItemBlockFluidStorage extends ItemBlockBase {
public ItemBlockFluidStorage() { public ItemBlockFluidStorage() {
super(RSBlocks.FLUID_STORAGE, RSBlocks.FLUID_STORAGE.getPlacementType(), true); super(RSBlocks.FLUID_STORAGE, RSBlocks.FLUID_STORAGE.getDirection(), true);
} }
@Override @Override

View File

@@ -20,7 +20,7 @@ import java.util.List;
public class ItemBlockStorage extends ItemBlockBase { public class ItemBlockStorage extends ItemBlockBase {
public ItemBlockStorage() { public ItemBlockStorage() {
super(RSBlocks.STORAGE, RSBlocks.STORAGE.getPlacementType(), true); super(RSBlocks.STORAGE, RSBlocks.STORAGE.getDirection(), true);
} }
@Override @Override

View File

@@ -161,6 +161,7 @@ public class ProxyCommon {
registerBlock(RSBlocks.GRID); registerBlock(RSBlocks.GRID);
registerBlock(RSBlocks.CRAFTING_MONITOR); registerBlock(RSBlocks.CRAFTING_MONITOR);
registerBlock(RSBlocks.STORAGE_MONITOR); registerBlock(RSBlocks.STORAGE_MONITOR);
registerBlock(RSBlocks.SECURITY_MANAGER);
registerBlock(RSBlocks.CRAFTER); registerBlock(RSBlocks.CRAFTER);
registerBlock(RSBlocks.PROCESSING_PATTERN_ENCODER); registerBlock(RSBlocks.PROCESSING_PATTERN_ENCODER);
registerBlock(RSBlocks.DISK_DRIVE); registerBlock(RSBlocks.DISK_DRIVE);
@@ -173,7 +174,6 @@ public class ProxyCommon {
registerBlock(RSBlocks.EXTERNAL_STORAGE); registerBlock(RSBlocks.EXTERNAL_STORAGE);
registerBlock(RSBlocks.CONSTRUCTOR); registerBlock(RSBlocks.CONSTRUCTOR);
registerBlock(RSBlocks.DESTRUCTOR); registerBlock(RSBlocks.DESTRUCTOR);
registerBlock(RSBlocks.SECURITY_MANAGER);
registerBlock(RSBlocks.READER); registerBlock(RSBlocks.READER);
registerBlock(RSBlocks.WRITER); registerBlock(RSBlocks.WRITER);
@@ -840,7 +840,7 @@ public class ProxyCommon {
private void registerBlock(BlockCable cable) { private void registerBlock(BlockCable cable) {
GameRegistry.<Block>register(cable); GameRegistry.<Block>register(cable);
GameRegistry.register(new ItemBlockBase(cable, cable.getPlacementType(), false)); GameRegistry.register(new ItemBlockBase(cable, cable.getDirection(), false));
cableTypes.add(cable); cableTypes.add(cable);
} }

View File

@@ -3,7 +3,7 @@ package com.raoulvdberge.refinedstorage.render;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader; import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache; import com.google.common.cache.LoadingCache;
import com.raoulvdberge.refinedstorage.block.BlockBase; import com.raoulvdberge.refinedstorage.RSBlocks;
import com.raoulvdberge.refinedstorage.block.BlockDiskDrive; import com.raoulvdberge.refinedstorage.block.BlockDiskDrive;
import com.raoulvdberge.refinedstorage.tile.TileDiskDrive; import com.raoulvdberge.refinedstorage.tile.TileDiskDrive;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@@ -71,7 +71,7 @@ public class BakedModelDiskDrive implements IBakedModel {
private LoadingCache<CacheKey, List<BakedQuad>> cache = CacheBuilder.newBuilder().build(new CacheLoader<CacheKey, List<BakedQuad>>() { private LoadingCache<CacheKey, List<BakedQuad>> cache = CacheBuilder.newBuilder().build(new CacheLoader<CacheKey, List<BakedQuad>>() {
@Override @Override
public List<BakedQuad> load(CacheKey key) throws Exception { public List<BakedQuad> load(CacheKey key) throws Exception {
EnumFacing facing = key.state.getValue(BlockBase.DIRECTION); EnumFacing facing = key.state.getValue(RSBlocks.DISK_DRIVE.getDirection().getProperty());
List<BakedQuad> quads = models.get(facing).getQuads(key.state, key.side, 0); List<BakedQuad> quads = models.get(facing).getQuads(key.state, key.side, 0);

View File

@@ -3,7 +3,7 @@ package com.raoulvdberge.refinedstorage.render;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader; import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache; import com.google.common.cache.LoadingCache;
import com.raoulvdberge.refinedstorage.block.BlockBase; import com.raoulvdberge.refinedstorage.RSBlocks;
import com.raoulvdberge.refinedstorage.block.BlockDiskManipulator; import com.raoulvdberge.refinedstorage.block.BlockDiskManipulator;
import com.raoulvdberge.refinedstorage.tile.TileDiskDrive; import com.raoulvdberge.refinedstorage.tile.TileDiskDrive;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@@ -72,7 +72,7 @@ public class BakedModelDiskManipulator implements IBakedModel {
private LoadingCache<CacheKey, List<BakedQuad>> cache = CacheBuilder.newBuilder().build(new CacheLoader<CacheKey, List<BakedQuad>>() { private LoadingCache<CacheKey, List<BakedQuad>> cache = CacheBuilder.newBuilder().build(new CacheLoader<CacheKey, List<BakedQuad>>() {
@Override @Override
public List<BakedQuad> load(CacheKey key) throws Exception { public List<BakedQuad> load(CacheKey key) throws Exception {
EnumFacing facing = key.state.getValue(BlockBase.DIRECTION); EnumFacing facing = key.state.getValue(RSBlocks.DISK_MANIPULATOR.getDirection().getProperty());
List<BakedQuad> quads = (key.state.getValue(BlockDiskManipulator.CONNECTED) ? modelsConnected : modelsDisconnected).get(facing).getQuads(key.state, key.side, 0); List<BakedQuad> quads = (key.state.getValue(BlockDiskManipulator.CONNECTED) ? modelsConnected : modelsDisconnected).get(facing).getQuads(key.state, key.side, 0);

View File

@@ -10,6 +10,11 @@
} }
}, },
"variants": { "variants": {
"inventory": [
{
"transform": "forge:default-block"
}
],
"energy": { "energy": {
"0": { "0": {
"textures": { "textures": {

View File

@@ -40,12 +40,6 @@
}, },
"west": { "west": {
"y": 270 "y": 270
},
"up": {
"x": 270
},
"down": {
"x": 90
} }
} }
} }

View File

@@ -70,12 +70,6 @@
}, },
"west": { "west": {
"y": 270 "y": 270
},
"up": {
"x": 270
},
"down": {
"x": 90
} }
} }
} }

View File

@@ -15,8 +15,7 @@
"variants": { "variants": {
"inventory": [ "inventory": [
{ {
"transform": "forge:default-block", "transform": "forge:default-block"
"y": 0
} }
], ],
"normal": { "normal": {

View File

@@ -43,12 +43,6 @@
}, },
"west": { "west": {
"y": 270 "y": 270
},
"up": {
"x": 270
},
"down": {
"x": 90
} }
} }
} }

View File

@@ -31,12 +31,6 @@
}, },
"west": { "west": {
"y": 270 "y": 270
},
"up": {
"x": 270
},
"down": {
"x": 90
} }
} }
} }

View File

@@ -34,12 +34,6 @@
}, },
"west": { "west": {
"y": 270 "y": 270
},
"up": {
"x": 270
},
"down": {
"x": 90
} }
} }
} }