Cleanup sources

This commit is contained in:
Daniel Mills
2021-08-02 19:50:41 -04:00
parent 18c70002cb
commit 160bdf5472
20 changed files with 76 additions and 342 deletions

View File

@@ -19,7 +19,6 @@
package com.volmit.iris.engine.object;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.volmit.iris.Iris;
import com.volmit.iris.engine.data.B;
import com.volmit.iris.util.collection.KList;
@@ -31,7 +30,6 @@ import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import java.io.File;
import java.io.IOException;
@Data
public class IrisCompat {
@@ -151,7 +149,7 @@ public class IrisCompat {
}
}
public static IrisCompat configured(File f) throws IOException {
public static IrisCompat configured(File f) {
IrisCompat def = new IrisCompat();
String defa = new JSONObject(new Gson().toJson(def)).toString(4);
J.attemptAsync(() -> IO.writeAll(new File(f.getParentFile(), "compat.default.json"), defa));
@@ -170,7 +168,7 @@ public class IrisCompat {
for (IrisCompatabilityItemFilter i : rea.getItemFilters()) {
def.getItemFilters().add(i);
}
} catch (JsonSyntaxException e) {
} catch (Throwable e) {
e.printStackTrace();
Iris.reportError(e);
}

View File

@@ -22,7 +22,6 @@ import com.volmit.iris.Iris;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.object.annotations.ArrayType;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.RegistryListMythical;
import com.volmit.iris.engine.object.annotations.Required;
import com.volmit.iris.util.collection.KList;
import com.volmit.iris.util.format.C;
@@ -63,10 +62,6 @@ public class IrisEntity extends IrisRegistrant {
@Desc("The type of entity to spawn. To spawn a mythic mob, set this type to unknown and define mythic type.")
private EntityType type = EntityType.UNKNOWN;
@RegistryListMythical
@Desc("The type of mythic mob (if mythic mobs is installed). If this is set, make sure to set 'type' to UNKNOWN")
private String mythicalType = "";
@Desc("The custom name of this entity")
private String customName = "";
@@ -281,17 +276,10 @@ public class IrisEntity extends IrisRegistrant {
return ae.get();
}
if (isMythical()) {
return Iris.linkMythicMobs.spawn(getMythicalType(), at);
}
return at.getWorld().spawnEntity(at, getType());
}
public boolean isMythical() {
return Iris.linkMythicMobs.supported() && !getMythicalType().trim().isEmpty();
}
public boolean isCitizens() {
return false;

View File

@@ -1,31 +0,0 @@
/*
* Iris is a World Generator for Minecraft Bukkit Servers
* Copyright (c) 2021 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.volmit.iris.engine.object.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Retention(RUNTIME)
@Target({PARAMETER, TYPE, FIELD})
public @interface RegistryListMythical {
}