Skip to content

Commit

Permalink
Add CraftTweaker support for Fish Data. Closes #209
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed Feb 12, 2021
1 parent 417011d commit bed7c66
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ repositories {
name = "JEI maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
name = "CraftTweaker2"
url = "https://maven.blamejared.com"
}
flatDir { dirs 'deps' }
}

Expand Down Expand Up @@ -65,6 +69,7 @@ dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
compileOnly fg.deobf("mezz.jei:jei-1.16.4:${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-1.16.4:${jei_version}")
compileOnly fg.deobf("com.blamejared.crafttweaker:CraftTweaker-${minecraft_version}:${ct_version}")
}

jar {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ forge_version=36.0.1
mappings=20201028-1.16.3
mod_version=2.1.14
jei_version=7.6.1.65
ct_version=7.1.0.121

org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public int handleHookRetraction(@Nonnull ItemStack stack) {
builder.withParameter(LootParameters.KILLER_ENTITY, angler).withParameter(LootParameters.THIS_ENTITY, this);

List<ItemStack> lootEntries = getLoot(builder, serverWorld);

if (lootEntries.isEmpty()) {
if (this.world.getDimensionKey() == World.THE_END) {
lootEntries.add(new ItemStack(AquaItems.FISH_BONES));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.teammetallurgy.aquaculture.integration.crafttweaker;

import com.blamejared.crafttweaker.api.annotations.ZenRegister;
import com.blamejared.crafttweaker.api.item.IItemStack;
import com.teammetallurgy.aquaculture.api.AquacultureAPI;
import org.openzen.zencode.java.ZenCodeType;

@ZenRegister
@ZenCodeType.Name("mods.aquaculture.FishData")
public class CTFishData {

@ZenCodeType.Method
public void add(IItemStack fishStack, double min, double max, int filletAmount) {
AquacultureAPI.FISH_DATA.add(fishStack.getDefinition(), min, max, filletAmount);
}
}

0 comments on commit bed7c66

Please sign in to comment.