Skip to content

Commit

Permalink
dullstone button and pressure plate
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyof429 committed Aug 20, 2024
1 parent 3fb4abd commit a8cfc09
Show file tree
Hide file tree
Showing 30 changed files with 289 additions and 20 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
{
"variants": {
"": {
"model": "infernalexp:block/shimmer_sand"
}
"": [
{
"model": "infernalexp:block/shimmer_sand"
},
{
"model": "infernalexp:block/shimmer_sand",
"y": 90
},
{
"model": "infernalexp:block/shimmer_sand",
"y": 180
},
{
"model": "infernalexp:block/shimmer_sand",
"y": 270
}
]
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "infernalexp:dullstone_button"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "infernalexp:dullstone_pressure_plate"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"infernalexp:dimstone",
"infernalexp:polished_dimstone",
"infernalexp:dullstone",
"infernalexp:polished_dullstone"
"infernalexp:polished_dullstone",
"infernalexp:dullstone_pressure_plate",
"infernalexp:dullstone_button"
]
}
23 changes: 18 additions & 5 deletions src/main/java/org/infernalstudios/infernalexp/block/ModBlocks.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.infernalstudios.infernalexp.block;

import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.type.BlockSetTypeBuilder;
import net.minecraft.block.*;
import net.minecraft.client.model.Model;
import net.minecraft.data.client.Models;
import net.minecraft.registry.tag.BlockTags;
import org.infernalstudios.infernalexp.InfernalExpansion;
import org.infernalstudios.infernalexp.block.custom.LuminousFungusBlock;
import org.infernalstudios.infernalexp.setup.ModRegistry;

import java.util.Map;

