mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-12-13 14:49:03 +00:00
Changed unreliable sequential integer object id to BSON ObjectId #162
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package net.simon987.biomassplugin;
|
||||
|
||||
import net.simon987.server.GameServer;
|
||||
import net.simon987.server.game.world.TileMap;
|
||||
import net.simon987.server.game.world.World;
|
||||
import net.simon987.server.logging.LogManager;
|
||||
import org.bson.types.ObjectId;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
@@ -63,7 +63,7 @@ public class WorldUtils {
|
||||
}
|
||||
|
||||
BiomassBlob biomassBlob = new BiomassBlob();
|
||||
biomassBlob.setObjectId(GameServer.INSTANCE.getGameUniverse().getNextObjectId());
|
||||
biomassBlob.setObjectId(new ObjectId());
|
||||
biomassBlob.setBiomassCount(yield);
|
||||
biomassBlob.setX(p.x);
|
||||
biomassBlob.setY(p.y);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package net.simon987.biomassplugin.event;
|
||||
|
||||
import net.simon987.biomassplugin.BiomassBlob;
|
||||
import net.simon987.server.GameServer;
|
||||
import net.simon987.server.ServerConfiguration;
|
||||
import net.simon987.server.event.GameEvent;
|
||||
import net.simon987.server.event.GameEventListener;
|
||||
@@ -9,6 +8,7 @@ import net.simon987.server.event.ObjectDeathEvent;
|
||||
import net.simon987.server.game.objects.GameObject;
|
||||
import net.simon987.server.game.world.World;
|
||||
import net.simon987.server.logging.LogManager;
|
||||
import org.bson.types.ObjectId;
|
||||
|
||||
/**
|
||||
* Handles ObjectDeathEvent events
|
||||
@@ -58,7 +58,7 @@ public class ObjectDeathListener implements GameEventListener {
|
||||
private BiomassBlob createBiomassBlobAt(int x, int y, World world) {
|
||||
|
||||
BiomassBlob biomassBlob = new BiomassBlob();
|
||||
biomassBlob.setObjectId(GameServer.INSTANCE.getGameUniverse().getNextObjectId());
|
||||
biomassBlob.setObjectId(new ObjectId());
|
||||
biomassBlob.setBiomassCount(biomassDropCount);
|
||||
biomassBlob.setX(x);
|
||||
biomassBlob.setY(y);
|
||||
|
||||
Reference in New Issue
Block a user