Jump to content

[1.12.2]Calling ItemStack array in casted tileentity crashes world


tebreca

Recommended Posts

So hello everybody, i was trying to make a tile entity for a machine that would onky accept items in special slots, but when it calls the update statement, i instantly get a exeption, i tried to debug but i didn't found anything. Do i send packets in the wrong way?

 

code for TE:

package btf.objects.blocks.tiles;

import btf.init.BlockInit;
import btf.init.ItemInit;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;

public class TileAssembler extends TileEntity{
	public ItemStack[] inv = new ItemStack[3];

	public ItemStack getInv(int meta) {
		return this.inv[meta];
	}

	public void setInv(ItemStack inv, int meta) {
		this.inv[meta] = inv;
	}

	public void refresh() {
		if(inv[0].getItem()==Items.DIAMOND_HOE&&inv[1].getItem()==ItemInit.copperGear) {
			if(world.getBlockState(pos.add(0, 1, 0)).getBlock()==BlockInit.casingWooden) {
				world.setBlockState(pos.add(0, 1, 0), BlockInit.harvester.getDefaultState());
				inv[0]=null;inv[1]=null;
			}
		} else if (inv[2].getItem()==Items.DIAMOND_PICKAXE&&inv[3].getItem()==ItemInit.ironGear) {
			if(world.getBlockState(pos.add(0, 1, 0)).getBlock()==BlockInit.casingWooden) {
				world.setBlockState(pos.add(0, 1, 0), BlockInit.blockbreaker.getDefaultState());
				inv[2]=null;inv[3]=null;
			}
		}
		
	}
	
	@Override
	public NBTTagCompound writeToNBT(NBTTagCompound compound) {
		// TODO Auto-generated method stub
		return super.writeToNBT(compound);
	}
	
	@Override
	public void readFromNBT(NBTTagCompound compound) {
		// TODO Auto-generated method stub
		super.readFromNBT(compound);
	}
	
	
}

 

Block code:

package btf.objects.blocks;

import btf.main.Main;
import btf.objects.blocks.tiles.TileAssembler;
import btf.objects.blocks.tiles.TileBlockBreaker;
import btf.objects.blocks.tiles.TileCrafterMachine;
import btf.objects.blocks.tiles.TileHarvesterTicker;
import btf.util.handlers.MachineHandler;
import btf.util.handlers.MachineHandler.MachineTypes;
import net.minecraft.block.BlockRedstoneWire;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public class Machine extends BlockBase implements ITileEntityProvider{
	public static final PropertyDirection FACING = PropertyDirection.create("facing");
	MachineTypes typeIn;

	public Machine(String name, Material materialIn, CreativeTabs tab, MachineTypes machinetype) {
		super(name, materialIn, tab);
		typeIn=machinetype;
		this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
	}
	@Deprecated
	public Machine(String name, Material materialIn, CreativeTabs tab) {
		//EXTREMELY DEPRECATED use (String name, Material materialIn, CreativeTabs tab, MachineTypes machinetype) instead
		super(name, materialIn, tab);
		Main.LOGGER.warn("Registering Machines Without a MACHINETYPE!! this is ABSOLUTELY Deprecated");
	}
	
	@Override
	public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
		 switch (typeIn) {
		 case FACTORYTABLE: 
		 {
		 if(side == side.EAST || side == side.WEST || side == side.NORTH || side == side.SOUTH)
			 return true;
		 return false;
		 }
		case BLOCKBREAKER:
		{
			if (side == side.DOWN)
				return true;
			return false;
		}
		case HARVESTER:
		{
			if (side == side.DOWN)
				return true;
			return false;
		}
		case TELEPORTER:
		{
			return false;
		}
		case WOODENCASING:
		{
			return false;
		}
		case ASSEMBLER:
		{
			return false;
		}
			
		}
		return false;
	}
	
	@Override
	public TileEntity createTileEntity(World world, IBlockState state) {
		switch (typeIn) {
		case WOODENCASING: 
		{
			//TODO Add TileEntity
			break;
		}
		case BLOCKBREAKER:
		{
			return new TileBlockBreaker();
		}
		case FACTORYTABLE:
		{
			return new TileCrafterMachine();
		}
		case HARVESTER:
		{
			return new TileHarvesterTicker();
		}
		case TELEPORTER:
		{
		//TODO Add TileEntity
			break;
		}
		case ASSEMBLER:
		{
			return new TileAssembler();
		}
		}
		return super.createTileEntity(world, state);
	}
	
	@Override
	public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
		if (this.typeIn == MachineTypes.HARVESTER||this.typeIn == MachineTypes.BLOCKBREAKER) {
		worldIn.setBlockState(pos, this.getBlockState().getBaseState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()));
		}
		super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
		}
	
	@Override
	protected BlockStateContainer createBlockState() {
		return new BlockStateContainer(this, FACING);
		}

	@Override
    public int getMetaFromState(IBlockState state) {
        return state.getValue(FACING).getIndex();
    }

    @Override
    public IBlockState getStateFromMeta(int meta) {
        return this.getDefaultState().withProperty(FACING, EnumFacing.getFront(meta & 7));
    }
    
    @Override
    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
    		EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
    	MachineHandler.OnBlockActivated(worldIn, pos, state, playerIn, hand, typeIn);
    	return super.onBlockActivated(worldIn, pos, state, playerIn, hand, facing, hitX, hitY, hitZ);
    }
	@Override
	public TileEntity createNewTileEntity(World worldIn, int meta) {
		if (typeIn == MachineTypes.BLOCKBREAKER)
			return new TileBlockBreaker();
		if (typeIn == MachineTypes.HARVESTER)
		return new TileHarvesterTicker();
		if (typeIn == MachineTypes.ASSEMBLER)
			return new TileAssembler();
		return null;
	}
	
}

 

