From 46a821e079e42f8a10ce9902fb1cafc5301a5328 Mon Sep 17 00:00:00 2001 From: Ivan Mishin Date: Sat, 6 Jul 2024 22:20:09 +0200 Subject: [PATCH 01/12] Updated Galactifun.java --- .../addoncommunity/galactifun/Galactifun.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java b/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java index 4620bf8a..ff097647 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java +++ b/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java @@ -35,7 +35,7 @@ import io.github.mooy1.infinitylib.metrics.bukkit.Metrics; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.BlobBuildUpdater; +//import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.BlobBuildUpdater; import io.github.thebusybiscuit.slimefun4.libraries.paperlib.PaperLib; @@ -53,11 +53,11 @@ public final class Galactifun extends AbstractAddon { private boolean shouldDisable = false; public Galactifun() { - super("Slimefun-Addon-Community", "Galactifun", "master", "auto-update"); + super("IvanMishin1", "ME-Galactifun", "master", "auto-update"); } public Galactifun(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) { - super(loader, description, dataFolder, file, "Slimefun-Addon-Community", "Galactifun", "master", "auto-update"); + super(loader, description, dataFolder, file, "IvanMishin1", "ME-Galactifun", "master", "auto-update"); isTest = true; } @@ -109,7 +109,9 @@ protected void enable() { new Metrics(this, 11613); if (!isTest && this.getConfig().getBoolean("auto-update") && !getPluginVersion().contains("MODIFIED")) { - new BlobBuildUpdater(this, this.getFile(), "Galactifun").start(); + // Disabled auto-updater for now + // new BlobBuildUpdater(this, this.getFile(), "Galactifun").start(); + log(Level.WARNING, "Auto-update is disabled on this fork of Galactifun"); } this.alienManager = new AlienManager(this); @@ -126,8 +128,9 @@ protected void enable() { // log after startup Scheduler.run(() -> log(Level.INFO, - "################# Galactifun " + getPluginVersion() + " #################", + "################# ME-Galactifun " + getPluginVersion() + " #################", "", + "This is a fork of Galactifun made by IvanMishin1 for Mega-Earth", "Galactifun is open source, you can contribute or report bugs at: ", getBugTrackerURL(), "Join the Slimefun Addon Community Discord: discord.gg/SqD3gg5SAU", From cb632bde4d5059cef937c302e0c3feb8813f293d Mon Sep 17 00:00:00 2001 From: Ivan Mishin Date: Tue, 9 Jul 2024 19:37:19 +0200 Subject: [PATCH 02/12] Fixed nether portals --- .gitignore | 1 + README.md | 16 +++++++----- .../core/managers/WorldManager.java | 25 +++++++++++++++++++ src/main/resources/config.yml | 3 +++ 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 2802857e..087cdcb9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,6 @@ .classpath .DS_Store .gradle/ +gradle/ build/ run/ diff --git a/README.md b/README.md index a74fc5b4..bf20713f 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,21 @@ -# Galactifun +# ME-Galactifun -A Slimefun addon which adds galaxies, star systems, planets, moons, rockets, and spacesuits. It has a large api for addon devs. +A fork of a Slimefun addon which adds galaxies, star systems, planets, moons, rockets, and spacesuits. It has a large api for addon devs. Inspiration taken from ClayTech and the mod GalactiCraft. ## Download -Download here (just click the badge!): +Download the original Galactifun plugin here (just click the badge!): [![Build Status](https://thebusybiscuit.github.io/builds/Slimefun-Addon-Community/Galactifun/master/badge.svg)](https://thebusybiscuit.github.io/builds/Slimefun-Addon-Community/Galactifun/master) -## Discord +## Build + +`./gradlew shadowJar` -Feel free to join us on the Slimefun Addon Community Discord: +## Discord -https://discord.gg/SqD3gg5SAU +Feel free to join us on our discord servers: +![](https://dcbadge.limes.pink/api/server/SqD3gg5SAU?style=flat&compact=true) +![](https://dcbadge.limes.pink/api/server/HFrgFk98mx?style=flat&compact=true) diff --git a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java index deac2126..af4c8e74 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java +++ b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java @@ -9,6 +9,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; import javax.annotation.Nonnull; @@ -46,7 +47,9 @@ import org.bukkit.event.player.PlayerGameModeChangeEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.event.world.PortalCreateEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.MetadataValue; @@ -74,9 +77,13 @@ import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public final class WorldManager implements Listener { private static final String PLACED = "placed"; + private static final Logger log = LoggerFactory.getLogger(WorldManager.class); @Getter private final int maxAliensPerPlayer; @@ -181,6 +188,24 @@ public Collection alienWorlds() { return Collections.unmodifiableCollection(this.alienWorlds.values()); } + @EventHandler(priority = EventPriority.MONITOR) + public void onPortalCreate(PortalCreateEvent e) { + if (!e.getWorld().getName().equals(Galactifun.instance().getConfig().getString("worlds.earth-name")) + && !e.getWorld().getName().equals(Galactifun.instance().getConfig().getString("worlds.nether-name"))) { + Objects.requireNonNull(e.getEntity()).sendMessage(ChatColor.RED + "You cannot create portals in this world!"); + e.setCancelled(true); + } + } + + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void portal(PlayerPortalEvent e){ + if (!e.getFrom().getWorld().getName().equals(Galactifun.instance().getConfig().getString("worlds.earth-name")) + && !e.getFrom().getWorld().getName().equals(Galactifun.instance().getConfig().getString("worlds.nether-name"))) { + e.getPlayer().sendMessage(ChatColor.RED + "You cannot use portals in this world!"); + e.setCancelled(true); + } + } + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlanetChange(@Nonnull PlayerChangedWorldEvent e) { AlienWorld object = getAlienWorld(e.getFrom()); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 98c3200d..cadf8dd4 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -7,6 +7,9 @@ worlds: # This should be the name main world where people work on stuff and make bases. earth-name: world + # The name of your world that is the Nether. + nether-name: world_nether + aliens: # How often aliens tick in Minecraft ticks - there are 20 ticks in 1 second From 647a316a7fe39e71ff9d00061da7b47c23d4f2a7 Mon Sep 17 00:00:00 2001 From: Ivan Mishin Date: Tue, 9 Jul 2024 20:12:13 +0200 Subject: [PATCH 03/12] Revert to Galactifun --- .gitignore | 1 - README.md | 16 ++++++---------- .../addoncommunity/galactifun/Galactifun.java | 15 ++++++--------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 087cdcb9..2802857e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,5 @@ .classpath .DS_Store .gradle/ -gradle/ build/ run/ diff --git a/README.md b/README.md index bf20713f..2936bfc3 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,17 @@ -# ME-Galactifun +# Galactifun -A fork of a Slimefun addon which adds galaxies, star systems, planets, moons, rockets, and spacesuits. It has a large api for addon devs. +A Slimefun addon which adds galaxies, star systems, planets, moons, rockets, and spacesuits. It has a large api for addon devs. Inspiration taken from ClayTech and the mod GalactiCraft. ## Download -Download the original Galactifun plugin here (just click the badge!): +Download here (just click the badge!): [![Build Status](https://thebusybiscuit.github.io/builds/Slimefun-Addon-Community/Galactifun/master/badge.svg)](https://thebusybiscuit.github.io/builds/Slimefun-Addon-Community/Galactifun/master) -## Build - -`./gradlew shadowJar` - ## Discord -Feel free to join us on our discord servers: -![](https://dcbadge.limes.pink/api/server/SqD3gg5SAU?style=flat&compact=true) -![](https://dcbadge.limes.pink/api/server/HFrgFk98mx?style=flat&compact=true) +Feel free to join us on the Slimefun Addon Community Discord: + +https://discord.gg/SqD3gg5SAU \ No newline at end of file diff --git a/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java b/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java index ff097647..61ff2a68 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java +++ b/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java @@ -35,7 +35,7 @@ import io.github.mooy1.infinitylib.metrics.bukkit.Metrics; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -//import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.BlobBuildUpdater; +import io.github.thebusybiscuit.slimefun4.libraries.dough.updater.BlobBuildUpdater; import io.github.thebusybiscuit.slimefun4.libraries.paperlib.PaperLib; @@ -53,11 +53,11 @@ public final class Galactifun extends AbstractAddon { private boolean shouldDisable = false; public Galactifun() { - super("IvanMishin1", "ME-Galactifun", "master", "auto-update"); + super("Slimefun-Addon-Community", "Galactifun", "master", "auto-update"); } public Galactifun(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) { - super(loader, description, dataFolder, file, "IvanMishin1", "ME-Galactifun", "master", "auto-update"); + super(loader, description, dataFolder, file, "Slimefun-Addon-Community", "Galactifun", "master", "auto-update"); isTest = true; } @@ -109,9 +109,7 @@ protected void enable() { new Metrics(this, 11613); if (!isTest && this.getConfig().getBoolean("auto-update") && !getPluginVersion().contains("MODIFIED")) { - // Disabled auto-updater for now - // new BlobBuildUpdater(this, this.getFile(), "Galactifun").start(); - log(Level.WARNING, "Auto-update is disabled on this fork of Galactifun"); + new BlobBuildUpdater(this, this.getFile(), "Galactifun").start(); } this.alienManager = new AlienManager(this); @@ -128,9 +126,8 @@ protected void enable() { // log after startup Scheduler.run(() -> log(Level.INFO, - "################# ME-Galactifun " + getPluginVersion() + " #################", + "################# Galactifun " + getPluginVersion() + " #################", "", - "This is a fork of Galactifun made by IvanMishin1 for Mega-Earth", "Galactifun is open source, you can contribute or report bugs at: ", getBugTrackerURL(), "Join the Slimefun Addon Community Discord: discord.gg/SqD3gg5SAU", @@ -179,4 +176,4 @@ public ChunkGenerator getDefaultWorldGenerator(@Nonnull String worldName, @Nulla return null; } -} +} \ No newline at end of file From 1101be6655c366f8e7acd590c0bcd84d2dfeb792 Mon Sep 17 00:00:00 2001 From: Ivan Mishin Date: Tue, 9 Jul 2024 20:19:28 +0200 Subject: [PATCH 04/12] Revert to Galactifun --- README.md | 2 +- .../java/io/github/addoncommunity/galactifun/Galactifun.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2936bfc3..3e8176d9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Inspiration taken from ClayTech and the mod GalactiCraft. ## Download -Download here (just click the badge!): +Download here (just click the badge!): [![Build Status](https://thebusybiscuit.github.io/builds/Slimefun-Addon-Community/Galactifun/master/badge.svg)](https://thebusybiscuit.github.io/builds/Slimefun-Addon-Community/Galactifun/master) diff --git a/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java b/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java index 61ff2a68..4620bf8a 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java +++ b/src/main/java/io/github/addoncommunity/galactifun/Galactifun.java @@ -176,4 +176,4 @@ public ChunkGenerator getDefaultWorldGenerator(@Nonnull String worldName, @Nulla return null; } -} \ No newline at end of file +} From ab1cfa38775027c8d1e584ebb8a0cbda17258abe Mon Sep 17 00:00:00 2001 From: Ivan Mishin Date: Tue, 9 Jul 2024 20:40:31 +0200 Subject: [PATCH 05/12] Fixed portals in another way --- README.md | 16 ++++++++++------ .../galactifun/core/managers/WorldManager.java | 8 ++------ src/main/resources/config.yml | 3 --- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3e8176d9..0c7d8747 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,21 @@ -# Galactifun +# ME-Galactifun -A Slimefun addon which adds galaxies, star systems, planets, moons, rockets, and spacesuits. It has a large api for addon devs. +A fork of a Slimefun addon which adds galaxies, star systems, planets, moons, rockets, and spacesuits. It has a large api for addon devs. Inspiration taken from ClayTech and the mod GalactiCraft. ## Download -Download here (just click the badge!): +Download the original Galactifun plugin here (just click the badge!): [![Build Status](https://thebusybiscuit.github.io/builds/Slimefun-Addon-Community/Galactifun/master/badge.svg)](https://thebusybiscuit.github.io/builds/Slimefun-Addon-Community/Galactifun/master) -## Discord +## Build + +`./gradlew shadowJar` -Feel free to join us on the Slimefun Addon Community Discord: +## Discord -https://discord.gg/SqD3gg5SAU \ No newline at end of file +Feel free to join us on our discord servers: +![](https://dcbadge.limes.pink/api/server/SqD3gg5SAU?style=flat&compact=true) +![](https://dcbadge.limes.pink/api/server/HFrgFk98mx?style=flat&compact=true) \ No newline at end of file diff --git a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java index af4c8e74..7f2c1f13 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java +++ b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java @@ -190,18 +190,14 @@ public Collection alienWorlds() { @EventHandler(priority = EventPriority.MONITOR) public void onPortalCreate(PortalCreateEvent e) { - if (!e.getWorld().getName().equals(Galactifun.instance().getConfig().getString("worlds.earth-name")) - && !e.getWorld().getName().equals(Galactifun.instance().getConfig().getString("worlds.nether-name"))) { - Objects.requireNonNull(e.getEntity()).sendMessage(ChatColor.RED + "You cannot create portals in this world!"); + if (e.getWorld().getName().contains("world_galactifun")) { e.setCancelled(true); } } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void portal(PlayerPortalEvent e){ - if (!e.getFrom().getWorld().getName().equals(Galactifun.instance().getConfig().getString("worlds.earth-name")) - && !e.getFrom().getWorld().getName().equals(Galactifun.instance().getConfig().getString("worlds.nether-name"))) { - e.getPlayer().sendMessage(ChatColor.RED + "You cannot use portals in this world!"); + if (e.getFrom().getWorld().getName().contains("world_galactifun")){ e.setCancelled(true); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index cadf8dd4..98c3200d 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -7,9 +7,6 @@ worlds: # This should be the name main world where people work on stuff and make bases. earth-name: world - # The name of your world that is the Nether. - nether-name: world_nether - aliens: # How often aliens tick in Minecraft ticks - there are 20 ticks in 1 second From 7d518e36bd9ce2ad1fbe4599d61eca09edd03ba2 Mon Sep 17 00:00:00 2001 From: Ivan Mishin Date: Tue, 9 Jul 2024 20:53:44 +0200 Subject: [PATCH 06/12] Reverted to Galactifun README.md --- README.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0c7d8747..2936bfc3 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,17 @@ -# ME-Galactifun +# Galactifun -A fork of a Slimefun addon which adds galaxies, star systems, planets, moons, rockets, and spacesuits. It has a large api for addon devs. +A Slimefun addon which adds galaxies, star systems, planets, moons, rockets, and spacesuits. It has a large api for addon devs. Inspiration taken from ClayTech and the mod GalactiCraft. ## Download -Download the original Galactifun plugin here (just click the badge!): +Download here (just click the badge!): [![Build Status](https://thebusybiscuit.github.io/builds/Slimefun-Addon-Community/Galactifun/master/badge.svg)](https://thebusybiscuit.github.io/builds/Slimefun-Addon-Community/Galactifun/master) -## Build - -`./gradlew shadowJar` - ## Discord -Feel free to join us on our discord servers: -![](https://dcbadge.limes.pink/api/server/SqD3gg5SAU?style=flat&compact=true) -![](https://dcbadge.limes.pink/api/server/HFrgFk98mx?style=flat&compact=true) \ No newline at end of file +Feel free to join us on the Slimefun Addon Community Discord: + +https://discord.gg/SqD3gg5SAU \ No newline at end of file From 4fe3daa3eec81f51d9373133bb51bc136b32500d Mon Sep 17 00:00:00 2001 From: Ivan Mishin Date: Tue, 9 Jul 2024 20:55:14 +0200 Subject: [PATCH 07/12] Git confuses me --- .../addoncommunity/galactifun/core/managers/WorldManager.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java index 7f2c1f13..564531b2 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java +++ b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java @@ -77,13 +77,9 @@ import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public final class WorldManager implements Listener { private static final String PLACED = "placed"; - private static final Logger log = LoggerFactory.getLogger(WorldManager.class); @Getter private final int maxAliensPerPlayer; From bd4a6db9e7fb69f54fc2827c7823cae7f4b31d1b Mon Sep 17 00:00:00 2001 From: Ivan Mishin Date: Tue, 9 Jul 2024 20:56:18 +0200 Subject: [PATCH 08/12] What? --- .../addoncommunity/galactifun/core/managers/WorldManager.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java index 564531b2..58b4a385 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java +++ b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java @@ -9,7 +9,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.UUID; import javax.annotation.Nonnull; From b5b259f4066aa19da73cf5a22100340ee16a57dc Mon Sep 17 00:00:00 2001 From: Ivan Mishin Date: Tue, 9 Jul 2024 21:48:20 +0200 Subject: [PATCH 09/12] Added allow-nether-portals in config.yml --- .../galactifun/core/managers/WorldManager.java | 8 ++++---- src/main/resources/config.yml | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java index 58b4a385..7e9f5db5 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java +++ b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java @@ -183,16 +183,16 @@ public Collection alienWorlds() { return Collections.unmodifiableCollection(this.alienWorlds.values()); } - @EventHandler(priority = EventPriority.MONITOR) + @EventHandler(priority = EventPriority.HIGHEST) public void onPortalCreate(PortalCreateEvent e) { - if (e.getWorld().getName().contains("world_galactifun")) { + if (!Galactifun.instance().getConfig().getBoolean("worlds.allow-nether-portals") && e.getWorld().getName().contains("world_galactifun")) { e.setCancelled(true); } } - @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void portal(PlayerPortalEvent e){ - if (e.getFrom().getWorld().getName().contains("world_galactifun")){ + if (!Galactifun.instance().getConfig().getBoolean("worlds.allow-nether-portals") && e.getFrom().getWorld().getName().contains("world_galactifun")){ e.setCancelled(true); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 98c3200d..8a0d2504 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -7,6 +7,9 @@ worlds: # This should be the name main world where people work on stuff and make bases. earth-name: world + # If set to true, players can use Nether portals in Galactifun planet worlds. + allow-nether-portals: false + aliens: # How often aliens tick in Minecraft ticks - there are 20 ticks in 1 second From e6e8af8ecc0fbc4d47a10bc5db747721b3fa7418 Mon Sep 17 00:00:00 2001 From: Ivan Mishin <88932074+IvanMishin1@users.noreply.github.com> Date: Tue, 9 Jul 2024 22:04:34 +0200 Subject: [PATCH 10/12] Update src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java Co-authored-by: Seggan --- .../addoncommunity/galactifun/core/managers/WorldManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java index 7e9f5db5..67799441 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java +++ b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java @@ -185,7 +185,7 @@ public Collection alienWorlds() { @EventHandler(priority = EventPriority.HIGHEST) public void onPortalCreate(PortalCreateEvent e) { - if (!Galactifun.instance().getConfig().getBoolean("worlds.allow-nether-portals") && e.getWorld().getName().contains("world_galactifun")) { + if (!Galactifun.instance().getConfig().getBoolean("worlds.allow-nether-portals") && getAlienWorld(e.getWorld()) != null) { e.setCancelled(true); } } From 32915707737b961981ca721dd5abd92c1d736ddb Mon Sep 17 00:00:00 2001 From: Ivan Mishin <88932074+IvanMishin1@users.noreply.github.com> Date: Tue, 9 Jul 2024 22:04:42 +0200 Subject: [PATCH 11/12] Update src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java Co-authored-by: Seggan --- .../addoncommunity/galactifun/core/managers/WorldManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java index 67799441..0f18dbc6 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java +++ b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java @@ -192,7 +192,7 @@ public void onPortalCreate(PortalCreateEvent e) { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void portal(PlayerPortalEvent e){ - if (!Galactifun.instance().getConfig().getBoolean("worlds.allow-nether-portals") && e.getFrom().getWorld().getName().contains("world_galactifun")){ + if (!Galactifun.instance().getConfig().getBoolean("worlds.allow-nether-portals") && getAlienWorld(e.getWorld()) != null){ e.setCancelled(true); } } From 9d2b4e3e2ff7af9b7932cfff66d3e882c75d4f5f Mon Sep 17 00:00:00 2001 From: Ivan Mishin Date: Tue, 9 Jul 2024 22:06:57 +0200 Subject: [PATCH 12/12] Added getFrom() --- .../addoncommunity/galactifun/core/managers/WorldManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java index 0f18dbc6..f3d8ab40 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java +++ b/src/main/java/io/github/addoncommunity/galactifun/core/managers/WorldManager.java @@ -192,7 +192,7 @@ public void onPortalCreate(PortalCreateEvent e) { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void portal(PlayerPortalEvent e){ - if (!Galactifun.instance().getConfig().getBoolean("worlds.allow-nether-portals") && getAlienWorld(e.getWorld()) != null){ + if (!Galactifun.instance().getConfig().getBoolean("worlds.allow-nether-portals") && getAlienWorld(e.getFrom().getWorld()) != null){ e.setCancelled(true); } }