public class ModBlocks {
public static void register() {
InfernalExpansion.log("Registering Blocks for " + InfernalExpansion.MOD_ID);
Expand All @@ -22,11 +22,13 @@ public static void register() {

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


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

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

public static final Block DIMSTONE = ModRegistry.ofBlock("dimstone",
new Block(dimStone))
.model().drop().tool("wood_pickaxe").build();
.drop().tool("wood_pickaxe").build();

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

public static final Block DULLSTONE_BUTTON = ModRegistry.ofBlock("dullstone_button",
new ButtonBlock(FabricBlockSettings.copyOf(dullStone).collidable(false)
.luminance(a -> a.get(ButtonBlock.POWERED) ? 15 : 0), dullStoneSet, 20, false))
.drop().tool("wood_pickaxe").build();

public static final Block DULLSTONE_PRESSURE_PLATE = ModRegistry.ofBlock("dullstone_pressure_plate",
new PressurePlateBlock(PressurePlateBlock.ActivationRule.MOBS,
FabricBlockSettings.copyOf(dullStone).collidable(false)
.luminance(a -> a.get(PressurePlateBlock.POWERED) ? 15 : 0), dullStoneSet))
.drop().tool("wood_pickaxe").build();


public static final Block GLOWSILK_COCOON = ModRegistry.ofBlock("glowsilk_cocoon",
new Block(FabricBlockSettings.copyOf(Blocks.MOSS_BLOCK).strength(2f).luminance(15).mapColor(MapColor.YELLOW)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class ModItemGroups {
entries.add(ModBlocks.POLISHED_DIMSTONE);
entries.add(ModBlocks.DULLSTONE);
entries.add(ModBlocks.POLISHED_DULLSTONE);
entries.add(ModBlocks.DULLSTONE_BUTTON);
entries.add(ModBlocks.DULLSTONE_PRESSURE_PLATE);
entries.add(ModItems.DULLROCKS);

entries.add(ModBlocks.GLOWSILK_COCOON);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ public ItemBuilder fuel(int duration) {

public enum Models {
CUBE,
ROTATABLE,
CROSS,
PILLAR,
STAIRS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public void generateBlockStateModels(BlockStateModelGenerator generator) {

for (Block block : ModRegistry.getModelList(ModRegistry.Models.CUBE))
generator.registerSimpleCubeAll(block);
for (Block block : ModRegistry.getModelList(ModRegistry.Models.ROTATABLE))
generator.registerRotatable(block);
for (Block block : ModRegistry.getModelList(ModRegistry.Models.PILLAR))
generator.registerLog(block).log(block);
for (Block block : ModRegistry.getModelList(ModRegistry.Models.CROSS))
Expand Down
18 changes: 18 additions & 0 deletions src/main/resources/assets/infernalexp/blockstates/dimstone.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"variants": {
"": [
{
"model": "infernalexp:block/dimstone1"
},
{
"model": "infernalexp:block/dimstone2"
},
{
"model": "infernalexp:block/dimstone3"
},
{
"model": "infernalexp:block/dimstone4"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"variants": {
"face=ceiling,facing=east,powered=false": {
"model": "infernalexp:block/dullstone_button",
"x": 180,
"y": 270
},
"face=ceiling,facing=east,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed",
"x": 180,
"y": 270
},
"face=ceiling,facing=north,powered=false": {
"model": "infernalexp:block/dullstone_button",
"x": 180,
"y": 180
},
"face=ceiling,facing=north,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed",
"x": 180,
"y": 180
},
"face=ceiling,facing=south,powered=false": {
"model": "infernalexp:block/dullstone_button",
"x": 180
},
"face=ceiling,facing=south,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed",
"x": 180
},
"face=ceiling,facing=west,powered=false": {
"model": "infernalexp:block/dullstone_button",
"x": 180,
"y": 90
},
"face=ceiling,facing=west,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed",
"x": 180,
"y": 90
},
"face=floor,facing=east,powered=false": {
"model": "infernalexp:block/dullstone_button",
"y": 90
},
"face=floor,facing=east,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed",
"y": 90
},
"face=floor,facing=north,powered=false": {
"model": "infernalexp:block/dullstone_button"
},
"face=floor,facing=north,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed"
},
"face=floor,facing=south,powered=false": {
"model": "infernalexp:block/dullstone_button",
"y": 180
},
"face=floor,facing=south,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed",
"y": 180
},
"face=floor,facing=west,powered=false": {
"model": "infernalexp:block/dullstone_button",
"y": 270
},
"face=floor,facing=west,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed",
"y": 270
},
"face=wall,facing=east,powered=false": {
"model": "infernalexp:block/dullstone_button",
"uvlock": true,
"x": 90,
"y": 90
},
"face=wall,facing=east,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed",
"uvlock": true,
"x": 90,
"y": 90
},
"face=wall,facing=north,powered=false": {
"model": "infernalexp:block/dullstone_button",
"uvlock": true,
"x": 90
},
"face=wall,facing=north,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed",
"uvlock": true,
"x": 90
},
"face=wall,facing=south,powered=false": {
"model": "infernalexp:block/dullstone_button",
"uvlock": true,
"x": 90,
"y": 180
},
"face=wall,facing=south,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed",
"uvlock": true,
"x": 90,
"y": 180
},
"face=wall,facing=west,powered=false": {
"model": "infernalexp:block/dullstone_button",
"uvlock": true,
"x": 90,
"y": 270
},
"face=wall,facing=west,powered=true": {
"model": "infernalexp:block/dullstone_button_pressed",
"uvlock": true,
"x": 90,
"y": 270
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"variants": {
"powered=false": {
"model": "infernalexp:block/dullstone_pressure_plate"
},
"powered=true": {
"model": "infernalexp:block/dullstone_pressure_plate_down"
}
}
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/infernalexp/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"block.infernalexp.polished_dimstone": "Polished Dimstone",
"block.infernalexp.dullstone": "Dullstone",
"block.infernalexp.polished_dullstone": "Polished Dullstone",
"block.infernalexp.dullstone_button": "Dullstone Button",
"block.infernalexp.dullstone_pressure_plate": "Dullstone Pressure Plate",
"block.infernalexp.glowsilk_cocoon": "Glowsilk Cocoon",
"block.infernalexp.luminous_fungus": "Luminous Fungus",

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "infernalexp:block/dimstone"
"all": "infernalexp:block/dimstone1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "infernalexp:block/dimstone2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "infernalexp:block/dimstone3"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "infernalexp:block/dimstone4"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/button",
"textures": {
"texture": "infernalexp:block/polished_dullstone"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/button_inventory",
"textures": {
"texture": "infernalexp:block/polished_dullstone"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/button_pressed",
"textures": {
"texture": "infernalexp:block/polished_glowstone"
}
}
Loading

0 comments on commit a8cfc09

Please sign in to comment.