-
Notifications
You must be signed in to change notification settings - Fork 0
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
14 changed files
with
123 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Automatically build the project and run any configured tests for every push | ||
# and submitted pull request. This can help catch issues that only occur on | ||
# certain platforms or Java versions, and provides a first line of defence | ||
# against bad commits. | ||
|
||
name: build | ||
on: [pull_request, push] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
# Use these Java versions | ||
java: [ | ||
21, # Current Java LTS | ||
] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v4 | ||
- name: validate gradle wrapper | ||
uses: gradle/wrapper-validation-action@v2 | ||
- name: setup jdk ${{ matrix.java }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'microsoft' | ||
- name: make gradle wrapper executable | ||
run: chmod +x ./gradlew | ||
- name: build | ||
run: ./gradlew build | ||
- name: capture build artifacts | ||
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Artifacts | ||
path: build/libs/ |
Binary file not shown.
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
30 changes: 30 additions & 0 deletions
30
src/main/java/org/decdev/thepoetryofwinter/block/ModBlocks.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,30 @@ | ||
package org.decdev.thepoetryofwinter.block; | ||
|
||
import net.minecraft.block.AbstractBlock; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.item.BlockItem; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.util.Identifier; | ||
import org.decdev.thepoetryofwinter.ThePoetryOfWinter; | ||
|
||
public class ModBlocks { | ||
|
||
public static final Block AA_SWORDMAN_BLOCK = register("aaswordman_block", new Block(AbstractBlock.Settings.create().strength(3.0f,3.0f))); | ||
|
||
public static void registerBlockItems(String id, Block block){ | ||
Item item = Registry.register(Registries.ITEM,Identifier.of(ThePoetryOfWinter.MOD_ID,id),new BlockItem(block, new Item.Settings())); | ||
if (item instanceof BlockItem) { | ||
((BlockItem)item).appendBlocks(Item.BLOCK_ITEMS,item); | ||
} | ||
} | ||
|
||
public static Block register(String id, Block block){ | ||
registerBlockItems(id,block); | ||
return Registry.register(Registries.BLOCK, Identifier.of(ThePoetryOfWinter.MOD_ID,id),block); | ||
} | ||
public static void registerModBlocks(){ | ||
ThePoetryOfWinter.LOGGER.info("Registering ThePoetryOfWinter Blocks"); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/org/decdev/thepoetryofwinter/item/ModItems.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,21 @@ | ||
package org.decdev.thepoetryofwinter.item; | ||
|
||
import net.minecraft.item.Item; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.util.Identifier; | ||
import org.decdev.thepoetryofwinter.ThePoetryOfWinter; | ||
|
||
public class ModItems { | ||
|
||
public static final Item AA_SWORDMAN = registerItems("aaswordman", new Item(new Item.Settings().maxCount(1))); | ||
|
||
public static Item registerItems(String id, Item item) { | ||
return Registry.register( | ||
Registries.ITEM, Identifier.of(ThePoetryOfWinter.MOD_ID,id), item); | ||
} | ||
|
||
public static void registerModItems(){ | ||
ThePoetryOfWinter.LOGGER.info("Registering ThePoetryOfWinter Items"); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/assets/thepoetryofwinter/blockstates/aaswordman_block.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,7 @@ | ||
{ | ||
"variants": { | ||
"": { | ||
"model": "thepoetryofwinter:block/aaswordman_block" | ||
} | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"item.thepoetryofwinter.aaswordman": "AAswordman", | ||
"block.thepoetryofwinter.aaswordman_block": "AAswordman block" | ||
} |
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,4 @@ | ||
{ | ||
"item.thepoetryofwinter.aaswordman": "AA剑侠", | ||
"block.thepoetryofwinter.aaswordman_block": "AA剑侠方块" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/thepoetryofwinter/models/block/aaswordman_block.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,6 @@ | ||
{ | ||
"parent": "minecraft:block/cube_all", | ||
"textures": { | ||
"all": "thepoetryofwinter:block/aaswordman_block" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/thepoetryofwinter/models/item/aaswordman.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,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "thepoetryofwinter:item/aaswordman" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/thepoetryofwinter/models/item/aaswordman_block.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,3 @@ | ||
{ | ||
"parent": "thepoetryofwinter:block/aaswordman_block" | ||
} |
Binary file added
BIN
+612 KB
src/main/resources/assets/thepoetryofwinter/textures/block/aaswordman_block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+612 KB
src/main/resources/assets/thepoetryofwinter/textures/item/aaswordman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+612 KB
src/main/resources/assets/thepoetryofwinter/textures/item/aaswordman_block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.