Search in sources :

Example 31 with JobEntry

use of com.minecolonies.api.colony.jobs.registry.JobEntry in project minecolonies by ldtteam.

the class PrivateWorkerCraftingProductionResolverFactory method deserialize.

@NotNull
@Override
public PrivateWorkerCraftingProductionResolver 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 PrivateWorkerCraftingProductionResolver(location, token, entry);
}
Also used : JobEntry(com.minecolonies.api.colony.jobs.registry.JobEntry) PrivateWorkerCraftingProductionResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingProductionResolver) ILocation(com.minecolonies.api.colony.requestsystem.location.ILocation) ResourceLocation(net.minecraft.util.ResourceLocation) NotNull(org.jetbrains.annotations.NotNull)

Example 32 with JobEntry

use of com.minecolonies.api.colony.jobs.registry.JobEntry in project minecolonies by ldtteam.

the class PrivateWorkerCraftingRequestResolverFactory method deserialize.

@Override
public PrivateWorkerCraftingRequestResolver deserialize(IFactoryController controller, PacketBuffer buffer) throws Throwable {
    final IToken<?> token = controller.deserialize(buffer);
    final ILocation location = controller.deserialize(buffer);
    final JobEntry entry = buffer.readRegistryId();
    return new PrivateWorkerCraftingRequestResolver(location, token, entry);
}
Also used : JobEntry(com.minecolonies.api.colony.jobs.registry.JobEntry) ILocation(com.minecolonies.api.colony.requestsystem.location.ILocation) PrivateWorkerCraftingRequestResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingRequestResolver)

Example 33 with JobEntry

use of com.minecolonies.api.colony.jobs.registry.JobEntry in project minecolonies by ldtteam.

the class PublicWorkerCraftingProductionResolverFactory method deserialize.

@Override
public PublicWorkerCraftingProductionResolver deserialize(IFactoryController controller, PacketBuffer buffer) throws Throwable {
    final IToken<?> token = controller.deserialize(buffer);
    final ILocation location = controller.deserialize(buffer);
    final JobEntry entry = buffer.readRegistryId();
    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)

Example 34 with JobEntry

use of com.minecolonies.api.colony.jobs.registry.JobEntry 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)

Example 35 with JobEntry

use of com.minecolonies.api.colony.jobs.registry.JobEntry in project minecolonies by ldtteam.

the class PublicWorkerCraftingRequestResolverFactory method deserialize.

@Override
public PublicWorkerCraftingRequestResolver deserialize(IFactoryController controller, PacketBuffer buffer) throws Throwable {
    final IToken<?> token = controller.deserialize(buffer);
    final ILocation location = controller.deserialize(buffer);
    final JobEntry entry = buffer.readRegistryId();
    return new PublicWorkerCraftingRequestResolver(location, token, entry);
}
Also used : JobEntry(com.minecolonies.api.colony.jobs.registry.JobEntry) ILocation(com.minecolonies.api.colony.requestsystem.location.ILocation) PublicWorkerCraftingRequestResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.PublicWorkerCraftingRequestResolver)

Aggregations

JobEntry (com.minecolonies.api.colony.jobs.registry.JobEntry)37 ResourceLocation (net.minecraft.util.ResourceLocation)18 ILocation (com.minecolonies.api.colony.requestsystem.location.ILocation)16 NotNull (org.jetbrains.annotations.NotNull)13 Nullable (org.jetbrains.annotations.Nullable)7 PublicWorkerCraftingRequestResolver (com.minecolonies.coremod.colony.requestsystem.resolvers.PublicWorkerCraftingRequestResolver)6 ICitizenData (com.minecolonies.api.colony.ICitizenData)5 IColony (com.minecolonies.api.colony.IColony)5 PublicWorkerCraftingProductionResolver (com.minecolonies.coremod.colony.requestsystem.resolvers.PublicWorkerCraftingProductionResolver)5 AbstractEntityCitizen (com.minecolonies.api.entity.citizen.AbstractEntityCitizen)4 IToken (com.minecolonies.api.colony.requestsystem.token.IToken)3 RaiderType (com.minecolonies.api.entity.mobs.RaiderType)3 PrivateWorkerCraftingRequestResolver (com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingRequestResolver)3 PacketBuffer (net.minecraft.network.PacketBuffer)3 IColonyManager (com.minecolonies.api.colony.IColonyManager)2 IBuilding (com.minecolonies.api.colony.buildings.IBuilding)2 com.minecolonies.api.colony.buildings.modules (com.minecolonies.api.colony.buildings.modules)2 ISettingKey (com.minecolonies.api.colony.buildings.modules.settings.ISettingKey)2 BuildingEntry (com.minecolonies.api.colony.buildings.registry.BuildingEntry)2 IWareHouse (com.minecolonies.api.colony.buildings.workerbuildings.IWareHouse)2