Class AbstractShipRaidEvent
java.lang.Object
com.minecolonies.core.colony.events.raid.AbstractShipRaidEvent
- All Implemented Interfaces:
IColonyEntitySpawnEvent,IColonyEvent,IColonyRaidEvent,IColonySpawnEvent,IColonyStructureSpawnEvent,net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
- Direct Known Subclasses:
DrownedPirateRaidEvent,NorsemenShipRaidEvent,PirateRaidEvent
public abstract class AbstractShipRaidEvent
extends Object
implements IColonyRaidEvent, IColonyStructureSpawnEvent
The Ship based raid event, spawns a ship with raider spawners onboard.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IColonyThe associated colonyprotected intMax raider count.protected final net.minecraft.server.level.ServerBossEventThe raids visual raidbarReference to the currently active pirates for this event.protected com.ldtteam.structurize.api.RotationMirrorRotation of the ship to spawnprotected ShipSizeThe events shipsizeprotected intRaider kill count.protected PathResultThe path result towards the intended spawn pointprotected net.minecraft.core.BlockPosThe ships spawnpointprotected EventStatusThe current raidstatusstatic final StringNBT Tagsstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final intSpacing between waypointsprotected List<net.minecraft.core.BlockPos> Waypoints helping raiders travel -
Constructor Summary
ConstructorsConstructorDescriptionAbstractShipRaidEvent(@NotNull IColony colony) Create a new ship based raid event. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSpawner(net.minecraft.core.BlockPos pos) Add a spawner to an event.voiddeserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) 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.Returns the list of used schematics and their positions.net.minecraft.core.BlockPosThe position the event starts atReturns the events current statusList<net.minecraft.core.BlockPos> Gets the list of waypointsbooleanWhether or not the raid is still active.booleanIf this is an underwater ship based event.voidonEntityDeath(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.voidonTileEntityBreak(net.minecraft.world.level.block.entity.BlockEntity te) Called by tileentities relevant to the event on invalidation.voidonUpdate()Onupdate function, called every 25s / 500 ticks.voidregisterEntity(net.minecraft.world.entity.Entity entity) Called to register an entity with this eventnet.minecraft.nbt.CompoundTagserializeNBT(net.minecraft.core.HolderLookup.Provider provider) voidSets the colonyvoidsetMaxRaiderCount(int maxRaiderCount) Set the max raider count.voidsetShipRotation(com.ldtteam.structurize.api.RotationMirror shipRotationMirror) Sets the ships rotationvoidsetShipSize(ShipSize shipSize) Sets the ship size for this event.voidsetSpawnPath(PathResult result) Set the pathing for this raids spawnpointvoidsetSpawnPoint(net.minecraft.core.BlockPos spawnPoint) Sets the spawn pointvoidsetStatus(EventStatus status) Sets the current event statusvoidunregisterEntity(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.IColonyEvent
getEventTypeIDMethods inherited from interface com.minecolonies.api.colony.colonyEvents.IColonyRaidEvent
getArcherRaiderType, getBossRaiderType, getNormalRaiderTypeMethods inherited from interface com.minecolonies.api.colony.colonyEvents.IColonyStructureSpawnEvent
getShipDesc
-
Field Details
-
WAYPOINT_SPACING
protected static final int WAYPOINT_SPACINGSpacing between waypoints- See Also:
-
TAG_DAYS_LEFT
NBT Tags- See Also:
-
TAG_SPAWNER_COUNT
- See Also:
-
TAG_POS
- See Also:
-
TAG_SPAWNERS
- See Also:
-
TAG_SHIPSIZE
- See Also:
-
TAG_SHIP_ROTMIR
- See Also:
-
TAG_RAIDER_THRESHOLD_TRACKER
- See Also:
-
TAG_MAX_RAIDER_COUNT
- See Also:
-
status
The current raidstatus -
raidBar
protected final net.minecraft.server.level.ServerBossEvent raidBarThe raids visual raidbar -
colony
The associated colony -
spawnPoint
protected net.minecraft.core.BlockPos spawnPointThe ships spawnpoint -
shipSize
The events shipsize -
raiders
Reference to the currently active pirates for this event. -
shipRotationMirror
protected com.ldtteam.structurize.api.RotationMirror shipRotationMirrorRotation of the ship to spawn -
spawnPathResult
The path result towards the intended spawn point -
wayPoints
Waypoints helping raiders travel -
maxRaiderCount
protected int maxRaiderCountMax raider count. -
spawnerThresholdKillTracker
protected int spawnerThresholdKillTrackerRaider kill count.
-
-
Constructor Details
-
AbstractShipRaidEvent
Create a new ship based raid event.- Parameters:
colony- the colony.
-
-
Method Details
-
onStart
public void onStart()Description copied from interface:IColonyEventActions which are done on the start of the event.- Specified by:
onStartin interfaceIColonyEvent
-
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
-
isUnderWater
public boolean isUnderWater()If this is an underwater ship based event.- Returns:
- true if so.
-
onFinish
public void onFinish()Description copied from interface:IColonyEventActions which are done on the finish/removal of the event.- Specified by:
onFinishin interfaceIColonyEvent
-
onTileEntityBreak
public void onTileEntityBreak(net.minecraft.world.level.block.entity.BlockEntity te) Description copied from interface:IColonyEventCalled by tileentities relevant to the event on invalidation.- Specified by:
onTileEntityBreakin interfaceIColonyEvent- Parameters:
te- the broken Tile entity.
-
onNightFall
public void onNightFall()Description copied from interface:IColonyEventCalled on night fall, to execute special day-based logic.- Specified by:
onNightFallin interfaceIColonyEvent
-
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.
-
registerEntity
public void registerEntity(net.minecraft.world.entity.Entity entity) Description copied from interface:IColonyEntitySpawnEventCalled to register an entity with this event- Specified by:
registerEntityin interfaceIColonyEntitySpawnEvent- Parameters:
entity- the entity to register.
-
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.
-
setShipSize
Sets the ship size for this event.- Parameters:
shipSize- the ship size.
-
setShipRotation
public void setShipRotation(com.ldtteam.structurize.api.RotationMirror shipRotationMirror) Sets the ships rotation- Parameters:
shipRotationMirror- the ship rotation.
-
setColony
Description copied from interface:IColonyEventSets the colony- Specified by:
setColonyin interfaceIColonyEvent- Parameters:
colony- the colony to set.
-
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.
-
getSchematicSpawns
Description copied from interface:IColonyStructureSpawnEventReturns the list of used schematics and their positions. The string should be the full path to the schematic file.- Specified by:
getSchematicSpawnsin interfaceIColonyStructureSpawnEvent- Returns:
- list of schematics
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider) - Specified by:
serializeNBTin interfacenet.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
deserializeNBT
public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) - Specified by:
deserializeNBTin interfacenet.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
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
-
isRaidActive
public boolean isRaidActive()Description copied from interface:IColonyRaidEventWhether or not the raid is still active.- Specified by:
isRaidActivein interfaceIColonyRaidEvent- Returns:
- true if so.
-
setMaxRaiderCount
public void setMaxRaiderCount(int maxRaiderCount) Description copied from interface:IColonyStructureSpawnEventSet the max raider count.- Specified by:
setMaxRaiderCountin interfaceIColonyStructureSpawnEvent- Parameters:
maxRaiderCount- the count.
-