added support for reaping jewels

This commit is contained in:
alterNERDtive 2023-07-06 12:30:07 +02:00
parent 0b3b86b911
commit 5d49c055d1
Signed by: alterNERDtive
GPG key ID: 547787A4FE6533F1
4 changed files with 87 additions and 13 deletions

View file

@ -1,6 +1,6 @@
# devel # devel
* * Added support for Reaping Jewels (you still cannot obtain those without commands or config changes!).
# 3.10.1.5 (2023-06-27) # 3.10.1.5 (2023-06-27)

View file

@ -8,20 +8,21 @@ If you do not disable the changes that affect expertises, I recommend a full exp
## Fixes ## Fixes
* Removed the “Andersite” “joke” * Removed the “Andersite” “joke”.
* ~~Removed call to a colour handling event that is called several thousand times per second; gives a noticeable performance boost, but turns jewels and unidentified items white~~ use <https://github.com/radimous/FastVaultGear> * ~~Removed call to a colour handling event that is called several thousand times per second; gives a noticeable performance boost, but turns jewels and unidentified items white~~ use <https://github.com/radimous/FastVaultGear>.
* Fake players work with research again (e.g. Routers + Botany Pots, AE2 auto crafting) * Fake players work with research again (e.g. Routers + Botany Pots, AE2 auto crafting).
* Fake players can put Vault Rocks on the Altar again * Fake players can put Vault Rocks on the Altar again.
* Relic fragments \#5 are now equally as likely to drop as the others * Relic fragments \#5 are now equally as likely to drop as the others.
* AE2 auto crafting no longer requires manually giving its fake player all research * AE2 auto crafting no longer requires manually giving its fake player all research.
* Altar Conduit now draws the correct amount of power when connected to AE2 * Altar Conduit now draws the correct amount of power when connected to AE2.
## Changes ## Changes
* Removed Emerald cost from Vault Enchanter. * Removed Emerald cost from Vault Enchanter.
* Vault Enchanters offer Fortune 5, Fortunate expertise removed * Vault Enchanters offer Fortune 5, Fortunate expertise removed.
* Jewel cutting has a base 25% chance of failure, Jeweler expertise removed * Jewel cutting has a base 25% chance of failure, Jeweler expertise removed.
* Budding Crystal (Sky Vaults only) growth time reduced * Budding Crystal (Sky Vaults only) growth time reduced.
* Altar infusion time (time between redstone signal and the crystal popping off) reduced * Altar infusion time (time between redstone signal and the crystal popping off) reduced.
* Vault Junk Upgrades (Junk Management) tier 1 and 2 buffed * Vault Junk Upgrades (Junk Management) tier 1 and 2 buffed
* Jewel cutting buffed from 110 size reduction to 310 * Jewel cutting buffed from 110 size reduction to 310.
* Added support for Reaping jewels (you still cannot obtain those without commands or config changes!).

View file

@ -0,0 +1,72 @@
/**
* Copyright 2023 alterNERDtive.
*
* This file is part of Vault Mod Tweaks.
*
* Vault Mod Tweaks is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Vault Mod Tweaks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Vault Mod Tweaks. If not, see <https://www.gnu.org/licenses/>.
*/
package tv.alterNERD.VaultModTweaks.integration.mixin;
import java.util.Map;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import iskallia.vault.gear.data.VaultGearData;
import iskallia.vault.item.tool.ToolType;
import net.minecraft.world.item.ItemStack;
@Mixin(ToolType.class)
public abstract class MixinToolType {
/**
* Accessor mixin for the
* {@link iskallia.vault.item.tool.ToolType.PACKED_TO_TYPE} variable.
*
* @return nothing; this should never be actually called
*/
@Accessor
static Map<Integer, ToolType> getPACKED_TO_TYPE() {
throw new AssertionError();
}
/**
* Makes sure that items with both hammering _and_ reaping are given a
* model.
*
* Sadly there is no way to inject new values into the
* {@link iskallia.vault.item.tool.ToolType} Enum, so they will render as
* if they did not have reaping.
*
* @param stack the item in question
* @param ci CallBackInfo
* @param data local variable
* @param packed local variable
*/
@Inject(
method = "of",
at = @At("RETURN"),
cancellable = true,
locals = LocalCapture.CAPTURE_FAILHARD,
remap = false
)
private static void of$return(ItemStack stack, CallbackInfoReturnable<ToolType> ci, VaultGearData data, int packed) {
// hammering: 8, reaping: 16
if ((packed & 24) == 24) {
ci.setReturnValue(getPACKED_TO_TYPE().get(packed - 16));
}
}
}

View file

@ -11,6 +11,7 @@
"MixinExpertisesGuiConfig", "MixinExpertisesGuiConfig",
"MixinPlayerResearchesData", "MixinPlayerResearchesData",
"MixinStageManager", "MixinStageManager",
"MixinToolType",
"MixinUnidentifiedRelicFragmentsConfig", "MixinUnidentifiedRelicFragmentsConfig",
"MixinVaultAltarBlock", "MixinVaultAltarBlock",
"MixinVaultAltarConfig", "MixinVaultAltarConfig",