Skip to content

Commit

Permalink
fix mixin apply error when using CC:T 1.112.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xiewuzhiying committed Aug 3, 2024
1 parent bebd605 commit cdfc899
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies {
modImplementation files("jars/createbigcannons-5.5.0-dev+mc.1.20.1-fabric-build.50.jar")

//ComputerCraft
modCompileOnly("maven.modrinth:cc-tweaked:1.111.0")
modCompileOnly("maven.modrinth:cc-tweaked:B9b58ZKh")

//Eureka
modCompileOnly("maven.modrinth:eureka:1.20.1-fabric-1.5.0-beta.3")
Expand Down
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dependencies {
modImplementation("maven.modrinth:create-clockwork:8JdnD9wo")

//ComputerCraft
modImplementation("maven.modrinth:cc-tweaked:1.111.0")
modImplementation("maven.modrinth:cc-tweaked:B9b58ZKh")

// CBC
modImplementation files("jars/createbigcannons-5.5.0-dev+mc.1.20.1-fabric-build.50.jar")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.github.xiewuzhiying.vs_addition.fabric.mixin.computercraft;

import dan200.computercraft.shared.pocket.core.PocketBrain;
import dan200.computercraft.shared.pocket.core.PocketHolder;
import dan200.computercraft.shared.pocket.core.PocketServerComputer;
import dan200.computercraft.shared.pocket.items.PocketComputerItem;
import io.github.xiewuzhiying.vs_addition.compats.computercraft.VSAdditionCC;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.Container;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -15,12 +15,12 @@
@Mixin(PocketComputerItem.class)
public abstract class MixinPocketComputerItem {
@Inject(
method = "createServerComputer",
method = "getOrCreateBrain",
at = @At("RETURN"),
remap = false
)
private void vs_addition$addAPI(ServerLevel level, Entity entity, Container inventory, ItemStack stack, CallbackInfoReturnable<PocketServerComputer> cir) {
PocketServerComputer computer = cir.getReturnValue();
private void vs_addition$addAPI(ServerLevel level, PocketHolder holder, ItemStack stack, CallbackInfoReturnable<PocketBrain> cir) {
PocketServerComputer computer = cir.getReturnValue().computer();

VSAdditionCC.applyCCAPIs(computer, level);

Expand Down
2 changes: 1 addition & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ dependencies {
modImplementation("com.tterrag.registrate:Registrate:${registrate_version}")

// ComputerCraft
modImplementation("maven.modrinth:cc-tweaked:eMzJxUoQ")
modImplementation("maven.modrinth:cc-tweaked:1.112.0")

//Eureka
modImplementation("maven.modrinth:eureka:1.20.1-forge-1.5.1-beta.3")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package io.github.xiewuzhiying.vs_addition.forge.mixin.computercraft;

import dan200.computercraft.shared.pocket.core.PocketBrain;
import dan200.computercraft.shared.pocket.core.PocketHolder;
import dan200.computercraft.shared.pocket.core.PocketServerComputer;
import dan200.computercraft.shared.pocket.items.PocketComputerItem;
import io.github.xiewuzhiying.vs_addition.compats.computercraft.VSAdditionCC;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.Container;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -16,15 +15,14 @@
@Mixin(PocketComputerItem.class)
public abstract class MixinPocketComputerItem {
@Inject(
method = "createServerComputer",
method = "getOrCreateBrain",
at = @At("RETURN"),
remap = false
)
private void vs_addition$addAPI(ServerLevel world, Entity entity, Container inventory, ItemStack stack, CallbackInfoReturnable<PocketServerComputer> cir) {
PocketServerComputer computer = cir.getReturnValue();
Level level = computer.getLevel();
private void vs_addition$addAPI(ServerLevel level, PocketHolder holder, ItemStack stack, CallbackInfoReturnable<PocketBrain> cir) {
PocketServerComputer computer = cir.getReturnValue().computer();

VSAdditionCC.applyCCAPIs(computer, (ServerLevel) level);
VSAdditionCC.applyCCAPIs(computer, level);

// cir.setReturnValue(computer);
}
Expand Down

0 comments on commit cdfc899

Please sign in to comment.