use of ivorius.reccomplex.files.SimpleLeveledRegistry in project RecurrentComplex by Ivorforce.
the class RCGuiHandler method openComponentGui.
protected static void openComponentGui(EntityPlayer player, String key, Component component, SaveDirectoryData saveDirectoryData, int guiID) {
if (key == null)
key = "New Generator";
if (component == null)
component = Component.createDefaultComponent();
if (saveDirectoryData == null) {
SimpleLeveledRegistry<Component>.Status<Component> status = GenericItemCollectionRegistry.INSTANCE.status(key);
saveDirectoryData = SaveDirectoryData.defaultData(key, status != null && status.isActive(), RecurrentComplex.loader.tryFindIDs(ResourceDirectory.ACTIVE.toPath(), RCFileSuffix.INVENTORY_GENERATION_COMPONENT), RecurrentComplex.loader.tryFindIDs(ResourceDirectory.INACTIVE.toPath(), RCFileSuffix.INVENTORY_GENERATION_COMPONENT));
}
ByteBuf buf = Unpooled.buffer();
ByteBufUtils.writeUTF8String(buf, key);
ItemCollectionSaveHandler.INSTANCE.write(buf, component);
saveDirectoryData.writeTo(buf);
IvGuiRegistry.INSTANCE.openGui(player, RecurrentComplex.MOD_ID, guiID, buf);
}
use of ivorius.reccomplex.files.SimpleLeveledRegistry in project RecurrentComplex by Ivorforce.
the class PacketEditStructureHandler method openEditStructure.
public static void openEditStructure(GenericStructure structureInfo, String structureID, EntityPlayerMP player) {
if (structureID == null)
structureID = "NewStructure";
RCEntityInfo entityInfo = RCEntityInfo.get(player, null);
if (entityInfo != null)
entityInfo.setCachedExportStructureBlockDataNBT(structureInfo.worldDataCompound);
SimpleLeveledRegistry<Structure<?>>.Status<Structure<?>> status = StructureRegistry.INSTANCE.status(structureID);
RecurrentComplex.network.sendTo(new PacketEditStructure(structureInfo, structureID, SaveDirectoryData.defaultData(structureID, status != null && status.isActive(), RecurrentComplex.loader.tryFindIDs(ResourceDirectory.ACTIVE.toPath(), RCFileSuffix.STRUCTURE), RecurrentComplex.loader.tryFindIDs(ResourceDirectory.INACTIVE.toPath(), RCFileSuffix.STRUCTURE))), player);
}
Aggregations