mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-30 00:15:57 -04:00
Fixed various bugs
This commit is contained in:
@@ -29,8 +29,6 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import main.NGECore;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
|
||||
import engine.resources.objects.Baseline;
|
||||
@@ -45,7 +43,6 @@ public class SWGSet<E> implements Set<E>, Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private TreeSet<E> set = new TreeSet<E>();
|
||||
private transient int updateCounter = 0;
|
||||
private long objectId;
|
||||
private byte viewType;
|
||||
private short updateType;
|
||||
private boolean addByte;
|
||||
@@ -55,7 +52,6 @@ public class SWGSet<E> implements Set<E>, Serializable {
|
||||
public SWGSet() { }
|
||||
|
||||
public SWGSet(SWGObject object, int viewType, int updateType, boolean addByte) {
|
||||
this.objectId = object.getObjectId();
|
||||
this.viewType = (byte) viewType;
|
||||
this.updateType = (short) updateType;
|
||||
this.addByte = addByte;
|
||||
@@ -64,7 +60,6 @@ public class SWGSet<E> implements Set<E>, Serializable {
|
||||
|
||||
public SWGSet(Set<E> s) {
|
||||
if (s instanceof SWGSet) {
|
||||
this.objectId = ((SWGSet<E>) s).objectId;
|
||||
this.object = ((SWGSet<E>) s).object;
|
||||
this.viewType = ((SWGSet<E>) s).viewType;
|
||||
this.updateType = ((SWGSet<E>) s).updateType;
|
||||
@@ -72,10 +67,20 @@ public class SWGSet<E> implements Set<E>, Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public void init() {
|
||||
public void init(SWGObject object) {
|
||||
objectMutex = new Object();
|
||||
updateCounter = 0;
|
||||
object = NGECore.getInstance().objectService.getObject(objectId);
|
||||
this.object = object;
|
||||
|
||||
for (Object item : set) {
|
||||
try {
|
||||
if (item instanceof IDelta) {
|
||||
item.getClass().getMethod("init", new Class[] {}).invoke(item, new Object[] { });
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean add(E e) {
|
||||
|
||||
Reference in New Issue
Block a user