Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-09-06 08:02:50 +02:00
Shade in Kashike's lib
Dieser Commit ist enthalten in:
Ursprung
3e4004ad9e
Commit
55348346e9
@ -142,6 +142,9 @@ subprojects {
|
||||
include(dependency('com.sk89q:jchronic:0.2.4a'))
|
||||
include(dependency('com.thoughtworks.paranamer:paranamer:2.6'))
|
||||
include(dependency('com.sk89q.lib:jlibnoise:1.0.0'))
|
||||
relocate('net.kyori.text', 'com.sk89q.worldedit.util.formatting') {
|
||||
include(dependency('net.kyori:text-api:2.0.0'))
|
||||
}
|
||||
}
|
||||
exclude 'GradleStart**'
|
||||
exclude '.cache'
|
||||
|
@ -16,6 +16,7 @@
|
||||
<allow pkg="net.royawesome.jlibnoise"/>
|
||||
<allow pkg="org.json.simple" />
|
||||
<allow pkg="org.slf4j"/>
|
||||
<allow pkg="net.kyori.text"/>
|
||||
|
||||
<subpackage name="util.yaml">
|
||||
<allow pkg="org.yaml.snakeyaml"/>
|
||||
|
@ -15,6 +15,7 @@ dependencies {
|
||||
compile 'org.bstats:bstats-bukkit:1.4'
|
||||
compile "io.papermc:paperlib:1.0.1"
|
||||
compile 'org.slf4j:slf4j-jdk14:1.7.26'
|
||||
compile 'net.kyori:text-adapter-bukkit:1.0.3'
|
||||
testCompile 'org.mockito:mockito-core:1.9.0-rc1'
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,8 @@ import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.internal.cui.CUIEvent;
|
||||
import com.sk89q.worldedit.session.SessionKey;
|
||||
import com.sk89q.worldedit.util.auth.AuthorizationException;
|
||||
import com.sk89q.worldedit.util.formatting.Fragment;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.adapter.bukkit.TextAdapter;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -93,9 +94,8 @@ public class BukkitCommandSender implements Actor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(Fragment fragment) {
|
||||
// TODO Bukkit is bad and the API is somewhat lacking
|
||||
printRaw(fragment.toString());
|
||||
public void print(TextComponent component) {
|
||||
TextAdapter.sendComponent(sender, component);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,14 +31,14 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.session.SessionKey;
|
||||
import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.formatting.Fragment;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||
import com.sk89q.worldedit.world.gamemode.GameModes;
|
||||
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.adapter.bukkit.TextAdapter;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -127,9 +127,8 @@ public class BukkitPlayer extends AbstractPlayerActor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(Fragment fragment) {
|
||||
// TODO Bukkit is bad and the API is somewhat lacking
|
||||
printRaw(fragment.toString());
|
||||
public void print(TextComponent component) {
|
||||
TextAdapter.sendComponent(player, component);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,6 +13,7 @@ dependencies {
|
||||
compile 'com.sk89q.lib:jlibnoise:1.0.0'
|
||||
compile 'com.googlecode.json-simple:json-simple:1.1.1'
|
||||
compile 'org.slf4j:slf4j-api:1.7.26'
|
||||
compile 'net.kyori:text-api:2.0.0'
|
||||
//compile 'net.sf.trove4j:trove4j:3.0.3'
|
||||
testCompile 'org.mockito:mockito-core:1.9.0-rc1'
|
||||
}
|
||||
@ -29,4 +30,4 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
build.dependsOn(shadowJar)
|
||||
build.dependsOn(shadowJar { classifier = null })
|
||||
|
@ -23,7 +23,7 @@ import com.sk89q.worldedit.internal.cui.CUIEvent;
|
||||
import com.sk89q.worldedit.session.SessionOwner;
|
||||
import com.sk89q.worldedit.util.Identifiable;
|
||||
import com.sk89q.worldedit.util.auth.Subject;
|
||||
import com.sk89q.worldedit.util.formatting.Fragment;
|
||||
import net.kyori.text.TextComponent;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@ -77,11 +77,11 @@ public interface Actor extends Identifiable, SessionOwner, Subject {
|
||||
void printError(String msg);
|
||||
|
||||
/**
|
||||
* Print a {@link Fragment}.
|
||||
* Print a {@link TextComponent}.
|
||||
*
|
||||
* @param fragment The fragment to print
|
||||
* @param component The component to print
|
||||
*/
|
||||
void print(Fragment fragment);
|
||||
void print(TextComponent component);
|
||||
|
||||
/**
|
||||
* Returns true if the actor can destroy bedrock.
|
||||
|
@ -31,10 +31,10 @@ import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.session.SessionKey;
|
||||
import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.util.formatting.Fragment;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||
import net.kyori.text.TextComponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@ -134,8 +134,8 @@ class PlayerProxy extends AbstractPlayerActor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(Fragment fragment) {
|
||||
basePlayer.print(fragment);
|
||||
public void print(TextComponent component) {
|
||||
basePlayer.print(component);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ def forgeVersion = "25.0.76"
|
||||
dependencies {
|
||||
compile project(':worldedit-core')
|
||||
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.2'
|
||||
compile 'net.kyori:text-serializer-gson:2.0.0'
|
||||
|
||||
minecraft "net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}"
|
||||
|
||||
|
@ -34,6 +34,7 @@ import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
@ -141,6 +142,11 @@ public class ForgePlayer extends AbstractPlayerActor {
|
||||
sendColorized(msg, TextFormatting.RED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(TextComponent component) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
private void sendColorized(String msg, TextFormatting formatting) {
|
||||
for (String part : msg.split("\n")) {
|
||||
TextComponentString component = new TextComponentString(part);
|
||||
|
@ -19,6 +19,7 @@ dependencies {
|
||||
compile project(':worldedit-core')
|
||||
compile 'org.spongepowered:spongeapi:7.1.0'
|
||||
compile 'org.bstats:bstats-sponge:1.4'
|
||||
compile 'net.kyori:text-adapter-spongeapi:1.0.3'
|
||||
testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1'
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,8 @@ import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.internal.cui.CUIEvent;
|
||||
import com.sk89q.worldedit.session.SessionKey;
|
||||
import com.sk89q.worldedit.util.auth.AuthorizationException;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.adapter.spongeapi.TextAdapter;
|
||||
import org.spongepowered.api.command.CommandSource;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.text.Text;
|
||||
@ -89,6 +91,11 @@ public class SpongeCommandSender implements Actor {
|
||||
sendColorized(msg, TextColors.RED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(TextComponent component) {
|
||||
TextAdapter.sendComponent(sender, component);
|
||||
}
|
||||
|
||||
private void sendColorized(String msg, TextColor formatting) {
|
||||
for (String part : msg.split("\n")) {
|
||||
sender.sendMessage(Text.of(formatting, TextSerializers.LEGACY_FORMATTING_CODE.deserialize(part)));
|
||||
|
@ -36,6 +36,8 @@ import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||
import com.sk89q.worldedit.world.gamemode.GameModes;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.adapter.spongeapi.TextAdapter;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.data.type.HandTypes;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
@ -149,6 +151,11 @@ public class SpongePlayer extends AbstractPlayerActor {
|
||||
sendColorized(msg, TextColors.RED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(TextComponent component) {
|
||||
TextAdapter.sendComponent(player, component);
|
||||
}
|
||||
|
||||
private void sendColorized(String msg, TextColor formatting) {
|
||||
for (String part : msg.split("\n")) {
|
||||
this.player.sendMessage(Text.of(formatting, TextSerializers.FORMATTING_CODE.deserialize(part)));
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren