IMC API for adding new altar components (#1039)
CC @Drullkus
(cherry picked from commit 8a8bff8
)
This commit is contained in:
parent
9010cebc40
commit
f135dab7ba
3 changed files with 40 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
package WayofTime.bloodmagic.util.handler;
|
||||
|
||||
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
||||
import WayofTime.bloodmagic.api.altar.EnumAltarComponent;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
@ -54,6 +55,17 @@ public class IMCHandler
|
|||
BloodMagicAPI.blacklistFromGreenGrove(block);
|
||||
}
|
||||
}
|
||||
|
||||
if (message.key.equals("altarComponent") && message.isStringMessage())
|
||||
{
|
||||
String[] splitInfo = message.getStringValue().split(":");
|
||||
if (splitInfo.length == 4)
|
||||
{
|
||||
Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(splitInfo[0], splitInfo[1]));
|
||||
if (block != null)
|
||||
BloodMagicAPI.addAltarComponent(block.getStateFromMeta(Integer.parseInt(splitInfo[2])), EnumAltarComponent.valueOf(splitInfo[3]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue