Skip to content

Commit

Permalink
feat:✨ Added new Paintbrush item that allows applying decorations to …
Browse files Browse the repository at this point in the history
…storage blocks in world

- put into Decoration Table instead of storage to set the decorations that the paintbrush applies
- right click blocks in world to apply the decoration
- works on individual storage blocks as well as on storage controller to apply the decoration to all storages in controller multiblock
- pulls blocks / dyes needed to apply the decoration from player's inventory as well as from any container items including backpacks
  • Loading branch information
P3pp3rF1y committed Dec 9, 2024
1 parent ac61a96 commit ac9725e
Show file tree
Hide file tree
Showing 27 changed files with 1,189 additions and 248 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ loader_version_range=[4,)
mod_id=sophisticatedstorage
mod_name=Sophisticated Storage
mod_license=GNU General Public License v3.0
mod_version=0.11.5
mod_version=1.0.0
mod_group_id=sophisticatedstorage
mod_authors=P3pp3rF1y, Ridanisaurus
mod_description=Fancy and functional storage containers.
Expand All @@ -35,7 +35,7 @@ jade_cf_file_id=5109393
chipped_cf_file_id=5506938
resourcefullib_cf_file_id=5483169
athena_cf_file_id=5431579
sc_version=[1.21-0.7.14,1.22)
sc_version=[1.21.1-1.0.0,1.22)
sb_version=[1.21,1.22)

#publish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"conditions": {
"items": [
{
"items": "#c:slimeballs"
"items": "#c:slime_balls"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_base_tier_wooden_storage": {
"conditions": {
"items": [
{
"items": "#sophisticatedstorage:base_tier_wooden_storage"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "sophisticatedstorage:paintbrush"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_base_tier_wooden_storage"
]
],
"rewards": {
"recipes": [
"sophisticatedstorage:paintbrush"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "misc",
"ingredients": [
{
"tag": "c:slimeballs"
"tag": "c:slime_balls"
},
{
"item": "minecraft:paper"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"S": {
"item": "minecraft:stick"
},
"W": {
"tag": "minecraft:wool"
}
},
"pattern": [
" W ",
" SW",
"S "
],
"result": {
"count": 1,
"id": "sophisticatedstorage:paintbrush"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import net.p3pp3rf1y.sophisticatedstorage.item.WoodStorageBlockItem;

import javax.annotation.Nullable;
import java.util.EnumMap;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
Expand Down Expand Up @@ -134,7 +135,7 @@ public void setPlacedBy(Level level, BlockPos pos, BlockState state, @org.jetbra
WorldHelper.getBlockEntity(level, pos, BarrelBlockEntity.class).ifPresent(barrel -> {
Map<BarrelMaterial, ResourceLocation> materials = BarrelBlockItem.getMaterials(stack);
if (!materials.isEmpty()) {
barrel.setMaterials(materials);
barrel.setMaterials(new EnumMap<>(materials));
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@ public StorageWrapper getMainStorageWrapper() {
return getStorageWrapper();
}

@Nullable
public ChestBlockEntity getMainChestBlockEntity() {
if (doubleMainPos != null) {
return level.getBlockEntity(doubleMainPos, ModBlocks.CHEST_BLOCK_ENTITY_TYPE.get()).orElse(null);
}
return this;
}

@Override
public boolean canBeLinked() {
return isMainChest() && super.canBeLinked();
Expand Down
Loading

0 comments on commit ac9725e

Please sign in to comment.