mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
commit
5b3918fcb1
@ -124,7 +124,6 @@ dependencies {
|
|||||||
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
||||||
implementation 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
|
implementation 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
|
||||||
implementation 'me.clip:placeholderapi:2.11.1'
|
implementation 'me.clip:placeholderapi:2.11.1'
|
||||||
implementation 'io.th0rgal:oraxen:1.94.0'
|
|
||||||
implementation 'org.bukkit:craftbukkit:1.18.2-R0.1-SNAPSHOT:remapped-mojang'
|
implementation 'org.bukkit:craftbukkit:1.18.2-R0.1-SNAPSHOT:remapped-mojang'
|
||||||
|
|
||||||
// Shaded
|
// Shaded
|
||||||
|
@ -23,7 +23,6 @@ import com.volmit.iris.core.ServerConfigurator;
|
|||||||
import com.volmit.iris.core.link.IrisPapiExpansion;
|
import com.volmit.iris.core.link.IrisPapiExpansion;
|
||||||
import com.volmit.iris.core.link.MultiverseCoreLink;
|
import com.volmit.iris.core.link.MultiverseCoreLink;
|
||||||
import com.volmit.iris.core.link.MythicMobsLink;
|
import com.volmit.iris.core.link.MythicMobsLink;
|
||||||
import com.volmit.iris.core.link.OraxenLink;
|
|
||||||
import com.volmit.iris.core.loader.IrisData;
|
import com.volmit.iris.core.loader.IrisData;
|
||||||
import com.volmit.iris.core.nms.INMS;
|
import com.volmit.iris.core.nms.INMS;
|
||||||
import com.volmit.iris.core.service.StudioSVC;
|
import com.volmit.iris.core.service.StudioSVC;
|
||||||
@ -65,7 +64,6 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.WorldCreator;
|
import org.bukkit.WorldCreator;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.configuration.InvalidConfigurationException;
|
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -95,7 +93,6 @@ public class Iris extends VolmitPlugin implements Listener {
|
|||||||
public static Iris instance;
|
public static Iris instance;
|
||||||
public static BukkitAudiences audiences;
|
public static BukkitAudiences audiences;
|
||||||
public static MultiverseCoreLink linkMultiverseCore;
|
public static MultiverseCoreLink linkMultiverseCore;
|
||||||
public static OraxenLink linkOraxen;
|
|
||||||
public static MythicMobsLink linkMythicMobs;
|
public static MythicMobsLink linkMythicMobs;
|
||||||
public static IrisCompat compat;
|
public static IrisCompat compat;
|
||||||
public static FileWatcher configWatcher;
|
public static FileWatcher configWatcher;
|
||||||
@ -401,7 +398,6 @@ public class Iris extends VolmitPlugin implements Listener {
|
|||||||
instance = this;
|
instance = this;
|
||||||
compat = IrisCompat.configured(getDataFile("compat.json"));
|
compat = IrisCompat.configured(getDataFile("compat.json"));
|
||||||
linkMultiverseCore = new MultiverseCoreLink();
|
linkMultiverseCore = new MultiverseCoreLink();
|
||||||
linkOraxen = new OraxenLink();
|
|
||||||
linkMythicMobs = new MythicMobsLink();
|
linkMythicMobs = new MythicMobsLink();
|
||||||
configWatcher = new FileWatcher(getDataFile("settings.json"));
|
configWatcher = new FileWatcher(getDataFile("settings.json"));
|
||||||
services.values().forEach(IrisService::onEnable);
|
services.values().forEach(IrisService::onEnable);
|
||||||
|
@ -327,7 +327,11 @@ public class CommandObject implements DecreeExecutor {
|
|||||||
|
|
||||||
Map<Block, BlockData> futureChanges = new HashMap<>();
|
Map<Block, BlockData> futureChanges = new HashMap<>();
|
||||||
|
|
||||||
o = o.scaled(scale, IrisObjectPlacementScaleInterpolator.TRICUBIC);
|
if(scale != 1)
|
||||||
|
{
|
||||||
|
o = o.scaled(scale, IrisObjectPlacementScaleInterpolator.TRICUBIC);
|
||||||
|
}
|
||||||
|
|
||||||
o.place(block.getBlockX(), block.getBlockY() + (int) o.getCenter().getY(), block.getBlockZ(), createPlacer(block.getWorld(), futureChanges), placement, new RNG(), null);
|
o.place(block.getBlockX(), block.getBlockY() + (int) o.getCenter().getY(), block.getBlockZ(), createPlacer(block.getWorld(), futureChanges), placement, new RNG(), null);
|
||||||
|
|
||||||
Iris.service(ObjectSVC.class).addChanges(futureChanges);
|
Iris.service(ObjectSVC.class).addChanges(futureChanges);
|
||||||
|
@ -1,113 +0,0 @@
|
|||||||
/*
|
|
||||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
|
||||||
* Copyright (c) 2022 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.core.link;
|
|
||||||
|
|
||||||
import com.volmit.iris.util.collection.KList;
|
|
||||||
import io.th0rgal.oraxen.items.OraxenItems;
|
|
||||||
import io.th0rgal.oraxen.mechanics.Mechanic;
|
|
||||||
import io.th0rgal.oraxen.mechanics.MechanicFactory;
|
|
||||||
import io.th0rgal.oraxen.mechanics.MechanicsManager;
|
|
||||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.block.BlockMechanic;
|
|
||||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.block.BlockMechanicFactory;
|
|
||||||
import io.th0rgal.oraxen.mechanics.provided.gameplay.noteblock.NoteBlockMechanicFactory;
|
|
||||||
import io.th0rgal.oraxen.utils.Utils;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.data.BlockData;
|
|
||||||
import org.bukkit.block.data.MultipleFacing;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class OraxenLink {
|
|
||||||
private static final String[] EMPTY = new String[0];
|
|
||||||
|
|
||||||
public boolean supported() {
|
|
||||||
return getOraxen() != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockData getBlockDataFor(String id) {
|
|
||||||
if(!supported()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
MechanicFactory f = getFactory(id);
|
|
||||||
|
|
||||||
if(f == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Mechanic m = f.getMechanic(id);
|
|
||||||
|
|
||||||
// TODO: Why isnt there a simple getBlockData() function?
|
|
||||||
if(m.getFactory() instanceof NoteBlockMechanicFactory) {
|
|
||||||
return ((NoteBlockMechanicFactory) m.getFactory()).createNoteBlockData(id);
|
|
||||||
} else if(m.getFactory() instanceof BlockMechanicFactory) {
|
|
||||||
MultipleFacing newBlockData = (MultipleFacing) Bukkit.createBlockData(Material.MUSHROOM_STEM);
|
|
||||||
Utils.setBlockFacing(newBlockData, ((BlockMechanic) m).getCustomVariation());
|
|
||||||
return newBlockData;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MechanicFactory getFactory(String id) {
|
|
||||||
if(!supported()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
Field f = MechanicsManager.class.getDeclaredField("FACTORIES_BY_MECHANIC_ID");
|
|
||||||
f.setAccessible(true);
|
|
||||||
Map<String, MechanicFactory> map = (Map<String, MechanicFactory>) f.get(null);
|
|
||||||
|
|
||||||
for(MechanicFactory i : map.values()) {
|
|
||||||
if(i.getItems().contains(id)) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch(Throwable e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getItemTypes() {
|
|
||||||
if(!supported()) {
|
|
||||||
return EMPTY;
|
|
||||||
}
|
|
||||||
|
|
||||||
KList<String> v = new KList<>();
|
|
||||||
|
|
||||||
for(String i : OraxenItems.getItemNames()) {
|
|
||||||
if(getBlockDataFor(i) != null) {
|
|
||||||
v.add(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return v.toArray(new String[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Plugin getOraxen() {
|
|
||||||
|
|
||||||
return Bukkit.getPluginManager().getPlugin("Oraxen");
|
|
||||||
}
|
|
||||||
}
|
|
@ -336,8 +336,7 @@ public class IrisComplex implements DataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private double getHeight(Engine engine, IrisBiome b, double x, double z, long seed) {
|
private double getHeight(Engine engine, IrisBiome b, double x, double z, long seed) {
|
||||||
return Math.min(engine.getWorld().maxHeight(),
|
return Math.max(Math.min(getInterpolatedHeight(engine, x, z, seed) + fluidHeight + overlayStream.get(x, z), engine.getHeight()), 0);
|
||||||
Math.max(getInterpolatedHeight(engine, x, z, seed) + fluidHeight + overlayStream.get(x, z), engine.getWorld().minHeight()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerGenerator(IrisGenerator cachedGenerator) {
|
private void registerGenerator(IrisGenerator cachedGenerator) {
|
||||||
|
@ -462,10 +462,6 @@ public class B {
|
|||||||
BlockData bx = null;
|
BlockData bx = null;
|
||||||
|
|
||||||
if(!ix.startsWith("minecraft:")) {
|
if(!ix.startsWith("minecraft:")) {
|
||||||
if(ix.startsWith("oraxen:") && Iris.linkOraxen.supported()) {
|
|
||||||
bx = Iris.linkOraxen.getBlockDataFor(ix.split("\\Q:\\E")[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(bx == null) {
|
if(bx == null) {
|
||||||
try {
|
try {
|
||||||
if(ix.contains(":")) {
|
if(ix.contains(":")) {
|
||||||
@ -652,14 +648,6 @@ public class B {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
for(String i : Iris.linkOraxen.getItemTypes()) {
|
|
||||||
bt.add("oraxen:" + i);
|
|
||||||
}
|
|
||||||
} catch(Throwable e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
bt.addAll(Iris.service(RegistrySVC.class).getCustomBlockRegistry().compile());
|
bt.addAll(Iris.service(RegistrySVC.class).getCustomBlockRegistry().compile());
|
||||||
} catch(Throwable e) {
|
} catch(Throwable e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user