Skip to content

Commit

Permalink
Backport to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenBagTwo committed Oct 22, 2024
1 parent f2b398d commit f93d88e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,16 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.20.5 upwards uses Java 21.
it.options.release = 21
it.options.release = 17
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

jar {
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
org.gradle.jvmargs=-Xmx2G
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.5
yarn_mappings=1.20.5+build.1
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.10
# Mod Properties
mod_version=handled.by.jgitver
maven_group=net.openbagtwo
archives_base_name=fox-nap
# Dependencies (optional or otherwise)
fabric_version=0.97.5+1.20.5
modmenu_version=9.1.0
fabric_version=0.97.0+1.20.4
modmenu_version=9.0.0
snakeyaml_version=2.2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.openbagtwo.foxnap.instruments;

import java.util.List;
import net.minecraft.client.item.TooltipType;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.GoatHornItem;
import net.minecraft.item.Item;
Expand All @@ -14,6 +14,7 @@
import net.minecraft.util.TypedActionResult;
import net.minecraft.world.World;
import net.minecraft.world.event.GameEvent;
import org.jetbrains.annotations.Nullable;

public class SecretlyJustAGoatHorn extends GoatHornItem {

Expand All @@ -32,10 +33,9 @@ public SecretlyJustAGoatHorn(SoundEvent soundEvent, int cooldown) {
@Override
public void appendTooltip(
ItemStack stack,
Item.TooltipContext context,
@Nullable World world,
List<Text> tooltip,
TooltipType type
) {
TooltipContext context) {
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.minecraft.util.math.random.Random;
import net.minecraft.village.TradeOffer;
import net.minecraft.village.TradeOffers;
import net.minecraft.village.TradedItem;
import net.openbagtwo.foxnap.instruments.SecretlyJustAGoatHorn;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -59,10 +58,10 @@ public TradeOffer create(Entity entity, Random random) {
}
Item selectedItem = this.itemPool.get(random.nextInt(this.itemPool.size()));
if (isBuy) {
return new TradeOffer(new TradedItem(selectedItem, this.price), new ItemStack(Items.EMERALD),
return new TradeOffer(new ItemStack(selectedItem, this.price), new ItemStack(Items.EMERALD),
this.maxUses, this.xp, 0.05F);
} else {
return new TradeOffer(new TradedItem(Items.EMERALD, this.price),
return new TradeOffer(new ItemStack(Items.EMERALD, this.price),
new ItemStack(selectedItem.asItem()),
this.maxUses, this.xp, 0.05F);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"depends": {
"fabricloader": ">=0.15.0",
"fabric": "*",
"minecraft": ">1.20.4",
"java": ">=21"
"minecraft": ">1.20.2 <=1.20.4",
"java": ">=17"
},
"accessWidener": "foxnap.accesswidener",
"mixins": [
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/records.mixins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"required": true,
"package": "net.openbagtwo.foxnap.mixins",
"compatibilityLevel": "JAVA_21",
"compatibilityLevel": "JAVA_17",
"mixins": [
"JukeboxBlockEntityMixin"
],
Expand Down

0 comments on commit f93d88e

Please sign in to comment.