mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-27 02:59:06 +00:00
Matter loaders
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.core.loader.IrisRegistrant;
|
||||
import com.volmit.iris.util.json.JSONObject;
|
||||
import com.volmit.iris.util.matter.IrisMatter;
|
||||
import com.volmit.iris.util.matter.Matter;
|
||||
import com.volmit.iris.util.plugin.VolmitSender;
|
||||
import jdk.jfr.DataAmount;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@Data
|
||||
public class IrisMatterObject extends IrisRegistrant {
|
||||
private final Matter matter;
|
||||
|
||||
public IrisMatterObject()
|
||||
{
|
||||
this(1,1,1);
|
||||
}
|
||||
|
||||
public IrisMatterObject(int w, int h, int d)
|
||||
{
|
||||
this(new IrisMatter(w,h,d));
|
||||
}
|
||||
|
||||
public IrisMatterObject(Matter matter)
|
||||
{
|
||||
this.matter = matter;
|
||||
}
|
||||
|
||||
public static IrisMatterObject from(IrisObject object)
|
||||
{
|
||||
return new IrisMatterObject(Matter.from(object));
|
||||
}
|
||||
|
||||
public static IrisMatterObject from(File j) throws IOException, ClassNotFoundException {
|
||||
return new IrisMatterObject(Matter.read(j));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFolderName() {
|
||||
return "matter";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "Matter";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scanForErrors(JSONObject p, VolmitSender sender) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,9 @@
|
||||
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Snippet;
|
||||
import com.volmit.iris.core.loader.ObjectResourceLoader;
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -29,8 +30,12 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode()
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@Desc("Represents an iris object placer. It places objects.")
|
||||
@Desc("Represents an iris object placer. It places matter objects.")
|
||||
@Data
|
||||
public class IrisMatterPlacement {
|
||||
|
||||
@RegistryListResource(IrisMatterObject.class)
|
||||
@Required
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("List of objects to place")
|
||||
private KList<String> place = new KList<>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user