Search in sources :

Example 1 with WarehouseRequestResolver

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

the class BuildingWareHouse method getResolvers.

@Override
public ImmutableCollection<IRequestResolver<?>> getResolvers() {
    final ImmutableCollection<IRequestResolver<?>> supers = super.getResolvers();
    final ImmutableList.Builder<IRequestResolver<?>> builder = ImmutableList.builder();
    builder.addAll(supers);
    builder.add(new WarehouseRequestResolver(getRequester().getRequesterLocation(), getColony().getRequestManager().getFactoryController().getNewInstance(TypeConstants.ITOKEN)));
    return builder.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) IRequestResolver(com.minecolonies.api.colony.requestsystem.resolver.IRequestResolver) WarehouseRequestResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.WarehouseRequestResolver)

Example 2 with WarehouseRequestResolver

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

the class WarehouseRequestResolverFactory method deserialize.

@NotNull
@Override
public WarehouseRequestResolver deserialize(@NotNull final IFactoryController controller, @NotNull final NBTTagCompound nbt) {
    final IToken token = controller.deserialize(nbt.getCompoundTag(NBT_TOKEN));
    final ILocation location = controller.deserialize(nbt.getCompoundTag(NBT_LOCATION));
    return new WarehouseRequestResolver(location, token);
}
Also used : ILocation(com.minecolonies.api.colony.requestsystem.location.ILocation) IToken(com.minecolonies.api.colony.requestsystem.token.IToken) WarehouseRequestResolver(com.minecolonies.coremod.colony.requestsystem.resolvers.WarehouseRequestResolver) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

WarehouseRequestResolver (com.minecolonies.coremod.colony.requestsystem.resolvers.WarehouseRequestResolver)2 ImmutableList (com.google.common.collect.ImmutableList)1 ILocation (com.minecolonies.api.colony.requestsystem.location.ILocation)1 IRequestResolver (com.minecolonies.api.colony.requestsystem.resolver.IRequestResolver)1 IToken (com.minecolonies.api.colony.requestsystem.token.IToken)1 NotNull (org.jetbrains.annotations.NotNull)1