From a1c4d07cfc74c18161eed85df40aa22bdd3a43ce Mon Sep 17 00:00:00 2001 From: sisby-folk Date: Sun, 28 Jul 2024 22:24:21 +1000 Subject: [PATCH] use standard actions (without modrinth, ofc) Co-authored-by: TheEpicBlock --- .editorconfig | 5 ++ .github/workflows/build.yml | 50 +++++++------------ .github/workflows/release.yml | 30 ++++------- gradle.properties | 7 +-- .../github/theepicblock/polymc/impl/Util.java | 1 - .../net/modfest/fireblanket/Fireblanket.java | 19 +++---- .../fireblanket/FireblanketClient.java | 5 +- .../modfest/fireblanket/FireblanketMixin.java | 9 ++-- .../zstd/MixinPersistentStateManager.java | 1 - .../render_regions/RegionSyncRequest.java | 4 +- 10 files changed, 49 insertions(+), 82 deletions(-) diff --git a/.editorconfig b/.editorconfig index 80aa62f..6d7dcc0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,6 +2,11 @@ indent_size = 4 indent_style = tab tab_width = 4 +insert_final_newline = true + +[*.yml] +indent_size = 2 +indent_style = space [*.java] ij_java_block_brace_style = end_of_line diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0900f62..b25623b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,40 +1,24 @@ -# Automatically build the project and run any configured tests for every push -# and submitted pull request. This can help catch issues that only occur on -# certain platforms or Java versions, and provides a first line of defence -# against bad commits. +name: Build -name: build -on: [pull_request, push] +on: [ push, pull_request ] jobs: build: - strategy: - matrix: - # Use these Java versions - java: [ - 21, # Current Java LTS & minimum supported by Minecraft - ] - # and run on both Linux and Windows - os: [ubuntu-22.04, windows-2022] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - - name: checkout repository - uses: actions/checkout@v3 - - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v1 - - name: setup jdk ${{ matrix.java }} - uses: actions/setup-java@v3 + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup jdk + uses: actions/setup-java@v4 with: - java-version: ${{ matrix.java }} - distribution: 'microsoft' - - name: make gradle wrapper executable - if: ${{ runner.os != 'Windows' }} - run: chmod +x ./gradlew - - name: build - run: ./gradlew build - - name: capture build artifacts - if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS - uses: actions/upload-artifact@v3 + java-version: 21 + distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 with: - name: Artifacts - path: build/libs/ \ No newline at end of file + validate-wrappers: true + + - name: Build with Gradle + run: ./gradlew build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37aecac..d28f6e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: release +name: Release on: release: @@ -6,32 +6,24 @@ on: - published jobs: - github-release: + upload: runs-on: ubuntu-latest steps: - - name: Cache - uses: actions/cache@v2 - with: - path: | - ~/.gradle/loom-cache - ~/.gradle/caches - ~/.gradle/wrapper - key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - gradle- - - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Setup JDK 21 - uses: actions/setup-java@v1 + - name: Setup jdk + uses: actions/setup-java@v4 with: java-version: 21 + distribution: 'temurin' - - name: Ensure gradlew is executable - run: chmod +x gradlew + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + validate-wrappers: true - - name: Build mod + - name: Build with Gradle run: ./gradlew build - name: Upload GitHub release diff --git a/gradle.properties b/gradle.properties index c5c37d5..cc06cf7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,10 +4,8 @@ org.gradle.caching=true org.gradle.parallel=true org.gradle.caching.debug=false org.gradle.configureondemand=true - # Loom fabric.loom.multiProjectOptimisation=true - # Mod Metadata archivesName=fireblanket group=net.modfest @@ -20,7 +18,6 @@ homepage=https://modrinth.com/mod/fireblanket issues=https://github.com/modfest/fireblanket/issues sources=https://github.com/modfest/fireblanket license=AGPL-3.0-or-later - # Mod Version -baseVersion = 0.5.4 -branch = 1.21 +baseVersion=0.5.4 +branch=1.21 diff --git a/src/dummy/java/io/github/theepicblock/polymc/impl/Util.java b/src/dummy/java/io/github/theepicblock/polymc/impl/Util.java index 0ffccfa..e4dbd20 100644 --- a/src/dummy/java/io/github/theepicblock/polymc/impl/Util.java +++ b/src/dummy/java/io/github/theepicblock/polymc/impl/Util.java @@ -1,7 +1,6 @@ package io.github.theepicblock.polymc.impl; import io.github.theepicblock.polymc.api.PolyMap; - import net.minecraft.server.network.ServerPlayerEntity; public class Util { diff --git a/src/main/java/net/modfest/fireblanket/Fireblanket.java b/src/main/java/net/modfest/fireblanket/Fireblanket.java index 967962f..e46181d 100644 --- a/src/main/java/net/modfest/fireblanket/Fireblanket.java +++ b/src/main/java/net/modfest/fireblanket/Fireblanket.java @@ -1,13 +1,14 @@ package net.modfest.fireblanket; +import com.google.common.base.Stopwatch; +import com.mojang.brigadier.builder.LiteralArgumentBuilder; import net.fabricmc.api.EnvType; import net.fabricmc.api.ModInitializer; - -import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; import net.fabricmc.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents; import net.fabricmc.fabric.api.event.Event; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents; +import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback; import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry; import net.fabricmc.fabric.api.networking.v1.ServerLoginConnectionEvents; @@ -15,11 +16,10 @@ import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.block.Block; import net.minecraft.network.ClientConnection; import net.minecraft.network.PacketCallbacks; -import net.minecraft.network.packet.CustomPayload; import net.minecraft.network.packet.Packet; -import net.minecraft.block.Block; import net.minecraft.registry.Registries; import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.ServerCommandSource; @@ -34,23 +34,18 @@ import net.modfest.fireblanket.compat.PolyMcCompat; import net.modfest.fireblanket.mixin.accessor.ClientConnectionAccessor; import net.modfest.fireblanket.mixin.accessor.ServerChunkManagerAccessor; +import net.modfest.fireblanket.mixin.accessor.ServerLoginNetworkHandlerAccessor; +import net.modfest.fireblanket.mixinsupport.FSCConnection; import net.modfest.fireblanket.net.BatchedBEUpdatePayload; import net.modfest.fireblanket.net.CommandBlockPacket; import net.modfest.fireblanket.world.blocks.UpdateSignBlockEntityTypes; -import net.modfest.fireblanket.mixin.accessor.ServerLoginNetworkHandlerAccessor; -import net.modfest.fireblanket.mixinsupport.FSCConnection; +import net.modfest.fireblanket.world.entity.EntityFilters; import net.modfest.fireblanket.world.render_regions.RegionSyncRequest; import net.modfest.fireblanket.world.render_regions.RenderRegions; import net.modfest.fireblanket.world.render_regions.RenderRegionsState; -import net.modfest.fireblanket.world.entity.EntityFilters; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.mojang.brigadier.builder.LiteralArgumentBuilder; - -import com.google.common.base.Stopwatch; - import java.nio.file.Files; import java.nio.file.Path; import java.util.concurrent.LinkedBlockingQueue; diff --git a/src/main/java/net/modfest/fireblanket/FireblanketClient.java b/src/main/java/net/modfest/fireblanket/FireblanketClient.java index 8c778f2..28d9638 100644 --- a/src/main/java/net/modfest/fireblanket/FireblanketClient.java +++ b/src/main/java/net/modfest/fireblanket/FireblanketClient.java @@ -1,9 +1,6 @@ package net.modfest.fireblanket; -import java.util.concurrent.CompletableFuture; - import com.mojang.brigadier.builder.LiteralArgumentBuilder; - import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; @@ -31,6 +28,8 @@ import net.modfest.fireblanket.world.render_regions.RegionSyncRequest; import net.modfest.fireblanket.world.render_regions.RenderRegions; +import java.util.concurrent.CompletableFuture; + public class FireblanketClient implements ClientModInitializer { public static final RenderRegions renderRegions = new RenderRegions(); diff --git a/src/main/java/net/modfest/fireblanket/FireblanketMixin.java b/src/main/java/net/modfest/fireblanket/FireblanketMixin.java index f4073d4..17c78ab 100644 --- a/src/main/java/net/modfest/fireblanket/FireblanketMixin.java +++ b/src/main/java/net/modfest/fireblanket/FireblanketMixin.java @@ -1,15 +1,14 @@ package net.modfest.fireblanket; -import java.util.List; -import java.util.Set; - +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.Bootstrap; import org.objectweb.asm.tree.ClassNode; import org.slf4j.LoggerFactory; import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; import org.spongepowered.asm.mixin.extensibility.IMixinInfo; -import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.Bootstrap; +import java.util.List; +import java.util.Set; public class FireblanketMixin implements IMixinConfigPlugin { public static final boolean GAMEPLAY_CHANGES = Boolean.getBoolean("fireblanket.gameplayChanges"); diff --git a/src/main/java/net/modfest/fireblanket/mixin/zstd/MixinPersistentStateManager.java b/src/main/java/net/modfest/fireblanket/mixin/zstd/MixinPersistentStateManager.java index 4da9de4..0d8511e 100644 --- a/src/main/java/net/modfest/fireblanket/mixin/zstd/MixinPersistentStateManager.java +++ b/src/main/java/net/modfest/fireblanket/mixin/zstd/MixinPersistentStateManager.java @@ -25,7 +25,6 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.util.Map; import java.util.function.BiFunction; import java.util.zip.GZIPInputStream; diff --git a/src/main/java/net/modfest/fireblanket/world/render_regions/RegionSyncRequest.java b/src/main/java/net/modfest/fireblanket/world/render_regions/RegionSyncRequest.java index 5f16e36..5a79b27 100644 --- a/src/main/java/net/modfest/fireblanket/world/render_regions/RegionSyncRequest.java +++ b/src/main/java/net/modfest/fireblanket/world/render_regions/RegionSyncRequest.java @@ -175,9 +175,7 @@ public boolean valid() { } - record FullStateLegacy(ImmutableMap regions, - ImmutableMultimap entityAttachments, - ImmutableMultimap blockAttachments) implements RegionSyncRequest { + record FullStateLegacy(ImmutableMap regions, ImmutableMultimap entityAttachments, ImmutableMultimap blockAttachments) implements RegionSyncRequest { @Override public RequestType type() {