the machinehandler handling the onclick event:

package btf.util.handlers;

import java.util.Map;
import java.util.Random;

import btf.init.ItemInit;
import btf.main.Main;
import btf.objects.blocks.Machine;
import btf.objects.blocks.tiles.TileAssembler;
import btf.objects.blocks.tiles.TileCrafterMachine;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class MachineHandler {
	public static enum MachineTypes {
	     BLOCKBREAKER, FACTORYTABLE, HARVESTER, TELEPORTER, WOODENCASING, ASSEMBLER
	}
	private boolean initialized = false;
	private BlockPos breaking;
	private int dropx;
	private int dropy;
	private int dropz;
	
	public static void OnBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
    		EnumHand hand, MachineTypes typeIn) {
		switch (typeIn) {
		case WOODENCASING: 
		{
			
			break;
		}
		case BLOCKBREAKER:
		{
			break;
		}
		case FACTORYTABLE:
		{
			if (playerIn.getActiveItemStack().getItem() == Items.DIAMOND_HOE) {
				//null
			}
			break;
		}
		case HARVESTER:
		{
			break;
		}
		case TELEPORTER:
		{
			if (!playerIn.isSneaking()) {
				BlockPos posNew = new BlockPos(pos.getX(), pos.getY()+1, pos.getZ());
				if(worldIn.getBlockState(posNew) == Blocks.AIR.getDefaultState()) {
					BlockPos playerPos = playerIn.getPosition().add(0, -1, 0);
					if (worldIn.getBlockState(playerPos) == state)
						playerIn.move(MoverType.SELF, 0, 1.0, 0);
					worldIn.setBlockToAir(pos);
					worldIn.setBlockState(posNew, state);
				
				}
				
			}else {
					BlockPos posNew = new BlockPos(pos.getX(), pos.getY()-1, pos.getZ());
					if(worldIn.getBlockState(posNew) == Blocks.AIR.getDefaultState()) {
					worldIn.setBlockToAir(pos);
					worldIn.setBlockState(posNew, state);
					}
			}
			}
		case ASSEMBLER:
		{
			ItemStack inv;
			inv = playerIn.getActiveItemStack().copy();
			inv.setCount(1);
			int meta=0;
			ItemStack[] acceptedItems = new ItemStack[] {
					new ItemStack(Items.DIAMOND_HOE),
					new ItemStack(ItemInit.copperGear),
					new ItemStack(Items.DIAMOND_PICKAXE),
					new ItemStack(ItemInit.ironGear)
			};
			for ( ItemStack invcheck:acceptedItems) {
				meta++;
				if(invcheck.getItem() == inv.getItem()) {
					TileEntity TileentityIn = worldIn.getTileEntity(pos);
					if(TileentityIn instanceof TileAssembler) {
						TileAssembler tileIn = (TileAssembler)TileentityIn;
						tileIn.setInv(inv, meta);
						playerIn.getActiveItemStack().shrink(1);
					}
				}
			}
			TileEntity TileentityIn = worldIn.getTileEntity(pos);
			if(TileentityIn instanceof TileAssembler) {
			TileAssembler tileIn = (TileAssembler)worldIn.getTileEntity(pos);
			tileIn.refresh();
			}
		}
			break;
		}	
	}
	

}

 

Edited by tebreca
forgot version
Link to comment
Share on other sites

stacktrace:

