Jump to content

[1.9.4] Crash while loading model


MrRiegel

Recommended Posts

Hi,

I created some cable blocks and I want to render them with json files.

 

But starting MC takes an eternity and in the end it crashs with an OutOfMemoryError.

 

---- Minecraft Crash Report ----

// Hi. I'm Minecraft, and I'm a crashaholic.

 

Time: 26.06.16 10:18

Description: Initializing game

 

java.lang.OutOfMemoryError: Java heap space

at javax.vecmath.Matrix4f.clone(Matrix4f.java:3255)

at net.minecraftforge.common.model.TRSRTransformation.getMatrix(TRSRTransformation.java:513)

at net.minecraft.client.renderer.block.model.FaceBakery.rotateVertex(FaceBakery.java:220)

at net.minecraft.client.renderer.block.model.FaceBakery.fillVertexData(FaceBakery.java:148)

at net.minecraft.client.renderer.block.model.FaceBakery.makeQuadVertexData(FaceBakery.java:92)

at net.minecraft.client.renderer.block.model.FaceBakery.makeBakedQuad(FaceBakery.java:64)

at net.minecraft.client.renderer.block.model.ModelBakery.makeBakedQuad(ModelBakery.java:688)

at net.minecraftforge.client.model.ModelLoader.access$500(ModelLoader.java:99)

at net.minecraftforge.client.model.ModelLoader$VanillaModelWrapper.bakeNormal(ModelLoader.java:551)

at net.minecraftforge.client.model.ModelLoader$VanillaModelWrapper.bake(ModelLoader.java:522)

at net.minecraftforge.client.model.MultiModel.bake(MultiModel.java:267)

at net.minecraftforge.client.model.ModelLoader$WeightedRandomModel.bake(ModelLoader.java:779)

at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:163)

at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28)

at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:131)

at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:112)

at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:797)

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:332)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:559)

at net.minecraft.client.Minecraft.run(Minecraft.java:384)

at net.minecraft.client.main.Main.main(Main.java:118)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Thread: Client thread

Stacktrace:

at javax.vecmath.Matrix4f.clone(Matrix4f.java:3255)

at net.minecraftforge.common.model.TRSRTransformation.getMatrix(TRSRTransformation.java:513)

at net.minecraft.client.renderer.block.model.FaceBakery.rotateVertex(FaceBakery.java:220)

at net.minecraft.client.renderer.block.model.FaceBakery.fillVertexData(FaceBakery.java:148)

at net.minecraft.client.renderer.block.model.FaceBakery.makeQuadVertexData(FaceBakery.java:92)

at net.minecraft.client.renderer.block.model.FaceBakery.makeBakedQuad(FaceBakery.java:64)

at net.minecraft.client.renderer.block.model.ModelBakery.makeBakedQuad(ModelBakery.java:688)

at net.minecraftforge.client.model.ModelLoader.access$500(ModelLoader.java:99)

at net.minecraftforge.client.model.ModelLoader$VanillaModelWrapper.bakeNormal(ModelLoader.java:551)

at net.minecraftforge.client.model.ModelLoader$VanillaModelWrapper.bake(ModelLoader.java:522)

at net.minecraftforge.client.model.MultiModel.bake(MultiModel.java:267)

at net.minecraftforge.client.model.ModelLoader$WeightedRandomModel.bake(ModelLoader.java:779)

at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:163)

at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28)

at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:131)

at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:112)

at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:797)

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:332)

 

-- Initialization --

Details:

Stacktrace:

at net.minecraft.client.Minecraft.run(Minecraft.java:389)

at net.minecraft.client.main.Main.main(Main.java:118)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)

at GradleStart.main(GradleStart.java:26)

 

-- System Details --

Details:

Minecraft Version: 1.9.4

Operating System: Linux (amd64) version 3.13.0-37-generic

Java Version: 1.8.0_91, Oracle Corporation

Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 272549888 bytes (259 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP 9.28 Powered by Forge 12.17.0.1957 7 mods loaded, 7 mods active

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UCHIJA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)

UCHIJA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.9.4-12.17.0.1957-PROJECT(Storage-Network).jar)

UCHIJA Forge{12.17.0.1957} [Minecraft Forge] (forgeSrc-1.9.4-12.17.0.1957-PROJECT(Storage-Network).jar)

UCHIJA storagenetwork{1.12.0} [storage Network] (bin)

