Permalink
Browse files

It compiles.

  • Loading branch information...
me4502 committed Jul 22, 2018
1 parent 89db0d9 commit 2e8d14c99539e1e6b7a7653b44f764a286291e80
Showing with 1,018 additions and 689 deletions.
  1. +2 −1 worldguard-core/src/main/java/com/sk89q/worldguard/WorldGuard.java
  2. +20 −0 worldguard-core/src/main/java/com/sk89q/worldguard/config/WorldConfiguration.java
  3. +2 −2 ...rldguard-core/src/main/java/com/sk89q/worldguard}/protection/DelayedRegionOverlapAssociation.java
  4. +85 −84 worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/Flags.java
  5. +8 −0 worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/registry/FlagRegistry.java
  6. +8 −1 worldguard-core/src/main/java/com/sk89q/worldguard/protection/flags/registry/SimpleFlagRegistry.java
  7. +4 −4 worldguard-core/src/main/java/com/sk89q/worldguard/session/Session.java
  8. +12 −4 worldguard-core/src/main/java/com/sk89q/worldguard/session/WorldPlayerTuple.java
  9. +19 −0 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/BukkitConfigurationManager.java
  10. +1 −1 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/BukkitUtil.java
  11. +3 −2 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/BukkitWorldConfiguration.java
  12. +20 −1 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/BukkitWorldGuardPlatform.java
  13. +4 −1 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java
  14. +23 −23 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/chest/SignChestProtection.java
  15. +5 −6 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/commands/GeneralCommands.java
  16. +7 −3 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/commands/ToggleCommands.java
  17. +13 −9 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/commands/region/MemberCommands.java
  18. +57 −48 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/commands/region/RegionCommands.java
  19. +45 −39 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/commands/region/RegionCommandsBase.java
  20. +4 −3 ...guard-legacy/src/main/java/com/sk89q/worldguard/bukkit/commands/region/RegionPrintoutBuilder.java
  21. +5 −4 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/internal/TargetMatcherSet.java
  22. +1 −1 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/ChestProtectionListener.java
  23. +19 −14 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java
  24. +9 −6 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/PlayerMoveListener.java
  25. +106 −114 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/RegionProtectionListener.java
  26. +3 −5 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/WorldGuardBlockListener.java
  27. +72 −41 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/WorldGuardEntityListener.java
  28. +5 −4 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/WorldGuardHangingListener.java
  29. +68 −53 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/WorldGuardPlayerListener.java
  30. +3 −2 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/WorldGuardServerListener.java
  31. +18 −6 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/listener/WorldGuardVehicleListener.java
  32. +5 −2 worldguard-legacy/src/main/java/com/sk89q/worldguard/{ → bukkit}/session/BukkitSessionManager.java
  33. +199 −70 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/Materials.java
  34. +7 −4 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/report/ConfigReport.java
  35. +1 −2 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/report/ServerReport.java
  36. +5 −115 worldguard-legacy/src/main/java/com/sk89q/worldguard/protection/GlobalRegionManager.java
  37. +1 −0 worldguard-legacy/src/main/resources/plugin.yml
  38. +143 −6 worldguard-legacy/src/test/java/com/sk89q/worldguard/TestPlayer.java
  39. +2 −2 worldguard-legacy/src/test/java/com/sk89q/worldguard/protection/RegionEntryExitTest.java
  40. +2 −3 worldguard-legacy/src/test/java/com/sk89q/worldguard/protection/RegionOverlapTest.java
  41. +2 −3 worldguard-legacy/src/test/java/com/sk89q/worldguard/protection/RegionPriorityTest.java
