View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002320||Industrial-Craft²||crossmod-compatibility / submodules / API||public||2018-02-10 06:43||2019-04-11 11:42|
|Target Version||Fixed in Version||Builds for MC 1.12.x|
|Summary||0002320: Missing interface in API to make own radioactive items.|
|Description||IC2 Version: industrialcraft-2-2.8.53-ex112|
Forge Version: 1.12.2-126.96.36.19911
Hello again! Me didn't find any Interface to make mark my items as radioactive items for IC2. For example if I want to have my own radioactive material which causes radiation debuff and IC2 hazmat should protect against it.
I found ic2.core.item.type.IRadioactiveItemType but it is not usable because when radiation applying there are check like "instanceof ItemMulti". It could be useful if you can move this interface to API and change check a bit to be able use it in addons.
|Tags||API, item, radioactive|
I can expose the test for whether an entity has a full hazmat suit, but the actual application of radiation is just a potion effect (which you can already access from ic2.api.info.Info) which is applied every time a radioactive item is ticked. From IC2's point of view there is no simple option for an item to implement an interface then suddenly apply it without severe hits having to watch every item a player has at all times. The internal one is really a utility to map metadata to the radiation effect needed rather than a flag for whether the item is radioactive to start with, hence the check for the type, it's literally for that one item. Would having the hazmat check given provide enough for you to do the rest for your own radioactive items?
So it means I should:
1. Implement my own update handler at my modification.
2. Put there check if player have full IC2 hazmat suit.
3. If he don't then apply the effect.
Yeah. I should say that solution may be enough just for current case.
Don't known... Maybe I should create another issue ticket for another thingy. But I'll write it here.
I noticed that I'll encounter another problem in future. If I want to implement my own armor which protects against radiaction (for example Reinforced/Armored Hazmat Suit) then:
1. There won't be universal interface for both IC2 radioactive items and my own. I should make separate check for my items & IC2 items. It is not so good too.
2. The radiation buff will be applied by IC2 update handler and from my side I can only remove the radiation buff in my armor item onArmorTick method. It means sometimes player can receive damage from effect anyway.
So maybe... It would be cool to have some interface for hazmat armor. Like IMetalArmor which I use in my mod to be able use my armor with IC2 magnetizer elevator.
||That sounds reasonable, it could allow something like an electric armour that only protected you whilst it had power.|
||Added an IHazmatLike interface to IC2 2.8.117 which allows marking armour as hazmat compatible. Also comes with a utility method for getting whether an entity is wearing a full hazmat suit.|
|2018-02-10 06:43||zcaliptium||New Issue|
|2018-02-10 06:43||zcaliptium||Tag Attached: API|
|2018-02-10 06:43||zcaliptium||Tag Attached: item|
|2018-02-10 06:43||zcaliptium||Tag Attached: radioactive|
|2018-02-14 01:18||Chocohead||Assigned To||=> Chocohead|
|2018-02-14 01:18||Chocohead||Status||new => feedback|
|2018-02-14 01:18||Chocohead||Note Added: 0005548|
|2018-02-14 01:19||Chocohead||Note Edited: 0005548||View Revisions|
|2018-02-15 11:04||zcaliptium||Note Added: 0005550|
|2018-02-15 11:04||zcaliptium||Status||feedback => assigned|
|2018-02-16 00:55||Chocohead||Note Added: 0005552|
|2019-04-11 11:42||Chocohead||Status||assigned => resolved|
|2019-04-11 11:42||Chocohead||Resolution||open => fixed|
|2019-04-11 11:42||Chocohead||Fixed in Version||=> Builds for MC 1.12.x|
|2019-04-11 11:42||Chocohead||Note Added: 0005981|