Skip to content

Commit

Permalink
Bollards
Browse files Browse the repository at this point in the history
  • Loading branch information
Fureniku committed Nov 28, 2023
1 parent ae88e65 commit c2c5d24
Show file tree
Hide file tree
Showing 30 changed files with 165 additions and 84 deletions.
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "furenikusroads:block/bollard_thick_left",
"y": 90
},
"facing=north": {
"model": "furenikusroads:block/bollard_thick_left"
},
"facing=south": {
"model": "furenikusroads:block/bollard_thick_left",
"y": 180
},
"facing=west": {
"model": "furenikusroads:block/bollard_thick_left",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "furenikusroads:block/bollard_thick_right",
"y": 90
},
"facing=north": {
"model": "furenikusroads:block/bollard_thick_right"
},
"facing=south": {
"model": "furenikusroads:block/bollard_thick_right",
"y": 180
},
"facing=west": {
"model": "furenikusroads:block/bollard_thick_right",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "furenikusroads:block/bollard_thin_left",
"y": 90
},
"facing=north": {
"model": "furenikusroads:block/bollard_thin_left"
},
"facing=south": {
"model": "furenikusroads:block/bollard_thin_left",
"y": 180
},
"facing=west": {
"model": "furenikusroads:block/bollard_thin_left",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "furenikusroads:block/bollard_thin_right",
"y": 90
},
"facing=north": {
"model": "furenikusroads:block/bollard_thin_right"
},
"facing=south": {
"model": "furenikusroads:block/bollard_thin_right",
"y": 180
},
"facing=west": {
"model": "furenikusroads:block/bollard_thin_right",
"y": 270
}
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_round_top",
"textures": {
"texture": "furenikusroads:block/roads/road_block_concrete_1",
"top": "furenikusroads:block/roads/road_block_concrete_1"
"texture": "furenikusroads:block/roads/road_block_concrete_1"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_smooth_thin",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_yellow",
"top": "furenikusroads:block/decorative/bollard_yellow"
"texture": "furenikusroads:block/decorative/bollard_yellow"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_topped",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_black",
"top": "furenikusroads:block/decorative/bollard_black"
"texture": "furenikusroads:block/decorative/bollard_black"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_topped",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_smooth_metal",
"top": "furenikusroads:block/decorative/bollard_smooth_metal"
"texture": "furenikusroads:block/decorative/bollard_smooth_metal"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_topped_ringed",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_black",
"top": "furenikusroads:block/decorative/bollard_black"
"texture": "furenikusroads:block/decorative/bollard_black"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_topped_ringed",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_smooth_metal",
"top": "furenikusroads:block/decorative/bollard_smooth_metal"
"texture": "furenikusroads:block/decorative/bollard_smooth_metal"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_smooth_light",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_black",
"top": "furenikusroads:block/decorative/bollard_black"
"texture": "furenikusroads:block/decorative/bollard_black"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_smooth_light",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_smooth_metal",
"top": "furenikusroads:block/decorative/bollard_smooth_metal"
"texture": "furenikusroads:block/decorative/bollard_smooth_metal"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_portable",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_small_portable",
"top": "furenikusroads:block/decorative/bollard_small_portable"
"texture": "furenikusroads:block/decorative/bollard_small_portable"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_round_top",
"textures": {
"texture": "furenikusroads:block/roads/road_block_concrete_2",
"top": "furenikusroads:block/roads/road_block_concrete_2"
"texture": "furenikusroads:block/roads/road_block_concrete_2"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_portable",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_small_portable_yellow",
"top": "furenikusroads:block/decorative/bollard_small_portable_yellow"
"texture": "furenikusroads:block/decorative/bollard_small_portable_yellow"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_smooth",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_smooth_metal",
"top": "furenikusroads:block/decorative/bollard_smooth_metal"
"texture": "furenikusroads:block/decorative/bollard_smooth_metal"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_smooth",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_yellow",
"top": "furenikusroads:block/decorative/bollard_yellow"
"texture": "furenikusroads:block/decorative/bollard_yellow"
}
}
@@ -1,7 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_smooth_thin",
"textures": {
"texture": "furenikusroads:block/decorative/bollard_smooth_metal",
"top": "furenikusroads:block/decorative/bollard_smooth_metal"
"texture": "furenikusroads:block/decorative/bollard_smooth_metal"
}
}
@@ -0,0 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_traffic_1",
"textures": {
"texture": "furenikusroads:block/decorative/traffic_bollard_thick_left"
}
}
@@ -0,0 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_traffic_1",
"textures": {
"texture": "furenikusroads:block/decorative/traffic_bollard_thick_right"
}
}
@@ -0,0 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_traffic_2",
"textures": {
"texture": "furenikusroads:block/decorative/traffic_bollard_thin_left"
}
}
@@ -0,0 +1,6 @@
{
"parent": "furenikusroads:blocks/decorative/bollard_traffic_2",
"textures": {
"texture": "furenikusroads:block/decorative/traffic_bollard_thin_right"
}
}
16 changes: 0 additions & 16 deletions src/main/java/com/fureniku/roads/blocks/BollardBlock.java

