Skip to content

Commit

Permalink
Re-added CraftTweaker support
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed Dec 2, 2023
1 parent 0e53173 commit 697a14b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dependencies {
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
//compileOnly fg.deobf("com.blamejared.crafttweaker:CraftTweaker-forge-1.18.1:${ct_version}")
compileOnly fg.deobf("com.blamejared.crafttweaker:CraftTweaker-forge-${minecraft_version}:${ct_version}")
}

def resourceTargets = ['META-INF/mods.toml']
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ loader_version_range=[47,)
mod_id=aq2
mod_version=2.5.0
jei_version=15.1.0.19
ct_version=9.0.81
ct_version=14.0.27

org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*
package com.teammetallurgy.aquaculture.integration.crafttweaker;

import com.blamejared.crafttweaker.api.CraftTweakerAPI;
Expand All @@ -21,4 +20,4 @@ public static void add(Item fish, double min, double max, int filletAmount) {
public static void remove(Item fish) {
CraftTweakerAPI.apply(new RemoveFishDataAction(fish));
}
}*/
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
package com.teammetallurgy.aquaculture.integration.crafttweaker.actions;

import com.blamejared.crafttweaker.api.action.base.IUndoableAction;
import com.teammetallurgy.aquaculture.api.AquacultureAPI;
import net.minecraft.world.item.Item;
import net.minecraftforge.registries.ForgeRegistries;

public class AddFishDataAction implements IUndoableAction {
private final Item fish;
Expand All @@ -22,6 +22,11 @@ public AddFishDataAction(Item fish, double min, double max, int filletAmount) {
this.filletAmount = filletAmount;
}

@Override
public String systemName() {
return "Aquaculture Add Fish Data";
}

@Override
public void apply() {
if (AquacultureAPI.FISH_DATA.hasWeight(this.fish)) {
Expand All @@ -38,7 +43,7 @@ public void apply() {

@Override
public String describe() {
return "Adding FishData for: " + this.fish.getRegistryName() + " with min: " + this.min + ", max: " + this.max + " and fillet amount of: " + this.filletAmount;
return "Adding FishData for: " + ForgeRegistries.ITEMS.getKey(this.fish).toString() + " with min: " + this.min + ", max: " + this.max + " and fillet amount of: " + this.filletAmount;
}

@Override
Expand All @@ -52,6 +57,6 @@ public void undo() {

@Override
public String describeUndo() {
return "Undoing removal of FishData for: " + this.fish.getRegistryName();
return "Undoing removal of FishData for: " + ForgeRegistries.ITEMS.getKey(this.fish).toString();
}
}*/
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
package com.teammetallurgy.aquaculture.integration.crafttweaker.actions;

import com.blamejared.crafttweaker.api.action.base.IUndoableAction;
import com.teammetallurgy.aquaculture.api.AquacultureAPI;
import net.minecraft.world.item.Item;
import net.minecraftforge.registries.ForgeRegistries;

public class RemoveFishDataAction implements IUndoableAction {
private final Item fish;
Expand All @@ -15,6 +15,11 @@ public RemoveFishDataAction(Item fish) {
this.fish = fish;
}

@Override
public String systemName() {
return "Aquaculture Remove Fish Data";
}

@Override
public void apply() {
this.min = AquacultureAPI.FISH_DATA.getMinWeight(this.fish, 0);
Expand All @@ -25,20 +30,20 @@ public void apply() {

@Override
public String describe() {
return "Removing FishData for: " + this.fish.getRegistryName();
return "Removing FishData for: " + ForgeRegistries.ITEMS.getKey(this.fish).toString();
}

@Override
public void undo() {
if (this.filletAmount > 0) {
AquacultureAPI.FISH_DATA.add(this.fish, this.min, this.max, this.filletAmount);
} else {
AquacultureAPI.FISH_DATA.add(this.fish, this.min, this.max);
AquacultureAPI.FISH_DATA.add(this.fish, this.min, this.max, 0);
}
}

@Override
public String describeUndo() {
return "Undoing removal of FishData for: " + this.fish.getRegistryName();
return "Undoing removal of FishData for: " + ForgeRegistries.ITEMS.getKey(this.fish).toString();
}
}*/
}

0 comments on commit 697a14b

Please sign in to comment.