Class HordeRaidEvent
java.lang.Object
com.minecolonies.core.colony.events.raid.HordeRaidEvent
- All Implemented Interfaces:
IColonyCampFireRaidEvent,IColonyEntitySpawnEvent,IColonyEvent,IColonyRaidEvent,IColonySpawnEvent,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
- Direct Known Subclasses:
AmazonRaidEvent,BarbarianRaidEvent,EgyptianRaidEvent,NorsemenRaidEvent,PirateGroundRaidEvent
public abstract class HordeRaidEvent
extends Object
implements IColonyRaidEvent, IColonyCampFireRaidEvent
Horde raid event for the colony, triggers a horde that spawn and attack the colony.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HordeThe amount of entities overallstatic intThe max distance to search for a loaded blockpos on a respawn trystatic intThe max distance a barbarian is allowed to spawn from the original spawn positionstatic intThe minimum distance to the colony center where mobs are allowed to spawnThe references to living raiders leftprotected final net.minecraft.server.level.ServerBossEventThe raids visual raidbarprotected EventStatusStatus of the event -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSpawner(net.minecraft.core.BlockPos pos) Add a spawner to an event.voiddeserializeNBT(net.minecraft.nbt.CompoundTag compound) Get the assigned colony.protected abstract net.minecraft.network.chat.MutableComponentGets the raids display nameList<net.minecraft.world.entity.Entity>The list of entities related to this eventintgetID()Returns this events ID.net.minecraft.core.BlockPosReturns a random campfirenet.minecraft.core.BlockPosThe position the event starts atReturns the events current statusList<net.minecraft.core.BlockPos>Gets the list of waypointsvoidonEntityDeath(net.minecraft.world.entity.LivingEntity entity) Trigger on entity death.voidonFinish()Actions which are done on the finish/removal of the event.voidCalled on night fall, to execute special day-based logic.voidonStart()Actions which are done on the start of the event.voidonUpdate()Onupdate function, called every 25s / 500 ticks.protected voidSends the right horde message.net.minecraft.nbt.CompoundTagvoidsetCampFireTime(int time) Sets the intervals to wait before moving away from campfires.voidSets the colonyvoidvoidsetSpawnPath(PathResult result) Set the pathing for this raids spawnpointvoidsetSpawnPoint(net.minecraft.core.BlockPos spawnPoint) Sets the spawn pointvoidsetStatus(EventStatus status) Sets the current event statusprotected voidspawnHorde(net.minecraft.core.BlockPos spawnPos, IColony colony, int id, int numberOfBosses, int numberOfArchers, int numberOfRaiders) Spawn a specific horde.voidunregisterEntity(net.minecraft.world.entity.Entity entity) Called when an entity is removedprotected voidUpdates the raid barMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.colonyEvents.IColonyEntitySpawnEvent
registerEntityMethods inherited from interface com.minecolonies.api.colony.colonyEvents.IColonyEvent
getEventTypeID, onTileEntityBreakMethods inherited from interface com.minecolonies.api.colony.colonyEvents.IColonyRaidEvent
getArcherRaiderType, getBossRaiderType, getNormalRaiderType, isRaidActive
-
Field Details
-
MAX_SPAWN_DEVIATION
public static int MAX_SPAWN_DEVIATIONThe max distance a barbarian is allowed to spawn from the original spawn position -
MAX_RESPAWN_DEVIATION
public static int MAX_RESPAWN_DEVIATIONThe max distance to search for a loaded blockpos on a respawn try -
MIN_CENTER_DISTANCE
public static int MIN_CENTER_DISTANCEThe minimum distance to the colony center where mobs are allowed to spawn -
horde
The amount of entities overall -
raidBar
protected final net.minecraft.server.level.ServerBossEvent raidBarThe raids visual raidbar -
normal
The references to living raiders left -
archers
-
boss
-
status
Status of the event
-
-
Constructor Details
-
HordeRaidEvent
-
-
Method Details
-
setSpawnPoint
public void setSpawnPoint(net.minecraft.core.BlockPos spawnPoint) Description copied from interface:IColonySpawnEventSets the spawn point- Specified by:
setSpawnPointin interfaceIColonySpawnEvent- Parameters:
spawnPoint- the spawn point to set.
-
getSpawnPos
public net.minecraft.core.BlockPos getSpawnPos()Description copied from interface:IColonySpawnEventThe position the event starts at- Specified by:
getSpawnPosin interfaceIColonySpawnEvent- Returns:
- the spawn pos.
-
getEntities
Description copied from interface:IColonyEntitySpawnEventThe list of entities related to this event- Specified by:
getEntitiesin interfaceIColonyEntitySpawnEvent- Returns:
- the list.
-
getStatus
Description copied from interface:IColonyEventReturns the events current status- Specified by:
getStatusin interfaceIColonyEvent- Returns:
- the status.
-
setStatus
Description copied from interface:IColonyEventSets the current event status- Specified by:
setStatusin interfaceIColonyEvent- Parameters:
status- the status to set.
-
getID
public int getID()Description copied from interface:IColonyEventReturns this events ID.- Specified by:
getIDin interfaceIColonyEvent- Returns:
- the event id.
-
setColony
Description copied from interface:IColonyEventSets the colony- Specified by:
setColonyin interfaceIColonyEvent- Parameters:
colony- the colony to set.
-
unregisterEntity
public void unregisterEntity(net.minecraft.world.entity.Entity entity) Called when an entity is removed- Specified by:
unregisterEntityin interfaceIColonyEntitySpawnEvent- Parameters:
entity- the entity to unregister.
-
onEntityDeath
public void onEntityDeath(net.minecraft.world.entity.LivingEntity entity) Description copied from interface:IColonyEntitySpawnEventTrigger on entity death.- Specified by:
onEntityDeathin interfaceIColonyEntitySpawnEvent- Parameters:
entity- the killed entity.
-
spawnHorde
protected void spawnHorde(net.minecraft.core.BlockPos spawnPos, IColony colony, int id, int numberOfBosses, int numberOfArchers, int numberOfRaiders) Spawn a specific horde.- Parameters:
spawnPos- the pos to spawn them at.colony- the colony to spawn them for.id- the raid event id.numberOfArchers- the archers.numberOfBosses- the bosses.numberOfRaiders- the normal raiders.
-
onFinish
public void onFinish()Description copied from interface:IColonyEventActions which are done on the finish/removal of the event.- Specified by:
onFinishin interfaceIColonyEvent
-
onNightFall
public void onNightFall()Description copied from interface:IColonyEventCalled on night fall, to execute special day-based logic.- Specified by:
onNightFallin interfaceIColonyEvent
-
setHorde
-
getRandomCampfire
public net.minecraft.core.BlockPos getRandomCampfire()Returns a random campfire- Returns:
- a random campfire.
-
onStart
public void onStart()Description copied from interface:IColonyEventActions which are done on the start of the event.- Specified by:
onStartin interfaceIColonyEvent
-
getColony
Get the assigned colony.- Returns:
- the colony.
-
updateRaidBar
protected void updateRaidBar()Updates the raid bar -
getDisplayName
protected abstract net.minecraft.network.chat.MutableComponent getDisplayName()Gets the raids display name- Returns:
-
onUpdate
public void onUpdate()Description copied from interface:IColonyEventOnupdate function, called every 25s / 500 ticks. Comes from colony then goes to the eventmanager and then to the event.- Specified by:
onUpdatein interfaceIColonyEvent
-
sendHordeMessage
protected void sendHordeMessage()Sends the right horde message. -
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag compound) - Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
setCampFireTime
public void setCampFireTime(int time) Description copied from interface:IColonyCampFireRaidEventSets the intervals to wait before moving away from campfires.- Specified by:
setCampFireTimein interfaceIColonyCampFireRaidEvent- Parameters:
time- in MAX_TICK(25s) intervals
-
addSpawner
public void addSpawner(net.minecraft.core.BlockPos pos) Description copied from interface:IColonyRaidEventAdd a spawner to an event.- Specified by:
addSpawnerin interfaceIColonyRaidEvent- Parameters:
pos- the pos to add the spawner at.
-
getWayPoints
Description copied from interface:IColonyRaidEventGets the list of waypoints- Specified by:
getWayPointsin interfaceIColonyRaidEvent
-
setSpawnPath
Set the pathing for this raids spawnpoint- Parameters:
result- pathing result to wait for
-