diff --git a/testplugins/src/main/java/org/spongepowered/test/channel/PingPacket.java b/testplugins/src/main/java/org/spongepowered/test/channel/PingPacket.java index 65d4460982c..6d069fbe756 100644 --- a/testplugins/src/main/java/org/spongepowered/test/channel/PingPacket.java +++ b/testplugins/src/main/java/org/spongepowered/test/channel/PingPacket.java @@ -24,10 +24,11 @@ */ package org.spongepowered.test.channel; -import com.google.common.base.MoreObjects; import org.spongepowered.api.network.channel.ChannelBuf; import org.spongepowered.api.network.channel.packet.RequestPacket; +import java.util.StringJoiner; + public final class PingPacket implements RequestPacket { private int id; @@ -55,8 +56,8 @@ public void write(final ChannelBuf buf) { @Override public String toString() { - return MoreObjects.toStringHelper(this) - .add("id", this.id) + return new StringJoiner(", ", PingPacket.class.getSimpleName() + "[", "]") + .add("id=" + this.id) .toString(); } } diff --git a/testplugins/src/main/java/org/spongepowered/test/channel/PongPacket.java b/testplugins/src/main/java/org/spongepowered/test/channel/PongPacket.java index 27268fbc082..960cbc1e321 100644 --- a/testplugins/src/main/java/org/spongepowered/test/channel/PongPacket.java +++ b/testplugins/src/main/java/org/spongepowered/test/channel/PongPacket.java @@ -24,10 +24,11 @@ */ package org.spongepowered.test.channel; -import com.google.common.base.MoreObjects; import org.spongepowered.api.network.channel.ChannelBuf; import org.spongepowered.api.network.channel.packet.Packet; +import java.util.StringJoiner; + public final class PongPacket implements Packet { private int id; @@ -55,8 +56,8 @@ public void write(final ChannelBuf buf) { @Override public String toString() { - return MoreObjects.toStringHelper(this) - .add("id", this.id) + return new StringJoiner(", ", PongPacket.class.getSimpleName() + "[", "]") + .add("id=" + this.id) .toString(); } } diff --git a/testplugins/src/main/java/org/spongepowered/test/channel/PrintTextPacket.java b/testplugins/src/main/java/org/spongepowered/test/channel/PrintTextPacket.java index 271ecc72f8f..7bfb92c47a2 100644 --- a/testplugins/src/main/java/org/spongepowered/test/channel/PrintTextPacket.java +++ b/testplugins/src/main/java/org/spongepowered/test/channel/PrintTextPacket.java @@ -24,10 +24,11 @@ */ package org.spongepowered.test.channel; -import com.google.common.base.MoreObjects; import org.spongepowered.api.network.channel.ChannelBuf; import org.spongepowered.api.network.channel.packet.Packet; +import java.util.StringJoiner; + public final class PrintTextPacket implements Packet { private String text; @@ -55,8 +56,8 @@ public void write(final ChannelBuf buf) { @Override public String toString() { - return MoreObjects.toStringHelper(this) - .add("text", this.text) + return new StringJoiner(", ", PrintTextPacket.class.getSimpleName() + "[", "]") + .add("text=" + this.text) .toString(); } } diff --git a/testplugins/src/main/java/org/spongepowered/test/data/DataTest.java b/testplugins/src/main/java/org/spongepowered/test/data/DataTest.java index 32da7fdf5b6..6ab7f9b8c4e 100644 --- a/testplugins/src/main/java/org/spongepowered/test/data/DataTest.java +++ b/testplugins/src/main/java/org/spongepowered/test/data/DataTest.java @@ -24,7 +24,6 @@ */ package org.spongepowered.test.data; -import com.google.common.collect.ImmutableMap; import com.google.inject.Inject; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.HoverEvent; @@ -328,7 +327,7 @@ public void testData(final ServerPlayer player) { armorStand.equip(EquipmentTypes.MAIN_HAND.get(), ItemStack.of(ItemTypes.DIAMOND)); armorStand.equip(EquipmentTypes.OFF_HAND.get(), ItemStack.of(ItemTypes.DIAMOND)); - armorStand.offer(Keys.BODY_ROTATIONS, ImmutableMap.of(BodyParts.CHEST.get(), Vector3d.RIGHT)); + armorStand.offer(Keys.BODY_ROTATIONS, Map.of(BodyParts.CHEST.get(), Vector3d.RIGHT)); // TODO wither.get(Keys.BOSS_BAR) diff --git a/testplugins/src/main/java/org/spongepowered/test/map/MapTest.java b/testplugins/src/main/java/org/spongepowered/test/map/MapTest.java index d4dc577104b..f031a89fbb2 100644 --- a/testplugins/src/main/java/org/spongepowered/test/map/MapTest.java +++ b/testplugins/src/main/java/org/spongepowered/test/map/MapTest.java @@ -24,7 +24,6 @@ */ package org.spongepowered.test.map; -import com.google.common.collect.Sets; import com.google.inject.Inject; import net.kyori.adventure.audience.Audience; import net.kyori.adventure.identity.Identity; @@ -211,7 +210,7 @@ private CommandResult addNamedDecoration(final CommandContext ctx) throws Comman .customName(Component.text("I AM A ").color(NamedTextColor.BLUE).append(BlockTypes.BLUE_BANNER.get())) .rotation(MapDecorationOrientations.NORTH) .build(); - heldMap.require(Keys.MAP_INFO).offer(Keys.MAP_DECORATIONS, Sets.newHashSet(decoration)); + heldMap.require(Keys.MAP_INFO).offer(Keys.MAP_DECORATIONS, Set.of(decoration)); return CommandResult.success(); } diff --git a/testplugins/src/main/java/org/spongepowered/test/trades/TradeTest.java b/testplugins/src/main/java/org/spongepowered/test/trades/TradeTest.java index 3d8486b6525..416e6d5027b 100644 --- a/testplugins/src/main/java/org/spongepowered/test/trades/TradeTest.java +++ b/testplugins/src/main/java/org/spongepowered/test/trades/TradeTest.java @@ -24,7 +24,6 @@ */ package org.spongepowered.test.trades; -import com.google.common.collect.ImmutableList; import com.google.inject.Inject; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; @@ -79,7 +78,7 @@ public TradeTest(final PluginContainer pluginContainer) { private static final Component LORE_FOURTH = TradeTest.blueText( "Granting delights for you and me"); private static final Component LORE_FIFTH = TradeTest.blueText("For ").append(TradeTest.sponge()).append(TradeTest.blueText(" is in a State of play")); private static final Component LORE_SIXTH = TradeTest.blueText("Today, be happy as can be!"); - static final ImmutableList LORE = ImmutableList.of( + static final List LORE = List.of( TradeTest.LORE_FIRST, TradeTest.LORE_SECOND, TradeTest.LORE_THIRD, TradeTest.LORE_FOURTH, TradeTest.LORE_FIFTH, @@ -104,10 +103,10 @@ public void enable(final CommandContext ctx) { public static final class SpawnListener { // Here are the items that we will sell and buy - private static final List> SELL_TYPES = ImmutableList.of( + private static final List> SELL_TYPES = List.of( ItemTypes.SLIME_BALL, ItemTypes.BLAZE_ROD, ItemTypes.APPLE, ItemTypes.GHAST_TEAR, ItemTypes.COBBLESTONE, ItemTypes.STICK, ItemTypes.EMERALD); - private static final List> BUYING_TYPES = ImmutableList.of( + private static final List> BUYING_TYPES = List.of( ItemTypes.ACACIA_DOOR, ItemTypes.ACACIA_LEAVES, ItemTypes.BIRCH_LEAVES, @@ -164,7 +163,7 @@ private void onSpawn(final SpawnEntityEvent event) { // the job.... because they have a mind of their own... .set(Keys.EXPERIENCE, 1) .set(Keys.EXPERIENCE_LEVEL, 1) - .set(Keys.TRADE_OFFERS, ImmutableList.of(SpawnListener.generateTradeOffer().apply(villager, villager.random()))); + .set(Keys.TRADE_OFFERS, List.of(SpawnListener.generateTradeOffer().apply(villager, villager.random()))); villager.copyFrom(container); }); } diff --git a/testplugins/src/main/java/org/spongepowered/test/volumestream/VolumeStreamTest.java b/testplugins/src/main/java/org/spongepowered/test/volumestream/VolumeStreamTest.java index 23acadfa7db..1de067274ed 100644 --- a/testplugins/src/main/java/org/spongepowered/test/volumestream/VolumeStreamTest.java +++ b/testplugins/src/main/java/org/spongepowered/test/volumestream/VolumeStreamTest.java @@ -24,7 +24,6 @@ */ package org.spongepowered.test.volumestream; -import com.google.common.collect.ImmutableList; import com.google.inject.Inject; import io.leangen.geantyref.TypeToken; import net.kyori.adventure.identity.Identity; @@ -81,6 +80,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.UUID; import java.util.zip.GZIPInputStream; @@ -127,7 +127,7 @@ public void onGamePreInitialization(final RegisterCommandEvent biomeKey = Parameter.registryElement( TypeToken.get(Biome.class), - ImmutableList.of( + List.of( VariableValueParameters.RegistryEntryBuilder.WORLD_FROM_LOCATABLE_HOLDER_PROVIDER , VariableValueParameters.RegistryEntryBuilder.WORLD_FROM_CAUSE_HOLDER_PROVIDER ),