Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
|
@ -1,10 +1,17 @@
|
|||
package WayofTime.bloodmagic.util.handler.event;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.ConfigHandler;
|
||||
import WayofTime.bloodmagic.annot.Handler;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.event.AltarCraftedEvent;
|
||||
import WayofTime.bloodmagic.api.iface.IUpgradeTrainer;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||
import WayofTime.bloodmagic.block.BlockLifeEssence;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.ItemInscriptionTool;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemBanner;
|
||||
|
@ -16,38 +23,26 @@ import net.minecraftforge.fluids.Fluid;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import WayofTime.bloodmagic.ConfigHandler;
|
||||
import WayofTime.bloodmagic.annot.Handler;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.event.AltarCraftedEvent;
|
||||
import WayofTime.bloodmagic.api.iface.IUpgradeTrainer;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||
import WayofTime.bloodmagic.item.ItemInscriptionTool;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Handler
|
||||
public class CraftingHandler
|
||||
{
|
||||
public class CraftingHandler {
|
||||
|
||||
// Sets the uses of crafted Inscription Tools to 10
|
||||
@SubscribeEvent
|
||||
public void onAltarCrafted(AltarCraftedEvent event)
|
||||
{
|
||||
if (event.getOutput() == null)
|
||||
{
|
||||
public void onAltarCrafted(AltarCraftedEvent event) {
|
||||
if (event.getOutput() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getOutput().getItem() instanceof ItemInscriptionTool)
|
||||
{
|
||||
if (event.getOutput().getItem() instanceof ItemInscriptionTool) {
|
||||
NBTHelper.checkNBT(event.getOutput());
|
||||
event.getOutput().getTagCompound().setInteger(Constants.NBT.USES, 10);
|
||||
}
|
||||
|
||||
if (event.getOutput().getItem() == ForgeModContainer.getInstance().universalBucket && event.getAltarRecipe().getSyphon() == 1000)
|
||||
{
|
||||
if (event.getOutput().getItem() == ForgeModContainer.getInstance().universalBucket && event.getAltarRecipe().getSyphon() == 1000) {
|
||||
NBTTagCompound bucketTags = FluidUtil.getFilledBucket(new FluidStack(BlockLifeEssence.getLifeEssence(), Fluid.BUCKET_VOLUME)).getTagCompound();
|
||||
event.getOutput().setTagCompound(bucketTags);
|
||||
}
|
||||
|
@ -55,12 +50,9 @@ public class CraftingHandler
|
|||
|
||||
// Handles crafting of: Revealing Upgrade Tome, Elytra Upgrade Tome, Combining Upgrade Tomes, Setting Upgrade for Trainer
|
||||
@SubscribeEvent
|
||||
public void onAnvil(AnvilUpdateEvent event)
|
||||
{
|
||||
if (ConfigHandler.thaumcraftGogglesUpgrade)
|
||||
{
|
||||
if (event.getLeft().getItem() == RegistrarBloodMagicItems.LIVING_ARMOUR_HELMET && event.getRight().getItem() == Constants.Compat.THAUMCRAFT_GOGGLES && !event.getRight().isItemDamaged())
|
||||
{
|
||||
public void onAnvil(AnvilUpdateEvent event) {
|
||||
if (ConfigHandler.thaumcraftGogglesUpgrade) {
|
||||
if (event.getLeft().getItem() == RegistrarBloodMagicItems.LIVING_ARMOUR_HELMET && event.getRight().getItem() == Constants.Compat.THAUMCRAFT_GOGGLES && !event.getRight().isItemDamaged()) {
|
||||
ItemStack output = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
|
||||
output = NBTHelper.checkNBT(output);
|
||||
ItemHelper.LivingUpgrades.setKey(output, BloodMagic.MODID + ".upgrade.revealing");
|
||||
|
@ -73,10 +65,8 @@ public class CraftingHandler
|
|||
}
|
||||
}
|
||||
|
||||
if (event.getLeft().getItem() == RegistrarBloodMagicItems.SIGIL_HOLDING)
|
||||
{
|
||||
if (event.getRight().getItem() == Items.NAME_TAG)
|
||||
{
|
||||
if (event.getLeft().getItem() == RegistrarBloodMagicItems.SIGIL_HOLDING) {
|
||||
if (event.getRight().getItem() == Items.NAME_TAG) {
|
||||
ItemStack output = event.getLeft().copy();
|
||||
if (!output.hasTagCompound())
|
||||
output.setTagCompound(new NBTTagCompound());
|
||||
|
@ -88,8 +78,7 @@ public class CraftingHandler
|
|||
return;
|
||||
}
|
||||
|
||||
if (event.getRight().getItem() == Items.DYE)
|
||||
{
|
||||
if (event.getRight().getItem() == Items.DYE) {
|
||||
EnumDyeColor dyeColor = ItemBanner.getBaseColor(event.getRight());
|
||||
ItemStack output = event.getLeft().copy();
|
||||
if (!output.hasTagCompound())
|
||||
|
@ -103,8 +92,7 @@ public class CraftingHandler
|
|||
}
|
||||
}
|
||||
|
||||
if (event.getLeft().getItem() == Items.BOOK && event.getRight().getItem() == Items.ELYTRA && !event.getRight().isItemDamaged())
|
||||
{
|
||||
if (event.getLeft().getItem() == Items.BOOK && event.getRight().getItem() == Items.ELYTRA && !event.getRight().isItemDamaged()) {
|
||||
ItemStack output = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
|
||||
output = NBTHelper.checkNBT(output);
|
||||
ItemHelper.LivingUpgrades.setKey(output, BloodMagic.MODID + ".upgrade.elytra");
|
||||
|
@ -116,16 +104,13 @@ public class CraftingHandler
|
|||
return;
|
||||
}
|
||||
|
||||
if (event.getLeft().getItem() == RegistrarBloodMagicItems.UPGRADE_TOME && event.getRight().getItem() == RegistrarBloodMagicItems.UPGRADE_TOME)
|
||||
{
|
||||
if (event.getLeft().getItem() == RegistrarBloodMagicItems.UPGRADE_TOME && event.getRight().getItem() == RegistrarBloodMagicItems.UPGRADE_TOME) {
|
||||
LivingArmourUpgrade leftUpgrade = ItemHelper.LivingUpgrades.getUpgrade(event.getLeft());
|
||||
if (leftUpgrade != null && !leftUpgrade.isDowngrade() && ItemHelper.LivingUpgrades.getKey(event.getLeft()).equals(ItemHelper.LivingUpgrades.getKey(event.getRight())))
|
||||
{
|
||||
if (leftUpgrade != null && !leftUpgrade.isDowngrade() && ItemHelper.LivingUpgrades.getKey(event.getLeft()).equals(ItemHelper.LivingUpgrades.getKey(event.getRight()))) {
|
||||
int leftLevel = ItemHelper.LivingUpgrades.getLevel(event.getLeft());
|
||||
int rightLevel = ItemHelper.LivingUpgrades.getLevel(event.getRight());
|
||||
|
||||
if (leftLevel == rightLevel && leftLevel < leftUpgrade.getMaxTier() - 1)
|
||||
{
|
||||
if (leftLevel == rightLevel && leftLevel < leftUpgrade.getMaxTier() - 1) {
|
||||
ItemStack outputStack = event.getLeft().copy();
|
||||
ItemHelper.LivingUpgrades.setLevel(outputStack, leftLevel + 1);
|
||||
event.setCost(leftLevel + 2);
|
||||
|
@ -137,17 +122,14 @@ public class CraftingHandler
|
|||
}
|
||||
}
|
||||
|
||||
if (event.getLeft().getItem() instanceof IUpgradeTrainer && event.getRight().getItem() == RegistrarBloodMagicItems.UPGRADE_TOME)
|
||||
{
|
||||
if (event.getLeft().getItem() instanceof IUpgradeTrainer && event.getRight().getItem() == RegistrarBloodMagicItems.UPGRADE_TOME) {
|
||||
LivingArmourUpgrade rightUpgrade = ItemHelper.LivingUpgrades.getUpgrade(event.getRight());
|
||||
if (rightUpgrade != null)
|
||||
{
|
||||
if (rightUpgrade != null) {
|
||||
String key = ItemHelper.LivingUpgrades.getKey(event.getRight());
|
||||
ItemStack outputStack = event.getLeft().copy();
|
||||
List<String> keyList = new ArrayList<String>();
|
||||
keyList.add(key);
|
||||
if (((IUpgradeTrainer) event.getLeft().getItem()).setTrainedUpgrades(outputStack, keyList))
|
||||
{
|
||||
if (((IUpgradeTrainer) event.getLeft().getItem()).setTrainedUpgrades(outputStack, keyList)) {
|
||||
event.setCost(1);
|
||||
|
||||
event.setOutput(outputStack);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue