mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-28 23:15:53 -04:00
Merge remote-tracking branch 'origin/master' into ResourceSpawn
Conflicts: src/main/NGECore.java src/services/DevService.java src/services/command/CommandService.java
This commit is contained in:
@@ -272,9 +272,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
|
||||
public void loadServerTemplates() {
|
||||
System.out.println("Loading server templates...");
|
||||
for(Runnable r : loadServerTemplateTasks) {
|
||||
r.run();
|
||||
}
|
||||
loadServerTemplateTasks.forEach(Runnable::run);
|
||||
loadServerTemplateTasks.clear();
|
||||
System.out.println("Finished loading server templates...");
|
||||
}
|
||||
@@ -639,6 +637,20 @@ public class ObjectService implements INetworkDispatch {
|
||||
return;
|
||||
}
|
||||
|
||||
if(object.getStringAttribute("proc_name") != null)
|
||||
{
|
||||
if(object.getAttachment("tempUseCount") != null)
|
||||
{
|
||||
int useCount = (int)object.getAttachment("tempUseCount"); // Seefo: Placeholder until delta for stack count/use count
|
||||
|
||||
if((useCount - 1) == 0) destroyObject(object);
|
||||
else object.setAttachment("tempUseCount", useCount--);
|
||||
}
|
||||
|
||||
// Seefo: We need to add cool downs for buff items
|
||||
core.buffService.addBuffToCreature(creature, object.getStringAttribute("proc_name").replace("@ui_buff:", ""), creature);
|
||||
}
|
||||
|
||||
String filePath = "scripts/" + object.getTemplate().split("shared_" , 2)[0].replace("shared_", "") + object.getTemplate().split("shared_" , 2)[1].replace(".iff", "") + ".py";
|
||||
|
||||
if (FileUtilities.doesFileExist(filePath)) {
|
||||
@@ -993,8 +1005,8 @@ public class ObjectService implements INetworkDispatch {
|
||||
if (duplicate.containsKey(containerId)) {
|
||||
containerId = duplicate.get(containerId);
|
||||
}
|
||||
|
||||
if (objectId != 0 && getObject(objectId) != null) {
|
||||
String planetName = planet.getName();
|
||||
if (objectId != 0 && getObject(objectId) != null && (planetName.contains("dungeon") || planetName.contains("adventure"))) {
|
||||
SWGObject container = getObject(containerId);
|
||||
int x = ((int) (px + ((container == null) ? x1 : container.getPosition().x)));
|
||||
int z = ((int) (pz + ((container == null) ? z1 : container.getPosition().z)));
|
||||
@@ -1018,6 +1030,8 @@ public class ObjectService implements INetworkDispatch {
|
||||
SWGObject object;
|
||||
if(objectId != 0 && containerId == 0) {
|
||||
if(portalCRC != 0) {
|
||||
if (core.getBuildingODB().contains(objectId, Long.class, BuildingObject.class) && !duplicate.containsValue(objectId))
|
||||
continue;
|
||||
containers.add(objectId);
|
||||
object = createObject(template, objectId, planet, new Point3D(px + x1, py, pz + z1), new Quaternion(qw, qx, qy, qz), null, true, false);
|
||||
object.setAttachment("childObjects", null);
|
||||
@@ -1027,14 +1041,14 @@ public class ObjectService implements INetworkDispatch {
|
||||
((BuildingObject) object).getTransaction().commitSync();
|
||||
}*/
|
||||
} else {
|
||||
object = createObject(template, objectId, planet, new Point3D(px + x1, py, pz + z1), new Quaternion(qw, qx, qy, qz), null, false, false);
|
||||
object = createObject(template, 0, planet, new Point3D(px + x1, py, pz + z1), new Quaternion(qw, qx, qy, qz), null, false, false);
|
||||
}
|
||||
if(object == null)
|
||||
continue;
|
||||
object.setContainerPermissions(WorldPermissions.WORLD_PERMISSIONS);
|
||||
if(radius > 256)
|
||||
object.setAttachment("bigSpawnRange", new Boolean(true));
|
||||
if (!duplicate.containsValue(objectId) && object instanceof BuildingObject)
|
||||
if (!duplicate.containsValue(objectId) && object instanceof BuildingObject && portalCRC != 0)
|
||||
persistentBuildings.add((BuildingObject) object);
|
||||
} else if(containerId != 0) {
|
||||
object = createObject(template, 0, planet, new Point3D(px, py, pz), new Quaternion(qw, qx, qy, qz), null, false, false);
|
||||
@@ -1071,6 +1085,7 @@ public class ObjectService implements INetworkDispatch {
|
||||
building.createTransaction(core.getBuildingODB().getEnvironment());
|
||||
core.getBuildingODB().put(building, Long.class, BuildingObject.class, building.getTransaction());
|
||||
building.getTransaction().commitSync();
|
||||
destroyObject(building);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user