Skip to content

Commit

Permalink
Added Simple Compacting Drawers that only have 2 slots
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Jan 1, 2023
1 parent fc9ff69 commit 637c1ff
Show file tree
Hide file tree
Showing 32 changed files with 681 additions and 72 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// 1.19.2 2023-01-01T20:57:10.2897946 Tags for minecraft:item
89ea5373901359c91347ffd870336f8dd4f2cc52 data/functionalstorage/tags/items/drawer.json
// 1.19.2 2023-01-01T21:28:56.6950886 Tags for minecraft:item
246122fe97612d7cabc70aec28eb4cd0c96853f2 data/functionalstorage/tags/items/drawer.json
a6cf5364934bad4e060980a3c7f3c091ad90a585 data/functionalstorage/tags/items/ignore_crafting_check.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.19.2 2023-01-01T19:28:06.2595005 Item Models: functionalstorage
// 1.19.2 2023-01-01T21:28:56.6971068 Item Models: functionalstorage
05946c7f40bf42b62f86e70d637524afd795cad2 assets/functionalstorage/models/item/acacia_1.json
9e4990cfbaa0ce0612d18b497169377fe24ee704 assets/functionalstorage/models/item/acacia_2.json
648c9170a8c4c6068d0fdcf1ff7f6bf387902f3c assets/functionalstorage/models/item/acacia_4.json
Expand Down Expand Up @@ -41,6 +41,7 @@ c47402657897519b8d24fe05c24d8cf5206b8b66 assets/functionalstorage/models/item/oa
f8a391ef1bd1165e4146fdce9e26c5e148cb6c10 assets/functionalstorage/models/item/puller_upgrade.json
5c3d1bb1721ef875dd0b838d2362234891128783 assets/functionalstorage/models/item/pusher_upgrade.json
2dd88009a044be860f02b5696d83b0fcdd011d9f assets/functionalstorage/models/item/redstone_upgrade.json
d6f8f4ccd5e6bdc362dea5ffc2f3b0126b3dd7d0 assets/functionalstorage/models/item/simple_compacting_drawer.json
bfcda282f9a0a050e6a35b59b7ef298d8c21ad28 assets/functionalstorage/models/item/spruce_1.json
a5092df002d1882ba7356af656ffe4449c2ae014 assets/functionalstorage/models/item/spruce_2.json
13d086813dc0e5718e4230916adb8450b7936f1b assets/functionalstorage/models/item/spruce_4.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.19.2 2023-01-01T19:28:06.2580004 Block States: functionalstorage
// 1.19.2 2023-01-01T21:28:56.6960912 Block States: functionalstorage
b1f76f1b67016350af532beb6de3ffdc4d9a07be assets/functionalstorage/blockstates/acacia_1.json
a4e462d9775fd4aefa673952d4d69f9d90b2e823 assets/functionalstorage/blockstates/acacia_2.json
ecd77b58fb3d746ab8e2109adf686ea01cf5d96a assets/functionalstorage/blockstates/acacia_4.json
Expand Down Expand Up @@ -31,6 +31,7 @@ be5ed1859166cc324b2935d509572dc6f8e114f4 assets/functionalstorage/blockstates/ma
f47b30927e7b46a35f2273f67f8333ab4cc2e889 assets/functionalstorage/blockstates/oak_1.json
29c84d44a7b8e80a47c97ee891f7e15519f7ca17 assets/functionalstorage/blockstates/oak_2.json
7ce5d921723c7d0f45ed6fdf58436a61b19dde23 assets/functionalstorage/blockstates/oak_4.json
944cf78adff114b16702265055e66f1e5c7719b5 assets/functionalstorage/blockstates/simple_compacting_drawer.json
c53e0a691dd74cb9a6d60ebf825a7b7895382f31 assets/functionalstorage/blockstates/spruce_1.json
cbc78a9d7d6691b4ddf1dd633e2d693b4b751595 assets/functionalstorage/blockstates/spruce_2.json
e6d6962cc3719731bc798dcf1757a0c5bcf9099c assets/functionalstorage/blockstates/spruce_4.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.19.2 2023-01-01T19:28:06.2615014 LootTables
// 1.19.2 2023-01-01T21:28:56.6950886 LootTables
1d4929d7d6176f60e5ea991a577527ed251ef375 data/functionalstorage/loot_tables/blocks/acacia_1.json
1d4929d7d6176f60e5ea991a577527ed251ef375 data/functionalstorage/loot_tables/blocks/acacia_2.json
1d4929d7d6176f60e5ea991a577527ed251ef375 data/functionalstorage/loot_tables/blocks/acacia_4.json
Expand Down Expand Up @@ -31,6 +31,7 @@
1d4929d7d6176f60e5ea991a577527ed251ef375 data/functionalstorage/loot_tables/blocks/oak_1.json
1d4929d7d6176f60e5ea991a577527ed251ef375 data/functionalstorage/loot_tables/blocks/oak_2.json
1d4929d7d6176f60e5ea991a577527ed251ef375 data/functionalstorage/loot_tables/blocks/oak_4.json
1d4929d7d6176f60e5ea991a577527ed251ef375 data/functionalstorage/loot_tables/blocks/simple_compacting_drawer.json
1d4929d7d6176f60e5ea991a577527ed251ef375 data/functionalstorage/loot_tables/blocks/spruce_1.json
1d4929d7d6176f60e5ea991a577527ed251ef375 data/functionalstorage/loot_tables/blocks/spruce_2.json
1d4929d7d6176f60e5ea991a577527ed251ef375 data/functionalstorage/loot_tables/blocks/spruce_4.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// 1.19.2 2023-01-01T20:57:10.2907942 Tags for minecraft:block
89ea5373901359c91347ffd870336f8dd4f2cc52 data/minecraft/tags/blocks/mineable/axe.json
2600ac24b2deb398115bcaa6d5ae4a584e048091 data/minecraft/tags/blocks/mineable/pickaxe.json
// 1.19.2 2023-01-01T21:28:56.6930889 Tags for minecraft:block
246122fe97612d7cabc70aec28eb4cd0c96853f2 data/minecraft/tags/blocks/mineable/axe.json
8e6d491aff305684a23edc85e87dcba04122a21b data/minecraft/tags/blocks/mineable/pickaxe.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.19.2 2023-01-01T19:28:06.2610007 Languages: en_us
7580f9cf452cc6f51a122a68593cb796e822d2a8 assets/functionalstorage/lang/en_us.json
// 1.19.2 2023-01-01T21:28:56.69843 Languages: en_us
4923ed56412c825520255d1c1fe08293aea1497e assets/functionalstorage/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.19.2 2022-12-26T23:16:26.736141 Block Models: functionalstorage
// 1.19.2 2023-01-01T21:28:56.6940891 Block Models: functionalstorage
6d54a3aeb1cd5d36308305bace660178e8e562d6 assets/functionalstorage/models/block/acacia_1_locked.json
8d6752b49bcf17192815d02c04f79887e7adc30a assets/functionalstorage/models/block/acacia_2_locked.json
11acc40b9bb8ff8a3c99c8f4251056924f686400 assets/functionalstorage/models/block/acacia_4_locked.json
Expand All @@ -25,6 +25,7 @@ d059b5d3f663e00a229fb433efce31a6e2b7f46d assets/functionalstorage/models/block/j
9f780946e48fd6f34003ed84242483c9f706db0c assets/functionalstorage/models/block/oak_1_locked.json
d35a517f7b6b7f3278d588d767110e1ffd4de2aa assets/functionalstorage/models/block/oak_2_locked.json
d1645c52b03b76a8ae9b145d1af73c0a34629dff assets/functionalstorage/models/block/oak_4_locked.json
0e6fb68e682c5ea2b6002097505b8b600e4cde4d assets/functionalstorage/models/block/simple_compacting_drawer_locked.json
0d02c3473a2fede484a134918d73d1d67572e08a assets/functionalstorage/models/block/spruce_1_locked.json
bd634037f8695e67dff884393526dc120f6870b0 assets/functionalstorage/models/block/spruce_2_locked.json
2051671b7479f1a5a858a415ede795d1b91ca703 assets/functionalstorage/models/block/spruce_4_locked.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.19.2 2023-01-01T19:28:06.2585003 Titanium Recipe
// 1.19.2 2023-01-01T21:28:56.6971068 Titanium Recipe
f1f858c5c729d3265eca96a08ccc173c60e68cf0 data/functionalstorage/advancements/recipes/functionalstorage/netherite_upgrade.json
b05cf8697ddf7bd71f6ca3d498da0426928c7744 data/functionalstorage/recipes/acacia_1.json
918f07592884a21aeb8ee99d7f6df3f50e89766f data/functionalstorage/recipes/acacia_2.json
Expand Down Expand Up @@ -46,6 +46,7 @@ a79a3ec456db3fc56d8d5c717c264ee13c4bbdd9 data/functionalstorage/recipes/oak_draw
5f9576e04f3d22c25bf24b1c6d73380a646b5e5f data/functionalstorage/recipes/puller_upgrade.json
a6530183b52eebec5dbe7e4aa8b2fed73ff8aafe data/functionalstorage/recipes/pusher_upgrade.json
1f978597c015995d4665be0337ba3c9253a99a6b data/functionalstorage/recipes/redstone_upgrade.json
a8a010edcaa5dd5b433a50e9f9db83cfd5f23bd2 data/functionalstorage/recipes/simple_compacting_drawer.json
a84afe1c311bdde26ab919ee9d02f6ccd96dfcb8 data/functionalstorage/recipes/spruce_1.json
648fc89e40c56a1abc03ef2f736f82c0950b792a data/functionalstorage/recipes/spruce_2.json
98fbe14751894faf856430cb708d9af702b3d37f data/functionalstorage/recipes/spruce_4.json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"variants": {
"locked=false,subfacing=east": {
"model": "functionalstorage:block/simple_compacting_drawer",
"uvlock": true,
"y": 90
},
"locked=false,subfacing=north": {
"model": "functionalstorage:block/simple_compacting_drawer",
"uvlock": true
},
"locked=false,subfacing=south": {
"model": "functionalstorage:block/simple_compacting_drawer",
"uvlock": true,
"y": 180
},
"locked=false,subfacing=west": {
"model": "functionalstorage:block/simple_compacting_drawer",
"uvlock": true,
"y": 270
},
"locked=true,subfacing=east": {
"model": "functionalstorage:block/simple_compacting_drawer_locked",
"uvlock": true,
"y": 90
},
"locked=true,subfacing=north": {
"model": "functionalstorage:block/simple_compacting_drawer_locked",
"uvlock": true
},
"locked=true,subfacing=south": {
"model": "functionalstorage:block/simple_compacting_drawer_locked",
"uvlock": true,
"y": 180
},
"locked=true,subfacing=west": {
"model": "functionalstorage:block/simple_compacting_drawer_locked",
"uvlock": true,
"y": 270
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"block.functionalstorage.oak_1": "Oak Drawer (1x1)",
"block.functionalstorage.oak_2": "Oak Drawer (1x2)",
"block.functionalstorage.oak_4": "Oak Drawer (2x2)",
"block.functionalstorage.simple_compacting_drawer": "Simple Compacting Drawer",
"block.functionalstorage.spruce_1": "Spruce Drawer (1x1)",
"block.functionalstorage.spruce_2": "Spruce Drawer (1x2)",
"block.functionalstorage.spruce_4": "Spruce Drawer (2x2)",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "functionalstorage:block/simple_compacting_drawer",
"textures": {
"lock_icon": "functionalstorage:blocks/lock"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "functionalstorage:block/simple_compacting_drawer"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "minecraft:block"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"type": "forge:conditional",
"recipes": [
{
"conditions": [
{
"type": "forge:and",
"values": [
{
"type": "forge:item_exists",
"item": "functionalstorage:simple_compacting_drawer"
}
]
}
],
"recipe": {
"type": "minecraft:crafting_shaped",
"key": {
"D": {
"tag": "functionalstorage:drawer"
},
"I": {
"tag": "forge:ingots/iron"
},
"P": {
"item": "minecraft:piston"
},
"S": {
"item": "minecraft:stone"
}
},
"pattern": [
"SSS",
"SDP",
"SIS"
],
"result": {
"item": "functionalstorage:simple_compacting_drawer"
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"values": [
"functionalstorage:oak_4",
"functionalstorage:spruce_4",
"functionalstorage:birch_4",
"functionalstorage:jungle_4",
"functionalstorage:acacia_4",
"functionalstorage:dark_oak_4",
"functionalstorage:crimson_4",
"functionalstorage:warped_4",
"functionalstorage:framed_4",
"functionalstorage:mangrove_4",
"functionalstorage:oak_2",
"functionalstorage:spruce_2",
"functionalstorage:birch_2",
Expand All @@ -19,16 +29,6 @@
"functionalstorage:crimson_1",
"functionalstorage:warped_1",
"functionalstorage:framed_1",
"functionalstorage:mangrove_1",
"functionalstorage:oak_4",
"functionalstorage:spruce_4",
"functionalstorage:birch_4",
"functionalstorage:jungle_4",
"functionalstorage:acacia_4",
"functionalstorage:dark_oak_4",
"functionalstorage:crimson_4",
"functionalstorage:warped_4",
"functionalstorage:framed_4",
"functionalstorage:mangrove_4"
"functionalstorage:mangrove_1"
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"values": [
"functionalstorage:oak_4",
"functionalstorage:spruce_4",
"functionalstorage:birch_4",
"functionalstorage:jungle_4",
"functionalstorage:acacia_4",
"functionalstorage:dark_oak_4",
"functionalstorage:crimson_4",
"functionalstorage:warped_4",
"functionalstorage:framed_4",
"functionalstorage:mangrove_4",
"functionalstorage:oak_2",
"functionalstorage:spruce_2",
"functionalstorage:birch_2",
Expand All @@ -19,16 +29,6 @@
"functionalstorage:crimson_1",
"functionalstorage:warped_1",
"functionalstorage:framed_1",
"functionalstorage:mangrove_1",
"functionalstorage:oak_4",
"functionalstorage:spruce_4",
"functionalstorage:birch_4",
"functionalstorage:jungle_4",
"functionalstorage:acacia_4",
"functionalstorage:dark_oak_4",
"functionalstorage:crimson_4",
"functionalstorage:warped_4",
"functionalstorage:framed_4",
"functionalstorage:mangrove_4"
"functionalstorage:mangrove_1"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"functionalstorage:fluid_1",
"functionalstorage:fluid_2",
"functionalstorage:fluid_4",
"functionalstorage:controller_extension"
"functionalstorage:controller_extension",
"functionalstorage:simple_compacting_drawer"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public class FunctionalStorage extends ModuleController {
public static Pair<RegistryObject<Block>, RegistryObject<BlockEntityType<?>>> FLUID_DRAWER_2;
public static Pair<RegistryObject<Block>, RegistryObject<BlockEntityType<?>>> FLUID_DRAWER_4;
public static Pair<RegistryObject<Block>, RegistryObject<BlockEntityType<?>>> CONTROLLER_EXTENSION;
public static Pair<RegistryObject<Block>, RegistryObject<BlockEntityType<?>>> SIMPLE_COMPACTING_DRAWER;

public static RegistryObject<Item> LINKING_TOOL;
public static HashMap<StorageUpgradeItem.StorageTier, RegistryObject<Item>> STORAGE_UPGRADES = new HashMap<>();
Expand Down Expand Up @@ -156,6 +157,7 @@ public FunctionalStorage() {
NBTManager.getInstance().scanTileClassForAnnotations(FramedDrawerTile.class);
NBTManager.getInstance().scanTileClassForAnnotations(CompactingFramedDrawerTile.class);
NBTManager.getInstance().scanTileClassForAnnotations(FluidDrawerTile.class);
NBTManager.getInstance().scanTileClassForAnnotations(SimpleCompactingDrawerTile.class);
}


Expand Down Expand Up @@ -188,6 +190,7 @@ protected void initModules() {
for (StorageUpgradeItem.StorageTier value : StorageUpgradeItem.StorageTier.values()) {
STORAGE_UPGRADES.put(value, getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), value.name().toLowerCase(Locale.ROOT) + (value == StorageUpgradeItem.StorageTier.IRON ? "_downgrade" : "_upgrade"), () -> new StorageUpgradeItem(value)));
}
SIMPLE_COMPACTING_DRAWER = getRegistries().registerBlockWithTile("simple_compacting_drawer", () -> new SimpleCompactingDrawerBlock("simple_compacting_drawer", BlockBehaviour.Properties.copy(Blocks.STONE_BRICKS)));
COLLECTOR_UPGRADE = getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), "collector_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY));
PULLING_UPGRADE = getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), "puller_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY));
PUSHING_UPGRADE = getRegistries().registerGeneric(ForgeRegistries.ITEMS.getRegistryKey(), "pusher_upgrade", () -> new UpgradeItem(new Item.Properties(), UpgradeItem.Type.UTILITY));
Expand Down Expand Up @@ -262,6 +265,8 @@ public void onClient() {
registerRenderers.registerBlockEntityRenderer((BlockEntityType<? extends FluidDrawerTile>) FLUID_DRAWER_1.getRight().get(), p_173571_ -> new FluidDrawerRenderer());
registerRenderers.registerBlockEntityRenderer((BlockEntityType<? extends FluidDrawerTile>) FLUID_DRAWER_2.getRight().get(), p_173571_ -> new FluidDrawerRenderer());
registerRenderers.registerBlockEntityRenderer((BlockEntityType<? extends FluidDrawerTile>) FLUID_DRAWER_4.getRight().get(), p_173571_ -> new FluidDrawerRenderer());
registerRenderers.registerBlockEntityRenderer((BlockEntityType<? extends SimpleCompactingDrawerTile>) SIMPLE_COMPACTING_DRAWER.getRight().get(), p_173571_ -> new SimpleCompactingDrawerRenderer());

}).subscribe();
EventManager.mod(RegisterColorHandlersEvent.Item.class).process(item -> {
item.getItemColors().register((stack, tint) -> {
Expand Down Expand Up @@ -302,6 +307,7 @@ public void onClient() {
ItemBlockRenderTypes.setRenderLayer(FLUID_DRAWER_1.getLeft().get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(FLUID_DRAWER_2.getLeft().get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(FLUID_DRAWER_4.getLeft().get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(SIMPLE_COMPACTING_DRAWER.getLeft().get(), RenderType.cutout());
}).subscribe();
EventManager.forge(RenderTooltipEvent.Pre.class).process(itemTooltipEvent -> {
if (itemTooltipEvent.getItemStack().getItem().equals(FunctionalStorage.ENDER_DRAWER.getLeft().get().asItem()) && itemTooltipEvent.getItemStack().hasTag()) {
Expand Down Expand Up @@ -357,7 +363,6 @@ protected void registerModels() {
item(VOID_UPGRADE.get());
item(REDSTONE_UPGRADE.get());
item(CREATIVE_UPGRADE.get());

}

private void item(Item item) {
Expand Down Expand Up @@ -386,6 +391,8 @@ protected void registerModels() {
.texture("lock_icon", modLoc("blocks/lock"));
withExistingParent(ForgeRegistries.BLOCKS.getKey(FLUID_DRAWER_4.getLeft().get()).getPath() + "_locked", modLoc(ForgeRegistries.BLOCKS.getKey(FLUID_DRAWER_4.getLeft().get()).getPath()))
.texture("lock_icon", modLoc("blocks/lock"));
withExistingParent(ForgeRegistries.BLOCKS.getKey(SIMPLE_COMPACTING_DRAWER.getLeft().get()).getPath() + "_locked", modLoc(ForgeRegistries.BLOCKS.getKey(SIMPLE_COMPACTING_DRAWER.getLeft().get()).getPath()))
.texture("lock_icon", modLoc("blocks/lock"));
// withExistingParent(ForgeRegistries.BLOCKS.getKey(FRAMED_COMPACTING_DRAWER.getLeft().get()).getPath() + "_locked", modLoc(ForgeRegistries.BLOCKS.getKey(FRAMED_COMPACTING_DRAWER.getLeft().get()).getPath()))
// .texture("lock_icon", modLoc("blocks/lock"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.minecraft.core.Direction;
import net.minecraft.core.NonNullList;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.util.Mth;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.LivingEntity;
Expand Down Expand Up @@ -243,10 +244,11 @@ public int getSignal(BlockState p_60483_, BlockGetter blockGetter, BlockPos bloc
if (tile != null){
for (int i = 0; i < tile.getUtilityUpgrades().getSlots(); i++) {
ItemStack stack = tile.getUtilityUpgrades().getStackInSlot(i);
if (stack.getItem().equals(FunctionalStorage.REDSTONE_UPGRADE.get())){
if (stack.getItem().equals(FunctionalStorage.REDSTONE_UPGRADE.get())) {
int redstoneSlot = stack.getOrCreateTag().getInt("Slot");
if (redstoneSlot < tile.getStorage().getSlots()){
return (int) ((tile.getStorage().getStackInSlot(redstoneSlot).getCount() / (double)tile.getStorage().getSlotLimit(redstoneSlot)) * 15);
if (redstoneSlot < tile.getStorage().getSlots()) {
var amount = (tile.getStorage().getStackInSlot(redstoneSlot).getCount() / (double) tile.getStorage().getSlotLimit(redstoneSlot)) * 14;
return Mth.floor(amount * 14.0F) + (amount > 0 ? 1 : 0);
}
}
}
Expand Down
Loading

0 comments on commit 637c1ff

Please sign in to comment.