-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some small code changes and moscow metro logo
What I did: -Moved code from main to other classes to clean up -Metro Logo
- Loading branch information
1 parent
c338dd9
commit 1f295db
Showing
23 changed files
with
281 additions
and
353 deletions.
There are no files selected for viewing
16 changes: 14 additions & 2 deletions
16
common/src/main/java/ru/weryskok/mtrrumetro/BlockEntityTypes.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 |
---|---|---|
@@ -1,10 +1,22 @@ | ||
package ru.weryskok.mtrrumetro; | ||
|
||
import mtr.RegistryObject; | ||
import mtr.mappings.BlockEntityMapper; | ||
import mtr.mappings.RegistryUtilities; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
import ru.weryskok.mtrrumetro.blocks.*; | ||
|
||
public interface BlockEntityTypes { | ||
RegistryObject<BlockEntityType<BlockSPBHorizontalElevatorDoor.TileEntitySPBHorizontalElevatorDoor>> SPB_HORIZONTAL_ELEVATOR_DOOR_TILE_ENTITY = new RegistryObject<>(() -> RegistryUtilities.getBlockEntityType(BlockSPBHorizontalElevatorDoor.TileEntitySPBHorizontalElevatorDoor::new, Blocks.SPB_HORIZONTAL_ELEVATOR_DOOR.get())); | ||
import java.util.function.BiConsumer; | ||
|
||
public class BlockEntityTypes { | ||
public final BiConsumer<String, RegistryObject<? extends BlockEntityType<? extends BlockEntityMapper>>> registerBlockEntityType; | ||
public static final RegistryObject<BlockEntityType<BlockSPBHorizontalElevatorDoor.TileEntitySPBHorizontalElevatorDoor>> SPB_HORIZONTAL_ELEVATOR_DOOR_TILE_ENTITY = new RegistryObject<>(() -> RegistryUtilities.getBlockEntityType(BlockSPBHorizontalElevatorDoor.TileEntitySPBHorizontalElevatorDoor::new, Blocks.SPB_HORIZONTAL_ELEVATOR_DOOR.get())); | ||
|
||
public BlockEntityTypes(BiConsumer<String, RegistryObject<? extends BlockEntityType<? extends BlockEntityMapper>>> registerBlockEntityType) { | ||
this.registerBlockEntityType = registerBlockEntityType; | ||
} | ||
|
||
public void registerBlockEntites(){ | ||
registerBlockEntityType.accept("spb_horizontal_elevator_door", BlockEntityTypes.SPB_HORIZONTAL_ELEVATOR_DOOR_TILE_ENTITY); | ||
} | ||
} |
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
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
42 changes: 42 additions & 0 deletions
42
common/src/main/java/ru/weryskok/mtrrumetro/blocks/outside/MetroLogo.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,42 @@ | ||
package ru.weryskok.mtrrumetro.blocks.outside; | ||
|
||
import it.unimi.dsi.fastutil.doubles.DoubleList; | ||
import mtr.block.IBlock; | ||
import mtr.data.RailAngle; | ||
import mtr.mappings.BlockDirectionalMapper; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.item.context.BlockPlaceContext; | ||
import net.minecraft.world.level.BlockGetter; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.block.state.StateDefinition; | ||
import net.minecraft.world.level.block.state.properties.BooleanProperty; | ||
import net.minecraft.world.level.material.Material; | ||
import net.minecraft.world.phys.shapes.CollisionContext; | ||
import net.minecraft.world.phys.shapes.Shapes; | ||
import net.minecraft.world.phys.shapes.VoxelShape; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class MetroLogo extends BlockDirectionalMapper { | ||
|
||
public MetroLogo() { | ||
super(Properties.of(Material.METAL).friction(2f)); | ||
} | ||
|
||
@Override | ||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { | ||
builder.add(FACING); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public BlockState getStateForPlacement(BlockPlaceContext blockPlaceContext) { | ||
return defaultBlockState().setValue(FACING, blockPlaceContext.getHorizontalDirection().getOpposite()); | ||
} | ||
|
||
@Override | ||
public VoxelShape getShape(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, CollisionContext collisionContext) { | ||
return Shapes.box(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
common/src/main/resources/assets/russianmetro/blockstates/moscow_metro_label.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,20 @@ | ||
{ | ||
"variants": { | ||
"facing=north": { | ||
"model": "russianmetro:block/enterance_deco/metro_logo" | ||
}, | ||
"facing=east": { | ||
"model": "russianmetro:block/enterance_deco/metro_logo", | ||
"y": 90 | ||
}, | ||
"facing=south": { | ||
"model": "russianmetro:block/enterance_deco/metro_logo", | ||
"y": 180 | ||
}, | ||
"facing=west": { | ||
"model": "russianmetro:block/enterance_deco/metro_logo", | ||
"y": 270 | ||
} | ||
|
||
} | ||
} |
102 changes: 102 additions & 0 deletions
102
common/src/main/resources/assets/russianmetro/models/block/enterance_deco/metro_logo.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,102 @@ | ||
{ | ||
"credit": "Made with Blockbench", | ||
"parent": "block/block", | ||
"texture_size": [32, 32], | ||
"textures": { | ||
"0": "russianmetro:block/enterance_deco/subway_logo", | ||
"particle": "russianmetro:block/enterance_deco/subway_logo" | ||
}, | ||
"elements": [ | ||
{ | ||
"from": [9.15432, 4.77583, 7], | ||
"to": [11.15432, 12.27583, 9], | ||
"rotation": {"angle": 22.5, "axis": "z", "origin": [8, 11, 8]}, | ||
"faces": { | ||
"north": {"uv": [3, 0, 4, 4], "texture": "#0"}, | ||
"east": {"uv": [0, 0, 1, 4], "texture": "#0"}, | ||
"south": {"uv": [1, 0, 2, 4], "texture": "#0"}, | ||
"west": {"uv": [2, 0, 3, 4], "texture": "#0"}, | ||
"up": {"uv": [4, 7.5, 3, 6.5], "rotation": 90, "texture": "#0"}, | ||
"down": {"uv": [5, 6.5, 4, 7.5], "rotation": 270, "texture": "#0"} | ||
} | ||
}, | ||
{ | ||
"from": [7.84568, 8.52583, 7], | ||
"to": [9.84568, 13.52583, 9], | ||
"rotation": {"angle": -22.5, "axis": "z", "origin": [8, 11, 8]}, | ||
"faces": { | ||
"north": {"uv": [5, 2.5, 6, 5], "texture": "#0"}, | ||
"east": {"uv": [3, 4, 4, 6.5], "texture": "#0"}, | ||
"south": {"uv": [4, 4, 5, 6.5], "texture": "#0"}, | ||
"west": {"uv": [5, 0, 6, 2.5], "texture": "#0"}, | ||
"up": {"uv": [8, 3, 7, 2], "rotation": 90, "texture": "#0"}, | ||
"down": {"uv": [8, 3, 7, 4], "rotation": 270, "texture": "#0"} | ||
} | ||
}, | ||
{ | ||
"from": [6.15432, 8.52583, 7], | ||
"to": [8.15432, 13.52583, 9], | ||
"rotation": {"angle": 22.5, "axis": "z", "origin": [8, 11, 8]}, | ||
"faces": { | ||
"north": {"uv": [6, 5, 7, 7.5], "texture": "#0"}, | ||
"east": {"uv": [5, 5, 6, 7.5], "texture": "#0"}, | ||
"south": {"uv": [6, 0, 7, 2.5], "texture": "#0"}, | ||
"west": {"uv": [6, 2.5, 7, 5], "texture": "#0"}, | ||
"up": {"uv": [8, 5, 7, 4], "rotation": 90, "texture": "#0"}, | ||
"down": {"uv": [8, 5, 7, 6], "rotation": 270, "texture": "#0"} | ||
} | ||
}, | ||
{ | ||
"from": [4.84568, 4.77583, 7], | ||
"to": [6.84568, 12.27583, 9], | ||
"rotation": {"angle": -22.5, "axis": "z", "origin": [8, 11, 8]}, | ||
"faces": { | ||
"north": {"uv": [2, 4, 3, 8], "texture": "#0"}, | ||
"east": {"uv": [0, 4, 1, 8], "texture": "#0"}, | ||
"south": {"uv": [4, 0, 5, 4], "texture": "#0"}, | ||
"west": {"uv": [1, 4, 2, 8], "texture": "#0"}, | ||
"up": {"uv": [8, 1, 7, 0], "rotation": 90, "texture": "#0"}, | ||
"down": {"uv": [8, 1, 7, 2], "rotation": 270, "texture": "#0"} | ||
} | ||
}, | ||
{ | ||
"from": [8.825, 13, 7], | ||
"to": [10.425, 13.4, 9], | ||
"rotation": {"angle": 0, "axis": "y", "origin": [8, 11, 8]}, | ||
"faces": { | ||
"north": {"uv": [1, 8, 2, 8.5], "texture": "#0"}, | ||
"east": {"uv": [0, 8, 1, 8.5], "texture": "#0"}, | ||
"south": {"uv": [8, 0, 9, 0.5], "texture": "#0"}, | ||
"west": {"uv": [8, 0.5, 9, 1], "texture": "#0"}, | ||
"up": {"uv": [8, 7, 7, 6], "rotation": 90, "texture": "#0"}, | ||
"down": {"uv": [8, 7, 7, 8], "rotation": 270, "texture": "#0"} | ||
} | ||
}, | ||
{ | ||
"from": [5.575, 13, 7], | ||
"to": [7.175, 13.4, 9], | ||
"rotation": {"angle": 0, "axis": "y", "origin": [8, 11, 8]}, | ||
"faces": { | ||
"north": {"uv": [8, 2, 9, 2.5], "texture": "#0"}, | ||
"east": {"uv": [8, 1, 9, 1.5], "texture": "#0"}, | ||
"south": {"uv": [8, 1.5, 9, 2], "texture": "#0"}, | ||
"west": {"uv": [2, 8, 3, 8.5], "texture": "#0"}, | ||
"up": {"uv": [4, 8.5, 3, 7.5], "rotation": 90, "texture": "#0"}, | ||
"down": {"uv": [5, 7.5, 4, 8.5], "rotation": 270, "texture": "#0"} | ||
} | ||
}, | ||
{ | ||
"from": [7.15, 8, 7], | ||
"to": [8.75, 8.4, 9], | ||
"rotation": {"angle": 0, "axis": "y", "origin": [8, 11, 8]}, | ||
"faces": { | ||
"north": {"uv": [8, 4, 9, 4.5], "texture": "#0"}, | ||
"east": {"uv": [8, 2.5, 9, 3], "texture": "#0"}, | ||
"south": {"uv": [8, 3, 9, 3.5], "texture": "#0"}, | ||
"west": {"uv": [8, 3.5, 9, 4], "texture": "#0"}, | ||
"up": {"uv": [6, 8.5, 5, 7.5], "rotation": 90, "texture": "#0"}, | ||
"down": {"uv": [7, 7.5, 6, 8.5], "rotation": 270, "texture": "#0"} | ||
} | ||
} | ||
] | ||
} |
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.