Skip to content

Commit

Permalink
fix 9774 (#9775)
Browse files Browse the repository at this point in the history
Better handle removed quests
Fix trapdoor handling with ladders
Fix some panel/carpet movement.
  • Loading branch information
Raycoms committed Mar 24, 2024
1 parent 999f9c1 commit 5b40b40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1328,13 +1328,7 @@ private int handleTargetNotPassable(@Nullable final MNode parent, @NotNull final

private boolean checkHeadBlock(@Nullable final MNode parent, @NotNull final BlockPos pos)
{
BlockPos localPos = pos;
final VoxelShape bb = cachedBlockLookup.getBlockState(localPos).getCollisionShape(world, localPos);
if (bb.max(Direction.Axis.Y) < 1)
{
localPos = pos.above();
}

final VoxelShape bb = cachedBlockLookup.getBlockState(pos).getCollisionShape(world, pos);
if (!canLeaveBlock(pos.above(), parent, true))
{
return true;
Expand All @@ -1360,10 +1354,9 @@ private boolean checkHeadBlock(@Nullable final MNode parent, @NotNull final Bloc

if (parent != null)
{
final BlockState hereState = cachedBlockLookup.getBlockState(localPos.below());
final VoxelShape bb1 = cachedBlockLookup.getBlockState(pos).getCollisionShape(world, pos);
final VoxelShape bb2 = cachedBlockLookup.getBlockState(localPos.above()).getCollisionShape(world, localPos.above());
if ((localPos.above().getY() + getStartY(bb2, 1)) - (pos.getY() + getEndY(bb1, 0)) >= 2)
final BlockState hereState = cachedBlockLookup.getBlockState(pos.below());
final VoxelShape bb2 = cachedBlockLookup.getBlockState(pos.above()).getCollisionShape(world, pos.above());
if ((pos.above().getY() + getStartY(bb2, 1)) - (pos.getY() + getEndY(bb, 0)) >= 2)
{
return false;
}
Expand Down Expand Up @@ -1538,6 +1531,10 @@ private boolean canLeaveBlock(final BlockPos pos, final MNode parent, final bool
{
if (dir.getY() != 0)
{
if (parentBlock.getBlock() instanceof TrapDoorBlock)
{
return true;
}
return (head && parentBlock.getValue(PanelBlock.HALF) == Half.TOP && dir.getY() < 0) || (!head && parentBlock.getValue(PanelBlock.HALF) == Half.BOTTOM
&& dir.getY() > 0);
}
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/minecolonies/core/quests/QuestManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ public List<FinishedQuest> getFinishedQuests()
for (Map.Entry<ResourceLocation, Integer> entry : finishedQuests.entrySet())
{
IQuestTemplate template = GLOBAL_SERVER_QUESTS.get(entry.getKey());
data.add(new FinishedQuest(template, entry.getValue()));
if (template != null)
{
data.add(new FinishedQuest(template, entry.getValue()));
}
}
finishedQuestsCache = Collections.unmodifiableList(data);
}
Expand Down

0 comments on commit 5b40b40

Please # to comment.