UCHIJA JEI{3.4.2.206} [Just Enough Items] (jei_1.9.4-3.4.2.206.jar)

UCHIJA Chameleon{1.9-2.1.4} [Chameleon] (Chameleon-1.9-2.1.4(1).jar)

UCHIJA StorageDrawers{1.9-3.1.7} [storage Drawers] (StorageDrawers-1.9-3.1.7(1).jar)

Loaded coremods (and transformers):

GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13399 Compatibility Profile Context 13.35.1005' Renderer: 'AMD Radeon HD 7800 Series  '

Launched Version: 1.9.4

LWJGL: 2.9.4

OpenGL: AMD Radeon HD 7800 Series  GL version 4.5.13399 Compatibility Profile Context 13.35.1005, ATI Technologies Inc.

GL Caps: Using GL 1.3 multitexturing.

Using GL 1.3 texture combiners.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Shaders are available because OpenGL 2.1 is supported.

VBOs are available because OpenGL 1.5 is supported.

 

Using VBOs: No

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Resource Packs:

Current Language: English (US)

Profiler Position: N/A (disabled)

CPU: net.minecraft.client.Minecraft$15@aa8ae85

 

 

Thats the blockstate file and I have 6 (similiar) more of them:

 

{

    "forge_marker" : 1,

    "defaults" : {

        "textures" : {

            "particle" : "storagenetwork:blocks/storageKabel",

            "all" : "storagenetwork:blocks/storageKabel",

            "plate" : "blocks/iron_block"

        },

        "model" : "storagenetwork:kabelCube"

    },

    "variants" : {

        "straight" : {

            "true" : {

               

            },

            "false" : {

                "model" : "storagenetwork:kabelCube"

            }

        },

        "north" : {

            "connect" : {

                "submodel" : {

                    "s1" : {

                        "model" : "storagenetwork:kabelPin",

                        "x" : 90

                    }

                }

            },

            "storage" : {

                "submodel" : {

                    "s1" : {

                        "model" : "storagenetwork:kabelPin",

                        "x" : 90

                    },

                    "s1s" : {

                        "model" : "storagenetwork:kabelPlate",

                        "x" : 90

                    }

                }

            },

            "null" : {

               

            }

        },

        "south" : {

            "connect" : {

                "submodel" : {

                    "s2" : {

                        "model" : "storagenetwork:kabelPin",

                        "x" : 270

                    }

                }

            },

            "storage" : {

                "submodel" : {

                    "s2" : {

                        "model" : "storagenetwork:kabelPin",

                        "x" : 270

                    },

                    "s2s" : {

                        "model" : "storagenetwork:kabelPlate",

                        "x" : 270

                    }

                }

            },

            "null" : {

               

            }

        },

        "west" : {

            "connect" : {

                "submodel" : {

                    "s3" : {

                        "model" : "storagenetwork:kabelPin",

                        "x" : 90,

                        "y" : 270

                    }

                }

            },

            "storage" : {

                "submodel" : {

                    "s3" : {

                        "model" : "storagenetwork:kabelPin",

                        "x" : 90,

                        "y" : 270

                    },

                    "s3s" : {

                        "model" : "storagenetwork:kabelPlate",

                        "x" : 90,

                        "y" : 270

                    }

                }

            },

            "null" : {

               

            }

        },

        "east" : {

            "connect" : {

                "submodel" : {

                    "s4" : {

                        "model" : "storagenetwork:kabelPin",

                        "x" : 90,

                        "y" : 90

                    }

                }

            },

            "storage" : {

                "submodel" : {

                    "s4" : {

                        "model" : "storagenetwork:kabelPin",

                        "x" : 90,

                        "y" : 90

                    },

                    "s4s" : {

                        "model" : "storagenetwork:kabelPlate",

                        "x" : 90,

                        "y" : 90

                    }

                }

            },

            "null" : {

               

            }

        },

        "up" : {

            "connect" : {

                "submodel" : {

                    "s5" : {

                        "model" : "storagenetwork:kabelPin"

                    }

                }

            },

            "storage" : {

                "submodel" : {

                    "s5" : {

                        "model" : "storagenetwork:kabelPin"

                    },

                    "s5s" : {

                        "model" : "storagenetwork:kabelPlate"

                    }

                }

            },

            "null" : {

               

            }

        },

        "down" : {

            "connect" : {

                "submodel" : {

                    "s6" : {

                        "model" : "storagenetwork:kabelPin",

                        "x" : 180

                    }

                }

            },

            "storage" : {

                "submodel" : {

                    "s6" : {

                        "model" : "storagenetwork:kabelPin",

                        "x" : 180

                    },

                    "s6s" : {

                        "model" : "storagenetwork:kabelPin",

                        "x" : 180

                    }

                }

            },

            "null" : {

               

            }

        }

    }

}

 

 

