Skip to content

Commit

Permalink
1.27.2 - Fix WitherSpawning
Browse files Browse the repository at this point in the history
  • Loading branch information
moom0o committed Jan 5, 2023
1 parent 825ab37 commit 3c7ceff
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.moomoo</groupId>
<artifactId>anarchyexploitfixes</artifactId>
<version>1.27.1</version>
<version>1.27.2</version>
<packaging>jar</packaging>

<name>AnarchyExploitFixes</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand All @@ -23,29 +24,30 @@ private void onCreatureSpawn(CreatureSpawnEvent evt) {
if (!configSection.getBoolean("overworld") && !configSection.getBoolean("nether") && !configSection.getBoolean("end")) {
return;
}

int radius = configSection.getInt("radius");
switch (evt.getEntity().getWorld().getEnvironment()) {
case NORMAL: {
if (configSection.getBoolean("overworld") && shouldCancel(evt, radius)) {
evt.setCancelled(true);
sendMessage(evt.getEntity().getLocation(), radius);
if (evt.getEntity().getType().equals(EntityType.WITHER)) {
int radius = configSection.getInt("radius");
switch (evt.getEntity().getWorld().getEnvironment()) {
case NORMAL: {
if (configSection.getBoolean("overworld") && shouldCancel(evt, radius)) {
evt.setCancelled(true);
sendMessage(evt.getEntity().getLocation(), radius);
}
break;
}
break;
}
case NETHER: {
if (configSection.getBoolean("nether") && shouldCancel(evt, radius)) {
evt.setCancelled(true);
sendMessage(evt.getEntity().getLocation(), radius);
case NETHER: {
if (configSection.getBoolean("nether") && shouldCancel(evt, radius)) {
evt.setCancelled(true);
sendMessage(evt.getEntity().getLocation(), radius);
}
break;
}
break;
}
case THE_END: {
if (configSection.getBoolean("end") && shouldCancel(evt, radius)) {
evt.setCancelled(true);
sendMessage(evt.getEntity().getLocation(), radius);
case THE_END: {
if (configSection.getBoolean("end") && shouldCancel(evt, radius)) {
evt.setCancelled(true);
sendMessage(evt.getEntity().getLocation(), radius);
}
break;
}
break;
}
}
}
Expand Down

0 comments on commit 3c7ceff

Please sign in to comment.