Skip to content

Commit

Permalink
Update Main.java
Browse files Browse the repository at this point in the history
  • Loading branch information
moom0o authored Aug 6, 2020
1 parent 5124f3d commit 6645c84
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions me/moomoo/anarchyexploitfixes/Main.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.moomoo.anarchyexploitfixes;

import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.Container;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
Expand All @@ -10,6 +11,7 @@
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.BlockRedstoneEvent;
Expand All @@ -27,8 +29,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.time.Instant;
import java.util.Date;
import java.util.List;
import java.util.*;

public class Main extends JavaPlugin implements Listener {
FileConfiguration config = getConfig();
Expand Down Expand Up @@ -320,12 +321,14 @@ private void onMove(PlayerMoveEvent evt){
PlayerInventory i = player.getInventory();
Location l = i.getLocation();
evt.setCancelled(true);
if(getConfig().getBoolean("RemoveElytra")){
evt.getPlayer().setGliding(false);
if (i.getChestplate() != null && i.getChestplate().getType().equals(Material.ELYTRA)) {
ItemStack elytra = i.getChestplate();
i.setChestplate(null);
l.getWorld().dropItemNaturally(l, elytra);
}
}
}
}
if(getConfig().getBoolean("PreventGoingBelowBedrockFloorOnElytra")){
Expand Down

0 comments on commit 6645c84

Please sign in to comment.