Skip to content

Commit

Permalink
Strip out WorldGuard support, rely on Magic for spawn-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWolf committed Aug 3, 2018
1 parent cce0eed commit 2521ed8
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 254 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Now reacts to all spawn reasons by default. You can change this behavior in configs.
- Adds quiet=true parameter to all spell casts.
- Requires Magic 7.6.6 or higher (to support WG7 and MC 1.13)

# 1.5

Expand Down
24 changes: 1 addition & 23 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,33 +70,11 @@
<dependency>
<groupId>com.elmakers.mine.bukkit.plugins</groupId>
<artifactId>Magic</artifactId>
<version>7.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldedit</artifactId>
<version>5.5.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>6.2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mewin</groupId>
<artifactId>WGCustomFlags</artifactId>
<version>1.6.1</version>
<version>7.6.6-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
<repository>
<id>elMakers</id>
<url>http://maven.elmakers.com/repository/</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.elmakers.mine.bukkit.magicworlds.listener.EntitySpawnListener;
import com.elmakers.mine.bukkit.magicworlds.listener.PlayerListener;
import com.elmakers.mine.bukkit.magicworlds.populator.builtin.MagicChestPopulator;
import com.elmakers.mine.bukkit.magicworlds.worldguard.WorldGuardManager;
import com.elmakers.mine.bukkit.utility.ConfigurationUtils;
import org.bukkit.Bukkit;
import org.bukkit.Location;
Expand All @@ -21,7 +20,6 @@
import org.bukkit.plugin.PluginManager;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -57,10 +55,6 @@ public void initialize()
load();
}

public void initializeWorldGuardFlags() {
worldGuardManager.initializeFlags(plugin);
}

public void load()
{
File configFolder = plugin.getDataFolder();
Expand Down Expand Up @@ -91,14 +85,6 @@ public void load()
pm.registerEvents(new PlayerListener(this), plugin);
}

worldGuardManager.setEnabled(config.getBoolean("region_manager_enabled", true));
plugin.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
@Override
public void run() {
worldGuardManager.initialize(plugin);
}
}, 10);

ConfigurationSection worlds = config.getConfigurationSection("worlds");
if (worlds != null) {
Set<String> worldKeys = worlds.getKeys(false);
Expand Down Expand Up @@ -197,7 +183,7 @@ public MagicWorld getWorld(String name) {
}

public boolean inTaggedRegion(Location location, Set<String> tags) {
return worldGuardManager.inTaggedRegion(location, tags);
return magicAPI.getController().inTaggedRegion(location, tags);
}

/*
Expand All @@ -208,7 +194,6 @@ public boolean inTaggedRegion(Location location, Set<String> tags) {
private boolean magicLoaded = false;
private boolean loaded = false;

private WorldGuardManager worldGuardManager = new WorldGuardManager();
private final Map<String, MagicWorld> magicWorlds = new HashMap<String, MagicWorld>();
private final MagicChunkGenerator worldGenerator;
private final Plugin plugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public void onLoad()
if (controller == null) {
controller = new MagicWorldsController(this);
}
controller.initializeWorldGuardFlags();
}

public boolean hasPermission(CommandSender sender, String pNode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void run() {
logger.info("Loading/Generating chunk at " + chunk.getX() + ", " + chunk.getZ());
}
} else {
if (!NMSUtils.isDone(chunk)) {
if (!NMSUtils.isReady(chunk)) {
if (generate) {
if (!chunk.load(true)) {
logger.info("Failed to generate chunk at " + chunk.getX() + ", " + chunk.getZ());
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
entity_spawn_listener: true
player_listener: true

# Enable or disable WorldGuard and custom flags integration
region_manager_enabled: true

# Configure spawn reasons to ignore
ignore_reasons:
- CUSTOM
Expand Down

0 comments on commit 2521ed8

Please sign in to comment.