small work on znpcs loader
This commit is contained in:
parent
8f82afeb0b
commit
4c8432678e
1 changed files with 10 additions and 5 deletions
|
@ -57,7 +57,6 @@ public class ZNpcsLoader implements DataImporter {
|
||||||
gson = new Gson();
|
gson = new Gson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<NpcEntryImpl> importData() {
|
public Collection<NpcEntryImpl> importData() {
|
||||||
ZNpcsModel[] models;
|
ZNpcsModel[] models;
|
||||||
|
@ -70,9 +69,15 @@ public class ZNpcsLoader implements DataImporter {
|
||||||
ArrayList<NpcEntryImpl> entries = new ArrayList<>();
|
ArrayList<NpcEntryImpl> entries = new ArrayList<>();
|
||||||
for (ZNpcsModel model : models) {
|
for (ZNpcsModel model : models) {
|
||||||
String type = model.getNpcType();
|
String type = model.getNpcType();
|
||||||
if (type.equalsIgnoreCase("mushroom_cow")) type = "mooshroom";
|
|
||||||
else if (type.equalsIgnoreCase("snowman")) type = "snow_golem";
|
|
||||||
|
|
||||||
|
switch (type.toLowerCase()) {
|
||||||
|
case "mushroom_cow":
|
||||||
|
type = "mooshroom";
|
||||||
|
break;
|
||||||
|
case "snowman":
|
||||||
|
type = "snow_golem";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
ZNpcsLocation oldLoc = model.getLocation();
|
ZNpcsLocation oldLoc = model.getLocation();
|
||||||
NpcLocation location = new NpcLocation(oldLoc.getX(), oldLoc.getY(), oldLoc.getZ(), oldLoc.getYaw(), oldLoc.getPitch());
|
NpcLocation location = new NpcLocation(oldLoc.getX(), oldLoc.getY(), oldLoc.getZ(), oldLoc.getYaw(), oldLoc.getPitch());
|
||||||
|
@ -85,7 +90,7 @@ public class ZNpcsLoader implements DataImporter {
|
||||||
|
|
||||||
for (ZNpcsAction action : model.getClickActions()) {
|
for (ZNpcsAction action : model.getClickActions()) {
|
||||||
InteractionType t = adaptClickType(action.getActionType());
|
InteractionType t = adaptClickType(action.getActionType());
|
||||||
// TODO
|
npc.addAction(adaptAction(action.getActionType(), t, action.getAction(), action.getDelay()));
|
||||||
}
|
}
|
||||||
|
|
||||||
NpcEntryImpl entry = new NpcEntryImpl(String.valueOf(model.getId()), npc);
|
NpcEntryImpl entry = new NpcEntryImpl(String.valueOf(model.getId()), npc);
|
||||||
|
@ -119,7 +124,7 @@ public class ZNpcsLoader implements DataImporter {
|
||||||
case "console":
|
case "console":
|
||||||
return new ConsoleCommandAction(taskScheduler, parameter, clickType, delay * 1000L);
|
return new ConsoleCommandAction(taskScheduler, parameter, clickType, delay * 1000L);
|
||||||
case "chat":
|
case "chat":
|
||||||
return new PlayerChatAction(parameter, clickType, delay * 1000L);
|
return new PlayerChatAction(taskScheduler, parameter, clickType, delay * 1000L);
|
||||||
case "message":
|
case "message":
|
||||||
return new MessageAction(adventure, parameter, clickType, textSerializer, delay * 1000L);
|
return new MessageAction(adventure, parameter, clickType, textSerializer, delay * 1000L);
|
||||||
case "server":
|
case "server":
|
||||||
|
|
Loading…
Reference in a new issue