Skip to content

Commit a8cfc09

Browse files
committed
dullstone button and pressure plate
1 parent 3fb4abd commit a8cfc09

30 files changed

+289
-20
lines changed

src/main/generated/assets/infernalexp/blockstates/dimstone.json

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
{
22
"variants": {
3-
"": {
4-
"model": "infernalexp:block/shimmer_sand"
5-
}
3+
"": [
4+
{
5+
"model": "infernalexp:block/shimmer_sand"
6+
},
7+
{
8+
"model": "infernalexp:block/shimmer_sand",
9+
"y": 90
10+
},
11+
{
12+
"model": "infernalexp:block/shimmer_sand",
13+
"y": 180
14+
},
15+
{
16+
"model": "infernalexp:block/shimmer_sand",
17+
"y": 270
18+
}
19+
]
620
}
721
}

src/main/generated/assets/infernalexp/models/item/dimstone.json

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"type": "minecraft:block",
3+
"pools": [
4+
{
5+
"bonus_rolls": 0.0,
6+
"conditions": [
7+
{
8+
"condition": "minecraft:survives_explosion"
9+
}
10+
],
11+
"entries": [
12+
{
13+
"type": "minecraft:item",
14+
"name": "infernalexp:dullstone_button"
15+
}
16+
],
17+
"rolls": 1.0
18+
}
19+
]
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"type": "minecraft:block",
3+
"pools": [
4+
{
5+
"bonus_rolls": 0.0,
6+
"conditions": [
7+
{
8+
"condition": "minecraft:survives_explosion"
9+
}
10+
],
11+
"entries": [
12+
{
13+
"type": "minecraft:item",
14+
"name": "infernalexp:dullstone_pressure_plate"
15+
}
16+
],
17+
"rolls": 1.0
18+
}
19+
]
20+
}

src/main/generated/data/minecraft/tags/blocks/mineable/pickaxe.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"infernalexp:dimstone",
88
"infernalexp:polished_dimstone",
99
"infernalexp:dullstone",
10-
"infernalexp:polished_dullstone"
10+
"infernalexp:polished_dullstone",
11+
"infernalexp:dullstone_pressure_plate",
12+
"infernalexp:dullstone_button"
1113
]
1214
}

src/main/java/org/infernalstudios/infernalexp/block/ModBlocks.java

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package org.infernalstudios.infernalexp.block;
22

33
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
4+
import net.fabricmc.fabric.api.object.builder.v1.block.type.BlockSetTypeBuilder;
45
import net.minecraft.block.*;
5-
import net.minecraft.client.model.Model;
6-
import net.minecraft.data.client.Models;
7-
import net.minecraft.registry.tag.BlockTags;
86
import org.infernalstudios.infernalexp.InfernalExpansion;
97
import org.infernalstudios.infernalexp.block.custom.LuminousFungusBlock;
108
import org.infernalstudios.infernalexp.setup.ModRegistry;
119

10+
import java.util.Map;
11+
1212
public class ModBlocks {
1313
public static void register() {
1414
InfernalExpansion.log("Registering Blocks for " + InfernalExpansion.MOD_ID);
@@ -22,11 +22,13 @@ public static void register() {
2222

2323
private static final FabricBlockSettings dullStone =
2424
FabricBlockSettings.copyOf(Blocks.GLOWSTONE).strength(1.7f).luminance(0).mapColor(MapColor.TERRACOTTA_GRAY).requiresTool();
25+
private static final BlockSetType dullStoneSet =
26+
new BlockSetTypeBuilder().register(InfernalExpansion.makeID("dullstone"));
2527

2628

2729
public static final Block SHIMMER_SAND = ModRegistry.ofBlock("shimmer_sand",
2830
new SandBlock(0xffffaa, FabricBlockSettings.copyOf(Blocks.SAND)))
29-
.model().drop().tool("wood_shovel").build();
31+
.model(ModRegistry.Models.ROTATABLE).drop().tool("wood_shovel").build();
3032

3133
public static final Block SHIMMER_SHEET = ModRegistry.ofBlock("shimmer_sheet",
3234
new SnowBlock(FabricBlockSettings.copyOf(Blocks.SAND)))
@@ -48,7 +50,7 @@ public static void register() {
4850

4951
public static final Block DIMSTONE = ModRegistry.ofBlock("dimstone",
5052
new Block(dimStone))
51-
.model().drop().tool("wood_pickaxe").build();
53+
.drop().tool("wood_pickaxe").build();
5254

5355
public static final Block POLISHED_DIMSTONE = ModRegistry.ofBlock("polished_dimstone",
5456
new Block(dimStone))
@@ -62,6 +64,17 @@ public static void register() {
6264
new Block(dullStone))
6365
.model().drop().tool("wood_pickaxe").build();
6466

67+
public static final Block DULLSTONE_BUTTON = ModRegistry.ofBlock("dullstone_button",
68+
new ButtonBlock(FabricBlockSettings.copyOf(dullStone).collidable(false)
69+
.luminance(a -> a.get(ButtonBlock.POWERED) ? 15 : 0), dullStoneSet, 20, false))
70+
.drop().tool("wood_pickaxe").build();
71+
72+
public static final Block DULLSTONE_PRESSURE_PLATE = ModRegistry.ofBlock("dullstone_pressure_plate",
73+
new PressurePlateBlock(PressurePlateBlock.ActivationRule.MOBS,
74+
FabricBlockSettings.copyOf(dullStone).collidable(false)
75+
.luminance(a -> a.get(PressurePlateBlock.POWERED) ? 15 : 0), dullStoneSet))
76+
.drop().tool("wood_pickaxe").build();
77+
6578

6679
public static final Block GLOWSILK_COCOON = ModRegistry.ofBlock("glowsilk_cocoon",
6780
new Block(FabricBlockSettings.copyOf(Blocks.MOSS_BLOCK).strength(2f).luminance(15).mapColor(MapColor.YELLOW)))

src/main/java/org/infernalstudios/infernalexp/item/ModItemGroups.java

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public class ModItemGroups {
2929
entries.add(ModBlocks.POLISHED_DIMSTONE);
3030
entries.add(ModBlocks.DULLSTONE);
3131
entries.add(ModBlocks.POLISHED_DULLSTONE);
32+
entries.add(ModBlocks.DULLSTONE_BUTTON);
33+
entries.add(ModBlocks.DULLSTONE_PRESSURE_PLATE);
3234
entries.add(ModItems.DULLROCKS);
3335

3436
entries.add(ModBlocks.GLOWSILK_COCOON);

src/main/java/org/infernalstudios/infernalexp/setup/ModRegistry.java

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ public ItemBuilder fuel(int duration) {
227227

228228
public enum Models {
229229
CUBE,
230+
ROTATABLE,
230231
CROSS,
231232
PILLAR,
232233
STAIRS,

src/main/java/org/infernalstudios/infernalexp/setup/datagen/ModModelProvider.java

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public void generateBlockStateModels(BlockStateModelGenerator generator) {
2222

2323
for (Block block : ModRegistry.getModelList(ModRegistry.Models.CUBE))
2424
generator.registerSimpleCubeAll(block);
25+
for (Block block : ModRegistry.getModelList(ModRegistry.Models.ROTATABLE))
26+
generator.registerRotatable(block);
2527
for (Block block : ModRegistry.getModelList(ModRegistry.Models.PILLAR))
2628
generator.registerLog(block).log(block);
2729
for (Block block : ModRegistry.getModelList(ModRegistry.Models.CROSS))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"variants": {
3+
"": [
4+
{
5+
"model": "infernalexp:block/dimstone1"
6+
},
7+
{
8+
"model": "infernalexp:block/dimstone2"
9+
},
10+
{
11+
"model": "infernalexp:block/dimstone3"
12+
},
13+
{
14+
"model": "infernalexp:block/dimstone4"
15+
}
16+
]
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"variants": {
3+
"face=ceiling,facing=east,powered=false": {
4+
"model": "infernalexp:block/dullstone_button",
5+
"x": 180,
6+
"y": 270
7+
},
8+
"face=ceiling,facing=east,powered=true": {
9+
"model": "infernalexp:block/dullstone_button_pressed",
10+
"x": 180,
11+
"y": 270
12+
},
13+
"face=ceiling,facing=north,powered=false": {
14+
"model": "infernalexp:block/dullstone_button",
15+
"x": 180,
16+
"y": 180
17+
},
18+
"face=ceiling,facing=north,powered=true": {
19+
"model": "infernalexp:block/dullstone_button_pressed",
20+
"x": 180,
21+
"y": 180
22+
},
23+
"face=ceiling,facing=south,powered=false": {
24+
"model": "infernalexp:block/dullstone_button",
25+
"x": 180
26+
},
27+
"face=ceiling,facing=south,powered=true": {
28+
"model": "infernalexp:block/dullstone_button_pressed",
29+
"x": 180
30+
},
31+
"face=ceiling,facing=west,powered=false": {
32+
"model": "infernalexp:block/dullstone_button",
33+
"x": 180,
34+
"y": 90
35+
},
36+
"face=ceiling,facing=west,powered=true": {
37+
"model": "infernalexp:block/dullstone_button_pressed",
38+
"x": 180,
39+
"y": 90
40+
},
41+
"face=floor,facing=east,powered=false": {
42+
"model": "infernalexp:block/dullstone_button",
43+
"y": 90
44+
},
45+
"face=floor,facing=east,powered=true": {
46+
"model": "infernalexp:block/dullstone_button_pressed",
47+
"y": 90
48+
},
49+
"face=floor,facing=north,powered=false": {
50+
"model": "infernalexp:block/dullstone_button"
51+
},
52+
"face=floor,facing=north,powered=true": {
53+
"model": "infernalexp:block/dullstone_button_pressed"
54+
},
55+
"face=floor,facing=south,powered=false": {
56+
"model": "infernalexp:block/dullstone_button",
57+
"y": 180
58+
},
59+
"face=floor,facing=south,powered=true": {
60+
"model": "infernalexp:block/dullstone_button_pressed",
61+
"y": 180
62+
},
63+
"face=floor,facing=west,powered=false": {
64+
"model": "infernalexp:block/dullstone_button",
65+
"y": 270
66+
},
67+
"face=floor,facing=west,powered=true": {
68+
"model": "infernalexp:block/dullstone_button_pressed",
69+
"y": 270
70+
},
71+
"face=wall,facing=east,powered=false": {
72+
"model": "infernalexp:block/dullstone_button",
73+
"uvlock": true,
74+
"x": 90,
75+
"y": 90
76+
},
77+
"face=wall,facing=east,powered=true": {
78+
"model": "infernalexp:block/dullstone_button_pressed",
79+
"uvlock": true,
80+
"x": 90,
81+
"y": 90
82+
},
83+
"face=wall,facing=north,powered=false": {
84+
"model": "infernalexp:block/dullstone_button",
85+
"uvlock": true,
86+
"x": 90
87+
},
88+
"face=wall,facing=north,powered=true": {
89+
"model": "infernalexp:block/dullstone_button_pressed",
90+
"uvlock": true,
91+
"x": 90
92+
},
93+
"face=wall,facing=south,powered=false": {
94+
"model": "infernalexp:block/dullstone_button",
95+
"uvlock": true,
96+
"x": 90,
97+
"y": 180
98+
},
99+
"face=wall,facing=south,powered=true": {
100+
"model": "infernalexp:block/dullstone_button_pressed",
101+
"uvlock": true,
102+
"x": 90,
103+
"y": 180
104+
},
105+
"face=wall,facing=west,powered=false": {
106+
"model": "infernalexp:block/dullstone_button",
107+
"uvlock": true,
108+
"x": 90,
109+
"y": 270
110+
},
111+
"face=wall,facing=west,powered=true": {
112+
"model": "infernalexp:block/dullstone_button_pressed",
113+
"uvlock": true,
114+
"x": 90,
115+
"y": 270
116+
}
117+
}
118+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"variants": {
3+
"powered=false": {
4+
"model": "infernalexp:block/dullstone_pressure_plate"
5+
},
6+
"powered=true": {
7+
"model": "infernalexp:block/dullstone_pressure_plate_down"
8+
}
9+
}
10+
}

src/main/resources/assets/infernalexp/lang/en_us.json

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"block.infernalexp.polished_dimstone": "Polished Dimstone",
1212
"block.infernalexp.dullstone": "Dullstone",
1313
"block.infernalexp.polished_dullstone": "Polished Dullstone",
14+
"block.infernalexp.dullstone_button": "Dullstone Button",
15+
"block.infernalexp.dullstone_pressure_plate": "Dullstone Pressure Plate",
1416
"block.infernalexp.glowsilk_cocoon": "Glowsilk Cocoon",
1517
"block.infernalexp.luminous_fungus": "Luminous Fungus",
1618

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parent": "minecraft:block/cube_all",
33
"textures": {
4-
"all": "infernalexp:block/dimstone"
4+
"all": "infernalexp:block/dimstone1"
55
}
66
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "minecraft:block/cube_all",
3+
"textures": {
4+
"all": "infernalexp:block/dimstone2"
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "minecraft:block/cube_all",
3+
"textures": {
4+
"all": "infernalexp:block/dimstone3"
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "minecraft:block/cube_all",
3+
"textures": {
4+
"all": "infernalexp:block/dimstone4"
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "minecraft:block/button",
3+
"textures": {
4+
"texture": "infernalexp:block/polished_dullstone"
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "minecraft:block/button_inventory",
3+
"textures": {
4+
"texture": "infernalexp:block/polished_dullstone"
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "minecraft:block/button_pressed",
3+
"textures": {
4+
"texture": "infernalexp:block/polished_glowstone"
5+
}
6+
}

0 commit comments

Comments
 (0)