mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-17 17:54:05 +00:00
Drop oraxen support
This commit is contained in:
parent
8090ba0259
commit
d315e99b63
@ -124,7 +124,6 @@ dependencies {
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.22'
|
||||
implementation 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
|
||||
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'
|
||||
|
||||
// Shaded
|
||||
|
@ -23,7 +23,6 @@ import com.volmit.iris.core.ServerConfigurator;
|
||||
import com.volmit.iris.core.link.IrisPapiExpansion;
|
||||
import com.volmit.iris.core.link.MultiverseCoreLink;
|
||||
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.nms.INMS;
|
||||
import com.volmit.iris.core.service.StudioSVC;
|
||||
@ -65,7 +64,6 @@ import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -95,7 +93,6 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
public static Iris instance;
|
||||
public static BukkitAudiences audiences;
|
||||
public static MultiverseCoreLink linkMultiverseCore;
|
||||
public static OraxenLink linkOraxen;
|
||||
public static MythicMobsLink linkMythicMobs;
|
||||
public static IrisCompat compat;
|
||||
public static FileWatcher configWatcher;
|
||||
@ -401,7 +398,6 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
instance = this;
|
||||
compat = IrisCompat.configured(getDataFile("compat.json"));
|
||||
linkMultiverseCore = new MultiverseCoreLink();
|
||||
linkOraxen = new OraxenLink();
|
||||
linkMythicMobs = new MythicMobsLink();
|
||||
configWatcher = new FileWatcher(getDataFile("settings.json"));
|
||||
services.values().forEach(IrisService::onEnable);
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
@ -462,10 +462,6 @@ public class B {
|
||||
BlockData bx = null;
|
||||
|
||||
if(!ix.startsWith("minecraft:")) {
|
||||
if(ix.startsWith("oraxen:") && Iris.linkOraxen.supported()) {
|
||||
bx = Iris.linkOraxen.getBlockDataFor(ix.split("\\Q:\\E")[1]);
|
||||
}
|
||||
|
||||
if(bx == null) {
|
||||
try {
|
||||
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 {
|
||||
bt.addAll(Iris.service(RegistrySVC.class).getCustomBlockRegistry().compile());
|
||||
} catch(Throwable e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user