View Issue Details

IDProjectCategoryView StatusLast Update
0002320Industrial-Craft²crossmod-compatibility / submodules / APIpublic2019-04-11 11:42
Reporterzcaliptium Assigned ToChocohead  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Fixed in VersionBuilds for MC 1.12.x 
Summary0002320: Missing interface in API to make own radioactive items.
DescriptionIC2 Version: industrialcraft-2-2.8.53-ex112
Forge Version: 1.12.2-14.23.2.2611

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.
TagsAPI, item, radioactive
Minecraft Version 1.12.2

Activities

Chocohead

2018-02-14 01:18

developer   ~0005548

Last edited: 2018-02-14 01:19

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?

zcaliptium

2018-02-15 11:04

reporter   ~0005550

Hmmmm...

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.

Chocohead

2018-02-16 00:55

developer   ~0005552

That sounds reasonable, it could allow something like an electric armour that only protected you whilst it had power.

Chocohead

2019-04-11 11:42

developer   ~0005981

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.

Issue History

Date Modified Username Field Change
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
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