Skip to content

Commit

Permalink
Update for Minecraft 1.20.2
Browse files Browse the repository at this point in the history
Forge build is disabled until Neoforged updates
  • Loading branch information
jpenilla committed Sep 23, 2023
1 parent 86afb00 commit 837cf67
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import com.google.inject.Inject;
import io.netty.buffer.Unpooled;
import java.util.Collection;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Predicate;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket;
import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
Expand Down Expand Up @@ -159,19 +159,26 @@ public void worldChanged(final ServerPlayer player) {
}

private static void send(final ServerPlayer player, final ByteArrayDataOutput out) {
final ClientboundCustomPayloadPacket packet = new ClientboundCustomPayloadPacket(
CHANNEL,
new FriendlyByteBuf(Unpooled.wrappedBuffer(out.toByteArray()))
);
final ClientboundCustomPayloadPacket packet = new ClientboundCustomPayloadPacket(new SquaremapClientPayload(out));
player.connection.send(packet);
}

@SuppressWarnings("UnstableApiUsage")
private record SquaremapClientPayload(ByteArrayDataOutput out) implements CustomPacketPayload {
@Override
public void write(final FriendlyByteBuf friendlyByteBuf) {
friendlyByteBuf.writeBytes(this.out.toByteArray());
}

@Override
public ResourceLocation id() {
return CHANNEL;
}
}

private static ByteArrayDataOutput out() {
return ByteStreams.newDataOutput();
}

@SuppressWarnings("UnstableApiUsage")
private static ByteArrayDataInput in(final byte[] bytes) {
return ByteStreams.newDataInput(bytes);
}
Expand Down
14 changes: 7 additions & 7 deletions gradle/libs.versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ metadata:
plugins:
org.spongepowered.gradle.plugin: &sg 2.2.0
org.spongepowered.gradle.ore: *sg
xyz.jpenilla.run-paper: 2.1.0
xyz.jpenilla.run-paper: 2.2.0
net.minecrell.plugin-yml.bukkit: 0.5.3
io.papermc.hangar-publish-plugin: 0.0.5
io.papermc.hangar-publish-plugin: 0.1.0

versions:
minecraft: '1.20.1'
minecraft: '1.20.2'
checkerQual: 3.38.0
cloud: 1.8.4
cloudForge: 1.0.0+1.20-SNAPSHOT
cloudSponge: 1.8.0-SNAPSHOT
configurate: 4.1.2
adventure: 4.14.0
examination: 1.3.0
adventurePlatformFabric: 5.9.0
paperApi: 1.20.1-R0.1-SNAPSHOT
adventurePlatformFabric: 5.10.0-SNAPSHOT
paperApi: 1.20.2-R0.1-SNAPSHOT
bStats: 3.0.2
fabricApi: 0.83.0+1.20.1
fabricLoader: 0.14.21
fabricApi: 0.89.1+1.20.2
fabricLoader: 0.14.22
cardinalComponents: 5.2.2
guice: 5.1.0
forge: 1.20.1-47.0.0
Expand Down
10 changes: 7 additions & 3 deletions paper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ plugins {

val minecraftVersion = libs.versions.minecraft

configurations.compileOnly {
exclude("io.papermc.paper", "paper-api")
}

dependencies {
paperweight.foliaDevBundle(minecraftVersion.map { "$it-R0.1-SNAPSHOT" })
paperweight.paperDevBundle(minecraftVersion.map { "$it-R0.1-SNAPSHOT" })
compileOnly("dev.folia", "folia-api", "1.20.1-R0.1-SNAPSHOT")

implementation(projects.squaremapCommon)

Expand Down Expand Up @@ -63,8 +68,7 @@ runPaper.folia.registerTask()

hangarPublish.publications.register("plugin") {
version.set(project.version as String)
owner.set("jmp")
slug.set("squaremap")
id.set("squaremap")
channel.set("Release")
changelog.set(releaseNotes)
apiKey.set(providers.environmentVariable("HANGAR_UPLOAD_KEY"))
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ setupSubproject("api")
setupSubproject("common")
setupSubproject("paper")
setupSubproject("fabric")
setupSubproject("forge")
// setupSubproject("forge")
setupSubproject("sponge")

fun setupSubproject(moduleName: String) {
Expand Down

0 comments on commit 837cf67

Please sign in to comment.