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 compile and diseases #10551

Merged
merged 1 commit into from
Dec 23, 2024
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
@@ -1,10 +1,10 @@
package com.minecolonies.core.entity.citizen;

import com.minecolonies.api.IMinecoloniesAPI;
import com.minecolonies.api.blocks.AbstractBlockHut;
import com.minecolonies.api.colony.*;
import com.minecolonies.api.colony.buildings.IGuardBuilding;
import com.minecolonies.api.colony.buildings.registry.BuildingEntry;
import com.minecolonies.api.colony.citizens.event.CitizenRemovedEvent;
import com.minecolonies.api.colony.jobs.IJob;
import com.minecolonies.api.colony.permissions.Action;
import com.minecolonies.api.colony.permissions.IPermissions;
Expand All @@ -26,6 +26,8 @@
import com.minecolonies.api.entity.citizen.citizenhandlers.*;
import com.minecolonies.api.entity.citizen.happiness.ExpirationBasedHappinessModifier;
import com.minecolonies.api.entity.citizen.happiness.StaticHappinessSupplier;
import com.minecolonies.api.eventbus.events.colony.citizens.CitizenDiedModEvent;
import com.minecolonies.api.eventbus.events.colony.citizens.CitizenRemovedModEvent;
import com.minecolonies.api.inventory.InventoryCitizen;
import com.minecolonies.api.inventory.container.ContainerCitizenInventory;
import com.minecolonies.api.items.ModItems;
Expand Down Expand Up @@ -1587,14 +1589,7 @@ public void die(@NotNull final DamageSource damageSource)
Component.literal(damageSource.getLocalizedDeathMessage(this).getString()).getString().replaceFirst(this.getDisplayName().getString(), "Citizen");
citizenColonyHandler.getColonyOrRegister().getEventDescriptionManager().addEventDescription(new CitizenDiedEvent(blockPosition(), citizenData.getName(), deathCause));

try
{
NeoForge.EVENT_BUS.post(new CitizenRemovedEvent(citizenData, damageSource));
}
catch (final Exception e)
{
Log.getLogger().error("Error during CitizenRemovedEvent", e);
}
IMinecoloniesAPI.getInstance().getEventBus().post(new CitizenDiedModEvent(citizenData, damageSource));
}
super.die(damageSource);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
import com.ldtteam.common.network.PlayMessageType;
import com.minecolonies.api.colony.IColony;
import com.minecolonies.api.colony.IColonyManager;
import com.minecolonies.api.colony.event.ColonyDeletedEvent;
import com.minecolonies.api.util.Log;
import com.minecolonies.api.util.MessageUtils;
import com.minecolonies.api.util.constant.Constants;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.network.handling.IPayloadContext;

import static com.minecolonies.api.util.constant.TranslationConstants.MESSAGE_INFO_COLONY_DESTROY_SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package com.minecolonies.core.network.messages.server.colony;

import com.ldtteam.common.network.PlayMessageType;
import com.minecolonies.api.IMinecoloniesAPI;
import com.minecolonies.api.colony.IColony;
import com.minecolonies.api.colony.buildings.views.IBuildingView;
import com.minecolonies.api.colony.event.ColonyInformationChangedEvent;
import com.minecolonies.api.util.Log;
import com.minecolonies.api.eventbus.events.colony.ColonyTeamColorChangedModEvent;
import com.minecolonies.api.util.constant.Constants;
import com.minecolonies.core.network.messages.server.AbstractColonyServerMessage;
import net.minecraft.ChatFormatting;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.network.handling.IPayloadContext;
import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -66,13 +65,6 @@ protected void toBytes(@NotNull final RegistryFriendlyByteBuf buf)
protected void onExecute(final IPayloadContext ctxIn, final ServerPlayer player, final IColony colony)
{
colony.setColonyColor(ChatFormatting.values()[colorOrdinal]);
try
{
NeoForge.EVENT_BUS.post(new ColonyInformationChangedEvent(colony, ColonyInformationChangedEvent.Type.TEAM_COLOR));
}
catch (final Exception e)
{
Log.getLogger().error("Error during ColonyInformationChangedEvent", e);
}
IMinecoloniesAPI.getInstance().getEventBus().post(new ColonyTeamColorChangedModEvent(colony));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"rarity": 100,
"items": [
{
"item": "minecraft:carrot",
"id": "minecraft:carrot",
"count": 1
},
{
"item": "minecraft:potato",
"id": "minecraft:potato",
"count": 1
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"rarity": 10,
"items": [
{
"item": "minecraft:poppy",
"id": "minecraft:poppy",
"count": 1
},
{
"item": "minecraft:dandelion",
"id": "minecraft:dandelion",
"count": 1
},
{
"item": "minecraft:kelp",
"id": "minecraft:kelp",
"count": 1
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"rarity": 1,
"items": [
{
"item": "minecraft:honey_bottle",
"id": "minecraft:honey_bottle",
"count": 1
},
{
"item": "minecraft:golden_apple",
"id": "minecraft:golden_apple",
"count": 1
}
]
}
}
Loading