It compiles. Somehow.
This commit is contained in:
parent
554c9852e6
commit
348fee1e2a
|
@ -235,7 +235,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
|
||||||
{
|
{
|
||||||
EntityMob mod = (EntityMob) ent;
|
EntityMob mod = (EntityMob) ent;
|
||||||
mod.faceEntity(getTarget(ent.getEntityWorld(), pos), 180, 0);
|
mod.faceEntity(getTarget(ent.getEntityWorld(), pos), 180, 0);
|
||||||
mod.moveEntityWithHeading(0, 0.3f);
|
mod.getMoveHelper().strafe(0, 0.3f);
|
||||||
if (mod.posY < pos.getY())
|
if (mod.posY < pos.getY())
|
||||||
{
|
{
|
||||||
mod.setJumping(true);
|
mod.setJumping(true);
|
||||||
|
@ -313,7 +313,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
|
||||||
if (entry.action instanceof AttractTask)
|
if (entry.action instanceof AttractTask)
|
||||||
{
|
{
|
||||||
AttractTask at = (AttractTask) entry.action;
|
AttractTask at = (AttractTask) entry.action;
|
||||||
if (at.coord.equals(pos) || !at.continueExecuting())
|
if (at.coord.equals(pos) || !at.shouldExecute())
|
||||||
{
|
{
|
||||||
remove = entry.action;
|
remove = entry.action;
|
||||||
} else
|
} else
|
||||||
|
@ -423,19 +423,6 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldExecute()
|
public boolean shouldExecute()
|
||||||
{
|
|
||||||
return continueExecuting();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resetTask()
|
|
||||||
{
|
|
||||||
started = false;
|
|
||||||
updatesSincePathing = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean continueExecuting()
|
|
||||||
{
|
{
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
//TODO:
|
//TODO:
|
||||||
|
@ -448,6 +435,13 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void resetTask()
|
||||||
|
{
|
||||||
|
started = false;
|
||||||
|
updatesSincePathing = 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInterruptible()
|
public boolean isInterruptible()
|
||||||
{
|
{
|
||||||
|
|
|
@ -154,19 +154,6 @@ public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldExecute()
|
public boolean shouldExecute()
|
||||||
{
|
|
||||||
return continueExecuting();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resetTask()
|
|
||||||
{
|
|
||||||
started = false;
|
|
||||||
updatesSincePathing = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean continueExecuting()
|
|
||||||
{
|
{
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
//TODO:
|
//TODO:
|
||||||
|
@ -179,6 +166,13 @@ public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void resetTask()
|
||||||
|
{
|
||||||
|
started = false;
|
||||||
|
updatesSincePathing = 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInterruptible()
|
public boolean isInterruptible()
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,6 @@ package WayofTime.bloodmagic.api;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.BloodMagic;
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||||
|
@ -171,163 +170,4 @@ public class Constants
|
||||||
public static final int NIGHT_VISION_CONSTANT_BEGIN = 30002;
|
public static final int NIGHT_VISION_CONSTANT_BEGIN = 30002;
|
||||||
public static final int NIGHT_VISION_CONSTANT_END = 30000;
|
public static final int NIGHT_VISION_CONSTANT_END = 30000;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum BloodMagicItem
|
|
||||||
{
|
|
||||||
ACTIVATION_CRYSTAL("ItemActivationCrystal"),
|
|
||||||
ALTAR_MAKER("ItemAltarMaker"),
|
|
||||||
ARCANE_ASHES("ItemArcaneAshes"),
|
|
||||||
BLOOD_ORB("ItemBloodOrb"),
|
|
||||||
BOUND_AXE("ItemBoundAxe"),
|
|
||||||
BLOOD_SHARD("ItemBloodShard"),
|
|
||||||
BOUND_PICKAXE("ItemBoundPickaxe"),
|
|
||||||
BOUND_SHOVEL("ItemBoundShovel"),
|
|
||||||
BOUND_SWORD("ItemBoundSword"),
|
|
||||||
COMPONENT("ItemComponent"),
|
|
||||||
CUTTING_FLUID("ItemCuttingFluid"),
|
|
||||||
DEMON_CRYSTAL("ItemDemonCrystal"),
|
|
||||||
DAGGER_OF_SACRIFICE("ItemDaggerOfSacrifice"),
|
|
||||||
INSCRIPTION_TOOL("ItemInscriptionTool"),
|
|
||||||
LAVA_CRYSTAL("ItemLavaCrystal"),
|
|
||||||
LIVING_ARMOR_HELMET("ItemLivingArmourHelmet"),
|
|
||||||
LIVING_ARMOR_CHEST("ItemLivingArmourChest"),
|
|
||||||
LIVING_ARMOR_LEGS("ItemLivingArmourLegs"),
|
|
||||||
LIVING_ARMOR_BOOTS("ItemLivingArmourBoots"),
|
|
||||||
MONSTER_SOUL("ItemMonsterSoul"),
|
|
||||||
NODE_ROUTER("ItemNodeRouter"),
|
|
||||||
RITUAL_DIVINER("ItemRitualDiviner"),
|
|
||||||
ROUTER_FILTER("ItemRouterFilter"),
|
|
||||||
FLUID_ROUTER_FILTER("ItemFluidRouterFilter"),
|
|
||||||
SACRIFICIAL_DAGGER("ItemSacrificialDagger"),
|
|
||||||
SACRIFICE_PACK("ItemPackSacrifice"),
|
|
||||||
SELF_SACRIFICE_PACK("ItemPackSelfSacrifice"),
|
|
||||||
SENTIENT_ARMOR_HELMET("ItemSentientArmourHelmet"),
|
|
||||||
SENTIENT_ARMOR_CHEST("ItemSentientArmourChest"),
|
|
||||||
SENTIENT_ARMOR_LEGS("ItemSentientArmourLegs"),
|
|
||||||
SENTIENT_ARMOR_BOOTS("ItemSentientArmourBoots"),
|
|
||||||
SENTIENT_ARMOR_GEM("ItemSentientArmourGem"),
|
|
||||||
SENTIENT_AXE("ItemSentientAxe"),
|
|
||||||
SENTIENT_BOW("ItemSentientBow"),
|
|
||||||
SENTIENT_PICKAXE("ItemSentientPickaxe"),
|
|
||||||
SENTIENT_SHOVEL("ItemSentientShovel"),
|
|
||||||
SENTIENT_SWORD("ItemSentientSword"),
|
|
||||||
SOUL_GEM("ItemSoulGem"),
|
|
||||||
SOUL_SNARE("ItemSoulSnare"),
|
|
||||||
SIGIL_AIR("ItemSigilAir"),
|
|
||||||
SIGIL_BLOOD_LIGHT("ItemSigilBloodLight"),
|
|
||||||
SIGIL_COMPRESSION("ItemSigilCompression"),
|
|
||||||
SIGIL_DIVINATION("ItemSigilDivination"),
|
|
||||||
SIGIL_ELEMENTAL_AFFINITY("ItemSigilElementalAffinity"),
|
|
||||||
SIGIL_ENDER_SEVERANCE("ItemSigilEnderSeverance"),
|
|
||||||
SIGIL_FAST_MINER("ItemSigilFastMiner"),
|
|
||||||
SIGIL_GREEN_GROVE("ItemSigilGreenGrove"),
|
|
||||||
SIGIL_HASTE("ItemSigilHaste"),
|
|
||||||
SIGIL_LAVA("ItemSigilLava"),
|
|
||||||
SIGIL_MAGNETISM("ItemSigilMagnetism"),
|
|
||||||
SIGIL_PHANTOM_BRIDGE("ItemSigilPhantomBridge"),
|
|
||||||
SIGIL_SEER("ItemSigilSeer"),
|
|
||||||
SIGIL_SUPPRESION("ItemSigilSuppression"),
|
|
||||||
SIGIL_VOID("ItemSigilVoid"),
|
|
||||||
SIGIL_WATER("ItemSigilWater"),
|
|
||||||
SIGIL_WHIRLWIND("ItemSigilWhirlwind"),
|
|
||||||
SLATE("ItemSlate"),
|
|
||||||
TELEPOSITION_FOCUS("ItemTelepositionFocus"),
|
|
||||||
UPGRADE_TOME("ItemUpgradeTome"),
|
|
||||||
UPGRADE_TRAINER("ItemUpgradeTrainer"),
|
|
||||||
SIGIL_TELEPOSITION("ItemSigilTeleposition"),
|
|
||||||
EXPERIENCE_TOME("ItemExperienceBook"),
|
|
||||||
SIGIL_TRANSPOSITION("ItemSigilTransposition"),
|
|
||||||
RITUAL_READER("ItemRitualReader"),
|
|
||||||
SANGUINE_BOOK("ItemSanguineBook"),
|
|
||||||
SIGIL_HOLDING("ItemSigilHolding"),
|
|
||||||
ARMOUR_POINTS_UPGRADE("ItemLivingArmourPointsUpgrade"),
|
|
||||||
DEMON_WILL_GAUGE("ItemDemonWillGauge"),
|
|
||||||
POTION_FLASK("ItemPotionFlask"),
|
|
||||||
SIGIL_CLAW("ItemSigilClaw"),
|
|
||||||
SIGIL_BOUNCE("ItemSigilBounce"),
|
|
||||||
SIGIL_FROST("ItemSigilFrost");
|
|
||||||
|
|
||||||
private final String regName;
|
|
||||||
|
|
||||||
BloodMagicItem(String regName)
|
|
||||||
{
|
|
||||||
this.regName = regName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Item getItem()
|
|
||||||
{
|
|
||||||
return BloodMagicAPI.getItem(regName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRegName()
|
|
||||||
{
|
|
||||||
return regName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum BloodMagicBlock
|
|
||||||
{
|
|
||||||
ALCHEMY_ARRAY("BlockAlchemyArray"),
|
|
||||||
ALTAR("BlockAltar"),
|
|
||||||
BLOOD_LIGHT("BlockBloodLight"),
|
|
||||||
BLOOD_RUNE("BlockBloodRune"),
|
|
||||||
BLOOD_STONE("BlockBloodStoneBrick"),
|
|
||||||
CRYSTAL("BlockCrystal"),
|
|
||||||
INPUT_ROUTING_NODE("BlockInputRoutingNode"),
|
|
||||||
ITEM_ROUTING_NODE("BlockItemRoutingNode"),
|
|
||||||
LIFE_ESSENCE("BlockLifeEssence"),
|
|
||||||
MASTER_ROUTING_NODE("BlockMasterRoutingNode"),
|
|
||||||
OUTPUT_ROUTING_NODE("BlockOutputRoutingNode"),
|
|
||||||
@Deprecated
|
|
||||||
PEDESTAL("BlockPedestal"),
|
|
||||||
/** No longer included in the mod. */
|
|
||||||
PHANTOM("BlockPhantom"),
|
|
||||||
RITUAL_CONTROLLER("BlockRitualController"),
|
|
||||||
RITUAL_STONE("BlockRitualStone"),
|
|
||||||
SOUL_FORGE("BlockSoulForge"),
|
|
||||||
SPECTRAL("BlockSpectral"),
|
|
||||||
TELEPOSER("BlockTeleposer"),
|
|
||||||
INCENSE_ALTAR("BlockIncenseAltar"),
|
|
||||||
PATH("BlockPath"),
|
|
||||||
DEMON_CRUCIBLE("BlockDemonCrucible"),
|
|
||||||
DEMON_PYLON("BlockDemonPylon"),
|
|
||||||
DEMON_CRYSTALLIZER("BlockDemonCrystallizer"),
|
|
||||||
DEMON_CRYSTAL("BlockDemonCrystal"),
|
|
||||||
DIMENSIONAL_PORTAL("BlockDimensionalPortal"),
|
|
||||||
BLOOD_TANK("BlockBloodTank"),
|
|
||||||
MIMIC("BlockMimic"),
|
|
||||||
ALCHEMY_TABLE("BlockAlchemyTable"),
|
|
||||||
DEMON_BRICK_1("BlockDemonBricks1"),
|
|
||||||
DEMON_BRICK_2("BlockDemonBricks2"),
|
|
||||||
DEMON_BLOCK_EXTRA("BlockDemonExtra"),
|
|
||||||
DEMON_PILLAR_1("BlockPillar1"),
|
|
||||||
DEMON_PILLAR_2("BlockPillar2"),
|
|
||||||
DEMON_PILLAR_CAP_1("BlockPillarCap1"),
|
|
||||||
DEMON_PILLAR_CAP_2("BlockPillarCap2"),
|
|
||||||
DEMON_PILLAR_CAP_3("BlockPillarCap3"),
|
|
||||||
DEMON_WALL_1("BlockWall1"),
|
|
||||||
DEMON_STAIRS_1("BlockStairs1"),
|
|
||||||
DEMON_STAIRS_2("BlockStairs2"),
|
|
||||||
DEMON_STAIRS_3("BlockStairs3"),
|
|
||||||
DEMON_LIGHT("BlockDemonLight"),
|
|
||||||
INVERSION_PILLAR("BlockInversionPillar"),
|
|
||||||
INVERSION_PILLAR_END("BlockInversionPillarEnd");
|
|
||||||
|
|
||||||
private final String regName;
|
|
||||||
|
|
||||||
BloodMagicBlock(String regName)
|
|
||||||
{
|
|
||||||
this.regName = regName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Block getBlock()
|
|
||||||
{
|
|
||||||
return BloodMagicAPI.getBlock(regName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRegName()
|
|
||||||
{
|
|
||||||
return regName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package WayofTime.bloodmagic.api;
|
package WayofTime.bloodmagic.api;
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.Setter;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -12,16 +9,19 @@ import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@EqualsAndHashCode
|
|
||||||
public class ItemStackWrapper
|
public class ItemStackWrapper
|
||||||
{
|
{
|
||||||
public final Item item;
|
public final Item item;
|
||||||
public final int stackSize;
|
public final int stackSize;
|
||||||
public final int meta;
|
public final int meta;
|
||||||
@Setter
|
|
||||||
public NBTTagCompound nbtTag;
|
public NBTTagCompound nbtTag;
|
||||||
|
|
||||||
|
public ItemStackWrapper(Item item, int stackSize, int meta) {
|
||||||
|
this.item = item;
|
||||||
|
this.stackSize = stackSize;
|
||||||
|
this.meta = meta;
|
||||||
|
}
|
||||||
|
|
||||||
public ItemStackWrapper(Item item, int stackSize)
|
public ItemStackWrapper(Item item, int stackSize)
|
||||||
{
|
{
|
||||||
this(item, stackSize, 0);
|
this(item, stackSize, 0);
|
||||||
|
@ -103,4 +103,24 @@ public class ItemStackWrapper
|
||||||
|
|
||||||
return stackList;
|
return stackList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Item getItem() {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStackSize() {
|
||||||
|
return stackSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMeta() {
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NBTTagCompound getNbtTag() {
|
||||||
|
return nbtTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNbtTag(NBTTagCompound nbtTag) {
|
||||||
|
this.nbtTag = nbtTag;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package WayofTime.bloodmagic.api.alchemyCrafting;
|
package WayofTime.bloodmagic.api.alchemyCrafting;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
@ -9,7 +8,6 @@ import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
public class AlchemyArrayEffectCrafting extends AlchemyArrayEffect
|
public class AlchemyArrayEffectCrafting extends AlchemyArrayEffect
|
||||||
{
|
{
|
||||||
@Getter
|
|
||||||
public final ItemStack outputStack;
|
public final ItemStack outputStack;
|
||||||
public int tickLimit;
|
public int tickLimit;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package WayofTime.bloodmagic.api.alchemyCrafting;
|
package WayofTime.bloodmagic.api.alchemyCrafting;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
@ -81,7 +81,7 @@ public class AlchemyCircleRenderer
|
||||||
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
|
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer wr = tessellator.getBuffer();
|
BufferBuilder wr = tessellator.getBuffer();
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
// float rot = (float)(this.worldObj.provider.getWorldTime() % (360 /
|
// float rot = (float)(this.worldObj.provider.getWorldTime() % (360 /
|
||||||
|
|
|
@ -30,12 +30,12 @@ public class ItemBindable extends Item implements IBindable
|
||||||
@Override
|
@Override
|
||||||
public String getOwnerName(ItemStack stack)
|
public String getOwnerName(ItemStack stack)
|
||||||
{
|
{
|
||||||
return stack != null ? NBTHelper.checkNBT(stack).getTagCompound().getString(Constants.NBT.OWNER_NAME) : null;
|
return !stack.isEmpty() ? stack.getTagCompound().getString(Constants.NBT.OWNER_NAME) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getOwnerUUID(ItemStack stack)
|
public String getOwnerUUID(ItemStack stack)
|
||||||
{
|
{
|
||||||
return stack != null ? NBTHelper.checkNBT(stack).getTagCompound().getString(Constants.NBT.OWNER_UUID) : null;
|
return !stack.isEmpty() ? stack.getTagCompound().getString(Constants.NBT.OWNER_UUID) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class LivingArmourHandler
|
||||||
Constructor<? extends LivingArmourUpgrade> ctor = clazz.getConstructor(int.class);
|
Constructor<? extends LivingArmourUpgrade> ctor = clazz.getConstructor(int.class);
|
||||||
if (ctor == null)
|
if (ctor == null)
|
||||||
{
|
{
|
||||||
BloodMagicAPI.getLogger().error("Error adding living armour upgrade {} as it doesn't have a valid constructor.", upgrade.getUniqueIdentifier());
|
BloodMagicAPI.logger.error("Error adding living armour upgrade {} as it doesn't have a valid constructor.", upgrade.getUniqueIdentifier());
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
upgradeConstructorMap.put(upgrade.getUniqueIdentifier(), ctor);
|
upgradeConstructorMap.put(upgrade.getUniqueIdentifier(), ctor);
|
||||||
|
|
|
@ -1,305 +0,0 @@
|
||||||
package WayofTime.bloodmagic.api.recipe;
|
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.inventory.InventoryCrafting;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
|
||||||
import net.minecraft.item.crafting.ShapedRecipes;
|
|
||||||
import net.minecraft.util.NonNullList;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shaped Blood Orb Recipe Handler by joshie *
|
|
||||||
*/
|
|
||||||
public class ShapedBloodOrbRecipe implements IRecipe
|
|
||||||
{
|
|
||||||
private static final int MAX_CRAFT_GRID_WIDTH = 3;
|
|
||||||
private static final int MAX_CRAFT_GRID_HEIGHT = 3;
|
|
||||||
|
|
||||||
private ItemStack output = null;
|
|
||||||
private Object[] input = null;
|
|
||||||
public int width = 0;
|
|
||||||
public int height = 0;
|
|
||||||
private int tier;
|
|
||||||
private boolean mirrored = true;
|
|
||||||
|
|
||||||
public ShapedBloodOrbRecipe(Block result, Object... recipe)
|
|
||||||
{
|
|
||||||
this(new ItemStack(result), recipe);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShapedBloodOrbRecipe(Item result, Object... recipe)
|
|
||||||
{
|
|
||||||
this(new ItemStack(result), recipe);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShapedBloodOrbRecipe(ItemStack result, Object... recipe)
|
|
||||||
{
|
|
||||||
output = result.copy();
|
|
||||||
|
|
||||||
String shape = "";
|
|
||||||
int idx = 0;
|
|
||||||
|
|
||||||
if (recipe[idx] instanceof Boolean)
|
|
||||||
{
|
|
||||||
mirrored = (Boolean) recipe[idx];
|
|
||||||
if (recipe[idx + 1] instanceof Object[])
|
|
||||||
{
|
|
||||||
recipe = (Object[]) recipe[idx + 1];
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
idx = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (recipe[idx] instanceof String[])
|
|
||||||
{
|
|
||||||
String[] parts = ((String[]) recipe[idx++]);
|
|
||||||
|
|
||||||
for (String s : parts)
|
|
||||||
{
|
|
||||||
width = s.length();
|
|
||||||
shape += s;
|
|
||||||
}
|
|
||||||
|
|
||||||
height = parts.length;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
while (recipe[idx] instanceof String)
|
|
||||||
{
|
|
||||||
String s = (String) recipe[idx++];
|
|
||||||
shape += s;
|
|
||||||
width = s.length();
|
|
||||||
height++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (width * height != shape.length())
|
|
||||||
{
|
|
||||||
String ret = "Invalid shaped ore recipe: ";
|
|
||||||
for (Object tmp : recipe)
|
|
||||||
{
|
|
||||||
ret += tmp + ", ";
|
|
||||||
}
|
|
||||||
ret += output;
|
|
||||||
throw new RuntimeException(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
HashMap<Character, Object> itemMap = new HashMap<Character, Object>();
|
|
||||||
|
|
||||||
for (; idx < recipe.length; idx += 2)
|
|
||||||
{
|
|
||||||
Character chr = (Character) recipe[idx];
|
|
||||||
Object in = recipe[idx + 1];
|
|
||||||
|
|
||||||
if (in instanceof IBloodOrb || (in instanceof ItemStack && ((ItemStack) in).getItem() instanceof IBloodOrb))
|
|
||||||
{
|
|
||||||
// If the item is an instanceof IBloodOrb then save the level of
|
|
||||||
// the orb.
|
|
||||||
if (in instanceof ItemStack)
|
|
||||||
{
|
|
||||||
ItemStack inStack = (ItemStack) in;
|
|
||||||
tier = ((IBloodOrb) inStack.getItem()).getOrbLevel(inStack.getItemDamage());
|
|
||||||
itemMap.put(chr, tier);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
tier = ((IBloodOrb) in).getOrbLevel(0);
|
|
||||||
itemMap.put(chr, tier);
|
|
||||||
}
|
|
||||||
} else if (in instanceof ItemStack)
|
|
||||||
{
|
|
||||||
itemMap.put(chr, ((ItemStack) in).copy());
|
|
||||||
} else if (in instanceof Item)
|
|
||||||
{
|
|
||||||
itemMap.put(chr, new ItemStack((Item) in));
|
|
||||||
} else if (in instanceof Block)
|
|
||||||
{
|
|
||||||
itemMap.put(chr, new ItemStack((Block) in, 1, OreDictionary.WILDCARD_VALUE));
|
|
||||||
} else if (in instanceof String)
|
|
||||||
{
|
|
||||||
itemMap.put(chr, OreDictionary.getOres((String) in));
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
String ret = "Invalid shaped orb recipe: ";
|
|
||||||
for (Object tmp : recipe)
|
|
||||||
{
|
|
||||||
ret += tmp + ", ";
|
|
||||||
}
|
|
||||||
ret += output;
|
|
||||||
throw new RuntimeException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
input = new Object[width * height];
|
|
||||||
int x = 0;
|
|
||||||
for (char chr : shape.toCharArray())
|
|
||||||
{
|
|
||||||
input[x++] = itemMap.get(chr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ShapedBloodOrbRecipe(ShapedRecipes recipe, Map<ItemStack, String> replacements)
|
|
||||||
{
|
|
||||||
output = recipe.getRecipeOutput();
|
|
||||||
width = recipe.recipeWidth;
|
|
||||||
height = recipe.recipeHeight;
|
|
||||||
|
|
||||||
input = new Object[recipe.recipeItems.length];
|
|
||||||
|
|
||||||
for (int i = 0; i < input.length; i++)
|
|
||||||
{
|
|
||||||
ItemStack ingred = recipe.recipeItems[i];
|
|
||||||
|
|
||||||
if (ingred == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
input[i] = recipe.recipeItems[i];
|
|
||||||
|
|
||||||
for (Entry<ItemStack, String> replace : replacements.entrySet())
|
|
||||||
{
|
|
||||||
if (OreDictionary.itemMatches(replace.getKey(), ingred, true))
|
|
||||||
{
|
|
||||||
input[i] = OreDictionary.getOres(replace.getValue());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getCraftingResult(InventoryCrafting var1)
|
|
||||||
{
|
|
||||||
return output.copy();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRecipeSize()
|
|
||||||
{
|
|
||||||
return input.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getRecipeOutput()
|
|
||||||
{
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean matches(InventoryCrafting inv, World world)
|
|
||||||
{
|
|
||||||
for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++)
|
|
||||||
{
|
|
||||||
for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y)
|
|
||||||
{
|
|
||||||
if (checkMatch(inv, x, y, false))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mirrored && checkMatch(inv, x, y, true))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private boolean checkMatch(InventoryCrafting inv, int startX, int startY, boolean mirror)
|
|
||||||
{
|
|
||||||
for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++)
|
|
||||||
{
|
|
||||||
for (int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++)
|
|
||||||
{
|
|
||||||
int subX = x - startX;
|
|
||||||
int subY = y - startY;
|
|
||||||
Object target = null;
|
|
||||||
|
|
||||||
if (subX >= 0 && subY >= 0 && subX < width && subY < height)
|
|
||||||
{
|
|
||||||
if (mirror)
|
|
||||||
{
|
|
||||||
target = input[width - subX - 1 + subY * width];
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
target = input[subX + subY * width];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemStack slot = inv.getStackInRowAndColumn(x, y);
|
|
||||||
// If target is integer, then we should be check the blood orb
|
|
||||||
// value of the item instead
|
|
||||||
if (target instanceof Integer)
|
|
||||||
{
|
|
||||||
if (!slot.isEmpty() && slot.getItem() instanceof IBloodOrb)
|
|
||||||
{
|
|
||||||
IBloodOrb orb = (IBloodOrb) slot.getItem();
|
|
||||||
if (orb.getOrbLevel(slot.getItemDamage()) < (Integer) target)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
return false;
|
|
||||||
} else if (target instanceof ItemStack)
|
|
||||||
{
|
|
||||||
if (!OreDictionary.itemMatches((ItemStack) target, slot, false))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (target instanceof List)
|
|
||||||
{
|
|
||||||
boolean matched = false;
|
|
||||||
|
|
||||||
Iterator<ItemStack> itr = ((List<ItemStack>) target).iterator();
|
|
||||||
while (itr.hasNext() && !matched)
|
|
||||||
{
|
|
||||||
matched = OreDictionary.itemMatches(itr.next(), slot, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!matched)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (target == null && !slot.isEmpty())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShapedBloodOrbRecipe setMirrored(boolean mirror)
|
|
||||||
{
|
|
||||||
mirrored = mirror;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object[] getInput()
|
|
||||||
{
|
|
||||||
return this.input;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
|
|
||||||
{
|
|
||||||
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTier()
|
|
||||||
{
|
|
||||||
return tier;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,201 +0,0 @@
|
||||||
package WayofTime.bloodmagic.api.recipe;
|
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.inventory.InventoryCrafting;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
|
||||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
|
||||||
import net.minecraft.util.NonNullList;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.ForgeHooks;
|
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shapeless Blood Orb Recipe Handler by joshie *
|
|
||||||
*/
|
|
||||||
public class ShapelessBloodOrbRecipe implements IRecipe
|
|
||||||
{
|
|
||||||
private ItemStack output = null;
|
|
||||||
private ArrayList<Object> input = new ArrayList<Object>();
|
|
||||||
private int tier;
|
|
||||||
|
|
||||||
public ShapelessBloodOrbRecipe(Block result, Object... recipe)
|
|
||||||
{
|
|
||||||
this(new ItemStack(result), recipe);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShapelessBloodOrbRecipe(Item result, Object... recipe)
|
|
||||||
{
|
|
||||||
this(new ItemStack(result), recipe);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShapelessBloodOrbRecipe(ItemStack result, Object... recipe)
|
|
||||||
{
|
|
||||||
output = result.copy();
|
|
||||||
for (Object in : recipe)
|
|
||||||
{
|
|
||||||
if (in instanceof IBloodOrb || (in instanceof ItemStack && ((ItemStack) in).getItem() instanceof IBloodOrb))
|
|
||||||
{
|
|
||||||
// If the item is an instanceof IBloodOrb then save the level of
|
|
||||||
// the orb.
|
|
||||||
if (in instanceof ItemStack)
|
|
||||||
{
|
|
||||||
ItemStack inStack = (ItemStack) in;
|
|
||||||
tier = ((IBloodOrb) inStack.getItem()).getOrbLevel(inStack.getItemDamage());
|
|
||||||
input.add(tier);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
tier = ((IBloodOrb) in).getOrbLevel(0);
|
|
||||||
input.add(tier);
|
|
||||||
}
|
|
||||||
} else if (in instanceof ItemStack)
|
|
||||||
{
|
|
||||||
input.add(((ItemStack) in).copy());
|
|
||||||
} else if (in instanceof Item)
|
|
||||||
{
|
|
||||||
input.add(new ItemStack((Item) in));
|
|
||||||
} else if (in instanceof Block)
|
|
||||||
{
|
|
||||||
input.add(new ItemStack((Block) in));
|
|
||||||
} else if (in instanceof String)
|
|
||||||
{
|
|
||||||
input.add(OreDictionary.getOres((String) in));
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
String ret = "Invalid shapeless ore recipe: ";
|
|
||||||
for (Object tmp : recipe)
|
|
||||||
{
|
|
||||||
ret += tmp + ", ";
|
|
||||||
}
|
|
||||||
ret += output;
|
|
||||||
throw new RuntimeException(ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ShapelessBloodOrbRecipe(ShapelessRecipes recipe, Map<ItemStack, String> replacements)
|
|
||||||
{
|
|
||||||
output = recipe.getRecipeOutput();
|
|
||||||
|
|
||||||
for (ItemStack ingred : recipe.recipeItems)
|
|
||||||
{
|
|
||||||
Object finalObj = ingred;
|
|
||||||
for (Entry<ItemStack, String> replace : replacements.entrySet())
|
|
||||||
{
|
|
||||||
if (OreDictionary.itemMatches(replace.getKey(), ingred, false))
|
|
||||||
{
|
|
||||||
finalObj = OreDictionary.getOres(replace.getValue());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
input.add(finalObj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRecipeSize()
|
|
||||||
{
|
|
||||||
return input.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getRecipeOutput()
|
|
||||||
{
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getCraftingResult(InventoryCrafting var1)
|
|
||||||
{
|
|
||||||
return output.copy();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
|
||||||
public boolean matches(InventoryCrafting var1, World world)
|
|
||||||
{
|
|
||||||
ArrayList<Object> required = new ArrayList<Object>(input);
|
|
||||||
|
|
||||||
for (int x = 0; x < var1.getSizeInventory(); x++)
|
|
||||||
{
|
|
||||||
ItemStack slot = var1.getStackInSlot(x);
|
|
||||||
|
|
||||||
if (!slot.isEmpty())
|
|
||||||
{
|
|
||||||
boolean inRecipe = false;
|
|
||||||
Iterator<Object> req = required.iterator();
|
|
||||||
|
|
||||||
while (req.hasNext())
|
|
||||||
{
|
|
||||||
boolean match = false;
|
|
||||||
|
|
||||||
Object next = req.next();
|
|
||||||
|
|
||||||
// If target is integer, then we should be check the blood
|
|
||||||
// orb value of the item instead
|
|
||||||
if (next instanceof Integer)
|
|
||||||
{
|
|
||||||
if (slot.getItem() instanceof IBloodOrb)
|
|
||||||
{
|
|
||||||
IBloodOrb orb = (IBloodOrb) slot.getItem();
|
|
||||||
if (orb.getOrbLevel(slot.getItemDamage()) < (Integer) next)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
return false;
|
|
||||||
match = true;
|
|
||||||
} else if (next instanceof ItemStack)
|
|
||||||
{
|
|
||||||
match = OreDictionary.itemMatches((ItemStack) next, slot, false);
|
|
||||||
} else if (next instanceof List)
|
|
||||||
{
|
|
||||||
Iterator<ItemStack> itr = ((List<ItemStack>) next).iterator();
|
|
||||||
while (itr.hasNext() && !match)
|
|
||||||
{
|
|
||||||
match = OreDictionary.itemMatches(itr.next(), slot, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (match)
|
|
||||||
{
|
|
||||||
inRecipe = true;
|
|
||||||
required.remove(next);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!inRecipe)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return required.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<Object> getInput()
|
|
||||||
{
|
|
||||||
return this.input;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
|
|
||||||
{
|
|
||||||
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTier()
|
|
||||||
{
|
|
||||||
return tier;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -7,9 +7,6 @@ import java.util.Map.Entry;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
@ -128,8 +125,8 @@ public class AlchemyArrayRecipeRegistry
|
||||||
if (effectEntry.getValue() instanceof AlchemyArrayEffectCrafting)
|
if (effectEntry.getValue() instanceof AlchemyArrayEffectCrafting)
|
||||||
{
|
{
|
||||||
AlchemyArrayEffectCrafting craftingEffect = (AlchemyArrayEffectCrafting) effectEntry.getValue();
|
AlchemyArrayEffectCrafting craftingEffect = (AlchemyArrayEffectCrafting) effectEntry.getValue();
|
||||||
ItemStack resultStack = craftingEffect.getOutputStack();
|
ItemStack resultStack = craftingEffect.outputStack;
|
||||||
if (resultStack != null && resultStack.getItem() != null)
|
if (!resultStack.isEmpty())
|
||||||
{
|
{
|
||||||
if (resultStack.getItem() == stack.getItem() && resultStack.getItemDamage() == stack.getItemDamage())
|
if (resultStack.getItem() == stack.getItem() && resultStack.getItemDamage() == stack.getItemDamage())
|
||||||
{
|
{
|
||||||
|
@ -291,9 +288,6 @@ public class AlchemyArrayRecipeRegistry
|
||||||
return getAlchemyCircleRenderer(Collections.singletonList(itemStack), catalystStack);
|
return getAlchemyCircleRenderer(Collections.singletonList(itemStack), catalystStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
|
||||||
@ToString
|
|
||||||
@EqualsAndHashCode
|
|
||||||
public static class AlchemyArrayRecipe
|
public static class AlchemyArrayRecipe
|
||||||
{
|
{
|
||||||
public AlchemyCircleRenderer defaultCircleRenderer;
|
public AlchemyCircleRenderer defaultCircleRenderer;
|
||||||
|
@ -384,6 +378,45 @@ public class AlchemyArrayRecipeRegistry
|
||||||
|
|
||||||
return defaultCircleRenderer;
|
return defaultCircleRenderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AlchemyCircleRenderer getDefaultCircleRenderer() {
|
||||||
|
return defaultCircleRenderer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemStack> getInput() {
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BiMap<ItemStackWrapper, AlchemyArrayEffect> getCatalystMap() {
|
||||||
|
return catalystMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BiMap<ItemStackWrapper, AlchemyCircleRenderer> getCircleMap() {
|
||||||
|
return circleMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (!(o instanceof AlchemyArrayRecipe)) return false;
|
||||||
|
|
||||||
|
AlchemyArrayRecipe that = (AlchemyArrayRecipe) o;
|
||||||
|
|
||||||
|
if (defaultCircleRenderer != null ? !defaultCircleRenderer.equals(that.defaultCircleRenderer) : that.defaultCircleRenderer != null)
|
||||||
|
return false;
|
||||||
|
if (input != null ? !input.equals(that.input) : that.input != null) return false;
|
||||||
|
if (catalystMap != null ? !catalystMap.equals(that.catalystMap) : that.catalystMap != null) return false;
|
||||||
|
return circleMap != null ? circleMap.equals(that.circleMap) : that.circleMap == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = defaultCircleRenderer != null ? defaultCircleRenderer.hashCode() : 0;
|
||||||
|
result = 31 * result + (input != null ? input.hashCode() : 0);
|
||||||
|
result = 31 * result + (catalystMap != null ? catalystMap.hashCode() : 0);
|
||||||
|
result = 31 * result + (circleMap != null ? circleMap.hashCode() : 0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BiMap<List<ItemStack>, AlchemyArrayRecipe> getRecipes()
|
public static BiMap<List<ItemStack>, AlchemyArrayRecipe> getRecipes()
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class ImperfectRitualRegistry
|
||||||
if (imperfectRitual != null)
|
if (imperfectRitual != null)
|
||||||
{
|
{
|
||||||
if (registry.containsKey(id))
|
if (registry.containsKey(id))
|
||||||
BloodMagicAPI.getLogger().error("Duplicate imperfect ritual id: %s", id);
|
BloodMagicAPI.logger.error("Duplicate imperfect ritual id: %s", id);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
registry.put(id, imperfectRitual);
|
registry.put(id, imperfectRitual);
|
||||||
|
@ -88,7 +88,7 @@ public class ImperfectRitualRegistry
|
||||||
return enabledRituals.get(imperfectRitual);
|
return enabledRituals.get(imperfectRitual);
|
||||||
} catch (NullPointerException e)
|
} catch (NullPointerException e)
|
||||||
{
|
{
|
||||||
BloodMagicAPI.getLogger().error("Invalid Imperfect Ritual was called");
|
BloodMagicAPI.logger.error("Invalid Imperfect Ritual was called");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,15 +33,15 @@ public class RitualRegistry
|
||||||
{
|
{
|
||||||
if (locked)
|
if (locked)
|
||||||
{
|
{
|
||||||
BloodMagicAPI.getLogger().error("This registry has been locked. Please register your ritual earlier.");
|
BloodMagicAPI.logger.error("This registry has been locked. Please register your ritual earlier.");
|
||||||
BloodMagicAPI.getLogger().error("If you reflect this, I will hunt you down. - TehNut");
|
BloodMagicAPI.logger.error("If you reflect this, I will hunt you down. - TehNut");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ritual != null)
|
if (ritual != null)
|
||||||
{
|
{
|
||||||
if (registry.containsKey(id))
|
if (registry.containsKey(id))
|
||||||
BloodMagicAPI.getLogger().error("Duplicate ritual id: %s", id);
|
BloodMagicAPI.logger.error("Duplicate ritual id: %s", id);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
registry.put(id, ritual);
|
registry.put(id, ritual);
|
||||||
|
@ -95,7 +95,7 @@ public class RitualRegistry
|
||||||
return enabledRituals.get(ritual);
|
return enabledRituals.get(ritual);
|
||||||
} catch (NullPointerException e)
|
} catch (NullPointerException e)
|
||||||
{
|
{
|
||||||
BloodMagicAPI.getLogger().error("Invalid Ritual was called");
|
BloodMagicAPI.logger.error("Invalid Ritual was called");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package WayofTime.bloodmagic.api.ritual;
|
package WayofTime.bloodmagic.api.ritual;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IStringSerializable;
|
import net.minecraft.util.IStringSerializable;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
@ -17,6 +19,9 @@ public enum EnumRuneType implements IStringSerializable
|
||||||
DUSK(TextFormatting.DARK_GRAY),
|
DUSK(TextFormatting.DARK_GRAY),
|
||||||
DAWN(TextFormatting.GOLD);
|
DAWN(TextFormatting.GOLD);
|
||||||
|
|
||||||
|
@GameRegistry.ObjectHolder("bloodmagic:inscription_tool")
|
||||||
|
public static final Item INSCRIPTION_TOOL = Items.AIR;
|
||||||
|
|
||||||
public final TextFormatting colorCode;
|
public final TextFormatting colorCode;
|
||||||
|
|
||||||
EnumRuneType(TextFormatting colorCode)
|
EnumRuneType(TextFormatting colorCode)
|
||||||
|
@ -34,7 +39,7 @@ public enum EnumRuneType implements IStringSerializable
|
||||||
|
|
||||||
public ItemStack getScribeStack()
|
public ItemStack getScribeStack()
|
||||||
{
|
{
|
||||||
return new ItemStack(Constants.BloodMagicItem.INSCRIPTION_TOOL.getItem(), 1, ordinal());
|
return new ItemStack(INSCRIPTION_TOOL, 1, ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
package WayofTime.bloodmagic.api.teleport;
|
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
@ToString
|
|
||||||
@EqualsAndHashCode
|
|
||||||
@Getter
|
|
||||||
public class ChunkPairSerializable implements Serializable
|
|
||||||
{
|
|
||||||
private int chunkXPos;
|
|
||||||
private int chunkZPos;
|
|
||||||
|
|
||||||
public ChunkPairSerializable(int chunkXPos, int chunkZPos)
|
|
||||||
{
|
|
||||||
this.chunkXPos = chunkXPos;
|
|
||||||
this.chunkZPos = chunkZPos;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChunkPairSerializable(BlockPos blockPos)
|
|
||||||
{
|
|
||||||
this(blockPos.getX() >> 4, blockPos.getZ() >> 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockPos getChunkCenter(int y)
|
|
||||||
{
|
|
||||||
return new BlockPos((chunkXPos << 4) + 8, y, (chunkZPos << 4) + 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockPos getChunkCenter()
|
|
||||||
{
|
|
||||||
return getChunkCenter(64);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,23 +1,16 @@
|
||||||
package WayofTime.bloodmagic.api.teleport;
|
package WayofTime.bloodmagic.api.teleport;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@ToString
|
|
||||||
public class PortalLocation implements Serializable
|
public class PortalLocation implements Serializable
|
||||||
{
|
{
|
||||||
@Getter
|
|
||||||
private int x;
|
private int x;
|
||||||
@Getter
|
|
||||||
private int y;
|
private int y;
|
||||||
@Getter
|
|
||||||
private int z;
|
private int z;
|
||||||
@Getter
|
|
||||||
private int dimension;
|
private int dimension;
|
||||||
|
|
||||||
public PortalLocation(int x, int y, int z, int dimension)
|
public PortalLocation(int x, int y, int z, int dimension)
|
||||||
|
@ -87,4 +80,20 @@ public class PortalLocation implements Serializable
|
||||||
result = 31 * result + z;
|
result = 31 * result + z;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getX() {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getY() {
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getZ() {
|
||||||
|
return z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDimension() {
|
||||||
|
return dimension;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,14 @@
|
||||||
package WayofTime.bloodmagic.api.teleport;
|
package WayofTime.bloodmagic.api.teleport;
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
@ToString
|
|
||||||
@EqualsAndHashCode
|
|
||||||
public abstract class Teleport implements ITeleport
|
public abstract class Teleport implements ITeleport
|
||||||
{
|
{
|
||||||
@Getter
|
|
||||||
protected int x;
|
protected int x;
|
||||||
@Getter
|
|
||||||
protected int y;
|
protected int y;
|
||||||
@Getter
|
|
||||||
protected int z;
|
protected int z;
|
||||||
@Getter
|
|
||||||
protected Entity entity;
|
protected Entity entity;
|
||||||
@Getter
|
|
||||||
protected String networkToDrain;
|
protected String networkToDrain;
|
||||||
|
|
||||||
public Teleport(int x, int y, int z, Entity entity, String networkToDrain)
|
public Teleport(int x, int y, int z, Entity entity, String networkToDrain)
|
||||||
|
@ -34,4 +24,48 @@ public abstract class Teleport implements ITeleport
|
||||||
{
|
{
|
||||||
this(blockPos.getX(), blockPos.getY(), blockPos.getZ(), entity, networkToDrain);
|
this(blockPos.getX(), blockPos.getY(), blockPos.getZ(), entity, networkToDrain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getX() {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getY() {
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getZ() {
|
||||||
|
return z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNetworkToDrain() {
|
||||||
|
return networkToDrain;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (!(o instanceof Teleport)) return false;
|
||||||
|
|
||||||
|
Teleport teleport = (Teleport) o;
|
||||||
|
|
||||||
|
if (x != teleport.x) return false;
|
||||||
|
if (y != teleport.y) return false;
|
||||||
|
if (z != teleport.z) return false;
|
||||||
|
if (entity != null ? !entity.equals(teleport.entity) : teleport.entity != null) return false;
|
||||||
|
return networkToDrain != null ? networkToDrain.equals(teleport.networkToDrain) : teleport.networkToDrain == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = x;
|
||||||
|
result = 31 * result + y;
|
||||||
|
result = 31 * result + z;
|
||||||
|
result = 31 * result + (entity != null ? entity.hashCode() : 0);
|
||||||
|
result = 31 * result + (networkToDrain != null ? networkToDrain.hashCode() : 0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package WayofTime.bloodmagic.api.util.helper;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
import WayofTime.bloodmagic.api.event.SoulNetworkEvent;
|
import WayofTime.bloodmagic.api.event.SoulNetworkEvent;
|
||||||
|
import WayofTime.bloodmagic.api.orb.BloodOrb;
|
||||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
||||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||||
import WayofTime.bloodmagic.api.saving.BMWorldSavedData;
|
import WayofTime.bloodmagic.api.saving.BMWorldSavedData;
|
||||||
|
@ -87,9 +88,11 @@ public class NetworkHelper
|
||||||
if (tier > OrbRegistry.getTierMap().size() || tier < 0)
|
if (tier > OrbRegistry.getTierMap().size() || tier < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
for (ItemStack orbStack : OrbRegistry.getOrbsForTier(tier))
|
for (ItemStack orbStack : OrbRegistry.getOrbsForTier(tier)) {
|
||||||
if (((IBloodOrb) orbStack.getItem()).getMaxEssence(orbStack.getItemDamage()) > ret)
|
BloodOrb orb = ((IBloodOrb) orbStack.getItem()).getOrb(orbStack);
|
||||||
ret = ((IBloodOrb) orbStack.getItem()).getMaxEssence(orbStack.getItemDamage());
|
if (orb.getCapacity() > ret)
|
||||||
|
ret = orb.getCapacity();
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package WayofTime.bloodmagic.api.util.helper;
|
||||||
import WayofTime.bloodmagic.ConfigHandler;
|
import WayofTime.bloodmagic.ConfigHandler;
|
||||||
import WayofTime.bloodmagic.api.altar.IBloodAltar;
|
import WayofTime.bloodmagic.api.altar.IBloodAltar;
|
||||||
import WayofTime.bloodmagic.api.event.SacrificeKnifeUsedEvent;
|
import WayofTime.bloodmagic.api.event.SacrificeKnifeUsedEvent;
|
||||||
import WayofTime.bloodmagic.registry.ModPotions;
|
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
|
@ -82,7 +82,7 @@ public class PlayerSacrificeHelper
|
||||||
{
|
{
|
||||||
player.setHealth(maxHealth / 10.0f);
|
player.setHealth(maxHealth / 10.0f);
|
||||||
setPlayerIncense(player, 0);
|
setPlayerIncense(player, 0);
|
||||||
player.addPotionEffect(new PotionEffect(ModPotions.soulFray, soulFrayDuration));
|
player.addPotionEffect(new PotionEffect(RegistrarBloodMagic.SOUL_FRAY, soulFrayDuration));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import WayofTime.bloodmagic.altar.BloodAltar;
|
||||||
import WayofTime.bloodmagic.api.altar.EnumAltarComponent;
|
import WayofTime.bloodmagic.api.altar.EnumAltarComponent;
|
||||||
import WayofTime.bloodmagic.api.altar.IBloodAltar;
|
import WayofTime.bloodmagic.api.altar.IBloodAltar;
|
||||||
import WayofTime.bloodmagic.api.iface.IDocumentedBlock;
|
import WayofTime.bloodmagic.api.iface.IDocumentedBlock;
|
||||||
|
import WayofTime.bloodmagic.api.orb.BloodOrb;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
@ -76,13 +77,13 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl
|
||||||
{
|
{
|
||||||
if (orbStack.getItem() instanceof IBloodOrb && orbStack.getItem() instanceof IBindable)
|
if (orbStack.getItem() instanceof IBloodOrb && orbStack.getItem() instanceof IBindable)
|
||||||
{
|
{
|
||||||
IBloodOrb bloodOrb = (IBloodOrb) orbStack.getItem();
|
BloodOrb orb = ((IBloodOrb) orbStack.getItem()).getOrb(orbStack);
|
||||||
IBindable bindable = (IBindable) orbStack.getItem();
|
IBindable bindable = (IBindable) orbStack.getItem();
|
||||||
if (!Strings.isNullOrEmpty(bindable.getOwnerUUID(orbStack)))
|
if (orb != null && !Strings.isNullOrEmpty(bindable.getOwnerUUID(orbStack)))
|
||||||
{
|
{
|
||||||
SoulNetwork soulNetwork = NetworkHelper.getSoulNetwork(bindable.getOwnerUUID(orbStack));
|
SoulNetwork soulNetwork = NetworkHelper.getSoulNetwork(bindable.getOwnerUUID(orbStack));
|
||||||
|
|
||||||
int maxEssence = bloodOrb.getMaxEssence(orbStack.getItemDamage());
|
int maxEssence = orb.getCapacity();
|
||||||
int currentEssence = soulNetwork.getCurrentEssence();
|
int currentEssence = soulNetwork.getCurrentEssence();
|
||||||
int level = currentEssence * 15 / maxEssence;
|
int level = currentEssence * 15 / maxEssence;
|
||||||
return Math.min(15, level) % 16;
|
return Math.min(15, level) % 16;
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class BlockSpectral extends Block implements IVariantProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity)
|
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity, boolean bool)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,4 +72,16 @@ public class BlockInteger extends Block
|
||||||
protected BlockStateContainer createStateContainer() {
|
protected BlockStateContainer createStateContainer() {
|
||||||
return new BlockStateContainer.Builder(this).add(property).build();
|
return new BlockStateContainer.Builder(this).add(property).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMaxMeta() {
|
||||||
|
return maxMeta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PropertyInteger getProperty() {
|
||||||
|
return property;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockStateContainer getRealStateContainer() {
|
||||||
|
return realStateContainer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,8 @@ public class GuiAlchemyTable extends GuiContainer
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString(TextHelper.localize("tile.bloodmagic.alchemyTable.name"), 8, 5, 4210752);
|
this.fontRenderer.drawString(TextHelper.localize("tile.bloodmagic.alchemyTable.name"), 8, 5, 4210752);
|
||||||
this.fontRendererObj.drawString(TextHelper.localize("container.inventory"), 8, 111, 4210752);
|
this.fontRenderer.drawString(TextHelper.localize("container.inventory"), 8, 111, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class GuiHolding extends GuiContainer
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
//the parameters for drawString are: string, x, y, color
|
//the parameters for drawString are: string, x, y, color
|
||||||
fontRendererObj.drawString(TextHelper.localize("item.bloodmagic.sigil.holding.name"), 53, 4, 4210752);
|
fontRenderer.drawString(TextHelper.localize("item.bloodmagic.sigil.holding.name"), 53, 4, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class GuiItemRoutingNode extends GuiContainer
|
||||||
this.buttonList.add(this.decrementButton = new GuiButton(7, left + 132, top + 50, 10, 18, "<"));
|
this.buttonList.add(this.decrementButton = new GuiButton(7, left + 132, top + 50, 10, 18, "<"));
|
||||||
disableDirectionalButton(inventory.currentActiveSlot);
|
disableDirectionalButton(inventory.currentActiveSlot);
|
||||||
|
|
||||||
this.textBox = new GuiTextField(0, this.fontRendererObj, left + 94, top + 37, 70, 12);
|
this.textBox = new GuiTextField(0, this.fontRenderer, left + 94, top + 37, 70, 12);
|
||||||
this.textBox.setEnableBackgroundDrawing(false);
|
this.textBox.setEnableBackgroundDrawing(false);
|
||||||
this.textBox.setText("");
|
this.textBox.setText("");
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ public class GuiItemRoutingNode extends GuiContainer
|
||||||
{
|
{
|
||||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
Minecraft.getMinecraft().fontRendererObj.drawString(inventory.getName(), xSize, ySize / 4, 4210752);
|
Minecraft.getMinecraft().fontRenderer.drawString(inventory.getName(), xSize, ySize / 4, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -193,7 +193,7 @@ public class GuiItemRoutingNode extends GuiContainer
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString("" + getCurrentActiveSlotPriority(), 143 + 5, 51 + 4, 0xFFFFFF);
|
this.fontRenderer.drawString("" + getCurrentActiveSlotPriority(), 143 + 5, 51 + 4, 0xFFFFFF);
|
||||||
String s = "";
|
String s = "";
|
||||||
if (container.lastGhostSlotClicked != -1)
|
if (container.lastGhostSlotClicked != -1)
|
||||||
{
|
{
|
||||||
|
@ -204,7 +204,7 @@ public class GuiItemRoutingNode extends GuiContainer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fontRendererObj.drawStringWithShadow(s.substring(0, Math.min(16, s.length())), 81, 19, 0xFFFFFF);
|
this.fontRenderer.drawStringWithShadow(s.substring(0, Math.min(16, s.length())), 81, 19, 0xFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -28,8 +28,8 @@ public class GuiSoulForge extends GuiContainer
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString(TextHelper.localize("tile.bloodmagic.soulForge.name"), 8, 5, 4210752);
|
this.fontRenderer.drawString(TextHelper.localize("tile.bloodmagic.soulForge.name"), 8, 5, 4210752);
|
||||||
this.fontRendererObj.drawString(TextHelper.localize("container.inventory"), 8, 111, 4210752);
|
this.fontRenderer.drawString(TextHelper.localize("container.inventory"), 8, 111, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -22,8 +22,8 @@ public class GuiTeleposer extends GuiContainer
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString(TextHelper.localize("tile.bloodmagic.teleposer.name"), 64, 23, 4210752);
|
this.fontRenderer.drawString(TextHelper.localize("tile.bloodmagic.teleposer.name"), 64, 23, 4210752);
|
||||||
this.fontRendererObj.drawString(TextHelper.localize("container.inventory"), 8, 47, 4210752);
|
this.fontRenderer.drawString(TextHelper.localize("container.inventory"), 8, 47, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -25,15 +25,15 @@ public class ConfigGui extends GuiConfig
|
||||||
|
|
||||||
// adds sections declared in ConfigHandler. toLowerCase() is used
|
// adds sections declared in ConfigHandler. toLowerCase() is used
|
||||||
// because the configuration class automatically does this, so must we.
|
// because the configuration class automatically does this, so must we.
|
||||||
list.add(new ConfigElement(ConfigHandler.getConfig().getCategory("Potions".toLowerCase())));
|
list.add(new ConfigElement(ConfigHandler.config.getCategory("Potions".toLowerCase())));
|
||||||
list.add(new ConfigElement(ConfigHandler.getConfig().getCategory("Client".toLowerCase())));
|
list.add(new ConfigElement(ConfigHandler.config.getCategory("Client".toLowerCase())));
|
||||||
list.add(new ConfigElement(ConfigHandler.getConfig().getCategory("Compatibility".toLowerCase())));
|
list.add(new ConfigElement(ConfigHandler.config.getCategory("Compatibility".toLowerCase())));
|
||||||
list.add(new ConfigElement(ConfigHandler.getConfig().getCategory("Teleposer Blacklist".toLowerCase())));
|
list.add(new ConfigElement(ConfigHandler.config.getCategory("Teleposer Blacklist".toLowerCase())));
|
||||||
list.add(new ConfigElement(ConfigHandler.getConfig().getCategory("Well of Suffering Blacklist".toLowerCase())));
|
list.add(new ConfigElement(ConfigHandler.config.getCategory("Well of Suffering Blacklist".toLowerCase())));
|
||||||
list.add(new ConfigElement(ConfigHandler.getConfig().getCategory("Item/Block Blacklisting".toLowerCase())));
|
list.add(new ConfigElement(ConfigHandler.config.getCategory("Item/Block Blacklisting".toLowerCase())));
|
||||||
list.add(new ConfigElement(ConfigHandler.getConfig().getCategory("General".toLowerCase())));
|
list.add(new ConfigElement(ConfigHandler.config.getCategory("General".toLowerCase())));
|
||||||
list.add(new ConfigElement(ConfigHandler.getConfig().getCategory("Rituals".toLowerCase())));
|
list.add(new ConfigElement(ConfigHandler.config.getCategory("Rituals".toLowerCase())));
|
||||||
list.add(new ConfigElement(ConfigHandler.getConfig().getCategory("Blood Altar Sacrificial Values".toLowerCase())));
|
list.add(new ConfigElement(ConfigHandler.config.getCategory("Blood Altar Sacrificial Values".toLowerCase())));
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,28 +8,23 @@ import java.util.Set;
|
||||||
|
|
||||||
public class ConfigGuiFactory implements IModGuiFactory
|
public class ConfigGuiFactory implements IModGuiFactory
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(Minecraft minecraftInstance)
|
public void initialize(Minecraft minecraftInstance) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiScreen> mainConfigGuiClass()
|
public boolean hasConfigGui() {
|
||||||
{
|
return false;
|
||||||
return ConfigGui.class;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories()
|
public GuiScreen createConfigGui(GuiScreen parentScreen) {
|
||||||
{
|
return new ConfigGui(parentScreen);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RuntimeOptionGuiHandler getHandlerFor(IModGuiFactory.RuntimeOptionCategoryElement element)
|
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||||
|
|
||||||
public abstract class HUDElement
|
public abstract class HUDElement
|
||||||
{
|
{
|
||||||
|
|
||||||
private int xOffset;
|
private int xOffset;
|
||||||
private int yOffset;
|
private int yOffset;
|
||||||
private final int xOffsetDefault;
|
private final int xOffsetDefault;
|
||||||
|
@ -57,19 +56,19 @@ public abstract class HUDElement
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getxOffset() {
|
public int getXOffset() {
|
||||||
return xOffset;
|
return xOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getyOffset() {
|
public int getYOffset() {
|
||||||
return yOffset;
|
return yOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getxOffsetDefault() {
|
public int getXOffsetDefault() {
|
||||||
return xOffsetDefault;
|
return xOffsetDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getyOffsetDefault() {
|
public int getYOffsetDefault() {
|
||||||
return yOffsetDefault;
|
return yOffsetDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import WayofTime.bloodmagic.BloodMagic;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||||
|
@ -74,7 +73,7 @@ public class HUDElementDemonWillAura extends HUDElement
|
||||||
String value = "" + (int) amount;
|
String value = "" + (int) amount;
|
||||||
GlStateManager.translate(x - 2 * textureXOffset - value.length() * 0 + 70, (y - 1), 0);
|
GlStateManager.translate(x - 2 * textureXOffset - value.length() * 0 + 70, (y - 1), 0);
|
||||||
GlStateManager.scale(0.5, 0.5, 1);
|
GlStateManager.scale(0.5, 0.5, 1);
|
||||||
minecraft.fontRendererObj.drawStringWithShadow("" + (int) amount, 0, 2, 0xffffff);
|
minecraft.fontRenderer.drawStringWithShadow("" + (int) amount, 0, 2, 0xffffff);
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class HUDElementHolding extends HUDElement
|
||||||
if (animation > 0.0F)
|
if (animation > 0.0F)
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
Minecraft.getMinecraft().getRenderItem().renderItemOverlays(Minecraft.getMinecraft().fontRendererObj, stack, x, y);
|
Minecraft.getMinecraft().getRenderItem().renderItemOverlays(Minecraft.getMinecraft().fontRenderer, stack, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class CustomMeshDefinitionActivatable implements ItemMeshDefinition
|
||||||
@Override
|
@Override
|
||||||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||||
{
|
{
|
||||||
if (stack != null && stack.getItem() instanceof IActivatable)
|
if (!stack.isEmpty() && stack.getItem() instanceof IActivatable)
|
||||||
if (((IActivatable) stack.getItem()).getActivated(stack))
|
if (((IActivatable) stack.getItem()).getActivated(stack))
|
||||||
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + name), "active=true");
|
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + name), "active=true");
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class CustomMeshDefinitionMultiWill implements ItemMeshDefinition
|
||||||
@Override
|
@Override
|
||||||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||||
{
|
{
|
||||||
if (stack != null && stack.getItem() instanceof IMultiWillTool)
|
if (!stack.isEmpty() && stack.getItem() instanceof IMultiWillTool)
|
||||||
{
|
{
|
||||||
EnumDemonWillType type = ((IMultiWillTool) stack.getItem()).getCurrentType(stack);
|
EnumDemonWillType type = ((IMultiWillTool) stack.getItem()).getCurrentType(stack);
|
||||||
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + name), "type=" + type.getName().toLowerCase());
|
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + name), "type=" + type.getName().toLowerCase());
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class CustomMeshDefinitionWillGem implements ItemMeshDefinition
|
||||||
@Override
|
@Override
|
||||||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||||
{
|
{
|
||||||
if (stack != null && stack.getItem() == RegistrarBloodMagicItems.SOUL_GEM)
|
if (!stack.isEmpty() && stack.getItem() == RegistrarBloodMagicItems.SOUL_GEM)
|
||||||
{
|
{
|
||||||
EnumDemonWillType type = ((ItemSoulGem) stack.getItem()).getCurrentType(stack);
|
EnumDemonWillType type = ((ItemSoulGem) stack.getItem()).getCurrentType(stack);
|
||||||
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + name), "type=" + ItemSoulGem.names[stack.getItemDamage()] + "_" + type.getName().toLowerCase());
|
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + name), "type=" + ItemSoulGem.names[stack.getItemDamage()] + "_" + type.getName().toLowerCase());
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package WayofTime.bloodmagic.client.render.alchemyArray;
|
package WayofTime.bloodmagic.client.render.alchemyArray;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
@ -71,7 +71,7 @@ public class AttractorAlchemyCircleRenderer extends AlchemyCircleRenderer
|
||||||
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
|
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer wr = tessellator.getBuffer();
|
BufferBuilder wr = tessellator.getBuffer();
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package WayofTime.bloodmagic.client.render.alchemyArray;
|
package WayofTime.bloodmagic.client.render.alchemyArray;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
@ -168,7 +168,7 @@ public class BindingAlchemyCircleRenderer extends AlchemyCircleRenderer
|
||||||
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime)
|
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime)
|
||||||
{
|
{
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer wr = tessellator.getBuffer();
|
BufferBuilder wr = tessellator.getBuffer();
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package WayofTime.bloodmagic.client.render.alchemyArray;
|
package WayofTime.bloodmagic.client.render.alchemyArray;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
@ -56,7 +56,7 @@ public class DualAlchemyCircleRenderer extends AlchemyCircleRenderer
|
||||||
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
|
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer wr = tessellator.getBuffer();
|
BufferBuilder wr = tessellator.getBuffer();
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
// float rot = (float)(this.worldObj.provider.getWorldTime() % (360 /
|
// float rot = (float)(this.worldObj.provider.getWorldTime() % (360 /
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package WayofTime.bloodmagic.client.render.alchemyArray;
|
package WayofTime.bloodmagic.client.render.alchemyArray;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
@ -54,7 +54,7 @@ public class SingleAlchemyCircleRenderer extends AlchemyCircleRenderer
|
||||||
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
|
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer wr = tessellator.getBuffer();
|
BufferBuilder wr = tessellator.getBuffer();
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
// float rot = (float)(this.worldObj.provider.getWorldTime() % (360 /
|
// float rot = (float)(this.worldObj.provider.getWorldTime() % (360 /
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package WayofTime.bloodmagic.client.render.alchemyArray;
|
package WayofTime.bloodmagic.client.render.alchemyArray;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
@ -58,7 +58,7 @@ public class StaticAlchemyCircleRenderer extends AlchemyCircleRenderer
|
||||||
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
|
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer wr = tessellator.getBuffer();
|
BufferBuilder wr = tessellator.getBuffer();
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.item.ItemStack;
|
||||||
public class RenderAlchemyArray extends TileEntitySpecialRenderer<TileAlchemyArray>
|
public class RenderAlchemyArray extends TileEntitySpecialRenderer<TileAlchemyArray>
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileAlchemyArray alchemyArray, double x, double y, double z, float partialTicks, int destroyStage)
|
public void render(TileAlchemyArray alchemyArray, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||||
{
|
{
|
||||||
ItemStack inputStack = alchemyArray.getStackInSlot(0);
|
ItemStack inputStack = alchemyArray.getStackInSlot(0);
|
||||||
ItemStack catalystStack = alchemyArray.getStackInSlot(1);
|
ItemStack catalystStack = alchemyArray.getStackInSlot(1);
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
|
||||||
public static float maxHeight = 0.745f;
|
public static float maxHeight = 0.745f;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileAltar tileAltar, double x, double y, double z, float partialTicks, int destroyStage)
|
public void render(TileAltar tileAltar, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||||
{
|
{
|
||||||
ItemStack inputStack = tileAltar.getStackInSlot(0);
|
ItemStack inputStack = tileAltar.getStackInSlot(0);
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
|
||||||
GlStateManager.translate(x, y, z);
|
GlStateManager.translate(x, y, z);
|
||||||
if (level > 0)
|
if (level > 0)
|
||||||
this.renderFluid(getWorld(), level);
|
this.renderFluid(getWorld(), level);
|
||||||
this.renderItem(tileAltar.getWorld(), inputStack, partialTicks);
|
this.renderItem(tileAltar.getWorld(), inputStack);
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
if (tileAltar.getCurrentTierDisplayed() != EnumAltarTier.ONE)
|
if (tileAltar.getCurrentTierDisplayed() != EnumAltarTier.ONE)
|
||||||
|
@ -59,7 +59,7 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
|
||||||
GlStateManager.translate(0.5, minHeight + (fluidLevel) * (maxHeight - minHeight), 0.5);
|
GlStateManager.translate(0.5, minHeight + (fluidLevel) * (maxHeight - minHeight), 0.5);
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer wr = tessellator.getBuffer();
|
BufferBuilder wr = tessellator.getBuffer();
|
||||||
|
|
||||||
float size = 0.8f;
|
float size = 0.8f;
|
||||||
|
|
||||||
|
@ -95,14 +95,14 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
|
||||||
GlStateManager.color(red, green, blue, 1.0F);
|
GlStateManager.color(red, green, blue, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderItem(World world, ItemStack stack, float partialTicks)
|
private void renderItem(World world, ItemStack stack)
|
||||||
{
|
{
|
||||||
RenderItem itemRenderer = mc.getRenderItem();
|
RenderItem itemRenderer = mc.getRenderItem();
|
||||||
if (stack != null)
|
if (!stack.isEmpty())
|
||||||
{
|
{
|
||||||
GlStateManager.translate(0.5, 1, 0.5);
|
GlStateManager.translate(0.5, 1, 0.5);
|
||||||
EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, stack);
|
EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, stack);
|
||||||
entityitem.getEntityItem().setCount(1);
|
entityitem.getItem().setCount(1);
|
||||||
entityitem.hoverStart = 0.0F;
|
entityitem.hoverStart = 0.0F;
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.disableLighting();
|
GlStateManager.disableLighting();
|
||||||
|
@ -113,7 +113,7 @@ public class RenderAltar extends TileEntitySpecialRenderer<TileAltar>
|
||||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||||
GlStateManager.pushAttrib();
|
GlStateManager.pushAttrib();
|
||||||
RenderHelper.enableStandardItemLighting();
|
RenderHelper.enableStandardItemLighting();
|
||||||
itemRenderer.renderItem(entityitem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);
|
itemRenderer.renderItem(entityitem.getItem(), ItemCameraTransforms.TransformType.FIXED);
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
GlStateManager.popAttrib();
|
GlStateManager.popAttrib();
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ package WayofTime.bloodmagic.client.render.block;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.tile.TileBloodTank;
|
import WayofTime.bloodmagic.tile.TileBloodTank;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
|
@ -21,7 +21,7 @@ public class RenderBloodTank extends TileEntitySpecialRenderer<TileBloodTank>
|
||||||
private static final Minecraft mc = Minecraft.getMinecraft();
|
private static final Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileBloodTank bloodTank, double x, double y, double z, float partialTicks, int destroyStage)
|
public void render(TileBloodTank bloodTank, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||||
{
|
{
|
||||||
if (bloodTank == null)
|
if (bloodTank == null)
|
||||||
return;
|
return;
|
||||||
|
@ -50,7 +50,7 @@ public class RenderBloodTank extends TileEntitySpecialRenderer<TileBloodTank>
|
||||||
GlStateManager.disableBlend();
|
GlStateManager.disableBlend();
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer buffer = tessellator.getBuffer();
|
BufferBuilder buffer = tessellator.getBuffer();
|
||||||
|
|
||||||
TextureAtlasSprite fluid = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(renderFluid.getStill().toString());
|
TextureAtlasSprite fluid = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(renderFluid.getStill().toString());
|
||||||
fluid = fluid == null ? mc.getTextureMapBlocks().getMissingSprite() : fluid;
|
fluid = fluid == null ? mc.getTextureMapBlocks().getMissingSprite() : fluid;
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class RenderDemonCrucible extends TileEntitySpecialRenderer<TileDemonCruc
|
||||||
public static float maxHeight = 0.79f;
|
public static float maxHeight = 0.79f;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileDemonCrucible tile, double x, double y, double z, float partialTicks, int destroyStage)
|
public void render(TileDemonCrucible tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||||
{
|
{
|
||||||
ItemStack inputStack = tile.getStackInSlot(0);
|
ItemStack inputStack = tile.getStackInSlot(0);
|
||||||
|
|
||||||
|
@ -33,11 +33,11 @@ public class RenderDemonCrucible extends TileEntitySpecialRenderer<TileDemonCruc
|
||||||
private void renderItem(World world, ItemStack stack, float partialTicks)
|
private void renderItem(World world, ItemStack stack, float partialTicks)
|
||||||
{
|
{
|
||||||
RenderItem itemRenderer = mc.getRenderItem();
|
RenderItem itemRenderer = mc.getRenderItem();
|
||||||
if (stack != null)
|
if (!stack.isEmpty())
|
||||||
{
|
{
|
||||||
GlStateManager.translate(0.5, 1.5, 0.5);
|
GlStateManager.translate(0.5, 1.5, 0.5);
|
||||||
EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, stack);
|
EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, stack);
|
||||||
entityitem.getEntityItem().setCount(1);
|
entityitem.getItem().setCount(1);
|
||||||
entityitem.hoverStart = 0.0F;
|
entityitem.hoverStart = 0.0F;
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.disableLighting();
|
GlStateManager.disableLighting();
|
||||||
|
@ -48,7 +48,7 @@ public class RenderDemonCrucible extends TileEntitySpecialRenderer<TileDemonCruc
|
||||||
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
GlStateManager.scale(0.5F, 0.5F, 0.5F);
|
||||||
GlStateManager.pushAttrib();
|
GlStateManager.pushAttrib();
|
||||||
RenderHelper.enableStandardItemLighting();
|
RenderHelper.enableStandardItemLighting();
|
||||||
itemRenderer.renderItem(entityitem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);
|
itemRenderer.renderItem(entityitem.getItem(), ItemCameraTransforms.TransformType.FIXED);
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
GlStateManager.popAttrib();
|
GlStateManager.popAttrib();
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
package WayofTime.bloodmagic.client.render.block;
|
package WayofTime.bloodmagic.client.render.block;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public class RenderFakeBlocks
|
public class RenderFakeBlocks
|
||||||
|
@ -20,7 +19,7 @@ public class RenderFakeBlocks
|
||||||
double maxY = minY + 1;
|
double maxY = minY + 1;
|
||||||
double maxZ = minZ + 1;
|
double maxZ = minZ + 1;
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer wr = tessellator.getBuffer();
|
BufferBuilder wr = tessellator.getBuffer();
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||||
|
|
||||||
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||||
|
|
|
@ -6,9 +6,9 @@ import WayofTime.bloodmagic.api.iface.INodeRenderer;
|
||||||
import WayofTime.bloodmagic.client.helper.ShaderHelper;
|
import WayofTime.bloodmagic.client.helper.ShaderHelper;
|
||||||
import WayofTime.bloodmagic.tile.routing.TileRoutingNode;
|
import WayofTime.bloodmagic.tile.routing.TileRoutingNode;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
@ -23,10 +23,8 @@ public class RenderItemRoutingNode extends TileEntitySpecialRenderer<TileRouting
|
||||||
private static final ResourceLocation beamTexture = new ResourceLocation(BloodMagic.MODID, "textures/entities/nodeBeam.png");
|
private static final ResourceLocation beamTexture = new ResourceLocation(BloodMagic.MODID, "textures/entities/nodeBeam.png");
|
||||||
private static final Minecraft mc = Minecraft.getMinecraft();
|
private static final Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
|
||||||
// private static final ResourceLocation test = new ResourceLocation("luminescence:textures/models/InputMirror.png");
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileRoutingNode tileNode, double x, double y, double z, float partialTicks, int destroyStage)
|
public void render(TileRoutingNode tileNode, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||||
{
|
{
|
||||||
if (mc.player.getHeldItemMainhand().getItem() instanceof INodeRenderer || ConfigHandler.alwaysRenderRoutingLines)
|
if (mc.player.getHeldItemMainhand().getItem() instanceof INodeRenderer || ConfigHandler.alwaysRenderRoutingLines)
|
||||||
{
|
{
|
||||||
|
@ -48,7 +46,7 @@ public class RenderItemRoutingNode extends TileEntitySpecialRenderer<TileRouting
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
float f1 = 1.0f;
|
float f1 = 1.0f;
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer wr = tessellator.getBuffer();
|
BufferBuilder wr = tessellator.getBuffer();
|
||||||
this.bindTexture(beamTexture);
|
this.bindTexture(beamTexture);
|
||||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
|
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
|
||||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
|
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
|
||||||
|
|
|
@ -10,14 +10,14 @@ import WayofTime.bloodmagic.tile.TileMimic;
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class RenderMimic extends TileEntitySpecialRenderer<TileMimic>
|
public class RenderMimic extends TileEntitySpecialRenderer<TileMimic>
|
||||||
{
|
{
|
||||||
public void renderTileEntityAt(TileMimic mimic, double x, double y, double z, float partialTicks, int destroyStage)
|
public void render(TileMimic mimic, double x, double y, double z, float partialTicks, int destroyStage, float alpha)
|
||||||
{
|
{
|
||||||
if (mimic.getStackInSlot(0) != null)
|
if (mimic.getStackInSlot(0) != null)
|
||||||
{
|
{
|
||||||
TileEntity testTile = mimic.mimicedTile;
|
TileEntity testTile = mimic.mimicedTile;
|
||||||
if (mimic != null)
|
if (mimic != null)
|
||||||
{
|
{
|
||||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(testTile, x, y, z, partialTicks, destroyStage);
|
TileEntityRendererDispatcher.instance.render(testTile, x, y, z, partialTicks, destroyStage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package WayofTime.bloodmagic.client.render.entity;
|
package WayofTime.bloodmagic.client.render.entity;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.entity.Render;
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
|
@ -38,7 +38,7 @@ public class RenderEntitySentientArrow extends Render<EntitySentientArrow>
|
||||||
GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F);
|
GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||||
GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);
|
GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer worldrenderer = tessellator.getBuffer();
|
BufferBuilder worldrenderer = tessellator.getBuffer();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
float f = 0.0F;
|
float f = 0.0F;
|
||||||
float f1 = 0.5F;
|
float f1 = 0.5F;
|
||||||
|
|
|
@ -40,18 +40,8 @@ public class RenderSentientSpecter extends RenderBiped<EntitySentientSpecter>
|
||||||
*/
|
*/
|
||||||
public void doRender(EntitySentientSpecter entity, double x, double y, double z, float entityYaw, float partialTicks)
|
public void doRender(EntitySentientSpecter entity, double x, double y, double z, float entityYaw, float partialTicks)
|
||||||
{
|
{
|
||||||
// if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(entity, this, partialTicks, x, y, z)))
|
this.setModelVisibilities(entity);
|
||||||
// return;
|
super.doRender(entity, x, y, z, entityYaw, partialTicks);
|
||||||
// if (!entity.isUser() || this.renderManager.renderViewEntity == entity)
|
|
||||||
{
|
|
||||||
double d0 = y;
|
|
||||||
|
|
||||||
this.setModelVisibilities(entity);
|
|
||||||
// GlStateManager.enableBlendProfile(GlStateManager.Profile.PLAYER_SKIN);
|
|
||||||
super.doRender(entity, x, d0, z, entityYaw, partialTicks);
|
|
||||||
// GlStateManager.disableBlendProfile(GlStateManager.Profile.PLAYER_SKIN);
|
|
||||||
}
|
|
||||||
// net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(entity, this, partialTicks, x, y, z));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setModelVisibilities(EntitySentientSpecter clientPlayer)
|
private void setModelVisibilities(EntitySentientSpecter clientPlayer)
|
||||||
|
@ -60,13 +50,13 @@ public class RenderSentientSpecter extends RenderBiped<EntitySentientSpecter>
|
||||||
|
|
||||||
ItemStack itemstack = clientPlayer.getHeldItemMainhand();
|
ItemStack itemstack = clientPlayer.getHeldItemMainhand();
|
||||||
ItemStack itemstack1 = clientPlayer.getHeldItemOffhand();
|
ItemStack itemstack1 = clientPlayer.getHeldItemOffhand();
|
||||||
modelplayer.setInvisible(true);
|
modelplayer.setVisible(false);
|
||||||
|
|
||||||
modelplayer.isSneak = clientPlayer.isSneaking();
|
modelplayer.isSneak = clientPlayer.isSneaking();
|
||||||
ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
|
ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
|
||||||
ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;
|
ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;
|
||||||
|
|
||||||
if (itemstack != null)
|
if (!itemstack.isEmpty())
|
||||||
{
|
{
|
||||||
modelbiped$armpose = ModelBiped.ArmPose.ITEM;
|
modelbiped$armpose = ModelBiped.ArmPose.ITEM;
|
||||||
|
|
||||||
|
@ -84,7 +74,7 @@ public class RenderSentientSpecter extends RenderBiped<EntitySentientSpecter>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemstack1 != null)
|
if (!itemstack1.isEmpty())
|
||||||
{
|
{
|
||||||
modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;
|
modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;
|
||||||
|
|
||||||
|
@ -134,40 +124,4 @@ public class RenderSentientSpecter extends RenderBiped<EntitySentientSpecter>
|
||||||
float f = 0.9375F;
|
float f = 0.9375F;
|
||||||
GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
|
GlStateManager.scale(0.9375F, 0.9375F, 0.9375F);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void renderRightArm(EntitySentientSpecter clientPlayer)
|
|
||||||
// {
|
|
||||||
// float f = 1.0F;
|
|
||||||
// GlStateManager.color(1.0F, 1.0F, 1.0F);
|
|
||||||
// float f1 = 0.0625F;
|
|
||||||
// ModelBiped modelplayer = this.getMainModel();
|
|
||||||
// this.setModelVisibilities(clientPlayer);
|
|
||||||
// GlStateManager.enableBlend();
|
|
||||||
// modelplayer.swingProgress = 0.0F;
|
|
||||||
// modelplayer.isSneak = false;
|
|
||||||
// modelplayer.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, clientPlayer);
|
|
||||||
// modelplayer.bipedRightArm.rotateAngleX = 0.0F;
|
|
||||||
// modelplayer.bipedRightArm.render(0.0625F);
|
|
||||||
// modelplayer.bipedRightArmwear.rotateAngleX = 0.0F;
|
|
||||||
// modelplayer.bipedRightArmwear.render(0.0625F);
|
|
||||||
// GlStateManager.disableBlend();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void renderLeftArm(EntitySentientSpecter clientPlayer)
|
|
||||||
// {
|
|
||||||
// float f = 1.0F;
|
|
||||||
// GlStateManager.color(1.0F, 1.0F, 1.0F);
|
|
||||||
// float f1 = 0.0625F;
|
|
||||||
// ModelBiped modelplayer = this.getMainModel();
|
|
||||||
// this.setModelVisibilities(clientPlayer);
|
|
||||||
// GlStateManager.enableBlend();
|
|
||||||
// modelplayer.isSneak = false;
|
|
||||||
// modelplayer.swingProgress = 0.0F;
|
|
||||||
// modelplayer.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, clientPlayer);
|
|
||||||
// modelplayer.bipedLeftArm.rotateAngleX = 0.0F;
|
|
||||||
// modelplayer.bipedLeftArm.render(0.0625F);
|
|
||||||
// modelplayer.bipedLeftArmwear.rotateAngleX = 0.0F;
|
|
||||||
// modelplayer.bipedLeftArmwear.render(0.0625F);
|
|
||||||
// GlStateManager.disableBlend();
|
|
||||||
// }
|
|
||||||
}
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
package WayofTime.bloodmagic.client.render.entity.layer;
|
package WayofTime.bloodmagic.client.render.entity.layer;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
@ -32,7 +32,7 @@ public class LayerAlchemyCircle<T extends EntityCorruptedSheep> implements Layer
|
||||||
}
|
}
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
VertexBuffer wr = tessellator.getBuffer();
|
BufferBuilder wr = tessellator.getBuffer();
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
float rot = this.rotationspeed * (partialTicks + demon.ticksExisted);
|
float rot = this.rotationspeed * (partialTicks + demon.ticksExisted);
|
||||||
|
|
|
@ -41,11 +41,11 @@ public class LayerCorruptedSpiderEyes implements LayerRenderer<EntityCorruptedSp
|
||||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j, (float) k);
|
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j, (float) k);
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.spiderRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
this.spiderRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
|
||||||
i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
|
i = entitylivingbaseIn.getBrightnessForRender();
|
||||||
j = i % 65536;
|
j = i % 65536;
|
||||||
k = i / 65536;
|
k = i / 65536;
|
||||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j, (float) k);
|
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j, (float) k);
|
||||||
this.spiderRenderer.setLightmap(entitylivingbaseIn, partialTicks);
|
this.spiderRenderer.setLightmap(entitylivingbaseIn);
|
||||||
GlStateManager.disableBlend();
|
GlStateManager.disableBlend();
|
||||||
GlStateManager.enableAlpha();
|
GlStateManager.enableAlpha();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,9 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
|
||||||
import WayofTime.bloodmagic.api.recipe.ShapedBloodOrbRecipe;
|
|
||||||
import WayofTime.bloodmagic.api.recipe.ShapelessBloodOrbRecipe;
|
|
||||||
import WayofTime.bloodmagic.api.registry.AlchemyArrayRecipeRegistry;
|
import WayofTime.bloodmagic.api.registry.AlchemyArrayRecipeRegistry;
|
||||||
import WayofTime.bloodmagic.client.render.alchemyArray.DualAlchemyCircleRenderer;
|
import WayofTime.bloodmagic.client.render.alchemyArray.DualAlchemyCircleRenderer;
|
||||||
import WayofTime.bloodmagic.compat.guideapi.page.PageAlchemyArray;
|
import WayofTime.bloodmagic.compat.guideapi.page.PageAlchemyArray;
|
||||||
import WayofTime.bloodmagic.compat.guideapi.page.recipeRenderer.ShapedBloodOrbRecipeRenderer;
|
|
||||||
import WayofTime.bloodmagic.compat.guideapi.page.recipeRenderer.ShapelessBloodOrbRecipeRenderer;
|
|
||||||
import amerifrance.guideapi.page.PageIRecipe;
|
import amerifrance.guideapi.page.PageIRecipe;
|
||||||
|
|
||||||
public class BookUtils
|
public class BookUtils
|
||||||
|
@ -72,14 +68,6 @@ public class BookUtils
|
||||||
|
|
||||||
public static PageIRecipe getPageForRecipe(IRecipe recipe)
|
public static PageIRecipe getPageForRecipe(IRecipe recipe)
|
||||||
{
|
{
|
||||||
if (recipe instanceof ShapedBloodOrbRecipe)
|
|
||||||
{
|
|
||||||
return new PageIRecipe(recipe, new ShapedBloodOrbRecipeRenderer((ShapedBloodOrbRecipe) recipe));
|
|
||||||
} else if (recipe instanceof ShapelessBloodOrbRecipe)
|
|
||||||
{
|
|
||||||
return new PageIRecipe(recipe, new ShapelessBloodOrbRecipeRenderer((ShapelessBloodOrbRecipe) recipe));
|
|
||||||
}
|
|
||||||
|
|
||||||
return new PageIRecipe(recipe);
|
return new PageIRecipe(recipe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,6 @@ public class GuideBloodMagic implements IGuideBook {
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public IRecipe getRecipe(@Nonnull ItemStack bookStack) {
|
public IRecipe getRecipe(@Nonnull ItemStack bookStack) {
|
||||||
return new ShapelessOreRecipe(new ResourceLocation(BloodMagic.MODID, "guide"), GuideAPI.getStackFromBook(GUIDE_BOOK), new ItemStack(Items.BOOK), "glass", "feather");
|
return new ShapelessOreRecipe(new ResourceLocation(BloodMagic.MODID, "guide"), GuideAPI.getStackFromBook(GUIDE_BOOK), new ItemStack(Items.BOOK), "glass", "feather").setRegistryName("guide");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.BloodMagic;
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
|
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
@ -88,7 +89,7 @@ public class CategoryArchitect
|
||||||
List<IPage> weakorbPages = new ArrayList<IPage>();
|
List<IPage> weakorbPages = new ArrayList<IPage>();
|
||||||
weakorbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "weakorb" + ".info.1"), 370));
|
weakorbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "weakorb" + ".info.1"), 370));
|
||||||
|
|
||||||
AltarRecipe weakorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagicItems.ORB_WEAK));
|
AltarRecipe weakorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK));
|
||||||
if (weakorbRecipe != null)
|
if (weakorbRecipe != null)
|
||||||
{
|
{
|
||||||
weakorbPages.add(new PageAltarRecipe(weakorbRecipe));
|
weakorbPages.add(new PageAltarRecipe(weakorbRecipe));
|
||||||
|
@ -196,7 +197,7 @@ public class CategoryArchitect
|
||||||
|
|
||||||
List<IPage> apprenticeorbPages = new ArrayList<IPage>();
|
List<IPage> apprenticeorbPages = new ArrayList<IPage>();
|
||||||
|
|
||||||
AltarRecipe apprenticeorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagicItems.ORB_APPRENTICE));
|
AltarRecipe apprenticeorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_APPRENTICE));
|
||||||
if (apprenticeorbRecipe != null)
|
if (apprenticeorbRecipe != null)
|
||||||
{
|
{
|
||||||
apprenticeorbPages.add(new PageAltarRecipe(apprenticeorbRecipe));
|
apprenticeorbPages.add(new PageAltarRecipe(apprenticeorbRecipe));
|
||||||
|
@ -342,7 +343,7 @@ public class CategoryArchitect
|
||||||
|
|
||||||
List<IPage> magicianOrbPages = new ArrayList<IPage>();
|
List<IPage> magicianOrbPages = new ArrayList<IPage>();
|
||||||
|
|
||||||
AltarRecipe magicianOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagicItems.ORB_MAGICIAN));
|
AltarRecipe magicianOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MAGICIAN));
|
||||||
if (magicianOrbRecipe != null)
|
if (magicianOrbRecipe != null)
|
||||||
{
|
{
|
||||||
magicianOrbPages.add(new PageAltarRecipe(magicianOrbRecipe));
|
magicianOrbPages.add(new PageAltarRecipe(magicianOrbRecipe));
|
||||||
|
@ -538,7 +539,7 @@ public class CategoryArchitect
|
||||||
|
|
||||||
List<IPage> masterOrbPages = new ArrayList<IPage>();
|
List<IPage> masterOrbPages = new ArrayList<IPage>();
|
||||||
|
|
||||||
AltarRecipe masterOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagicItems.ORB_MASTER));
|
AltarRecipe masterOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MASTER));
|
||||||
if (magicianOrbRecipe != null)
|
if (magicianOrbRecipe != null)
|
||||||
{
|
{
|
||||||
masterOrbPages.add(new PageAltarRecipe(masterOrbRecipe));
|
masterOrbPages.add(new PageAltarRecipe(masterOrbRecipe));
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
package WayofTime.bloodmagic.compat.guideapi.page.recipeRenderer;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
|
||||||
import WayofTime.bloodmagic.api.recipe.ShapedBloodOrbRecipe;
|
|
||||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
|
||||||
import amerifrance.guideapi.api.impl.Book;
|
|
||||||
import amerifrance.guideapi.api.impl.abstraction.CategoryAbstract;
|
|
||||||
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
|
|
||||||
import amerifrance.guideapi.api.util.GuiHelper;
|
|
||||||
import amerifrance.guideapi.gui.GuiBase;
|
|
||||||
import amerifrance.guideapi.page.reciperenderer.BasicRecipeRenderer;
|
|
||||||
|
|
||||||
// TODO: Fix rendering of recipe
|
|
||||||
public class ShapedBloodOrbRecipeRenderer extends BasicRecipeRenderer<ShapedBloodOrbRecipe>
|
|
||||||
{
|
|
||||||
public ShapedBloodOrbRecipeRenderer(ShapedBloodOrbRecipe recipe)
|
|
||||||
{
|
|
||||||
super(recipe);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
|
||||||
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRendererObj)
|
|
||||||
{
|
|
||||||
super.draw(book, category, entry, guiLeft, guiTop, mouseX, mouseY, guiBase, fontRendererObj);
|
|
||||||
for (int y = 0; y < recipe.height; y++)
|
|
||||||
{
|
|
||||||
for (int x = 0; x < recipe.width; x++)
|
|
||||||
{
|
|
||||||
int stackX = (x + 1) * 17 + (guiLeft + 29);
|
|
||||||
int stackY = (y + 1) * 17 + (guiTop + 40);
|
|
||||||
Object component = recipe.getInput()[y * recipe.width + x];
|
|
||||||
if (component != null)
|
|
||||||
{
|
|
||||||
if (component instanceof ItemStack)
|
|
||||||
{
|
|
||||||
ItemStack input = (ItemStack) component;
|
|
||||||
if (input.getItemDamage() == OreDictionary.WILDCARD_VALUE)
|
|
||||||
input.setItemDamage(0);
|
|
||||||
|
|
||||||
GuiHelper.drawItemStack((ItemStack) component, stackX, stackY);
|
|
||||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
|
|
||||||
{
|
|
||||||
tooltips = GuiHelper.getTooltip((ItemStack) component);
|
|
||||||
}
|
|
||||||
} else if (component instanceof Integer)
|
|
||||||
{
|
|
||||||
List<ItemStack> list = OrbRegistry.getOrbsDownToTier((Integer) component);
|
|
||||||
if (!list.isEmpty())
|
|
||||||
{
|
|
||||||
ItemStack stack = list.get(getRandomizedCycle(x + (y * 3), list.size()));
|
|
||||||
GuiHelper.drawItemStack(stack, stackX, stackY);
|
|
||||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
|
|
||||||
{
|
|
||||||
tooltips = GuiHelper.getTooltip(stack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
List<ItemStack> list = (List<ItemStack>) component;
|
|
||||||
if (!list.isEmpty())
|
|
||||||
{
|
|
||||||
ItemStack stack = list.get(getRandomizedCycle(x + (y * 3), list.size()));
|
|
||||||
GuiHelper.drawItemStack(stack, stackX, stackY);
|
|
||||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
|
|
||||||
{
|
|
||||||
tooltips = GuiHelper.getTooltip(stack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,92 +0,0 @@
|
||||||
package WayofTime.bloodmagic.compat.guideapi.page.recipeRenderer;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
|
||||||
import WayofTime.bloodmagic.api.recipe.ShapelessBloodOrbRecipe;
|
|
||||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
|
||||||
import amerifrance.guideapi.api.impl.Book;
|
|
||||||
import amerifrance.guideapi.api.impl.abstraction.CategoryAbstract;
|
|
||||||
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
|
|
||||||
import amerifrance.guideapi.api.util.GuiHelper;
|
|
||||||
import amerifrance.guideapi.api.util.TextHelper;
|
|
||||||
import amerifrance.guideapi.gui.GuiBase;
|
|
||||||
import amerifrance.guideapi.page.reciperenderer.BasicRecipeRenderer;
|
|
||||||
|
|
||||||
public class ShapelessBloodOrbRecipeRenderer extends BasicRecipeRenderer<ShapelessBloodOrbRecipe>
|
|
||||||
{
|
|
||||||
|
|
||||||
public ShapelessBloodOrbRecipeRenderer(ShapelessBloodOrbRecipe recipe)
|
|
||||||
{
|
|
||||||
super(recipe);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
|
||||||
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRendererObj)
|
|
||||||
{
|
|
||||||
super.draw(book, category, entry, guiLeft, guiTop, mouseX, mouseY, guiBase, fontRendererObj);
|
|
||||||
for (int y = 0; y < 3; y++)
|
|
||||||
{
|
|
||||||
for (int x = 0; x < 3; x++)
|
|
||||||
{
|
|
||||||
int i = 3 * y + x;
|
|
||||||
if (i >= recipe.getRecipeSize())
|
|
||||||
{
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
int stackX = (x + 1) * 17 + (guiLeft + 29);
|
|
||||||
int stackY = (y + 1) * 17 + (guiTop + 40);
|
|
||||||
Object component = recipe.getInput().get(i);
|
|
||||||
if (component != null)
|
|
||||||
{
|
|
||||||
if (component instanceof ItemStack)
|
|
||||||
{
|
|
||||||
ItemStack input = (ItemStack) component;
|
|
||||||
if (input.getItemDamage() == OreDictionary.WILDCARD_VALUE)
|
|
||||||
input.setItemDamage(0);
|
|
||||||
|
|
||||||
GuiHelper.drawItemStack((ItemStack) component, stackX, stackY);
|
|
||||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
|
|
||||||
{
|
|
||||||
tooltips = GuiHelper.getTooltip((ItemStack) component);
|
|
||||||
}
|
|
||||||
} else if (component instanceof Integer)
|
|
||||||
{
|
|
||||||
List<ItemStack> list = OrbRegistry.getOrbsDownToTier((Integer) component);
|
|
||||||
if (!list.isEmpty())
|
|
||||||
{
|
|
||||||
ItemStack stack = list.get(getRandomizedCycle(x + (y * 3), list.size()));
|
|
||||||
GuiHelper.drawItemStack(stack, stackX, stackY);
|
|
||||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
|
|
||||||
{
|
|
||||||
tooltips = GuiHelper.getTooltip(stack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
List<ItemStack> list = (List<ItemStack>) component;
|
|
||||||
if (!list.isEmpty())
|
|
||||||
{
|
|
||||||
ItemStack stack = list.get(getRandomizedCycle(x + (y * 3), list.size()));
|
|
||||||
GuiHelper.drawItemStack(stack, stackX, stackY);
|
|
||||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
|
|
||||||
{
|
|
||||||
tooltips = GuiHelper.getTooltip(stack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getRecipeName()
|
|
||||||
{
|
|
||||||
return TextHelper.localizeEffect("text.shapeless.crafting");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,8 +5,8 @@ import java.util.Map;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import mezz.jei.api.*;
|
import mezz.jei.api.*;
|
||||||
|
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourHandler;
|
import WayofTime.bloodmagic.api.livingArmour.LivingArmourHandler;
|
||||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||||
|
@ -29,8 +29,6 @@ import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeMaker;
|
||||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeCategory;
|
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeCategory;
|
||||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeHandler;
|
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeHandler;
|
||||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeMaker;
|
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeMaker;
|
||||||
import WayofTime.bloodmagic.compat.jei.orb.ShapedOrbRecipeHandler;
|
|
||||||
import WayofTime.bloodmagic.compat.jei.orb.ShapelessOrbRecipeHandler;
|
|
||||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||||
|
|
||||||
|
@ -44,9 +42,14 @@ public class BloodMagicPlugin extends BlankModPlugin
|
||||||
{
|
{
|
||||||
jeiHelper = registry.getJeiHelpers();
|
jeiHelper = registry.getJeiHelpers();
|
||||||
|
|
||||||
registry.addRecipeCategories(new AltarRecipeCategory(), new BindingRecipeCategory(), new AlchemyArrayCraftingCategory(), new TartaricForgeRecipeCategory(), new AlchemyTableRecipeCategory(), new ArmourDowngradeRecipeCategory());
|
registry.addRecipeHandlers(
|
||||||
|
new AltarRecipeHandler(),
|
||||||
registry.addRecipeHandlers(new AltarRecipeHandler(), new BindingRecipeHandler(), new AlchemyArrayCraftingRecipeHandler(), new TartaricForgeRecipeHandler(), new AlchemyTableRecipeHandler(), new ArmourDowngradeRecipeHandler(), new ShapedOrbRecipeHandler(), new ShapelessOrbRecipeHandler());
|
new BindingRecipeHandler(),
|
||||||
|
new AlchemyArrayCraftingRecipeHandler(),
|
||||||
|
new TartaricForgeRecipeHandler(),
|
||||||
|
new AlchemyTableRecipeHandler(),
|
||||||
|
new ArmourDowngradeRecipeHandler()
|
||||||
|
);
|
||||||
|
|
||||||
registry.addRecipes(AltarRecipeMaker.getRecipes());
|
registry.addRecipes(AltarRecipeMaker.getRecipes());
|
||||||
registry.addRecipes(BindingRecipeMaker.getRecipes());
|
registry.addRecipes(BindingRecipeMaker.getRecipes());
|
||||||
|
@ -55,14 +58,8 @@ public class BloodMagicPlugin extends BlankModPlugin
|
||||||
registry.addRecipes(AlchemyTableRecipeMaker.getRecipes());
|
registry.addRecipes(AlchemyTableRecipeMaker.getRecipes());
|
||||||
registry.addRecipes(ArmourDowngradeRecipeMaker.getRecipes());
|
registry.addRecipes(ArmourDowngradeRecipeMaker.getRecipes());
|
||||||
|
|
||||||
registry.addDescription(new ItemStack(RegistrarBloodMagicItems.ALTAR_MAKER), "jei.bloodmagic.desc.altarBuilder");
|
registry.addIngredientInfo(new ItemStack(RegistrarBloodMagicItems.ALTAR_MAKER), ItemStack.class, "jei.bloodmagic.desc.altarBuilder");
|
||||||
registry.addDescription(new ItemStack(RegistrarBloodMagicItems.MONSTER_SOUL), "jei.bloodmagic.desc.demonicWill");
|
registry.addIngredientInfo(new ItemStack(RegistrarBloodMagicItems.MONSTER_SOUL), ItemStack.class, "jei.bloodmagic.desc.demonicWill");
|
||||||
|
|
||||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_LIGHT));
|
|
||||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.SPECTRAL));
|
|
||||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.PHANTOM));
|
|
||||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.ALCHEMY_ARRAY));
|
|
||||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.DIMENSIONAL_PORTAL, 1, OreDictionary.WILDCARD_VALUE));
|
|
||||||
|
|
||||||
for (Map.Entry<String, Integer> entry : LivingArmourHandler.upgradeMaxLevelMap.entrySet())
|
for (Map.Entry<String, Integer> entry : LivingArmourHandler.upgradeMaxLevelMap.entrySet())
|
||||||
{
|
{
|
||||||
|
@ -73,22 +70,37 @@ public class BloodMagicPlugin extends BlankModPlugin
|
||||||
ItemStack stack = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
|
ItemStack stack = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
|
||||||
LivingUpgrades.setKey(stack, key);
|
LivingUpgrades.setKey(stack, key);
|
||||||
LivingUpgrades.setLevel(stack, i);
|
LivingUpgrades.setLevel(stack, i);
|
||||||
jeiHelper.getItemBlacklist().addItemToBlacklist(stack);
|
jeiHelper.getIngredientBlacklist().addIngredientToBlacklist(stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
registry.addRecipeClickArea(GuiSoulForge.class, 115, 15, 16, 88, Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
registry.addRecipeClickArea(GuiSoulForge.class, 115, 15, 16, 88, Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
||||||
|
|
||||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.ALTAR), Constants.Compat.JEI_CATEGORY_ALTAR);
|
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.ALTAR), Constants.Compat.JEI_CATEGORY_ALTAR);
|
||||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.SOUL_FORGE), Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.SOUL_FORGE), Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
||||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY);
|
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY);
|
||||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_BINDING);
|
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_BINDING);
|
||||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.ALCHEMY_TABLE), Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
|
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.ALCHEMY_TABLE), Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
|
||||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_CONTROLLER), Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE);
|
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_CONTROLLER), Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
|
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
|
||||||
subtypeRegistry.useNbtForSubtypes(RegistrarBloodMagicItems.UPGRADE_TOME);
|
subtypeRegistry.useNbtForSubtypes(RegistrarBloodMagicItems.UPGRADE_TOME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerCategories(IRecipeCategoryRegistration registry) {
|
||||||
|
if (jeiHelper == null)
|
||||||
|
jeiHelper = registry.getJeiHelpers();
|
||||||
|
|
||||||
|
registry.addRecipeCategories(
|
||||||
|
new AltarRecipeCategory(),
|
||||||
|
new BindingRecipeCategory(),
|
||||||
|
new AlchemyArrayCraftingCategory(),
|
||||||
|
new TartaricForgeRecipeCategory(),
|
||||||
|
new AlchemyTableRecipeCategory(),
|
||||||
|
new ArmourDowngradeRecipeCategory()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.compat.jei.alchemyArray;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import mezz.jei.api.gui.IDrawable;
|
import mezz.jei.api.gui.IDrawable;
|
||||||
import mezz.jei.api.gui.IRecipeLayout;
|
import mezz.jei.api.gui.IRecipeLayout;
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
|
@ -74,4 +75,9 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
|
||||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getModName() {
|
||||||
|
return BloodMagic.NAME;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class AlchemyArrayCraftingRecipeMaker
|
||||||
ItemStack catalyst = entry.getKey().toStack();
|
ItemStack catalyst = entry.getKey().toStack();
|
||||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectCrafting)
|
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectCrafting)
|
||||||
{
|
{
|
||||||
ItemStack output = ((AlchemyArrayEffectCrafting) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).getOutputStack();
|
ItemStack output = ((AlchemyArrayEffectCrafting) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).outputStack;
|
||||||
|
|
||||||
AlchemyArrayCraftingRecipeJEI recipe = new AlchemyArrayCraftingRecipeJEI(input, catalyst, output);
|
AlchemyArrayCraftingRecipeJEI recipe = new AlchemyArrayCraftingRecipeJEI(input, catalyst, output);
|
||||||
recipes.add(recipe);
|
recipes.add(recipe);
|
||||||
|
|
|
@ -2,6 +2,7 @@ package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||||
import mezz.jei.api.gui.IDrawable;
|
import mezz.jei.api.gui.IDrawable;
|
||||||
|
@ -75,4 +76,9 @@ public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTable
|
||||||
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||||
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getModName() {
|
||||||
|
return BloodMagic.NAME;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import java.util.List;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import lombok.Getter;
|
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -14,7 +13,6 @@ import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
|
||||||
public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
||||||
{
|
{
|
||||||
@Getter
|
|
||||||
private AlchemyTableRecipe recipe;
|
private AlchemyTableRecipe recipe;
|
||||||
|
|
||||||
public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe)
|
public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe)
|
||||||
|
@ -41,4 +39,8 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AlchemyTableRecipe getRecipe() {
|
||||||
|
return recipe;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import mezz.jei.api.gui.IDrawable;
|
import mezz.jei.api.gui.IDrawable;
|
||||||
import mezz.jei.api.gui.IRecipeLayout;
|
import mezz.jei.api.gui.IRecipeLayout;
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
|
@ -72,4 +73,9 @@ public class AltarRecipeCategory implements IRecipeCategory
|
||||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getModName() {
|
||||||
|
return BloodMagic.NAME;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
||||||
@Override
|
@Override
|
||||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
|
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
minecraft.fontRendererObj.drawString(infoString[0], 90 - minecraft.fontRendererObj.getStringWidth(infoString[0]) / 2, 0, Color.gray.getRGB());
|
minecraft.fontRenderer.drawString(infoString[0], 90 - minecraft.fontRenderer.getStringWidth(infoString[0]) / 2, 0, Color.gray.getRGB());
|
||||||
minecraft.fontRendererObj.drawString(infoString[1], 90 - minecraft.fontRendererObj.getStringWidth(infoString[1]) / 2, 10, Color.gray.getRGB());
|
minecraft.fontRenderer.drawString(infoString[1], 90 - minecraft.fontRenderer.getStringWidth(infoString[1]) / 2, 10, Color.gray.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||||
import mezz.jei.api.gui.IDrawable;
|
import mezz.jei.api.gui.IDrawable;
|
||||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||||
|
@ -94,4 +95,9 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory
|
||||||
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getModName() {
|
||||||
|
return BloodMagic.NAME;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import lombok.Getter;
|
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -14,7 +13,6 @@ import java.util.List;
|
||||||
|
|
||||||
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
|
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
|
||||||
{
|
{
|
||||||
@Getter
|
|
||||||
private LivingArmourDowngradeRecipe recipe;
|
private LivingArmourDowngradeRecipe recipe;
|
||||||
|
|
||||||
public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe)
|
public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe)
|
||||||
|
@ -31,4 +29,8 @@ public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
|
||||||
LivingUpgrades.setUpgrade(upgradeStack, recipe.getRecipeOutput());
|
LivingUpgrades.setUpgrade(upgradeStack, recipe.getRecipeOutput());
|
||||||
ingredients.setOutput(ItemStack.class, upgradeStack);
|
ingredients.setOutput(ItemStack.class, upgradeStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LivingArmourDowngradeRecipe getRecipe() {
|
||||||
|
return recipe;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.compat.jei.binding;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import mezz.jei.api.gui.IDrawable;
|
import mezz.jei.api.gui.IDrawable;
|
||||||
import mezz.jei.api.gui.IRecipeLayout;
|
import mezz.jei.api.gui.IRecipeLayout;
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
|
@ -72,4 +73,9 @@ public class BindingRecipeCategory implements IRecipeCategory
|
||||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getModName() {
|
||||||
|
return BloodMagic.NAME;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class BindingRecipeMaker
|
||||||
ItemStack catalyst = entry.getKey().toStack();
|
ItemStack catalyst = entry.getKey().toStack();
|
||||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectBinding)
|
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectBinding)
|
||||||
{
|
{
|
||||||
ItemStack output = ((AlchemyArrayEffectBinding) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).getOutputStack();
|
ItemStack output = ((AlchemyArrayEffectBinding) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).outputStack;
|
||||||
|
|
||||||
BindingRecipeJEI recipe = new BindingRecipeJEI(input, catalyst, output);
|
BindingRecipeJEI recipe = new BindingRecipeJEI(input, catalyst, output);
|
||||||
recipes.add(recipe);
|
recipes.add(recipe);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||||
import mezz.jei.api.gui.IDrawable;
|
import mezz.jei.api.gui.IDrawable;
|
||||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||||
|
@ -101,4 +102,9 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory
|
||||||
craftingGridHelper.setInputs(guiItemStacks, inputs);
|
craftingGridHelper.setInputs(guiItemStacks, inputs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getModName() {
|
||||||
|
return BloodMagic.NAME;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import java.util.List;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||||
import lombok.Getter;
|
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -16,9 +15,7 @@ import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
|
||||||
public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
||||||
{
|
{
|
||||||
@Getter
|
|
||||||
private TartaricForgeRecipe recipe;
|
private TartaricForgeRecipe recipe;
|
||||||
@Getter
|
|
||||||
private List<ItemStack> validGems = new ArrayList<ItemStack>();
|
private List<ItemStack> validGems = new ArrayList<ItemStack>();
|
||||||
|
|
||||||
public TartaricForgeRecipeJEI(TartaricForgeRecipe recipe)
|
public TartaricForgeRecipeJEI(TartaricForgeRecipe recipe)
|
||||||
|
@ -70,4 +67,12 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
||||||
this.minSouls = minSouls;
|
this.minSouls = minSouls;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TartaricForgeRecipe getRecipe() {
|
||||||
|
return recipe;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ItemStack> getValidGems() {
|
||||||
|
return validGems;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
package WayofTime.bloodmagic.compat.jei.orb;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
import mezz.jei.api.recipe.IRecipeHandler;
|
|
||||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
|
||||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
|
||||||
import WayofTime.bloodmagic.api.recipe.ShapedBloodOrbRecipe;
|
|
||||||
|
|
||||||
public class ShapedOrbRecipeHandler implements IRecipeHandler<ShapedBloodOrbRecipe>
|
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
|
||||||
public Class<ShapedBloodOrbRecipe> getRecipeClass()
|
|
||||||
{
|
|
||||||
return ShapedBloodOrbRecipe.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
public String getRecipeCategoryUid(@Nonnull ShapedBloodOrbRecipe recipe)
|
|
||||||
{
|
|
||||||
return VanillaRecipeCategoryUid.CRAFTING;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
|
||||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ShapedBloodOrbRecipe recipe)
|
|
||||||
{
|
|
||||||
return new ShapedOrbRecipeJEI(Arrays.asList(recipe.getInput()), recipe.getTier(), recipe.getRecipeOutput());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isRecipeValid(@Nonnull ShapedBloodOrbRecipe recipe)
|
|
||||||
{
|
|
||||||
return recipe.getInput().length > 0;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,68 +0,0 @@
|
||||||
package WayofTime.bloodmagic.compat.jei.orb;
|
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
|
||||||
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
|
||||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
|
||||||
import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
|
||||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
|
||||||
|
|
||||||
public class ShapedOrbRecipeJEI extends BlankRecipeWrapper implements IShapedCraftingRecipeWrapper
|
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
private final List inputs;
|
|
||||||
|
|
||||||
private final int tier;
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
private final ItemStack output;
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public ShapedOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output)
|
|
||||||
{
|
|
||||||
ArrayList inputList = new ArrayList(input);
|
|
||||||
|
|
||||||
for (Object object : inputList)
|
|
||||||
if (object instanceof Integer)
|
|
||||||
inputList.set(inputList.indexOf(object), OrbRegistry.getOrbsDownToTier((Integer) object));
|
|
||||||
|
|
||||||
this.inputs = inputList;
|
|
||||||
this.tier = tier;
|
|
||||||
this.output = output;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getWidth()
|
|
||||||
{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getHeight()
|
|
||||||
{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getIngredients(IIngredients ingredients) {
|
|
||||||
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(inputs);
|
|
||||||
ingredients.setInputLists(ItemStack.class, expanded);
|
|
||||||
ingredients.setOutput(ItemStack.class, output);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
|
||||||
String draw = TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier));
|
|
||||||
minecraft.fontRendererObj.drawString(draw, 72 - minecraft.fontRendererObj.getStringWidth(draw) / 2, 10, Color.gray.getRGB());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
package WayofTime.bloodmagic.compat.jei.orb;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
import mezz.jei.api.recipe.IRecipeHandler;
|
|
||||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
|
||||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
|
||||||
import WayofTime.bloodmagic.api.recipe.ShapelessBloodOrbRecipe;
|
|
||||||
|
|
||||||
public class ShapelessOrbRecipeHandler implements IRecipeHandler<ShapelessBloodOrbRecipe>
|
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
|
||||||
public Class<ShapelessBloodOrbRecipe> getRecipeClass()
|
|
||||||
{
|
|
||||||
return ShapelessBloodOrbRecipe.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRecipeCategoryUid(@Nonnull ShapelessBloodOrbRecipe recipe)
|
|
||||||
{
|
|
||||||
return VanillaRecipeCategoryUid.CRAFTING;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
|
||||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ShapelessBloodOrbRecipe recipe)
|
|
||||||
{
|
|
||||||
return new ShapelessOrbRecipeJEI(recipe.getInput(), recipe.getTier(), recipe.getRecipeOutput());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isRecipeValid(@Nonnull ShapelessBloodOrbRecipe recipe)
|
|
||||||
{
|
|
||||||
return recipe.getInput().size() > 0;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,58 +0,0 @@
|
||||||
package WayofTime.bloodmagic.compat.jei.orb;
|
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
|
||||||
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
|
||||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
|
||||||
import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
|
||||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
|
||||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
|
||||||
|
|
||||||
public class ShapelessOrbRecipeJEI extends BlankRecipeWrapper implements ICraftingRecipeWrapper
|
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
private final List inputs;
|
|
||||||
private final int tier;
|
|
||||||
@Nonnull
|
|
||||||
private final ItemStack output;
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public ShapelessOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output)
|
|
||||||
{
|
|
||||||
ArrayList inputList = new ArrayList(input);
|
|
||||||
|
|
||||||
for (Object object : inputList)
|
|
||||||
if (object instanceof Integer)
|
|
||||||
inputList.set(inputList.indexOf(object), OrbRegistry.getOrbsDownToTier((Integer) object));
|
|
||||||
|
|
||||||
this.inputs = inputList;
|
|
||||||
this.tier = tier;
|
|
||||||
this.output = output;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getIngredients(IIngredients ingredients) {
|
|
||||||
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(inputs);
|
|
||||||
ingredients.setInputLists(ItemStack.class, expanded);
|
|
||||||
ingredients.setOutput(ItemStack.class, output);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
|
|
||||||
{
|
|
||||||
String draw = TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier));
|
|
||||||
minecraft.fontRendererObj.drawString(draw, 72 - minecraft.fontRendererObj.getStringWidth(draw) / 2, 10, Color.gray.getRGB());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -25,7 +25,7 @@ public class StorageBlockCraftingManager
|
||||||
|
|
||||||
public void addStorageBlockRecipes()
|
public void addStorageBlockRecipes()
|
||||||
{
|
{
|
||||||
this.recipes = new StorageBlockCraftingRecipeAssimilator().getPackingRecipes();
|
// this.recipes = new StorageBlockCraftingRecipeAssimilator().getPackingRecipes();
|
||||||
|
|
||||||
BloodMagic.instance.logger.info("Total number of compression recipes: " + this.recipes.size());
|
BloodMagic.instance.logger.info("Total number of compression recipes: " + this.recipes.size());
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,285 +16,285 @@ import java.util.*;
|
||||||
|
|
||||||
public class StorageBlockCraftingRecipeAssimilator
|
public class StorageBlockCraftingRecipeAssimilator
|
||||||
{
|
{
|
||||||
public static final List<Class> ignore = new ArrayList<Class>();
|
// public static final List<Class> ignore = new ArrayList<Class>();
|
||||||
|
//
|
||||||
public List<IRecipe> getPackingRecipes()
|
// public List<IRecipe> getPackingRecipes()
|
||||||
{
|
// {
|
||||||
// grab all recipes potentially suitable for packing or unpacking
|
// // grab all recipes potentially suitable for packing or unpacking
|
||||||
|
//
|
||||||
List<PackingRecipe> packingRecipes = new LinkedList<PackingRecipe>();
|
// List<PackingRecipe> packingRecipes = new LinkedList<PackingRecipe>();
|
||||||
List<IRecipe> unpackingRecipes = new ArrayList<IRecipe>();
|
// List<IRecipe> unpackingRecipes = new ArrayList<IRecipe>();
|
||||||
|
//
|
||||||
for (IRecipe recipe : getCraftingRecipes())
|
// for (IRecipe recipe : getCraftingRecipes())
|
||||||
{
|
// {
|
||||||
if (ignore.contains(recipe.getClass()))
|
// if (ignore.contains(recipe.getClass()))
|
||||||
continue;
|
// continue;
|
||||||
|
//
|
||||||
ItemStack output = recipe.getRecipeOutput();
|
// ItemStack output = recipe.getRecipeOutput();
|
||||||
if (output.isEmpty())
|
// if (output.isEmpty())
|
||||||
continue;
|
// continue;
|
||||||
|
//
|
||||||
if (output.getCount() == 1)
|
// if (output.getCount() == 1)
|
||||||
{
|
// {
|
||||||
PackingRecipe packingRecipe = getPackingRecipe(recipe);
|
// PackingRecipe packingRecipe = getPackingRecipe(recipe);
|
||||||
|
//
|
||||||
if (packingRecipe != null)
|
// if (packingRecipe != null)
|
||||||
{
|
// {
|
||||||
packingRecipes.add(packingRecipe);
|
// packingRecipes.add(packingRecipe);
|
||||||
}
|
// }
|
||||||
} else if ((output.getCount() == 4 || output.getCount() == 9) && recipe.canFit(1, 1))
|
// } else if ((output.getCount() == 4 || output.getCount() == 9) && recipe.canFit(1, 1))
|
||||||
{
|
// {
|
||||||
unpackingRecipes.add(recipe);
|
// unpackingRecipes.add(recipe);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// grab all packing recipes which accept the output of any of the
|
// // grab all packing recipes which accept the output of any of the
|
||||||
// unpacking recipes
|
// // unpacking recipes
|
||||||
|
//
|
||||||
Container container = makeDummyContainer();
|
// Container container = makeDummyContainer();
|
||||||
InventoryCrafting inventoryUnpack = new InventoryCrafting(container, 2, 2);
|
// InventoryCrafting inventoryUnpack = new InventoryCrafting(container, 2, 2);
|
||||||
InventoryCrafting inventory2x2 = new InventoryCrafting(container, 2, 2);
|
// InventoryCrafting inventory2x2 = new InventoryCrafting(container, 2, 2);
|
||||||
InventoryCrafting inventory3x3 = new InventoryCrafting(container, 3, 3);
|
// InventoryCrafting inventory3x3 = new InventoryCrafting(container, 3, 3);
|
||||||
World world = null; // TODO: use a proper dummy world?
|
// World world = null; // TODO: use a proper dummy world?
|
||||||
|
//
|
||||||
List<IRecipe> ret = new ArrayList<IRecipe>();
|
// List<IRecipe> ret = new ArrayList<IRecipe>();
|
||||||
|
//
|
||||||
for (IRecipe recipeUnpack : unpackingRecipes)
|
// for (IRecipe recipeUnpack : unpackingRecipes)
|
||||||
{
|
// {
|
||||||
if (ignore.contains(recipeUnpack.getClass()))
|
// if (ignore.contains(recipeUnpack.getClass()))
|
||||||
continue;
|
// continue;
|
||||||
|
//
|
||||||
ItemStack unpacked = recipeUnpack.getRecipeOutput();
|
// ItemStack unpacked = recipeUnpack.getRecipeOutput();
|
||||||
InventoryCrafting inventory = null;
|
// InventoryCrafting inventory = null;
|
||||||
|
//
|
||||||
for (Iterator<PackingRecipe> it = packingRecipes.iterator(); it.hasNext();)
|
// for (Iterator<PackingRecipe> it = packingRecipes.iterator(); it.hasNext();)
|
||||||
{
|
// {
|
||||||
PackingRecipe recipePack = it.next();
|
// PackingRecipe recipePack = it.next();
|
||||||
|
//
|
||||||
// check if the packing recipe accepts the unpacking recipe's output
|
// // check if the packing recipe accepts the unpacking recipe's output
|
||||||
|
//
|
||||||
boolean matched = false;
|
// boolean matched = false;
|
||||||
|
//
|
||||||
if (recipePack.possibleInputs != null)
|
// if (recipePack.possibleInputs != null)
|
||||||
{
|
// {
|
||||||
// the recipe could be parsed, use its inputs directly since that's faster verify recipe size
|
// // the recipe could be parsed, use its inputs directly since that's faster verify recipe size
|
||||||
|
//
|
||||||
if (recipePack.inputCount != unpacked.getCount())
|
// if (recipePack.inputCount != unpacked.getCount())
|
||||||
continue;
|
// continue;
|
||||||
|
//
|
||||||
// check if any of the input options matches the unpacked
|
// // check if any of the input options matches the unpacked
|
||||||
// item stack
|
// // item stack
|
||||||
|
//
|
||||||
for (ItemStack stack : recipePack.possibleInputs)
|
// for (ItemStack stack : recipePack.possibleInputs)
|
||||||
{
|
// {
|
||||||
if (areInputsIdentical(unpacked, stack))
|
// if (areInputsIdentical(unpacked, stack))
|
||||||
{
|
// {
|
||||||
matched = true;
|
// matched = true;
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} else
|
// } else
|
||||||
{
|
// {
|
||||||
// unknown IRecipe, check through the recipe conventionally verify recipe size for 3x3 to skip anything smaller quickly
|
// // unknown IRecipe, check through the recipe conventionally verify recipe size for 3x3 to skip anything smaller quickly
|
||||||
|
//
|
||||||
if (unpacked.getCount() == 9 && recipePack.recipe.getIngredients().size() < 9)
|
// if (unpacked.getCount() == 9 && recipePack.recipe.getIngredients().size() < 9)
|
||||||
continue;
|
// continue;
|
||||||
|
//
|
||||||
// initialize inventory late, but only once per unpack recipe
|
// // initialize inventory late, but only once per unpack recipe
|
||||||
|
//
|
||||||
if (inventory == null)
|
// if (inventory == null)
|
||||||
{
|
// {
|
||||||
if (unpacked.getCount() == 4)
|
// if (unpacked.getCount() == 4)
|
||||||
{
|
// {
|
||||||
inventory = inventory2x2;
|
// inventory = inventory2x2;
|
||||||
} else
|
// } else
|
||||||
{
|
// {
|
||||||
inventory = inventory3x3;
|
// inventory = inventory3x3;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
for (int i = 0; i < unpacked.getCount(); i++)
|
// for (int i = 0; i < unpacked.getCount(); i++)
|
||||||
{
|
// {
|
||||||
inventory.setInventorySlotContents(i, unpacked.copy());
|
// inventory.setInventorySlotContents(i, unpacked.copy());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// check if the packing recipe accepts the unpacked item
|
// // check if the packing recipe accepts the unpacked item
|
||||||
// stack
|
// // stack
|
||||||
|
//
|
||||||
matched = recipePack.recipe.matches(inventory, world);
|
// matched = recipePack.recipe.matches(inventory, world);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (matched)
|
// if (matched)
|
||||||
{
|
// {
|
||||||
// check if the unpacking recipe accepts the packing
|
// // check if the unpacking recipe accepts the packing
|
||||||
// recipe's output
|
// // recipe's output
|
||||||
|
//
|
||||||
ItemStack packOutput = recipePack.recipe.getRecipeOutput();
|
// ItemStack packOutput = recipePack.recipe.getRecipeOutput();
|
||||||
inventoryUnpack.setInventorySlotContents(0, packOutput.copy());
|
// inventoryUnpack.setInventorySlotContents(0, packOutput.copy());
|
||||||
|
//
|
||||||
if (recipeUnpack.matches(inventoryUnpack, world))
|
// if (recipeUnpack.matches(inventoryUnpack, world))
|
||||||
{
|
// {
|
||||||
ret.add(recipePack.recipe);
|
// ret.add(recipePack.recipe);
|
||||||
it.remove();
|
// it.remove();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
return ret;
|
// return ret;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@SuppressWarnings("unchecked")
|
// @SuppressWarnings("unchecked")
|
||||||
private List<IRecipe> getCraftingRecipes()
|
// private List<IRecipe> getCraftingRecipes()
|
||||||
{
|
// {
|
||||||
return ForgeRegistries.RECIPES.getValues();
|
// return ForgeRegistries.RECIPES.getValues();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private Container makeDummyContainer()
|
// private Container makeDummyContainer()
|
||||||
{
|
// {
|
||||||
return new Container()
|
// return new Container()
|
||||||
{
|
// {
|
||||||
@Override
|
// @Override
|
||||||
public boolean canInteractWith(EntityPlayer player)
|
// public boolean canInteractWith(EntityPlayer player)
|
||||||
{
|
// {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private PackingRecipe getPackingRecipe(IRecipe recipe)
|
// private PackingRecipe getPackingRecipe(IRecipe recipe)
|
||||||
{
|
// {
|
||||||
if (recipe.getIngredients().size() < 4)
|
// if (recipe.getIngredients().size() < 4)
|
||||||
return null;
|
// return null;
|
||||||
|
//
|
||||||
List<Ingredient> inputs = recipe.getIngredients();
|
// List<Ingredient> inputs = recipe.getIngredients();
|
||||||
|
//
|
||||||
// check if the recipe inputs are size 4 or 9
|
// // check if the recipe inputs are size 4 or 9
|
||||||
|
//
|
||||||
int count = 0;
|
// int count = 0;
|
||||||
|
//
|
||||||
for (Object o : inputs)
|
// for (Object o : inputs)
|
||||||
{
|
// {
|
||||||
if (o != null)
|
// if (o != null)
|
||||||
count++;
|
// count++;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (count != 4 && count != 9)
|
// if (count != 4 && count != 9)
|
||||||
return null;
|
// return null;
|
||||||
|
//
|
||||||
// grab identical inputs
|
// // grab identical inputs
|
||||||
|
//
|
||||||
List<Ingredient> identicalInputs = getIdenticalInputs(inputs);
|
// List<Ingredient> identicalInputs = getIdenticalInputs(inputs);
|
||||||
if (identicalInputs == null)
|
// if (identicalInputs == null)
|
||||||
return null;
|
// return null;
|
||||||
|
//
|
||||||
return new PackingRecipe(recipe, identicalInputs, count);
|
// return new PackingRecipe(recipe, identicalInputs, count);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* Determine the item stacks from the provided inputs which are suitable for
|
// * Determine the item stacks from the provided inputs which are suitable for
|
||||||
* every input element.
|
// * every input element.
|
||||||
*
|
// *
|
||||||
* @param inputs
|
// * @param inputs
|
||||||
* List of all inputs, null elements are being ignored.
|
// * List of all inputs, null elements are being ignored.
|
||||||
* @return List List of all options.
|
// * @return List List of all options.
|
||||||
*/
|
// */
|
||||||
@SuppressWarnings("unchecked")
|
// @SuppressWarnings("unchecked")
|
||||||
private List<Ingredient> getIdenticalInputs(List<Ingredient> inputs)
|
// private List<Ingredient> getIdenticalInputs(List<Ingredient> inputs)
|
||||||
{
|
// {
|
||||||
List<Ingredient> options = null;
|
// List<Ingredient> options = null;
|
||||||
|
//
|
||||||
for (Ingredient input : inputs)
|
// for (Ingredient input : inputs)
|
||||||
{
|
// {
|
||||||
if (input == null)
|
// if (input == null)
|
||||||
continue;
|
// continue;
|
||||||
|
//
|
||||||
List<ItemStack> offers;
|
// List<ItemStack> offers;
|
||||||
|
//
|
||||||
if (input. instanceof ItemStack)
|
// if (input. instanceof ItemStack)
|
||||||
{
|
// {
|
||||||
offers = Collections.singletonList((ItemStack) input);
|
// offers = Collections.singletonList((ItemStack) input);
|
||||||
} else if (input instanceof List)
|
// } else if (input instanceof List)
|
||||||
{
|
// {
|
||||||
offers = (List<ItemStack>) input;
|
// offers = (List<ItemStack>) input;
|
||||||
|
//
|
||||||
if (offers.isEmpty())
|
// if (offers.isEmpty())
|
||||||
return null;
|
// return null;
|
||||||
} else
|
// } else
|
||||||
{
|
// {
|
||||||
throw new RuntimeException("invalid input: " + input.getClass());
|
// throw new RuntimeException("invalid input: " + input.getClass());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (options == null)
|
// if (options == null)
|
||||||
{
|
// {
|
||||||
options = new ArrayList<ItemStack>(offers);
|
// options = new ArrayList<ItemStack>(offers);
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
for (Iterator<ItemStack> it = options.iterator(); it.hasNext();)
|
// for (Iterator<ItemStack> it = options.iterator(); it.hasNext();)
|
||||||
{
|
// {
|
||||||
ItemStack stackReq = it.next();
|
// ItemStack stackReq = it.next();
|
||||||
boolean found = false;
|
// boolean found = false;
|
||||||
|
//
|
||||||
for (ItemStack stackCmp : offers)
|
// for (ItemStack stackCmp : offers)
|
||||||
{
|
// {
|
||||||
if (areInputsIdentical(stackReq, stackCmp))
|
// if (areInputsIdentical(stackReq, stackCmp))
|
||||||
{
|
// {
|
||||||
found = true;
|
// found = true;
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (!found)
|
// if (!found)
|
||||||
{
|
// {
|
||||||
it.remove();
|
// it.remove();
|
||||||
|
//
|
||||||
if (options.isEmpty())
|
// if (options.isEmpty())
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
return options;
|
// return options;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private boolean areInputsIdentical(ItemStack a, ItemStack b)
|
// private boolean areInputsIdentical(ItemStack a, ItemStack b)
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
if (a.getItem() != b.getItem())
|
// if (a.getItem() != b.getItem())
|
||||||
return false;
|
// return false;
|
||||||
|
//
|
||||||
int dmgA = a.getItemDamage();
|
// int dmgA = a.getItemDamage();
|
||||||
int dmgB = b.getItemDamage();
|
// int dmgB = b.getItemDamage();
|
||||||
|
//
|
||||||
return dmgA == dmgB || dmgA == OreDictionary.WILDCARD_VALUE || dmgB == OreDictionary.WILDCARD_VALUE;
|
// return dmgA == dmgB || dmgA == OreDictionary.WILDCARD_VALUE || dmgB == OreDictionary.WILDCARD_VALUE;
|
||||||
} catch (NullPointerException e)
|
// } catch (NullPointerException e)
|
||||||
{
|
// {
|
||||||
|
//
|
||||||
BloodMagic.instance.getLogger().error("A mod in this instance has registered an item with a null input. Known problem mods are:");
|
// BloodMagic.instance.getLogger().error("A mod in this instance has registered an item with a null input. Known problem mods are:");
|
||||||
|
//
|
||||||
// String err = "";
|
// // String err = "";
|
||||||
// for (String problem : problemMods)
|
// // for (String problem : problemMods)
|
||||||
// err += (err.length() > 0 ? ", " : "") + problem;
|
// // err += (err.length() > 0 ? ", " : "") + problem;
|
||||||
// BloodMagic.instance.getLogger().error(err);
|
// // BloodMagic.instance.getLogger().error(err);
|
||||||
|
//
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private static class PackingRecipe
|
// private static class PackingRecipe
|
||||||
{
|
// {
|
||||||
PackingRecipe(IRecipe recipe, List<ItemStack> possibleInputs, int inputCount)
|
// PackingRecipe(IRecipe recipe, List<ItemStack> possibleInputs, int inputCount)
|
||||||
{
|
// {
|
||||||
this.recipe = recipe;
|
// this.recipe = recipe;
|
||||||
this.possibleInputs = possibleInputs;
|
// this.possibleInputs = possibleInputs;
|
||||||
this.inputCount = inputCount;
|
// this.inputCount = inputCount;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
final IRecipe recipe;
|
// final IRecipe recipe;
|
||||||
final List<ItemStack> possibleInputs;
|
// final List<ItemStack> possibleInputs;
|
||||||
final int inputCount;
|
// final int inputCount;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class RegistrarBloodMagicItems
|
||||||
public static final Item SIGIL_CLAW = Items.AIR;
|
public static final Item SIGIL_CLAW = Items.AIR;
|
||||||
public static final Item SIGIL_BOUNCE = Items.AIR;
|
public static final Item SIGIL_BOUNCE = Items.AIR;
|
||||||
public static final Item SIGIL_FROST = Items.AIR;
|
public static final Item SIGIL_FROST = Items.AIR;
|
||||||
public static final Item ITEM_COMPONENT = Items.AIR;
|
public static final Item COMPONENT = Items.AIR;
|
||||||
public static final Item ITEM_DEMON_CRYSTAL = Items.AIR;
|
public static final Item ITEM_DEMON_CRYSTAL = Items.AIR;
|
||||||
public static final Item TELEPOSITION_FOCUS = Items.AIR;
|
public static final Item TELEPOSITION_FOCUS = Items.AIR;
|
||||||
public static final Item EXPERIENCE_TOME = Items.AIR;
|
public static final Item EXPERIENCE_TOME = Items.AIR;
|
||||||
|
@ -160,7 +160,7 @@ public class RegistrarBloodMagicItems
|
||||||
new ItemSigilBounce().setRegistryName("sigil_bounce"),
|
new ItemSigilBounce().setRegistryName("sigil_bounce"),
|
||||||
new ItemSigilFrost().setRegistryName("sigil_frost"),
|
new ItemSigilFrost().setRegistryName("sigil_frost"),
|
||||||
new ItemComponent().setRegistryName("component"),
|
new ItemComponent().setRegistryName("component"),
|
||||||
new ItemDemonCrystal().setRegistryName("demon_crystal"),
|
new ItemDemonCrystal().setRegistryName("item_demon_crystal"),
|
||||||
new ItemTelepositionFocus().setRegistryName("teleposition_focus"),
|
new ItemTelepositionFocus().setRegistryName("teleposition_focus"),
|
||||||
new ItemExperienceBook().setRegistryName("experience_book"),
|
new ItemExperienceBook().setRegistryName("experience_book"),
|
||||||
new ItemBloodShard().setRegistryName("blood_shard"),
|
new ItemBloodShard().setRegistryName("blood_shard"),
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package WayofTime.bloodmagic.entity.projectile;
|
package WayofTime.bloodmagic.entity.projectile;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.projectile.EntityThrowable;
|
import net.minecraft.entity.projectile.EntityThrowable;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
@ -7,7 +8,6 @@ import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.util.EnumParticleTypes;
|
import net.minecraft.util.EnumParticleTypes;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import WayofTime.bloodmagic.registry.ModPotions;
|
|
||||||
|
|
||||||
public class EntitySoulSnare extends EntityThrowable
|
public class EntitySoulSnare extends EntityThrowable
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ public class EntitySoulSnare extends EntityThrowable
|
||||||
{
|
{
|
||||||
if (result.entityHit instanceof EntityLivingBase && result.entityHit.getEntityWorld().rand.nextDouble() < 0.25)
|
if (result.entityHit instanceof EntityLivingBase && result.entityHit.getEntityWorld().rand.nextDouble() < 0.25)
|
||||||
{
|
{
|
||||||
((EntityLivingBase) result.entityHit).addPotionEffect(new PotionEffect(ModPotions.soulSnare, 300, 0));
|
((EntityLivingBase) result.entityHit).addPotionEffect(new PotionEffect(RegistrarBloodMagic.SOUL_SNARE, 300, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float) 0);
|
result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float) 0);
|
||||||
|
|
|
@ -18,6 +18,7 @@ import com.mojang.authlib.GameProfile;
|
||||||
@SuppressWarnings("EntityConstructor")
|
@SuppressWarnings("EntityConstructor")
|
||||||
public class FakePlayerBM extends FakePlayer
|
public class FakePlayerBM extends FakePlayer
|
||||||
{
|
{
|
||||||
|
|
||||||
public FakePlayerBM(WorldServer world, GameProfile name) {
|
public FakePlayerBM(WorldServer world, GameProfile name) {
|
||||||
super(world, name);
|
super(world, name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ public class FuelHandler implements IFuelHandler
|
||||||
@Override
|
@Override
|
||||||
public int getBurnTime(ItemStack fuel)
|
public int getBurnTime(ItemStack fuel)
|
||||||
{
|
{
|
||||||
if (fuel != null && fuel.getItem() == RegistrarBloodMagicItems.ITEM_COMPONENT && fuel.getMetadata() == ItemComponent.getStack(ItemComponent.SAND_COAL).getMetadata())
|
if (fuel != null && fuel.getItem() == RegistrarBloodMagicItems.COMPONENT && fuel.getMetadata() == ItemComponent.getStack(ItemComponent.SAND_COAL).getMetadata())
|
||||||
{
|
{
|
||||||
return 1600;
|
return 1600;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,13 @@ package WayofTime.bloodmagic.item;
|
||||||
import WayofTime.bloodmagic.BloodMagic;
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.NonNullList;
|
import net.minecraft.util.NonNullList;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||||
|
@ -36,19 +38,22 @@ public class ItemActivationCrystal extends ItemBindableBase implements IVariantP
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item id, CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
||||||
{
|
{
|
||||||
|
if (!isInCreativeTab(creativeTab))
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < names.length; i++)
|
for (int i = 0; i < names.length; i++)
|
||||||
list.add(new ItemStack(id, 1, i));
|
list.add(new ItemStack(this, 1, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
tooltip.add(TextHelper.localize("tooltip.bloodmagic.activationCrystal." + names[stack.getItemDamage()]));
|
tooltip.add(TextHelper.localize("tooltip.bloodmagic.activationCrystal." + names[stack.getItemDamage()]));
|
||||||
|
|
||||||
super.addInformation(stack, player, tooltip, advanced);
|
super.addInformation(stack, world, tooltip, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
||||||
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -49,7 +50,7 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
if (!stack.hasTagCompound())
|
if (!stack.hasTagCompound())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.item;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -36,7 +37,7 @@ public class ItemArcaneAshes extends Item implements IVariantProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.arcaneAshes"));
|
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.arcaneAshes"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,10 @@ import WayofTime.bloodmagic.api.impl.ItemBindable;
|
||||||
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
||||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@ -23,7 +25,7 @@ public class ItemBindableBase extends ItemBindable
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
if (!stack.hasTagCompound())
|
if (!stack.hasTagCompound())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.BloodMagic;
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.SoundEvents;
|
import net.minecraft.init.SoundEvents;
|
||||||
|
@ -96,15 +97,15 @@ public class ItemBloodOrb extends ItemBindableBase implements IBloodOrb, IBindab
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.orb.desc"));
|
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.orb.desc"));
|
||||||
|
|
||||||
BloodOrb orb = getOrb(stack);
|
BloodOrb orb = getOrb(stack);
|
||||||
if (advanced && orb != null)
|
if (flag.isAdvanced() && orb != null)
|
||||||
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.orb.owner", orb.getRegistryName()));
|
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.orb.owner", orb.getRegistryName()));
|
||||||
|
|
||||||
super.addInformation(stack, player, tooltip, advanced);
|
super.addInformation(stack, world, tooltip, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -29,10 +29,13 @@ public class ItemBloodShard extends Item implements IVariantProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item id, CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
||||||
{
|
{
|
||||||
|
if (!isInCreativeTab(creativeTab))
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < names.length; i++)
|
for (int i = 0; i < names.length; i++)
|
||||||
list.add(new ItemStack(id, 1, i));
|
list.add(new ItemStack(this, 1, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -9,6 +9,7 @@ import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||||
import WayofTime.bloodmagic.util.Utils;
|
import WayofTime.bloodmagic.util.Utils;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
@ -104,14 +105,17 @@ public class ItemBoundSword extends ItemSword implements IBindable, IActivatable
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems)
|
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> subItems)
|
||||||
{
|
{
|
||||||
subItems.add(Utils.setUnbreakable(new ItemStack(itemIn)));
|
if (!isInCreativeTab(tab))
|
||||||
|
return;
|
||||||
|
|
||||||
|
subItems.add(Utils.setUnbreakable(new ItemStack(this)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
if (!stack.hasTagCompound())
|
if (!stack.hasTagCompound())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -12,9 +12,9 @@ import WayofTime.bloodmagic.util.Utils;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.collect.ArrayListMultimap;
|
import com.google.common.collect.ArrayListMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import lombok.Getter;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
@ -47,7 +47,6 @@ import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Multiset;
|
import com.google.common.collect.Multiset;
|
||||||
|
|
||||||
@Getter
|
|
||||||
public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
|
public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
|
||||||
{
|
{
|
||||||
protected final String tooltipBase;
|
protected final String tooltipBase;
|
||||||
|
@ -72,7 +71,7 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
|
||||||
@Override
|
@Override
|
||||||
public float getStrVsBlock(ItemStack stack, IBlockState state)
|
public float getStrVsBlock(ItemStack stack, IBlockState state)
|
||||||
{
|
{
|
||||||
return getActivated(stack) ? getToolMaterial().getEfficiencyOnProperMaterial() : 1.0F;
|
return getActivated(stack) ? toolMaterial.getEfficiencyOnProperMaterial() : 1.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -82,10 +81,12 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> subItems)
|
||||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems)
|
|
||||||
{
|
{
|
||||||
subItems.add(Utils.setUnbreakable(new ItemStack(itemIn)));
|
if (isInCreativeTab(tab))
|
||||||
|
return;
|
||||||
|
|
||||||
|
subItems.add(Utils.setUnbreakable(new ItemStack(this)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -146,10 +147,10 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
|
||||||
{
|
{
|
||||||
BoundToolEvent.Charge event = new BoundToolEvent.Charge(player, stack);
|
BoundToolEvent.Charge event = new BoundToolEvent.Charge(player, stack);
|
||||||
if (MinecraftForge.EVENT_BUS.post(event))
|
if (MinecraftForge.EVENT_BUS.post(event))
|
||||||
return new ActionResult<ItemStack>(EnumActionResult.FAIL, event.result);
|
return new ActionResult<>(EnumActionResult.FAIL, event.result);
|
||||||
|
|
||||||
player.setActiveHand(hand);
|
player.setActiveHand(hand);
|
||||||
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onItemRightClick(world, player, hand);
|
return super.onItemRightClick(world, player, hand);
|
||||||
|
@ -207,7 +208,7 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
if (TextHelper.canTranslate(tooltipBase + "desc"))
|
if (TextHelper.canTranslate(tooltipBase + "desc"))
|
||||||
tooltip.add(TextHelper.localizeEffect(tooltipBase + "desc"));
|
tooltip.add(TextHelper.localizeEffect(tooltipBase + "desc"));
|
||||||
|
@ -220,7 +221,7 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
|
||||||
if (!Strings.isNullOrEmpty(getOwnerUUID(stack)))
|
if (!Strings.isNullOrEmpty(getOwnerUUID(stack)))
|
||||||
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.currentOwner", PlayerHelper.getUsernameFromStack(stack)));
|
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.currentOwner", PlayerHelper.getUsernameFromStack(stack)));
|
||||||
|
|
||||||
super.addInformation(stack, player, tooltip, advanced);
|
super.addInformation(stack, world, tooltip, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -304,4 +305,24 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTooltipBase() {
|
||||||
|
return tooltipBase;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<ItemStack, Boolean> getHeldDownMap() {
|
||||||
|
return heldDownMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<ItemStack, Integer> getHeldDownCountMap() {
|
||||||
|
return heldDownCountMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getChargeTime() {
|
||||||
|
return chargeTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package WayofTime.bloodmagic.item;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -20,7 +19,6 @@ import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||||
|
|
||||||
public class ItemComponent extends Item implements IVariantProvider
|
public class ItemComponent extends Item implements IVariantProvider
|
||||||
{
|
{
|
||||||
@Getter
|
|
||||||
private static ArrayList<String> names = new ArrayList<String>();
|
private static ArrayList<String> names = new ArrayList<String>();
|
||||||
|
|
||||||
public static final String REAGENT_WATER = "reagentWater";
|
public static final String REAGENT_WATER = "reagentWater";
|
||||||
|
@ -113,15 +111,18 @@ public class ItemComponent extends Item implements IVariantProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item id, CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
||||||
{
|
{
|
||||||
|
if (!isInCreativeTab(creativeTab))
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < names.size(); i++)
|
for (int i = 0; i < names.size(); i++)
|
||||||
list.add(new ItemStack(id, 1, i));
|
list.add(new ItemStack(this, 1, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack getStack(String name)
|
public static ItemStack getStack(String name)
|
||||||
{
|
{
|
||||||
return new ItemStack(RegistrarBloodMagicItems.ITEM_COMPONENT, 1, names.indexOf(name));
|
return new ItemStack(RegistrarBloodMagicItems.COMPONENT, 1, names.indexOf(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -140,4 +141,8 @@ public class ItemComponent extends Item implements IVariantProvider
|
||||||
|
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ArrayList<String> getNames() {
|
||||||
|
return names;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -30,7 +31,7 @@ public class ItemDemonWillGauge extends Item implements IVariantProvider, IDemon
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
tooltip.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect("tooltip.bloodmagic.willGauge"))));
|
tooltip.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect("tooltip.bloodmagic.willGauge"))));
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.item;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.SoundEvents;
|
import net.minecraft.init.SoundEvents;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -41,7 +42,7 @@ public class ItemExperienceBook extends Item implements IVariantProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.experienceTome"));
|
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.experienceTome"));
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.BloodMagic;
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -48,11 +49,14 @@ public class ItemInscriptionTool extends ItemBindableBase implements IVariantPro
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item id, CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
||||||
{
|
{
|
||||||
|
if (!isInCreativeTab(creativeTab))
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i = 1; i < EnumRuneType.values().length; i++)
|
for (int i = 1; i < EnumRuneType.values().length; i++)
|
||||||
{
|
{
|
||||||
ItemStack stack = NBTHelper.checkNBT(new ItemStack(id, 1, i));
|
ItemStack stack = NBTHelper.checkNBT(new ItemStack(this, 1, i));
|
||||||
stack.getTagCompound().setInteger(Constants.NBT.USES, 10);
|
stack.getTagCompound().setInteger(Constants.NBT.USES, 10);
|
||||||
list.add(stack);
|
list.add(stack);
|
||||||
}
|
}
|
||||||
|
@ -106,10 +110,10 @@ public class ItemInscriptionTool extends ItemBindableBase implements IVariantPro
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> list, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
list.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect("tooltip.bloodmagic.inscriber.desc"))));
|
list.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect("tooltip.bloodmagic.inscriber.desc"))));
|
||||||
super.addInformation(stack, player, list, advanced);
|
super.addInformation(stack, world, list, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -41,6 +41,9 @@ public class ItemLavaCrystal extends ItemBindableBase implements IVariantProvide
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemBurnTime(ItemStack stack) {
|
public int getItemBurnTime(ItemStack stack) {
|
||||||
|
if (!stack.hasTagCompound())
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (getOwnerUUID(stack) == null)
|
if (getOwnerUUID(stack) == null)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.google.common.collect.Lists;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.SoundEvents;
|
import net.minecraft.init.SoundEvents;
|
||||||
|
@ -117,7 +118,7 @@ public class ItemPotionFlask extends Item implements IMeshProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
PotionUtils.addPotionTooltip(stack, tooltip, 1.0F);
|
PotionUtils.addPotionTooltip(stack, tooltip, 1.0F);
|
||||||
tooltip.add("");
|
tooltip.add("");
|
||||||
|
@ -139,16 +140,11 @@ public class ItemPotionFlask extends Item implements IMeshProvider
|
||||||
@Override
|
@Override
|
||||||
public ItemMeshDefinition getMeshDefinition()
|
public ItemMeshDefinition getMeshDefinition()
|
||||||
{
|
{
|
||||||
return new ItemMeshDefinition()
|
return stack -> {
|
||||||
{
|
boolean full = true;
|
||||||
@Override
|
if (stack.hasTagCompound() && stack.getTagCompound().hasKey("empty"))
|
||||||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
full = false;
|
||||||
{
|
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + getRegistryName().getResourcePath()), "full=" + (full ? "true" : "false"));
|
||||||
boolean full = true;
|
|
||||||
if (stack.hasTagCompound() && stack.getTagCompound().hasKey("empty"))
|
|
||||||
full = false;
|
|
||||||
return new ModelResourceLocation(new ResourceLocation(BloodMagic.MODID, "item/" + getRegistryName().getResourcePath()), "full=" + (full ? "true" : "false"));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import java.util.List;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
@ -78,10 +79,13 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item id, CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
||||||
{
|
{
|
||||||
|
if (!isInCreativeTab(creativeTab))
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < names.length; i++)
|
for (int i = 0; i < names.length; i++)
|
||||||
list.add(new ItemStack(id, 1, i));
|
list.add(new ItemStack(this, 1, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -236,7 +240,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
if (!stack.hasTagCompound())
|
if (!stack.hasTagCompound())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.BloodMagic;
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -45,7 +46,7 @@ public class ItemRitualReader extends Item implements IVariantProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag tooltipFlag)
|
||||||
{
|
{
|
||||||
if (!stack.hasTagCompound())
|
if (!stack.hasTagCompound())
|
||||||
return;
|
return;
|
||||||
|
@ -65,7 +66,7 @@ public class ItemRitualReader extends Item implements IVariantProvider
|
||||||
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.extraInfo"));
|
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.extraInfo"));
|
||||||
}
|
}
|
||||||
|
|
||||||
super.addInformation(stack, player, tooltip, advanced);
|
super.addInformation(stack, world, tooltip, tooltipFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -8,6 +8,7 @@ import WayofTime.bloodmagic.ConfigHandler;
|
||||||
import WayofTime.bloodmagic.client.IMeshProvider;
|
import WayofTime.bloodmagic.client.IMeshProvider;
|
||||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
@ -59,14 +60,17 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item id, CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
||||||
{
|
{
|
||||||
|
if (!isInCreativeTab(creativeTab))
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < names.length; i++)
|
for (int i = 0; i < names.length; i++)
|
||||||
list.add(new ItemStack(id, 1, i));
|
list.add(new ItemStack(this, 1, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> list, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
list.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect("tooltip.bloodmagic.sacrificialDagger.desc"))));
|
list.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect("tooltip.bloodmagic.sacrificialDagger.desc"))));
|
||||||
|
|
||||||
|
@ -126,11 +130,11 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider
|
||||||
if (evt.shouldDrainHealth)
|
if (evt.shouldDrainHealth)
|
||||||
{
|
{
|
||||||
player.hurtResistantTime = 0;
|
player.hurtResistantTime = 0;
|
||||||
player.attackEntityFrom(BloodMagicAPI.getDamageSource(), 0.001F);
|
player.attackEntityFrom(BloodMagicAPI.damageSource, 0.001F);
|
||||||
player.setHealth(Math.max(player.getHealth() - ConfigHandler.sacrificialDaggerDamage, 0.0001f));
|
player.setHealth(Math.max(player.getHealth() - ConfigHandler.sacrificialDaggerDamage, 0.0001f));
|
||||||
if (player.getHealth() <= 0.001f)
|
if (player.getHealth() <= 0.001f)
|
||||||
{
|
{
|
||||||
player.onDeath(BloodMagicAPI.getDamageSource());
|
player.onDeath(BloodMagicAPI.damageSource);
|
||||||
player.setHealth(0);
|
player.setHealth(0);
|
||||||
}
|
}
|
||||||
// player.attackEntityFrom(BloodMagicAPI.getDamageSource(), 2.0F);
|
// player.attackEntityFrom(BloodMagicAPI.getDamageSource(), 2.0F);
|
||||||
|
|
|
@ -12,6 +12,7 @@ import WayofTime.bloodmagic.util.ChatUtil;
|
||||||
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
||||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -107,7 +108,7 @@ public class ItemSanguineBook extends Item implements IVariantProvider, IAltarMa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
if (!stack.hasTagCompound())
|
if (!stack.hasTagCompound())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3,11 +3,13 @@ package WayofTime.bloodmagic.item;
|
||||||
import WayofTime.bloodmagic.BloodMagic;
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.NonNullList;
|
import net.minecraft.util.NonNullList;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||||
|
@ -32,10 +34,13 @@ public class ItemSlate extends Item implements IVariantProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item id, CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
||||||
{
|
{
|
||||||
|
if (!isInCreativeTab(creativeTab))
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < names.length; i++)
|
for (int i = 0; i < names.length; i++)
|
||||||
list.add(new ItemStack(id, 1, i));
|
list.add(new ItemStack(this, 1, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -46,7 +51,7 @@ public class ItemSlate extends Item implements IVariantProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> list, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
list.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect("tooltip.bloodmagic.slate.desc"))));
|
list.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect("tooltip.bloodmagic.slate.desc"))));
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import WayofTime.bloodmagic.api.Constants;
|
||||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -48,10 +49,13 @@ public class ItemTelepositionFocus extends ItemBindableBase implements IVariantP
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item id, CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
||||||
{
|
{
|
||||||
|
if (!isInCreativeTab(creativeTab))
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < names.length; i++)
|
for (int i = 0; i < names.length; i++)
|
||||||
list.add(new ItemStack(id, 1, i));
|
list.add(new ItemStack(this, 1, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -72,11 +76,11 @@ public class ItemTelepositionFocus extends ItemBindableBase implements IVariantP
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
tooltip.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localize("tooltip.bloodmagic.telepositionFocus." + names[stack.getItemDamage()]))));
|
tooltip.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localize("tooltip.bloodmagic.telepositionFocus." + names[stack.getItemDamage()]))));
|
||||||
|
|
||||||
super.addInformation(stack, player, tooltip, advanced);
|
super.addInformation(stack, world, tooltip, flag);
|
||||||
|
|
||||||
if (!stack.hasTagCompound())
|
if (!stack.hasTagCompound())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||||
|
@ -88,8 +89,11 @@ public class ItemUpgradeTome extends Item implements IVariantProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubItems(Item id, CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list)
|
||||||
{
|
{
|
||||||
|
if (!isInCreativeTab(creativeTab))
|
||||||
|
return;
|
||||||
|
|
||||||
for (Entry<String, Integer> entry : LivingArmourHandler.upgradeMaxLevelMap.entrySet())
|
for (Entry<String, Integer> entry : LivingArmourHandler.upgradeMaxLevelMap.entrySet())
|
||||||
{
|
{
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
|
@ -114,9 +118,8 @@ public class ItemUpgradeTome extends Item implements IVariantProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag)
|
||||||
{
|
{
|
||||||
// tooltip.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect("tooltip.bloodmagic.livingArmour"))));
|
|
||||||
if (!stack.hasTagCompound())
|
if (!stack.hasTagCompound())
|
||||||
return;
|
return;
|
||||||
LivingArmourUpgrade upgrade = LivingUpgrades.getUpgrade(stack);
|
LivingArmourUpgrade upgrade = LivingUpgrades.getUpgrade(stack);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue