Skip to content

Commit

Permalink
hotfix data loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Raycoms committed Dec 9, 2024
1 parent 5794d07 commit c47dc3c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,20 @@ public void handle(
{
Log.getLogger().error("Error during EntityPlaceEvent", e);
}
InventoryUtils.reduceStackInItemHandler(new InvWrapper(player.getInventory()), inventoryStack, 1);

if (tempColony == null)
{
// Townhall Placement
SoundUtils.playSuccessSound(player, player.blockPosition());
InventoryUtils.reduceStackInItemHandler(new InvWrapper(player.getInventory()), inventoryStack, 1);
return;
}

AdvancementUtils.TriggerAdvancementPlayersForColony(tempColony, playerMP -> AdvancementTriggers.PLACE_STRUCTURE.get().trigger(playerMP, ((AbstractBlockHut<?>) anchor.getBlock()).getBlueprintName()));


int level = 0;
boolean finishedUpgrade = false;
final HutBlockData hutComponent = HutBlockData.readFromItemStack(stack);
final HutBlockData hutComponent = HutBlockData.readFromItemStack(inventoryStack);
if (hutComponent != null)
{
if (hutComponent.level() != -1)
Expand All @@ -212,6 +211,8 @@ public void handle(
}
}

InventoryUtils.reduceStackInItemHandler(new InvWrapper(player.getInventory()), inventoryStack, 1);

@Nullable final IBuilding building = IColonyManager.getInstance().getBuilding(world, blockPos);
if (building == null)
{
Expand Down

0 comments on commit c47dc3c

Please sign in to comment.