The models look like that

 

{

    "elements" : [{

            "__comment" : "cube",

            "from" : [5, 5, 5],

            "to" : [11, 11, 11],

            "faces" : {

                "down" : {

                    "texture" : "#all"

                },

                "up" : {

                    "texture" : "#all"

                },

                "north" : {

                    "texture" : "#all"

                },

                "south" : {

                    "texture" : "#all"

                },

                "west" : {

                    "texture" : "#all"

                },

                "east" : {

                    "texture" : "#all"

                }

            }

        }]

}

 

 

 

just in case the block class

 

package mrriegel.storagenetwork.blocks;

 

import java.util.List;

import java.util.Map;

import java.util.Map.Entry;

import java.util.Random;

 

import javax.annotation.Nullable;

 

import mrriegel.storagenetwork.CreativeTab;

import mrriegel.storagenetwork.StorageNetwork;

import mrriegel.storagenetwork.api.IConnectable;

import mrriegel.storagenetwork.config.ConfigHandler;

import mrriegel.storagenetwork.handler.GuiHandler;

import mrriegel.storagenetwork.helper.InvHelper;

import mrriegel.storagenetwork.helper.Util;

import mrriegel.storagenetwork.init.ModBlocks;

import mrriegel.storagenetwork.init.ModItems;

import mrriegel.storagenetwork.tile.TileKabel;

import mrriegel.storagenetwork.tile.TileKabel.Kind;

import mrriegel.storagenetwork.tile.TileMaster;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.block.properties.IProperty;

import net.minecraft.block.properties.PropertyBool;

import net.minecraft.block.properties.PropertyEnum;

import net.minecraft.block.state.BlockStateContainer;

import net.minecraft.block.state.IBlockState;

import net.minecraft.client.resources.I18n;

import net.minecraft.entity.Entity;

import net.minecraft.entity.EntityLivingBase;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.init.Blocks;

import net.minecraft.item.ItemBlock;

import net.minecraft.item.ItemStack;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.BlockRenderLayer;

import net.minecraft.util.EnumBlockRenderType;

import net.minecraft.util.EnumFacing;

import net.minecraft.util.EnumHand;

import net.minecraft.util.IStringSerializable;

import net.minecraft.util.math.AxisAlignedBB;

import net.minecraft.util.math.BlockPos;

import net.minecraft.world.IBlockAccess;

import net.minecraft.world.World;

import net.minecraftforge.common.property.ExtendedBlockState;

import net.minecraftforge.common.property.IExtendedBlockState;

import net.minecraftforge.common.property.IUnlistedProperty;

import net.minecraftforge.fml.relauncher.Side;

import net.minecraftforge.fml.relauncher.SideOnly;

 

import com.google.common.collect.Lists;

import com.google.common.collect.Maps;

 

public class BlockKabel extends BlockConnectable {

 

public static final PropertyConnection NORTH = PropertyConnection.create("north");

public static final PropertyConnection SOUTH = PropertyConnection.create("south");

public static final PropertyConnection WEST = PropertyConnection.create("west");

public static final PropertyConnection EAST = PropertyConnection.create("east");

public static final PropertyConnection DOWN = PropertyConnection.create("down");

public static final PropertyConnection UP = PropertyConnection.create("up");

public static final PropertyBool STRAIGHT = PropertyBool.create("straight");

 

public static enum Connect implements IStringSerializable {

CONNECT("connect"), STORAGE("storage"), NULL("null");

String name;

 

private Connect(String name) {

this.name = name;

}

 

@Override

public String getName() {

return name;

}

}

 

public BlockKabel() {

super(Material.IRON);

this.setHardness(1.4F);

this.setCreativeTab(CreativeTab.tab1);

this.setDefaultState(blockState.getBaseState().withProperty(NORTH, Connect.NULL).withProperty(SOUTH, Connect.NULL).withProperty(WEST, Connect.NULL).withProperty(EAST, Connect.NULL).withProperty(UP, Connect.NULL).withProperty(DOWN, Connect.NULL).withProperty(STRAIGHT, false));

}

 

@Override

public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {

return false;

}

 

@Override

public boolean isOpaqueCube(IBlockState state) {

return false;

}

 

@Override

@SideOnly(Side.CLIENT)

public boolean isTranslucent(IBlockState state) {

return true;

}

 

@Override

public boolean isFullCube(IBlockState state) {

return false;

}

 

@Override

public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) {

return layer == BlockRenderLayer.SOLID;

}

 

