Upstream merge of the region package and things that may have broken with it.

This commit is contained in:
MattBDev
2020-08-18 15:48:31 -04:00
parent de34047365
commit 79b5612311
48 changed files with 852 additions and 678 deletions

View File

@ -3,18 +3,18 @@
* Copyright (C) sk89q <http://www.sk89q.com>
* 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
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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.
* 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 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/>.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit.world;
@ -64,9 +64,14 @@ public abstract class AbstractWorld implements World {
return null;
}
@Override
public int getMinY() {
return 0;
}
@Override
public int getMaxY() {
return getMaximumPoint().getBlockY();
return 255;
}
@Override
@ -124,12 +129,12 @@ public abstract class AbstractWorld implements World {
@Override
public BlockVector3 getMinimumPoint() {
return BlockVector3.at(-30000000, 0, -30000000);
return BlockVector3.at(-30000000, getMinY(), -30000000);
}
@Override
public BlockVector3 getMaximumPoint() {
return BlockVector3.at(30000000, 255, 30000000);
return BlockVector3.at(30000000, getMaxY(), 30000000);
}
@Override

View File

@ -99,6 +99,7 @@ public class NullWorld extends AbstractWorld {
public BiomeType getBiome(BlockVector2 position) {
return BiomeTypes.THE_VOID;
}
@Override
public BiomeType getBiomeType(int x, int y, int z) {
return BiomeTypes.THE_VOID;

View File

@ -100,7 +100,7 @@ public interface SimpleWorld extends World {
default void fixLighting(Iterable<BlockVector2> chunks) {
}
// @Override
// @Override
default boolean playEffect(BlockVector3 position, int type, int data) {
return false;
}

View File

@ -3,18 +3,18 @@
* Copyright (C) sk89q <http://www.sk89q.com>
* 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
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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.
* 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 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/>.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit.world;
@ -71,6 +71,13 @@ public interface World extends Extent, Keyed, IChunkCache<IChunkGet> {
@Nullable
Path getStoragePath();
/**
* Get the minimum Y.
*
* @return the minimum Y
*/
int getMinY();
/**
* Get the maximum Y.
*
@ -324,11 +331,9 @@ public interface World extends Extent, Keyed, IChunkCache<IChunkGet> {
}
/**
* Refresh a specific chunk
* Refresh a specific chunk.
* Note: only 0 is guaranteed to send all tiles / entities
* Note: Only 65535 is guaranteed to send all blocks
* @param chunkX
* @param chunkZ
*/
void refreshChunk(final int chunkX, final int chunkZ);
@ -336,7 +341,7 @@ public interface World extends Extent, Keyed, IChunkCache<IChunkGet> {
IChunkGet get(int x, int z);
/**
* Send a fake chunk to a player/s
* Send a fake chunk to a player.
* @param player may be null to send to everyone
* @param packet the chunk packet
*/