
Jstylezzz
Members-
Posts
11 -
Joined
-
Last visited
Everything posted by Jstylezzz
-
you need to change fifth parameter to a block as setblock only accepts it as a block not an int Yeah I figured that that was the problem, I wasn't sure how to fix it though. As I see it now, I would need to change the fith '0' to Block.air right? Thanks
-
Hi everyone I've searched quite long on the Internet, but I couldn't find anything on this issue I'm having.. I followed a tutorial to generate structures, and all goes well until the part where I placed the structure.java in Eclipse, and fixed all other errors. The error I am getting is The method setBlock(World, int, int, int, Block, int) in the type structure is not applicable for the arguments (World, int, int, int, int, int) And the actual code that causes this is this.setBlock(world, i + 0, j + 0, k + 0, 0, 0); And this is just one of the, I don't know how many, same errors I am getting. Not sure if it's needed, but here is the beginning of the function public boolean generate(World world, Random rand, int i, int j, int k) { //check that each corner is one of the valid spawn blocks if(!locationIsValidSpawn(world, i, j, k) || !locationIsValidSpawn(world, i + 39, j, k) || !locationIsValidSpawn(world, i + 39, j, k + 65) || !locationIsValidSpawn(world, i, j, k + 65)) { return false; } k = k - 10; i = i - 10; this.setBlock(world, i + 0, j + 0, k + 0, 0, 0); //etc.. The code in the 'structure.java', comes from a file exported from MCEdit (.schematic), and was converted to java code using MrPonyCaptain's converter. All help is appreciated, thanks in advance!
-
[1.7.10] Unreported exception thrown when setting blockbounds
Jstylezzz replied to Jstylezzz's topic in Modder Support
Yeah, I still have it. This is what Eclipse says: 'The type UICopperCable must implement the inherited abstract method ITileEntityProvider.createNewTileEntity(World, int)'. It has the option to add the unimplemented method, but that just adds the createNewTileEntity thing that we just changed.. -
[1.7.10] Unreported exception thrown when setting blockbounds
Jstylezzz replied to Jstylezzz's topic in Modder Support
Ah, thanks a lot for looking I think we nearly solved this problem, yey I added the override @Override public TileEntity createNewTileEntity(World world, int i) { return new TileEntityCable(); } When I change createNewTileEntity to createTileEntity it gives me an error, so I tried it like I paste above. It still crashes on me though Thanks for helping me, and sorry for being so difficult! -
[1.7.10] Unreported exception thrown when setting blockbounds
Jstylezzz replied to Jstylezzz's topic in Modder Support
I added public boolean hasTileEntity(int meta) { return true; } into the UICopperCable class file. It still crashes when I place down the block though. Is there anything else a tileEntity block should have in it's class that I missed? -
[1.7.10] Unreported exception thrown when setting blockbounds
Jstylezzz replied to Jstylezzz's topic in Modder Support
Sure I can package com.jstylezzz.allincluded.block; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import com.jstylezzz.allincluded.AllIncluded; import com.jstylezzz.allincluded.entity.TileEntityCable; public class UICopperCable extends BlockContainer { public UICopperCable() { super(Material.cloth); setStepSound(Block.soundTypeStone); setCreativeTab(CreativeTabs.tabBlock); setCreativeTab(AllIncluded.allIncluded); setBlockName("uiCopperCable"); setBlockTextureName("allincluded:uiCopperCable"); setHardness(1.0f); useNeighborBrightness=true; float pixel = 1F/16; setBlockBounds(11*pixel/2, 11*pixel/2, 11*pixel/2, 1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2); } public TileEntity createNewTileEntity(World world, int i) { return new TileEntityCable(); } public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { TileEntityCable cable = (TileEntityCable) world.getTileEntity(x, y, z); float pixel = 1F/16; float f = 0; if(cable.connections[3] == null) f = 0; else f = 11*pixel/2; this.setBlockBounds(11*pixel/2, 11*pixel/2, 11*pixel/2-(f), 1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2); return AxisAlignedBB.getBoundingBox((double)x+minX, (double)y+minY,(double)z+minZ, (double)x+maxX, (double)y+maxY, (double)z+maxZ); } public int getRenderType(){ return -1; } public boolean isOpaqueCube(){ return false; } public boolean renderAsNormalBlock() { return false; } } Here is the UICopperCable class. I tried something like this, but it still doesn't like it very much. Thanks anyways! -
[1.7.10] Unreported exception thrown when setting blockbounds
Jstylezzz replied to Jstylezzz's topic in Modder Support
Ah I see, thanks for the heads up I'm not really sure what I should change though, the 'connections' is basically this public ForgeDirection [] connections = new ForgeDirection[6]; //and then public void updateConnections() //Called on updateEntity { if(worldObj.getTileEntity(xCoord, yCoord+1, zCoord) instanceof TileEntityCable) connections[0] = ForgeDirection.UP; else connections[0] = null; if(worldObj.getTileEntity(xCoord, yCoord-1, zCoord) instanceof TileEntityCable) connections[1] = ForgeDirection.DOWN; else connections[1] = null; if(worldObj.getTileEntity(xCoord, yCoord, zCoord-1) instanceof TileEntityCable) connections[2] = ForgeDirection.NORTH; else connections[2] = null; if(worldObj.getTileEntity(xCoord+1, yCoord, zCoord) instanceof TileEntityCable) connections[3] = ForgeDirection.EAST; else connections[3] = null; if(worldObj.getTileEntity(xCoord, yCoord, zCoord+1) instanceof TileEntityCable) connections[4] = ForgeDirection.SOUTH; else connections[4] = null; if(worldObj.getTileEntity(xCoord-1, yCoord, zCoord) instanceof TileEntityCable) connections[5] = ForgeDirection.WEST; else connections[5] = null; } Is there a way to get around that NPE? Thanks for the answers so far -
[1.7.10] Unreported exception thrown when setting blockbounds
Jstylezzz replied to Jstylezzz's topic in Modder Support
But the ':0' thing at the end should set that thingie to '0' if it is null right? (cable.connections[3] !=null?(11*pixel/2):0) -
Hello everyone This is my first post here, so my apologies in advance if I do anything wrong! So, I've been following a few tutorials and things seem to go pretty smooth. The only problem that I have is when I set the blockbounds of a block inside the AxisAlignedBB function. In the crash log I get 'Unreported exception thrown'. Here is my full crash thingie that I get in the Eclipse console: It only happens when the following function is not commented out: this.setBlockBounds(11*pixel/2, 11*pixel/2, 11*pixel/2-(cable.connections[3] !=null?(11*pixel/2):0), 1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2); The whole callback is as follows public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { TileEntityCable cable = (TileEntityCable) world.getTileEntity(x, y, z); float pixel = 1F/16; this.setBlockBounds(11*pixel/2, 11*pixel/2, 11*pixel/2-(cable.connections[3] !=null?(11*pixel/2):0), 1-11*pixel/2, 1-11*pixel/2, 1-11*pixel/2); return AxisAlignedBB.getBoundingBox((double)x+minX, (double)y+minY,(double)z+minZ, (double)x+maxX, (double)y+maxY, (double)z+maxZ); } Note, that Minecraft only crashes if I place the block down. If a block is already placed down in the world, it does not make minecraft crash, but it also doesn't change the blockbounds. I'm sure that there is something that I'm doing wrong, but I really can't seem to find out what it is.. I hope someone here knows what's going on, all the help is much appreciated. Thanks in advance! EDIT: lol, I'm sorry for those posts (which I removed again), it seems I pressed the wrong button