@Override

public EnumBlockRenderType getRenderType(IBlockState state) {

return EnumBlockRenderType.MODEL;

}

 

@Override

public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {

if (!(worldIn.getTileEntity(pos) instanceof TileKabel))

return false;

if (worldIn.isRemote)

return true;

TileKabel tile = (TileKabel) worldIn.getTileEntity(pos);

if (/* tile.getMaster() == null || */(heldItem != null && (heldItem.getItem() == ModItems.coverstick || heldItem.getItem() == ModItems.toggler || heldItem.getItem() == ModItems.duplicator)))

return false;

else if (tile.getKind() == Kind.exKabel || tile.getKind() == Kind.imKabel || tile.getKind() == Kind.storageKabel) {

playerIn.openGui(StorageNetwork.instance, GuiHandler.CABLE, worldIn, pos.getX(), pos.getY(), pos.getZ());

return true;

}

return false;

}

 

@Override

public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) {

worldIn.notifyBlockUpdate(pos, state, state, 3);

worldIn.markBlockRangeForRenderUpdate(pos.add(-1, -1, -1), pos.add(1, 1, 1));

super.neighborChanged(state, worldIn, pos, blockIn);

 

}

 

@Override

public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {

setConnections(worldIn, pos, state, false);

}

 

@Override

protected BlockStateContainer createBlockState() {

return new BlockStateContainer(this, new IProperty[] { NORTH, SOUTH, EAST, WEST, UP, DOWN, STRAIGHT });

}

 

@Override

public int getMetaFromState(IBlockState state) {

return 0;

}

 

boolean validInventory(IBlockAccess worldIn, BlockPos pos, EnumFacing side) {

return InvHelper.hasItemHandler(worldIn, pos, side);

}

 

IBlockState getNewState(IBlockAccess world, BlockPos pos) {

if (!(world.getTileEntity(pos) instanceof TileKabel))

return world.getBlockState(pos);

TileKabel tile = (TileKabel) world.getTileEntity(pos);

EnumFacing face = null;

BlockPos con = null;

Map<EnumFacing, Connect> oldMap = tile.getConnects();

Map<EnumFacing, Connect> newMap = Maps.newHashMap();

 

EnumFacing stor = null;

for (Entry<EnumFacing, Connect> e : oldMap.entrySet()) {

if (e.getValue() == Connect.STORAGE) {

stor = e.getKey();

break;

}

}

boolean storage = false;

boolean first = false;

if (stor != null && getConnect(world, pos, pos.offset(stor)) == Connect.STORAGE) {

newMap.put(stor, Connect.STORAGE);

storage = true;

first = true;

}

for (EnumFacing f : EnumFacing.values()) {

if (stor == f && first)

continue;

Connect neu = getConnect(world, pos, pos.offset(f));

if (neu == Connect.STORAGE)

if (!storage) {

newMap.put(f, neu);

storage = true;

} else

newMap.put(f, Connect.NULL);

else

newMap.put(f, neu);

}

tile.setConnects(newMap);

 

if (tile.north == Connect.STORAGE) {

face = EnumFacing.NORTH;

con = pos.north();

} else if (tile.south == Connect.STORAGE) {

face = EnumFacing.SOUTH;

con = pos.south();

} else if (tile.east == Connect.STORAGE) {

face = EnumFacing.EAST;

con = pos.east();

} else if (tile.west == Connect.STORAGE) {

face = EnumFacing.WEST;

con = pos.west();

} else if (tile.down == Connect.STORAGE) {

face = EnumFacing.DOWN;

con = pos.down();

} else if (tile.up == Connect.STORAGE) {

face = EnumFacing.UP;

con = pos.up();

}

 

tile.setInventoryFace(face);

tile.setConnectedInventory(con);

Map<EnumFacing, Connect> map = tile.getConnects();

return world.getBlockState(pos).withProperty(NORTH, map.get(EnumFacing.NORTH)).withProperty(SOUTH, map.get(EnumFacing.SOUTH)).withProperty(EAST, map.get(EnumFacing.EAST)).withProperty(WEST, map.get(EnumFacing.WEST)).withProperty(UP, map.get(EnumFacing.UP)).withProperty(DOWN, map.get(EnumFacing.DOWN)).withProperty(STRAIGHT, oo(tile));

}

 

