Tweak boss nether portals
This commit is contained in:
parent
70212f9596
commit
f4397d0b0b
@ -1,5 +1,6 @@
|
||||
package mineplex.game.clans.clans.nether;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -19,6 +20,7 @@ import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.EntityPortalEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
@ -72,9 +74,9 @@ public class NetherManager extends MiniPlugin
|
||||
private PortalRepository _repo;
|
||||
private NetherMinibossManager _miniboss;
|
||||
private World _netherWorld;
|
||||
private List<NetherPortal> _portals = Lists.newArrayList();
|
||||
public List<BossNetherPortal> BossPortals = Lists.newArrayList();
|
||||
private List<NetherPortal> _returnPortals = Lists.newArrayList();
|
||||
private List<NetherPortal> _portals = new ArrayList<>();
|
||||
public List<BossNetherPortal> BossPortals = new ArrayList<>();
|
||||
private List<NetherPortal> _returnPortals = new ArrayList<>();
|
||||
public Map<Player, Long> InNether = new HashMap<>();
|
||||
public Map<Player, Location> OverworldOrigins = new HashMap<>();
|
||||
public Map<Player, ClaimData> Claiming = new HashMap<>();
|
||||
@ -305,6 +307,7 @@ public class NetherManager extends MiniPlugin
|
||||
}
|
||||
BossNetherPortal portal = new BossNetherPortal(bossSpawn.clone().add(-2, 5, 0), bossSpawn.clone().add(2, 0, 0), false);
|
||||
portal.open(PORTAL_OPEN_DURATION);
|
||||
BossPortals.add(portal);
|
||||
for (NetherPortal returnPortal : _returnPortals)
|
||||
{
|
||||
returnPortal.open(-1);
|
||||
@ -570,6 +573,15 @@ public class NetherManager extends MiniPlugin
|
||||
@EventHandler
|
||||
public void onBossDeath(BossDeathEvent event)
|
||||
{
|
||||
spawnBossPortal(event.getEvent().getCenterLocation().clone().subtract(0, 1, 0));
|
||||
spawnBossPortal(event.getEvent().getCenterLocation().clone());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onBlockDamage(EntityExplodeEvent event)
|
||||
{
|
||||
if (isInNether(event.getLocation()))
|
||||
{
|
||||
event.setYield(0f);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user