diff --git a/src/main/java/net/brokenmoon/redcontrol/RedControl.java b/src/main/java/net/brokenmoon/redcontrol/RedControl.java index 550beea..e3fd360 100644 --- a/src/main/java/net/brokenmoon/redcontrol/RedControl.java +++ b/src/main/java/net/brokenmoon/redcontrol/RedControl.java @@ -46,10 +46,10 @@ public class RedControl implements ModInitializer { LOGGER.info("Initializing RedControl!"); Registry.register(Registries.BLOCK, new Identifier("redcontrol", "cpu"), CPU); Registry.register(Registries.BLOCK, new Identifier("redcontrol", "monitor"), MONITOR); - Registry.register(Registries.BLOCK, new Identifier("redcontrol", "drive"), DRIVE); + Registry.register(Registries.BLOCK, new Identifier("redcontrol", "disk_drive"), DRIVE); Registry.register(Registries.ITEM, new Identifier("redcontrol", "cpu"), new BlockItem(CPU, new FabricItemSettings())); Registry.register(Registries.ITEM, new Identifier("redcontrol", "monitor"), new BlockItem(MONITOR, new FabricItemSettings())); - Registry.register(Registries.ITEM, new Identifier("redcontrol", "drive"), new BlockItem(DRIVE, new FabricItemSettings())); + Registry.register(Registries.ITEM, new Identifier("redcontrol", "disk_drive"), new BlockItem(DRIVE, new FabricItemSettings())); } } \ No newline at end of file diff --git a/src/main/java/net/brokenmoon/redcontrol/blocks/NetworkCarrier.java b/src/main/java/net/brokenmoon/redcontrol/blocks/NetworkCarrier.java index 53db078..6efecca 100644 --- a/src/main/java/net/brokenmoon/redcontrol/blocks/NetworkCarrier.java +++ b/src/main/java/net/brokenmoon/redcontrol/blocks/NetworkCarrier.java @@ -7,7 +7,10 @@ import net.brokenmoon.redcontrol.mixin.RedBusAccessor; import net.minecraft.block.*; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemStack; +import net.minecraft.state.StateManager; +import net.minecraft.state.property.Properties; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; @@ -97,4 +100,15 @@ public abstract class NetworkCarrier extends BlockWithEntity implements BlockEnt return ActionResult.SUCCESS; } + + @Override + protected void appendProperties(StateManager.Builder builder) { + builder.add(Properties.HORIZONTAL_FACING); + } + + @Override + public BlockState getPlacementState(ItemPlacementContext ctx) { + return super.getPlacementState(ctx).with(Properties.HORIZONTAL_FACING, ctx.getHorizontalPlayerFacing().getOpposite()); + } + } diff --git a/src/main/resources/assets/redcontrol/blockstates/cpu.json b/src/main/resources/assets/redcontrol/blockstates/cpu.json new file mode 100644 index 0000000..f817c96 --- /dev/null +++ b/src/main/resources/assets/redcontrol/blockstates/cpu.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "redcontrol:block/cpu", "uvlock": false }, + "facing=east": { "model": "redcontrol:block/cpu", "y": 90, "uvlock": false }, + "facing=south": { "model": "redcontrol:block/cpu", "y": 180, "uvlock": false }, + "facing=west": { "model": "redcontrol:block/cpu", "y": 270, "uvlock": false } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/redcontrol/blockstates/disk_drive.json b/src/main/resources/assets/redcontrol/blockstates/disk_drive.json new file mode 100644 index 0000000..cf95c47 --- /dev/null +++ b/src/main/resources/assets/redcontrol/blockstates/disk_drive.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "redcontrol:block/disk_drive", "uvlock": false }, + "facing=east": { "model": "redcontrol:block/disk_drive", "y": 90, "uvlock": false }, + "facing=south": { "model": "redcontrol:block/disk_drive", "y": 180, "uvlock": false }, + "facing=west": { "model": "redcontrol:block/disk_drive", "y": 270, "uvlock": false } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/redcontrol/blockstates/monitor.json b/src/main/resources/assets/redcontrol/blockstates/monitor.json new file mode 100644 index 0000000..dfa8163 --- /dev/null +++ b/src/main/resources/assets/redcontrol/blockstates/monitor.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "redcontrol:block/monitor", "uvlock": false }, + "facing=east": { "model": "redcontrol:block/monitor", "y": 90, "uvlock": false }, + "facing=south": { "model": "redcontrol:block/monitor", "y": 180, "uvlock": false }, + "facing=west": { "model": "redcontrol:block/monitor", "y": 270, "uvlock": false } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/redcontrol/models/block/cpu.json b/src/main/resources/assets/redcontrol/models/block/cpu.json new file mode 100644 index 0000000..64cebdb --- /dev/null +++ b/src/main/resources/assets/redcontrol/models/block/cpu.json @@ -0,0 +1,23 @@ +{ "parent": "block/block", + "textures": { + "front": "redcontrol:block/cpu", + "left": "redcontrol:block/monitor_left", + "right": "redcontrol:block/monitor_right", + "back": "redcontrol:block/monitor_back", + "top": "redcontrol:block/monitor_bottom", + "bottom": "redcontrol:block/monitor_top" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#bottom", "cullface": "down" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#front", "cullface": "north" }, + "south": { "texture": "#back", "cullface": "south" }, + "west": { "texture": "#right", "cullface": "west" }, + "east": { "texture": "#left", "cullface": "east" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/redcontrol/models/block/disk_drive.json b/src/main/resources/assets/redcontrol/models/block/disk_drive.json new file mode 100644 index 0000000..b839bb0 --- /dev/null +++ b/src/main/resources/assets/redcontrol/models/block/disk_drive.json @@ -0,0 +1,23 @@ +{ "parent": "block/block", + "textures": { + "front": "redcontrol:block/disk_drive", + "left": "redcontrol:block/monitor_left", + "right": "redcontrol:block/monitor_right", + "back": "redcontrol:block/monitor_back", + "top": "redcontrol:block/monitor_bottom", + "bottom": "redcontrol:block/monitor_top" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#bottom", "cullface": "down" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#front", "cullface": "north" }, + "south": { "texture": "#back", "cullface": "south" }, + "west": { "texture": "#right", "cullface": "west" }, + "east": { "texture": "#left", "cullface": "east" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/redcontrol/models/block/monitor.json b/src/main/resources/assets/redcontrol/models/block/monitor.json new file mode 100644 index 0000000..343d9d4 --- /dev/null +++ b/src/main/resources/assets/redcontrol/models/block/monitor.json @@ -0,0 +1,23 @@ +{ "parent": "block/block", + "textures": { + "front": "redcontrol:block/monitor_front", + "left": "redcontrol:block/monitor_left", + "right": "redcontrol:block/monitor_right", + "back": "redcontrol:block/monitor_back", + "top": "redcontrol:block/monitor_bottom", + "bottom": "redcontrol:block/monitor_top" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "faces": { + "down": { "texture": "#bottom", "cullface": "down" }, + "up": { "texture": "#top", "cullface": "up" }, + "north": { "texture": "#front", "cullface": "north" }, + "south": { "texture": "#back", "cullface": "south" }, + "west": { "texture": "#right", "cullface": "west" }, + "east": { "texture": "#left", "cullface": "east" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/redcontrol/models/item/cpu.json b/src/main/resources/assets/redcontrol/models/item/cpu.json new file mode 100644 index 0000000..4530cc2 --- /dev/null +++ b/src/main/resources/assets/redcontrol/models/item/cpu.json @@ -0,0 +1,3 @@ +{ + "parent": "redcontrol:block/cpu" +} \ No newline at end of file diff --git a/src/main/resources/assets/redcontrol/models/item/disk_drive.json b/src/main/resources/assets/redcontrol/models/item/disk_drive.json new file mode 100644 index 0000000..4125203 --- /dev/null +++ b/src/main/resources/assets/redcontrol/models/item/disk_drive.json @@ -0,0 +1,3 @@ +{ + "parent": "redcontrol:block/disk_drive" +} \ No newline at end of file diff --git a/src/main/resources/assets/redcontrol/models/item/monitor.json b/src/main/resources/assets/redcontrol/models/item/monitor.json new file mode 100644 index 0000000..a63f05a --- /dev/null +++ b/src/main/resources/assets/redcontrol/models/item/monitor.json @@ -0,0 +1,3 @@ +{ + "parent": "redcontrol:block/monitor" +} \ No newline at end of file diff --git a/src/main/resources/assets/redcontrol/textures/block/cpu.ase b/src/main/resources/assets/redcontrol/textures/block/cpu.ase new file mode 100644 index 0000000..3da393b Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/cpu.ase differ diff --git a/src/main/resources/assets/redcontrol/textures/block/cpu.png b/src/main/resources/assets/redcontrol/textures/block/cpu.png new file mode 100644 index 0000000..14d3dbf Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/cpu.png differ diff --git a/src/main/resources/assets/redcontrol/textures/block/disk_drive.ase b/src/main/resources/assets/redcontrol/textures/block/disk_drive.ase new file mode 100644 index 0000000..de5b0f9 Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/disk_drive.ase differ diff --git a/src/main/resources/assets/redcontrol/textures/block/disk_drive.png b/src/main/resources/assets/redcontrol/textures/block/disk_drive.png new file mode 100644 index 0000000..c106094 Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/disk_drive.png differ diff --git a/src/main/resources/assets/redcontrol/textures/block/monitor.ase b/src/main/resources/assets/redcontrol/textures/block/monitor.ase new file mode 100644 index 0000000..0e6b10d Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/monitor.ase differ diff --git a/src/main/resources/assets/redcontrol/textures/block/monitor.png b/src/main/resources/assets/redcontrol/textures/block/monitor.png new file mode 100644 index 0000000..434d196 Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/monitor.png differ diff --git a/src/main/resources/assets/redcontrol/textures/block/monitor_back.png b/src/main/resources/assets/redcontrol/textures/block/monitor_back.png new file mode 100644 index 0000000..18b441e Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/monitor_back.png differ diff --git a/src/main/resources/assets/redcontrol/textures/block/monitor_bottom.png b/src/main/resources/assets/redcontrol/textures/block/monitor_bottom.png new file mode 100644 index 0000000..0cd1aee Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/monitor_bottom.png differ diff --git a/src/main/resources/assets/redcontrol/textures/block/monitor_front.png b/src/main/resources/assets/redcontrol/textures/block/monitor_front.png new file mode 100644 index 0000000..c329a8b Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/monitor_front.png differ diff --git a/src/main/resources/assets/redcontrol/textures/block/monitor_left.png b/src/main/resources/assets/redcontrol/textures/block/monitor_left.png new file mode 100644 index 0000000..246257c Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/monitor_left.png differ diff --git a/src/main/resources/assets/redcontrol/textures/block/monitor_right.png b/src/main/resources/assets/redcontrol/textures/block/monitor_right.png new file mode 100644 index 0000000..1b960d9 Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/monitor_right.png differ diff --git a/src/main/resources/assets/redcontrol/textures/block/monitor_top.png b/src/main/resources/assets/redcontrol/textures/block/monitor_top.png new file mode 100644 index 0000000..f3e98e7 Binary files /dev/null and b/src/main/resources/assets/redcontrol/textures/block/monitor_top.png differ