Skip to content

Commit

Permalink
1.20 Baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
NextdoorPsycho committed Jun 7, 2023
1 parent f5a3a7e commit b0c96be
Show file tree
Hide file tree
Showing 8 changed files with 640 additions and 640 deletions.
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ plugins {
id "de.undercouch.download" version "5.0.1"
}

version '2.6.2-1.19.4'
def nmsVersion = "1.19.4" //[NMS]
def apiVersion = '1.19'
version '2.7.0-1.20.0'
def nmsVersion = "1.20" //[NMS]
def apiVersion = '1.20'
def specialSourceVersion = '1.11.0' //[NMS]
def spigotJarVersion = '1.19.4-R0.1-SNAPSHOT' //[NMS]
def spigotJarVersion = '1.20-R0.1-SNAPSHOT' //[NMS]
def name = getRootProject().getName() // Defined in settings.gradle
def main = 'com.volmit.iris.Iris'

Expand Down Expand Up @@ -129,8 +129,8 @@ dependencies {
// Provided or Classpath
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
implementation 'org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT'
implementation 'org.bukkit:craftbukkit:1.19.4-R0.1-SNAPSHOT:remapped-mojang' //[NMS]
implementation 'org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT'
implementation 'org.bukkit:craftbukkit:1.20-R0.1-SNAPSHOT:remapped-mojang' //[NMS]

// Third Party Integrations
implementation 'com.github.oraxen:oraxen:1.152.5'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/volmit/iris/Iris.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.volmit.iris.core.link.MythicMobsLink;
import com.volmit.iris.core.loader.IrisData;
import com.volmit.iris.core.nms.INMS;
import com.volmit.iris.core.nms.v19_4.NMSBinding19_4;
import com.volmit.iris.core.nms.v20.NMSBinding19_4;
import com.volmit.iris.core.pregenerator.LazyPregenerator;
import com.volmit.iris.core.service.StudioSVC;
import com.volmit.iris.core.tools.IrisToolbelt;
Expand Down
154 changes: 77 additions & 77 deletions src/main/java/com/volmit/iris/core/nms/INMS.java
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
/*
* 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.nms;

import com.volmit.iris.Iris;
import com.volmit.iris.core.IrisSettings;
import com.volmit.iris.core.nms.v19_4.NMSBinding19_4;
import com.volmit.iris.core.nms.v1X.NMSBinding1X;
import com.volmit.iris.util.collection.KMap;
import org.bukkit.Bukkit;

public class INMS {
//@builder
private static final KMap<String, Class<? extends INMSBinding>> bindings = new KMap<String, Class<? extends INMSBinding>>()
.qput("v1_19_R3", NMSBinding19_4.class);
//@done
private static final INMSBinding binding = bind();

public static INMSBinding get() {
return binding;
}

public static String getNMSTag() {
if (IrisSettings.get().getGeneral().isDisableNMS()) {
return "BUKKIT";
}

try {
return Bukkit.getServer().getClass().getCanonicalName().split("\\Q.\\E")[3];
} catch (Throwable e) {
Iris.reportError(e);
Iris.error("Failed to determine server nms version!");
e.printStackTrace();
}

return "BUKKIT";
}

private static INMSBinding bind() {
String code = getNMSTag();
Iris.info("Locating NMS Binding for " + code);

if (bindings.containsKey(code)) {
try {
INMSBinding b = bindings.get(code).getConstructor().newInstance();
Iris.info("Craftbukkit " + code + " <-> " + b.getClass().getSimpleName() + " Successfully Bound");

return b;
} catch (Throwable e) {
Iris.reportError(e);
e.printStackTrace();
}
}

Iris.info("Craftbukkit " + code + " <-> " + NMSBinding1X.class.getSimpleName() + " Successfully Bound");
Iris.warn("Note: Some features of Iris may not work the same since you are on an unsupported version of Minecraft.");
Iris.warn("Note: If this is a new version, expect an update soon.");

return new NMSBinding1X();
}
}
/*
* 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.nms;

import com.volmit.iris.Iris;
import com.volmit.iris.core.IrisSettings;
import com.volmit.iris.core.nms.v20.NMSBinding19_4;
import com.volmit.iris.core.nms.v1X.NMSBinding1X;
import com.volmit.iris.util.collection.KMap;
import org.bukkit.Bukkit;

public class INMS {
//@builder
private static final KMap<String, Class<? extends INMSBinding>> bindings = new KMap<String, Class<? extends INMSBinding>>()
.qput("v1_19_R3", NMSBinding19_4.class);
//@done
private static final INMSBinding binding = bind();

public static INMSBinding get() {
return binding;
}

public static String getNMSTag() {
if (IrisSettings.get().getGeneral().isDisableNMS()) {
return "BUKKIT";
}

try {
return Bukkit.getServer().getClass().getCanonicalName().split("\\Q.\\E")[3];
} catch (Throwable e) {
Iris.reportError(e);
Iris.error("Failed to determine server nms version!");
e.printStackTrace();
}

return "BUKKIT";
}

private static INMSBinding bind() {
String code = getNMSTag();
Iris.info("Locating NMS Binding for " + code);

if (bindings.containsKey(code)) {
try {
INMSBinding b = bindings.get(code).getConstructor().newInstance();
Iris.info("Craftbukkit " + code + " <-> " + b.getClass().getSimpleName() + " Successfully Bound");

return b;
} catch (Throwable e) {
Iris.reportError(e);
e.printStackTrace();
}
}

Iris.info("Craftbukkit " + code + " <-> " + NMSBinding1X.class.getSimpleName() + " Successfully Bound");
Iris.warn("Note: Some features of Iris may not work the same since you are on an unsupported version of Minecraft.");
Iris.warn("Note: If this is a new version, expect an update soon.");

return new NMSBinding1X();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.volmit.iris.core.nms.v19_4;
package com.volmit.iris.core.nms.v20;

import com.mojang.serialization.Codec;
import com.volmit.iris.Iris;
Expand All @@ -18,10 +18,9 @@
import net.minecraft.world.level.biome.Climate;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_19_R3.CraftServer;
import org.bukkit.craftbukkit.v1_19_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_19_R3.block.CraftBlock;

import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
import org.bukkit.craftbukkit.v1_20_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_20_R1.block.CraftBlock;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
Expand Down
Loading

0 comments on commit b0c96be

Please sign in to comment.