Skip to content

Commit

Permalink
Fix vanilla bta furnace bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSVK12 committed Feb 25, 2024
1 parent d2f1917 commit 330420e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bta_version=7.1-pre1a
loader_version=0.14.19-babric.3-bta

# Mod
mod_version=3.4.7
mod_version=3.4.8
mod_group=turniplabs
mod_name=halplibe

Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package turniplabs.halplibe.mixin.mixins;

import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.core.block.entity.TileEntityBlastFurnace;
import net.minecraft.core.block.entity.TileEntityFurnace;
import net.minecraft.core.data.registry.Registries;
import net.minecraft.core.data.registry.recipe.RecipeGroup;
import net.minecraft.core.data.registry.recipe.RecipeRegistry;
import net.minecraft.core.data.registry.recipe.entry.RecipeEntryBlastFurnace;
import net.minecraft.core.data.registry.recipe.entry.RecipeEntryFurnace;
import net.minecraft.core.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.List;

Expand Down Expand Up @@ -47,4 +51,11 @@ private RecipeEntryBlastFurnace getMatchingRecipe(){
}
return null;
}

//TODO: REMOVE THIS WHEN 7.1 RELEASES FULLY!!!
@Inject(method = "smeltItem", at = @At(value = "FIELD", target = "Lnet/minecraft/core/block/entity/TileEntityBlastFurnace;furnaceItemStacks:[Lnet/minecraft/core/item/ItemStack;", ordinal = 5))
public void fixBug(CallbackInfo ci, @Local ItemStack stack){
furnaceItemStacks[2].stackSize += stack.stackSize-1;
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package turniplabs.halplibe.mixin.mixins;

import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.core.block.entity.TileEntityFurnace;
import net.minecraft.core.data.registry.Registries;
import net.minecraft.core.data.registry.recipe.RecipeGroup;
Expand All @@ -10,7 +11,9 @@
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.List;

Expand Down Expand Up @@ -48,4 +51,10 @@ private RecipeEntryFurnace getMatchingRecipe(){
}
return null;
}

//TODO: REMOVE THIS WHEN 7.1 RELEASES FULLY!!!
@Inject(method = "smeltItem", at = @At(value = "FIELD", target = "Lnet/minecraft/core/block/entity/TileEntityFurnace;furnaceItemStacks:[Lnet/minecraft/core/item/ItemStack;", ordinal = 5))
public void fixBug(CallbackInfo ci, @Local ItemStack stack){
furnaceItemStacks[2].stackSize += stack.stackSize-1;
}
}

0 comments on commit 330420e

Please sign in to comment.