Skip to content

Commit

Permalink
[v2.1.1+1.18] bump version (#46)
Browse files Browse the repository at this point in the history
* sync
  • Loading branch information
Aton-Kish committed Oct 9, 2022
1 parent 0624391 commit 98618db
Show file tree
Hide file tree
Showing 22 changed files with 99 additions and 59 deletions.
File renamed without changes.
5 changes: 2 additions & 3 deletions .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 Down
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.18)](https://github.com/Aton-Kish/reinforced-shulker-boxes/actions/workflows/build.yml?query=branch:1.18)
[![build](https://github.com/Aton-Kish/reinforced-shulker-boxes/actions/workflows/build.yaml/badge.svg?branch=1.18)](https://github.com/Aton-Kish/reinforced-shulker-boxes/actions/workflows/build.yaml?query=branch:1.18)

# 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).
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.3
loader_version=0.14.6
yarn_mappings=1.18.2+build.4
loader_version=0.14.9

# Mod Properties
mod_version=2.0.1+1.18.2
mod_version=2.1.1+1.18
maven_group=atonkish.reinfshulker
archives_base_name=reinforced-shulker-boxes

# Dependencies
fabric_version=0.54.0+1.18.2
reinforced_core_version=2.0.1+1.18.2
reinforced_chests_version=2.0.1+1.18.2
quick_shulker_version=1.3.5-1.18
shulker_box_tooltip_version=3.0.7+1.18.2
fabric_version=0.59.0+1.18.2
reinforced_core_version=3.0.2+1.18
reinforced_chests_version=2.1.2+1.18
quick_shulker_version=1.3.9-1.18
shulker_box_tooltip_version=3.0.10+1.18.2
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.
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,20 @@ public ReinforcedShulkerBoxBlock(ReinforcingMaterial material, @Nullable DyeColo
this.material = material;
}

@Override
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
return new ReinforcedShulkerBoxBlockEntity(this.material, this.getColor(), pos, state);
}

@Override
@Nullable
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state,
BlockEntityType<T> type) {
return checkType(type, ModBlockEntityType.REINFORCED_SHULKER_BOX_MAP.get(this.material),
ReinforcedShulkerBoxBlockEntity::tick);
}

@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand,
BlockHitResult hit) {
if (world.isClient) {
Expand Down Expand Up @@ -81,6 +84,7 @@ private static boolean canOpen(BlockState state, World world, BlockPos pos, Shul
}
}

@Override
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
BlockEntity blockEntity = world.getBlockEntity(pos);
if (blockEntity instanceof ReinforcedShulkerBoxBlockEntity) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,33 @@

import atonkish.reinfcore.screen.ReinforcedStorageScreenHandler;
import atonkish.reinfcore.util.ReinforcingMaterial;
import atonkish.reinfshulker.mixin.BlockEntityAccessor;

public class ReinforcedShulkerBoxBlockEntity extends ShulkerBoxBlockEntity {
private final ReinforcingMaterial cachedMaterial;

public ReinforcedShulkerBoxBlockEntity(ReinforcingMaterial material, @Nullable DyeColor color, BlockPos pos,
BlockState state) {
super(color, pos, state);
((BlockEntityInterface) this).setType(ModBlockEntityType.REINFORCED_SHULKER_BOX_MAP.get(material));
((BlockEntityAccessor) this).setType(ModBlockEntityType.REINFORCED_SHULKER_BOX_MAP.get(material));
this.setInvStackList(DefaultedList.ofSize(material.getSize(), ItemStack.EMPTY));
this.cachedMaterial = material;
}

public ReinforcedShulkerBoxBlockEntity(ReinforcingMaterial material, BlockPos pos, BlockState state) {
super(pos, state);
((BlockEntityInterface) this).setType(ModBlockEntityType.REINFORCED_SHULKER_BOX_MAP.get(material));
((BlockEntityAccessor) this).setType(ModBlockEntityType.REINFORCED_SHULKER_BOX_MAP.get(material));
this.setInvStackList(DefaultedList.ofSize(material.getSize(), ItemStack.EMPTY));
this.cachedMaterial = material;
}

@Override
protected Text getContainerName() {
String namespace = BlockEntityType.getId(this.getType()).getNamespace();
return new TranslatableText("container." + namespace + "." + this.cachedMaterial.getName() + "ShulkerBox");
}

@Override
public int[] getAvailableSlots(Direction side) {
return IntStream.range(0, this.size()).toArray();
}
Expand All @@ -51,6 +54,7 @@ public ReinforcingMaterial getMaterial() {
return this.cachedMaterial;
}

@Override
protected ScreenHandler createScreenHandler(int syncId, PlayerInventory playerInventory) {
return ReinforcedStorageScreenHandler.createShulkerBoxScreen(this.cachedMaterial, syncId, playerInventory,
this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.util.SpriteIdentifier;
import net.minecraft.util.DyeColor;
Expand All @@ -28,6 +29,16 @@ public static Identifier registerMaterialAtlasTexture(String namespace, Reinforc
if (!REINFORCED_SHULKER_BOXES_ATLAS_TEXTURE_MAP.containsKey(material)) {
Identifier identifier = new Identifier(namespace,
"textures/atlas/" + material.getName() + "_shulker_boxes.png");

ClientSpriteRegistryCallback.event(identifier).register((atlasTexture, registry) -> {
String nonColorPath = "entity/reinforced_shulker/" + material.getName() + "/shulker";
registry.register(new Identifier(namespace, nonColorPath));
for (DyeColor color : DyeColor.values()) {
String colorPath = nonColorPath + "_" + color.getName();
registry.register(new Identifier(namespace, colorPath));
}
});

REINFORCED_SHULKER_BOXES_ATLAS_TEXTURE_MAP.put(material, identifier);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public ReinforcedShulkerBoxBlockEntityRenderer(BlockEntityRendererFactory.Contex
this.model = new ShulkerEntityModel<>(ctx.getLayerModelPart(EntityModelLayers.SHULKER));
}

@Override
public void render(ReinforcedShulkerBoxBlockEntity reinforcedShulkerBoxBlockEntity, float tickDelta,
MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
Direction direction = Direction.UP;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.util.function.BiConsumer;

import net.kyrptonaught.quickshulker.api.ItemStackInventory;
import net.kyrptonaught.quickshulker.api.QuickOpenableRegistry;
import net.kyrptonaught.quickshulker.api.RegisterQuickShulker;
import net.kyrptonaught.shulkerutils.ItemStackInventory;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
Expand Down Expand Up @@ -40,8 +40,7 @@ public void registerProviders() {
PlayerEntity playerEntity) -> ReinforcedStorageScreenHandler.createShulkerBoxScreen(material,
syncId, playerInventory, inventory);
Text text = stack.hasCustomName() ? stack.getName()
: new TranslatableText(
"container." + namespace + "." + material.getName() + "ShulkerBox");
: new TranslatableText("container." + namespace + "." + material.getName() + "ShulkerBox");

player.openHandledScreen(new SimpleNamedScreenHandlerFactory(screenHandlerFactory, text));
};
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/atonkish/reinfshulker/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import atonkish.reinfcore.item.ItemGroupInterface;
import atonkish.reinfcore.item.ModItemGroup;
import atonkish.reinfcore.util.ReinforcingMaterial;
import atonkish.reinfshulker.block.ModBlocks;
Expand Down Expand Up @@ -45,7 +44,7 @@ public static Item registerMaterialDyeColor(ReinforcingMaterial material, DyeCol

public static void registerMaterialDyeColorItemGroupIcon(ReinforcingMaterial material, DyeColor color) {
Item item = REINFORCED_SHULKER_BOX_MAP.get(material).get(color);
((ItemGroupInterface) ModItemGroup.REINFORCED_STORAGE).setIcon(item);
ModItemGroup.setIcon(ModItemGroup.REINFORCED_STORAGE, item);
}

private static Item register(BlockItem item) {
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/atonkish/reinfshulker/mixin/BlockEntityAccessor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package atonkish.reinfshulker.mixin;

import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityType;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(BlockEntity.class)
public interface BlockEntityAccessor {
@Mutable
@Accessor("type")
public void setType(BlockEntityType<?> type);
}
21 changes: 0 additions & 21 deletions src/main/java/atonkish/reinfshulker/mixin/BlockEntityMixin.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ private void removeMissingIdentifier(Map<Identifier, JsonElement> map, ResourceM

missingIdentifiers.forEach(map::remove);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public ReinforcedShulkerBoxColoringRecipe(Identifier identifier) {
super(identifier);
}

@Override
public boolean matches(CraftingInventory craftingInventory, World world) {
int i = 0;
int j = 0;
Expand All @@ -46,6 +47,7 @@ public boolean matches(CraftingInventory craftingInventory, World world) {
return i == 1 && j == 1;
}

@Override
public ItemStack craft(CraftingInventory craftingInventory) {
ItemStack itemStack = ItemStack.EMPTY;
DyeItem dyeItem = (DyeItem) Items.WHITE_DYE;
Expand Down Expand Up @@ -73,10 +75,12 @@ public ItemStack craft(CraftingInventory craftingInventory) {
return itemStack3;
}

@Override
public boolean fits(int width, int height) {
return width * height >= 2;
}

@Override
public RecipeSerializer<?> getSerializer() {
return ModRecipeSerializer.REINFORCED_SHULKER_BOX_COLORING;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public ReinforcedShulkerBoxCraftingRecipe(Identifier id, String group, int width
this.output = output;
}

@Override
public ItemStack craft(CraftingInventory craftingInventory) {
ItemStack inputItemStack = craftingInventory.getStack(4);
ItemStack outputItemStack = this.getOutput().copy();
Expand All @@ -51,6 +52,7 @@ public ItemStack craft(CraftingInventory craftingInventory) {
return outputItemStack;
}

@Override
public RecipeSerializer<?> getSerializer() {
return ModRecipeSerializer.REINFORCED_SHULKER_BOX;
}
Expand Down Expand Up @@ -217,6 +219,7 @@ static Map<String, Ingredient> readSymbols(JsonObject json) {
}

public static class Serializer implements RecipeSerializer<ReinforcedShulkerBoxCraftingRecipe> {
@Override
public ReinforcedShulkerBoxCraftingRecipe read(Identifier identifier, JsonObject jsonObject) {
String string = JsonHelper.getString(jsonObject, "group", "");
Map<String, Ingredient> map = ReinforcedShulkerBoxCraftingRecipe
Expand All @@ -232,6 +235,7 @@ public ReinforcedShulkerBoxCraftingRecipe read(Identifier identifier, JsonObject
return new ReinforcedShulkerBoxCraftingRecipe(identifier, string, i, j, defaultedList, itemStack);
}

@Override
public ReinforcedShulkerBoxCraftingRecipe read(Identifier identifier, PacketByteBuf packetByteBuf) {
int i = packetByteBuf.readVarInt();
int j = packetByteBuf.readVarInt();
Expand All @@ -246,6 +250,7 @@ public ReinforcedShulkerBoxCraftingRecipe read(Identifier identifier, PacketByte
return new ReinforcedShulkerBoxCraftingRecipe(identifier, string, i, j, defaultedList, itemStack);
}

@Override
public void write(PacketByteBuf packetByteBuf, ReinforcedShulkerBoxCraftingRecipe recipe) {
packetByteBuf.writeVarInt(recipe.width);
packetByteBuf.writeVarInt(recipe.height);
Expand All @@ -260,5 +265,4 @@ public void write(PacketByteBuf packetByteBuf, ReinforcedShulkerBoxCraftingRecip
packetByteBuf.writeItemStack(recipe.output);
}
}

}
Loading

0 comments on commit 98618db

Please sign in to comment.