Skip to content

Commit

Permalink
Added support for drawer dividers, closes #254
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Mar 9, 2024
1 parent 4f310d3 commit 35b717b
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 36 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle'

group = 'com.buuz135'
version = '1.20.1-1.2.9'
version = '1.20.1-1.2.10'

java {
archivesBaseName = 'functionalstorage'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2023-11-18T14:19:52.3947253 Functional Storage Item Tags
6c2aa8af2200df22b202c6a5806cc67c8d6d5ec8 data/functionalstorage/tags/items/drawer.json
// 1.20.1 2024-03-09T18:58:14.9623682 Functional Storage Item Tags
dce1fbc7d93ffd0f6dca91d6e15795d982c6e62e data/functionalstorage/tags/items/drawer.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// 1.20.1 2023-11-18T14:19:52.395725 Tags for minecraft:block mod id functionalstorage
6c2aa8af2200df22b202c6a5806cc67c8d6d5ec8 data/minecraft/tags/blocks/mineable/axe.json
// 1.20.1 2024-03-09T18:58:14.9634102 Tags for minecraft:block mod id functionalstorage
dce1fbc7d93ffd0f6dca91d6e15795d982c6e62e data/minecraft/tags/blocks/mineable/axe.json
4b6fc75faca16170a17220f0e301b16866f4bc5c data/minecraft/tags/blocks/mineable/pickaxe.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2023-11-18T14:19:52.395725 Languages: en_us
3c5c7ebc509af42524da16d52f65487083d540c2 assets/functionalstorage/lang/en_us.json
// 1.20.1 2024-03-09T18:58:14.9644129 Languages: en_us
112cce2d4db4dc706b7fdd988dd505ea0046bacc assets/functionalstorage/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"configurationtool.configmode.toggle_upgrades": "Hide/Show Upgrade Renders",
"configurationtool.use": "Sneak + Right Click in the air to change modes. Right click a drawer to toggle the option.",
"drawer.block.contents": "Contents: ",
"frameddrawer.use": "How 2 Change Texture: \nInside a crafting window place the block you want use the texture of for the outside of the drawer in the first slot of the crafting window, on the second slot put the block that will be used for the texture on the inside of the framed drawer and on the third slot put a framed drawer. \n",
"frameddrawer.use": "How 2 Change Texture: \nInside a crafting window place the block you want use the texture of for the outside of the drawer in the first slot of the crafting window, on the second slot put the block that will be used for the texture on the inside of the framed drawer and on the third slot put a framed drawer. You can change the drawer divider texture by adding a block into the 4th slot\n",
"gui.functionalstorage.amount": "Amount: ",
"gui.functionalstorage.fluid": "Fluid: ",
"gui.functionalstorage.item": "Item: ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
"functionalstorage:mangrove_2",
"functionalstorage:cherry_2",
"functionalstorage:framed_2",
"functionalstorage:oak_1",
"functionalstorage:spruce_1",
"functionalstorage:birch_1",
"functionalstorage:jungle_1",
"functionalstorage:acacia_1",
"functionalstorage:dark_oak_1",
"functionalstorage:crimson_1",
"functionalstorage:warped_1",
"functionalstorage:mangrove_1",
"functionalstorage:cherry_1",
"functionalstorage:framed_1",
"functionalstorage:oak_4",
"functionalstorage:spruce_4",
"functionalstorage:birch_4",
Expand All @@ -32,6 +21,17 @@
"functionalstorage:warped_4",
"functionalstorage:mangrove_4",
"functionalstorage:cherry_4",
"functionalstorage:framed_4"
"functionalstorage:framed_4",
"functionalstorage:oak_1",
"functionalstorage:spruce_1",
"functionalstorage:birch_1",
"functionalstorage:jungle_1",
"functionalstorage:acacia_1",
"functionalstorage:dark_oak_1",
"functionalstorage:crimson_1",
"functionalstorage:warped_1",
"functionalstorage:mangrove_1",
"functionalstorage:cherry_1",
"functionalstorage:framed_1"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
"functionalstorage:mangrove_2",
"functionalstorage:cherry_2",
"functionalstorage:framed_2",
"functionalstorage:oak_1",
"functionalstorage:spruce_1",
"functionalstorage:birch_1",
"functionalstorage:jungle_1",
"functionalstorage:acacia_1",
"functionalstorage:dark_oak_1",
"functionalstorage:crimson_1",
"functionalstorage:warped_1",
"functionalstorage:mangrove_1",
"functionalstorage:cherry_1",
"functionalstorage:framed_1",
"functionalstorage:oak_4",
"functionalstorage:spruce_4",
"functionalstorage:birch_4",
Expand All @@ -32,6 +21,17 @@
"functionalstorage:warped_4",
"functionalstorage:mangrove_4",
"functionalstorage:cherry_4",
"functionalstorage:framed_4"
"functionalstorage:framed_4",
"functionalstorage:oak_1",
"functionalstorage:spruce_1",
"functionalstorage:birch_1",
"functionalstorage:jungle_1",
"functionalstorage:acacia_1",
"functionalstorage:dark_oak_1",
"functionalstorage:crimson_1",
"functionalstorage:warped_1",
"functionalstorage:mangrove_1",
"functionalstorage:cherry_1",
"functionalstorage:framed_1"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,17 @@ public static FramedDrawerModelData getDrawerModelData(ItemStack stack){
return null;
}

public static ItemStack fill(ItemStack first, ItemStack second, ItemStack drawer){
public static ItemStack fill(ItemStack first, ItemStack second, ItemStack drawer, ItemStack divider){
drawer = ItemHandlerHelper.copyStackWithSize(drawer, 1);
CompoundTag style = drawer.getOrCreateTagElement("Style");
style.putString("particle", ForgeRegistries.ITEMS.getKey(first.getItem()).toString());
style.putString("side", ForgeRegistries.ITEMS.getKey(first.getItem()).toString());
style.putString("front", ForgeRegistries.ITEMS.getKey(second.getItem()).toString());
style.putString("front_divider", ForgeRegistries.ITEMS.getKey(first.getItem()).toString());
if (divider.isEmpty()){
style.putString("front_divider", ForgeRegistries.ITEMS.getKey(first.getItem()).toString());
} else {
style.putString("front_divider", ForgeRegistries.ITEMS.getKey(divider.getItem()).toString());
}
drawer.getOrCreateTag().put("Style", style);
return drawer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected void addTranslations() {
this.add("linkingtool.ender.frequency", "Frequency: ");
this.add("linkingtool.ender.clear", "Sneak + Right Click in the air to clear frequency.");
this.add("drawer.block.contents", "Contents: ");
this.add("frameddrawer.use", "How 2 Change Texture: \nInside a crafting window place the block you want use the texture of for the outside of the drawer in the first slot of the crafting window, on the second slot put the block that will be used for the texture on the inside of the framed drawer and on the third slot put a framed drawer. \n");
this.add("frameddrawer.use", "How 2 Change Texture: \nInside a crafting window place the block you want use the texture of for the outside of the drawer in the first slot of the crafting window, on the second slot put the block that will be used for the texture on the inside of the framed drawer and on the third slot put a framed drawer. You can change the drawer divider texture by adding a block into the 4th slot\n");
this.add("item.utility.slot", "Slot: ");
this.add("item.utility.slot.desc", "Right click in a GUI to change slot");
this.add("gui.functionalstorage.item", "Item: ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public ItemStack assemble(CraftingContainer inv, RegistryAccess registryAccess)
matchesController(inv.getItem(0), inv.getItem(1), inv.getItem(2)) ||
matchesControllerExtension(inv.getItem(0), inv.getItem(1), inv.getItem(2)))
{
return FramedDrawerBlock.fill(inv.getItem(0), inv.getItem(1), inv.getItem(2).copy());
return FramedDrawerBlock.fill(inv.getItem(0), inv.getItem(1), inv.getItem(2).copy(), inv.getItem(3));
}

return ItemStack.EMPTY;
Expand Down

0 comments on commit 35b717b

Please sign in to comment.