Thread: Client thread
Stacktrace:
	at btf.objects.blocks.tiles.TileAssembler.refresh(TileAssembler.java:22)
	at btf.util.handlers.MachineHandler.OnBlockActivated(MachineHandler.java:106)
	at btf.objects.blocks.Machine.onBlockActivated(Machine.java:142)
	at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClickBlock(PlayerControllerMP.java:454)
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1674)
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2361)
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2127)

-- Affected level --
Details:
	Level name: MpServer
	All players: 1 total; [EntityPlayerSP['Player525'/331, l='MpServer', x=-175.22, y=75.00, z=260.58]]
	Chunk stats: MultiplayerChunkCache: 539, 539
	Level seed: 0
	Level generator: ID 00 - default, ver 1. Features enabled: false
	Level generator options: 
	Level spawn location: World: (-172,64,256), Chunk: (at 4,4,0 in -11,16; contains blocks -176,0,256 to -161,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
	Level time: 36358 game time, 36358 day time
	Level dimension: 0
	Level storage version: 0x00000 - Unknown?
	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
	Forced entities: 107 total; [EntitySkeleton['Skeleton'/65, l='MpServer', x=-244.50, y=29.00, z=192.50], EntityCow['Cow'/66, l='MpServer', x=-241.22, y=69.00, z=195.41], EntityCow['Cow'/67, l='MpServer', x=-251.03, y=66.00, z=213.58], EntityCow['Cow'/68, l='MpServer', x=-246.50, y=68.00, z=238.50], EntityWolf['Wolf'/69, l='MpServer', x=-239.70, y=68.00, z=239.38], EntityCow['Cow'/70, l='MpServer', x=-238.55, y=69.00, z=246.27], EntityCow['Cow'/71, l='MpServer', x=-253.79, y=72.00, z=330.56], EntityCow['Cow'/72, l='MpServer', x=-244.64, y=72.00, z=319.62], EntityPlayerSP['Player525'/331, l='MpServer', x=-175.22, y=75.00, z=260.58], EntityCow['Cow'/88, l='MpServer', x=-234.45, y=70.00, z=202.68], EntityCow['Cow'/89, l='MpServer', x=-237.16, y=67.00, z=220.17], EntityCow['Cow'/90, l='MpServer', x=-232.83, y=70.00, z=249.86], EntityCow['Cow'/91, l='MpServer', x=-239.82, y=69.00, z=267.63], EntityCow['Cow'/92, l='MpServer', x=-232.93, y=69.00, z=270.55], EntityCow['Cow'/93, l='MpServer', x=-229.60, y=70.00, z=284.50], EntityCow['Cow'/94, l='MpServer', x=-236.58, y=68.00, z=280.78], EntityCow['Cow'/95, l='MpServer', x=-227.20, y=70.00, z=298.14], EntityCow['Cow'/96, l='MpServer', x=-228.55, y=70.00, z=298.22], EntityWolf['Wolf'/97, l='MpServer', x=-234.00, y=68.00, z=295.77], EntityWolf['Wolf'/98, l='MpServer', x=-233.43, y=68.00, z=295.09], EntityZombie['Zombie'/106, l='MpServer', x=-215.50, y=21.00, z=236.50], EntityBat['Bat'/107, l='MpServer', x=-212.56, y=55.58, z=264.43], EntityCow['Cow'/108, l='MpServer', x=-221.20, y=70.00, z=263.83], EntitySkeleton['Skeleton'/109, l='MpServer', x=-210.50, y=53.00, z=274.50], EntityCow['Cow'/110, l='MpServer', x=-216.21, y=70.00, z=285.40], EntityCow['Cow'/111, l='MpServer', x=-212.44, y=70.00, z=283.26], EntityCow['Cow'/112, l='MpServer', x=-209.45, y=69.00, z=294.32], EntitySkeleton['Skeleton'/113, l='MpServer', x=-218.50, y=22.00, z=325.01], EntityZombie['Zombie'/114, l='MpServer', x=-215.50, y=39.00, z=339.50], EntityWolf['Wolf'/119, l='MpServer', x=-193.26, y=73.00, z=210.61], EntityCow['Cow'/120, l='MpServer', x=-196.50, y=74.00, z=202.72], EntityCow['Cow'/121, l='MpServer', x=-200.34, y=74.25, z=229.41], EntityWolf['Wolf'/122, l='MpServer', x=-197.60, y=71.00, z=237.27], EntitySkeleton['Skeleton'/123, l='MpServer', x=-192.50, y=28.00, z=260.50], EntitySpider['Spider'/124, l='MpServer', x=-204.03, y=31.00, z=260.65], EntityZombie['Zombie'/125, l='MpServer', x=-192.39, y=59.00, z=266.13], EntitySkeleton['Skeleton'/126, l='MpServer', x=-197.50, y=20.00, z=280.50], EntityZombie['Zombie'/127, l='MpServer', x=-197.31, y=18.00, z=275.74], EntityZombie['Zombie'/128, l='MpServer', x=-201.35, y=19.00, z=278.48], EntityBat['Bat'/129, l='MpServer', x=-195.03, y=21.48, z=275.17], EntityCow['Cow'/130, l='MpServer', x=-199.78, y=70.00, z=291.82], EntityCow['Cow'/131, l='MpServer', x=-199.61, y=70.00, z=301.21], EntityCow['Cow'/132, l='MpServer', x=-202.30, y=70.00, z=297.57], EntityCow['Cow'/133, l='MpServer', x=-198.87, y=70.00, z=298.87], EntitySkeleton['Skeleton'/134, l='MpServer', x=-195.50, y=16.00, z=305.50], EntitySkeleton['Skeleton'/135, l='MpServer', x=-193.49, y=16.00, z=305.78], EntityZombie['Zombie'/136, l='MpServer', x=-195.50, y=16.00, z=305.50], EntityCow['Cow'/139, l='MpServer', x=-180.22, y=72.00, z=204.85], EntityCow['Cow'/140, l='MpServer', x=-176.44, y=71.00, z=206.21], EntitySkeleton['Skeleton'/141, l='MpServer', x=-184.50, y=35.00, z=253.50], EntityCreeper['Creeper'/142, l='MpServer', x=-179.46, y=60.00, z=255.55], EntitySkeleton['Skeleton'/143, l='MpServer', x=-187.35, y=58.00, z=266.22], EntityBat['Bat'/144, l='MpServer', x=-182.75, y=64.10, z=258.25], EntityBat['Bat'/145, l='MpServer', x=-185.27, y=55.10, z=281.59], EntityCreeper['Creeper'/146, l='MpServer', x=-184.52, y=52.00, z=282.97], EntityBat['Bat'/147, l='MpServer', x=-184.30, y=54.10, z=281.66], EntityZombie['Zombie'/148, l='MpServer', x=-177.77, y=56.00, z=278.50], EntityItem['item.item.dyePowder.black'/149, l='MpServer', x=-186.82, y=47.00, z=292.89], EntityBat['Bat'/150, l='MpServer', x=-190.36, y=19.27, z=311.34], EntityCow['Cow'/153, l='MpServer', x=-174.50, y=67.00, z=195.21], EntityBat['Bat'/154, l='MpServer', x=-167.30, y=58.10, z=243.57], EntityCreeper['Creeper'/155, l='MpServer', x=-172.45, y=62.00, z=251.85], EntitySpider['Spider'/156, l='MpServer', x=-168.21, y=62.00, z=246.74], EntityZombie['Zombie'/157, l='MpServer', x=-163.50, y=26.00, z=270.50], EntitySkeleton['Skeleton'/158, l='MpServer', x=-163.50, y=35.00, z=265.50], EntityCreeper['Creeper'/159, l='MpServer', x=-164.50, y=35.00, z=267.50], EntityBat['Bat'/160, l='MpServer', x=-171.25, y=59.10, z=269.75], EntityWitch['Witch'/161, l='MpServer', x=-173.73, y=61.00, z=256.46], EntityItem['item.item.carrots'/162, l='MpServer', x=-175.50, y=74.00, z=256.50], EntitySkeleton['Skeleton'/163, l='MpServer', x=-166.50, y=19.00, z=285.50], EntityZombie['Zombie'/164, l='MpServer', x=-163.70, y=33.00, z=278.50], EntityBat['Bat'/165, l='MpServer', x=-174.25, y=61.10, z=282.25], EntityBat['Bat'/166, l='MpServer', x=-167.23, y=56.10, z=280.99], EntitySpider['Spider'/167, l='MpServer', x=-174.70, y=59.00, z=281.60], EntitySkeleton['Skeleton'/168, l='MpServer', x=-160.50, y=54.00, z=287.50], EntitySkeleton['Skeleton'/169, l='MpServer', x=-170.70, y=58.00, z=277.70], EntityBat['Bat'/170, l='MpServer', x=-165.14, y=53.09, z=285.49], EntitySkeleton['Skeleton'/171, l='MpServer', x=-175.50, y=18.00, z=313.50], EntitySpider['Spider'/179, l='MpServer', x=-155.50, y=32.00, z=203.50], EntityBat['Bat'/181, l='MpServer', x=-144.25, y=33.10, z=231.75], EntitySkeleton['Skeleton'/182, l='MpServer', x=-156.50, y=45.00, z=241.50], EntityZombie['Zombie'/183, l='MpServer', x=-149.57, y=15.00, z=259.25], EntityWitch['Witch'/184, l='MpServer', x=-165.93, y=39.00, z=287.50], EntityZombie['Zombie'/185, l='MpServer', x=-158.50, y=34.00, z=285.19], EntitySkeleton['Skeleton'/186, l='MpServer', x=-159.50, y=54.00, z=285.50], EntityCreeper['Creeper'/187, l='MpServer', x=-148.18, y=16.00, z=288.51], EntitySkeleton['Skeleton'/188, l='MpServer', x=-155.50, y=47.00, z=334.50], EntityZombie['Zombie'/189, l='MpServer', x=-157.07, y=47.00, z=330.22], EntityZombie['Zombie'/190, l='MpServer', x=-153.50, y=46.00, z=327.50], EntitySkeleton['Skeleton'/191, l='MpServer', x=-157.31, y=29.00, z=340.56], EntityChicken['Chicken'/200, l='MpServer', x=-133.12, y=82.00, z=183.49], EntityMinecartChest['Minecart with Chest'/201, l='MpServer', x=-138.50, y=31.06, z=236.50], EntityBat['Bat'/202, l='MpServer', x=-140.57, y=33.10, z=229.25], EntitySkeleton['Skeleton'/203, l='MpServer', x=-142.49, y=35.00, z=246.33], EntityCreeper['Creeper'/204, l='MpServer', x=-130.60, y=24.00, z=266.85], EntityBat['Bat'/205, l='MpServer', x=-134.10, y=18.16, z=261.58], EntityWolf['Wolf'/206, l='MpServer', x=-138.50, y=74.00, z=256.17], EntitySkeleton['Skeleton'/207, l='MpServer', x=-137.74, y=25.00, z=285.56], EntityChicken['Chicken'/222, l='MpServer', x=-122.59, y=88.00, z=188.53], EntityChicken['Chicken'/225, l='MpServer', x=-114.61, y=90.00, z=192.14], EntitySkeleton['Skeleton'/226, l='MpServer', x=-116.50, y=22.00, z=227.50], EntitySkeleton['Skeleton'/227, l='MpServer', x=-122.49, y=24.00, z=233.18], EntityBat['Bat'/228, l='MpServer', x=-119.44, y=13.10, z=253.81], EntityZombie['Zombie'/240, l='MpServer', x=-110.24, y=41.00, z=198.50], EntitySkeleton['Skeleton'/241, l='MpServer', x=-97.58, y=49.00, z=219.07], EntityZombie['Zombie'/242, l='MpServer', x=-102.73, y=32.00, z=238.52], EntityZombieVillager['Zombie Villager'/243, l='MpServer', x=-100.22, y=51.00, z=310.52]]
	Retry entities: 0 total; []
	Server brand: fml,forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:461)
	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2879)
	at net.minecraft.client.Minecraft.run(Minecraft.java:465)
	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)

 

exeption:

java.lang.NullPointerException: null
	at btf.objects.blocks.tiles.TileAssembler.refresh(TileAssembler.java:22) ~[TileAssembler.class:?]
	at btf.util.handlers.MachineHandler.OnBlockActivated(MachineHandler.java:106) ~[MachineHandler.class:?]
	at btf.objects.blocks.Machine.onBlockActivated(Machine.java:142) ~[Machine.class:?]
	at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClickBlock(PlayerControllerMP.java:454) ~[PlayerControllerMP.class:?]
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1674) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2361) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2127) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1915) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1171) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:436) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_151]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_151]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]

 

Edited by tebreca
Link to comment
Share on other sites

4 minutes ago, diesieben07 said:
  • Don't implement ITileEntityProvider. To add a TileEntity to your block, override hasTileEntity and createTileEntity.
  • In your OnBlockActivated the meta variable starts counting at 0 and then gets incremented 4 times. You use it after every increment, so you end up using values 1 through 4. Then you call setInv on your tile entity with that, but setInv can only accept values 0 through 3, because it accesses an array of length 4. Even if that does not crash because out of sheer luck you don't have the right things in your inventory, the inv array in your TileEntity will end up containing null values, which your refresh method does not handle (it just calls methods on the values in inv).
  • Your formatting is all over the place and you don't follow Java naming conventions. Please don't do this...