This file was deleted.

Expand Up @@ -2,23 +2,25 @@

import com.fureniku.metropolis.RegistrationBase;
import com.fureniku.metropolis.RegistrationGroup;
import com.fureniku.metropolis.blocks.MetroBlockDecorative;
import com.fureniku.metropolis.blocks.MetroBlockDecorativeRotatableBuilder;
import com.fureniku.metropolis.datagen.TextureSet;
import com.fureniku.metropolis.utils.CreativeTabSet;
import com.fureniku.roads.FurenikusRoads;
import com.fureniku.roads.blocks.BollardBlock;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;

import java.util.ArrayList;

public class RegistrationDecorative extends RegistrationGroup {

int bollardCount = 1;
public final String BOLLARD_THICK_LEFT = "bollard_thick_left";
public final String BOLLARD_THICK_RIGHT = "bollard_thick_right";
public final String BOLLARD_THIN_LEFT = "bollard_thin_left";
public final String BOLLARD_THIN_RIGHT = "bollard_thin_right";

private CreativeTabSet _decorativeTab;

Expand All @@ -30,26 +32,31 @@ public RegistrationDecorative(RegistrationBase registrationBase) {

@Override
public void init(IEventBus modEventBus) {
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 16, 4, "bollard_round_top", new ResourceLocation(FurenikusRoads.MODID, "block/roads/road_block_concrete_1")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 16, 4, "bollard_round_top", new ResourceLocation(FurenikusRoads.MODID, "block/roads/road_block_concrete_2")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 3, "bollard_smooth", getLoc("bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 3, "bollard_smooth", texture("texture", "bollard_striped"), texture("top", "bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 3, "bollard_smooth", texture("texture", "bollard_black_ringed"), texture("top", "bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 3, "bollard_smooth", texture("texture", "bollard_ringed"), texture("top", "bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 3, "bollard_smooth", getLoc("bollard_yellow")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 2, "bollard_smooth_thin", getLoc("bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 2, "bollard_smooth_thin", texture("texture", "bollard_striped"), texture("top", "bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 2, "bollard_smooth_thin", texture("texture", "bollard_black_ringed"), texture("top", "bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 2, "bollard_smooth_thin", texture("texture", "bollard_ringed"), texture("top", "bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 2, "bollard_smooth_thin", getLoc("bollard_yellow")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 2, "bollard_topped", getLoc("bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 2, "bollard_topped", getLoc("bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 2, "bollard_topped_ringed", getLoc("bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 14, 2, "bollard_topped_ringed", getLoc("bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props.lightLevel(p_50874_ -> 15).noOcclusion(), 16, 3, "bollard_smooth_light", getLoc("bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props.lightLevel(p_50874_ -> 15).noOcclusion(), 16, 3, "bollard_smooth_light", getLoc("bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 16, 2, "bollard_portable", getLoc("bollard_small_portable")));
registerBlockSet("bollard_" + (bollardCount++), () -> new BollardBlock(_props, 16, 2, "bollard_portable", getLoc("bollard_small_portable_yellow")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 16, 4, "bollard_round_top", new ResourceLocation(FurenikusRoads.MODID, "block/roads/road_block_concrete_1")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 16, 4, "bollard_round_top", new ResourceLocation(FurenikusRoads.MODID, "block/roads/road_block_concrete_2")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 3, "bollard_smooth", getLoc("bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 3, "bollard_smooth", texture("texture", "bollard_striped"), texture("top", "bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 3, "bollard_smooth", texture("texture", "bollard_black_ringed"), texture("top", "bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 3, "bollard_smooth", texture("texture", "bollard_ringed"), texture("top", "bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 3, "bollard_smooth", getLoc("bollard_yellow")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 2, "bollard_smooth_thin", getLoc("bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 2, "bollard_smooth_thin", texture("texture", "bollard_striped"), texture("top", "bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 2, "bollard_smooth_thin", texture("texture", "bollard_black_ringed"), texture("top", "bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 2, "bollard_smooth_thin", texture("texture", "bollard_ringed"), texture("top", "bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 2, "bollard_smooth_thin", getLoc("bollard_yellow")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 2, "bollard_topped", getLoc("bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 2, "bollard_topped", getLoc("bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 2, "bollard_topped_ringed", getLoc("bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 14, 2, "bollard_topped_ringed", getLoc("bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props.lightLevel(p_50874_ -> 15).noOcclusion(), 16, 3, "bollard_smooth_light", getLoc("bollard_black")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props.lightLevel(p_50874_ -> 15).noOcclusion(), 16, 3, "bollard_smooth_light", getLoc("bollard_smooth_metal")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 16, 2, "bollard_portable", getLoc("bollard_small_portable")));
registerBlockSet("bollard_" + (bollardCount++), () -> new MetroBlockDecorative(_props, 16, 2, "bollard_portable", getLoc("bollard_small_portable_yellow")));

registerBlockSet(BOLLARD_THICK_LEFT, () -> new MetroBlockDecorativeRotatableBuilder().setProps(_props).setWidth(4).setModelName("bollard_traffic_1").setTextures(getLoc("traffic_bollard_thick_left")).build());
registerBlockSet(BOLLARD_THICK_RIGHT, () -> new MetroBlockDecorativeRotatableBuilder().setProps(_props).setWidth(4).setModelName("bollard_traffic_1").setTextures(getLoc("traffic_bollard_thick_right")).build());
registerBlockSet(BOLLARD_THIN_LEFT, () -> new MetroBlockDecorativeRotatableBuilder().setProps(_props).setShape(4, 16, 2).setModelName("bollard_traffic_2").setTextures(getLoc("traffic_bollard_thin_left")).build());
registerBlockSet(BOLLARD_THIN_RIGHT, () -> new MetroBlockDecorativeRotatableBuilder().setProps(_props).setShape(4, 16, 2).setModelName("bollard_traffic_2").setTextures(getLoc("traffic_bollard_thin_right")).build());

_decorativeTab = new CreativeTabSet(registration.getCreativeTabDeferredRegister(),"tab_decorative", getItem("bollard_1"));
}
Expand All @@ -59,6 +66,10 @@ public void generateCreativeTabs() {
for (int i = 0; i < bollardCount-1; i++) {
_decorativeTab.addItem(getItem("bollard_" + (i+1)).get().getDefaultInstance());
}
_decorativeTab.addItem(getItem(BOLLARD_THICK_LEFT).get().getDefaultInstance());
_decorativeTab.addItem(getItem(BOLLARD_THICK_RIGHT).get().getDefaultInstance());
_decorativeTab.addItem(getItem(BOLLARD_THIN_LEFT).get().getDefaultInstance());
_decorativeTab.addItem(getItem(BOLLARD_THIN_RIGHT).get().getDefaultInstance());
}

@Override
Expand Down
@@ -1,9 +1,9 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"0": "furenikusroads:blocks/machine_part_dark",
"1": "furenikusroads:blocks/traffic_bollard_left",
"particle": "furenikusroads:blocks/machine_part_dark"
"0": "furenikusroads:block/machine/machine_metal_dark",
"1": "#texture",
"particle": "furenikusroads:block/machine/machine_metal_dark"
},
"elements": [
{
Expand All @@ -27,7 +27,7 @@
"south": {"uv": [0, 0, 6, 15], "texture": "#1"},
"west": {"uv": [6, 0, 12, 15], "texture": "#1"},
"up": {"uv": [12, 0, 16, 4], "texture": "#1"},
"down": {"uv": [0, 0, 6, 6], "texture": "#missing"}
"down": {"uv": [0, 0, 6, 6], "texture": "#1"}
}
}
]
Expand Down

0 comments on commit c2c5d24

Please sign in to comment.