summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/SubclumpShape.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-12 22:33:32 -0800
committerFuwn <[email protected]>2026-02-12 22:33:32 -0800
commitc7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch)
treedf9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/scape/SubclumpShape.java
downloadworldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz
worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip
Initial commit
Diffstat (limited to 'NET/worlds/scape/SubclumpShape.java')
-rw-r--r--NET/worlds/scape/SubclumpShape.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/NET/worlds/scape/SubclumpShape.java b/NET/worlds/scape/SubclumpShape.java
new file mode 100644
index 0000000..000786f
--- /dev/null
+++ b/NET/worlds/scape/SubclumpShape.java
@@ -0,0 +1,47 @@
+package NET.worlds.scape;
+
+public class SubclumpShape extends Shape implements ShapeLoaderListener {
+ private Material pendingMaterial = null;
+ private static final boolean debug = false;
+
+ @Override
+ public void setMaterial(Material m) {
+ SuperRoot parentObj = this.getOwner();
+ if (!(parentObj instanceof Shape)) {
+ super.setMaterial(m);
+ } else {
+ Shape parent = (Shape)parentObj;
+ if (!parent.isFullyLoaded()) {
+ parent.addLoadListener(this);
+ this.pendingMaterial = m;
+ } else {
+ super.setMaterial(m);
+ }
+ }
+ }
+
+ @Override
+ protected synchronized void addRwChildren(WObject container) {
+ SuperRoot o = this.getOwner();
+ if (o instanceof Shape) {
+ Shape parent = (Shape)o;
+ if (!parent.isFullyLoaded()) {
+ this.setState(LOADING, null);
+ parent.addLoadListener(this);
+ }
+ }
+
+ super.addRwChildren(container);
+ }
+
+ @Override
+ public void notifyShapeLoaded(Shape s) {
+ this.setState(NORMAL, null);
+ this.shapeRedraw();
+ if (this.pendingMaterial != null) {
+ super.setMaterial(this.pendingMaterial);
+ }
+
+ this.pendingMaterial = null;
+ }
+}