@@ -22,6 +22,7 @@
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldguard.internal.platform.WorldGuardPlatform;
import com.sk89q.worldguard.protection.flags.Flags;
import com.sk89q.worldguard.protection.flags.registry.FlagRegistry;
import com.sk89q.worldguard.protection.flags.registry.SimpleFlagRegistry;
@@ -40,7 +41,7 @@ public static WorldGuard getInstance() {
}
public WorldGuard() {
flagRegistry.setInitialized(true);
Flags.registerAll();
}
/**
@@ -19,6 +19,7 @@
package com.sk89q.worldguard.config;
import com.sk89q.worldedit.world.registry.LegacyMapper;
import com.sk89q.worldguard.blacklist.Blacklist;
import com.sk89q.worldguard.util.report.Unreported;
@@ -66,4 +67,23 @@ public Blacklist getBlacklist() {
public String getWorldName() {
return this.worldName;
}
public String convertLegacyItem(String legacy) {
String item = legacy;
try {
String[] splitter = item.split(":", 2);
int id = 0;
byte data = 0;
if (splitter.length == 1) {
id = Integer.parseInt(item);
} else {
id = Integer.parseInt(splitter[0]);
data = Byte.parseByte(splitter[1]);
}
item = LegacyMapper.getInstance().getItemFromLegacy(id, data).getId();
} catch (Throwable e) {
}
return item;
}
}
@@ -17,14 +17,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.sk89q.worldguard.bukkit.protection;
package com.sk89q.worldguard.protection;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldguard.protection.regions.RegionQuery;
import com.sk89q.worldguard.domains.Association;
import com.sk89q.worldguard.protection.ApplicableRegionSet;
import com.sk89q.worldguard.protection.association.RegionAssociable;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import org.bukkit.Location;
import javax.annotation.Nullable;
import java.util.List;

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -23,6 +23,7 @@
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
@@ -65,6 +66,13 @@
@Nullable
Flag<?> get(String name);
/**
* Get all flags
*
* @return All flags
*/
List<Flag<?>> getAll();
/**
* Unmarshal a raw map of values into a map of flags with their
* unmarshalled values.
@@ -21,12 +21,14 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.sk89q.worldguard.protection.flags.Flag;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentMap;
@@ -41,7 +43,7 @@
private final Object lock = new Object();
private final ConcurrentMap<String, Flag<?>> flags = Maps.newConcurrentMap();
private boolean initialized;
private boolean initialized = false;
public boolean isInitialized() {
return initialized;
@@ -98,6 +100,11 @@ public void registerAll(Collection<Flag<?>> flags) {
return flags.get(name.toLowerCase());
}
@Override
public List<Flag<?>> getAll() {
return Lists.newArrayList(this.flags.values());
}
private Flag<?> getOrCreate(String name) {
Flag<?> flag = get(name);
@@ -64,7 +64,7 @@ public Session(SessionManager manager) {
*
* @param handler A new handler
*/
void register(Handler handler) {
public void register(Handler handler) {
handlers.put(handler.getClass(), handler);
}
@@ -95,7 +95,7 @@ public SessionManager getManager() {
*
* @param player The player
*/
void initialize(LocalPlayer player) {
public void initialize(LocalPlayer player) {
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
Location location = player.getLocation();
ApplicableRegionSet set = query.getApplicableRegions(location);
@@ -113,7 +113,7 @@ void initialize(LocalPlayer player) {
*
* @param player The player
*/
void tick(LocalPlayer player) {
public void tick(LocalPlayer player) {
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
Location location = player.getLocation();
ApplicableRegionSet set = query.getApplicableRegions(location);
@@ -128,7 +128,7 @@ void tick(LocalPlayer player) {
*
* @param player The player
*/
void resetState(LocalPlayer player) {
public void resetState(LocalPlayer player) {
initialize(player);
needRefresh.set(true);
}
@@ -22,12 +22,12 @@
import com.sk89q.worldedit.world.World;
import com.sk89q.worldguard.LocalPlayer;
class WorldPlayerTuple {
public class WorldPlayerTuple {
final World world;
final LocalPlayer player;
private final World world;
private final LocalPlayer player;
WorldPlayerTuple(World world, LocalPlayer player) {
public WorldPlayerTuple(World world, LocalPlayer player) {
this.world = world;
this.player = player;
}
@@ -45,6 +45,14 @@ public boolean equals(Object o) {
return true;
}
public LocalPlayer getPlayer() {
return player;
}
public World getWorld() {
return world;
}
@Override
public int hashCode() {
int result = world.hashCode();
@@ -1,3 +1,22 @@
/*
* WorldGuard, a suite of tools for Minecraft
* Copyright (C) sk89q <http://www.sk89q.com>
* Copyright (C) WorldGuard team and contributors
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.sk89q.worldguard.bukkit;
import com.sk89q.worldedit.WorldEdit;
@@ -208,6 +208,6 @@ public static Target createTarget(ItemStack item) {
*/
public static Target createTarget(Material material) {
checkNotNull(material);
return new ItemTarget(BukkitAdapter.adapt(material));
return new ItemTarget(BukkitAdapter.asItemType(material));
}
}
@@ -22,6 +22,7 @@
import com.sk89q.util.yaml.YAMLFormat;
import com.sk89q.util.yaml.YAMLProcessor;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.item.ItemTypes;
import com.sk89q.worldguard.LocalPlayer;
import com.sk89q.worldguard.blacklist.Blacklist;
import com.sk89q.worldguard.blacklist.BlacklistLoggerHandler;
@@ -127,7 +128,7 @@
public boolean disableMobDamage;
public boolean highFreqFlags;
public boolean checkLiquidFlow;
public int regionWand;
public String regionWand;
public Set<EntityType> blockCreatureSpawn;
public boolean allowTamedSpawns;
// public boolean useiConomy;
@@ -361,7 +362,7 @@ public void loadConfiguration() {
explosionFlagCancellation = getBoolean("regions.explosion-flags-block-entity-damage", true);
highFreqFlags = getBoolean("regions.high-frequency-flags", false);
checkLiquidFlow = getBoolean("regions.protect-against-liquid-flow", false);
regionWand = getInt("regions.wand", 334);
regionWand = convertLegacyItem(getString("regions.wand", ItemTypes.LEATHER.getId()));
maxClaimVolume = getInt("regions.max-claim-volume", 30000);
claimOnlyInsideExistingRegions = getBoolean("regions.claim-only-inside-existing-regions", false);
boundedLocationFlags = getBoolean("regions.location-flags-only-inside-regions", false);
@@ -1,3 +1,22 @@
/*
* WorldGuard, a suite of tools for Minecraft
* Copyright (C) sk89q <http://www.sk89q.com>
* Copyright (C) WorldGuard team and contributors
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.sk89q.worldguard.bukkit;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
@@ -11,7 +30,7 @@
import com.sk89q.worldguard.protection.flags.FlagContext;
import com.sk89q.worldguard.protection.flags.FlagContextCreateEvent;
import com.sk89q.worldguard.protection.regions.RegionContainer;
import com.sk89q.worldguard.session.BukkitSessionManager;
import com.sk89q.worldguard.bukkit.session.BukkitSessionManager;
import com.sk89q.worldguard.session.SessionManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@@ -73,11 +73,12 @@
import com.sk89q.worldguard.bukkit.util.Events;
import com.sk89q.worldguard.protection.GlobalRegionManager;
import com.sk89q.worldguard.protection.flags.Flag;
import com.sk89q.worldguard.protection.flags.registry.SimpleFlagRegistry;
import com.sk89q.worldguard.protection.managers.storage.StorageException;
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import com.sk89q.worldguard.protection.util.UnresolvedNamesException;
import com.sk89q.worldguard.session.BukkitSessionManager;
import com.sk89q.worldguard.bukkit.session.BukkitSessionManager;
import com.sk89q.worldguard.util.concurrent.EvenMoreExecutors;
import com.sk89q.worldguard.util.logging.ClassSourceValidator;
import com.sk89q.worldguard.util.logging.RecordMessagePrefixer;
@@ -255,6 +256,8 @@ public void run() {
ProcessPlayerEvent event = new ProcessPlayerEvent(player);
Events.fire(event);
}
((SimpleFlagRegistry) WorldGuard.getInstance().getFlagRegistry()).setInitialized(true);
}
@Override
Oops, something went wrong.

0 comments on commit 2e8d14c

Please sign in to comment.