Few fixes for worldedit changes

This commit is contained in:
Matthew Miller
2019-04-29 19:59:41 +10:00
parent a3a175ab8c
commit 2571efb5c3
6 changed files with 53 additions and 32 deletions

View File

@ -0,0 +1,46 @@
/*
* WorldEdit, a Minecraft world manipulation toolkit
* 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
* (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.worldedit.internal.block;
import com.sk89q.worldedit.world.block.BlockState;
import java.util.OptionalInt;
public class BlockStateIdAccess {
private BlockStateIdAccess() {
}
public interface Provider {
OptionalInt getBlockStateId(BlockState holder);
}
private static Provider blockStateStateId;
public static void setBlockStateStateId(Provider blockStateStateId) {
BlockStateIdAccess.blockStateStateId = blockStateStateId;
}
public static OptionalInt getBlockStateId(BlockState holder) {
return blockStateStateId.getBlockStateId((BlockState) holder);
}
}

View File

@ -1,24 +0,0 @@
package com.sk89q.worldedit.internal.block;
import com.sk89q.worldedit.world.block.BlockState;
import java.util.OptionalInt;
public class BlockStateIdAcess {
public interface Provider {
OptionalInt getBlockStateId(BlockState holder);
}
private static Provider blockStateStateId;
public static void setBlockStateStateId(Provider blockStateStateId) {
BlockStateIdAcess.blockStateStateId = blockStateStateId;
}
public static OptionalInt getBlockStateId(BlockState holder) {
return blockStateStateId.getBlockStateId((BlockState) holder);
}
}

View File

@ -27,7 +27,7 @@ import com.google.common.collect.Table;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.internal.block.BlockStateIdAcess;
import com.sk89q.worldedit.internal.block.BlockStateIdAccess;
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.world.registry.BlockRegistry;
@ -48,7 +48,7 @@ import java.util.Set;
public class BlockState implements BlockStateHolder<BlockState> {
static {
BlockStateIdAcess.setBlockStateStateId(x -> x.internalId);
BlockStateIdAccess.setBlockStateStateId(x -> x.internalId);
}
private final BlockType blockType;

View File

@ -75,7 +75,7 @@ public class BundledItemData {
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.registerTypeAdapter(Vector3.class, new VectorAdapter());
Gson gson = gsonBuilder.create();
URL url = ResourceLoader.getResource(BundledItemData.class,"items.json");F
URL url = ResourceLoader.getResource(BundledItemData.class,"items.json");
if (url == null) {
throw new IOException("Could not find items.json");
}