Dieser Commit ist enthalten in:
NotMyFault 2019-12-09 21:34:26 +01:00
Ursprung 80d7b0582f
Commit a058f13d6e
5 geänderte Dateien mit 14 neuen und 36 gelöschten Zeilen

Datei anzeigen

@ -13,7 +13,7 @@ logger.lifecycle("""
1) Read COMPILING.md if you haven't yet 1) Read COMPILING.md if you haven't yet
2) Try running 'build' in a separate Gradle run 2) Try running 'build' in a separate Gradle run
3) Use gradlew and not gradle 3) Use gradlew and not gradle
4) If you still need help, ask on Discord! https://discord.gg/enginehub 4) If you still need help, ask on Discord! https://discord.gg/ngZCzbU
Output files will be in [subproject]/build/libs Output files will be in [subproject]/build/libs
******************************************* *******************************************

Datei anzeigen

@ -1,21 +0,0 @@
============= You are compiling: =============
_______ ___ ____ __ ____ _______
| ____| / \ \ \ / \ / / | ____|
| |__ / ^ \ \ \/ \/ / | |__
| __| / /_\ \ \ / | __|
| | / _____ \ \ /\ / | |____
|__| /__/ \__\ \__/ \__/ |_______|
======== Authors https://git.io/fjIDU ========
If you encounter trouble:
- Run `build` in a separate Gradle run
- Use gradlew and not gradle
- Ask us!
- https://discord.gg/ngZCzbU (Discord)
Files will be output to `/target`
==============================================

Datei anzeigen

@ -19,10 +19,7 @@
package com.sk89q.worldedit.bukkit; package com.sk89q.worldedit.bukkit;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.platform.AbstractNonPlayerActor; import com.sk89q.worldedit.extension.platform.AbstractNonPlayerActor;
import com.sk89q.worldedit.extension.platform.Locatable; import com.sk89q.worldedit.extension.platform.Locatable;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
@ -31,22 +28,24 @@ import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.util.auth.AuthorizationException; import com.sk89q.worldedit.util.auth.AuthorizationException;
import com.sk89q.worldedit.util.formatting.WorldEditText; import com.sk89q.worldedit.util.formatting.WorldEditText;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.util.formatting.text.adapter.bukkit.TextAdapter; import com.sk89q.worldedit.util.formatting.text.adapter.bukkit.TextAdapter;
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.command.BlockCommandSender; import org.bukkit.command.BlockCommandSender;
import java.util.Locale;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.nio.charset.StandardCharsets;
import java.util.Locale;
import java.util.UUID;
import static com.google.common.base.Preconditions.checkNotNull;
public class BukkitBlockCommandSender extends AbstractNonPlayerActor implements Locatable { public class BukkitBlockCommandSender extends AbstractNonPlayerActor implements Locatable {
private static final String UUID_PREFIX = "CMD";
private final BlockCommandSender sender; private final BlockCommandSender sender;
private final WorldEditPlugin plugin; private final WorldEditPlugin plugin;
private final Location location; private final Location location;
@ -59,7 +58,7 @@ public class BukkitBlockCommandSender extends AbstractNonPlayerActor implements
this.plugin = plugin; this.plugin = plugin;
this.sender = sender; this.sender = sender;
this.location = BukkitAdapter.adapt(sender.getBlock().getLocation()); this.location = BukkitAdapter.adapt(sender.getBlock().getLocation());
this.uuid = new UUID(location.toVector().toBlockPoint().hashCode(), location.getExtent().hashCode()); this.uuid = UUID.nameUUIDFromBytes((UUID_PREFIX + sender.getName()).getBytes(StandardCharsets.UTF_8));
} }
@Override @Override
@ -134,7 +133,6 @@ public class BukkitBlockCommandSender extends AbstractNonPlayerActor implements
@Override @Override
public SessionKey getSessionKey() { public SessionKey getSessionKey() {
return new SessionKey() { return new SessionKey() {
@Nullable
@Override @Override
public String getName() { public String getName() {
return sender.getName(); return sender.getName();
@ -154,7 +152,7 @@ public class BukkitBlockCommandSender extends AbstractNonPlayerActor implements
@Override @Override
public boolean isPersistent() { public boolean isPersistent() {
return false; return true;
} }
@Override @Override

Datei anzeigen

@ -27,6 +27,7 @@ import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Locatable;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.transform.BlockTransformExtent; import com.sk89q.worldedit.extent.transform.BlockTransformExtent;
import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.Mask;
@ -104,8 +105,8 @@ public class FactoryConverter<T> implements ArgumentConverter<T> {
ParserContext parserContext = new ParserContext(); ParserContext parserContext = new ParserContext();
parserContext.setActor(actor); parserContext.setActor(actor);
if (actor instanceof Entity) { if (actor instanceof Locatable) {
Extent extent = ((Entity) actor).getExtent(); Extent extent = ((Locatable) actor).getExtent();
if (extent instanceof World) { if (extent instanceof World) {
parserContext.setWorld((World) extent); parserContext.setWorld((World) extent);
} }

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 8.9 KiB