Update framed blocks integration

This commit is contained in:
simibubi 2024-08-07 10:39:18 +02:00
parent c373de47b1
commit 42b57bdd61
3 changed files with 21 additions and 9 deletions

View file

@ -204,7 +204,7 @@ dependencies {
// implementation fg.deobf("curse.maven:druidcraft-340991:3101903")
// implementation fg.deobf("com.ferreusveritas.dynamictrees:DynamicTrees-1.16.5:0.10.0-Beta25")
// runtimeOnly fg.deobf("curse.maven:framedblocks-441647:4567924")
// runtimeOnly fg.deobf("curse.maven:framedblocks-441647:4762544")
// runtimeOnly fg.deobf("curse.maven:galosphere-631098:4398234")
// runtimeOnly fg.deobf("curse.maven:elementary-ores-332609:3956498")
// runtimeOnly fg.deobf("curse.maven:flib-661261:3956196")

View file

@ -8,7 +8,7 @@ mod_version = 0.5.1.g
artifact_minecraft_version = 1.19.2
minecraft_version = 1.19.2
forge_version = 43.2.4
forge_version = 43.2.14
# build dependency versions
forgegradle_version = 5.1.74
@ -25,7 +25,7 @@ registrate_version = MC1.19-1.1.5
flywheel_minecraft_version = 1.19.2
flywheel_version = 0.6.10-20
jei_minecraft_version = 1.19.2
jei_version = 11.2.0.254
jei_version = 11.6.0.1024
curios_minecraft_version = 1.19.2
curios_version = 5.1.4.1

View file

@ -9,6 +9,7 @@ import com.simibubi.create.content.schematics.requirement.ItemRequirement.ItemUs
import com.simibubi.create.content.schematics.requirement.ItemRequirement.StackRequirement;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.entity.BlockEntity;
@ -17,7 +18,7 @@ import net.minecraft.world.level.block.state.BlockState;
public class FramedBlocksInSchematics {
static final List<String> KEYS_TO_RETAIN =
List.of("intangible", "glowing", "reinforced", "camo_stack", "camo_stack_two", "camo_state", "camo_state_two");
List.of("intangible", "glowing", "reinforced", "camo", "camo_two");
public static CompoundTag prepareBlockEntityData(BlockState blockState, BlockEntity blockEntity) {
CompoundTag data = null;
@ -32,6 +33,14 @@ public class FramedBlocksInSchematics {
keysToRemove.add(key);
for (String key : keysToRemove)
data.remove(key);
if (data.getCompound("camo")
.contains("fluid"))
data.remove("camo");
if (data.getCompound("camo_two")
.contains("fluid"))
data.remove("camo_two");
return data;
}
@ -53,17 +62,20 @@ public class FramedBlocksInSchematics {
list.add(new StackRequirement(new ItemStack(Mods.FRAMEDBLOCKS.getItem("framed_reinforcement")),
ItemUseType.CONSUME));
if (data.contains("camo_stack"))
addCamoStack(data.getCompound("camo_stack"), list);
if (data.contains("camo"))
addCamoStack(data.getCompound("camo"), list);
if (data.contains("camo_stack_two"))
addCamoStack(data.getCompound("camo_stack_two"), list);
if (data.contains("camo_two"))
addCamoStack(data.getCompound("camo_two"), list);
return new ItemRequirement(list);
}
private static void addCamoStack(CompoundTag tag, List<StackRequirement> list) {
ItemStack itemStack = ItemStack.of(tag);
if (!tag.contains("state"))
return;
BlockState blockState = NbtUtils.readBlockState(tag.getCompound("state"));
ItemStack itemStack = new ItemStack(blockState.getBlock());
if (!itemStack.isEmpty())
list.add(new StackRequirement(itemStack, ItemUseType.CONSUME));
}