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 d669b52 commit ce13163
Show file tree
Hide file tree
Showing 24 changed files with 1,176 additions and 242 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.daemon=false

mod_id=sophisticatedstorage
mod_group_id=sophisticatedstorage
mod_version=0.11.3
mod_version=1.0.0
sonar_project_key=sophisticatedstorage:SophisticatedStorage
github_package_url=https://maven.pkg.github.com/P3pp3rF1y/SophisticatedStorage

Expand All @@ -30,6 +30,6 @@ jade_cf_file_id=4614153
chipped_cf_file_id=5077656
resourcefullib_cf_file_id=5070629
athena_cf_file_id=4764357
sc_version=[1.20.1-0.7.12,1.20.4)
sc_version=[1.20.1-1.0.0,1.20.4)
sb_version=[1.20.1-3.20.5,1.20.4)
parchment_version=2023.09.03-1.20.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_base_tier_wooden_storage": {
"conditions": {
"items": [
{
"tag": "sophisticatedstorage:base_tier_wooden_storage"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "sophisticatedstorage:paintbrush"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_base_tier_wooden_storage",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"sophisticatedstorage:paintbrush"
]
},
"sends_telemetry_event": false
}
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": {
"item": "sophisticatedstorage:paintbrush"
},
"show_notification": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,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 @@ -141,7 +142,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 @@ -363,6 +363,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 ce13163

Please sign in to comment.