Search in sources :

Example 1 with PrivateWorkerCraftingProductionResolver

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

the class PrivateWorkerCraftingProductionResolverFactory method deserialize.

@Override
public PrivateWorkerCraftingProductionResolver 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 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)

Example 2 with PrivateWorkerCraftingProductionResolver

use of com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingProductionResolver in project minecolonies by Minecolonies.

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 3 with PrivateWorkerCraftingProductionResolver

use of com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingProductionResolver in project minecolonies by Minecolonies.

the class WorkerBuildingModule method createResolvers.

@Override
public List<IRequestResolver<?>> createResolvers() {
    final ImmutableList.Builder<IRequestResolver<?>> builder = ImmutableList.builder();
    builder.add(new BuildingRequestResolver(building.getRequester().getLocation(), building.getColony().getRequestManager().getFactoryController().getNewInstance(TypeConstants.ITOKEN)), new PrivateWorkerCraftingRequestResolver(building.getRequester().getLocation(), building.getColony().getRequestManager().getFactoryController().getNewInstance(TypeConstants.ITOKEN), jobEntry), new PrivateWorkerCraftingProductionResolver(building.getRequester().getLocation(), building.getColony().getRequestManager().getFactoryController().getNewInstance(TypeConstants.ITOKEN), jobEntry));
    return builder.build();
}
Also used : PrivateWorkerCraftingProductionResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingProductionResolver) ImmutableList(com.google.common.collect.ImmutableList) PrivateWorkerCraftingRequestResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingRequestResolver) IRequestResolver(com.minecolonies.api.colony.requestsystem.resolver.IRequestResolver) BuildingRequestResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.BuildingRequestResolver)

Example 4 with PrivateWorkerCraftingProductionResolver

use of com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingProductionResolver in project minecolonies by Minecolonies.

the class PrivateWorkerCraftingProductionResolverFactory method deserialize.

@Override
public PrivateWorkerCraftingProductionResolver 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 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)

Example 5 with PrivateWorkerCraftingProductionResolver

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

the class WorkerBuildingModule method createResolvers.

@Override
public List<IRequestResolver<?>> createResolvers() {
    final ImmutableList.Builder<IRequestResolver<?>> builder = ImmutableList.builder();
    builder.add(new BuildingRequestResolver(building.getRequester().getLocation(), building.getColony().getRequestManager().getFactoryController().getNewInstance(TypeConstants.ITOKEN)), new PrivateWorkerCraftingRequestResolver(building.getRequester().getLocation(), building.getColony().getRequestManager().getFactoryController().getNewInstance(TypeConstants.ITOKEN), jobEntry), new PrivateWorkerCraftingProductionResolver(building.getRequester().getLocation(), building.getColony().getRequestManager().getFactoryController().getNewInstance(TypeConstants.ITOKEN), jobEntry));
    return builder.build();
}
Also used : PrivateWorkerCraftingProductionResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingProductionResolver) ImmutableList(com.google.common.collect.ImmutableList) PrivateWorkerCraftingRequestResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingRequestResolver) IRequestResolver(com.minecolonies.api.colony.requestsystem.resolver.IRequestResolver) BuildingRequestResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.BuildingRequestResolver)

Aggregations

PrivateWorkerCraftingProductionResolver (com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingProductionResolver)6 JobEntry (com.minecolonies.api.colony.jobs.registry.JobEntry)4 ILocation (com.minecolonies.api.colony.requestsystem.location.ILocation)4 ImmutableList (com.google.common.collect.ImmutableList)2 IRequestResolver (com.minecolonies.api.colony.requestsystem.resolver.IRequestResolver)2 BuildingRequestResolver (com.minecolonies.coremod.colony.requestsystem.resolvers.BuildingRequestResolver)2 PrivateWorkerCraftingRequestResolver (com.minecolonies.coremod.colony.requestsystem.resolvers.PrivateWorkerCraftingRequestResolver)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 NotNull (org.jetbrains.annotations.NotNull)2