summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/lv/enes/mc/eriscraft_misc/SecretDoorWailaPlugin.java35
-rw-r--r--src/main/resources/quilt.mod.json24
-rw-r--r--src/main/resources/waila_plugins.json7
3 files changed, 66 insertions, 0 deletions
diff --git a/src/main/java/lv/enes/mc/eriscraft_misc/SecretDoorWailaPlugin.java b/src/main/java/lv/enes/mc/eriscraft_misc/SecretDoorWailaPlugin.java
new file mode 100644
index 0000000..f4aaca9
--- /dev/null
+++ b/src/main/java/lv/enes/mc/eriscraft_misc/SecretDoorWailaPlugin.java
@@ -0,0 +1,35 @@
1package lv.enes.mc.eriscraft_misc;
2
3import mcp.mobius.waila.api.*;
4import net.minecraft.core.registries.BuiltInRegistries;
5import net.minecraft.resources.ResourceLocation;
6import net.minecraft.world.level.block.Blocks;
7import net.minecraft.world.level.block.DoorBlock;
8import net.minecraft.world.level.block.state.BlockState;
9
10/** When looking at secret doors as provided by the chipped mod, we say it's a bookshelf :3
11 * <p>
12 * TODO: Currently only secret oak doors are considered */
13@SuppressWarnings("unused")
14public class SecretDoorWailaPlugin implements IWailaPlugin {
15 @Override
16 public void register(IRegistrar registrar) {
17 registrar.addOverride(Overrider.INSTANCE, DoorBlock.class);
18 System.out.println("Hello, World!");
19 }
20
21 private enum Overrider implements IBlockComponentProvider {
22 INSTANCE;
23
24 @Override
25 public BlockState getOverride(IBlockAccessor accessor, IPluginConfig config) {
26 var id = BuiltInRegistries.BLOCK.getKey(accessor.getBlock());
27 // TODO: Somehow get the full list from chipped?
28 if (id.equals(new ResourceLocation("chipped", "secret_oak_door"))) {
29 return Blocks.BOOKSHELF.defaultBlockState();
30 } else {
31 return accessor.getBlockState();
32 }
33 }
34 }
35}
diff --git a/src/main/resources/quilt.mod.json b/src/main/resources/quilt.mod.json
new file mode 100644
index 0000000..c2ec5a6
--- /dev/null
+++ b/src/main/resources/quilt.mod.json
@@ -0,0 +1,24 @@
1{
2 "schema_version": 1,
3 "quilt_loader": {
4 "group": "lv.enes.mc",
5 "id": "eriscraft_misc",
6 "version": "${version}",
7 "metadata": {
8 "name": "ErisCraft Miscellany",
9 "description": "Miscellaneous things for my modpack :3",
10 "contributors": {
11 "Eris": "Owner"
12 }
13 },
14 "intermediate_mappings": "net.fabricmc:intermediary",
15 "entrypoints": {},
16 "depends": [{
17 "id": "quilt_loader",
18 "versions": "^${loader_version}"
19 }, {
20 "id": "minecraft",
21 "versions": "=${minecraft_version}"
22 }]
23 }
24} \ No newline at end of file
diff --git a/src/main/resources/waila_plugins.json b/src/main/resources/waila_plugins.json
new file mode 100644
index 0000000..2dafe26
--- /dev/null
+++ b/src/main/resources/waila_plugins.json
@@ -0,0 +1,7 @@
1{
2 "eris_alchemy:secret_doors": {
3 "initializer": "lv.enes.mc.eriscraft_misc.SecretDoorWailaPlugin",
4 "side": "*",
5 "required": []
6 }
7} \ No newline at end of file