public class Raid extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Raid.Member |
(package private) static class |
Raid.Status |
Modifier and Type | Field and Description |
---|---|
private boolean |
active |
private int |
badOmenLevel |
private ServerBossBar |
bar |
private BlockPos |
center |
private static Text |
DEFEAT_SUFFIX_TEXT |
private static Text |
DEFEAT_TITLE |
private static Text |
EVENT_TEXT |
private int |
finishCooldown |
private Set<UUID> |
heroesOfTheVillage |
private int |
id |
private int |
postRaidTicks |
private Optional<BlockPos> |
preCalculatedRavagerSpawnLocation |
private int |
preRaidTicks |
private Random |
random |
private boolean |
started |
private Raid.Status |
status |
private long |
ticksActive |
private float |
totalHealth |
private static Text |
VICTORY_SUFFIX_TEXT |
private static Text |
VICTORY_TITLE |
private int |
waveCount |
private int |
wavesSpawned |
private Map<Integer,RaiderEntity> |
waveToCaptain |
private Map<Integer,Set<RaiderEntity>> |
waveToRaiders |
private ServerWorld |
world |
Constructor and Description |
---|
Raid(int id,
ServerWorld world,
BlockPos pos) |
Raid(ServerWorld world,
CompoundTag tag) |
private static final Text EVENT_TEXT
private static final Text VICTORY_SUFFIX_TEXT
private static final Text DEFEAT_SUFFIX_TEXT
private static final Text VICTORY_TITLE
private static final Text DEFEAT_TITLE
private final Map<Integer,RaiderEntity> waveToCaptain
private final Map<Integer,Set<RaiderEntity>> waveToRaiders
private long ticksActive
private BlockPos center
private final ServerWorld world
private boolean started
private final int id
private float totalHealth
private int badOmenLevel
private boolean active
private int wavesSpawned
private final ServerBossBar bar
private int postRaidTicks
private int preRaidTicks
private final Random random
private final int waveCount
private Raid.Status status
private int finishCooldown
public Raid(int id, ServerWorld world, BlockPos pos)
public Raid(ServerWorld world, CompoundTag tag)
public boolean isFinished()
public boolean isPreRaid()
public boolean hasSpawned()
public boolean hasStopped()
public boolean hasWon()
public boolean hasLost()
public World getWorld()
public boolean hasStarted()
public int getGroupsSpawned()
private Predicate<ServerPlayerEntity> isInRaidDistance()
private void updateBarToPlayers()
public int getMaxAcceptableBadOmenLevel()
public int getBadOmenLevel()
public void start(PlayerEntity player)
public void invalidate()
public void tick()
private void moveRaidCenter()
private Optional<BlockPos> preCalculateRavagerSpawnLocation(int proximity)
private boolean shouldSpawnMoreGroups()
private boolean hasSpawnedFinalWave()
private boolean hasExtraWave()
private boolean hasSpawnedExtraWave()
private boolean isSpawningExtraWave()
private void removeObsoleteRaiders()
private void playRaidHorn(BlockPos pos)
private void spawnNextWave(BlockPos pos)
public void addRaider(int wave, RaiderEntity raider, @Nullable BlockPos pos, boolean existing)
public void updateBar()
public float getCurrentRaiderHealth()
private boolean canSpawnRaiders()
public int getRaiderCount()
public void removeFromWave(RaiderEntity entity, boolean countHealth)
private void markDirty()
public static ItemStack getOminousBanner()
@Nullable public RaiderEntity getCaptain(int wave)
@Nullable private BlockPos getRavagerSpawnLocation(int proximity, int tries)
private boolean addToWave(int wave, RaiderEntity entity)
public boolean addToWave(int wave, RaiderEntity entity, boolean countHealth)
public void setWaveCaptain(int wave, RaiderEntity entity)
public void removeLeader(int wave)
public BlockPos getCenter()
private void setCenter(BlockPos center)
public int getRaidId()
private int getCount(Raid.Member member, int wave, boolean extra)
private int getBonusCount(Raid.Member member, Random random, int wave, LocalDifficulty localDifficulty, boolean extra)
public boolean isActive()
public CompoundTag toTag(CompoundTag tag)
public int getMaxWaves(Difficulty difficulty)
public float getEnchantmentChance()
public void addHero(Entity entity)