Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Build Release

on : [push, pull_request]

env:
## set env
git_sha: ${{github.sha}}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
src/generated
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle
- uses: actions/checkout@v4
- uses: BrycensRanch/read-properties-action@v1
id: version
with:
file: gradle.properties
property: mod_version
default: 1.0.0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Set version env
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Datagen with gradle
run: ./gradlew runData
- name: Build with Gradle
run: ./gradlew build
- name: Upload binaries to release
uses: actions/upload-artifact@v4
with:
name: createdeco-${{steps.version.outputs.value}}-${{github.sha}}.jar
path: build/libs/createdeco-${{steps.version.outputs.value}}.jar
repo-token: ${{ secrets.ACTION_TOKEN }}
- name: Upload sources to release
uses: actions/upload-artifact@v4
with:
name: createdeco-${{steps.version.outputs.value}}-${{github.sha}}-sources.jar
path: build/libs/createdeco-${{steps.version.outputs.value}}-sources.jar
repo-token: ${{ secrets.ACTION_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
import net.minecraft.world.level.block.SimpleWaterloggedBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
Expand All @@ -32,7 +33,7 @@
import javax.annotation.Nullable;
import java.util.function.Predicate;

public class CatwalkStairBlock extends Block implements IWrenchable, SimpleWaterloggedBlock {
public class CatwalkStairBlock extends HorizontalDirectionalBlock implements IWrenchable, SimpleWaterloggedBlock {

private static final VoxelShape BOX_NORTH = Shapes.join(
Block.box(0d, 14d, 8d, 16d, 16d, 16d),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
import net.minecraft.world.level.block.SimpleWaterloggedBlock;
import net.minecraft.world.level.block.SupportType;
import net.minecraft.world.level.block.state.BlockState;
Expand All @@ -21,7 +22,7 @@

import javax.annotation.Nullable;

public class DecalBlock extends Block implements SimpleWaterloggedBlock {
public class DecalBlock extends HorizontalDirectionalBlock implements SimpleWaterloggedBlock {
private static final VoxelShape NORTH = Block.box(
1d, 1d, 0d,
15d, 15d, 1d
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.DirectionalBlock;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.SimpleWaterloggedBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
Expand Down Expand Up @@ -123,6 +125,16 @@ public VoxelShape getShape (BlockState state, BlockGetter reader, BlockPos pos,
};
}

@Override
public BlockState rotate(BlockState state, Rotation rotation) {
return state.setValue(FACING, rotation.rotate(state.getValue(FACING)));
}

@Override
public BlockState mirror(BlockState state, Mirror mirror) {
return state.setValue(FACING, mirror.mirror(state.getValue(FACING)));
}

public static boolean isSupportBlock (ItemStack test) {
return (test.getItem() instanceof BlockItem)
&& isSupportBlock(((BlockItem)test.getItem()).getBlock());
Expand Down