Integrate Wild Update quests and Citizens contacts
This commit is contained in:
parent
018d776874
commit
f46b26d956
1 changed files with 919 additions and 81 deletions
|
|
@ -93,12 +93,8 @@ public final class DuneLobby extends JavaPlugin implements Listener, CommandExec
|
|||
}
|
||||
private void npc(String role,String name,int x,int y,int z,Villager.Profession profession) {
|
||||
for(LivingEntity entity:lobby.getEntitiesByClass(LivingEntity.class)) if(role.equals(entity.getPersistentDataContainer().get(roleKey,PersistentDataType.STRING))) return;
|
||||
lobby.spawn(new Location(lobby,x+.5,y,z+.5,180,0),Villager.class,v->{
|
||||
v.setCustomName(ChatColor.GOLD+name); v.setCustomNameVisible(true); v.setAI(false); v.setSilent(true);
|
||||
v.setInvulnerable(true); v.setPersistent(true); v.setRemoveWhenFarAway(false); v.setProfession(profession);
|
||||
v.setVillagerType(role.equals("water")||role.equals("spice")?Villager.Type.SWAMP:Villager.Type.DESERT);
|
||||
v.getPersistentDataContainer().set(roleKey,PersistentDataType.STRING,role); v.setRecipes(List.of());
|
||||
});
|
||||
if(!com.dunerealms.npc.CitizensBridge.ready()||com.dunerealms.npc.CitizensBridge.exists(this,lobby,roleKey,role))return;
|
||||
com.dunerealms.npc.CitizensBridge.spawnContact(this,new Location(lobby,x+.5,y,z+.5,180,0),ChatColor.GOLD+name,roleKey,role,true);
|
||||
}
|
||||
@Override public boolean onCommand(CommandSender sender,Command command,String label,String[] args) {
|
||||
if(command.getName().equals("lobby")) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff