Merge pull request #769 from VolmitSoftware/Development

Updated PAPI Support
Temp Disabled Oraxen Support
Temp Disabled Ascync Tp
updated NMS (Colors and binds etc...)
Fixed my registry oopsie (thx Vatuu)
removed Debug Prints
/iris Height works now
Colors Fixed
This commit is contained in:
Brian Fopiano 2022-03-27 13:51:27 -07:00 committed by GitHub
commit 7ddc621009
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 64 additions and 48 deletions

View File

@ -25,10 +25,10 @@ plugins {
} }
group 'com.volmit.iris' group 'com.volmit.iris'
version '2.0.2-1.18.X' version '2.0.3-1.18.2' // Needs to be version specific
def nmsVersion = "1.18.1" def nmsVersion = "1.18.2"
def apiVersion = '1.18' def apiVersion = '1.18'
def spigotJarVersion = '1.18.1-R0.1-SNAPSHOT' def spigotJarVersion = '1.18.2-R0.1-SNAPSHOT'
def name = getRootProject().getName() // Defined in settings.gradle def name = getRootProject().getName() // Defined in settings.gradle
def main = 'com.volmit.iris.Iris' def main = 'com.volmit.iris.Iris'
@ -39,7 +39,7 @@ registerCustomOutputTask('Psycho', 'D://Dan/MinecraftDevelopment/server/plugins'
registerCustomOutputTask('ArcaneArts', 'C://Users/arcane/Documents/development/server/plugins') registerCustomOutputTask('ArcaneArts', 'C://Users/arcane/Documents/development/server/plugins')
registerCustomOutputTask('Coco', 'D://Documents/MC/plugins') registerCustomOutputTask('Coco', 'D://Documents/MC/plugins')
registerCustomOutputTask('Strange', 'D://Servers/1.17 Test Server/plugins') registerCustomOutputTask('Strange', 'D://Servers/1.17 Test Server/plugins')
registerCustomOutputTask('Vatuu', 'D://Minecraft/Servers/1.18.1/plugins') registerCustomOutputTask('Vatuu', 'D://Minecraft/Servers/1.18.2/plugins')
// ========================== UNIX ============================== // ========================== UNIX ==============================
registerCustomOutputTaskUnix('CyberpwnLT', '/Users/danielmills/Documents/development/server/plugins') registerCustomOutputTaskUnix('CyberpwnLT', '/Users/danielmills/Documents/development/server/plugins')
registerCustomOutputTaskUnix('PsychoLT', '/Users/brianfopiano/Desktop/REMOTES/RemoteMinecraft/plugins') registerCustomOutputTaskUnix('PsychoLT', '/Users/brianfopiano/Desktop/REMOTES/RemoteMinecraft/plugins')
@ -123,10 +123,10 @@ dependencies {
// Provided or Classpath // Provided or Classpath
compileOnly 'org.projectlombok:lombok:1.18.22' compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22' annotationProcessor 'org.projectlombok:lombok:1.18.22'
implementation 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT' implementation 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
implementation 'me.clip:placeholderapi:2.10.10' implementation 'me.clip:placeholderapi:2.11.1'
implementation 'io.th0rgal:oraxen:1.94.0' implementation 'io.th0rgal:oraxen:1.94.0'
implementation 'org.bukkit:craftbukkit:1.18.1-R0.1-SNAPSHOT:remapped-mojang' implementation 'org.bukkit:craftbukkit:1.18.2-R0.1-SNAPSHOT:remapped-mojang'
// Shaded // Shaded
implementation 'com.dfsek:Paralithic:0.4.0' implementation 'com.dfsek:Paralithic:0.4.0'

View File

@ -101,7 +101,7 @@ public class CommandIris implements DecreeExecutor {
sender().sendMessage(C.GREEN + "Iris v" + Iris.instance.getDescription().getVersion() + " by Volmit Software"); sender().sendMessage(C.GREEN + "Iris v" + Iris.instance.getDescription().getVersion() + " by Volmit Software");
} }
@Decree(description = "Print version information", origin = DecreeOrigin.PLAYER) @Decree(description = "Print world height information", origin = DecreeOrigin.PLAYER)
public void height() { public void height() {
sender().sendMessage(C.GREEN + "" + sender().player().getWorld().getMinHeight() + " to " + sender().player().getWorld().getMaxHeight()); sender().sendMessage(C.GREEN + "" + sender().player().getWorld().getMinHeight() + " to " + sender().player().getWorld().getMaxHeight());
sender().sendMessage(C.GREEN + "Total Height: " + (sender().player().getWorld().getMaxHeight() - sender().player().getWorld().getMinHeight())); sender().sendMessage(C.GREEN + "Total Height: " + (sender().player().getWorld().getMaxHeight() - sender().player().getWorld().getMinHeight()));

View File

@ -20,7 +20,7 @@ package com.volmit.iris.core.nms;
import com.volmit.iris.Iris; import com.volmit.iris.Iris;
import com.volmit.iris.core.IrisSettings; import com.volmit.iris.core.IrisSettings;
import com.volmit.iris.core.nms.v18_1.NMSBinding18_1; import com.volmit.iris.core.nms.v18_2.NMSBinding18_2;
import com.volmit.iris.core.nms.v1X.NMSBinding1X; import com.volmit.iris.core.nms.v1X.NMSBinding1X;
import com.volmit.iris.util.collection.KMap; import com.volmit.iris.util.collection.KMap;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -28,7 +28,7 @@ import org.bukkit.Bukkit;
public class INMS { public class INMS {
//@builder //@builder
private static final KMap<String, Class<? extends INMSBinding>> bindings = new KMap<String, Class<? extends INMSBinding>>() private static final KMap<String, Class<? extends INMSBinding>> bindings = new KMap<String, Class<? extends INMSBinding>>()
.qput("v1_18_R1", NMSBinding18_1.class); .qput("v1_18_R2", NMSBinding18_2.class);
//@done //@done
private static final INMSBinding binding = bind(); private static final INMSBinding binding = bind();

View File

@ -54,6 +54,7 @@ public interface INMSBinding {
String getTrueBiomeBaseKey(Location location); String getTrueBiomeBaseKey(Location location);
Object getCustomBiomeBaseFor(String mckey); Object getCustomBiomeBaseFor(String mckey);
Object getCustomBiomeBaseHolderFor(String mckey);
String getKeyForBiomeBase(Object biomeBase); String getKeyForBiomeBase(Object biomeBase);

View File

@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public enum NMSVersion { public enum NMSVersion {
R1_18_2,
R1_18, R1_18,
R1_17, R1_17,
R1_16, R1_16,
@ -98,6 +99,9 @@ public enum NMSVersion {
if(tryVersion("1_18_R1")) { if(tryVersion("1_18_R1")) {
return R1_18; return R1_18;
} }
if(tryVersion("1_18_R2")) {
return R1_18_2;
}
return null; return null;
} }

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
package com.volmit.iris.core.nms.v18_1; package com.volmit.iris.core.nms.v18_2;
import com.volmit.iris.Iris; import com.volmit.iris.Iris;
@ -36,10 +36,7 @@ import com.volmit.iris.util.nbt.mca.palette.MCAPalettedContainer;
import com.volmit.iris.util.nbt.mca.palette.MCAWrappedPalettedContainer; import com.volmit.iris.util.nbt.mca.palette.MCAWrappedPalettedContainer;
import com.volmit.iris.util.nbt.tag.CompoundTag; import com.volmit.iris.util.nbt.tag.CompoundTag;
import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2IntMap;
import net.minecraft.core.BlockPos; import net.minecraft.core.*;
import net.minecraft.core.IdMap;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.nbt.NbtIo; import net.minecraft.nbt.NbtIo;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
@ -52,9 +49,10 @@ import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.BlockData;
import org.bukkit.craftbukkit.v1_18_R1.CraftServer;
import org.bukkit.craftbukkit.v1_18_R1.CraftWorld; import org.bukkit.craftbukkit.v1_18_R2.CraftServer;
import org.bukkit.craftbukkit.v1_18_R1.block.data.CraftBlockData; import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.generator.ChunkGenerator; import org.bukkit.generator.ChunkGenerator;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -70,7 +68,7 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
public class NMSBinding18_1 implements INMSBinding { public class NMSBinding18_2 implements INMSBinding {
private final KMap<Biome, Object> baseBiomeCache = new KMap<>(); private final KMap<Biome, Object> baseBiomeCache = new KMap<>();
private final BlockData AIR = Material.AIR.createBlockData(); private final BlockData AIR = Material.AIR.createBlockData();
@ -148,7 +146,7 @@ public class NMSBinding18_1 implements INMSBinding {
} }
private RegistryAccess registry() { private RegistryAccess registry() {
return registryAccess.aquire(() -> (RegistryAccess) getFor(RegistryAccess.class, ((CraftServer) Bukkit.getServer()).getHandle().getServer())); return registryAccess.aquire(() -> (RegistryAccess) getFor(RegistryAccess.Frozen.class, ((CraftServer) Bukkit.getServer()).getHandle().getServer()));
} }
private Registry<net.minecraft.world.level.biome.Biome> getCustomBiomeRegistry() { private Registry<net.minecraft.world.level.biome.Biome> getCustomBiomeRegistry() {
@ -210,6 +208,10 @@ public class NMSBinding18_1 implements INMSBinding {
public Object getCustomBiomeBaseFor(String mckey) { public Object getCustomBiomeBaseFor(String mckey) {
return getCustomBiomeRegistry().get(new ResourceLocation(mckey)); return getCustomBiomeRegistry().get(new ResourceLocation(mckey));
} }
@Override
public Object getCustomBiomeBaseHolderFor(String mckey) {
return getCustomBiomeRegistry().getHolder(getTrueBiomeBaseId(getCustomBiomeRegistry().get(new ResourceLocation(mckey)))).get();
}
@Override @Override
public String getKeyForBiomeBase(Object biomeBase) { public String getKeyForBiomeBase(Object biomeBase) {
@ -229,13 +231,13 @@ public class NMSBinding18_1 implements INMSBinding {
return v; return v;
} }
//noinspection unchecked //noinspection unchecked
v = org.bukkit.craftbukkit.v1_18_R1.block.CraftBlock.biomeToBiomeBase((Registry<net.minecraft.world.level.biome.Biome>) registry, biome); v = org.bukkit.craftbukkit.v1_18_R2.block.CraftBlock.biomeToBiomeBase((Registry<net.minecraft.world.level.biome.Biome>) registry, biome);
if(v == null) { if(v == null) {
// Ok so there is this new biome name called "CUSTOM" in Paper's new releases. // Ok so there is this new biome name called "CUSTOM" in Paper's new releases.
// But, this does NOT exist within CraftBukkit which makes it return an error. // But, this does NOT exist within CraftBukkit which makes it return an error.
// So, we will just return the ID that the plains biome returns instead. // So, we will just return the ID that the plains biome returns instead.
//noinspection unchecked //noinspection unchecked
return org.bukkit.craftbukkit.v1_18_R1.block.CraftBlock.biomeToBiomeBase((Registry<net.minecraft.world.level.biome.Biome>) registry, Biome.PLAINS); return org.bukkit.craftbukkit.v1_18_R2.block.CraftBlock.biomeToBiomeBase((Registry<net.minecraft.world.level.biome.Biome>) registry, Biome.PLAINS);
} }
baseBiomeCache.put(biome, v); baseBiomeCache.put(biome, v);
return v; return v;
@ -334,7 +336,7 @@ public class NMSBinding18_1 implements INMSBinding {
public void forceBiomeInto(int x, int y, int z, Object somethingVeryDirty, ChunkGenerator.BiomeGrid chunk) { public void forceBiomeInto(int x, int y, int z, Object somethingVeryDirty, ChunkGenerator.BiomeGrid chunk) {
try { try {
ChunkAccess s = (ChunkAccess) getFieldForBiomeStorage(chunk).get(chunk); ChunkAccess s = (ChunkAccess) getFieldForBiomeStorage(chunk).get(chunk);
s.setBiome(x, y, z, (net.minecraft.world.level.biome.Biome) somethingVeryDirty); s.setBiome(x, y, z, (Holder<net.minecraft.world.level.biome.Biome>) somethingVeryDirty); // probably not safe? it said it wanted a holder, so i made it a holder...
} catch(IllegalAccessException e) { } catch(IllegalAccessException e) {
Iris.reportError(e); Iris.reportError(e);
e.printStackTrace(); e.printStackTrace();

View File

@ -112,6 +112,11 @@ public class NMSBinding1X implements INMSBinding {
return null; return null;
} }
@Override
public Object getCustomBiomeBaseHolderFor(String mckey) {
return null;
}
@Override @Override
public String getKeyForBiomeBase(Object biomeBase) { public String getKeyForBiomeBase(Object biomeBase) {
return null; return null;

View File

@ -57,7 +57,7 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome> {
return true; return true;
} }
} catch(Throwable e) { } catch(Throwable e) {
e.printStackTrace();
} }
return false; return false;
@ -79,7 +79,7 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome> {
if(ib.isCustom()) { if(ib.isCustom()) {
try { try {
IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z); IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z);
Object biomeBase = INMS.get().getCustomBiomeBaseFor(getDimension().getLoadKey() + ":" + custom.getId()); Object biomeBase = INMS.get().getCustomBiomeBaseHolderFor(getDimension().getLoadKey() + ":" + custom.getId());
// //
if(biomeBase == null || !injectBiome(h, x, 0, z, biomeBase)) { if(biomeBase == null || !injectBiome(h, x, 0, z, biomeBase)) {
throw new RuntimeException("Cant inject biome!"); throw new RuntimeException("Cant inject biome!");

View File

@ -18,6 +18,7 @@
package com.volmit.iris.engine.data.chunk; package com.volmit.iris.engine.data.chunk;
import com.volmit.iris.Iris;
import com.volmit.iris.core.nms.BiomeBaseInjector; import com.volmit.iris.core.nms.BiomeBaseInjector;
import com.volmit.iris.core.nms.INMS; import com.volmit.iris.core.nms.INMS;
import com.volmit.iris.util.data.IrisBiomeStorage; import com.volmit.iris.util.data.IrisBiomeStorage;

View File

@ -69,24 +69,31 @@ public abstract class EngineAssignedWorldManager extends EngineAssignedComponent
protected AtomicBoolean ignoreTP = new AtomicBoolean(false); protected AtomicBoolean ignoreTP = new AtomicBoolean(false);
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) // @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void on(PlayerTeleportEvent e) { // public void on(PlayerTeleportEvent e) {
if(ignoreTP.get()) { // if(ignoreTP.get()) {
return; // System.out.println("IgTP1");
} // return;
// }
if(!PaperLib.isPaper() || e.getTo() == null) { //
return; // if(!PaperLib.isPaper() || e.getTo() == null) {
} // System.out.println("IgTP2");
//
try { //// return;
if(e.getTo().getWorld().equals(getTarget().getWorld().realWorld())) { // }
getEngine().getWorldManager().teleportAsync(e); //
} //// try {
} catch(Throwable ex) { //// System.out.println("IgTP3");
////
} //// if(e.getTo().getWorld().equals(getTarget().getWorld().realWorld())) {
} //// System.out.println("IgTP4");
////
//// getEngine().getWorldManager().teleportAsync(e);
//// }
//// } catch(Throwable ex) {
////
//// }
// }
@EventHandler @EventHandler
public void on(WorldSaveEvent e) { public void on(WorldSaveEvent e) {

View File

@ -35,19 +35,16 @@ import com.volmit.iris.util.format.C;
import com.volmit.iris.util.format.Form; import com.volmit.iris.util.format.Form;
import com.volmit.iris.util.json.JSONObject; import com.volmit.iris.util.json.JSONObject;
import com.volmit.iris.util.math.RNG; import com.volmit.iris.util.math.RNG;
import com.volmit.iris.util.nbt.io.NBTUtil;
import com.volmit.iris.util.noise.CNG; import com.volmit.iris.util.noise.CNG;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.nbt.TagParser; import net.minecraft.nbt.TagParser;
import net.minecraft.server.commands.GiveCommand;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemStack; import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack;
import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable; import org.bukkit.inventory.meta.Damageable;
@ -277,7 +274,6 @@ public class IrisLoot {
CompoundTag tag = TagParser.parseTag(new JSONObject(customNbt).toString()); CompoundTag tag = TagParser.parseTag(new JSONObject(customNbt).toString());
tag.merge(s.getOrCreateTag()); tag.merge(s.getOrCreateTag());
s.setTag(tag); s.setTag(tag);
System.out.println(customNbt);
return CraftItemStack.asBukkitCopy(s); return CraftItemStack.asBukkitCopy(s);
} }
} }