mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c84c462aeb
3
.idea/.gitignore
generated
vendored
Normal file
3
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
5
.idea/jarRepositories.xml
generated
5
.idea/jarRepositories.xml
generated
@ -36,5 +36,10 @@
|
||||
<option name="name" value="CodeMC" />
|
||||
<option name="url" value="https://repo.codemc.org/repository/maven-public" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="nexus" />
|
||||
<option name="name" value="Lumine Releases" />
|
||||
<option name="url" value="https://mvn.lumine.io/repository/maven-public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
13
.idea/libraries/Maven__io_lumine_xikage_MythicMobs_4_9_1.xml
generated
Normal file
13
.idea/libraries/Maven__io_lumine_xikage_MythicMobs_4_9_1.xml
generated
Normal file
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: io.lumine.xikage:MythicMobs:4.9.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/lumine/xikage/MythicMobs/4.9.1/MythicMobs-4.9.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/lumine/xikage/MythicMobs/4.9.1/MythicMobs-4.9.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/lumine/xikage/MythicMobs/4.9.1/MythicMobs-4.9.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
1
Iris.iml
1
Iris.iml
@ -42,6 +42,7 @@
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit.craftbukkit:cb-1.14.4:1.14.4" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bstats:bstats-bukkit:1.7" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: io.lumine.xikage:MythicMobs:4.9.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.10" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.5" level="project" />
|
||||
</component>
|
||||
|
11
pom.xml
11
pom.xml
@ -152,6 +152,11 @@
|
||||
<id>CodeMC</id>
|
||||
<url>https://repo.codemc.org/repository/maven-public</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>nexus</id>
|
||||
<name>Lumine Releases</name>
|
||||
<url>https://mvn.lumine.io/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>WorldEdit</id>
|
||||
<url>https://maven.enginehub.org/repo/</url>
|
||||
@ -197,6 +202,12 @@
|
||||
<version>7.2.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.lumine.xikage</groupId>
|
||||
<artifactId>MythicMobs</artifactId>
|
||||
<version>4.9.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Utilities -->
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
|
@ -23,6 +23,7 @@ import com.volmit.iris.gen.provisions.ProvisionBukkit;
|
||||
import com.volmit.iris.gen.scaffold.IrisGenConfiguration;
|
||||
import com.volmit.iris.gen.scaffold.TerrainTarget;
|
||||
import com.volmit.iris.link.MultiverseCoreLink;
|
||||
import com.volmit.iris.link.MythicMobsLink;
|
||||
import com.volmit.iris.manager.EditManager;
|
||||
import com.volmit.iris.manager.IrisBoardManager;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
@ -59,6 +60,7 @@ public class Iris extends MortarPlugin
|
||||
public static IrisBoardManager board;
|
||||
public static String nmsTag = findNMSTag();
|
||||
public static MultiverseCoreLink linkMultiverseCore;
|
||||
public static MythicMobsLink linkMythicMobs;
|
||||
private static IrisLock lock = new IrisLock("Iris");
|
||||
private static final Queue<Runnable> syncJobs = new ShurikenQueue<>();
|
||||
public static boolean customModels = doesSupportCustomModels();
|
||||
@ -156,6 +158,7 @@ public class Iris extends MortarPlugin
|
||||
struct = new StructureManager();
|
||||
board = new IrisBoardManager();
|
||||
linkMultiverseCore = new MultiverseCoreLink();
|
||||
linkMythicMobs = new MythicMobsLink();
|
||||
edit = new EditManager();
|
||||
J.a(() -> IO.delete(getTemp()));
|
||||
J.a(this::bstats);
|
||||
|
@ -353,9 +353,12 @@ public abstract class ParallaxTerrainProvider extends TopographicTerrainProvider
|
||||
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3566522));
|
||||
}
|
||||
|
||||
for(IrisObjectPlacement k : r.getSurfaceObjects())
|
||||
if(r != null)
|
||||
{
|
||||
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3569222));
|
||||
for(IrisObjectPlacement k : r.getSurfaceObjects())
|
||||
{
|
||||
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3569222));
|
||||
}
|
||||
}
|
||||
|
||||
return g;
|
||||
|
@ -85,6 +85,11 @@ public abstract class PostBlockTerrainProvider extends ParallaxTerrainProvider i
|
||||
@Override
|
||||
public BlockData getPostBlock(int x, int y, int z, int currentPostX, int currentPostZ, ChunkData currentData)
|
||||
{
|
||||
if(y > 255 || y < 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(x >> 4 == currentPostX && z >> 4 == currentPostZ)
|
||||
{
|
||||
getPostLock().lock();
|
||||
|
@ -402,6 +402,11 @@ public class PostMasterPatcher extends IrisPostBlockFilter
|
||||
|
||||
private int nearestCaveFloor(int floor, int x, int z, int currentPostX, int currentPostZ, ChunkData currentData)
|
||||
{
|
||||
if(floor > 255)
|
||||
{
|
||||
return 255;
|
||||
}
|
||||
|
||||
if(B.isAir(getPostBlock(x, floor, z, currentPostX, currentPostZ, currentData)))
|
||||
{
|
||||
if(B.isAir(getPostBlock(x, floor - 1, z, currentPostX, currentPostZ, currentData)))
|
||||
@ -430,6 +435,11 @@ public class PostMasterPatcher extends IrisPostBlockFilter
|
||||
|
||||
private int nearestCaveCeiling(int ceiling, int x, int z, int currentPostX, int currentPostZ, ChunkData currentData)
|
||||
{
|
||||
if(ceiling > 255)
|
||||
{
|
||||
return 255;
|
||||
}
|
||||
|
||||
if(B.isAir(getPostBlock(x, ceiling, z, currentPostX, currentPostZ, currentData)))
|
||||
{
|
||||
if(B.isAir(getPostBlock(x, ceiling + 1, z, currentPostX, currentPostZ, currentData)))
|
||||
|
64
src/main/java/com/volmit/iris/link/MythicMobsLink.java
Normal file
64
src/main/java/com/volmit/iris/link/MythicMobsLink.java
Normal file
@ -0,0 +1,64 @@
|
||||
package com.volmit.iris.link;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
|
||||
import io.lumine.xikage.mythicmobs.MythicMobs;
|
||||
import io.lumine.xikage.mythicmobs.mobs.MythicMob;
|
||||
|
||||
public class MythicMobsLink
|
||||
{
|
||||
public MythicMobsLink()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public boolean supported()
|
||||
{
|
||||
return getMythicMobs() != null;
|
||||
}
|
||||
|
||||
public Entity spawn(String name, Location a)
|
||||
{
|
||||
if(!supported())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
MythicMobs m = (MythicMobs) getMythicMobs();
|
||||
return m.getMobManager().spawnMob(name, a).getEntity().getBukkitEntity();
|
||||
}
|
||||
|
||||
public String[] getMythicMobTypes()
|
||||
{
|
||||
KList<String> v = new KList<>();
|
||||
|
||||
if(supported())
|
||||
{
|
||||
MythicMobs m = (MythicMobs) getMythicMobs();
|
||||
|
||||
for(MythicMob i : m.getMobManager().getMobTypes())
|
||||
{
|
||||
v.add(i.getInternalName());
|
||||
}
|
||||
}
|
||||
|
||||
return v.toArray(new String[v.size()]);
|
||||
}
|
||||
|
||||
public Plugin getMythicMobs()
|
||||
{
|
||||
Plugin p = Bukkit.getPluginManager().getPlugin("MythicMobs");
|
||||
|
||||
if(p == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
}
|
@ -26,6 +26,7 @@ import com.volmit.iris.util.RegistryListFont;
|
||||
import com.volmit.iris.util.RegistryListGenerator;
|
||||
import com.volmit.iris.util.RegistryListItemType;
|
||||
import com.volmit.iris.util.RegistryListLoot;
|
||||
import com.volmit.iris.util.RegistryListMythical;
|
||||
import com.volmit.iris.util.RegistryListObject;
|
||||
import com.volmit.iris.util.RegistryListRegion;
|
||||
import com.volmit.iris.util.RegistryListStructure;
|
||||
@ -207,6 +208,22 @@ public class SchemaBuilder
|
||||
|
||||
}
|
||||
|
||||
else if(k.isAnnotationPresent(RegistryListMythical.class))
|
||||
{
|
||||
String key = "enum-reg-mythical";
|
||||
|
||||
if(!definitions.containsKey(key))
|
||||
{
|
||||
JSONObject j = new JSONObject();
|
||||
j.put("enum", new JSONArray(Iris.linkMythicMobs.getMythicMobTypes()));
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
fancyType = "Mythic Mob Type";
|
||||
prop.put("$ref", "#/definitions/" + key);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Mythic Mob Type (use ctrl+space for auto complete!) Define mythic mobs with the mythic mobs plugin configuration files.");
|
||||
}
|
||||
|
||||
else if(k.isAnnotationPresent(RegistryListBlockType.class))
|
||||
{
|
||||
String key = "enum-block-type";
|
||||
@ -553,6 +570,31 @@ public class SchemaBuilder
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Biome (use ctrl+space for auto complete!)");
|
||||
}
|
||||
|
||||
else if(k.isAnnotationPresent(RegistryListMythical.class))
|
||||
{
|
||||
fancyType = "List of Mythic Mob Types";
|
||||
String key = "enum-reg-mythical";
|
||||
|
||||
if(!definitions.containsKey(key))
|
||||
{
|
||||
JSONObject j = new JSONObject();
|
||||
JSONArray ja = new JSONArray();
|
||||
|
||||
for(String i : Iris.linkMythicMobs.getMythicMobTypes())
|
||||
{
|
||||
ja.put(i);
|
||||
}
|
||||
|
||||
j.put("enum", ja);
|
||||
definitions.put(key, j);
|
||||
}
|
||||
|
||||
JSONObject items = new JSONObject();
|
||||
items.put("$ref", "#/definitions/" + key);
|
||||
prop.put("items", items);
|
||||
description.add(SYMBOL_TYPE__N + " Must be a valid Mythic Mob Type (use ctrl+space for auto complete!) Configure mob types in the mythic mobs plugin configuration files.");
|
||||
}
|
||||
|
||||
else if(k.isAnnotationPresent(RegistryListBlockType.class))
|
||||
{
|
||||
fancyType = "List of Block Types";
|
||||
@ -839,6 +881,7 @@ public class SchemaBuilder
|
||||
{
|
||||
warnings.add("Unexpected Schema Type: " + type + " for field " + k.getName() + " (" + k.getType().getSimpleName() + ") in class " + cl.getSimpleName());
|
||||
}
|
||||
|
||||
KList<String> d = new KList<>();
|
||||
d.add(k.getName());
|
||||
d.add(getFieldDescription(k));
|
||||
|
@ -24,6 +24,7 @@ import com.volmit.iris.util.Desc;
|
||||
import com.volmit.iris.util.DontObfuscate;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.RNG;
|
||||
import com.volmit.iris.util.RegistryListMythical;
|
||||
import com.volmit.iris.util.Required;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -41,11 +42,15 @@ import lombok.experimental.Accessors;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisEntity extends IrisRegistrant
|
||||
{
|
||||
|
||||
@Required
|
||||
@DontObfuscate
|
||||
@Desc("The type of entity to spawn")
|
||||
private EntityType type = EntityType.PIG;
|
||||
@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")
|
||||
@DontObfuscate
|
||||
private String mythicalType = "";
|
||||
|
||||
@DontObfuscate
|
||||
@Desc("The custom name of this entity")
|
||||
@ -136,7 +141,7 @@ public class IrisEntity extends IrisRegistrant
|
||||
|
||||
public Entity spawn(ParallaxTerrainProvider gen, Location at, RNG rng)
|
||||
{
|
||||
Entity e = at.getWorld().spawnEntity(at, getType());
|
||||
Entity e = doSpawn(at);
|
||||
e.setCustomName(getCustomName() != null ? C.translateAlternateColorCodes('&', getCustomName()) : null);
|
||||
e.setCustomNameVisible(isCustomNameVisible());
|
||||
e.setGlowing(isGlowing());
|
||||
@ -259,4 +264,19 @@ public class IrisEntity extends IrisRegistrant
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
private Entity doSpawn(Location at)
|
||||
{
|
||||
if(isMythical())
|
||||
{
|
||||
return Iris.linkMythicMobs.spawn(getMythicalType(), at);
|
||||
}
|
||||
|
||||
return at.getWorld().spawnEntity(at, getType());
|
||||
}
|
||||
|
||||
public boolean isMythical()
|
||||
{
|
||||
return Iris.linkMythicMobs.supported() && !getMythicalType().trim().isEmpty();
|
||||
}
|
||||
}
|
||||
|
@ -490,6 +490,11 @@ public class B
|
||||
|
||||
public static boolean isAir(BlockData d)
|
||||
{
|
||||
if(d == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return d.getMaterial().equals(Material.AIR) || d.getMaterial().equals(Material.CAVE_AIR) || d.getMaterial().equals(Material.VOID_AIR);
|
||||
}
|
||||
}
|
||||
|
14
src/main/java/com/volmit/iris/util/RegistryListMythical.java
Normal file
14
src/main/java/com/volmit/iris/util/RegistryListMythical.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.*;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RUNTIME)
|
||||
@Target({PARAMETER, TYPE, FIELD})
|
||||
public @interface RegistryListMythical
|
||||
{
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user