Skip to content

Commit

Permalink
bump version from 2.0.4+1.19 to 2.1.0+1.19 (#40)
Browse files Browse the repository at this point in the history
* chore: bump deps versions

* chore: add Override deco

* chore: bump deps versions

* refactor: block entity accessor

* chore: add tag trigger

* docs: add config section

* chore: bump version from 2.0.4+1.19 to 2.1.0+1.19

* fix: fix image
  • Loading branch information
Aton-Kish authored Aug 12, 2022
1 parent 2bbbc23 commit cfe060a
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 61 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
name: build
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
branches:
- 1.[0-9]+
- 1.[0-9]+.[0-9]+
Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
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).
26 changes: 9 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,35 @@ 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)
maven {
url "https://jitpack.io"
}

// ModMenu (Shulker Box Tooltip deps)
// temporary
maven {
url "https://maven.terraformersmc.com/releases/"
}
}

dependencies {
Expand All @@ -75,8 +69,6 @@ dependencies {

// Shulker Box Tooltip
modImplementation "com.misterpemodder:shulkerboxtooltip:${project.shulker_box_tooltip_version}"
// temporary
modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}"
}

processResources {
Expand Down
18 changes: 8 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.1
yarn_mappings=1.19.1+build.5
loader_version=0.14.8
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.1
loader_version=0.14.9

# Mod Properties
mod_version=2.0.4+1.19
mod_version=2.1.0+1.19
maven_group=atonkish.reinfshulker
archives_base_name=reinforced-shulker-boxes

# Dependencies
fabric_version=0.58.5+1.19.1
reinforced_core_version=2.1.1+1.19
reinforced_chests_version=2.0.4+1.19
quick_shulker_version=1.3.6-1.19
fabric_version=0.59.0+1.19.2
reinforced_core_version=3.0.1+1.19
reinforced_chests_version=2.1.1+1.19
quick_shulker_version=1.3.7-1.19
shulker_box_tooltip_version=3.0.10+1.19
# temporary
mod_menu_version=4.0.5
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 @@ -18,30 +18,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 Text.translatable("container." + namespace + "." + this.cachedMaterial.getName() + "ShulkerBox");
}

@Override
public int[] getAvailableSlots(Direction side) {
return IntStream.range(0, this.size()).toArray();
}
Expand All @@ -50,6 +53,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 @@ -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
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 @@ -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);
}
}

}
2 changes: 1 addition & 1 deletion src/main/resources/reinfshulker.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"compatibilityLevel": "JAVA_17",
"mixins": [
"AbstractCauldronBlockMixin",
"BlockEntityMixin",
"BlockEntityAccessor",
"ShulkerBoxBlockMixin",
"ShulkerBoxColoringRecipeMixin",
"RecipeManagerMixin",
Expand Down

0 comments on commit cfe060a

Please sign in to comment.