@Override

public void setConnections(World worldIn, BlockPos pos, IBlockState state, boolean refresh) {

state = getNewState(worldIn, pos);

super.setConnections(worldIn, pos, state, refresh);

if (refresh)

Util.updateTile(worldIn, pos);

// worldIn.setBlockState(pos, state);

}

 

@Override

public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {

try {

IBlockState foo = getNewState(worldIn, pos);

return foo;

} catch (Exception e) {

e.printStackTrace();

return super.getActualState(state, worldIn, pos);

}

}

 

private boolean oo(TileKabel tile) {

boolean a = connected(tile.north) && connected(tile.south) && !connected(tile.west) && !connected(tile.east) && !connected(tile.up) && !connected(tile.down);

boolean b = !connected(tile.north) && !connected(tile.south) && connected(tile.west) && connected(tile.east) && !connected(tile.up) && !connected(tile.down);

boolean c = !connected(tile.north) && !connected(tile.south) && !connected(tile.west) && !connected(tile.east) && connected(tile.up) && connected(tile.down);

return (a ^ b ^ c) && tile.getKind() == Kind.kabel;

}

 

private boolean connected(Connect c) {

return c == Connect.STORAGE || c == Connect.CONNECT;

}

 

public static EnumFacing get(BlockPos a, BlockPos b) {

if (a.up().equals(b))

return EnumFacing.DOWN;

if (a.down().equals(b))

return EnumFacing.UP;

if (a.west().equals(b))

return EnumFacing.EAST;

if (a.east().equals(b))

return EnumFacing.WEST;

if (a.north().equals(b))

return EnumFacing.SOUTH;

if (a.south().equals(b))

return EnumFacing.NORTH;

return null;

}

 

@Override

public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn) {

if (!(worldIn.getTileEntity(pos) instanceof TileKabel))

return;

state = state.getActualState(worldIn, pos);

TileKabel tile = (TileKabel) worldIn.getTileEntity(pos);

if (tile != null && tile.getCover() != null) {

if (tile.getCover() != Blocks.GLASS)

addCollisionBoxToList(pos, entityBox, collidingBoxes, FULL_BLOCK_AABB);

else if (ConfigHandler.untouchable)

addCollisionBoxToList(pos, entityBox, collidingBoxes, NULL_AABB);

return;

}

float f = 0.3125F;

float f1 = 0.6875F;

float f2 = 0.3125F;

float f3 = 0.6875F;

float f4 = 0.3125F;

float f5 = 0.6875F;

addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(f, f4, f2, f1, f5, f3));

 

if (state.getValue(NORTH) != Connect.NULL) {

f2 = 0f;

addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(f, f4, f2, f1, f5, f3));

}

if (state.getValue(SOUTH) != Connect.NULL) {

f3 = 1f;

addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(f, f4, f2, f1, f5, f3));

}

if (state.getValue(WEST) != Connect.NULL) {

f = 0f;

addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(f, f4, f2, f1, f5, f3));

}

if (state.getValue(EAST) != Connect.NULL) {

f1 = 1f;

addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(f, f4, f2, f1, f5, f3));

}

if (state.getValue(DOWN) != Connect.NULL) {

f4 = 0f;

addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(f, f4, f2, f1, f5, f3));

}

if (state.getValue(UP) != Connect.NULL) {

f5 = 1f;

addCollisionBoxToList(pos, entityBox, collidingBoxes, new AxisAlignedBB(f, f4, f2, f1, f5, f3));

}

 

}

 

@Override

