Skip to content

Commit

Permalink
Update to 1.20.5/6 (#262)
Browse files Browse the repository at this point in the history
Co-authored-by: Potatoboy9999 <[email protected]>
  • Loading branch information
DrexHD and PotatoPresident authored Jun 1, 2024
1 parent 3335e5d commit bbe4d75
Show file tree
Hide file tree
Showing 84 changed files with 993 additions and 719 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up python 3
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install mkdocs and mike
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'temurin'
- name: Build artifacts
run: ./gradlew build
- name: Upload build artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: build/libs
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v1
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'temurin'

- name: Build release
run: ./gradlew build
Expand Down
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ dependencies {
// Config
shadow(libs.konf.core)
shadow(libs.konf.toml)

detektPlugins(libs.detekt.formatting)
}

tasks {
val javaVersion = JavaVersion.VERSION_17
val javaVersion = JavaVersion.VERSION_21

processResources {
inputs.property("id", modId)
Expand Down
42 changes: 15 additions & 27 deletions detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ complexity:
threshold: 10
includeStaticDeclarations: false
includePrivateDeclarations: false
ComplexMethod:
CyclomaticComplexMethod:
active: false
threshold: 15
ignoreSingleWhenExpression: false
Expand Down Expand Up @@ -258,7 +258,6 @@ formatting:
active: false
autoCorrect: false
indentSize: 4
continuationIndentSize: 4
MaximumLineLength:
active: true
maxLineLength: 120
Expand Down Expand Up @@ -359,7 +358,6 @@ naming:
parameterPattern: '[a-z][A-Za-z0-9]*'
privateParameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true
EnumNaming:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
Expand All @@ -381,13 +379,11 @@ naming:
excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
excludeClassPattern: '$^'
ignoreOverridden: true
FunctionParameterNaming:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
parameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true
InvalidPackageDeclaration: # If you want to use this, set the root package and enable it
active: false
rootPackage: 'template'
Expand Down Expand Up @@ -429,7 +425,6 @@ naming:
variablePattern: '[a-z][A-Za-z0-9]*'
privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true

performance:
active: true
Expand All @@ -448,8 +443,6 @@ potential-bugs:
active: true
Deprecation:
active: true
DuplicateCaseInWhenExpression:
active: true
EqualsAlwaysReturnsTrueOrFalse:
active: true
EqualsWithHashCodeExist:
Expand All @@ -474,16 +467,12 @@ potential-bugs:
LateinitUsage:
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
excludeAnnotatedProperties: []
ignoreAnnotated: []
ignoreOnClassesPattern: ''
MapGetWithNotNullAssertionOperator:
active: true
MissingWhenCase:
active: true
NullableToStringCall:
active: true
RedundantElseInWhen:
active: true
UnconditionalJumpStatementInLoop:
active: true
UnnecessaryNotNullOperator:
Expand All @@ -503,13 +492,15 @@ potential-bugs:

style:
active: true
BracesOnWhenStatements:
active: true
ClassOrdering:
active: true
CollapsibleIfStatements:
active: true
DataClassContainsFunctions:
active: false
conversionFunctionPrefix: 'to'
conversionFunctionPrefix: ['to']
DataClassShouldBeImmutable:
active: false
EqualsNullCall:
Expand All @@ -525,7 +516,7 @@ style:
includeLineWrapping: false
ForbiddenComment:
active: false
values: ['TODO:', 'FIXME:', 'STOPSHIP:']
comments: ['TODO:', 'FIXME:', 'STOPSHIP:']
allowedPatterns: ''
ForbiddenImport:
active: false
Expand All @@ -534,18 +525,15 @@ style:
ForbiddenMethodCall:
active: false
methods: []
ForbiddenPublicDataClass:
active: false
ignorePackages: ['*.internal', '*.internal.*']
ForbiddenVoid:
active: true
ignoreOverridden: true
ignoreUsageInGenerics: false
FunctionOnlyReturningConstant:
active: true
ignoreOverridableFunction: true
excludedFunctions: 'describeContents'
excludeAnnotatedFunction: ['dagger.Provides']
excludedFunctions: ['describeContents']
ignoreAnnotated: ['dagger.Provides']
LibraryCodeMustSpecifyReturnType:
active: true
LibraryEntitiesShouldNotBePublic:
Expand All @@ -566,7 +554,7 @@ style:
ignoreNamedArgument: true
ignoreEnums: true
ignoreRanges: false
MandatoryBracesIfStatements:
BracesOnIfStatements:
active: true
MandatoryBracesLoops:
active: true
Expand All @@ -590,8 +578,6 @@ style:
active: true
OptionalUnit:
active: false
OptionalWhenBraces:
active: true
PreferToOverPairSyntax:
active: true
ProtectedMemberInFinalClass:
Expand All @@ -603,7 +589,7 @@ style:
ReturnCount:
active: false
max: 2
excludedFunctions: 'equals'
excludedFunctions: ['equals']
excludeLabeled: false
excludeReturnFromLambda: true
excludeGuardClauses: false
Expand All @@ -620,10 +606,10 @@ style:
active: true
UnderscoresInNumericLiterals:
active: true
acceptableDecimalLength: 5
acceptableLength: 5
UnnecessaryAbstractClass:
active: true
excludeAnnotatedClasses: ['dagger.Module']
ignoreAnnotated: ['dagger.Module']
UnnecessaryAnnotationUseSiteTarget:
active: true
UnnecessaryApply:
Expand All @@ -638,6 +624,8 @@ style:
active: true
UnusedImports:
active: true
UnusedParameter:
active: false
UnusedPrivateClass:
active: true
UnusedPrivateMember:
Expand All @@ -651,7 +639,7 @@ style:
active: true
UseDataClass:
active: true
excludeAnnotatedClasses: []
ignoreAnnotated: []
allowVars: false
UseEmptyCounterpart:
active: true
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
![Last commit](https://img.shields.io/github/last-commit/quiltservertools/ledger?color=7e56c2&style=for-the-badge)
![Contributors](https://img.shields.io/github/contributors/quiltservertools/ledger?color=7e56c2&style=for-the-badge)

Ledger is a server-side fabric logging mod for modern Minecraft 1.17 and 1.18.
Ledger is a server-side fabric logging mod for modern Minecraft 1.17+.
Ledger has been written from scratch in Kotlin to solve the main issues of previous logging mods have encountered.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kotlin.code.style=official
org.gradle.jvmargs=-Xmx2G

# Mod Properties
modVersion = 1.3.1
modVersion = 1.3.2
mavenGroup = com.github.quiltservertools
modId = ledger
modName = Ledger
Expand Down
22 changes: 13 additions & 9 deletions libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[versions]
minecraft = "1.20.4"
yarn-mappings = "1.20.4+build.1"
fabric-loader = "0.15.10"
minecraft = "1.20.6"
yarn-mappings = "1.20.6+build.3"
fabric-loader = "0.15.11"

fabric-api = "0.91.3+1.20.4"
fabric-api = "0.99.0+1.20.6"

# Kotlin
kotlin = "1.8.22"
kotlin = "1.9.23"
# Also modrinth version in gradle.properties
fabric-kotlin = "1.9.4+kotlin.1.8.21"
fabric-kotlin = "1.10.19+kotlin.1.9.23"

fabric-permissions = "0.3.1"
translations = "2.2.0+1.20.3-rc1"
translations = "2.3.0+1.20.5-rc2"

exposed = "0.46.0"
sqlite-jdbc = "3.44.1.0"
Expand All @@ -20,6 +20,8 @@ konf = "1.1.2"

wdmcf = "1.0.2"

detect = "1.23.6"

[libraries]
minecraft = { module = "net.minecraft:minecraft", version.ref = "minecraft" }
yarn-mappings = { module = "net.fabricmc:yarn", version.ref = "yarn-mappings" }
Expand All @@ -39,12 +41,14 @@ sqlite-jdbc = { module = "org.xerial:sqlite-jdbc", version.ref = "sqlite-jdbc" }

konf-core = { module = "com.uchuhimo:konf-core", version.ref = "konf"}
konf-toml = { module = "com.uchuhimo:konf-toml", version.ref = "konf"}
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detect" }

wdmcf = { module = "me.bymartrixx:wdmcf", version.ref = "wdmcf" }

[plugins]
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.19.0" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detect" }
loom = { id = "fabric-loom", version = "1.6.+" }
git_hooks = { id = "com.github.jakemarsden.git-hooks", version = "0.0.2" }
shadow = { id = "com.github.johnrengelman.shadow", version = "7.1.2" }
# https://github.com/johnrengelman/shadow/issues/894
shadow = { id = "io.github.goooler.shadow", version = "8.1.7" }
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(targets = "net/minecraft/block/dispenser/DispenserBehavior$9")
@Mixin(targets = "net/minecraft/block/dispenser/DispenserBehavior$16")
public abstract class BucketDispenserBehaviorMixin extends ItemDispenserBehavior {

@Inject(
method = "dispenseSilently(Lnet/minecraft/util/math/BlockPointer;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;",
method = "dispenseSilently",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/block/FluidDrainable;tryDrainFluid(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/item/ItemStack;",
shift = At.Shift.AFTER
)
)
private void logFluidPickup(BlockPointer pointer, ItemStack stack, CallbackInfoReturnable<ItemStack> cir, @Local ItemStack itemStack, @Local BlockPos pos, @Local BlockState blockState) {
private void logFluidPickup(BlockPointer pointer, ItemStack stack, CallbackInfoReturnable<ItemStack> cir, @Local(argsOnly = true) ItemStack itemStack, @Local BlockPos pos, @Local BlockState blockState) {
var world = pointer.world();
if (!itemStack.isEmpty()) {
if (blockState.isLiquid() || blockState.isOf(Blocks.POWDER_SNOW)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private void logWaterlog(PlayerEntity player, World world, BlockPos pos, BlockHi
}
}

@Inject(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;incrementStat(Lnet/minecraft/stat/Stat;)V"))
@Inject(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;incrementStat(Lnet/minecraft/stat/Stat;)V", ordinal = 0))
private void logFluidPickup(World world, PlayerEntity player, Hand hand, CallbackInfoReturnable<TypedActionResult<ItemStack>> cir, @Local(ordinal = 0) BlockPos pos, @Local BlockState blockState) {
if (blockState.getBlock() instanceof Waterloggable) {
BlockChangeCallback.EVENT.invoker().changeBlock(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.minecraft.block.enums.BedPart;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
Expand All @@ -35,12 +34,12 @@ public void logBedBreak(World world, BlockPos pos, BlockState state, PlayerEntit
}

@Inject(method = "onUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;removeBlock(Lnet/minecraft/util/math/BlockPos;Z)Z"))
public void storeBlockEntity(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit, CallbackInfoReturnable<ActionResult> cir) {
public void storeBlockEntity(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit, CallbackInfoReturnable<ActionResult> cir) {
oldBlockEntity = world.getBlockEntity(pos);
}

@Inject(method = "onUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;removeBlock(Lnet/minecraft/util/math/BlockPos;Z)Z", shift = At.Shift.AFTER))
public void logBedExplosion(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit, CallbackInfoReturnable<ActionResult> cir) {
public void logBedExplosion(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit, CallbackInfoReturnable<ActionResult> cir) {
BlockBreakCallback.EVENT.invoker().breakBlock(world, pos, state, oldBlockEntity, Sources.INTERACT, player);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import net.minecraft.block.BlockState;
import net.minecraft.block.CakeBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.state.property.IntProperty;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.ItemActionResult;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
Expand Down Expand Up @@ -56,11 +58,11 @@ private static void ledgerLogCakeEatAndRemove(
player);
}

@Inject(method = "onUse", at = @At(value = "INVOKE",
@Inject(method = "onUseWithItem", at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/World;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z",
shift = At.Shift.AFTER))
private void ledgerLogCakeAddCandle(
BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit, CallbackInfoReturnable<ActionResult> cir) {
ItemStack itemStack, BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult blockHitResult, CallbackInfoReturnable<ItemActionResult> cir) {
BlockChangeCallback.EVENT.invoker().changeBlock(
player.getWorld(),
pos,
Expand Down
Loading

0 comments on commit bbe4d75

Please sign in to comment.