Skip to content

Commit

Permalink
update to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenithRogue committed Jan 20, 2024
1 parent 8cbceeb commit f631257
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.22
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.6
# Mod Properties
mod_version=1.1.0
mod_version=1.0.5
maven_group=dev.zenithknight.mcmods
archives_base_name=expandeddata
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.87.0+1.20.1
fabric_version=0.95.0+1.20.4
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
package dev.zenithknight.mcmods.expandeddata;

import net.fabricmc.api.ModInitializer;
//import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
//import net.minecraft.block.Block;
//import net.minecraft.block.Blocks;
//import net.minecraft.block.DispenserBlock;
//import net.minecraft.block.dispenser.BlockPlacementDispenserBehavior;
//import net.minecraft.block.dispenser.ShearsDispenserBehavior;
//import net.minecraft.item.BlockItem;
//import net.minecraft.item.Item;
//import net.minecraft.item.Items;
//import net.minecraft.registry.Registries;
//import net.minecraft.registry.Registry;
//import net.minecraft.util.Identifier;

public class ExpandedData implements ModInitializer {
@Override
public void onInitialize() {
System.out.println("Initialized Expanded Data mod!");
// DispenserBlock.registerBehavior(Blocks.CAKE.asItem(), new BlockPlacementDispenserBehavior());
// DispenserBlock.registerBehavior(Items.BUCKET.asItem(), new ShearsDispenserBehavior());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtList;
import net.minecraft.screen.PlayerScreenHandler;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -22,14 +23,18 @@ private static void entityToNbtMixin(Entity entity, CallbackInfoReturnable<NbtCo
nbtCompound.put("CursorItem", itemStack.writeNbt(new NbtCompound()));
}
if (!((PlayerEntity) entity).playerScreenHandler.getCraftingInput().isEmpty()) {
RecipeInputInventory craftingInput = ((PlayerEntity) entity).playerScreenHandler.getCraftingInput();
PlayerScreenHandler screenHandler = ((PlayerEntity) entity).playerScreenHandler;
RecipeInputInventory craftingInput = screenHandler.getCraftingInput();
NbtList nbtList = new NbtList();
for(int i = 0; i < craftingInput.size(); ++i) {
NbtCompound stackNbtCompound = craftingInput.getStack(i).writeNbt(new NbtCompound());
stackNbtCompound.putByte("Slot", (byte) i);
nbtList.add(stackNbtCompound);
}
nbtCompound.put("CraftingItems", nbtList);
if (screenHandler.getSlot(screenHandler.getCraftingResultSlotIndex()).hasStack()) {
nbtCompound.put("CraftingResult", screenHandler.getSlot(screenHandler.getCraftingResultSlotIndex()).getStack().writeNbt(new NbtCompound()));
}
}
}
cir.setReturnValue(nbtCompound);
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 @@ -23,7 +23,7 @@
"expandeddata.mixins.json"
],
"depends": {
"fabricloader": ">=0.14.17",
"minecraft": ">=1.20"
"fabricloader": ">=0.15.6",
"minecraft": ">=1.20.4"
}
}

0 comments on commit f631257

Please sign in to comment.