Skip to content

Commit

Permalink
Fix log spam caused by carry-on
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Nov 28, 2024
1 parent 5a6fbb2 commit 503eab5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ repositories {
exclusiveMaven("https://maven.wispforest.io", "me.alphamode")
exclusiveMaven("https://maven.terraformersmc.com/releases/", "com.terraformersmc")
exclusiveMaven("https://repo.erdbeerbaerlp.de/repository/maven-public/", "de.erdbeerbaerlp")
exclusiveMaven("https://maven.blamejared.com/", "tschipp.carryon")
flatDir {
dirs(setOf("libs"))
}
Expand Down Expand Up @@ -69,6 +70,8 @@ dependencies {
}

modCompileOnly("maven.modrinth:enchancement:1.20-26")

modImplementation("tschipp.carryon:carryon-fabric-1.20.1:2.1.2.7") { isTransitive = false }

// OPAC API
modApi("maven.modrinth:open-parties-and-claims:fabric-1.20.1-0.23.2")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
org.gradle.jvmargs=-Xmx2G

# Mod Properties
mod_version = 0.0.47
mod_version = 0.0.48
maven_group = dev.ithundxr
archives_base_name = RailwaysTweaks

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package dev.ithundxr.railwaystweaks.mixin.compat.carryon;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Cancellable;
import net.minecraft.world.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import tschipp.carryon.common.carry.PlacementHandler;

@Mixin(PlacementHandler.class)
public class PlacementHandlerMixin {
@WrapOperation(method = "tryStackEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;getBbHeight()F", ordinal = 0))
private static float railwaysTweaks$fixMissingNullcheck(Entity instance, Operation<Float> original, @Cancellable CallbackInfo ci) {
if (instance == null) {
ci.cancel();
return 0;
}

return original.call(instance);
}
}
1 change: 1 addition & 0 deletions src/main/resources/railwaystweaks.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"ServerPlayerMixin",
"ServerStatusPacketListenerImplMixin",
"compat.appleskin.SyncHandlerMixin",
"compat.carryon.PlacementHandlerMixin",
"compat.create.BlockHelperMixin",
"compat.create.Carriage$DimensionalCarriageEntityMixin",
"compat.create.CarriageAccessor",
Expand Down

0 comments on commit 503eab5

Please sign in to comment.