Cincture of Consumption (#30)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub GTNH Actions <[email protected]>
Co-authored-by: Nikolay S. <[email protected]>
This commit is contained in:
authored and GitHub committed 2026-11-01 20:24:30 -06:00
1 parent 5579082643
commit 4f4632546a
19 files changed
+303 -11

No files matched your search

-1
View File
@@ -26,7 +26,6 @@ whitelist.json
*.iml
*.ipr
*.iws
src/main/resources/mixins.*.json
*.bat
*.DS_Store
!gradlew.bat
+1
View File
@@ -9,6 +9,7 @@ This mod requires the following mods:
* [Thaumcraft 4](http://www.minecraftforum.net/topic/2011841-)
* [Baubles](https://github.com/GTNewHorizons/Baubles-Expanded/)
* [GTNHLib](https://github.com/GTNewHorizons/GTNHLib)
* [UniMixins](https://github.com/LegacyModdingMC/UniMixins)
Extra content is available if any of the following mods are also present:
* [Botania](https://github.com/GTNewHorizons/Botania/): Wand cores and caps that regenerate vis with Botania's mana and three new magical flowers.
+1 -1
View File
@@ -12,5 +12,5 @@ dependencies {
compileOnly(rfg.deobf("curse.maven:minefactory-reloaded-66672:2277486"))
compileOnly(rfg.deobf("curse.maven:cofh-core-69162:2388750")) // For MFR
runtimeOnlyNonPublishable("com.github.GTNewHorizons:AspectRecipeIndex:1.1.0:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:AspectRecipeIndex:1.1.3:dev")
}
+7 -7
View File
@@ -44,7 +44,7 @@ developmentEnvironmentUserName = Developer
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
# - modern: Native modern Java bytecode, no downgrading
enableModernJavaSyntax = jabel
enableModernJavaSyntax = jvmDowngrader
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
# and should *not* be used in most situations. -1 disables this.
@@ -52,12 +52,12 @@ enableModernJavaSyntax = jabel
# Target JVM version for JVM Downgrader bytecode downgrading.
# Only used when enableModernJavaSyntax = jvmDowngrader
# downgradeTargetVersion = 8
downgradeTargetVersion = 8
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
# Classes will be available in META-INF/versions/N/ for each version N in this list.
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
# jvmDowngraderMultiReleaseVersions = 21,25
jvmDowngraderMultiReleaseVersions = 21,25
# Specifies how JVM Downgrader API stubs are provided. Options:
# - shade: Shade minimized stubs into the jar
@@ -65,7 +65,7 @@ enableModernJavaSyntax = jabel
# - external: Another dependency provides stubs (no constraint, no warning)
# - (empty): Warning reminding you to configure stubs
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
# jvmDowngraderStubsProvider =
jvmDowngraderStubsProvider = gtnhlib
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
@@ -107,7 +107,7 @@ apiPackage =
accessTransformersFile =
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
usesMixins = true
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
@@ -123,12 +123,12 @@ mixinPlugin =
# Specify the package that contains all of your Mixins. The package must exist or
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
# it must match with this or the build will fail.
mixinsPackage =
mixinsPackage = mixins
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
coreModClass =
coreModClass = mixins.EarlyMixinsLoader
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
@@ -50,6 +50,7 @@ public class Config {
public static byte gluttony = 0;
public static boolean enchanting = true;
public static int hereticID = 666;
public static boolean consumptionCincture = true;
public static boolean crossMod = true;
public static boolean crossWand = true;
@@ -165,6 +166,12 @@ public class Config {
"Whether gluttony research is enabled. 0 = Enabled, 1 = Disabled, 2 = Hardcore").getInt(0);
if (gluttony < 0 || gluttony > 2) gluttony = 0;
hereticID = conf.get("general", "Heretic Villager ID", hereticID).getInt(hereticID);
consumptionCincture = conf.get(
"general",
"Cincture of Consumption",
consumptionCincture,
"Enable the Cincture of Consumption, a belt that makes eating faster and possible at full hunger.")
.getBoolean(consumptionCincture);
String trashlist = conf.get(
"general",
@@ -324,5 +324,10 @@ public class DarkAspects {
ThaumcraftApi.registerObjectTag(
new ItemStack(ForbiddenBlocks.taintStone, 1, 1),
(new AspectList()).add(Aspect.EARTH, 1));
if (Config.consumptionCincture) {
ThaumcraftApi.registerObjectTag(
new ItemStack(ForbiddenItems.consumptionCincture, 1, OreDictionary.WILDCARD_VALUE),
new AspectList().add(Aspect.CLOTH, 8).add(GLUTTONY, 8).add(Aspect.HUNGER, 8));
}
}
}
@@ -28,6 +28,7 @@ import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
@@ -64,6 +65,7 @@ import fox.spiteful.forbidden.blocks.ForbiddenBlocks;
import fox.spiteful.forbidden.compat.Compat;
import fox.spiteful.forbidden.enchantments.DarkEnchantments;
import fox.spiteful.forbidden.items.ForbiddenItems;
import fox.spiteful.forbidden.items.baubles.ItemConsumptionCincture;
import fox.spiteful.forbidden.items.baubles.ItemSubCollar;
import fox.spiteful.forbidden.items.tools.ItemRidingCrop;
import fox.spiteful.forbidden.items.tools.ItemTaintPickaxe;
@@ -432,7 +434,20 @@ public class FMEventHandler {
}
@SubscribeEvent
public void onEat(PlayerUseItemEvent.Finish event) {
public void onStartEating(PlayerUseItemEvent.Start event) {
if (Config.consumptionCincture && edible(event.item)
&& ItemConsumptionCincture.wearingBelt(event.entityPlayer)) {
event.duration = 1;
}
}
private static boolean edible(ItemStack item) {
return item.getItem() != null && (item.getItem().getItemUseAction(item) == EnumAction.eat
|| item.getItem().getItemUseAction(item) == EnumAction.drink);
}
@SubscribeEvent
public void onFinishEating(PlayerUseItemEvent.Finish event) {
if (event.entityPlayer.worldObj.isRemote) return;
if (event.item.getItem() instanceof ItemFood) {
if (event.entityPlayer.worldObj.provider.dimensionId == -1
@@ -430,6 +430,27 @@ public class ForbiddenRecipes {
new ItemStack(ForbiddenItems.ridingCrop, 1, 0),
new Object[] { "X", "#", "#", Character.valueOf('#'), Items.stick, Character.valueOf('X'),
Items.leather }));
if (Config.consumptionCincture) {
ForbiddenResearch.recipes.put(
"ConsumptionCincture",
ThaumcraftApi.addArcaneCraftingRecipe(
"CONSUMPTIONCINCTURE",
new ItemStack(ForbiddenItems.consumptionCincture),
new AspectList().add(Aspect.WATER, 25).add(Aspect.EARTH, 25).add(Aspect.AIR, 10),
"LCL",
"SBS",
"LKL",
'L',
new ItemStack(Items.leather),
'C',
new ItemStack(ConfigBlocks.blockChestHungry),
'S',
new ItemStack(ForbiddenItems.gluttonyShard),
'B',
new ItemStack(ConfigItems.itemBaubleBlanks, 1, 2),
'K',
new ItemStack(Items.cookie)));
}
ThaumcraftApi.addSmeltingBonus(new ItemStack(Items.emerald), new ItemStack(ForbiddenItems.resource, 0, 0));
GameRegistry.registerFuelHandler(new IFuelHandler() {
@@ -24,7 +24,7 @@ import thaumcraft.api.research.ResearchPage;
public class ForbiddenResearch {
public static HashMap recipes = new HashMap();
public static HashMap<String, Object> recipes = new HashMap<>();
public static void addResearch() {
ResearchCategories.registerCategory(
@@ -377,6 +377,21 @@ public class ForbiddenResearch {
new ResearchPage((InfusionEnchantmentRecipe) recipes.get("Voidtouched")))
.setParents("MORPHTOOLS", "VOIDMETAL").setConcealed().registerResearchItem();
ThaumcraftApi.addWarpToResearch("VOIDTOUCHED", 3);
if (Config.consumptionCincture) {
new DarkResearchItem(
"CONSUMPTIONCINCTURE",
"FORBIDDEN",
new AspectList().add(Aspect.HUNGER, 8).add(Aspect.FLESH, 8).add(Aspect.CLOTH, 8)
.add(DarkAspects.GLUTTONY, 16),
-12,
-7,
4,
new ItemStack(ForbiddenItems.consumptionCincture))
.setPages(
new ResearchPage("forbidden.research_page.CONSUMPTIONCINCTURE.1"),
new ResearchPage((IArcaneRecipe) recipes.get("ConsumptionCincture")))
.setParents("RINGFOOD", "HUNGRYCHEST").setConcealed().registerResearchItem();
}
}
if (Config.wrathCage) {
@@ -45,6 +45,7 @@ public class Compat {
public static boolean special = false;
public static boolean twilight = false;
public static boolean ee3 = false;
public static boolean baublesExpanded = false;
public static boolean mfr = false;
public static void initiate() {
@@ -58,6 +59,7 @@ public class Compat {
special = Config.wrathCage && Config.special && Loader.isModLoaded("SpecialMobs");
twilight = Config.wrathCage && Config.twilight && Loader.isModLoaded("TwilightForest");
ee3 = (Config.emc /* || Config.eewand */) && Loader.isModLoaded("EE3");
baublesExpanded = Loader.isModLoaded("Baubles|Expanded");
mfr = Loader.isModLoaded("MineFactoryReloaded");
}
@@ -15,6 +15,7 @@ import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.registry.GameRegistry;
import fox.spiteful.forbidden.Config;
import fox.spiteful.forbidden.compat.Compat;
import fox.spiteful.forbidden.items.baubles.ItemConsumptionCincture;
import fox.spiteful.forbidden.items.baubles.ItemRingNutrition;
import fox.spiteful.forbidden.items.baubles.ItemSubCollar;
import fox.spiteful.forbidden.items.scribes.ItemBloodwell;
@@ -54,6 +55,7 @@ import thaumcraft.api.wands.WandRod;
public class ForbiddenItems {
public static Item consumptionCincture;
public static Item deadlyShards;
public static Item gluttonyShard;
public static Item skullAxe;
@@ -337,6 +339,11 @@ public class ForbiddenItems {
blinkFocus = new ItemFocusBlink().setUnlocalizedName("BlinkFocus");
GameRegistry.registerItem(blinkFocus, "BlinkFocus");
if (Config.consumptionCincture) {
consumptionCincture = new ItemConsumptionCincture().setUnlocalizedName("consumption_cincture");
GameRegistry.registerItem(consumptionCincture, "consumption_cincture");
}
}
public static FocusUpgradeType getUpgrade(int id, ResourceLocation icon, String name, String text,
@@ -0,0 +1,107 @@
package fox.spiteful.forbidden.items.baubles;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import baubles.api.BaubleType;
import baubles.api.BaublesApi;
import baubles.api.IBauble;
import baubles.api.expanded.BaubleItemHelper;
import cpw.mods.fml.common.Optional;
import fox.spiteful.forbidden.Forbidden;
import fox.spiteful.forbidden.compat.Compat;
import fox.spiteful.forbidden.items.ForbiddenItems;
import thaumcraft.api.IRunicArmor;
import vazkii.botania.api.item.ICosmeticAttachable;
@Optional.Interface(iface = "vazkii.botania.api.item.ICosmeticAttachable", modid = "Botania")
public class ItemConsumptionCincture extends Item implements IRunicArmor, IBauble, ICosmeticAttachable {
public ItemConsumptionCincture() {
super();
maxStackSize = 1;
setCreativeTab(Forbidden.tab);
setTextureName("forbidden:consumption_cincture");
}
@Override
public BaubleType getBaubleType(ItemStack itemstack) {
return BaubleType.BELT;
}
@Override
public void onWornTick(ItemStack itemstack, EntityLivingBase player) {}
@Override
public void onEquipped(ItemStack itemstack, EntityLivingBase player) {}
@Override
public void onUnequipped(ItemStack itemstack, EntityLivingBase player) {}
@Override
public boolean canEquip(ItemStack itemstack, EntityLivingBase player) {
return true;
}
@Override
public boolean canUnequip(ItemStack itemstack, EntityLivingBase player) {
return true;
}
@Override
public int getRunicCharge(ItemStack itemstack) {
return 0;
}
@Override
public ItemStack getCosmeticItem(ItemStack stack) {
if (stack == null || stack.getTagCompound() == null) return null;
if (!stack.getTagCompound().hasKey("cosmeticItem")) return null;
NBTTagCompound cosmetic = stack.getTagCompound().getCompoundTag("cosmeticItem");
return ItemStack.loadItemStackFromNBT(cosmetic);
}
@Override
public void setCosmeticItem(ItemStack stack, ItemStack cosmetic) {
if (stack == null) return;
NBTTagCompound cmp = new NBTTagCompound();
if (cosmetic != null) cosmetic.writeToNBT(cmp);
NBTTagCompound tag = stack.getTagCompound();
if (tag == null) {
tag = new NBTTagCompound();
stack.setTagCompound(tag);
}
tag.setTag("cosmeticItem", cmp);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean adv) {
if (Compat.baublesExpanded) {
BaubleItemHelper.addSlotInformation(list, new String[] { "belt" });
}
if (Compat.botan && GuiScreen.isShiftKeyDown() && getCosmeticItem(stack) != null) {
list.add(
StatCollector.translateToLocalFormatted(
"botaniamisc.hasCosmetic",
getCosmeticItem(stack).getDisplayName()).replace('&', '§'));
}
}
public static boolean wearingBelt(EntityPlayer player) {
IInventory baubles = BaublesApi.getBaubles(player);
for (int i = 0; i < baubles.getSizeInventory(); i++) {
ItemStack bauble = baubles.getStackInSlot(i);
if (bauble != null && bauble.getItem() == ForbiddenItems.consumptionCincture) return true;
}
return false;
}
}
@@ -0,0 +1,47 @@
package fox.spiteful.forbidden.mixins;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.gtnewhorizon.gtnhmixins.IEarlyMixinLoader;
import com.gtnewhorizon.gtnhmixins.builders.IMixins;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
@IFMLLoadingPlugin.MCVersion("1.7.10")
public class EarlyMixinsLoader implements IFMLLoadingPlugin, IEarlyMixinLoader {
@Override
public String[] getASMTransformerClass() {
return null;
}
@Override
public String getModContainerClass() {
return null;
}
@Override
public String getSetupClass() {
return null;
}
@Override
public void injectData(Map<String, Object> data) {}
@Override
public String getAccessTransformerClass() {
return null;
}
@Override
public String getMixinConfig() {
return "mixins.ForbiddenMagic.early.json";
}
@Override
public List<String> getMixins(Set<String> loadedCoreMods) {
return IMixins.getEarlyMixins(Mixins.class, loadedCoreMods);
}
}
@@ -0,0 +1,26 @@
package fox.spiteful.forbidden.mixins;
import javax.annotation.Nonnull;
import com.gtnewhorizon.gtnhmixins.builders.IMixins;
import com.gtnewhorizon.gtnhmixins.builders.MixinBuilder;
import fox.spiteful.forbidden.Config;
public enum Mixins implements IMixins {
CONSUMPTION_CINCTURE(new MixinBuilder().setPhase(Phase.EARLY)
.addCommonMixins("MixinEntityPlayer_ConsumptionCincture").setApplyIf(() -> Config.consumptionCincture));
private final MixinBuilder builder;
Mixins(MixinBuilder builder) {
this.builder = builder;
}
@Nonnull
@Override
public MixinBuilder getBuilder() {
return builder;
}
}
@@ -0,0 +1,20 @@
package fox.spiteful.forbidden.mixins.early;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import fox.spiteful.forbidden.items.baubles.ItemConsumptionCincture;
@Mixin(EntityPlayer.class)
public class MixinEntityPlayer_ConsumptionCincture {
@WrapMethod(method = "canEat")
private boolean forbiddenmagic$consumptionCincture(boolean p_71043_1_ /* alwaysEdible, used for golden apples */,
Operation<Boolean> original) {
return ItemConsumptionCincture.wearingBelt((EntityPlayer) (Object) this) || original.call(p_71043_1_);
}
}
@@ -59,6 +59,7 @@ item.RingNutrition.name=Ring of Nutrition
item.TaintFruit.name=Tainted Fruit
item.TaintCoal.name=Hexcoal
item.Sword_Dragonslayer.name=Sword of the Dragonslayer
item.consumption_cincture.name=Cincture of Consumption
#
# Wand components
item.Wand.tainted.rod=Tainted
@@ -389,6 +390,10 @@ forbidden.research_name.SUBCOLLAR=Collar of Pain
forbidden.research_text.SUBCOLLAR=Pain and Magic
forbidden.research_page.SUBCOLLAR.1=Sometimes, people just want to get hurt. Especially if there's a benefit...<BR><BR>The Collar of Pain has all the capabilities of an Amulet of Vis Storage with the added bonus that it will generate vis whenever you take damage. The more you get hurt, the more vis it generates.
#
forbidden.research_name.CONSUMPTIONCINCTURE=Cincture of Consumption
forbidden.research_text.CONSUMPTIONCINCTURE=Diets are for the weak
forbidden.research_page.CONSUMPTIONCINCTURE.1=Your belt has been feeling rather tight lately. You tried getting bigger ones, but something must be wrong with them, since they all seem to shrink in the wash. While enjoying a midnight snack, the solution suddenly became clear: make a belt that encourages your appetite rather than restricting it.<BR><BR>While worn, the Cincture of Consumption allows you to instantly devour food and quaff drinks and potions. Better yet, even when your stomach insists you couldn't possibly eat another bite, you somehow always find room for more.<BR><BR>A little extra dessert never hurt anybody.
#
# Lexicon
forbidden.lexicon.euclidaisy=Euclidaisy
forbidden.lexicon.euclidaisy.0=The eerie, pink &1Euclidaisy&0 is an oddity. It uses large amounts of mana to conjure some sort of ethereal substance that only seems useful to thaumaturges.<br>&oIt doesn't combustion bend.&r
Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

@@ -0,0 +1,8 @@
{
"required": true,
"minVersion": "0.8.5-GTNH",
"package": "fox.spiteful.forbidden.mixins.early",
"refmap": "mixins.ForbiddenMagic.refmap.json",
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8"
}
@@ -0,0 +1,7 @@
{
"required": true,
"minVersion": "0.8.5-GTNH",
"refmap": "mixins.ForbiddenMagic.refmap.json",
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8"
}