Skip to content

Commit

Permalink
WIP Update to 1.21.4
Browse files Browse the repository at this point in the history
Assistance needed in the recipe department
  • Loading branch information
QPCrummer committed Dec 24, 2024
1 parent 421c182 commit 6a32153
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 35 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import java.nio.charset.StandardCharsets

plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'fabric-loom' version '1.9-SNAPSHOT'
id 'maven-publish'
id("com.modrinth.minotaur") version "2.8.7"
}
Expand All @@ -26,10 +26,10 @@ dependencies {

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
modImplementation include("eu.pb4:polymer-core:0.9.11+1.21.1")
modImplementation include("xyz.nucleoid:server-translations-api:2.3.1+1.21-pre2")
modImplementation "maven.modrinth:lithium:mc1.21.1-0.13.0"
include(implementation("com.moulberry:mixinconstraints:1.0.1"))
modImplementation include("eu.pb4:polymer-core:0.11.3+1.21.4")
modImplementation include("xyz.nucleoid:server-translations-api:2.4.0+1.21.2-rc1")
modImplementation "maven.modrinth:lithium:mc1.21.4-0.14.3-fabric"
include(implementation("com.moulberry:mixinconstraints:1.0.2"))
}

loom {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
org.gradle.jvmargs=-Xmx1G
minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3
loader_version=0.16.2
fabric_version=0.102.1+1.21.1
mod_version=1.0.18
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.2
loader_version=0.16.9
fabric_version=0.112.2+1.21.4
mod_version=1.0.19
maven_group=com.github.tatercertified
archives_base_name=fabricautocrafter
modrinth_id=wbqioEpc
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.stat.Stats;
import net.minecraft.util.ActionResult;
import net.minecraft.util.ItemScatterer;
Expand All @@ -16,6 +17,7 @@
import net.minecraft.world.World;
import net.minecraft.world.explosion.Explosion;
import org.jetbrains.annotations.Nullable;
import xyz.nucleoid.packettweaker.PacketContext;

import static net.minecraft.block.Blocks.CRAFTING_TABLE;

Expand All @@ -37,7 +39,7 @@ protected ActionResult onUse(BlockState state, World world, BlockPos pos, Player
}

@Override
public BlockState getPolymerBlockState(BlockState state) {
public BlockState getPolymerBlockState(BlockState blockState, PacketContext packetContext) {
return CRAFTING_TABLE.getDefaultState();
}

Expand Down Expand Up @@ -77,7 +79,7 @@ public void onStateReplaced(BlockState oldState, World world, BlockPos pos, Bloc
}

@Override
public void onDestroyedByExplosion(World world, BlockPos pos, Explosion explosion) {
public void onDestroyedByExplosion(ServerWorld world, BlockPos pos, Explosion explosion) {
if (world.getBlockEntity(pos) instanceof AutoCraftingTableBlockEntity entity) {
ItemScatterer.spawn(world, pos, entity.getHeldStacks());
if (!entity.getOutput().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import eu.pb4.polymer.core.api.block.PolymerBlockUtils;
import eu.pb4.polymer.core.api.item.PolymerBlockItem;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
Expand All @@ -22,7 +23,7 @@ public class AutoCrafterMod implements ModInitializer {
public static final Identifier IDENTIFIER = Identifier.of("autocrafter", "autocrafter");
public static final Block BLOCK = new AutoCrafter(AbstractBlock.Settings.copy(Blocks.CRAFTING_TABLE).strength(2.5f, 2.5f));
public static final BlockItem ITEM = new PolymerBlockItem(BLOCK, new Item.Settings(), Items.CRAFTING_TABLE);
public static final BlockEntityType<AutoCraftingTableBlockEntity> TYPE = BlockEntityType.Builder.create(AutoCraftingTableBlockEntity::new, BLOCK).build(null);
public static final BlockEntityType<AutoCraftingTableBlockEntity> TYPE = FabricBlockEntityTypeBuilder.create(AutoCraftingTableBlockEntity::new, BLOCK).build();

@Override
public void onInitialize() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registryL
super.writeNbt(nbt, registryLookup);
Inventories.writeNbt(nbt, inventory, registryLookup);
if (!output.isEmpty()) {
nbt.put("Output", output.encode(registryLookup));
nbt.put("Output", output.toNbt(registryLookup));
}
}

Expand Down Expand Up @@ -169,7 +169,7 @@ public boolean canPlayerUse(PlayerEntity player) {
}

@Override
public void provideRecipeInputs(RecipeMatcher finder) {
public void provideRecipeInputs(RecipeFinder finder) {
for (ItemStack stack : this.inventory) finder.addInput(stack);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket;
import net.minecraft.recipe.CraftingRecipe;
import net.minecraft.recipe.RecipeEntry;
import net.minecraft.recipe.RecipeMatcher;
import net.minecraft.recipe.RecipeUnlocker;
import net.minecraft.recipe.*;
import net.minecraft.screen.CraftingScreenHandler;
import net.minecraft.screen.slot.Slot;
import net.minecraft.server.network.ServerPlayNetworkHandler;
Expand Down Expand Up @@ -86,27 +83,28 @@ public void close(PlayerEntity player) {
}

@Override
public void populateRecipeFinder(RecipeMatcher finder) {
public void populateRecipeFinder(RecipeFinder finder) {
this.crafting_inv.provideRecipeInputs(finder);
}

@Override
public void clearCraftingSlots() {
this.crafting_inv.clear();
}
// TODO See if these are needed anymore
//@Override
//public void clearCraftingSlots() {
// this.crafting_inv.clear();
//}

@Override
public boolean matches(RecipeEntry<CraftingRecipe> recipe) {
return recipe.value().matches(this.crafting_inv.createRecipeInput(), this.player.getWorld());
}
//@Override
//public boolean matches(RecipeEntry<CraftingRecipe> recipe) {
// return recipe.value().matches(this.crafting_inv.createRecipeInput(), this.player.getWorld());
//}

@Override
public int getCraftingWidth() {
public int getWidth() {
return this.crafting_inv.getWidth();
}

@Override
public int getCraftingHeight() {
public int getHeight() {
return this.crafting_inv.getHeight();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.github.tatercertified.fabricautocrafter.AutoCraftingTableBlockEntity;
import com.moulberry.mixinconstraints.annotations.IfModLoaded;
import me.jellysquid.mods.lithium.common.block.entity.SleepingBlockEntity;
import me.jellysquid.mods.lithium.mixin.world.block_entity_ticking.sleeping.WrappedBlockEntityTickInvokerAccessor;
import net.caffeinemc.mods.lithium.common.block.entity.SleepingBlockEntity;
import net.caffeinemc.mods.lithium.mixin.world.block_entity_ticking.sleeping.WrappedBlockEntityTickInvokerAccessor;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.block.entity.LockableContainerBlockEntity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.github.tatercertified.fabricautocrafter.AutoCraftingTableBlockEntity;
import com.github.tatercertified.fabricautocrafter.AutoCraftingTableContainer;
import com.moulberry.mixinconstraints.annotations.IfModLoaded;
import me.jellysquid.mods.lithium.common.block.entity.SleepingBlockEntity;
import net.caffeinemc.mods.lithium.common.block.entity.SleepingBlockEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"depends": {
"fabricloader": "*",
"fabric": "*",
"minecraft": ">=1.21",
"minecraft": ">=1.21.4",
"java": ">=21"
},
"recommends": {
Expand Down

0 comments on commit 6a32153

Please sign in to comment.