Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Adventure: Introduce WorldEdit to an adventure #2406

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/LibsConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ fun Project.applyLibrariesConfiguration() {

val relocations = mapOf(
"net.kyori.text" to "com.sk89q.worldedit.util.formatting.text",
"net.kyori.adventure" to "com.sk89q.worldedit.util.adventure",
"net.kyori.minecraft" to "com.sk89q.worldedit.util.kyori",
)

Expand Down
5 changes: 3 additions & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import org.gradle.api.Project

object Versions {
const val TEXT = "3.0.4"
const val TEXT_EXTRAS = "3.0.6"
const val PISTON = "0.5.7"
const val KYORI_ADVENTURE = "4.14.0"
const val KYORI_PLATFORM_BUKKIT = "4.3.1"
const val PISTON = "0.6.0-SNAPSHOT"
const val AUTO_VALUE = "1.9"
const val JUNIT = "5.8.1"
const val MOCKITO = "4.3.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
{
}
"Default implementation in interface added": [
{
"type": "com.sk89q.worldedit.bukkit.BukkitBlockCommandSender",
"member": "Method com.sk89q.worldedit.bukkit.BukkitBlockCommandSender.print(com.sk89q.worldedit.util.formatting.text.Component)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.bukkit.BukkitBlockRegistry",
"member": "Method com.sk89q.worldedit.bukkit.BukkitBlockRegistry.getRichName(com.sk89q.worldedit.world.block.BlockType)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.bukkit.BukkitCommandSender",
"member": "Method com.sk89q.worldedit.bukkit.BukkitCommandSender.print(com.sk89q.worldedit.util.formatting.text.Component)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.bukkit.BukkitPlayer",
"member": "Method com.sk89q.worldedit.bukkit.BukkitPlayer.print(com.sk89q.worldedit.util.formatting.text.Component)",
"changes": [
"METHOD_REMOVED"
]
}
]
}
11 changes: 10 additions & 1 deletion verification/src/changes/accepted-cli-public-api-changes.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
{
}
"Default implementation in interface added": [
{
"type": "com.sk89q.worldedit.cli.CLICommandSender",
"member": "Method com.sk89q.worldedit.cli.CLICommandSender.print(com.sk89q.worldedit.util.formatting.text.Component)",
"changes": [
"METHOD_REMOVED"
]
}
]
}
42 changes: 42 additions & 0 deletions verification/src/changes/accepted-core-public-api-changes.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@
"changes": [
"METHOD_NEW_DEFAULT"
]
},
{
"type": "com.sk89q.worldedit.world.registry.ItemRegistry",
"member": "Method com.sk89q.worldedit.world.registry.ItemRegistry.getDisplayName(com.sk89q.worldedit.blocks.BaseItemStack)",
"changes": [
"METHOD_NEW_DEFAULT"
]
}
],
"LazyReference was never publicly extensible": [
Expand Down Expand Up @@ -216,6 +223,41 @@
"changes": [
"METHOD_NEW_DEFAULT"
]
},
{
"type": "com.sk89q.worldedit.extension.platform.Actor",
"member": "Method com.sk89q.worldedit.extension.platform.Actor.printDebug(com.sk89q.worldedit.util.adventure.text.Component)",
"changes": [
"METHOD_NEW_DEFAULT"
]
},
{
"type": "com.sk89q.worldedit.extension.platform.Actor",
"member": "Method com.sk89q.worldedit.extension.platform.Actor.printError(com.sk89q.worldedit.util.adventure.text.Component)",
"changes": [
"METHOD_NEW_DEFAULT"
]
},
{
"type": "com.sk89q.worldedit.extension.platform.Actor",
"member": "Method com.sk89q.worldedit.extension.platform.Actor.printInfo(com.sk89q.worldedit.util.adventure.text.Component)",
"changes": [
"METHOD_NEW_DEFAULT"
]
},
{
"type": "com.sk89q.worldedit.function.operation.Operation",
"member": "Method com.sk89q.worldedit.function.operation.Operation.getMessages()",
"changes": [
"METHOD_NEW_DEFAULT"
]
},
{
"type": "com.sk89q.worldedit.regions.RegionSelector",
"member": "Method com.sk89q.worldedit.regions.RegionSelector.getSelectionInformationLines()",
"changes": [
"METHOD_NEW_DEFAULT"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,46 @@
{
"Default implementation in interface added": [
{
"type": "com.sk89q.worldedit.fabric.FabricBlockCommandSender",
"member": "Method com.sk89q.worldedit.fabric.FabricBlockCommandSender.print(com.sk89q.worldedit.util.formatting.text.Component)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.fabric.FabricBlockRegistry",
"member": "Method com.sk89q.worldedit.fabric.FabricBlockRegistry.getRichName(com.sk89q.worldedit.world.block.BlockType)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.fabric.FabricCommandSender",
"member": "Method com.sk89q.worldedit.fabric.FabricCommandSender.print(com.sk89q.worldedit.util.formatting.text.Component)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.fabric.FabricItemRegistry",
"member": "Method com.sk89q.worldedit.fabric.FabricItemRegistry.getRichName(com.sk89q.worldedit.world.item.ItemType)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.fabric.FabricItemRegistry",
"member": "Method com.sk89q.worldedit.fabric.FabricItemRegistry.getRichName(com.sk89q.worldedit.blocks.BaseItemStack)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.fabric.FabricPlayer",
"member": "Method com.sk89q.worldedit.fabric.FabricPlayer.print(com.sk89q.worldedit.util.formatting.text.Component)",
"changes": [
"METHOD_REMOVED"
]
}
]
}
58 changes: 58 additions & 0 deletions verification/src/changes/accepted-forge-public-api-changes.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,60 @@
{
"Default implementation in interface added": [
{
"type": "com.sk89q.worldedit.forge.ForgeBlockCommandSender",
"member": "Method com.sk89q.worldedit.forge.ForgeBlockCommandSender.print(com.sk89q.worldedit.util.formatting.text.Component)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.forge.ForgeBlockRegistry",
"member": "Method com.sk89q.worldedit.forge.ForgeBlockRegistry.getRichName(com.sk89q.worldedit.world.block.BlockType)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.forge.ForgeCommandSender",
"member": "Method com.sk89q.worldedit.forge.ForgeCommandSender.print(com.sk89q.worldedit.util.formatting.text.Component)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.forge.ForgeItemRegistry",
"member": "Method com.sk89q.worldedit.forge.ForgeItemRegistry.getRichName(com.sk89q.worldedit.world.item.ItemType)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.forge.ForgeItemRegistry",
"member": "Method com.sk89q.worldedit.forge.ForgeItemRegistry.getRichName(com.sk89q.worldedit.blocks.BaseItemStack)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.forge.ForgePlayer",
"member": "Method com.sk89q.worldedit.forge.ForgePlayer.print(com.sk89q.worldedit.util.formatting.text.Component)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.forge.WorldEditFakePlayer",
"member": "Method com.sk89q.worldedit.forge.WorldEditFakePlayer.m_36391_(boolean)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.forge.WorldEditFakePlayer",
"member": "Method com.sk89q.worldedit.forge.WorldEditFakePlayer.m_5893_(net.minecraft.world.MenuProvider)",
"changes": [
"METHOD_REMOVED"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.util.SideEffect;
import com.sk89q.worldedit.util.adventure.text.Component;
import com.sk89q.worldedit.util.concurrency.LazyReference;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.util.io.file.SafeFiles;
import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.RegenOptions;
Expand Down Expand Up @@ -544,17 +543,17 @@ private void removeUnwantedEntityTagsRecursively(CompoundTag tag) {

@Override
public Component getRichBlockName(BlockType blockType) {
return TranslatableComponent.of(getBlockFromType(blockType).getDescriptionId());
return Component.translatable(getBlockFromType(blockType).getDescriptionId());
}

@Override
public Component getRichItemName(ItemType itemType) {
return TranslatableComponent.of(getItemFromType(itemType).getDescriptionId());
return Component.translatable(getItemFromType(itemType).getDescriptionId());
}

@Override
public Component getRichItemName(BaseItemStack itemStack) {
return TranslatableComponent.of(CraftItemStack.asNMSCopy(BukkitAdapter.adapt(itemStack)).getDescriptionId());
return Component.translatable(CraftItemStack.asNMSCopy(BukkitAdapter.adapt(itemStack)).getDescriptionId());
}

@SuppressWarnings({ "unchecked", "rawtypes" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.util.SideEffect;
import com.sk89q.worldedit.util.adventure.text.Component;
import com.sk89q.worldedit.util.concurrency.LazyReference;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.util.io.file.SafeFiles;
import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.RegenOptions;
Expand Down Expand Up @@ -536,17 +535,17 @@ private void removeUnwantedEntityTagsRecursively(CompoundTag tag) {

@Override
public Component getRichBlockName(BlockType blockType) {
return TranslatableComponent.of(getBlockFromType(blockType).getDescriptionId());
return Component.translatable(getBlockFromType(blockType).getDescriptionId());
}

@Override
public Component getRichItemName(ItemType itemType) {
return TranslatableComponent.of(getItemFromType(itemType).getDescriptionId());
return Component.translatable(getItemFromType(itemType).getDescriptionId());
}

@Override
public Component getRichItemName(BaseItemStack itemStack) {
return TranslatableComponent.of(CraftItemStack.asNMSCopy(BukkitAdapter.adapt(itemStack)).getDescriptionId());
return Component.translatable(CraftItemStack.asNMSCopy(BukkitAdapter.adapt(itemStack)).getDescriptionId());
}

@SuppressWarnings({ "unchecked", "rawtypes" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.util.SideEffect;
import com.sk89q.worldedit.util.adventure.text.Component;
import com.sk89q.worldedit.util.concurrency.LazyReference;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.util.io.file.SafeFiles;
import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.RegenOptions;
Expand Down Expand Up @@ -568,17 +567,17 @@ private void removeUnwantedEntityTagsRecursively(net.minecraft.nbt.CompoundTag t

@Override
public Component getRichBlockName(BlockType blockType) {
return TranslatableComponent.of(getBlockFromType(blockType).getDescriptionId());
return Component.translatable(getBlockFromType(blockType).getDescriptionId());
}

@Override
public Component getRichItemName(ItemType itemType) {
return TranslatableComponent.of(getItemFromType(itemType).getDescriptionId());
return Component.translatable(getItemFromType(itemType).getDescriptionId());
}

@Override
public Component getRichItemName(BaseItemStack itemStack) {
return TranslatableComponent.of(CraftItemStack.asNMSCopy(BukkitAdapter.adapt(itemStack)).getDescriptionId());
return Component.translatable(CraftItemStack.asNMSCopy(BukkitAdapter.adapt(itemStack)).getDescriptionId());
}

@SuppressWarnings({ "unchecked", "rawtypes" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.util.SideEffect;
import com.sk89q.worldedit.util.adventure.text.Component;
import com.sk89q.worldedit.util.concurrency.LazyReference;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.util.io.file.SafeFiles;
import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.RegenOptions;
Expand Down Expand Up @@ -568,17 +567,17 @@ private void removeUnwantedEntityTagsRecursively(net.minecraft.nbt.CompoundTag t

@Override
public Component getRichBlockName(BlockType blockType) {
return TranslatableComponent.of(getBlockFromType(blockType).getDescriptionId());
return Component.translatable(getBlockFromType(blockType).getDescriptionId());
}

@Override
public Component getRichItemName(ItemType itemType) {
return TranslatableComponent.of(getItemFromType(itemType).getDescriptionId());
return Component.translatable(getItemFromType(itemType).getDescriptionId());
}

@Override
public Component getRichItemName(BaseItemStack itemStack) {
return TranslatableComponent.of(CraftItemStack.asNMSCopy(BukkitAdapter.adapt(itemStack)).getDescriptionId());
return Component.translatable(CraftItemStack.asNMSCopy(BukkitAdapter.adapt(itemStack)).getDescriptionId());
}

@SuppressWarnings({ "unchecked", "rawtypes" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.util.SideEffect;
import com.sk89q.worldedit.util.adventure.text.Component;
import com.sk89q.worldedit.util.concurrency.LazyReference;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.util.io.file.SafeFiles;
import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.RegenOptions;
Expand Down Expand Up @@ -568,17 +567,17 @@ private void removeUnwantedEntityTagsRecursively(net.minecraft.nbt.CompoundTag t

@Override
public Component getRichBlockName(BlockType blockType) {
return TranslatableComponent.of(getBlockFromType(blockType).getDescriptionId());
return Component.translatable(getBlockFromType(blockType).getDescriptionId());
}

@Override
public Component getRichItemName(ItemType itemType) {
return TranslatableComponent.of(getItemFromType(itemType).getDescriptionId());
return Component.translatable(getItemFromType(itemType).getDescriptionId());
}

@Override
public Component getRichItemName(BaseItemStack itemStack) {
return TranslatableComponent.of(CraftItemStack.asNMSCopy(BukkitAdapter.adapt(itemStack)).getDescriptionId());
return Component.translatable(CraftItemStack.asNMSCopy(BukkitAdapter.adapt(itemStack)).getDescriptionId());
}

@SuppressWarnings({ "unchecked", "rawtypes" })
Expand Down
Loading
Loading