Posted August 6, 20178 yr I was messing around with dispenser behaviour and found that if the dispenser is replaced/destroyed/otherwise removed while dispensing, the game crashes with this in the log: Spoiler PM Description: Exception while ticking a block java.lang.IllegalArgumentException: Cannot get property PropertyDirection{name=facing, clazz=class net.minecraft.util.EnumFacing, values=[down, up, north, south, west, east]} as it does not exist in BlockStateContainer{block=minecraft:air, properties=[]} at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:204) at net.minecraft.dispenser.BehaviorDefaultDispenseItem.dispense(BehaviorDefaultDispenseItem.java:18) at net.minecraft.block.BlockDispenser.dispense(BlockDispenser.java:153) at net.minecraft.block.BlockDispenser.updateTick(BlockDispenser.java:189) at net.minecraft.world.WorldServer.tickUpdates(WorldServer.java:774) at net.minecraft.world.WorldServer.tick(WorldServer.java:231) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:825) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:740) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:589) at java.lang.Thread.run(Thread.java:748) What happened to cause this is pretty simple - I made the dispensed stack cause an explosion, however, I get the same result if I set the dispenser to a different block (air, for example). I have tried removing the tile entity before setting the block to air and/or causing the explosion, but the result is the same. Is there any way I can prevent this crash, other than delaying the explosion? Edited August 6, 20178 yr by PegBeard
August 6, 20178 yr Author I have a dispenser behaviour class, which is registered in the postInit: Spoiler public class DTDispensePowderKeg extends BehaviorDefaultDispenseItem { @Override protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) { World world = source.getWorld(); BlockPos pos = source.getBlockPos(); world.playSound((EntityPlayer)null, pos.getX(), pos.getY(), pos.getZ(), SoundEvents.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0F, 1.0F); stack.shrink(1); world.removeTileEntity(pos); world.isAirBlock(pos); world.newExplosion((EntityPlayer)null, pos.getX()+0.5D, pos.getY()+0.5D, pos.getZ()+0.5D, 4.0F, true, true); return stack; } } Is this correct? I looked it up back in 1.8, and assumed this was still relevant, as my other dispenser behaviours still work.
August 6, 20178 yr Author Oh. Is that something that changed since 1.8, or was the tutorial I followed back then wrong? edit: the removeTileEntity was just testing for this issue, didn't intend to keep it. Edited August 6, 20178 yr by PegBeard
August 6, 20178 yr 11 minutes ago, PegBeard said: Oh. Is that something that changed since 1.8, or was the tutorial I followed back then wrong? Probably the latter. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.