Skip to content

Commit

Permalink
Post merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Thodor12 committed Nov 28, 2024
1 parent c3b8c18 commit c2f25b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ public interface ICitizenDiseaseHandler
* Set a disease on the citizen.
* @param disease to set.
*/
void setDisease(String disease);
void setDisease(Disease disease);
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import com.minecolonies.core.colony.jobs.JobKnight;
import com.minecolonies.core.colony.jobs.JobNetherWorker;
import com.minecolonies.core.colony.jobs.JobRanger;
import com.minecolonies.core.datalistener.DiseasesListener;
import com.minecolonies.core.entity.ai.minimal.*;
import com.minecolonies.core.entity.ai.workers.AbstractEntityAIBasic;
import com.minecolonies.core.entity.ai.workers.CitizenAI;
Expand Down Expand Up @@ -487,7 +488,7 @@ private InteractionResult directPlayerInteraction(final Player player, final Int

if (!level.isClientSide())
{
getCitizenData().getCitizenDiseaseHandler().setDisease(IColonyManager.getInstance().getCompatibilityManager().getRandomDisease());
getCitizenData().getCitizenDiseaseHandler().setDisease(DiseasesListener.getRandomDisease(getRandom()));
playSound(SoundEvents.VILLAGER_HURT, 1.0f, (float) SoundUtils.getRandomPitch(getRandom()));
getCitizenData().markDirty(20);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.minecolonies.api.colony.ICitizenData;
import com.minecolonies.api.colony.IColony;
import com.minecolonies.api.colony.buildings.IBuilding;
import com.minecolonies.api.entity.citizen.AbstractEntityCitizen;
import com.minecolonies.api.entity.citizen.citizenhandlers.ICitizenDiseaseHandler;
import com.minecolonies.core.MineColonies;
import com.minecolonies.core.colony.buildings.workerbuildings.BuildingCook;
Expand All @@ -14,7 +15,7 @@
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.NotNull;
import net.minecraft.util.RandomSource;
import org.jetbrains.annotations.Nullable;

import static com.minecolonies.api.research.util.ResearchConstants.MASKS;
Expand Down Expand Up @@ -102,7 +103,7 @@ public void update(final int tickRate)

if (citizenData.getRandom().nextInt(configModifier * DISEASE_FACTOR) < citizenModifier * 10)
{
this.disease = DiseasesListener.getRandomDisease(citizen.getRandom());
this.disease = DiseasesListener.getRandomDisease(citizenData.getEntity().map(AbstractEntityCitizen::getRandom).orElse(RandomSource.create()));
}
}

Expand Down

0 comments on commit c2f25b8

Please sign in to comment.