Skip to content

Commit

Permalink
sync (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aton-Kish committed Oct 8, 2022
1 parent d14ce4e commit 7d5c336
Show file tree
Hide file tree
Showing 493 changed files with 1,327 additions and 1,218 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
name: build
on:
push:
branches:
- 1.[0-9]+
- 1.[0-9]+.[0-9]+
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
branches:
- 1.[0-9]+
Expand All @@ -20,7 +19,6 @@ jobs:
matrix:
# Use these Java versions
java: [
16, # Minimum supported by Minecraft
17, # Current Java LTS
]
# and run on both Linux and Windows
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: publish
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*

jobs:
publish:
runs-on: ubuntu-latest
env:
JAVA_VERSION: 17

steps:
- name: checkout repository
uses: actions/checkout@v2

- name: checkout mcmod repository
uses: actions/checkout@v2
with:
repository: Aton-Kish/mcmod
ref: maven
token: ${{ secrets.API_TOKEN_GITHUB }}
path: build/maven

- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: setup jdk ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}

- name: make gradle wrapper executable
run: chmod +x ./gradlew

- name: publish
run: ./gradlew publish

- name: push to mcmod repository
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: build/maven
destination-github-username: Aton-Kish
destination-repository-name: mcmod
user-email: [email protected]
target-branch: maven
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![Mod Environment](https://img.shields.io/static/v1?label=environment&message=client%2Fserver&color=yellow)
[![Downloads](https://raw.githubusercontent.com/Aton-Kish/mcmod-stats/main/reinforced-shulker-boxes/downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/reinforced-shulker-boxes)
[![MIT License](https://img.shields.io/static/v1?label=licence&message=MIT&color=blue)](./LICENSE)
[![build](https://github.com/Aton-Kish/reinforced-shulker-boxes/actions/workflows/build.yml/badge.svg?branch=1.17)](https://github.com/Aton-Kish/reinforced-shulker-boxes/actions/workflows/build.yml?query=branch:1.17)
[![build](https://github.com/Aton-Kish/reinforced-shulker-boxes/actions/workflows/build.yaml/badge.svg?branch=1.17)](https://github.com/Aton-Kish/reinforced-shulker-boxes/actions/workflows/build.yaml?query=branch:1.17)

# Reinforced Shulker Boxes

Expand Down Expand Up @@ -45,6 +45,34 @@ The Reinforced Shulker Boxes mod adds reinforced shulker boxes.

Dyed reinforced shulker boxes can be undyed using a cauldron.

## Configure

[The Reinforced Core lib](https://github.com/Aton-Kish/reinforced-core) has been integrated with [Mod Menu](https://www.curseforge.com/minecraft/mc-mods/modmenu) since version 3.0.0.

![Mod Menu](./images/modmenu/modmenu.png)

### Screen Type

_Available in Reinforced Shulker Boxes mod version 2.1.0+._

Screen type is `SINGLE` or `SCROLL`. (default: `SINGLE`)

| `SINGLE` screen | `SCROLL` screen |
| --------------------------------------------- | ---------------------------------------------- |
| ![Single Screen](./images/modmenu/single.png) | ![Scroll Screen](./images/modmenu/scroll6.png) |

### Scroll Screen

#### Rows

_Available in Reinforced Shulker Boxes mod version 2.1.0+._

Rows is an integer in the range from `6` to `9`. (default: `6`)

| Rows: `6` | Rows: `9` |
| ------------------------------------------------------ | ------------------------------------------------------ |
| ![Scroll Screen: 6 rows](./images/modmenu/scroll6.png) | ![Scroll Screen: 9 rows](./images/modmenu/scroll9.png) |

## License

The Reinforced Shulker Boxes mod is licensed under the MIT License, see [LICENSE](./LICENSE).
23 changes: 13 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
}

Expand All @@ -17,29 +17,29 @@ repositories {
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.

// Reinforced Core
// Reinforced Storage
maven {
url "https://raw.githubusercontent.com/Aton-Kish/mcmod/maven"
}

// Quick Shulker
// ModMenu (Reinforced Core deps)
maven {
url "https://maven.kyrptonaught.dev"
url "https://maven.terraformersmc.com/releases/"
}

// Shulker Box Tooltip
// Cloth Config (Reinforced Core deps)
maven {
url "https://maven.misterpemodder.com/libs-release"
url "https://maven.shedaniel.me/"
}

// Mod Menu (Shulker Box Tooltip deps)
// Quick Shulker
maven {
url "https://maven.terraformersmc.com/releases/"
url "https://maven.kyrptonaught.dev"
}

// Cloth Config (Shulker Box Tooltip deps)
// Shulker Box Tooltip
maven {
url "https://maven.shedaniel.me"
url "https://maven.misterpemodder.com/libs-release"
}

// Fabric ASM (Shulker Box Tooltip deps)
Expand All @@ -61,6 +61,9 @@ dependencies {
modImplementation "atonkish.reinfcore:reinforced-core:${project.reinforced_core_version}"
include "atonkish.reinfcore:reinforced-core:${project.reinforced_core_version}"

// Reinforced Chests
modImplementation "atonkish.reinfchest:reinforced-chests:${project.reinforced_chests_version}"

// Quick Shulker
modImplementation "net.kyrptonaught:quickshulker:${project.quick_shulker_version}"

Expand Down
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ org.gradle.jvmargs=-Xmx1G
# check these on https://fabricmc.net/versions.html
minecraft_version=1.17.1
yarn_mappings=1.17.1+build.65
loader_version=0.12.12
loader_version=0.14.9

# Mod Properties
mod_version = 1.1.8+1.17
mod_version = 2.1.1+1.17
maven_group = atonkish.reinfshulker
archives_base_name = reinforced-shulker-boxes

# Dependencies
fabric_version=0.46.1+1.17
reinforced_core_version=1.1.3+1.17
reinforced_core_version=3.0.2+1.17
reinforced_chests_version=2.1.2+1.17
quick_shulker_version=1.3.0-1.17
shulker_box_tooltip_version=3.0.4+1.17.1
shulker_box_tooltip_version=3.0.6+1.17.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Binary file added images/modmenu/modmenu.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 images/modmenu/scroll6.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 images/modmenu/scroll9.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 images/modmenu/single.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pluginManagement {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
mavenCentral()
gradlePluginPortal()
}
}
Original file line number Diff line number Diff line change
@@ -1,52 +1,77 @@
package atonkish.reinfshulker;

import java.util.HashMap;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.block.Block;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DyeColor;
import net.minecraft.util.math.BlockPos;

import atonkish.reinfcore.api.ReinforcedCoreClientModInitializer;
import atonkish.reinfcore.api.ReinforcedCoreClientRegistry;
import atonkish.reinfcore.util.ReinforcingMaterial;
import atonkish.reinfshulker.api.ReinforcedShulkerBoxesClientModInitializer;
import atonkish.reinfshulker.api.ReinforcedShulkerBoxesClientRegistry;
import atonkish.reinfshulker.block.ModBlocks;
import atonkish.reinfshulker.block.ReinforcedShulkerBoxBlock;
import atonkish.reinfshulker.block.entity.ModBlockEntityType;
import atonkish.reinfshulker.block.entity.ReinforcedShulkerBoxBlockEntity;
import atonkish.reinfshulker.client.render.block.entity.ReinforcedShulkerBoxBlockEntityRenderer;
import atonkish.reinfshulker.util.ReinforcingMaterialSettings;

@Environment(EnvType.CLIENT)
public class ReinforcedShulkerBoxesClientMod implements ClientModInitializer {
public class ReinforcedShulkerBoxesClientMod implements ReinforcedCoreClientModInitializer {
@Override
public void onInitializeClient() {
// Block Entity Renderer
registerBlockEntityRenderer();
public void onInitializeReinforcedCoreClient() {
// init Reinforced Core
initializeReinforcedCoreClient();

// init Reinforced Shulker Boxes
initializeReinforcedShulkerBoxesClient();

// Item Renderer
registerBuiltinItemRenderer();
// entrypoint: "reinfshulkerclient"
FabricLoader.getInstance()
.getEntrypoints(ReinforcedShulkerBoxesMod.MOD_ID + "client",
ReinforcedShulkerBoxesClientModInitializer.class)
.forEach(ReinforcedShulkerBoxesClientModInitializer::onInitializeReinforcedShulkerBoxesClient);
}

private static void registerBlockEntityRenderer() {
for (BlockEntityType<ReinforcedShulkerBoxBlockEntity> blockEntityType : ModBlockEntityType.REINFORCED_SHULKER_BOX_MAP
.values()) {
BlockEntityRendererRegistry.register(blockEntityType, ReinforcedShulkerBoxBlockEntityRenderer::new);
private static void initializeReinforcedCoreClient() {
for (ReinforcingMaterialSettings materialSettings : ReinforcingMaterialSettings.values()) {
ReinforcingMaterial material = materialSettings.getMaterial();

// Reinforced Storage Screen
ReinforcedCoreClientRegistry.registerMaterialShulkerBoxScreen(material);
}
}

private static void registerBuiltinItemRenderer() {
for (HashMap<DyeColor, Block> materialShulkerBoxMap : ModBlocks.REINFORCED_SHULKER_BOX_MAP.values()) {
for (Block block : materialShulkerBoxMap.values()) {
ReinforcingMaterial material = ((ReinforcedShulkerBoxBlock) block).getMaterial();
private static void initializeReinforcedShulkerBoxesClient() {
for (ReinforcingMaterialSettings materialSettings : ReinforcingMaterialSettings.values()) {
ReinforcingMaterial material = materialSettings.getMaterial();

// Textured Render Layers
ReinforcedShulkerBoxesClientRegistry.registerMaterialAtlasTexture(ReinforcedShulkerBoxesMod.MOD_ID,
material);
ReinforcedShulkerBoxesClientRegistry.registerMaterialRenderLayer(ReinforcedShulkerBoxesMod.MOD_ID,
material);
ReinforcedShulkerBoxesClientRegistry.registerMaterialDefaultSprite(ReinforcedShulkerBoxesMod.MOD_ID,
material);
ReinforcedShulkerBoxesClientRegistry.registerMaterialColoringSprites(ReinforcedShulkerBoxesMod.MOD_ID,
material);

// Block Entity Renderer
BlockEntityRendererRegistry
.register(ModBlockEntityType.REINFORCED_SHULKER_BOX_MAP.get(material),
ReinforcedShulkerBoxBlockEntityRenderer::new);

// Item Renderer
for (Block block : ModBlocks.REINFORCED_SHULKER_BOX_MAP.get(material).values()) {
BuiltinItemRendererRegistry.INSTANCE.register(block, (ItemStack stack, ModelTransformation.Mode mode,
MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) -> {
BlockEntity blockEntity = new ReinforcedShulkerBoxBlockEntity(material, BlockPos.ORIGIN,
Expand Down
Loading

0 comments on commit 7d5c336

Please sign in to comment.