Skip to content

Commit

Permalink
Fix #18 , update to RC-21
Browse files Browse the repository at this point in the history
  • Loading branch information
GallowsDove committed Mar 15, 2021
1 parent f45c9dc commit 161adbc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<dependency>
<groupId>com.github.Slimefun</groupId>
<artifactId>Slimefun4</artifactId>
<version>125d488f34</version>
<version>RC-21</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void onEnable() {
ForcefieldDome.loadDomeLocations();
PluginUtils.runSync(() -> ForcefieldDome.INSTANCE.setupDomes());
PluginUtils.scheduleRepeatingSync(new QuestTicker(), 10, 240);
PluginUtils.scheduleRepeatingSync(new MobTicker(), 5);
PluginUtils.scheduleRepeatingSync(new MobTicker(), 2);
}

@SneakyThrows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public Pixie() {

@Override
public void onSpawn(LivingEntity spawned) {
spawned.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).setBaseValue(20);
spawned.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).setBaseValue(24);
spawned.setRemoveWhenFarAway(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected BossBarStyle getBossBarStyle() {
@Override
public void onUniqueTick() {
this.tick++;
if (this.tick == 20) {
if (this.tick == 100) {
this.tick = 0;
}
}
Expand Down Expand Up @@ -103,7 +103,7 @@ public void onMobTick(@Nonnull LivingEntity entity) {

for (Entity player : entities) {
if (player instanceof Player && ((Player) player).getGameMode() == GameMode.SURVIVAL) {
if (this.tick % 4 == 0)
if (this.tick % 10 == 0)
pixieQueen.attack(player);
}
}
Expand All @@ -114,17 +114,17 @@ public void onMobTick(@Nonnull LivingEntity entity) {
if (player instanceof Player && ((Player) player).getGameMode() == GameMode.SURVIVAL) {
pixieQueen.setTarget((LivingEntity) player);
pixieQueen.setCharging(false);
if ((this.tick + 1) % 2 == 0) {
if ((this.tick + 2) % 3 == 0) {
// TODO find out why this sometimes produces error
try {
pixieQueen.setVelocity(player.getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(0.42));
pixieQueen.setVelocity(player.getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(0.32));
} catch (IllegalArgumentException e) { }
}
}
}
} else if (pattern == AttackPattern.SHOOT) {
if (pixieQueen.getTarget() != null) {
if (this.tick % 2 == 0) {
if (this.tick % 5 == 0) {
Arrow arrow = entity.launchProjectile(Arrow.class);
arrow.setDamage(24);
arrow.setColor(Color.LIME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private void onBlockDropEvent(@Nonnull EntityChangeBlockEvent e) {

@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
private void onBlocksBreakByExplosiveToolEvent(@Nonnull ExplosiveToolBreakBlocksEvent e) {
for (Block b : e.getBlocks()) {
for (Block b : e.getAdditionalBlocks()) {
if (ForcefieldDome.FORCEFIELD_BLOCKS.remove(b)) {
Bukkit.getScheduler().runTask(FoxyMachines.getInstance(), () -> b.setType(Material.BARRIER));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ public void run() {
if (mob != null) {
mob.onMobTick(entity);
if (mob instanceof CustomBoss) {
if (tick == 20) {
if (tick == 100) {
((CustomBoss) mob).onBossPattern(entity);
}
}
}
}
}
if (tick == 20) {
if (tick == 100) {
tick = 0;
}
tick++;
Expand Down

0 comments on commit 161adbc

Please sign in to comment.