08-18-2014, 05:22 PM
I investigated the right click problem of last post more thoroughly, and I think it will be advantageous to use Block's OnBlockActivated, rather than manually modifying blocks. To my demise, I noticed that that method required a player entity to be passed on, for things such as opening an inventory window, starting a sound at the player's location, buffs, ... I haven't created a player yet, and it's definitely not trivial to do so. But luckily, most interesting blocks can be right clicked whilst nulling the player:
So if I update to use the method, right clicking these will work (but some probably won't do anything useful). However, for the rest I'll have to create a dummy player that will ignore things like opening a gui and such, not even sure if that's possible (I've done it with interfaces, not with classes yet). There may be a way to generalize editing the inventory blocks. Either way, it's back to puzzling for that part.
- Button
- Noteblock
- PistonMoving
- RedstoneComparator
- RedstoneRepeater
- RedstoneOre
- DragonEgg
- Lever
- PistonBase
- Stairs
So if I update to use the method, right clicking these will work (but some probably won't do anything useful). However, for the rest I'll have to create a dummy player that will ignore things like opening a gui and such, not even sure if that's possible (I've done it with interfaces, not with classes yet). There may be a way to generalize editing the inventory blocks. Either way, it's back to puzzling for that part.