diff --git a/.gitignore b/.gitignore index e79bca888..f632b0d1f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ eclipse bin build target -gradle .gradle forge-download out diff --git a/HEADER.txt b/HEADER.txt new file mode 100644 index 000000000..a429eca27 --- /dev/null +++ b/HEADER.txt @@ -0,0 +1,16 @@ +WorldEdit, a Minecraft world manipulation toolkit +Copyright (C) sk89q +Copyright (C) WorldEdit 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 . diff --git a/build.gradle b/build.gradle index b204cd4d5..a8f1dc294 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,3 @@ -print new File('splash.txt').text - buildscript { repositories { mavenLocal() @@ -16,15 +14,21 @@ buildscript { } dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' - classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.3.0' - classpath 'org.ajoberstar:gradle-git:1.5.1' + classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4' + classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5' + classpath 'org.ajoberstar:gradle-git:1.7.2' } } +plugins { + id 'net.minecrell.licenser' version '0.4.1' apply false +} + apply plugin: 'java' clean { delete "target" } +print new File('splash.txt').text + group = 'com.boydti.fawe' def revision = "" def buildNumber = "" @@ -57,9 +61,8 @@ subprojects { apply plugin: 'java' apply plugin: 'maven' apply plugin: 'com.github.johnrengelman.shadow' - - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + // Enable this requires putting license header files in many, many FAWE files + //apply plugin: 'net.minecrell.licenser' ext.internalVersion = version @@ -70,10 +73,11 @@ subprojects { repositories { mavenCentral() - maven { url "http://ci.athion.net/job/FAWE-WorldGuard-1.13/ws/mvn/" } + maven { url "http://repo.bukkit.org/content/groups/public" } maven { url "http://maven.sk89q.com/repo/" } maven { url "http://repo.maven.apache.org/maven2" } // Fawe + maven {url "http://ci.athion.net/job/FAWE-WorldGuard-1.13/ws/mvn/"} maven {url "https://mvnrepository.com/artifact/"} maven {url "http://repo.dmulloy2.net/content/groups/public/"} maven {url "https://repo.destroystokyo.com/repository/maven-public//"} @@ -88,6 +92,13 @@ subprojects { maven {url "http://ci.emc.gs/nexus/content/groups/aikar/" } } + if (JavaVersion.current().isJava8Compatible()) { + // Java 8 turns on doclint which we fail + tasks.withType(Javadoc) { + options.addStringOption('Xdoclint:none', '-quiet') + } + } + task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir @@ -95,6 +106,7 @@ subprojects { artifacts { archives jar + archives javadocJar } if (!(name.equals('worldedit-forge') || name.equals('worldedit-sponge'))) { @@ -122,4 +134,10 @@ subprojects { exclude '.cache' exclude 'LICENSE*' } + + // Enable this requires putting license header files in many, many FAWE files + //license { + // header = rootProject.file("HEADER.txt") + // include '**/*.java' + //} } diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index cd403cf91..7872f45bc 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -53,11 +53,4 @@ - - - - - - - diff --git a/config/checkstyle/header.txt b/config/checkstyle/header.txt deleted file mode 100644 index 24392ded4..000000000 --- a/config/checkstyle/header.txt +++ /dev/null @@ -1,18 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit 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 . - */ \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 0d4a95168..29953ea14 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9b69b3197..e0b3fb8d7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Thu Jul 26 14:29:48 AEST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitImplementationTester.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitImplementationTester.java new file mode 100644 index 000000000..1345f6a81 --- /dev/null +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitImplementationTester.java @@ -0,0 +1,91 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit 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 . + */ + +package com.sk89q.worldedit.bukkit; + +/** + * Adds methods to test if different API methods are possible based on implementation. + */ +public class BukkitImplementationTester { + + private BukkitImplementationTester() { + } + + /** + * Known Bukkit implementations + */ + public enum BukkitImplementation { + CRAFTBUKKIT, + SPIGOT, + PAPER, + } + + private static final String implementationMessage = "************************************************" + + "* Note: PaperMC (https://papermc.io/) is *" + + "* recommended for optimal performance with *" + + "* WorldEdit, WorldGuard, or CraftBook. *" + + "************************************************"; + + private static BukkitImplementation implementation; + + /** + * Gets the implementation currently in use on the server. + * + * @return The server implementation + */ + public static BukkitImplementation getImplementation() { + if (implementation == null) { + try { + Class.forName("com.destroystokyo.paper.PaperConfig"); + implementation = BukkitImplementation.PAPER; + } catch (Exception e) { + try { + Class.forName("org.spigotmc.SpigotConfig"); + implementation = BukkitImplementation.SPIGOT; + } catch (Exception e2) { + implementation = BukkitImplementation.CRAFTBUKKIT; + } + } + + if (implementation != BukkitImplementation.PAPER) { +// Bukkit.getServer().getConsoleSender().sendMessage(implementationMessage); // TODO Decide if good idea. + } + } + + return implementation; + } + + /** + * Check if this implementation is compatible with Spigot APIs + * + * @return If compatible with Spigot APIs + */ + public static boolean isSpigotCompatible() { + return getImplementation() == BukkitImplementation.SPIGOT || getImplementation() == BukkitImplementation.PAPER; + } + + /** + * Check if this implementation is compatible with Paper APIs + * + * @return If compatible with Paper APIs + */ + public static boolean isPaperCompatible() { + return getImplementation() == BukkitImplementation.PAPER; + } +} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 93ee3dab6..129f85859 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -177,6 +177,9 @@ public class WorldEditPlugin extends JavaPlugin //implements TabCompleter // platforms to be worried about... at the current time of writing WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent()); + // Setup the BukkitImplementationTester. + BukkitImplementationTester.getImplementation(); + { // Register 1.13 Material ids with LegacyMapper LegacyMapper legacyMapper = LegacyMapper.getInstance(); for (Material m : Material.values()) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index 140873d8b..83c63867a 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -94,7 +94,7 @@ public interface BukkitImplAdapter extends IBukkitAdapter { Entity createEntity(Location location, BaseEntity state); /** - * Get a map of string -> properties + * Get a map of {@code string -> property}. * * @param blockType The block type * @return The properties map diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java index c3332a250..a25477235 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java @@ -41,7 +41,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent { * Create a new instance. * * @param extent the extent - * @param limit the limit (>= 0) or -1 for no limit + * @param limit the limit (>= 0) or -1 for no limit */ public BlockChangeLimiter(Extent extent, int limit) { super(extent); @@ -51,7 +51,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent { /** * Get the limit. * - * @return the limit (>= 0) or -1 for no limit + * @return the limit (>= 0) or -1 for no limit */ public int getLimit() { return limit; @@ -60,7 +60,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent { /** * Set the limit. * - * @param limit the limit (>= 0) or -1 for no limit + * @param limit the limit (>= 0) or -1 for no limit */ public void setLimit(int limit) { checkArgument(limit >= -1, "limit >= -1 required"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java index 6a8d96ccf..eac88237c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java @@ -17,7 +17,6 @@ * along with this program. If not, see . */ - package com.sk89q.worldedit.internal.annotation; import com.sk89q.worldedit.Vector; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java index a8e87f5e9..41cb27134 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java @@ -40,7 +40,7 @@ import java.util.Map; *

Supported operators:

*

*

    - *
  • Logical: &&, ||, ! (unary)
  • + *
  • Logical: &&, ||, ! (unary)
  • *
  • Bitwise: ~ (unary), >>, <<
  • *
  • Arithmetic: +, -, *, /, % (modulo), ^ (power), - (unary), --, ++ (prefix only)
  • *
  • Comparison: <=, >=, >, <, ==, !=, ~= (near)
  • diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java index ca03998b0..421602563 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java @@ -112,7 +112,7 @@ public class SimpleDispatcher implements Dispatcher { @Override public Object call(String arguments, CommandLocals locals, String[] parentCommands) throws CommandException { // We have permission for this command if we have permissions for subcommands - if (!testPermission(locals)) { + if (parentCommands.length != 0 && !testPermission(locals)) { throw new CommandPermissionsException(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java index 25f7efa7e..a8ad5ab1b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java @@ -201,7 +201,7 @@ public class ParametricCallable extends AParametricCallable { @Override public Object call(String stringArguments, CommandLocals locals, String[] parentCommands) throws CommandException { // Test permission - if (!testPermission(locals)) { + if (parentCommands.length != 0 && !testPermission(locals)) { throw new CommandPermissionsException(); } locals.putIfAbsent(CommandCallable.class, this); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java index f705bb99a..d6c70eeb8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java @@ -221,7 +221,7 @@ public enum Style { * ChatColor.COLOR_CODE color code character. The alternate color code character will only be replaced * if it is immediately followed by 0-9, A-F, a-f, K-O, k-o, R or r. * - * @param altColorChar The alternate color code character to replace. Ex: & + * @param altColorChar The alternate color code character to replace. Ex: & * @param textToTranslate Text containing the alternate color code character. * @return Text containing the ChatColor.COLOR_CODE color code character. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java index de6c1cc80..cee5897ff 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java @@ -99,7 +99,7 @@ public interface BlockType extends FawePattern, Comparable { } /** - * Gets the properties of this BlockType in a key->property mapping. + * Gets the properties of this BlockType in a {@code key->property} mapping. * * @return The properties map */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java index ab4c3bd0f..42c225036 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java @@ -219,19 +219,24 @@ public enum BlockTypes implements BlockType { DARK_PRISMARINE_SLAB, DARK_PRISMARINE_STAIRS, DAYLIGHT_DETECTOR, + DEAD_BRAIN_CORAL, DEAD_BRAIN_CORAL_BLOCK, DEAD_BRAIN_CORAL_FAN, DEAD_BRAIN_CORAL_WALL_FAN, + DEAD_BUBBLE_CORAL, DEAD_BUBBLE_CORAL_BLOCK, DEAD_BUBBLE_CORAL_FAN, DEAD_BUBBLE_CORAL_WALL_FAN, DEAD_BUSH, + DEAD_FIRE_CORAL, DEAD_FIRE_CORAL_BLOCK, DEAD_FIRE_CORAL_FAN, DEAD_FIRE_CORAL_WALL_FAN, + DEAD_HORN_CORAL, DEAD_HORN_CORAL_BLOCK, DEAD_HORN_CORAL_FAN, DEAD_HORN_CORAL_WALL_FAN, + DEAD_TUBE_CORAL, DEAD_TUBE_CORAL_BLOCK, DEAD_TUBE_CORAL_FAN, DEAD_TUBE_CORAL_WALL_FAN, @@ -654,11 +659,6 @@ public enum BlockTypes implements BlockType { YELLOW_WOOL, ZOMBIE_HEAD, ZOMBIE_WALL_HEAD, - DEAD_BRAIN_CORAL, - DEAD_BUBBLE_CORAL, - DEAD_FIRE_CORAL, - DEAD_HORN_CORAL, - DEAD_TUBE_CORAL, ; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java index b6c594683..61c7c1173 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java @@ -245,15 +245,20 @@ public enum ItemTypes implements ItemType { DARK_PRISMARINE_SLAB, DARK_PRISMARINE_STAIRS, DAYLIGHT_DETECTOR, + DEAD_BRAIN_CORAL, DEAD_BRAIN_CORAL_BLOCK, DEAD_BRAIN_CORAL_FAN, + DEAD_BUBBLE_CORAL, DEAD_BUBBLE_CORAL_BLOCK, DEAD_BUBBLE_CORAL_FAN, DEAD_BUSH, + DEAD_FIRE_CORAL, DEAD_FIRE_CORAL_BLOCK, DEAD_FIRE_CORAL_FAN, + DEAD_HORN_CORAL, DEAD_HORN_CORAL_BLOCK, DEAD_HORN_CORAL_FAN, + DEAD_TUBE_CORAL, DEAD_TUBE_CORAL_BLOCK, DEAD_TUBE_CORAL_FAN, DEBUG_STICK, diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java index dda18cd87..a2d5da198 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java @@ -46,8 +46,8 @@ public abstract class ChunkStore implements Closeable { public static final int DATA_VERSION_MC_1_13 = 1519; /** - * >> to chunk - * << from chunk + * {@code >>} - to chunk + * {@code <<} - from chunk */ public static final int CHUNK_SHIFTS = 4; diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json index 3e163855a..93dffaf2d 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json @@ -3949,6 +3949,31 @@ "hasContainer": true } }, + { + "id": "minecraft:dead_brain_coral", + "localizedName": "Dead Brain Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, { "id": "minecraft:dead_brain_coral_block", "localizedName": "Dead Brain Coral Block", @@ -4024,6 +4049,31 @@ "hasContainer": false } }, + { + "id": "minecraft:dead_bubble_coral", + "localizedName": "Dead Bubble Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, { "id": "minecraft:dead_bubble_coral_block", "localizedName": "Dead Bubble Coral Block", @@ -4124,6 +4174,31 @@ "hasContainer": false } }, + { + "id": "minecraft:dead_fire_coral", + "localizedName": "Dead Fire Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, { "id": "minecraft:dead_fire_coral_block", "localizedName": "Dead Fire Coral Block", @@ -4199,6 +4274,31 @@ "hasContainer": false } }, + { + "id": "minecraft:dead_horn_coral", + "localizedName": "Dead Horn Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, { "id": "minecraft:dead_horn_coral_block", "localizedName": "Dead Horn Coral Block", @@ -4274,6 +4374,31 @@ "hasContainer": false } }, + { + "id": "minecraft:dead_tube_coral", + "localizedName": "Dead Tube Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, { "id": "minecraft:dead_tube_coral_block", "localizedName": "Dead Tube Coral Block", @@ -6995,7 +7120,7 @@ "fragileWhenPushed": true, "unpushable": false, "mapColor": "#ff0000", - "isTranslucent": true, + "isTranslucent": false, "hasContainer": false } }, @@ -14045,7 +14170,7 @@ "fragileWhenPushed": true, "unpushable": false, "mapColor": "#4040ff", - "isTranslucent": true, + "isTranslucent": false, "hasContainer": false } }, diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json index c9eeb23b8..46829d927 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json @@ -803,6 +803,10 @@ "id": "minecraft:daylight_detector", "localizedName": "Air" }, + { + "id": "minecraft:dead_brain_coral", + "localizedName": "Air" + }, { "id": "minecraft:dead_brain_coral_block", "localizedName": "Air" @@ -811,6 +815,10 @@ "id": "minecraft:dead_brain_coral_fan", "localizedName": "Air" }, + { + "id": "minecraft:dead_bubble_coral", + "localizedName": "Air" + }, { "id": "minecraft:dead_bubble_coral_block", "localizedName": "Air" @@ -823,6 +831,10 @@ "id": "minecraft:dead_bush", "localizedName": "Air" }, + { + "id": "minecraft:dead_fire_coral", + "localizedName": "Air" + }, { "id": "minecraft:dead_fire_coral_block", "localizedName": "Air" @@ -831,6 +843,10 @@ "id": "minecraft:dead_fire_coral_fan", "localizedName": "Air" }, + { + "id": "minecraft:dead_horn_coral", + "localizedName": "Air" + }, { "id": "minecraft:dead_horn_coral_block", "localizedName": "Air" @@ -839,6 +855,10 @@ "id": "minecraft:dead_horn_coral_fan", "localizedName": "Air" }, + { + "id": "minecraft:dead_tube_coral", + "localizedName": "Air" + }, { "id": "minecraft:dead_tube_coral_block", "localizedName": "Air" @@ -1749,7 +1769,7 @@ }, { "id": "minecraft:lingering_potion", - "localizedName": "Lingering Potion" + "localizedName": "Lingering Water Bottle" }, { "id": "minecraft:llama_spawn_egg", @@ -2237,7 +2257,7 @@ }, { "id": "minecraft:potion", - "localizedName": "Potion" + "localizedName": "Water Bottle" }, { "id": "minecraft:powered_rail", @@ -2677,7 +2697,7 @@ }, { "id": "minecraft:splash_potion", - "localizedName": "Splash Potion" + "localizedName": "Splash Water Bottle" }, { "id": "minecraft:sponge", @@ -2885,7 +2905,7 @@ }, { "id": "minecraft:tipped_arrow", - "localizedName": "Tipped Arrow" + "localizedName": "Arrow of Poison" }, { "id": "minecraft:tnt", diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java index 216657581..c87033075 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java @@ -16,6 +16,7 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ + package com.sk89q.worldedit.forge; import com.sk89q.worldedit.blocks.BaseItem; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index e5cbcaf4d..676c77b50 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -24,6 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.io.Files; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.Vector; @@ -47,6 +48,8 @@ import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.weather.WeatherType; +import com.sk89q.worldedit.world.weather.WeatherTypes; + import net.minecraft.block.Block; import net.minecraft.block.BlockLeaves; import net.minecraft.block.BlockOldLeaf; @@ -86,6 +89,7 @@ import net.minecraft.world.gen.feature.WorldGenTaiga1; import net.minecraft.world.gen.feature.WorldGenTaiga2; import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraft.world.storage.WorldInfo; import net.minecraftforge.common.DimensionManager; import java.io.File; @@ -93,7 +97,6 @@ import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; import java.util.Random; -import java.util.UUID; import javax.annotation.Nullable; @@ -351,25 +354,75 @@ public class ForgeWorld extends AbstractWorld { return generator != null && generator.generate(getWorld(), random, ForgeAdapter.toBlockPos(position)); } + @Override + public void checkLoadedChunk(Vector pt) { + getWorld().getChunkFromBlockCoords(ForgeAdapter.toBlockPos(pt)); + } + + @Override + public void fixAfterFastMode(Iterable chunks) { + fixLighting(chunks); + } + + @Override + public void fixLighting(Iterable chunks) { + World world = getWorld(); + for (BlockVector2D chunk : chunks) { + world.getChunkFromChunkCoords(chunk.getBlockX(), chunk.getBlockZ()).resetRelightChecks(); + } + } + + @Override + public boolean playEffect(Vector position, int type, int data) { + getWorld().playEvent(type, ForgeAdapter.toBlockPos(position), data); + return true; + } + @Override public WeatherType getWeather() { - // TODO Weather implementation - return null; + WorldInfo info = getWorld().getWorldInfo(); + if (info.isThundering()) { + return WeatherTypes.THUNDER_STORM; + } + if (info.isRaining()) { + return WeatherTypes.RAIN; + } + return WeatherTypes.CLEAR; } @Override public long getRemainingWeatherDuration() { - return 0; + WorldInfo info = getWorld().getWorldInfo(); + if (info.isThundering()) { + return info.getThunderTime(); + } + if (info.isRaining()) { + return info.getRainTime(); + } + return info.getCleanWeatherTime(); } @Override public void setWeather(WeatherType weatherType) { - + setWeather(weatherType, 0); } @Override public void setWeather(WeatherType weatherType, long duration) { - + WorldInfo info = getWorld().getWorldInfo(); + if (WeatherTypes.THUNDER_STORM.equals(weatherType)) { + info.setCleanWeatherTime(0); + info.setThundering(true); + info.setThunderTime((int) duration); + } else if (WeatherTypes.RAIN.equals(weatherType)) { + info.setCleanWeatherTime(0); + info.setRaining(true); + info.setRainTime((int) duration); + } else if (WeatherTypes.CLEAR.equals(weatherType)) { + info.setRaining(false); + info.setThundering(false); + info.setCleanWeatherTime((int) duration); + } } @Override