Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix field size calc and fix mourn location crash without townhall #3168

Merged
merged 1 commit into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public <B extends AbstractBuilding> B getBuilding(final BlockPos buildingId, @No
public void addNewField(final ScarecrowTileEntity tileEntity, final BlockPos pos, final World world)
{
addField(pos);
tileEntity.calculateSize(world, pos);
tileEntity.calculateSize(world, pos.down());
markFieldsDirty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.minecolonies.api.entity.ai.Status;
import com.minecolonies.api.util.BlockPosUtil;
import com.minecolonies.api.util.CompatibilityUtils;
import com.minecolonies.coremod.colony.Colony;
import com.minecolonies.coremod.colony.jobs.AbstractJobGuard;
import com.minecolonies.coremod.entity.EntityCitizen;

Expand Down Expand Up @@ -169,7 +170,13 @@ public void startExecuting()
protected Vec3d getMournLocation()
{
Vec3d vec3d = null;
final BlockPos pos = citizen.getCitizenColonyHandler().getColony().getBuildingManager().getTownHall().getLocation();
final Colony colony = citizen.getCitizenColonyHandler().getColony();
if (colony == null || !colony.getBuildingManager().hasTownHall())
{
return new Vec3d(citizen.getHomePosition());
}

final BlockPos pos = colony.getBuildingManager().getTownHall().getLocation();
if (pos != null)
{
vec3d = new Vec3d(pos);
Expand Down