public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {

if (!(source.getTileEntity(pos) instanceof TileKabel))

return FULL_BLOCK_AABB;

state = state.getActualState(source, pos);

TileKabel tile = (TileKabel) source.getTileEntity(pos);

float f = 0.3125F;

float f1 = 0.6875F;

float f2 = 0.3125F;

float f3 = 0.6875F;

float f4 = 0.3125F;

float f5 = 0.6875F;

if (tile == null)

return new AxisAlignedBB(f, f4, f2, f1, f5, f3);

if (tile != null && tile.getCover() != null && tile.getCover() != Blocks.GLASS) {

return FULL_BLOCK_AABB;

}

AxisAlignedBB res = new AxisAlignedBB(0, 0, 0, 0, 0, 0);

 

if (state.getValue(NORTH) != Connect.NULL) {

f2 = 0f;

}

if (state.getValue(SOUTH) != Connect.NULL) {

f3 = 1f;

}

if (state.getValue(WEST) != Connect.NULL) {

f = 0f;

}

if (state.getValue(EAST) != Connect.NULL) {

f1 = 1f;

}

if (state.getValue(DOWN) != Connect.NULL) {

f4 = 0f;

}

if (state.getValue(UP) != Connect.NULL) {

f5 = 1f;

}

return new AxisAlignedBB(f, f4, f2, f1, f5, f3);

}

 

protected Connect getConnect(IBlockAccess worldIn, BlockPos orig, BlockPos pos) {

// if(true)return Connect.values()[new

// Random().nextInt(Connect.values().length)];

Block block = worldIn.getBlockState(pos).getBlock();

Block ori = worldIn.getBlockState(orig).getBlock();

if (worldIn.getTileEntity(pos) instanceof IConnectable || worldIn.getTileEntity(pos) instanceof TileMaster)

return Connect.CONNECT;

if (ori == ModBlocks.kabel || ori == ModBlocks.vacuumKabel)

return Connect.NULL;

EnumFacing face = get(orig, pos);

if (!validInventory(worldIn, pos, face))

return Connect.NULL;

return Connect.STORAGE;

}

 

@Override

public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {

TileEntity tileentity = worldIn.getTileEntity(pos);

if (tileentity instanceof TileKabel) {

TileKabel tile = (TileKabel) tileentity;

for (int i = 0; i < tile.getUpgrades().size(); i++) {

Util.spawnItemStack(worldIn, pos.getX(), pos.getY(), pos.getZ(), tile.getUpgrades().get(i));

}

}

 

super.breakBlock(worldIn, pos, state);

}

 

@Override

public TileEntity createNewTileEntity(World worldIn, int meta) {

return new TileKabel();

}

 

public static class Item extends ItemBlock {

 

public Item(Block block) {

super(block);

}

 

@Override

public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {

super.addInformation(stack, playerIn, tooltip, advanced);

if (stack.getItem() == net.minecraft.item.Item.getItemFromBlock(ModBlocks.exKabel))

tooltip.add(I18n.format("tooltip.storagenetwork.kabel_E"));

else if (stack.getItem() == net.minecraft.item.Item.getItemFromBlock(ModBlocks.imKabel))

tooltip.add(I18n.format("tooltip.storagenetwork.kabel_I"));

else if (stack.getItem() == net.minecraft.item.Item.getItemFromBlock(ModBlocks.storageKabel))

tooltip.add(I18n.format("tooltip.storagenetwork.kabel_S"));

else if (stack.getItem() == net.minecraft.item.Item.getItemFromBlock(ModBlocks.vacuumKabel))

tooltip.add(I18n.format("tooltip.storagenetwork.kabel_V"));

else if (stack.getItem() == net.minecraft.item.Item.getItemFromBlock(ModBlocks.kabel))

tooltip.add(I18n.format("tooltip.storagenetwork.kabel_L"));

tooltip.add(I18n.format("tooltip.storagenetwork.networkNeeded"));

}

 

}

 

public static class PropertyConnection extends PropertyEnum<Connect> {

 

String name;

 

public PropertyConnection(String name2) {

super(name2, Connect.class, Lists.newArrayList(Connect.values()));

this.name = name2;

}

 

public static PropertyConnection create(String name) {

return new PropertyConnection(name);

}

 

@Override

public String getName() {

return name;

}

}

 

}

 

 

 

Thanks for your help

Link to comment
Share on other sites

Sorry, that isn't the solution I was looking for.

Maybe it will solve the problem for me but not the ones that will use the mod.

And even if it works the start still lasts ~5 min.

 

Why do a few blockstate files suck up 2 GB memory?

Pressure Pipes and NeoTech use very similar blockstate files for their cables and they don't have that kind of problem.

What am I doing wrong?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.