Interface IRaiderManager
- All Known Implementing Classes:
RaidManager
public interface IRaiderManager
Interface implementing all methods required for all raider managers.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic enum -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether spies are enabledintcalculateRaiderAmount(int raidLevel) Calculates the barbarian amount for raidsnet.minecraft.core.BlockPosCalculates the spawn position for raidsbooleanChecks if the raider manager can have raider events.booleancanRaid()Whether the colony can be raided.intcalculates the colonies raid levelList<net.minecraft.core.BlockPos>Getter for the last spawn points.intGets the amount of citizens lost in a raid.intReturns the amount of nights since the last raiddoubleGets the difficulty modifier for raids, default difficulty is 1.0net.minecraft.core.BlockPosReturns a random building for raiders to go to, groups up 3 raiders to the same position.booleanisRaided()Whether the colony is currently raided.voidonLostCitizen(ICitizenData citizen) Called on loosing a citizen, to record deaths during raidsvoidCalled on nightfall.voidCalled when a raider mob diesvoidraiderEvent(@NotNull IRaiderManager.RaidSettings raidSettings) Trigger a specific type of raid on a colony.voidread(net.minecraft.nbt.CompoundTag compound) Reads the raid manager form nbtvoidsetCanHaveRaiderEvents(boolean canHave) Set that the manager can receive raider events.voidsetNightsSinceLastRaid(int nightsSinceLastRaid) Sets the amount of nights since the last raidvoidNotify raid manager of a passing through raid.voidsetRaidNextNight(IRaiderManager.RaidSettings raidSettings) Set if raiders will raid tonight.voidsetSpiesEnabled(boolean enabled) Sets whether spies are enabledbooleanChecks if raiders will raid tonight.voidwrite(net.minecraft.nbt.CompoundTag compound) Writes the raid manager to nbt
-
Method Details
-
canHaveRaiderEvents
boolean canHaveRaiderEvents()Checks if the raider manager can have raider events.- Returns:
- true if so.
-
willRaidTonight
boolean willRaidTonight()Checks if raiders will raid tonight.- Returns:
- true if so.
-
setCanHaveRaiderEvents
void setCanHaveRaiderEvents(boolean canHave) Set that the manager can receive raider events.- Parameters:
canHave- true or false.
-
setRaidNextNight
Set if raiders will raid tonight.- Parameters:
raidSettings- the settings for the next raid, or null to stop the next raid.
-
areSpiesEnabled
boolean areSpiesEnabled()Returns whether spies are enabled- Returns:
- true if enabled.
-
setSpiesEnabled
void setSpiesEnabled(boolean enabled) Sets whether spies are enabled- Parameters:
enabled- true if enabled.
-
raiderEvent
IRaiderManager.RaidSpawnResult raiderEvent(@NotNull @NotNull IRaiderManager.RaidSettings raidSettings) Trigger a specific type of raid on a colony.- Parameters:
raidSettings- the settings for this raid.
-
calculateSpawnLocation
net.minecraft.core.BlockPos calculateSpawnLocation()Calculates the spawn position for raids- Returns:
- the spawn location.
-
getLastSpawnPoints
List<net.minecraft.core.BlockPos> getLastSpawnPoints()Getter for the last spawn points.- Returns:
- a copy of the list
-
calculateRaiderAmount
int calculateRaiderAmount(int raidLevel) Calculates the barbarian amount for raids- Parameters:
raidLevel- the colonies raidlevel- Returns:
- the number of barbs.
-
isRaided
boolean isRaided()Whether the colony is currently raided.- Returns:
- true if so.
-
onNightFall
void onNightFall()Called on nightfall. -
getNightsSinceLastRaid
int getNightsSinceLastRaid()Returns the amount of nights since the last raid- Returns:
- the number of nights.
-
setNightsSinceLastRaid
void setNightsSinceLastRaid(int nightsSinceLastRaid) Sets the amount of nights since the last raid- Parameters:
nightsSinceLastRaid- the nights to set.
-
canRaid
boolean canRaid()Whether the colony can be raided.- Returns:
- true if possible.
-
getColonyRaidLevel
int getColonyRaidLevel()calculates the colonies raid level- Returns:
- the raid level.
-
getRandomBuilding
net.minecraft.core.BlockPos getRandomBuilding()Returns a random building for raiders to go to, groups up 3 raiders to the same position.- Returns:
- a random building.
-
getRaidDifficultyModifier
double getRaidDifficultyModifier()Gets the difficulty modifier for raids, default difficulty is 1.0- Returns:
- difficulty
-
onLostCitizen
Called on loosing a citizen, to record deaths during raids- Parameters:
citizen- that died
-
write
void write(net.minecraft.nbt.CompoundTag compound) Writes the raid manager to nbt- Parameters:
compound- to write to
-
read
void read(net.minecraft.nbt.CompoundTag compound) Reads the raid manager form nbt- Parameters:
compound- to read from
-
getLostCitizen
int getLostCitizen()Gets the amount of citizens lost in a raid.- Returns:
- amount
-
onRaiderDeath
Called when a raider mob dies- Parameters:
entity-
-
onRaidEventFinished
-
setPassThroughRaid
void setPassThroughRaid()Notify raid manager of a passing through raid.
-