-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
326 additions
and
13 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
66 changes: 66 additions & 0 deletions
66
common/src/main/java/io/github/xenfork/squidcraft/block/ModBlocks.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,66 @@ | ||
/* | ||
* MIT License | ||
* | ||
* Copyright (c) 2024 XenFork Union | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
*/ | ||
|
||
package io.github.xenfork.squidcraft.block; | ||
|
||
import dev.architectury.registry.registries.DeferredRegister; | ||
import dev.architectury.registry.registries.RegistrySupplier; | ||
import io.github.xenfork.squidcraft.SquidCraft; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.SoundType; | ||
import net.minecraft.world.level.block.state.BlockBehaviour; | ||
import net.minecraft.world.level.material.MapColor; | ||
|
||
import java.util.Locale; | ||
import java.util.function.Supplier; | ||
|
||
/** | ||
* @author squid233 | ||
* @since 0.14.0 | ||
*/ | ||
public enum ModBlocks { | ||
COOKED_SHREDDED_SQUID_BLOCK(() -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_WHITE).instabreak().sound(SoundType.SLIME_BLOCK))); | ||
|
||
private static final DeferredRegister<Block> REGISTER = DeferredRegister.create(SquidCraft.MOD_ID, Registries.BLOCK); | ||
private final String path; | ||
private final Supplier<Block> supplier; | ||
private RegistrySupplier<Block> registrySupplier; | ||
|
||
ModBlocks(Supplier<Block> supplier) { | ||
this.path = name().toLowerCase(Locale.ROOT); | ||
this.supplier = supplier; | ||
} | ||
|
||
public static void init() { | ||
for (var value : values()) { | ||
value.registrySupplier = REGISTER.register(value.path(), value.supplier); | ||
} | ||
REGISTER.register(); | ||
} | ||
|
||
public String path() { | ||
return path; | ||
} | ||
|
||
public RegistrySupplier<Block> registrySupplier() { | ||
return registrySupplier; | ||
} | ||
|
||
public Block get() { | ||
return registrySupplier().get(); | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
common/src/main/resources/assets/squidcraft/blockstates/cooked_shredded_squid_block.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,7 @@ | ||
{ | ||
"variants": { | ||
"": { | ||
"model": "squidcraft:block/cooked_shredded_squid_block" | ||
} | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
common/src/main/resources/assets/squidcraft/models/block/cooked_shredded_squid_block.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,6 @@ | ||
{ | ||
"parent": "block/cube_all", | ||
"textures": { | ||
"all": "squidcraft:block/cooked_shredded_squid_block" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
common/src/main/resources/assets/squidcraft/models/item/cooked_shredded_squid_block.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,3 @@ | ||
{ | ||
"parent": "squidcraft:block/cooked_shredded_squid_block" | ||
} |
Binary file added
BIN
+179 Bytes
...main/resources/assets/squidcraft/textures/block/cooked_shredded_squid_block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
common/src/main/resources/data/squidcraft/advancements/cooked_shredded_squid_block.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,29 @@ | ||
{ | ||
"parent": "squidcraft:cooked_shredded_squid", | ||
"criteria": { | ||
"cooked_shredded_squid_block": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"squidcraft:cooked_shredded_squid_block" | ||
] | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
} | ||
}, | ||
"display": { | ||
"frame": "goal", | ||
"description": { | ||
"translate": "advancements.squidcraft.cooked_shredded_squid_block.description" | ||
}, | ||
"title": { | ||
"translate": "advancements.squidcraft.cooked_shredded_squid_block.title" | ||
}, | ||
"icon": { | ||
"item": "squidcraft:cooked_shredded_squid_block" | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
common/src/main/resources/data/squidcraft/advancements/magma_shredded_squid.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
47 changes: 47 additions & 0 deletions
47
.../src/main/resources/data/squidcraft/advancements/recipes/cooked_shredded_squid_block.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,47 @@ | ||
{ | ||
"parent": "squidcraft:recipes/root", | ||
"criteria": { | ||
"has_cooked_shredded_squid": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"squidcraft:cooked_shredded_squid" | ||
] | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_cooked_shredded_squid_block": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"squidcraft:cooked_shredded_squid_block" | ||
] | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "squidcraft:cooked_shredded_squid_block" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_cooked_shredded_squid", | ||
"has_cooked_shredded_squid_block", | ||
"has_the_recipe" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"squidcraft:cooked_shredded_squid_block" | ||
] | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...main/resources/data/squidcraft/advancements/recipes/cooked_shredded_squid_decompress.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,47 @@ | ||
{ | ||
"parent": "squidcraft:recipes/root", | ||
"criteria": { | ||
"has_cooked_shredded_squid": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"squidcraft:cooked_shredded_squid" | ||
] | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_cooked_shredded_squid_block": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"squidcraft:cooked_shredded_squid_block" | ||
] | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "squidcraft:cooked_shredded_squid_decompress" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_cooked_shredded_squid", | ||
"has_cooked_shredded_squid_block", | ||
"has_the_recipe" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"squidcraft:cooked_shredded_squid_decompress" | ||
] | ||
} | ||
} |
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.