Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ whitelist.json
*.iml
*.ipr
*.iws
src/main/resources/mixins.*.json
*.bat
*.DS_Store
!gradlew.bat
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ dependencies {
compileOnly("com.github.GTNewHorizons:AppleCore:3.3.11:dev")
compileOnly("curse.maven:ee3-65509:2305023")

runtimeOnlyNonPublishable("com.github.GTNewHorizons:AspectRecipeIndex:1.1.0:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:AspectRecipeIndex:1.1.3:dev")
}
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ 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.
# forceToolchainVersion = -1

# 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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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!
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/fox/spiteful/forbidden/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -165,6 +166,12 @@ public static void configurate(File targ) {
"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(true);

String trashlist = conf.get(
"general",
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/fox/spiteful/forbidden/DarkAspects.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,10 @@ public static void addAspects() {
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));
}
}
}
16 changes: 15 additions & 1 deletion src/main/java/fox/spiteful/forbidden/FMEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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;
Expand Down Expand Up @@ -64,6 +65,7 @@
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;
Expand Down Expand Up @@ -430,7 +432,19 @@ private boolean isGarbage(ItemStack drop) {
}

@SubscribeEvent
public void onEat(PlayerUseItemEvent.Finish event) {
public void onStartEating(PlayerUseItemEvent.Start event) {
if (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
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/fox/spiteful/forbidden/ForbiddenRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,27 @@ public static void addRecipes() {
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() {
Expand Down
17 changes: 16 additions & 1 deletion src/main/java/fox/spiteful/forbidden/ForbiddenResearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class ForbiddenResearch {

public static HashMap recipes = new HashMap();
public static HashMap<String, Object> recipes = new HashMap<>();

public static void addResearch() {
ResearchCategories.registerCategory(
Expand Down Expand Up @@ -377,6 +377,21 @@ public static void addInfernalism() {
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) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/fox/spiteful/forbidden/compat/Compat.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class Compat {
public static boolean special = false;
public static boolean twilight = false;
public static boolean ee3 = false;
public static boolean baublesExpanded = true;

public static void initiate() {
if (!Config.crossMod) return;
Expand All @@ -51,6 +52,7 @@ public static void initiate() {
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");
}

public static void compatify() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
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;
Expand Down Expand Up @@ -54,6 +55,7 @@

public class ForbiddenItems {

public static Item consumptionCincture;
public static Item deadlyShards;
public static Item gluttonyShard;
public static Item skullAxe;
Expand Down Expand Up @@ -337,6 +339,11 @@ public static void addItems() {

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,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
package fox.spiteful.forbidden.items.baubles;

import java.util.List;

import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.texture.IIconRegister;
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.IIcon;
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 cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import fox.spiteful.forbidden.Config;
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 {

IIcon icon;

public ItemConsumptionCincture() {
super();
maxStackSize = 1;
setCreativeTab(Forbidden.tab);
}

@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ir) {
icon = ir.registerIcon("forbidden:consumption_cincture");
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta) {
return icon;
}

public BaubleType getBaubleType(ItemStack itemstack) {
return BaubleType.BELT;
}

public void onWornTick(ItemStack itemstack, EntityLivingBase player) {}

public void onEquipped(ItemStack itemstack, EntityLivingBase player) {}

public void onUnequipped(ItemStack itemstack, EntityLivingBase player) {}

public boolean canEquip(ItemStack itemstack, EntityLivingBase player) {
return true;
}

public boolean canUnequip(ItemStack itemstack, EntityLivingBase player) {
return true;
}

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(
String.format(
StatCollector.translateToLocal("botaniamisc.hasCosmetic"),
getCosmeticItem(stack).getDisplayName()).replace("&", "§"));
}

public static boolean wearingBelt(EntityPlayer player) {
if (!Config.consumptionCincture) return false;
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;
}
}
Loading
Loading