mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Remove FawePlayer and API modifications
This commit is contained in:
@ -8,7 +8,6 @@ import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.logging.rollback.RollbackOptimizedHistory;
|
||||
import com.boydti.fawe.object.FaweLimit;
|
||||
import com.boydti.fawe.object.FawePlayer;
|
||||
import com.boydti.fawe.object.HistoryExtent;
|
||||
import com.boydti.fawe.object.NullChangeSet;
|
||||
import com.boydti.fawe.object.RegionWrapper;
|
||||
@ -19,6 +18,7 @@ import com.boydti.fawe.object.exception.FaweException;
|
||||
import com.boydti.fawe.object.extent.NullExtent;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.event.extent.EditSessionEvent;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
@ -34,7 +34,7 @@ public class EditSessionBuilder {
|
||||
private World world;
|
||||
private String worldName;
|
||||
private Extent extent;
|
||||
private FawePlayer player;
|
||||
private Player player;
|
||||
private FaweLimit limit;
|
||||
private FaweChangeSet changeSet;
|
||||
private Region[] allowedRegions;
|
||||
@ -81,7 +81,7 @@ public class EditSessionBuilder {
|
||||
this.world = FaweAPI.getWorld(worldName);
|
||||
}
|
||||
|
||||
public EditSessionBuilder player(@Nullable FawePlayer player) {
|
||||
public EditSessionBuilder player(@Nullable Player player) {
|
||||
this.player = player;
|
||||
return this;
|
||||
}
|
||||
@ -95,7 +95,7 @@ public class EditSessionBuilder {
|
||||
return limit(FaweLimit.MAX.copy());
|
||||
}
|
||||
|
||||
public EditSessionBuilder limitUnprocessed(@Nonnull FawePlayer fp) {
|
||||
public EditSessionBuilder limitUnprocessed(@Nonnull Player fp) {
|
||||
checkNotNull(fp);
|
||||
limitUnlimited();
|
||||
FaweLimit tmp = fp.getLimit();
|
||||
@ -266,10 +266,10 @@ public class EditSessionBuilder {
|
||||
eventBus = WorldEdit.getInstance().getEventBus();
|
||||
}
|
||||
if (event == null) {
|
||||
event = new EditSessionEvent(world, player == null ? null : (player.getPlayer()), -1, null);
|
||||
event = new EditSessionEvent(world, player, -1, null);
|
||||
}
|
||||
if (player == null && event.getActor() != null) {
|
||||
player = FawePlayer.wrap(event.getActor());
|
||||
player = (Player) event.getActor();
|
||||
}
|
||||
if (limit == null) {
|
||||
if (player == null) {
|
||||
@ -293,7 +293,7 @@ public class EditSessionBuilder {
|
||||
}
|
||||
if (checkMemory) {
|
||||
if (MemUtil.isMemoryLimitedSlow()) {
|
||||
if (Permission.hasPermission(player.toWorldEditPlayer(), "worldedit.fast")) {
|
||||
if (Permission.hasPermission(player, "worldedit.fast")) {
|
||||
BBC.WORLDEDIT_OOM_ADMIN.send(player);
|
||||
}
|
||||
throw FaweException.LOW_MEMORY;
|
||||
@ -450,7 +450,7 @@ public class EditSessionBuilder {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public FawePlayer getPlayer() {
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@ import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.FaweInputStream;
|
||||
import com.boydti.fawe.object.FaweOutputStream;
|
||||
import com.boydti.fawe.object.FawePlayer;
|
||||
import com.boydti.fawe.object.RegionWrapper;
|
||||
import com.boydti.fawe.object.RunnableVal;
|
||||
import com.boydti.fawe.object.RunnableVal2;
|
||||
@ -87,22 +86,11 @@ import net.jpountz.lz4.LZ4InputStream;
|
||||
import net.jpountz.lz4.LZ4Utils;
|
||||
|
||||
public class MainUtil {
|
||||
/*
|
||||
* Generic non plugin related utils
|
||||
* e.g. sending messages
|
||||
*/
|
||||
public static void sendMessage(final FawePlayer<?> player, String message) {
|
||||
if (player == null) {
|
||||
Fawe.debug(message);
|
||||
} else {
|
||||
player.sendMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendAdmin(final String s) {
|
||||
for (final FawePlayer<?> player : Fawe.get().getCachedPlayers()) {
|
||||
for (final Player player : Fawe.get().getCachedPlayers()) {
|
||||
if (player.hasPermission("fawe.admin")) {
|
||||
player.sendMessage(s);
|
||||
player.print(s);
|
||||
}
|
||||
}
|
||||
Fawe.debug(s);
|
||||
|
@ -1,22 +1,24 @@
|
||||
package com.boydti.fawe.util;
|
||||
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.FawePlayer;
|
||||
import com.boydti.fawe.object.RegionWrapper;
|
||||
import com.boydti.fawe.object.exception.FaweException;
|
||||
import com.boydti.fawe.object.extent.NullExtent;
|
||||
import com.boydti.fawe.regions.FaweMask;
|
||||
import com.boydti.fawe.regions.FaweMaskManager;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
public class WEManager {
|
||||
|
||||
@ -63,7 +65,7 @@ public class WEManager {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Region[] getMask(FawePlayer<?> player) {
|
||||
public Region[] getMask(Player player) {
|
||||
return getMask(player, FaweMaskManager.MaskType.getDefaultMaskType());
|
||||
}
|
||||
|
||||
@ -77,7 +79,7 @@ public class WEManager {
|
||||
* @param player
|
||||
* @return
|
||||
*/
|
||||
public Region[] getMask(FawePlayer<?> player, FaweMaskManager.MaskType type) {
|
||||
public Region[] getMask(Player player, FaweMaskManager.MaskType type) {
|
||||
if (!Settings.IMP.REGION_RESTRICTIONS || player.hasPermission("fawe.bypass") || player.hasPermission("fawe.bypass.regions")) {
|
||||
return new Region[]{RegionWrapper.GLOBAL()};
|
||||
}
|
||||
|
Reference in New Issue
Block a user