This change makes Peripherals++ only add a single Peripheral Provider that will return the correct peripheral for any TileEntity implementing IPlusPlusPeripheral. Not only is it a lot more clean, but it is also a lot more safe as you previously were casting the TileEntity to IPeripheral without checking if it is one of your TileEntities at all.
If you want to add a new TileEntity, simply ensure that it or one of its superclasses implements IPlusPlusPeripheral. There is no need to add new Peripheral Providers anymore.
I moved the log messages for registering Forestry/AE2 blocks to ModBlocks so they still appear.
You might need to clean up imports after merging this; I tried to change as little as possible with this Pull Request.
This will close asiekierka/Computronics#147 as that issue was caused by your Providers throwing a ClassCastException.
This change makes Peripherals++ only add a single Peripheral Provider that will return the correct peripheral for any TileEntity implementing
IPlusPlusPeripheral
. Not only is it a lot more clean, but it is also a lot more safe as you previously were casting the TileEntity toIPeripheral
without checking if it is one of your TileEntities at all.If you want to add a new TileEntity, simply ensure that it or one of its superclasses implements
IPlusPlusPeripheral
. There is no need to add new Peripheral Providers anymore.I moved the log messages for registering Forestry/AE2 blocks to ModBlocks so they still appear.
You might need to clean up imports after merging this; I tried to change as little as possible with this Pull Request.
This will close asiekierka/Computronics#147 as that issue was caused by your Providers throwing a
ClassCastException
.