Skip to content

Commit

Permalink
Merge pull request #113 from refinedmods/release/0.11.0
Browse files Browse the repository at this point in the history
Release v0.11.0
  • Loading branch information
raoulvdberge authored Feb 16, 2024
2 parents d1cb8c2 + 4508bcc commit 3858764
Show file tree
Hide file tree
Showing 26 changed files with 111 additions and 76 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Documentation must be kept up to date when adding or changing functionality.

### Javadoc

Javadoc is available after every release on https://refinedmods.com/refinedstorageaddons/.
Javadoc is available after every release on https://refinedmods.com/javadoc/refinedstorageaddons/.

### API annotations

Expand Down Expand Up @@ -196,7 +196,7 @@ The workflow takes care of the following:
- Running a build.
- Publishing on [GitHub packages](https://github.com/refinedmods/refinedstorageaddons/packages) and
CreeperHost Maven.
- Publishing Javadoc on [GitHub pages](https://github.com/refinedmods/refinedstorageaddons/tree/gh-pages).
- Publishing Javadoc on [GitHub pages](https://github.com/refinedmods/javadoc).
- Deploying on [GitHub releases](https://github.com/refinedmods/refinedstorageaddons/releases).
- Announcing the release on Discord and Twitter.
- Creating a PR that merges `main` back into `develop` to get the changes to `CHANGELOG.md` and `build.gradle`
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ body:
options:
- Minecraft 1.19.2
- Minecraft 1.20.1
- Minecraft 1.20.4
validations:
required: true
- type: input
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
types: [ opened, synchronize, reopened ]
jobs:
build:
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.6.0
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.11.4
with:
mutation-testing: false
sonarqube: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
type: string
jobs:
draft:
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.6.0
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.11.4
with:
release-type: ${{ inputs.release-type }}
version-number-override: ${{ inputs.version-number-override }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-for-unsupported-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
types: [ labeled, unlabeled, reopened ]
jobs:
unsupported-labeler:
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.6.0
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.11.4
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- closed
jobs:
publish-release:
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.6.0
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.11.4
secrets: inherit
with:
project-name: 'Refined Storage Addons'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/resolved-issue-locking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
- cron: '0 0 * * *'
jobs:
lock:
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.6.0
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.11.4
2 changes: 1 addition & 1 deletion .github/workflows/validate-branch-name.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: Validate branch name
on: [ pull_request ]
jobs:
validate-branch-name:
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.6.0
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.11.4
4 changes: 3 additions & 1 deletion .github/workflows/validate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ on:
types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ]
jobs:
validate-changelog:
uses: refinedmods/refinedarchitect/.github/workflows/[email protected]
uses: refinedmods/refinedarchitect/.github/workflows/[email protected]
with:
validation-level: 'warn'
2 changes: 1 addition & 1 deletion .github/workflows/validate-commit-messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: Validate commit messages
on: [ pull_request ]
jobs:
validate-commit-messages:
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.6.0
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.11.4
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ eclipse/
.nb-gradle-properties
.project
*.launch
run/
runs/
*.iml
*.ipr
*.iws
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.11.0] - 2024-02-16

### Changed

- Ported to Minecraft 1.20.4.

## [0.10.0] - 2023-07-05

### Added

- Brazilian Portuguese translation.

### Changed

- Ported to Minecraft 1.20.1.
Expand Down Expand Up @@ -193,7 +203,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- Initial release for Minecraft 1.12 and Refined Storage 1.5.12.

[Unreleased]: https://github.com/refinedmods/refinedstorageaddons/compare/v0.10.0...HEAD
[Unreleased]: https://github.com/refinedmods/refinedstorageaddons/compare/v0.11.0...HEAD

[0.11.0]: https://github.com/refinedmods/refinedstorageaddons/compare/v0.10.0...v0.11.0

[0.10.0]: https://github.com/refinedmods/refinedstorageaddons/compare/v0.9.0...v0.10.0

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

Copyright © 2017 - 2023 Refined Mods
Copyright © 2017 - 2024 Refined Mods

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Refined Storage Addons [![Build Status](https://github.com/refinedmods/refinedstorageaddons/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/refinedmods/refinedstorageaddons/actions/workflows/build.yml) [![Downloads on CurseForge](http://cf.way2muchnoise.eu/full_272302_downloads.svg)](http://minecraft.curseforge.com/projects/refined-storage) [![Discord](https://img.shields.io/discord/342942776494653441)](https://discordapp.com/invite/VYzsydb) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.md)
# Refined Storage Addons [![Build Status](https://github.com/refinedmods/refinedstorageaddons/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/refinedmods/refinedstorageaddons/actions/workflows/build.yml) [![Downloads on CurseForge](http://cf.way2muchnoise.eu/full_272302_downloads.svg)](http://minecraft.curseforge.com/projects/refined-storage-addons) [![Downloads on Modrinth](https://img.shields.io/modrinth/dt/refined-storage-addons?logo=modrinth)](https://modrinth.com/mod/refined-storage-addons) [![Discord](https://img.shields.io/discord/342942776494653441)](https://discordapp.com/invite/VYzsydb) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE.md)

## About

Expand All @@ -18,6 +18,7 @@ Currently, Refined Storage Addons only adds the "Wireless Crafting Grid", a wire
- [CurseForge](https://curseforge.com/minecraft/mc-mods/refined-storage-addons)
- [Modrinth](https://modrinth.com/mod/refined-storage-addons)
- [Wiki](https://refinedmods.com/refined-storage-addons/)
- [Javadoc](https://refinedmods.com/javadoc/refinedstorageaddons)
- [Discord](https://discordapp.com/invite/VYzsydb)
- [Twitter](https://twitter.com/refinedmods)
- [Mastodon](https://anvil.social/@refinedmods)
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.6.0/helper.gradle"
apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v0.11.4/helper.gradle"

repositories {
maven {
Expand Down Expand Up @@ -28,8 +28,8 @@ enableModrinth("Z4Z5ccuT")
enableJavadoc()

dependencies {
compileOnly "com.refinedmods:refinedstorage:1.12.1"
runtimeOnly fg.deobf("com.refinedmods:refinedstorage:1.12.1") {
transitive false
compileOnly "com.refinedmods:refinedstorage:1.13.0-beta.2"
runtimeOnly("com.refinedmods:refinedstorage:1.13.0-beta.2") {
transitive = false
}
}
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
34 changes: 17 additions & 17 deletions src/main/java/com/refinedmods/refinedstorageaddons/RSAddons.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import com.refinedmods.refinedstorageaddons.config.ServerConfig;
import com.refinedmods.refinedstorageaddons.setup.ClientSetup;
import com.refinedmods.refinedstorageaddons.setup.CommonSetup;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.config.ModConfig;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.neoforge.common.NeoForge;

@Mod(RSAddons.ID)
public final class RSAddons {
Expand All @@ -21,19 +21,19 @@ public final class RSAddons {
public static final String ID = "refinedstorageaddons";
public static final ServerConfig SERVER_CONFIG = new ServerConfig();

public RSAddons() {
//new ItemStack(RSAddonsItems.CREATIVE_WIRELESS_CRAFTING_GRID.get())
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> {
FMLJavaModLoadingContext.get().getModEventBus().addListener(ClientSetup::onClientSetup);
MinecraftForge.EVENT_BUS.addListener(ClientSetup::onKeyInput);
FMLJavaModLoadingContext.get().getModEventBus().addListener(ClientSetup::onRegisterKeymappings);
});
public RSAddons(IEventBus eventBus) {
if (FMLEnvironment.dist == Dist.CLIENT) {
eventBus.addListener(ClientSetup::onClientSetup);
eventBus.addListener(ClientSetup::onRegisterKeymappings);
NeoForge.EVENT_BUS.addListener(ClientSetup::onKeyInput);
}

RSAddonsItems.register();
RSAddonsItems.register(eventBus);

ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, SERVER_CONFIG.getSpec());

FMLJavaModLoadingContext.get().getModEventBus().addListener(CommonSetup::onCommonSetup);
FMLJavaModLoadingContext.get().getModEventBus().addListener(CommonSetup::onRegister);
eventBus.addListener(CommonSetup::onCommonSetup);
eventBus.addListener(CommonSetup::onRegisterCapabilities);
eventBus.addListener(CommonSetup::onRegister);
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
package com.refinedmods.refinedstorageaddons;

import com.refinedmods.refinedstorageaddons.item.WirelessCraftingGridItem;

import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.item.Item;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;

public final class RSAddonsItems {
private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, RSAddons.ID);
private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(BuiltInRegistries.ITEM, RSAddons.ID);

static {
WIRELESS_CRAFTING_GRID = ITEMS.register("wireless_crafting_grid", () -> new WirelessCraftingGridItem(WirelessCraftingGridItem.Type.NORMAL));
CREATIVE_WIRELESS_CRAFTING_GRID = ITEMS.register("creative_wireless_crafting_grid", () -> new WirelessCraftingGridItem(WirelessCraftingGridItem.Type.CREATIVE));
}

public static final RegistryObject<WirelessCraftingGridItem> WIRELESS_CRAFTING_GRID;
public static final RegistryObject<WirelessCraftingGridItem> CREATIVE_WIRELESS_CRAFTING_GRID;
public static final DeferredHolder<Item, WirelessCraftingGridItem> WIRELESS_CRAFTING_GRID;
public static final DeferredHolder<Item, WirelessCraftingGridItem> CREATIVE_WIRELESS_CRAFTING_GRID;

public static void register() {
ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
public static void register(IEventBus eventBus) {
ITEMS.register(eventBus);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.mojang.blaze3d.platform.InputConstants;
import net.minecraft.client.KeyMapping;
import net.minecraftforge.client.settings.KeyConflictContext;
import net.minecraftforge.client.settings.KeyModifier;
import net.neoforged.neoforge.client.settings.KeyConflictContext;
import net.neoforged.neoforge.client.settings.KeyModifier;
import org.lwjgl.glfw.GLFW;

public final class RSAddonsKeyBindings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.energy.IEnergyStorage;
import net.neoforged.neoforge.capabilities.Capabilities;
import net.neoforged.neoforge.energy.IEnergyStorage;

public class WirelessCraftingGridNetworkItem implements INetworkItem {
private final INetworkItemManager handler;
Expand All @@ -37,7 +37,7 @@ public Player getPlayer() {

@Override
public boolean onOpen(INetwork network) {
IEnergyStorage energy = stack.getCapability(ForgeCapabilities.ENERGY, null).orElse(null);
IEnergyStorage energy = stack.getCapability(Capabilities.EnergyStorage.ITEM);

if (RSAddons.SERVER_CONFIG.getWirelessCraftingGrid().getUseEnergy() &&
((WirelessCraftingGridItem) stack.getItem()).getType() != WirelessCraftingGridItem.Type.CREATIVE &&
Expand All @@ -64,7 +64,8 @@ public boolean onOpen(INetwork network) {
@Override
public void drainEnergy(int energy) {
if (RSAddons.SERVER_CONFIG.getWirelessCraftingGrid().getUseEnergy() && ((WirelessCraftingGridItem) stack.getItem()).getType() != WirelessCraftingGridItem.Type.CREATIVE) {
stack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energyStorage -> {
IEnergyStorage energyStorage = stack.getCapability(Capabilities.EnergyStorage.ITEM);
if (energyStorage != null) {
energyStorage.extractEnergy(energy, false);

if (energyStorage.getEnergyStored() <= 0) {
Expand All @@ -74,7 +75,7 @@ public void drainEnergy(int energy) {

sendOutOfEnergyMessage();
}
});
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.refinedmods.refinedstorageaddons.config;

import net.minecraftforge.common.ForgeConfigSpec;
import net.neoforged.neoforge.common.ModConfigSpec;

public class ServerConfig {
private ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder();
private ForgeConfigSpec spec;
private WirelessCraftingGrid wirelessCraftingGrid;
private final ModConfigSpec.Builder builder = new ModConfigSpec.Builder();
private final ModConfigSpec spec;
private final WirelessCraftingGrid wirelessCraftingGrid;

public ServerConfig() {
wirelessCraftingGrid = new WirelessCraftingGrid();
Expand All @@ -18,11 +18,11 @@ public WirelessCraftingGrid getWirelessCraftingGrid() {
}

public class WirelessCraftingGrid {
private final ForgeConfigSpec.BooleanValue useEnergy;
private final ForgeConfigSpec.IntValue capacity;
private final ForgeConfigSpec.IntValue openUsage;
private final ForgeConfigSpec.IntValue craftUsage;
private final ForgeConfigSpec.IntValue clearUsage;
private final ModConfigSpec.BooleanValue useEnergy;
private final ModConfigSpec.IntValue capacity;
private final ModConfigSpec.IntValue openUsage;
private final ModConfigSpec.IntValue craftUsage;
private final ModConfigSpec.IntValue clearUsage;

public WirelessCraftingGrid() {
builder.push("wirelessCraftingGrid");
Expand Down Expand Up @@ -57,7 +57,7 @@ public int getClearUsage() {
}
}

public ForgeConfigSpec getSpec() {
public ModConfigSpec getSpec() {
return spec;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import net.minecraft.world.inventory.TransientCraftingContainer;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.CraftingRecipe;
import net.minecraft.world.item.crafting.RecipeHolder;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.Level;

Expand Down Expand Up @@ -108,7 +109,9 @@ public ResultContainer getCraftingResult() {
@Override
public void onCraftingMatrixChanged() {
if (currentRecipe == null || !currentRecipe.matches(craftingContainer, level)) {
currentRecipe = level.getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftingContainer, level).orElse(null);
currentRecipe = level.getRecipeManager().getRecipeFor(RecipeType.CRAFTING, craftingContainer, level)
.map(RecipeHolder::value)
.orElse(null);
}
if (currentRecipe == null) {
craftingResultContainer.setItem(0, ItemStack.EMPTY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.client.event.InputEvent;
import net.minecraftforge.client.event.RegisterKeyMappingsEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
import net.neoforged.neoforge.client.event.InputEvent;
import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent;

public final class ClientSetup {
private ClientSetup() {
Expand Down
Loading

0 comments on commit 3858764

Please sign in to comment.