mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix Metrics injection
This commit is contained in:
parent
26d4ea101e
commit
ea0ca470f1
@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.extension.factory.parser.mask;
|
|
||||||
|
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
|
||||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
|
||||||
import com.sk89q.worldedit.extension.input.NoMatchException;
|
|
||||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
|
||||||
import com.sk89q.worldedit.extent.Extent;
|
|
||||||
import com.sk89q.worldedit.function.mask.BlockMask;
|
|
||||||
import com.sk89q.worldedit.function.mask.Mask;
|
|
||||||
import com.sk89q.worldedit.internal.registry.InputParser;
|
|
||||||
import com.sk89q.worldedit.session.request.Request;
|
|
||||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parses mask input strings.
|
|
||||||
*/
|
|
||||||
public class BlocksMaskParser extends InputParser<Mask> {
|
|
||||||
|
|
||||||
public BlocksMaskParser(WorldEdit worldEdit) {
|
|
||||||
super(worldEdit);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Mask parseFromInput(String component, ParserContext context) throws InputParseException {
|
|
||||||
Extent extent = Request.request().getEditSession();
|
|
||||||
|
|
||||||
ParserContext tempContext = new ParserContext(context);
|
|
||||||
tempContext.setRestricted(false);
|
|
||||||
tempContext.setPreferringWildcard(true);
|
|
||||||
try {
|
|
||||||
Set<BlockStateHolder> holders = worldEdit.getBlockFactory().parseFromListInput(component, tempContext);
|
|
||||||
if (holders.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new BlockMask(extent, holders);
|
|
||||||
} catch (NoMatchException e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.world.registry;
|
package com.sk89q.worldedit.world.registry;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.sk89q.worldedit.blocks.BaseItem;
|
import com.sk89q.worldedit.blocks.BaseItem;
|
||||||
import com.sk89q.worldedit.world.item.ItemType;
|
import com.sk89q.worldedit.world.item.ItemType;
|
||||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||||
@ -27,11 +26,6 @@ import com.sk89q.worldedit.world.item.ItemTypes;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
=======
|
|
||||||
import com.sk89q.worldedit.world.item.ItemType;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
>>>>>>> b75d5149... Fixed the bundle being directly used outside of the registry system.
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A item registry that uses {@link BundledItemRegistry} to serve information
|
* A item registry that uses {@link BundledItemRegistry} to serve information
|
||||||
@ -41,7 +35,6 @@ public class BundledItemRegistry implements ItemRegistry {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
<<<<<<< HEAD
|
|
||||||
public BaseItem createFromId(String id) {
|
public BaseItem createFromId(String id) {
|
||||||
ItemType itemType = ItemTypes.get(id);
|
ItemType itemType = ItemTypes.get(id);
|
||||||
return itemType == null ? null : new BaseItem(itemType);
|
return itemType == null ? null : new BaseItem(itemType);
|
||||||
@ -54,8 +47,6 @@ public class BundledItemRegistry implements ItemRegistry {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
=======
|
|
||||||
>>>>>>> b75d5149... Fixed the bundle being directly used outside of the registry system.
|
|
||||||
public String getName(ItemType itemType) {
|
public String getName(ItemType itemType) {
|
||||||
BundledItemData.ItemEntry itemEntry = BundledItemData.getInstance().findById(itemType.getId());
|
BundledItemData.ItemEntry itemEntry = BundledItemData.getInstance().findById(itemType.getId());
|
||||||
return itemEntry != null ? itemEntry.localizedName : null;
|
return itemEntry != null ? itemEntry.localizedName : null;
|
||||||
|
@ -19,23 +19,16 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.world.registry;
|
package com.sk89q.worldedit.world.registry;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import com.sk89q.worldedit.blocks.BaseItem;
|
import com.sk89q.worldedit.blocks.BaseItem;
|
||||||
import com.sk89q.worldedit.world.item.ItemType;
|
import com.sk89q.worldedit.world.item.ItemType;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
=======
|
|
||||||
import com.sk89q.worldedit.world.item.ItemType;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
>>>>>>> b75d5149... Fixed the bundle being directly used outside of the registry system.
|
|
||||||
|
|
||||||
public interface ItemRegistry {
|
public interface ItemRegistry {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
<<<<<<< HEAD
|
|
||||||
* Create a new item using its ID.
|
* Create a new item using its ID.
|
||||||
*
|
*
|
||||||
* @param id the id
|
* @param id the id
|
||||||
@ -52,8 +45,6 @@ public interface ItemRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
=======
|
|
||||||
>>>>>>> b75d5149... Fixed the bundle being directly used outside of the registry system.
|
|
||||||
* Gets the name for the given item.
|
* Gets the name for the given item.
|
||||||
*
|
*
|
||||||
* @param itemType the item
|
* @param itemType the item
|
||||||
|
@ -34,6 +34,7 @@ import com.sk89q.worldedit.sponge.adapter.SpongeImplAdapter;
|
|||||||
import com.sk89q.worldedit.sponge.adapter.SpongeImplLoader;
|
import com.sk89q.worldedit.sponge.adapter.SpongeImplLoader;
|
||||||
import com.sk89q.worldedit.sponge.config.SpongeConfiguration;
|
import com.sk89q.worldedit.sponge.config.SpongeConfiguration;
|
||||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||||
|
import org.bstats.sponge.Metrics2;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.spongepowered.api.Sponge;
|
import org.spongepowered.api.Sponge;
|
||||||
import org.spongepowered.api.block.BlockSnapshot;
|
import org.spongepowered.api.block.BlockSnapshot;
|
||||||
@ -75,6 +76,9 @@ public class SpongeWorldEdit {
|
|||||||
@Inject
|
@Inject
|
||||||
private Logger logger;
|
private Logger logger;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Metrics2 metrics;
|
||||||
|
|
||||||
public static final String MOD_ID = "worldedit";
|
public static final String MOD_ID = "worldedit";
|
||||||
|
|
||||||
private SpongePermissionsProvider provider;
|
private SpongePermissionsProvider provider;
|
||||||
|
Loading…
Reference in New Issue
Block a user