-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed black hole units losing the nbt of items when stored in control…
…lers, closes #1435
- Loading branch information
Showing
35 changed files
with
597 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/generated/resources/.cache/c06b22f661d5f8690ae5a8441f9d34dce0f7210c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// 1.20.1 2023-07-29T16:46:10.1359 Tags for minecraft:block mod id industrialforegoing | ||
// 1.20.1 2024-06-24T21:25:49.0593931 Tags for minecraft:block mod id industrialforegoing | ||
d19fb5f318758fdaef5883eac670afb1d488f5ac data/industrialforegoing/tags/blocks/machine_frame/advanced.json | ||
078014cbf879ad3b7979dfd739a4f4a9f9436050 data/industrialforegoing/tags/blocks/machine_frame/pity.json | ||
3fc18d8c3f4e2763c5bacb8d3a7d34208cb0aac0 data/industrialforegoing/tags/blocks/machine_frame/simple.json | ||
62c1d369f5daa4c5411fce7042ba70e62cc604cc data/industrialforegoing/tags/blocks/machine_frame/supreme.json | ||
978c5cd1bafc1fdb56371e35cc3ce4b6759ab456 data/minecraft/tags/blocks/dirt.json | ||
8c73051e1ec462f521ee0e5ce8dffca2b809994a data/minecraft/tags/blocks/mineable/pickaxe.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/generated/resources/data/industrialforegoing/recipes/machine_settings_copier.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"type": "forge:conditional", | ||
"recipes": [ | ||
{ | ||
"conditions": [ | ||
{ | ||
"type": "forge:and", | ||
"values": [ | ||
{ | ||
"type": "forge:item_exists", | ||
"item": "industrialforegoing:machine_settings_copier" | ||
} | ||
] | ||
} | ||
], | ||
"recipe": { | ||
"type": "minecraft:crafting_shaped", | ||
"category": "misc", | ||
"key": { | ||
"L": { | ||
"tag": "forge:plastic" | ||
}, | ||
"P": { | ||
"item": "minecraft:paper" | ||
}, | ||
"R": { | ||
"item": "minecraft:redstone" | ||
} | ||
}, | ||
"pattern": [ | ||
"PLP", | ||
"LRL", | ||
"PRP" | ||
], | ||
"result": { | ||
"item": "industrialforegoing:machine_settings_copier" | ||
}, | ||
"show_notification": true | ||
} | ||
} | ||
] | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/com/buuz135/industrial/api/IMachineSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.buuz135.industrial.api; | ||
|
||
import com.hrznstudio.titanium.component.inventory.InventoryComponent; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public interface IMachineSettings { | ||
|
||
public static CompoundTag writeInventory(InventoryComponent component) { | ||
CompoundTag tag = new CompoundTag(); | ||
for (int i = 0; i < component.getSlots(); i++) { | ||
var stack = component.getStackInSlot(i); | ||
if (!stack.isEmpty()) { | ||
tag.put(i + "", stack.save(new CompoundTag())); | ||
} | ||
} | ||
return tag; | ||
} | ||
|
||
public static List<ItemStack> readInventory(CompoundTag tag) { | ||
List<ItemStack> stacks = new ArrayList<>(); | ||
for (String allKey : tag.getAllKeys()) { | ||
stacks.add(ItemStack.of(tag.getCompound(allKey))); | ||
} | ||
return stacks; | ||
} | ||
|
||
void loadSettings(Player player, CompoundTag tag); | ||
|
||
void saveSettings(Player player, CompoundTag tag); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
This fixes #1441