Search in sources :

Example 6 with PublicWorkerCraftingProductionResolver

use of com.minecolonies.coremod.colony.requestsystem.resolvers.PublicWorkerCraftingProductionResolver in project minecolonies by ldtteam.

the class PublicWorkerCraftingProductionResolverFactory method deserialize.

@NotNull
@Override
public PublicWorkerCraftingProductionResolver deserialize(@NotNull final IFactoryController controller, @NotNull final CompoundNBT nbt) {
    final IToken<?> token = controller.deserialize(nbt.getCompound(NBT_TOKEN));
    final ILocation location = controller.deserialize(nbt.getCompound(NBT_LOCATION));
    final JobEntry entry = IJobRegistry.getInstance().getValue(new ResourceLocation(nbt.getString(NBT_JOB)));
    return new PublicWorkerCraftingProductionResolver(location, token, entry);
}
Also used : JobEntry(com.minecolonies.api.colony.jobs.registry.JobEntry) ILocation(com.minecolonies.api.colony.requestsystem.location.ILocation) PublicWorkerCraftingProductionResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.PublicWorkerCraftingProductionResolver) ResourceLocation(net.minecraft.util.ResourceLocation) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PublicWorkerCraftingProductionResolver (com.minecolonies.coremod.colony.requestsystem.resolvers.PublicWorkerCraftingProductionResolver)6 JobEntry (com.minecolonies.api.colony.jobs.registry.JobEntry)4 ILocation (com.minecolonies.api.colony.requestsystem.location.ILocation)4 IRequestResolver (com.minecolonies.api.colony.requestsystem.resolver.IRequestResolver)2 PublicWorkerCraftingRequestResolver (com.minecolonies.coremod.colony.requestsystem.resolvers.PublicWorkerCraftingRequestResolver)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 NotNull (org.jetbrains.annotations.NotNull)2