ok, thx

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I'm struggling so hard to find a way to allow players to use my config file to modify where structures are being created. I have checked for events in the documentation but none of them seem to be of use for this. Why pointing Biome is not enough? Well Certain mods like Lost cities use vanilla generation, causing many structures to spawn in, completely disrupting the dimension generation. Is there a way to control dimensional spawning of structures? Please Im still trying very hard to find how to do this.
    • I'm new to modpack making, but familiar with file management and mod development. I cannot locate which mod is causing the crash. If it's more than one, Im not sure how to locate it. Any clues as to whats causing this? I have read through different possible causes but every thing is different, and none of the solves issues are the solution to my problem. This problem started occurring after adding about 5 mods, but once I removed them, the problem continued. It worked fine before.   Here is the crash report.
    • Nvm, added EMF and ETF to a Primarily Create using Modpack, it works, but with Rechiseled it softlocks in the initialization screen of Forge and just sits there..cuz the CPU load just goes to 0%.
    • Everytime i try to join my server my minecraft closes and crashes. Im using the void launcher right now to play this mod. Can someone please help im not sure why this is happening. This is the crash report   ---- Minecraft Crash Report ---- // Uh... Did I do that? Time: 6/25/24 7:05 PM Description: Unexpected error java.lang.NullPointerException: Unexpected error     at net.minecraft.crash.CrashReportCategory.func_85069_a(CrashReportCategory.java:145)     at net.minecraft.crash.CrashReport.func_85057_a(CrashReport.java:333)     at net.minecraft.crash.CrashReport.func_85058_a(CrashReport.java:303)     at net.minecraft.client.Minecraft.func_71407_l(Unknown Source)     at net.minecraft.client.Minecraft.func_71411_J(Unknown Source)     at net.minecraft.client.Minecraft.func_99999_d(Unknown Source)     at net.minecraft.client.main.Main.main(SourceFile:148)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)     at java.lang.reflect.Method.invoke(Unknown Source)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:     Minecraft Version: 1.7.10     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_271, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 1743850688 bytes (1663 MB) / 3333947392 bytes (3179 MB) up to 3817865216 bytes (3641 MB)     JVM Flags: 11 total; -Xms1024M -Xmx4096M -XX:MaxPermSize=256M -XX:+UseParallelGC -XX:ParallelGCThreads=6 -XX:+UseSplitVerifier -XX:+FailOverToOldVerifier -XX:-HeapDumpOnOutOfMemoryError -XX:+UseCompressedOops -XX:+ScavengeBeforeFullGC -XX:+PrintCommandLineFlags     AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1558 94 mods loaded, 93 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.05} [Minecraft Coder Pack] (minecraft.jar)      UCHIJA    FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1558-1.7.10-universal.jar)      UCHIJA    Forge{10.13.4.1558} [Minecraft Forge] (forge-1.7.10-10.13.4.1558-1.7.10-universal.jar)      UCHIJA    CodeChickenCore{1.0.7.46} [CodeChicken Core] (minecraft.jar)      UCHIJA    ivtoolkit{1.2.1} [IvToolkit] (minecraft.jar)      UCHIJA    OldModelLoader{1.0} [OldModelLoader] (minecraft.jar)      UCHIJA    MobiusCore{1.2.5} [MobiusCore] (minecraft.jar)      UCHIJA    NotEnoughItems{1.0.5.111} [Not Enough Items] (NotEnoughItemsuniversal.jar)      UCHIJA    voltzenginepreloader{0.0.1} [Voltz Engine Preloader] (minecraft.jar)      UCHIJA    FastCraft{1.25} [FastCraft] (fastcraft.jar)      UCHIJA    Baubles{1.0.1.10} [Baubles] (Baubles.jar)      UCHIJA    surpriseeggs{1.0.6} [Surprise Eggs] (AdventureBackpack.jar)      UCHIJA    adventurebackpack{1.7.10-0.8b} [Adventure Backpack] (AdventureBackpack.jar)      UCHIJA    AnimationAPI{1.2.4} [AnimationAPI] (AnimationAPI.jar)      UCHIJA    MovingWorld{1.7.10-1.8.1} [Moving World] (MovingWorld.jar)      UCHIJA    ArchimedesShipsPlus{1.7.10-1.8.1} [Archimedes' Ships Plus] (ArchimedesPlus.jar)      UCHIJA    asielib{0.2.7} [asielib] (asielib.jar)      UCHIJA    BiblioCraft{1.10.5} [BiblioCraft] (BiblioCraft.jar)      UCHIJA    CarpentersBlocks{3.3.6} [Carpenter's Blocks] (CarpentersBlocks.jar)      UCHIJA    ChestTransporter{2.0.6} [Chest Transporter] (ChestTransporter.jar)      UCHIJA    Railcraft{9.12.2.0} [Railcraft] (Railcraft.jar)      UCHIJA    chisel{2.3.10.37} [Chisel 2] (Chisel.jar)      UCHIJA    chunkpregenerator{2.1} [Chunk Pregenerator] (ChunkPregeneratorV.jar)      UCHIJA    lucky{5.1.0} [Lucky Block] (LuckyBlocks.jar)      UCHIJA    Waila{1.5.10} [Waila] (Waila.jar)      UCHIJA    ColorfulMobs{1.1.0} [Colorful Mobs] (ColorfulMobsMC.jar)      UCHIJA    controlling{1.0.0} [Controlling] (Controlling.jar)      UCHIJA    custommenu{2.0.0.3} [Custom Menu] (CustomMenu.jar)      UCHIJA    customnpcs{1.7.10d} [CustomNpcs] (CustomNpcs.jar)      UCHIJA    DamageIndicatorsMod{3.2.3} [Damage Indicators] (DamageIndicators.jar)      UCHIJA    darkcore{0.3} [Dark Core] (DarkCore.jar)      UCHIJA    PTRModelLib{1.0.0} [PTRModelLib] (Decocraft.jar)      UCHIJA    props{2.4.2} [Decocraft] (Decocraft.jar)      UCHIJA    FoodExpansion{1.0} [Food Expansion] (FoodExpansionmc.jar)      UCHIJA    FoodPlus{3.2rS} [ bFood Plus] (FoodPlus.jar)      UCHIJA    iChunUtil{4.2.2} [iChunUtil] (iChunUtil.jar)      UCHIJA    GraviGun{4.0.0-beta} [GraviGun] (GravityGun.jar)      UCHIJA    HardcoreEnderExpansion{1.8.6} [Hardcore Ender Expansion] (HardcoreEnderExpansionMCv.jar)      UCHIJA    Hats{4.0.1} [Hats] (Hats.jar)      UCHIJA    HatStand{4.0.0} [HatStand] (HatStand.jar)      UCHIJA    hbm{1.0.27 BETA (3815)} [Hbm's Nuclear Tech] (hbmBETA.jar)      UCHIJA    voltzengine{1.11.0.491} [Voltz Engine] (VoltzEngine.jar)      UCHIJA    icbmclassic{2.16.4.3} [ICBM-Classic] (ICBM.jar)      UCHIJA    InventoryPets{1.5.2} [Inventory Pets] (inventorypetsuniversal.jar)      UCHIJA    inventorytweaks{1.59-dev-152-cf6e263} [Inventory Tweaks] (InventoryTweaksdev.jar)      UCHIJA    IronChest{6.0.62.742} [Iron Chest] (ironchestuniversal.jar)      UCHIJA    journeymap{5.1.4p2} [JourneyMap] (journeymappunlimited.jar)      UCHIJA    pacman{1.0} [Pacman] (KillerPacman.jar)      UCHIJA    legends{6.15} [Legends Mod] (Legends.jar)      UCHIJA    levelup{0.10} [Level Up!] (LevelUp.jar)      UCHIJA    lmmx{1.0} [lmmx] (littleMaidMobXx.jar)      UCHIJA    MMMLibX{1.7.x-srg-1} [MMMLibX] (littleMaidMobXx.jar)      UCHIJA    zabuton{1.0} [zabuton] (littleMaidMobXx.jar)      UCHIJA    luckyegg{1.2.1} [LuckyEgg] (LuckyEgg.jar)      UCHIJA    malisiscore{1.7.10-0.14.3} [MalisisCore] (malisiscore.jar)      UCHIJA    malisisdoors{1.7.10-1.13.2} [Malisis' Doors] (malisisdoors.jar)      UCHIJA    mcheli{1.0.4} [MC Helicopter] (MCHeli.zip)      UCHIJA    battlegear2{1.7.10} [Mine & Blade Battlegear 2 - Bullseye] (MineBladeBattlegearBullseye.jar)      UCHIJA    MobProperties{0.4.0} [Mob Properties] (MobProperties.jar)      UCHIJA    nolpfij_mobstatues{0.1.1} [mobstatues] (MobStatues.jar)      UCHIJA    cfm{3.4.7} [ 9MrCrayfish's Furniture Mod] (MrCrayfishsFurnitureMod.jar)      UCHIJA    MutantCreatures{1.4.8} [Mutant Creatures] (MutantCreatures.jar)      UCHIJA    NEIAddons{1.12.10.33} [NEI Addons] (NEIAddons.jar)      UCHIJA    NEIAddons|AppEng{1.12.10.33} [NEI Addons: Applied Energistics 2] (NEIAddons.jar)      UCHIJA    NEIAddons|Botany{1.12.10.33} [NEI Addons: Botany] (NEIAddons.jar)      UCHIJA    NEIAddons|Forestry{1.12.10.33} [NEI Addons: Forestry] (NEIAddons.jar)      UCHIJA    NEIAddons|CraftingTables{1.12.10.33} [NEI Addons: Crafting Tables] (NEIAddons.jar)      UCHIJA    NEIAddons|ExNihilo{1.12.10.33} [NEI Addons: Ex Nihilo] (NEIAddons.jar)      UCHIJA    neiintegration{1.1.2} [NEI Integration] (NEIIntegrationMC.jar)      UCHIJA    recipehandler{1.7.10} [NoMoreRecipeConflict] (NoMoreRecipeConflict.jar)      UCHIJA    OreSpawn{1.7.10.20.3} [OreSpawn] (orespawn.zip)      UCHIJA    origin{3.3.0} [Origin] (Origin.jar)      UCHIJA    pandorasbox{2.0.1} [Pandora's Box] (PandorasBox.jar)      UCHIJA    PortalGun{4.0.0-beta-4} [PortalGun] (PortalGunbeta.jar)      UCHIJA    ProjectE{1.7.10-PE1.10.1} [ProjectE] (ProjectE.jar)      UCHIJA    recipescramble{1.7.5} [Recipe Scramble] (RecipeScramble.jar)      UCHIJA    reccomplex{0.9.7.1.1} [Recurrent Complex] (RecurrentComplex.jar)      UCHIJA    SaintsCore{0.8} [Saintscore] (Saintscore.jar)      UCHIJA    secretroomsmod{4.7.1} [The SecretRoomsMod] (secretroomsmod.jar)      UCHIJA    securitycraft{v1.8.13} [SecurityCraft] (SecurityCraftv.jar)      UCHIJA    SSTOW{1.7.10-0.1-RC9-7} [Soul Shards: The Old Ways] (SoulShardsTheOldWays.jar)      UCHIJA    statues{2.1.3} [Statues] (Statues.jar)      UCHIJA    StorageDrawers{1.7.10-1.10.9} [Storage Drawers] (StorageDrawers.jar)      UCHIJA    TardisMod{0.99} [Tardis Mod] (TardisMod.jar)      UCHIJA    TragicMC{2.46.2879} [TragicMC 2] (TragicMC.jar)      UCHIJA    TrailMix{4.0.0} [TrailMix] (TrailMix.jar)      UCHIJA    VeinMiner{0.36.0_1.7.10-28a7f13} [Vein Miner] (VeinMiner-1.7.10-0.36.0.496+28a7f13.jar)      UCHIJA    VeinMinerModSupport{0.36.0_1.7.10-28a7f13} [Mod Support] (VeinMiner-1.7.10-0.36.0.496+28a7f13.jar)      UCHIJA    voltzenginemodcompat{1.11.0.491} [Voltz Engine Mod Compatibility Loader] (VoltzEngine.jar)      UCHIJA    voltzenginemodflag{1.11.0.491} [VoltzEngine mod protection, flag, and region system] (VoltzEngine.jar)      UCHIJA    weepingangels{3.3.2} [Weeping Angels] (WeepingAngels.jar)      UCHIJA    thejungle{1.0.9} [Welcome to the Jungle] (WelcomeToTheJungle.jar)      UCHIJA    witchery{0.24.1} [Witchery] (Witchery.jar)      UD    asielibcore{} [AsieLib CoreMod] (minecraft.jar)      GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 522.25' Renderer: 'NVIDIA GeForce RTX 3050/PCIe/SSE2'     Launched Version: 1.7.10     LWJGL: 2.9.1     OpenGL: NVIDIA GeForce RTX 3050/PCIe/SSE2 GL version 4.6.0 NVIDIA 522.25, NVIDIA Corporation     GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported.     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)     Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used     Anisotropic Filtering: Off (1)
    • Yes, I downloaded the driver off of the official website and downloaded AMD Software: Adrenalin Edition in the process. It's showing me that my driver is up to date. I could try uninstalling and reinstalling it to see if there was anything I missed during the installation process, maybe? Edit: Update, I downloaded the AMD stuff again following the exact instructions in the FAQ, and I am still getting the same issue.
  • Topics

×
×
  • Create New...

Important Information

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