generated from NeoForgeMDKs/MDK-1.21-ModDevGradle
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
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
43 changes: 43 additions & 0 deletions
43
src/main/java/net/kaupenjoe/tutorialmod/block/custom/ChairBlock.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,43 @@ | ||
package net.kaupenjoe.tutorialmod.block.custom; | ||
|
||
import com.mojang.serialization.MapCodec; | ||
import net.minecraft.core.BlockPos; | ||
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.HorizontalDirectionalBlock; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.block.state.StateDefinition; | ||
import net.minecraft.world.phys.shapes.CollisionContext; | ||
import net.minecraft.world.phys.shapes.VoxelShape; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class ChairBlock extends HorizontalDirectionalBlock { | ||
public static final MapCodec<ChairBlock> CODEC = simpleCodec(ChairBlock::new); | ||
private static final VoxelShape SHAPE = Block.box(3.0, 0.0, 3.0, 13.0, 16.0, 13.0); | ||
|
||
public ChairBlock(Properties properties) { | ||
super(properties); | ||
} | ||
|
||
@Override | ||
protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) { | ||
return SHAPE; | ||
} | ||
|
||
@Override | ||
protected MapCodec<? extends HorizontalDirectionalBlock> codec() { | ||
return CODEC; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public BlockState getStateForPlacement(BlockPlaceContext context) { | ||
return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection().getOpposite()); | ||
} | ||
|
||
@Override | ||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { | ||
builder.add(FACING); | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
src/main/resources/assets/tutorialmod/blockstates/chair.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,19 @@ | ||
{ | ||
"variants": { | ||
"facing=north": { | ||
"model": "tutorialmod:block/chair" | ||
}, | ||
"facing=south": { | ||
"model": "tutorialmod:block/chair", | ||
"y": 180 | ||
}, | ||
"facing=east": { | ||
"model": "tutorialmod:block/chair", | ||
"y": 90 | ||
}, | ||
"facing=west": { | ||
"model": "tutorialmod:block/chair", | ||
"y": 270 | ||
} | ||
} | ||
} |
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
111 changes: 111 additions & 0 deletions
111
src/main/resources/assets/tutorialmod/models/block/chair.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,111 @@ | ||
{ | ||
"credit": "Made with Blockbench", | ||
"texture_size": [64, 64], | ||
"textures": { | ||
"0": "tutorialmod:block/chair", | ||
"particle": "tutorialmod:block/chair" | ||
}, | ||
"elements": [ | ||
{ | ||
"from": [3, 0, 11], | ||
"to": [5, 7, 13], | ||
"faces": { | ||
"north": {"uv": [5.5, 0.5, 6, 2.25], "texture": "#0"}, | ||
"east": {"uv": [5.5, 2.25, 6, 4], "texture": "#0"}, | ||
"south": {"uv": [2.5, 5.5, 3, 7.25], "texture": "#0"}, | ||
"west": {"uv": [3, 5.5, 3.5, 7.25], "texture": "#0"}, | ||
"up": {"uv": [6.5, 3.75, 6, 3.25], "texture": "#0"}, | ||
"down": {"uv": [6.5, 3.75, 6, 4.25], "texture": "#0"} | ||
} | ||
}, | ||
{ | ||
"from": [11, 0, 11], | ||
"to": [13, 7, 13], | ||
"faces": { | ||
"north": {"uv": [3.5, 5.5, 4, 7.25], "texture": "#0"}, | ||
"east": {"uv": [4, 5.5, 4.5, 7.25], "texture": "#0"}, | ||
"south": {"uv": [5.5, 4, 6, 5.75], "texture": "#0"}, | ||
"west": {"uv": [4.5, 5.5, 5, 7.25], "texture": "#0"}, | ||
"up": {"uv": [6.5, 4.75, 6, 4.25], "texture": "#0"}, | ||
"down": {"uv": [6.5, 4.75, 6, 5.25], "texture": "#0"} | ||
} | ||
}, | ||
{ | ||
"from": [11, 0, 3], | ||
"to": [13, 7, 5], | ||
"faces": { | ||
"north": {"uv": [5, 5.5, 5.5, 7.25], "texture": "#0"}, | ||
"east": {"uv": [5.5, 5.75, 6, 7.5], "texture": "#0"}, | ||
"south": {"uv": [0, 6, 0.5, 7.75], "texture": "#0"}, | ||
"west": {"uv": [0.5, 6, 1, 7.75], "texture": "#0"}, | ||
"up": {"uv": [6.5, 5.75, 6, 5.25], "texture": "#0"}, | ||
"down": {"uv": [6.5, 5.75, 6, 6.25], "texture": "#0"} | ||
} | ||
}, | ||
{ | ||
"from": [3, 0, 3], | ||
"to": [5, 7, 5], | ||
"faces": { | ||
"north": {"uv": [6, 0.5, 6.5, 2.25], "texture": "#0"}, | ||
"east": {"uv": [1, 6, 1.5, 7.75], "texture": "#0"}, | ||
"south": {"uv": [1.5, 6, 2, 7.75], "texture": "#0"}, | ||
"west": {"uv": [2, 6, 2.5, 7.75], "texture": "#0"}, | ||
"up": {"uv": [6.5, 6.75, 6, 6.25], "texture": "#0"}, | ||
"down": {"uv": [7, 0.5, 6.5, 1], "texture": "#0"} | ||
} | ||
}, | ||
{ | ||
"from": [2.9, 7, 2.5], | ||
"to": [13.1, 8, 13], | ||
"faces": { | ||
"north": {"uv": [6, 2.75, 8.5, 3], "texture": "#0"}, | ||
"east": {"uv": [6, 2.25, 8.75, 2.5], "texture": "#0"}, | ||
"south": {"uv": [6, 3, 8.5, 3.25], "texture": "#0"}, | ||
"west": {"uv": [6, 2.5, 8.75, 2.75], "texture": "#0"}, | ||
"up": {"uv": [2.5, 2.75, 0, 0], "texture": "#0"}, | ||
"down": {"uv": [5, 0, 2.5, 2.75], "texture": "#0"} | ||
} | ||
}, | ||
{ | ||
"from": [3, 8, 11.5], | ||
"to": [13, 19, 13], | ||
"faces": { | ||
"north": {"uv": [0, 2.75, 2.5, 5.5], "texture": "#0"}, | ||
"east": {"uv": [5, 0, 5.5, 2.75], "texture": "#0"}, | ||
"south": {"uv": [2.5, 2.75, 5, 5.5], "texture": "#0"}, | ||
"west": {"uv": [5, 2.75, 5.5, 5.5], "texture": "#0"}, | ||
"up": {"uv": [2.5, 6, 0, 5.5], "texture": "#0"}, | ||
"down": {"uv": [8, 0, 5.5, 0.5], "texture": "#0"} | ||
} | ||
} | ||
], | ||
"display": { | ||
"thirdperson_righthand": { | ||
"translation": [0, -0.75, 0], | ||
"scale": [0.5, 0.5, 0.5] | ||
}, | ||
"thirdperson_lefthand": { | ||
"translation": [0, -0.75, 0], | ||
"scale": [0.5, 0.5, 0.5] | ||
}, | ||
"firstperson_righthand": { | ||
"scale": [0.85, 0.85, 0.85] | ||
}, | ||
"firstperson_lefthand": { | ||
"scale": [0.85, 0.85, 0.85] | ||
}, | ||
"ground": { | ||
"scale": [0.85, 0.85, 0.85] | ||
}, | ||
"gui": { | ||
"rotation": [-165, -50, -180], | ||
"translation": [0.25, -1, 0], | ||
"scale": [0.65, 0.65, 0.65] | ||
}, | ||
"fixed": { | ||
"rotation": [-25.35, 59.42, 2.14], | ||
"translation": [0, -1.25, 0.25], | ||
"scale": [0.85, 0.85, 0.85] | ||
} | ||
} | ||
} |
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,3 @@ | ||
{ | ||
"parent": "tutorialmod:block/chair" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.