Permalink
Browse files

Merge remote-tracking branch 'origin/feature/sponge-1.10.2' into feat…

…ure/multipass2
  • Loading branch information...
DarkArc committed Jun 29, 2016
2 parents 1d6acfa + 0232d2c commit cc0c95a708eddd77cbc24688332dc5d0b453c331
View
@@ -1,6 +1,6 @@
println """
*******************************************
You are building WorldEdit!
You are building WorldEdit!
If you encounter trouble:
1) Read COMPILING.md if you haven't yet
@@ -27,7 +27,7 @@ buildscript {
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0'
classpath 'org.ajoberstar:gradle-git:1.4.2'
}
}
@@ -50,12 +50,34 @@ if (!project.hasProperty("gitCommitHash")) {
ext.gitCommitHash = "no_git_id"
}
apply plugin: 'com.jfrog.artifactory'
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = project.version.contains("SNAPSHOT") ? 'libs-snapshot-local' : 'libs-release-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
resolve {
repository {
repoKey = 'repo'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'checkstyle'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.jfrog.artifactory-upload'
apply plugin: 'com.jfrog.artifactory'
group = 'com.sk89q.worldedit'
version = '7.0-SNAPSHOT'
@@ -117,26 +139,4 @@ subprojects {
exclude '.cache'
exclude 'LICENSE*'
}
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = project.version.contains("SNAPSHOT") ? 'libs-snapshot-local' : 'libs-release-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
resolve {
repository {
repoKey = 'repo'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
}
}
@@ -27,7 +27,6 @@
import com.sk89q.worldedit.WorldVector;
import com.sk89q.worldedit.internal.LocalWorldAdapter;
import com.sk89q.worldedit.world.World;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.event.Event.Result;
import org.bukkit.event.EventHandler;
@@ -45,7 +44,6 @@
public class WorldEditListener implements Listener {
private WorldEditPlugin plugin;
private boolean ignoreLeftClickAir = false;
/**
* Called when a player plays an animation, such as an arm swing
@@ -143,22 +141,7 @@ public void onPlayerInteract(PlayerInteractEvent event) {
event.setCancelled(true);
}
if (!ignoreLeftClickAir) {
final int taskId = Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
ignoreLeftClickAir = false;
}
}, 2);
if (taskId != -1) {
ignoreLeftClickAir = true;
}
}
} else if (action == Action.LEFT_CLICK_AIR) {
if (ignoreLeftClickAir) {
return;
}
if (we.handleArmSwing(player)) {
event.setCancelled(true);
@@ -227,6 +227,27 @@
public static final int JUNGLE_DOOR = 195;
public static final int ACACIA_DOOR = 196;
public static final int DARK_OAK_DOOR = 197;
public static final int END_ROD = 198;
public static final int CHORUS_PLANT = 199;
public static final int CHORUS_FLOWER = 200;
public static final int PURPUR_BLOCK = 201;
public static final int PURPUR_PILLAR = 202;
public static final int PURPUR_STAIRS = 203;
public static final int PURPUR_DOUBLE_SLAB = 204;
public static final int PURPUR_SLAB = 205;
public static final int END_BRICKS = 206;
public static final int BEETROOTS = 207;
public static final int GRASS_PATH = 208;
public static final int END_GATEWAY = 209;
public static final int REPEATING_COMMAND_BLOCK = 210;
public static final int CHAIN_COMMAND_BLOCK = 211;
public static final int FROSTED_ICE = 212;
public static final int MAGMA_BLOCK = 213;
public static final int NETHER_WART_BLOCK = 214;
public static final int RED_NETHER_BRICK = 215;
public static final int BONE_BLOCK = 216;
public static final int STRUCTURE_VOID = 217;
public static final int STRUCTURE_BLOCK = 255;
private BlockID() {
}
@@ -238,7 +238,28 @@
BIRCH_DOOR(BlockID.BIRCH_DOOR, "Birch Door", "birchdoor"),
JUNGLE_DOOR(BlockID.JUNGLE_DOOR, "Jungle Door", "jungledoor"),
ACACIA_DOOR(BlockID.ACACIA_DOOR, "Acacia Door", "acaciadoor"),
DARK_OAK_DOOR(BlockID.DARK_OAK_DOOR, "Dark Oak Door", "darkoakdoor");
DARK_OAK_DOOR(BlockID.DARK_OAK_DOOR, "Dark Oak Door", "darkoakdoor"),
END_ROD(BlockID.END_ROD, "End Rod", "endrod", "endtorch"),
CHORUS_PLANT(BlockID.CHORUS_PLANT, "Chorus Plant", "chorusplant", "chorusstem"),
CHORUS_FLOWER(BlockID.CHORUS_FLOWER, "Chorus Flower", "chorusflower"),
PURPUR_BLOCK(BlockID.PURPUR_BLOCK, "Purpur Block", "purpurblock", "blockpurpur"),
PURPUR_PILLAR(BlockID.PURPUR_PILLAR, "Purpur Pillar", "purpurpillar"),
PURPUR_STAIRS(BlockID.PURPUR_STAIRS, "Purpur Stairs", "purpurstairs"),
PURPUR_DOUBLE_SLAB(BlockID.PURPUR_DOUBLE_SLAB, "Purpur Double Slab", "purpurdoubleslab", "doubleslabpurpur", "doublepurpurslab"),
PURPUR_SLAB(BlockID.PURPUR_SLAB, "Purpur Slab", "purpurslab", "slabpurpur"),
END_BRICKS(BlockID.END_BRICKS, "End Bricks", "endbricks"),
BEETROOTS(BlockID.BEETROOTS, "Beetroots", "beetroots", "beetroot_plant"),
GRASS_PATH(BlockID.GRASS_PATH, "Grass Path", "grasspath", "dirtpath"),
END_GATEWAY(BlockID.END_GATEWAY, "End Gateway", "endgateway"),
REPEATING_COMMAND_BLOCK(BlockID.REPEATING_COMMAND_BLOCK, "Repeating Command Block", "repeatingcommandblock", "commandblockrepeating"),
CHAIN_COMMAND_BLOCK(BlockID.CHAIN_COMMAND_BLOCK, "Chain Command Block", "chaincommandblock", "commandblockchain"),
FROSTED_ICE(BlockID.FROSTED_ICE, "Frosted Ice", "frostedice", "frostwalkerice"),
MAGMA_BLOCK(BlockID.MAGMA_BLOCK, "Magma Block", "magmablock", "magma"),
NETHER_WART_BLOCK(BlockID.NETHER_WART_BLOCK, "Nether Wart Block", "netherwartblock"),
RED_NETHER_BRICK(BlockID.RED_NETHER_BRICK, "Red Nether Brick", "rednetherbrick", "netherbrickred"),
BONE_BLOCK(BlockID.BONE_BLOCK, "Bone Block", "boneblock", "blockbone", "fossil", "fossilblock", "blockfossil"),
STRUCTURE_VOID(BlockID.STRUCTURE_VOID, "Structure Void", "structurevoid", "structureair"),
STRUCTURE_BLOCK(BlockID.STRUCTURE_BLOCK, "Structure Block", "structureblock");
/**
* Stores a map of the IDs for fast access.
@@ -186,12 +186,29 @@
public static final int MUTTON = 423;
public static final int COOKED_MUTTON = 424;
public static final int BANNER = 425;
// Nothing at 456
public static final int END_CRYSTAL = 426;
public static final int SPRUCE_DOOR = 427;
public static final int BIRCH_DOOR = 428;
public static final int JUNGLE_DOOR = 429;
public static final int ACACIA_DOOR = 430;
public static final int DARK_OAK_DOOR = 431;
public static final int CHORUS_FRUIT = 432;
public static final int CHORUS_FRUIT_POPPED = 433;
public static final int BEETROOT = 434;
public static final int BEETROOT_SEEDS = 435;
public static final int BEETROOT_SOUP = 436;
public static final int DRAGON_BREATH = 437;
public static final int SPLASH_POTION = 438;
public static final int SPECTRAL_ARROW = 439;
public static final int TIPPED_ARROW = 440;
public static final int LINGERING_POTION = 441;
public static final int SHIELD = 442;
public static final int ELYTRA = 443;
public static final int SPRUCE_BOAT = 444;
public static final int BIRCH_BOAT = 445;
public static final int JUNGLE_BOAT = 446;
public static final int ACACIA_BOAT = 447;
public static final int DARK_OAK_BOAT = 448;
@Deprecated public static final int GOLD_RECORD = 2256; // deprecated, but leave it there
@Deprecated public static final int GREEN_RECORD = 2257; // deprecated, but leave it there
@@ -208,6 +208,28 @@
PACKED_ICE(BlockID.PACKED_ICE, "Packed Ice", "packedice", "hardice"),
DOUBLE_PLANT(BlockID.DOUBLE_PLANT, "Large Flowers", "largeflowers", "doubleflowers"),
DARK_OAK_DOOR(BlockID.DARK_OAK_DOOR, "Dark Oak Door", "darkoakdoor"),
END_ROD(BlockID.END_ROD, "End Rod", "endrod", "endtorch"),
CHORUS_PLANT(BlockID.CHORUS_PLANT, "Chorus Plant", "chorusplant", "chorusstem"),
CHORUS_FLOWER(BlockID.CHORUS_FLOWER, "Chorus Flower", "chorusflower"),
PURPUR_BLOCK(BlockID.PURPUR_BLOCK, "Purpur Block", "purpurblock", "blockpurpur"),
PURPUR_PILLAR(BlockID.PURPUR_PILLAR, "Purpur Pillar", "purpurpillar"),
PURPUR_STAIRS(BlockID.PURPUR_STAIRS, "Purpur Stairs", "purpurstairs"),
PURPUR_DOUBLE_SLAB(BlockID.PURPUR_DOUBLE_SLAB, "Purpur Double Slab", "purpurdoubleslab", "doubleslabpurpur", "doublepurpurslab"),
PURPUR_SLAB(BlockID.PURPUR_SLAB, "Purpur Slab", "purpurslab", "slabpurpur"),
END_BRICKS(BlockID.END_BRICKS, "End Bricks", "endbricks"),
BEETROOTS(BlockID.BEETROOTS, "Beetroots", "beetroots", "beetroot_plant"),
GRASS_PATH(BlockID.GRASS_PATH, "Grass Path", "grasspath", "dirtpath"),
END_GATEWAY(BlockID.END_GATEWAY, "End Gateway", "endgateway"),
REPEATING_COMMAND_BLOCK(BlockID.REPEATING_COMMAND_BLOCK, "Repeating Command Block", "repeatingcommandblock", "commandblockrepeating"),
CHAIN_COMMAND_BLOCK(BlockID.CHAIN_COMMAND_BLOCK, "Chain Command Block", "chaincommandblock", "commandblockchain"),
FROSTED_ICE(BlockID.FROSTED_ICE, "Frosted Ice", "frostedice", "frostwalkerice"),
MAGMA_BLOCK(BlockID.MAGMA_BLOCK, "Magma Block", "magmablock", "magma"),
NETHER_WART_BLOCK(BlockID.NETHER_WART_BLOCK, "Nether Wart Block", "netherwartblock"),
RED_NETHER_BRICK(BlockID.RED_NETHER_BRICK, "Red Nether Brick", "rednetherbrick", "netherbrickred"),
BONE_BLOCK(BlockID.BONE_BLOCK, "Bone Block", "boneblock", "blockbone", "fossil", "fossilblock", "blockfossil"),
STRUCTURE_VOID(BlockID.STRUCTURE_VOID, "Structure Void", "structurevoid", "structureair"),
STRUCTURE_BLOCK(BlockID.STRUCTURE_BLOCK, "Structure Block", "structureblock"),
// Items
IRON_SHOVEL(ItemID.IRON_SHOVEL, "Iron shovel", "ironshovel"),
@@ -372,12 +394,30 @@
MUTTON(ItemID.MUTTON, "Mutton", "mutton", "rawmutton"),
COOKED_MUTTON(ItemID.COOKED_MUTTON, "Cooked Mutton", "cookedmutton"),
BANNER(ItemID.BANNER, "Banner", "banner"),
// Nothing at 456
SPRUCE_DOOR(ItemID.SPRUCE_DOOR, "Spruce Door", "sprucedoor"),
BIRCH_DOOR(ItemID.BIRCH_DOOR, "Birch Door", "birchdoor"),
JUNGLE_DOOR(ItemID.JUNGLE_DOOR, "Jungle Door", "jungledoor"),
ACACIA_DOOR(ItemID.ACACIA_DOOR, "Acacia Door", "acaciadoor"),
DARK_OAK_DOOR(ItemID.DARK_OAK_DOOR, "Dark Oak Door", "darkoakdoor"),
END_CRYSTAL(ItemID.END_CRYSTAL, "End Crystal", "endcrystal"),
SPRUCE_DOOR_ITEM(ItemID.SPRUCE_DOOR, "Spruce Door", "sprucedoor"),
BIRCH_DOOR_ITEM(ItemID.BIRCH_DOOR, "Birch Door", "birchdoor"),
JUNGLE_DOOR_ITEM(ItemID.JUNGLE_DOOR, "Jungle Door", "jungledoor"),
ACACIA_DOOR_ITEM(ItemID.ACACIA_DOOR, "Acacia Door", "acaciadoor"),
DARK_OAK_DOOR_ITEM(ItemID.DARK_OAK_DOOR, "Dark Oak Door", "darkoakdoor"),
CHORUS_FRUIT(ItemID.CHORUS_FRUIT, "Chorus Fruit", "chorusfruit"),
CHORUS_FRUIT_POPPED(ItemID.CHORUS_FRUIT_POPPED, "Popped Chorus Fruit", "poppedchorusfruit", "chorusfruitpopped", "cookedchorusfruit"),
BEETROOT(ItemID.BEETROOT, "Beetroot", "beetroot"),
BEETROOT_SEEDS(ItemID.BEETROOT_SEEDS, "Beetroot Seeds", "beetrootseeds"),
BEETROOT_SOUP(ItemID.BEETROOT_SOUP, "Beetroot Soup", "beetrootsoup"),
DRAGON_BREATH(ItemID.DRAGON_BREATH, "Dragon Breath", "dragonbreath"),
SPLASH_POTION(ItemID.SPLASH_POTION, "Splash Potion", "splashpotion", "potionsplash"),
SPECTRAL_ARROW(ItemID.SPECTRAL_ARROW, "Spectral Arrow", "spectralarrow", "glowingarrow"),
TIPPED_ARROW(ItemID.TIPPED_ARROW, "Tipped Arrow", "tippedarrow", "potionarrow"),
LINGERING_POTION(ItemID.LINGERING_POTION, "Lingering Potion", "lingeringpotion", "potionlingering"),
SHIELD(ItemID.SHIELD, "Shield", "shield"),
ELYTRA(ItemID.ELYTRA, "Elytra", "elytra", "wings"),
SPRUCE_BOAT(ItemID.SPRUCE_BOAT, "Spruce Boat", "spruceboat", "boatspruce"),
BIRCH_BOAT(ItemID.BIRCH_BOAT, "Birch Boat", "birchboat", "boatbirch"),
JUNGLE_BOAT(ItemID.JUNGLE_BOAT, "Jungle Boat", "jungleboat", "boatjungle"),
ACACIA_BOAT(ItemID.ACACIA_BOAT, "Acacia Boat", "acaciaboat", "boatacacia"),
DARK_OAK_BOAT(ItemID.DARK_OAK_BOAT, "Dark Oak Boat", "darkoakboat", "boatdarkoak"),
DISC_13(ItemID.DISC_13, "Music Disc - 13", "disc_13"),
DISC_CAT(ItemID.DISC_CAT, "Music Disc - Cat", "disc_cat"),
DISC_BLOCKS(ItemID.DISC_BLOCKS, "Music Disc - blocks", "disc_blocks"),
@@ -64,12 +64,37 @@ private static BaseBlock getBlockInHand(Actor actor) throws InputParseException
}
@Override
public BaseBlock parseFromInput(String input, ParserContext context) throws InputParseException {
// TODO: Rewrite this entire method to use BaseBlocks and ignore BlockType, as well as to properly handle mod:name IDs
public BaseBlock parseFromInput(String input, ParserContext context)
throws InputParseException {
// TODO: Rewrite this entire method to use BaseBlocks and ignore
// BlockType, as well as to properly handle mod:name IDs
BlockType blockType;
String originalInput = input;
input = input.replace("_", " ");
input = input.replace(";", "|");
Exception suppressed = null;
try {
BaseBlock modified = parseLogic(input, context);
if (modified != null) {
return modified;
}
} catch (Exception e) {
suppressed = e;
}
try {
return parseLogic(originalInput, context);
} catch (Exception e) {
if (suppressed != null) {
e.addSuppressed(suppressed);
}
throw e;
}
}
private BaseBlock parseLogic(String input, ParserContext context)
throws InputParseException, NoMatchException,
DisallowedUsageException {
BlockType blockType;
String[] blockAndExtraData = input.split("\\|");
String[] blockLocator = blockAndExtraData[0].split(":", 3);
String[] typeAndData;
@@ -127,12 +152,12 @@ public BaseBlock parseFromInput(String input, ParserContext context) throws Inpu
blockType = BlockType.lookup(testId);
if (blockType == null) {
int t = worldEdit.getServer().resolveItem(testId);
if (t > 0) {
if (t >= 0) {
blockType = BlockType.fromID(t); // Could be null
blockId = t;
} else if (blockLocator.length == 2) { // Block IDs in MC 1.7 and above use mod:name
t = worldEdit.getServer().resolveItem(blockAndExtraData[0]);
if (t > 0) {
if (t >= 0) {
blockType = BlockType.fromID(t); // Could be null
blockId = t;
typeAndData = new String[] { blockAndExtraData[0] };
Oops, something went wrong.

0 comments on commit cc0c95a

Please sign in to comment.