mirror of
https://github.com/MassiveCraft/Factions.git
synced 2025-02-20 14:01:45 +01:00
0.2.3. Runs against 1.13
This commit is contained in:
parent
f80b56dc6d
commit
1627a78307
4
pom.xml
4
pom.xml
@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>com.massivecraft</groupId>
|
||||
<artifactId>Factions</artifactId>
|
||||
<version>1.6.9.5-U0.2.2</version>
|
||||
<version>1.6.9.5-U0.2.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Factions</name>
|
||||
@ -73,7 +73,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.13-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
|
@ -392,53 +392,88 @@ public class Conf {
|
||||
territoryEnemyDenyCommands.add("tpaccept");
|
||||
territoryEnemyDenyCommands.add("tpa");
|
||||
|
||||
territoryProtectedMaterials.add(Material.WOODEN_DOOR);
|
||||
territoryProtectedMaterials.add(Material.TRAP_DOOR);
|
||||
territoryProtectedMaterials.add(Material.FENCE_GATE);
|
||||
territoryProtectedMaterials.add(Material.DARK_OAK_DOOR);
|
||||
territoryProtectedMaterials.add(Material.BIRCH_DOOR);
|
||||
territoryProtectedMaterials.add(Material.ACACIA_DOOR);
|
||||
territoryProtectedMaterials.add(Material.IRON_DOOR);
|
||||
territoryProtectedMaterials.add(Material.JUNGLE_DOOR);
|
||||
territoryProtectedMaterials.add(Material.OAK_DOOR);
|
||||
territoryProtectedMaterials.add(Material.SPRUCE_DOOR);
|
||||
|
||||
territoryProtectedMaterials.add(Material.ACACIA_TRAPDOOR);
|
||||
territoryProtectedMaterials.add(Material.BIRCH_TRAPDOOR);
|
||||
territoryProtectedMaterials.add(Material.DARK_OAK_TRAPDOOR);
|
||||
territoryProtectedMaterials.add(Material.IRON_TRAPDOOR);
|
||||
territoryProtectedMaterials.add(Material.JUNGLE_TRAPDOOR);
|
||||
territoryProtectedMaterials.add(Material.OAK_TRAPDOOR);
|
||||
territoryProtectedMaterials.add(Material.SPRUCE_TRAPDOOR);
|
||||
|
||||
territoryProtectedMaterials.add(Material.ACACIA_FENCE);
|
||||
territoryProtectedMaterials.add(Material.BIRCH_FENCE);
|
||||
territoryProtectedMaterials.add(Material.DARK_OAK_FENCE);
|
||||
territoryProtectedMaterials.add(Material.OAK_FENCE);
|
||||
territoryProtectedMaterials.add(Material.NETHER_BRICK_FENCE);
|
||||
territoryProtectedMaterials.add(Material.SPRUCE_FENCE);
|
||||
|
||||
territoryProtectedMaterials.add(Material.DISPENSER);
|
||||
territoryProtectedMaterials.add(Material.CHEST);
|
||||
territoryProtectedMaterials.add(Material.FURNACE);
|
||||
territoryProtectedMaterials.add(Material.BURNING_FURNACE);
|
||||
territoryProtectedMaterials.add(Material.DIODE_BLOCK_OFF);
|
||||
territoryProtectedMaterials.add(Material.DIODE_BLOCK_ON);
|
||||
territoryProtectedMaterials.add(Material.REPEATER);
|
||||
territoryProtectedMaterials.add(Material.JUKEBOX);
|
||||
territoryProtectedMaterials.add(Material.BREWING_STAND);
|
||||
territoryProtectedMaterials.add(Material.ENCHANTMENT_TABLE);
|
||||
territoryProtectedMaterials.add(Material.ENCHANTING_TABLE);
|
||||
territoryProtectedMaterials.add(Material.CAULDRON);
|
||||
territoryProtectedMaterials.add(Material.SOIL);
|
||||
territoryProtectedMaterials.add(Material.FARMLAND);
|
||||
territoryProtectedMaterials.add(Material.BEACON);
|
||||
territoryProtectedMaterials.add(Material.ANVIL);
|
||||
territoryProtectedMaterials.add(Material.TRAPPED_CHEST);
|
||||
territoryProtectedMaterials.add(Material.DROPPER);
|
||||
territoryProtectedMaterials.add(Material.HOPPER);
|
||||
|
||||
territoryDenyUseageMaterials.add(Material.FIREBALL);
|
||||
territoryDenyUseageMaterials.add(Material.FIRE_CHARGE);
|
||||
territoryDenyUseageMaterials.add(Material.FLINT_AND_STEEL);
|
||||
territoryDenyUseageMaterials.add(Material.BUCKET);
|
||||
territoryDenyUseageMaterials.add(Material.WATER_BUCKET);
|
||||
territoryDenyUseageMaterials.add(Material.LAVA_BUCKET);
|
||||
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.WOODEN_DOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.TRAP_DOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.FENCE_GATE);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.DARK_OAK_DOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.BIRCH_DOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.ACACIA_DOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.IRON_DOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.JUNGLE_DOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.OAK_DOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.SPRUCE_DOOR);
|
||||
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.ACACIA_TRAPDOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.BIRCH_TRAPDOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.DARK_OAK_TRAPDOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.IRON_TRAPDOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.JUNGLE_TRAPDOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.OAK_TRAPDOOR);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.SPRUCE_TRAPDOOR);
|
||||
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.ACACIA_FENCE);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.BIRCH_FENCE);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.DARK_OAK_FENCE);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.OAK_FENCE);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.NETHER_BRICK_FENCE);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.SPRUCE_FENCE);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.DISPENSER);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.CHEST);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.FURNACE);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.BURNING_FURNACE);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.DIODE_BLOCK_OFF);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.DIODE_BLOCK_ON);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.REPEATER);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.JUKEBOX);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.BREWING_STAND);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.ENCHANTMENT_TABLE);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.ENCHANTING_TABLE);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.CAULDRON);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.SOIL);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.FARMLAND);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.BEACON);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.ANVIL);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.TRAPPED_CHEST);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.DROPPER);
|
||||
territoryProtectedMaterialsWhenOffline.add(Material.HOPPER);
|
||||
|
||||
territoryDenyUseageMaterialsWhenOffline.add(Material.FIREBALL);
|
||||
territoryDenyUseageMaterialsWhenOffline.add(Material.FIRE_CHARGE);
|
||||
territoryDenyUseageMaterialsWhenOffline.add(Material.FLINT_AND_STEEL);
|
||||
territoryDenyUseageMaterialsWhenOffline.add(Material.BUCKET);
|
||||
territoryDenyUseageMaterialsWhenOffline.add(Material.WATER_BUCKET);
|
||||
@ -459,6 +494,7 @@ public class Conf {
|
||||
safeZoneNerfedCreatureTypes.add(EntityType.WITCH);
|
||||
safeZoneNerfedCreatureTypes.add(EntityType.WITHER);
|
||||
safeZoneNerfedCreatureTypes.add(EntityType.ZOMBIE);
|
||||
safeZoneNerfedCreatureTypes.add(EntityType.ELDER_GUARDIAN);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
|
@ -204,7 +204,7 @@ public class FactionsEntityListener implements Listener {
|
||||
targets.add(center.getRelative(1, 0, 0));
|
||||
targets.add(center.getRelative(-1, 0, 0));
|
||||
for (Block target : targets) {
|
||||
int id = target.getTypeId();
|
||||
int id = target.getType().getId();
|
||||
// ignore air, bedrock, water, lava, obsidian, enchanting table, etc.... too bad we can't get a blast resistance value through Bukkit yet
|
||||
if (id != 0 && (id < 7 || id > 11) && id != 49 && id != 90 && id != 116 && id != 119 && id != 120 && id != 130) {
|
||||
target.breakNaturally();
|
||||
|
@ -21,10 +21,10 @@ public class FactionsExploitListener implements Listener {
|
||||
|
||||
// thanks to ObGenBlocker and WorldGuard for this method
|
||||
Block block = event.getToBlock();
|
||||
int source = event.getBlock().getTypeId();
|
||||
int target = block.getTypeId();
|
||||
if ((target == 55 || target == 132) && (source == 0 || source == 10 || source == 11)) {
|
||||
block.setTypeId(0);
|
||||
Material source = event.getBlock().getType();
|
||||
Material target = block.getType();
|
||||
if ((target == Material.REDSTONE_WIRE || target == Material.TRIPWIRE) && (source == Material.AIR || source == Material.LAVA)) {
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ public class FactionsExploitListener implements Listener {
|
||||
|
||||
// blocks who occupy less than 1 block width or length wise need to be handled differently
|
||||
Material mat = event.getTo().getBlock().getType();
|
||||
if (((mat == Material.THIN_GLASS || mat == Material.IRON_FENCE) && clippingThrough(target, from, 0.65)) || ((mat == Material.FENCE || mat == Material.NETHER_FENCE) && clippingThrough(target, from, 0.45))) {
|
||||
if (((mat == Material.GLASS_PANE || mat == Material.IRON_BARS) && clippingThrough(target, from, 0.65)) || ((mat.name().toLowerCase().contains("fence")) && clippingThrough(target, from, 0.45))) {
|
||||
event.setTo(from);
|
||||
return;
|
||||
}
|
||||
|
@ -425,7 +425,12 @@ public class FactionsPlayerListener implements Listener {
|
||||
action = PermissableAction.LEVER;
|
||||
break;
|
||||
case STONE_BUTTON:
|
||||
case WOOD_BUTTON:
|
||||
case BIRCH_BUTTON:
|
||||
case ACACIA_BUTTON:
|
||||
case DARK_OAK_BUTTON:
|
||||
case JUNGLE_BUTTON:
|
||||
case OAK_BUTTON:
|
||||
case SPRUCE_BUTTON:
|
||||
action = PermissableAction.BUTTON;
|
||||
break;
|
||||
case DARK_OAK_DOOR:
|
||||
@ -434,9 +439,14 @@ public class FactionsPlayerListener implements Listener {
|
||||
case IRON_DOOR:
|
||||
case JUNGLE_DOOR:
|
||||
case SPRUCE_DOOR:
|
||||
case TRAP_DOOR:
|
||||
case WOOD_DOOR:
|
||||
case WOODEN_DOOR:
|
||||
case ACACIA_TRAPDOOR:
|
||||
case OAK_DOOR:
|
||||
case BIRCH_TRAPDOOR:
|
||||
case DARK_OAK_TRAPDOOR:
|
||||
case IRON_TRAPDOOR:
|
||||
case JUNGLE_TRAPDOOR:
|
||||
case OAK_TRAPDOOR:
|
||||
case SPRUCE_TRAPDOOR:
|
||||
action = PermissableAction.DOOR;
|
||||
break;
|
||||
case CHEST:
|
||||
@ -465,10 +475,14 @@ public class FactionsPlayerListener implements Listener {
|
||||
if (!rel.isMember() || !otherFaction.playerHasOwnershipRights(me, loc) && player.getItemInHand() != null) {
|
||||
switch (player.getItemInHand().getType()) {
|
||||
case CHEST:
|
||||
case SIGN_POST:
|
||||
case TRAPPED_CHEST:
|
||||
case SIGN:
|
||||
case WOOD_DOOR:
|
||||
case TRAPPED_CHEST:
|
||||
case DARK_OAK_DOOR:
|
||||
case ACACIA_DOOR:
|
||||
case BIRCH_DOOR:
|
||||
case JUNGLE_DOOR:
|
||||
case OAK_DOOR:
|
||||
case SPRUCE_DOOR:
|
||||
case IRON_DOOR:
|
||||
return false;
|
||||
default:
|
||||
@ -490,7 +504,7 @@ public class FactionsPlayerListener implements Listener {
|
||||
// You may use any block unless it is another faction's territory...
|
||||
if (rel.isNeutral() || (rel.isEnemy() && Conf.territoryEnemyProtectMaterials) || (rel.isAlly() && Conf.territoryAllyProtectMaterials) || (rel.isTruce() && Conf.territoryTruceProtectMaterials)) {
|
||||
if (!justCheck) {
|
||||
me.msg(TL.PLAYER_USE_TERRITORY, (material == Material.SOIL ? "trample " : "use ") + TextUtil.getMaterialName(material), otherFaction.getTag(myFaction));
|
||||
me.msg(TL.PLAYER_USE_TERRITORY, (material == Material.FARMLAND ? "trample " : "use ") + TextUtil.getMaterialName(material), otherFaction.getTag(myFaction));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -99,8 +99,8 @@ public class SeeChunkUtil extends BukkitRunnable {
|
||||
effect.display(color, loc, player);
|
||||
}
|
||||
} else {
|
||||
int typeId = blockY % 5 == 0 ? Material.REDSTONE_LAMP_ON.getId() : Material.STAINED_GLASS.getId();
|
||||
VisualizeUtil.addLocation(player, loc, typeId);
|
||||
Material mat = blockY % 5 == 0 ? Material.REDSTONE_LAMP : Material.GLASS_PANE;
|
||||
VisualizeUtil.addLocation(player, loc, mat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.massivecraft.factions.util;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -25,42 +26,36 @@ public class VisualizeUtil {
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void addLocation(Player player, Location location, int typeId, byte data) {
|
||||
public static void addLocation(Player player, Location location, Material material) {
|
||||
getPlayerLocations(player).add(location);
|
||||
player.sendBlockChange(location, typeId, data);
|
||||
player.sendBlockChange(location, material, (byte) 0);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void addLocation(Player player, Location location, int typeId) {
|
||||
getPlayerLocations(player).add(location);
|
||||
player.sendBlockChange(location, typeId, (byte) 0);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void addLocations(Player player, Map<Location, Integer> locationMaterialIds) {
|
||||
public static void addLocations(Player player, Map<Location, Material> locationMaterialIds) {
|
||||
Set<Location> ploc = getPlayerLocations(player);
|
||||
for (Entry<Location, Integer> entry : locationMaterialIds.entrySet()) {
|
||||
for (Entry<Location, Material> entry : locationMaterialIds.entrySet()) {
|
||||
ploc.add(entry.getKey());
|
||||
player.sendBlockChange(entry.getKey(), entry.getValue(), (byte) 0);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void addLocations(Player player, Collection<Location> locations, int typeId) {
|
||||
public static void addLocations(Player player, Collection<Location> locations, Material material) {
|
||||
Set<Location> ploc = getPlayerLocations(player);
|
||||
for (Location location : locations) {
|
||||
ploc.add(location);
|
||||
player.sendBlockChange(location, typeId, (byte) 0);
|
||||
player.sendBlockChange(location, material, (byte) 0);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void addBlocks(Player player, Collection<Block> blocks, int typeId) {
|
||||
public static void addBlocks(Player player, Collection<Block> blocks, Material material) {
|
||||
Set<Location> ploc = getPlayerLocations(player);
|
||||
for (Block block : blocks) {
|
||||
Location location = block.getLocation();
|
||||
ploc.add(location);
|
||||
player.sendBlockChange(location, typeId, (byte) 0);
|
||||
player.sendBlockChange(location, material, (byte) 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +67,7 @@ public class VisualizeUtil {
|
||||
}
|
||||
for (Location location : locations) {
|
||||
Block block = location.getWorld().getBlockAt(location);
|
||||
player.sendBlockChange(location, block.getTypeId(), block.getData());
|
||||
player.sendBlockChange(location, block.getType(), block.getData());
|
||||
}
|
||||
locations.clear();
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ public enum PermissableAction {
|
||||
}
|
||||
Material material = Material.matchMaterial(section.getString("materials." + name().toLowerCase().replace('_', '-')));
|
||||
if (material == null) {
|
||||
material = Material.STAINED_CLAY;
|
||||
material = Material.CLAY;
|
||||
}
|
||||
|
||||
Access access = fme.getFaction().getAccess(permissable, this);
|
||||
|
@ -161,10 +161,6 @@ public class TextUtil {
|
||||
return material.toString().replace('_', ' ').toLowerCase();
|
||||
}
|
||||
|
||||
public static String getMaterialName(int materialId) {
|
||||
return getMaterialName(Material.getMaterial(materialId));
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// Paging and chrome-tools like titleize
|
||||
// -------------------------------------------- //
|
||||
|
@ -3,6 +3,7 @@ version: ${project.version}-b${build.number}
|
||||
main: com.massivecraft.factions.P
|
||||
authors: [Olof Larsson, Brett Flannigan, drtshock]
|
||||
softdepend: [PlayerVaults, PlaceholderAPI, MVdWPlaceholderAPI, PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag, dynmap, FactionsTop]
|
||||
api-version: 1.13
|
||||
commands:
|
||||
factions:
|
||||
description: Reference command for Factions.
|
||||
|
Loading…
Reference in New Issue
Block a user