Skip to content

Commit

Permalink
Broaden out the new location display (ldtteam#5877)
Browse files Browse the repository at this point in the history
Change from AbstractBuildingCrafter.View to IBuildingWorkerView, to ensure more buildings display
  • Loading branch information
Mekle001 authored Oct 5, 2020
1 parent fa16a54 commit f7a46d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.minecolonies.api.colony.ICitizenDataView;
import com.minecolonies.api.colony.IColonyManager;
import com.minecolonies.api.colony.IColonyView;
import com.minecolonies.api.colony.buildings.IBuildingWorkerView;
import com.minecolonies.api.colony.buildings.views.IBuildingView;
import com.minecolonies.api.colony.requestsystem.request.RequestState;
import com.minecolonies.api.colony.requestsystem.requestable.*;
Expand Down Expand Up @@ -368,9 +369,9 @@ public List<String> getResolverToolTip(final IColonyView colony)
final IBuildingView view = colony.getBuilding(resolver);

int posInList = -1;
if (view instanceof AbstractBuildingCrafter.View)
if (view instanceof IBuildingWorkerView)
{
for (int worker : ((AbstractBuildingCrafter.View) view).getWorkerId())
for (int worker : ((IBuildingWorkerView) view).getWorkerId())
{
final ICitizenDataView citizen = colony.getCitizen(worker);
if (citizen != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.collect.Lists;
import com.minecolonies.api.colony.ICitizenData;
import com.minecolonies.api.colony.IColony;
import com.minecolonies.api.colony.buildings.IBuildingWorkerView;
import com.minecolonies.api.colony.requestsystem.location.ILocation;
import com.minecolonies.api.colony.requestsystem.manager.IRequestManager;
import com.minecolonies.api.colony.requestsystem.request.IRequest;
Expand Down Expand Up @@ -131,9 +132,9 @@ public void onRequestedRequestCancelled(@NotNull final IRequestManager manager,
public ITextComponent getRequesterDisplayName(@NotNull final IRequestManager manager, @NotNull final IRequest<?> request)
{
final IRequester requester = manager.getColony().getRequesterBuildingForPosition(getLocation().getInDimensionLocation());
if (requester instanceof AbstractBuildingCrafter.View)
if (requester instanceof IBuildingWorkerView)
{
return new StringTextComponent(((AbstractBuildingCrafter.View) requester).getJobName());
return new StringTextComponent(((IBuildingWorkerView) requester).getJobName());
}
return super.getRequesterDisplayName(manager, request);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.minecolonies.coremod.colony.requestsystem.resolvers;

import com.minecolonies.api.colony.buildings.IBuildingWorkerView;
import com.minecolonies.api.colony.requestsystem.location.ILocation;
import com.minecolonies.api.colony.requestsystem.manager.IRequestManager;
import com.minecolonies.api.colony.requestsystem.request.IRequest;
Expand All @@ -8,7 +9,6 @@
import com.minecolonies.api.colony.requestsystem.requestable.crafting.PublicCrafting;
import com.minecolonies.api.colony.requestsystem.requester.IRequester;
import com.minecolonies.api.colony.requestsystem.token.IToken;
import com.minecolonies.coremod.colony.buildings.AbstractBuildingCrafter;
import com.minecolonies.coremod.colony.buildings.AbstractBuildingWorker;
import com.minecolonies.coremod.colony.requestsystem.resolvers.core.AbstractCraftingRequestResolver;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -76,9 +76,9 @@ public void onRequestedRequestCancelled(@NotNull final IRequestManager manager,
public ITextComponent getRequesterDisplayName(@NotNull final IRequestManager manager, @NotNull final IRequest<?> request)
{
final IRequester requester = manager.getColony().getRequesterBuildingForPosition(getLocation().getInDimensionLocation());
if (requester instanceof AbstractBuildingCrafter.View)
if (requester instanceof IBuildingWorkerView)
{
return new StringTextComponent(((AbstractBuildingCrafter.View) requester).getJobName());
return new StringTextComponent(((IBuildingWorkerView) requester).getJobName());
}
return super.getRequesterDisplayName(manager, request);
}
Expand Down

0 comments on commit f7a46d9

Please sign in to comment.