diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 4b915857..9ab17dd8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -828,7 +828,7 @@ public class AlchemicalWizardry blacklistAccelerators(); MinecraftForge.EVENT_BUS.register(new ModLivingDropsEvent()); - proxy.InitRendering(); + proxy.initRendering(); NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); ItemStack gunpowderStack = new ItemStack(Items.gunpowder); diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/ILimitingLogic.java b/src/main/java/WayofTime/alchemicalWizardry/api/ILimitingLogic.java index 30ab2ca8..2d7a4912 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/ILimitingLogic.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/ILimitingLogic.java @@ -2,5 +2,5 @@ package WayofTime.alchemicalWizardry.api; public interface ILimitingLogic { - public int getRoutingLimit(); + int getRoutingLimit(); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java b/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java index bf29e713..7c8fa226 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/Int3.java @@ -3,7 +3,6 @@ package WayofTime.alchemicalWizardry.api; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; - public class Int3 { public int xCoord; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java index c41cab43..d77a2e1a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/RoutingFocusParadigm.java @@ -7,9 +7,9 @@ import net.minecraft.item.ItemStack; public class RoutingFocusParadigm { - public List logicList = new LinkedList(); + public List logicList = new LinkedList(); - public List locationList = new LinkedList(); + public List locationList = new LinkedList(); public int maximumAmount = 0; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java index 6af04910..a6ca090d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemicalPotionCreationHandler.java @@ -6,7 +6,7 @@ import java.util.ArrayList; public class AlchemicalPotionCreationHandler { - public static ArrayList registeredPotionEffects = new ArrayList(); + public static ArrayList registeredPotionEffects = new ArrayList(); public static void addPotion(ItemStack itemStack, int potionID, int tickDuration) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java index dfb24596..99ad2868 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/AlchemyRecipeRegistry.java @@ -8,7 +8,7 @@ import java.util.List; public class AlchemyRecipeRegistry { - public static List recipes = new ArrayList(); + public static List recipes = new ArrayList(); public static void registerRecipe(ItemStack output, int amountNeeded, ItemStack[] recipe, int bloodOrbLevel) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java index 20b43931..429587a1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentRegistry.java @@ -9,8 +9,8 @@ import net.minecraft.item.ItemStack; public class ReagentRegistry { - public static Map reagentList = new HashMap(); - public static Map itemToReagentMap = new HashMap(); + public static Map reagentList = new HashMap(); + public static Map itemToReagentMap = new HashMap(); public static Reagent sanctusReagent; public static Reagent incendiumReagent; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java index f8583970..8923f3d3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/ReagentStack.java @@ -28,9 +28,8 @@ public class ReagentStack } int amount = tag.getInteger("amount"); - ReagentStack stack = new ReagentStack(reagent, amount); - return stack; + return new ReagentStack(reagent, amount); } public NBTTagCompound writeToNBT(NBTTagCompound tag) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java index ec4b9068..f965ab7a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/alchemy/energy/TileSegmentedReagentHandler.java @@ -30,7 +30,7 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente { super(); - this.attunedTankMap = new HashMap(); + this.attunedTankMap = new HashMap(); this.tanks = new ReagentContainer[numberOfTanks]; for (int i = 0; i < numberOfTanks; i++) { @@ -116,7 +116,7 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente ReagentStack remainingStack = resource.copy(); remainingStack.amount = maxFill - totalFill; - boolean doesReagentMatch = tanks[i].getReagent() == null ? false : tanks[i].getReagent().isReagentEqual(remainingStack); + boolean doesReagentMatch = tanks[i].getReagent() != null && tanks[i].getReagent().isReagentEqual(remainingStack); if (doesReagentMatch) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java index 528e7b75..566fbfe9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/altarRecipeRegistry/AltarRecipeRegistry.java @@ -9,8 +9,8 @@ import net.minecraft.item.ItemStack; public class AltarRecipeRegistry { - public static List altarRecipes = new LinkedList(); - public static Map orbMap = new HashMap(); + public static List altarRecipes = new LinkedList(); + public static Map orbMap = new HashMap(); public static void registerAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate, int drainRate, boolean canBeFilled) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java index ba069118..407f74ff 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/BindingRegistry.java @@ -7,7 +7,7 @@ import java.util.List; public class BindingRegistry { - public static List bindingRecipes = new LinkedList(); + public static List bindingRecipes = new LinkedList(); public static void registerRecipe(ItemStack output, ItemStack input) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/UnbindingRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/UnbindingRegistry.java index 3ae2eaf2..d031edd3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/UnbindingRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/bindingRegistry/UnbindingRegistry.java @@ -7,7 +7,7 @@ import java.util.List; public class UnbindingRegistry { - public static List unbindingRecipes = new LinkedList(); + public static List unbindingRecipes = new LinkedList(); public static void addAllUnbindingRecipesFromBinding() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/compress/CompressionRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/compress/CompressionRegistry.java index 689b022a..342b9b7d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/compress/CompressionRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/compress/CompressionRegistry.java @@ -15,8 +15,8 @@ import net.minecraft.world.World; */ public class CompressionRegistry { - public static List compressionRegistry = new ArrayList(); - public static Map thresholdMap = new HashMap(); + public static List compressionRegistry = new ArrayList(); + public static Map thresholdMap = new HashMap(); public static void registerHandler(CompressionHandler handler) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/AddToNetworkEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/AddToNetworkEvent.java index def8381b..448f4712 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/AddToNetworkEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/AddToNetworkEvent.java @@ -3,7 +3,6 @@ package WayofTime.alchemicalWizardry.api.event; import net.minecraftforge.fml.common.eventhandler.Cancelable; import net.minecraftforge.fml.common.eventhandler.Event; - @Cancelable public class AddToNetworkEvent extends Event { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java b/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java index a1f63f9d..4fc7310f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java @@ -8,45 +8,43 @@ import net.minecraft.world.World; import net.minecraftforge.fml.common.eventhandler.Cancelable; import net.minecraftforge.fml.common.eventhandler.Event; - /** Fired when a teleposer attempts to transpose two blocks. Use this to perform special cleanup or compensation, or cancel it entirely to prevent the transposition. */ @Cancelable public class TeleposeEvent extends Event { + public final World initialWorld; + public final BlockPos initialPos; - public final World initialWorld; - public final BlockPos initialPos; + public final Block initialBlock; + public final IBlockState initialState; - public final Block initialBlock; - public final IBlockState initialState; + public final World finalWorld; + public final BlockPos finalPos; - public final World finalWorld; - public final BlockPos finalPos; + public final Block finalBlock; + public final IBlockState finalState; - public final Block finalBlock; - public final IBlockState finalState; - - public TeleposeEvent(World wi, BlockPos posi, IBlockState statei, World wf, BlockPos posf, IBlockState statef) { - initialWorld = wi; - initialPos = posi; + public TeleposeEvent(World wi, BlockPos posi, IBlockState statei, World wf, BlockPos posf, IBlockState statef) + { + initialWorld = wi; + initialPos = posi; - initialState = statei; - initialBlock = initialState.getBlock(); + initialState = statei; + initialBlock = initialState.getBlock(); - finalWorld = wf; - finalPos = posf; + finalWorld = wf; + finalPos = posf; - finalState = statef; - finalBlock = finalState.getBlock(); - } + finalState = statef; + finalBlock = finalState.getBlock(); + } - public TileEntity getInitialTile() { + public TileEntity getInitialTile() { return initialWorld.getTileEntity(initialPos); } - public TileEntity getFinalTile() { + public TileEntity getFinalTile() { return finalWorld.getTileEntity(finalPos); } - } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java index bc30ddc8..2d5e884b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java @@ -10,7 +10,7 @@ import net.minecraft.world.World; public class HarvestRegistry { - public static List handlerList = new ArrayList(); + public static List handlerList = new ArrayList(); public static void registerHarvestHandler(IHarvestHandler handler) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java b/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java index 4d5b1fd2..40773cb5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/items/ItemSpellMultiTool.java @@ -252,7 +252,7 @@ public class ItemSpellMultiTool extends Item public Set getToolClasses(ItemStack stack) { - Set set = new HashSet(); + Set set = new HashSet(); if (this.getHarvestLevel(stack, "pickaxe") > -1) { @@ -369,7 +369,7 @@ public class ItemSpellMultiTool extends Item MovingObjectPosition mop = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false); - int cost = 0; + int cost; if (mop != null && mop.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK)) { @@ -549,10 +549,7 @@ public class ItemSpellMultiTool extends Item public void setDuration(ItemStack container, World world, int duration) { - if (world.isRemote) - { - return; - } else + if (!world.isRemote) { World overWorld = DimensionManager.getWorld(0); long worldtime = overWorld.getTotalWorldTime(); @@ -632,10 +629,10 @@ public class ItemSpellMultiTool extends Item NBTTagList tagList = tagiest.getTagList("Effects", Constants.NBT.TAG_COMPOUND); - List spellEffectList = new LinkedList(); + List spellEffectList = new LinkedList(); for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); + NBTTagCompound tag = tagList.getCompoundTagAt(i); SpellEffect eff = SpellEffect.getEffectFromTag(tag); if (eff != null) @@ -729,10 +726,10 @@ public class ItemSpellMultiTool extends Item NBTTagList tagList = tagiest.getTagList("ToolTips", Constants.NBT.TAG_COMPOUND); - List toolTipList = new LinkedList(); + List toolTipList = new LinkedList(); for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); + NBTTagCompound tag = tagList.getCompoundTagAt(i); String str = tag.getString("tip"); if (str != null) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java b/src/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java index 44514568..0040f745 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/items/ShapelessBloodOrbRecipe.java @@ -134,7 +134,7 @@ public class ShapelessBloodOrbRecipe implements IRecipe //If target is integer, then we should be check the blood orb value of the item instead if (next instanceof Integer) { - if (slot != null && slot.getItem() instanceof IBloodOrb) + if (slot.getItem() instanceof IBloodOrb) { IBloodOrb orb = (IBloodOrb) slot.getItem(); if (orb.getOrbLevel() < (Integer) next) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IRitualDiviner.java b/src/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IRitualDiviner.java index 03094a88..2189a6ed 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IRitualDiviner.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/items/interfaces/IRitualDiviner.java @@ -2,13 +2,21 @@ package WayofTime.alchemicalWizardry.api.items.interfaces; import net.minecraft.item.ItemStack; -public interface IRitualDiviner { +public interface IRitualDiviner +{ int cycleDirection(ItemStack stack); + String getCurrentRitual(ItemStack stack); + int getDirection(ItemStack stack); + int getMaxRuneDisplacement(ItemStack stack); + String getNameForDirection(int direction); + void setCurrentRitual(ItemStack stack, String ritualID); + void setDirection(ItemStack stack, int direction); + void setMaxRuneDisplacement(ItemStack stack, int displacement); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java index 15a558d9..8bbe8397 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/RitualEffect.java @@ -17,10 +17,7 @@ public abstract class RitualEffect return true; } - public void onRitualBroken(IMasterRitualStone ritualStone, RitualBreakMethod method) - { - - } + public void onRitualBroken(IMasterRitualStone ritualStone, RitualBreakMethod method) {} public abstract int getCostPerRefresh(); diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java index 8be6be44..a45f0fd1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/rituals/Rituals.java @@ -26,8 +26,8 @@ public class Rituals public final MRSRenderer customRenderer; - public static Map ritualMap = new HashMap(); - public static List keyList = new LinkedList(); + public static Map ritualMap = new HashMap(); + public static List keyList = new LinkedList(); public Rituals(int crystalLevel, int actCost, RitualEffect effect, String name, MRSRenderer renderer) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/ComplexNetworkHandler.java b/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/ComplexNetworkHandler.java index 8d351d1e..0718624a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/ComplexNetworkHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/soulNetwork/ComplexNetworkHandler.java @@ -23,7 +23,7 @@ import com.google.gson.GsonBuilder; public class ComplexNetworkHandler { public static String fileName = "config/BloodMagic/soulnetworkKeys"; - static HashMap keyMap = new HashMap(); + static HashMap keyMap = new HashMap(); public static UUID getUUIDFromPlayer(EntityPlayer player) { return player.getPersistentID(); @@ -70,9 +70,8 @@ public class ComplexNetworkHandler try { br = new BufferedReader(new FileReader(save)); - HashMap schema = gson.fromJson(br, keyMap.getClass()); - - keyMap = schema; + + keyMap = gson.fromJson(br, keyMap.getClass()); if(keyMap != null) { @@ -86,7 +85,6 @@ public class ComplexNetworkHandler e.printStackTrace(); } } - else { keyMap = null; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/EntitySpellProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/EntitySpellProjectile.java index 556f6c0a..c4afda4e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/EntitySpellProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/EntitySpellProjectile.java @@ -45,10 +45,10 @@ public class EntitySpellProjectile extends Entity implements IProjectile //Custom variables private int maxRicochet = 0; private float damage = 1; - public List impactList = new ArrayList(); + public List impactList = new ArrayList(); private boolean penetration = false; - public List updateEffectList = new ArrayList(); - public List spellEffectList = new LinkedList(); + public List updateEffectList = new ArrayList(); + public List spellEffectList = new LinkedList(); private int blocksBroken = 0; public EntitySpellProjectile(World par1World) @@ -323,7 +323,7 @@ public class EntitySpellProjectile extends Entity implements IProjectile NBTTagList tagList = par1NBTTagCompound.getTagList("Effects", Constants.NBT.TAG_COMPOUND); - List spellEffectList = new LinkedList(); + List spellEffectList = new LinkedList(); for (int i = 0; i < tagList.tagCount(); i++) { NBTTagCompound tag = tagList.getCompoundTagAt(i); diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellEffectRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellEffectRegistry.java index f217b12a..fcdd82f5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellEffectRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellEffectRegistry.java @@ -8,9 +8,9 @@ import java.util.Map.Entry; public class SpellEffectRegistry { - public static Map, List> effectRegistry = new HashMap(); - public static Map typeRegistry = new HashMap(); - public static Map modifierRegistry = new HashMap(); + public static Map, List> effectRegistry = new HashMap, List>(); + public static Map typeRegistry = new HashMap(); + public static Map modifierRegistry = new HashMap(); public static void registerSpellEffect(Class paraClass, ComplexSpellEffect effect) { @@ -43,7 +43,7 @@ public class SpellEffectRegistry effectList.add(effect); }else { - List effectList = new LinkedList(); + List effectList = new LinkedList(); effectList.add(effect); effectRegistry.put(paraClass, effectList); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigm.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigm.java index 5423cb4f..4f72d4ff 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigm.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigm.java @@ -9,7 +9,7 @@ import net.minecraft.world.World; public abstract class SpellParadigm { - protected List bufferedEffectList = new LinkedList(); + protected List bufferedEffectList = new LinkedList(); public void addBufferedEffect(SpellEffect effect) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmMelee.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmMelee.java index 629f7dba..12023f7a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmMelee.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmMelee.java @@ -15,15 +15,12 @@ public class SpellParadigmMelee extends SpellParadigm public SpellParadigmMelee() { - this.entityEffectList = new ArrayList(); - this.worldEffectList = new ArrayList(); + this.entityEffectList = new ArrayList(); + this.worldEffectList = new ArrayList(); } @Override - public void enhanceParadigm(SpellEnhancement enh) - { - - } + public void enhanceParadigm(SpellEnhancement enh) {} @Override public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmProjectile.java index 8b6f6a31..f1a33800 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmProjectile.java @@ -25,8 +25,8 @@ public class SpellParadigmProjectile extends SpellParadigm this.damageSource = DamageSource.generic; this.damage = 1; this.cost = 0; - this.impactList = new ArrayList(); - this.updateEffectList = new ArrayList(); + this.impactList = new ArrayList(); + this.updateEffectList = new ArrayList(); this.penetration = false; this.ricochetMax = 0; this.isSilkTouch = false; diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmSelf.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmSelf.java index 89cffe07..91c6ab1d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmSelf.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmSelf.java @@ -14,14 +14,11 @@ public class SpellParadigmSelf extends SpellParadigm public SpellParadigmSelf() { - selfSpellEffectList = new ArrayList(); + selfSpellEffectList = new ArrayList(); } @Override - public void enhanceParadigm(SpellEnhancement enh) - { - - } + public void enhanceParadigm(SpellEnhancement enh) {} @Override public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack) diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmTool.java b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmTool.java index 137742c6..e61795b9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmTool.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/spell/SpellParadigmTool.java @@ -49,31 +49,31 @@ public class SpellParadigmTool extends SpellParadigm public SpellParadigmTool() { - this.leftClickEffectList = new LinkedList(); - this.rightClickEffectList = new LinkedList(); - this.toolUpdateEffectList = new LinkedList(); - this.toolSummonEffectList = new LinkedList(); - this.toolBanishEffectList = new LinkedList(); - this.breakBlockEffectList = new LinkedList(); - this.itemManipulatorEffectList = new LinkedList(); - this.digAreaEffectList = new LinkedList(); - this.specialDamageEffectList = new LinkedList(); - this.durationHash = new HashMap(); + this.leftClickEffectList = new LinkedList(); + this.rightClickEffectList = new LinkedList(); + this.toolUpdateEffectList = new LinkedList(); + this.toolSummonEffectList = new LinkedList(); + this.toolBanishEffectList = new LinkedList(); + this.breakBlockEffectList = new LinkedList(); + this.itemManipulatorEffectList = new LinkedList(); + this.digAreaEffectList = new LinkedList(); + this.specialDamageEffectList = new LinkedList(); + this.durationHash = new HashMap(); - this.toolInfoString = new HashMap(); - this.critChanceHash = new HashMap(); + this.toolInfoString = new HashMap(); + this.critChanceHash = new HashMap(); - this.harvestLevel = new HashMap(); + this.harvestLevel = new HashMap(); this.harvestLevel.put("pickaxe", -1); this.harvestLevel.put("shovel", -1); this.harvestLevel.put("axe", -1); - this.digSpeed = new HashMap(); + this.digSpeed = new HashMap(); this.digSpeed.put("pickaxe", 1.0f); this.digSpeed.put("shovel", 1.0f); this.digSpeed.put("axe", 1.0f); - this.maxDamageHash = new HashMap(); + this.maxDamageHash = new HashMap(); this.maxDamageHash.put("default", 5.0f); this.fortuneLevel = 0; @@ -356,8 +356,7 @@ public class SpellParadigmTool extends SpellParadigm for (IItemManipulator eff : this.itemManipulatorEffectList) { - List newHeldList = eff.handleItemsOnBlockBroken(toolStack, heldList); - heldList = newHeldList; + heldList = eff.handleItemsOnBlockBroken(toolStack, heldList); } return heldList; @@ -465,7 +464,7 @@ public class SpellParadigmTool extends SpellParadigm public float getAddedDamageForEntity(Entity entity) { - HashMap hash = new HashMap(); + HashMap hash = new HashMap(); for (ISpecialDamageEffect effect : this.specialDamageEffectList) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningRegistry.java index 18180d8c..01c065f8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/api/summoningRegistry/SummoningRegistry.java @@ -9,7 +9,7 @@ import java.util.List; public class SummoningRegistry { - public static List summoningList = new ArrayList(); + public static List summoningList = new ArrayList(); public static void registerSummon(SummoningHelper s, ItemStack[] ring1, ItemStack[] ring2, ItemStack[] ring3, int amountUsed, int bloodOrbLevel) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/BlockRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/client/BlockRenderer.java index 5c0d5ef2..8ade0296 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/BlockRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/BlockRenderer.java @@ -11,9 +11,4 @@ public class BlockRenderer { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("alchemicalwizardry:" + block.getUnlocalizedName().substring(5), "inventory")); } - - public static void registerBlocks() - { - - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java b/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java index 911fc563..3c5f4b04 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/ClientProxy.java @@ -41,7 +41,7 @@ import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazooka import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor; import WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam; import WayofTime.alchemicalWizardry.common.items.sigil.holding.ScrollHelper; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderAlchemicCalcinator; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderAlchemicalCalcinator; import WayofTime.alchemicalWizardry.common.renderer.block.RenderConduit; import WayofTime.alchemicalWizardry.common.renderer.block.RenderCrystalBelljar; import WayofTime.alchemicalWizardry.common.renderer.block.RenderMasterStone; @@ -52,9 +52,8 @@ import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellEffectBlock import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellEnhancementBlock; import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellModifierBlock; import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellParadigmBlock; -import WayofTime.alchemicalWizardry.common.renderer.block.RenderWritingTable; -import WayofTime.alchemicalWizardry.common.renderer.block.ShaderHelper; -import WayofTime.alchemicalWizardry.common.renderer.block.TEAltarRenderer; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderChemistrySet; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderAltar; import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEAlchemicalCalcinatorItemRenderer; import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEAltarItemRenderer; import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEBellJarItemRenderer; @@ -149,10 +148,10 @@ public class ClientProxy extends CommonProxy MinecraftForge.EVENT_BUS.register(new RitualDivinerRender()); - ClientRegistry.bindTileEntitySpecialRenderer(TEAltar.class, new TEAltarRenderer()); + ClientRegistry.bindTileEntitySpecialRenderer(TEAltar.class, new RenderAltar()); ClientRegistry.bindTileEntitySpecialRenderer(TEPedestal.class, new RenderPedestal()); ClientRegistry.bindTileEntitySpecialRenderer(TEPlinth.class, new RenderPlinth()); - ClientRegistry.bindTileEntitySpecialRenderer(TEChemistrySet.class, new RenderWritingTable()); + ClientRegistry.bindTileEntitySpecialRenderer(TEChemistrySet.class, new RenderChemistrySet()); ClientRegistry.bindTileEntitySpecialRenderer(TEConduit.class, new RenderConduit()); ClientRegistry.bindTileEntitySpecialRenderer(TESpellEffectBlock.class, new RenderSpellEffectBlock()); ClientRegistry.bindTileEntitySpecialRenderer(TESpellEnhancementBlock.class, new RenderSpellEnhancementBlock()); @@ -160,7 +159,7 @@ public class ClientProxy extends CommonProxy ClientRegistry.bindTileEntitySpecialRenderer(TESpellModifierBlock.class, new RenderSpellModifierBlock()); ClientRegistry.bindTileEntitySpecialRenderer(TEReagentConduit.class, new RenderReagentConduit()); ClientRegistry.bindTileEntitySpecialRenderer(TEMasterStone.class, new RenderMasterStone()); - ClientRegistry.bindTileEntitySpecialRenderer(TEAlchemicalCalcinator.class, new RenderAlchemicCalcinator()); + ClientRegistry.bindTileEntitySpecialRenderer(TEAlchemicalCalcinator.class, new RenderAlchemicalCalcinator()); ClientRegistry.bindTileEntitySpecialRenderer(TEBelljar.class, new RenderCrystalBelljar()); //Item Renderer stuff @@ -181,7 +180,7 @@ public class ClientProxy extends CommonProxy } @Override - public void InitRendering() + public void initRendering() { MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockAltar), new TEAltarItemRenderer()); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGuiFactory.java b/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGuiFactory.java index 9cea4d60..6413230c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGuiFactory.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/gui/ConfigGuiFactory.java @@ -9,9 +9,7 @@ import net.minecraftforge.fml.client.IModGuiFactory; public class ConfigGuiFactory implements IModGuiFactory { @Override - public void initialize(Minecraft minecraftInstance) { - - } + public void initialize(Minecraft minecraftInstance) {} @Override public Class mainConfigGuiClass() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAlchemyRecipeHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAlchemyRecipeHandler.java index 55608511..c92c0b0f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAlchemyRecipeHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAlchemyRecipeHandler.java @@ -1,178 +1,178 @@ -//package WayofTime.alchemicalWizardry.client.nei; -// -//import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.bloodOrbs; -// -//import java.awt.Rectangle; -//import java.util.ArrayList; -//import java.util.List; -// -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.inventory.GuiContainer; -//import net.minecraft.item.Item; -//import net.minecraft.item.ItemStack; -//import net.minecraft.util.ResourceLocation; -//import net.minecraft.util.StatCollector; -//import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe; -//import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; -//import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; -//import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiWritingTable; -//import codechicken.nei.ItemList; -//import codechicken.nei.NEIServerUtils; -//import codechicken.nei.PositionedStack; -//import codechicken.nei.recipe.TemplateRecipeHandler; -// -///** -// * NEI Alchemy Recipe Handler by joshie * -// */ -//public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler { -// public class CachedAlchemyRecipe extends CachedRecipe { -// public class BloodOrbs { -// public PositionedStack stack; -// -// public BloodOrbs(ItemStack orb) { -// this.stack = new PositionedStack(orb, 136, 47, false); -// } -// } -// -// ArrayList orbs; -// PositionedStack output; -// List inputs; -// int lp; -// -// public CachedAlchemyRecipe(AlchemyRecipe recipe, ItemStack orb) { -// this(recipe); -// this.orbs = new ArrayList(); -// orbs.add(new BloodOrbs(orb)); -// } -// -// public CachedAlchemyRecipe(AlchemyRecipe recipe) { -// List inputs = new ArrayList(); -// ItemStack[] stacks = recipe.getRecipe(); -// if (stacks.length > 0) inputs.add(new PositionedStack(stacks[0], 76, 3)); -// if (stacks.length > 1) inputs.add(new PositionedStack(stacks[1], 51, 19)); -// if (stacks.length > 2) inputs.add(new PositionedStack(stacks[2], 101, 19)); -// if (stacks.length > 3) inputs.add(new PositionedStack(stacks[3], 64, 47)); -// if (stacks.length > 4) inputs.add(new PositionedStack(stacks[4], 88, 47)); -// this.inputs = inputs; -// this.output = new PositionedStack(recipe.getResult(), 76, 25); -// this.lp = recipe.getAmountNeeded() * 100; -// this.orbs = new ArrayList(); -// for (Item orb : bloodOrbs) { -// if (((IBloodOrb) orb).getOrbLevel() >= recipe.getOrbLevel()) { -// orbs.add(new BloodOrbs(new ItemStack(orb))); -// } -// } -// } -// -// @Override -// public List getIngredients() { -// return inputs; -// } -// -// @Override -// public PositionedStack getResult() { -// return output; -// } -// -// @Override -// public PositionedStack getOtherStack() { -// if (orbs == null || orbs.size() <= 0) return null; -// return orbs.get((cycleticks / 48) % orbs.size()).stack; -// } -// } -// -// @Override -// public TemplateRecipeHandler newInstance() { -// for (ItemStack item : ItemList.items) { -// if (item != null && item.getItem() instanceof IBloodOrb) { -// bloodOrbs.add(item.getItem()); -// } -// } -// -// return super.newInstance(); -// } -// -// @Override -// public String getOverlayIdentifier() { -// return "alchemicalwizardry.alchemy"; -// } -// -// @Override -// public void loadTransferRects() { -// transferRects.add(new RecipeTransferRect(new Rectangle(134, 22, 16, 24), "alchemicalwizardry.alchemy")); -// } -// -// @Override -// public Class getGuiClass() { -// return GuiWritingTable.class; -// } -// -// @Override -// public void loadCraftingRecipes(String outputId, Object... results) { -// if (outputId.equals("alchemicalwizardry.alchemy") && getClass() == NEIAlchemyRecipeHandler.class) { -// for (AlchemyRecipe recipe : AlchemyRecipeRegistry.recipes) { -// if (recipe.getResult() != null) arecipes.add(new CachedAlchemyRecipe(recipe)); -// } -// } else { -// super.loadCraftingRecipes(outputId, results); -// } -// } -// -// @Override -// public void loadCraftingRecipes(ItemStack result) { -// for (AlchemyRecipe recipe : AlchemyRecipeRegistry.recipes) { -// if (recipe == null) continue; -// if (NEIServerUtils.areStacksSameTypeCrafting(result, recipe.getResult())) { -// arecipes.add(new CachedAlchemyRecipe(recipe)); -// } -// } -// } -// -// @Override -// public void loadUsageRecipes(ItemStack ingredient) { -// if (ingredient.getItem() instanceof IBloodOrb) { -// for (AlchemyRecipe recipe : AlchemyRecipeRegistry.recipes) { -// if (recipe == null) continue; -// if (((IBloodOrb) ingredient.getItem()).getOrbLevel() >= recipe.getOrbLevel()) { -// arecipes.add(new CachedAlchemyRecipe(recipe, ingredient)); -// } -// } -// } else { -// for (AlchemyRecipe recipe : AlchemyRecipeRegistry.recipes) { -// if (recipe == null) continue; -// ItemStack[] stacks = recipe.getRecipe(); -// for (ItemStack stack : stacks) { -// if (NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)) { -// arecipes.add(new CachedAlchemyRecipe(recipe)); -// break; -// } -// } -// } -// } -// } -// -// @Override -// public void drawExtras(int id) { -// CachedAlchemyRecipe cache = (CachedAlchemyRecipe) arecipes.get(id); -// Minecraft.getMinecraft().fontRendererObj.drawString("\u00a77" + cache.lp + "LP", getLPX(cache.lp), 34, 0); -// } -// -// public int getLPX(int lp) { -// if (lp < 10) return 122; -// else if (lp < 100) return 122; -// else if (lp < 1000) return 130; -// else if (lp < 10000) return 127; -// else if (lp < 100000) return 124; -// return 122; -// } -// -// @Override -// public String getRecipeName() { -// return StatCollector.translateToLocal("tile.blockWritingTable.name"); -// } -// -// @Override -// public String getGuiTexture() { -// return new ResourceLocation("alchemicalwizardry", "gui/nei/alchemy.png").toString(); -// } -//} +package WayofTime.alchemicalWizardry.client.nei; + +import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.bloodOrbs; + +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; + +import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiChemistrySet; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe; +import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; +import codechicken.nei.ItemList; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.TemplateRecipeHandler; + +/** + * NEI Alchemy Recipe Handler by joshie * + */ +public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler { + public class CachedAlchemyRecipe extends CachedRecipe { + public class BloodOrbs { + public PositionedStack stack; + + public BloodOrbs(ItemStack orb) { + this.stack = new PositionedStack(orb, 136, 47, false); + } + } + + ArrayList orbs; + PositionedStack output; + List inputs; + int lp; + + public CachedAlchemyRecipe(AlchemyRecipe recipe, ItemStack orb) { + this(recipe); + this.orbs = new ArrayList(); + orbs.add(new BloodOrbs(orb)); + } + + public CachedAlchemyRecipe(AlchemyRecipe recipe) { + List inputs = new ArrayList(); + ItemStack[] stacks = recipe.getRecipe(); + if (stacks.length > 0) inputs.add(new PositionedStack(stacks[0], 76, 3)); + if (stacks.length > 1) inputs.add(new PositionedStack(stacks[1], 51, 19)); + if (stacks.length > 2) inputs.add(new PositionedStack(stacks[2], 101, 19)); + if (stacks.length > 3) inputs.add(new PositionedStack(stacks[3], 64, 47)); + if (stacks.length > 4) inputs.add(new PositionedStack(stacks[4], 88, 47)); + this.inputs = inputs; + this.output = new PositionedStack(recipe.getResult(), 76, 25); + this.lp = recipe.getAmountNeeded() * 100; + this.orbs = new ArrayList(); + for (Item orb : bloodOrbs) { + if (((IBloodOrb) orb).getOrbLevel() >= recipe.getOrbLevel()) { + orbs.add(new BloodOrbs(new ItemStack(orb))); + } + } + } + + @Override + public List getIngredients() { + return inputs; + } + + @Override + public PositionedStack getResult() { + return output; + } + + @Override + public PositionedStack getOtherStack() { + if (orbs == null || orbs.size() <= 0) return null; + return orbs.get((cycleticks / 48) % orbs.size()).stack; + } + } + + @Override + public TemplateRecipeHandler newInstance() { + for (ItemStack item : ItemList.items) { + if (item != null && item.getItem() instanceof IBloodOrb) { + bloodOrbs.add(item.getItem()); + } + } + + return super.newInstance(); + } + + @Override + public String getOverlayIdentifier() { + return "alchemicalwizardry.alchemy"; + } + + @Override + public void loadTransferRects() { + transferRects.add(new RecipeTransferRect(new Rectangle(134, 22, 16, 24), "alchemicalwizardry.alchemy")); + } + + @Override + public Class getGuiClass() { + return GuiChemistrySet.class; + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals("alchemicalwizardry.alchemy") && getClass() == NEIAlchemyRecipeHandler.class) { + for (AlchemyRecipe recipe : AlchemyRecipeRegistry.recipes) { + if (recipe.getResult() != null) arecipes.add(new CachedAlchemyRecipe(recipe)); + } + } else { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) { + for (AlchemyRecipe recipe : AlchemyRecipeRegistry.recipes) { + if (recipe == null) continue; + if (NEIServerUtils.areStacksSameTypeCrafting(result, recipe.getResult())) { + arecipes.add(new CachedAlchemyRecipe(recipe)); + } + } + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) { + if (ingredient.getItem() instanceof IBloodOrb) { + for (AlchemyRecipe recipe : AlchemyRecipeRegistry.recipes) { + if (recipe == null) continue; + if (((IBloodOrb) ingredient.getItem()).getOrbLevel() >= recipe.getOrbLevel()) { + arecipes.add(new CachedAlchemyRecipe(recipe, ingredient)); + } + } + } else { + for (AlchemyRecipe recipe : AlchemyRecipeRegistry.recipes) { + if (recipe == null) continue; + ItemStack[] stacks = recipe.getRecipe(); + for (ItemStack stack : stacks) { + if (NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)) { + arecipes.add(new CachedAlchemyRecipe(recipe)); + break; + } + } + } + } + } + + @Override + public void drawExtras(int id) { + CachedAlchemyRecipe cache = (CachedAlchemyRecipe) arecipes.get(id); + Minecraft.getMinecraft().fontRendererObj.drawString("\u00a77" + cache.lp + "LP", getLPX(cache.lp), 34, 0); + } + + public int getLPX(int lp) { + if (lp < 10) return 122; + else if (lp < 100) return 122; + else if (lp < 1000) return 130; + else if (lp < 10000) return 127; + else if (lp < 100000) return 124; + return 122; + } + + @Override + public String getRecipeName() { + return StatCollector.translateToLocal("tile.blockWritingTable.name"); + } + + @Override + public String getGuiTexture() { + return new ResourceLocation("alchemicalwizardry", "gui/nei/alchemy.png").toString(); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAltarRecipeHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAltarRecipeHandler.java index 0b264e4a..c932f60a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAltarRecipeHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIAltarRecipeHandler.java @@ -1,187 +1,187 @@ -//package WayofTime.alchemicalWizardry.client.nei; -// -//import java.awt.Dimension; -//import java.awt.Point; -//import java.awt.Rectangle; -//import java.lang.reflect.Field; -//import java.util.List; -// -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.ScaledResolution; -//import net.minecraft.item.ItemStack; -//import net.minecraft.util.ResourceLocation; -//import net.minecraft.util.StatCollector; -// -//import org.lwjgl.input.Mouse; -// -//import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; -//import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; -//import codechicken.nei.NEIServerUtils; -//import codechicken.nei.PositionedStack; -//import codechicken.nei.recipe.GuiRecipe; -//import codechicken.nei.recipe.TemplateRecipeHandler; -// -///** -// * NEI Altar Recipe Handler by joshie * -// */ -//public class NEIAltarRecipeHandler extends TemplateRecipeHandler { -// public class CachedAltarRecipe extends CachedRecipe { -// PositionedStack input; -//// PositionedStack inputItems; -// PositionedStack output; -// int tier, lp_amount, consumption, drain; -// -// public CachedAltarRecipe(AltarRecipe recipe) { -//// inputItems = new PositionedStack(recipe.input, 38, 2, false); -// input = new PositionedStack(recipe.requiredItem, 38, 2, false); -// output = new PositionedStack(recipe.result, 132, 32, false); -// tier = recipe.minTier; -// lp_amount = recipe.liquidRequired; -// consumption = recipe.consumptionRate; -// drain = recipe.drainRate; -// } -// -// @Override -// public PositionedStack getIngredient() { -// return input; -// } -// -// @Override -// public PositionedStack getResult() { -// return output; -// } -// } -// -// @Override -// public void loadCraftingRecipes(String outputId, Object... results) { -// if (outputId.equals("alchemicalwizardry.altar") && getClass() == NEIAltarRecipeHandler.class) { -// for(AltarRecipe recipe: AltarRecipeRegistry.altarRecipes) { -// if(recipe != null && recipe.result != null) arecipes.add(new CachedAltarRecipe(recipe)); -// } -// } else { -// super.loadCraftingRecipes(outputId, results); -// } -// } -// -// @Override -// public void loadCraftingRecipes(ItemStack result) { -// for(AltarRecipe recipe: AltarRecipeRegistry.altarRecipes) { -// if(NEIServerUtils.areStacksSameTypeCrafting(recipe.result, result)) { -// if(recipe != null && recipe.result != null) arecipes.add(new CachedAltarRecipe(recipe)); -// } -// } -// } -// -// @Override -// public void loadUsageRecipes(ItemStack ingredient) { -// for(AltarRecipe recipe: AltarRecipeRegistry.altarRecipes) { -// if(NEIServerUtils.areStacksSameTypeCrafting(recipe.requiredItem, ingredient)) { -// if(recipe != null && recipe.result != null) arecipes.add(new CachedAltarRecipe(recipe)); -// } -// } -// } -// -// //Mouse Position helper -// public Point getMouse(int width, int height) { -// Point mousepos = getMousePosition(); -// int guiLeft = (width - 176) / 2; -// int guiTop = (height - 166) / 2; -// Point relMouse = new Point(mousepos.x - guiLeft, mousepos.y - guiTop); -// return relMouse; -// } -// -// //width helper, getting width normal way hates me on compile -// public int getGuiWidth(GuiRecipe gui) { -// try { -// Field f = gui.getClass().getField("width"); -// return (Integer) f.get(gui); -// } catch (NoSuchFieldException e) { -// try { -// Field f = gui.getClass().getField("field_146294_l"); -// return (Integer) f.get(gui); -// } catch (Exception e2) { -// return 0; -// } -// } catch (Exception e) { -// e.printStackTrace(); -// return 0; -// } -// } -// -// //height helper, getting height normal way hates me on compile -// public int getGuiHeight(GuiRecipe gui) { -// try { -// Field f = gui.getClass().getField("height"); -// return (Integer) f.get(gui); -// } catch (NoSuchFieldException e) { -// try { -// Field f = gui.getClass().getField("field_146295_m"); -// return (Integer) f.get(gui); -// } catch (Exception e2) { -// return 0; -// } -// } catch (Exception e) { -// e.printStackTrace(); -// return 0; -// } -// } -// -// @Override -// public void drawExtras(int id) { -// CachedAltarRecipe recipe = (CachedAltarRecipe) arecipes.get(id); -// Minecraft.getMinecraft().fontRendererObj.drawString("\u00a77" + StatCollector.translateToLocal("bm.string.tier") + ": " + recipe.tier, 78, 5, 0); -// Minecraft.getMinecraft().fontRendererObj.drawString("\u00a77" + "LP: " + recipe.lp_amount, 78, 15, 0); -// } -// -// @Override -// public List handleTooltip(GuiRecipe gui, List currenttip, int id) { -// currenttip = super.handleTooltip(gui, currenttip, id); -// Point mouse = getMouse(getGuiWidth(gui), getGuiHeight(gui)); -// CachedAltarRecipe recipe = (CachedAltarRecipe) arecipes.get(id); -// int yLow = id % 2 == 0 ? 38 : 102; -// int yHigh = id % 2 == 0 ? 72 : 136; -// if(mouse.x >= 19 && mouse.x <= 80 && mouse.y >= yLow && mouse.y <= yHigh) { -// currenttip.add(StatCollector.translateToLocal("bm.string.consume") + ": " + recipe.consumption + "LP/t"); -// currenttip.add(StatCollector.translateToLocal("bm.string.drain") + ": " + recipe.drain + "LP/t"); -// } -// -// return currenttip; -// } -// -// @Override -// public String getOverlayIdentifier() { -// return "altarrecipes"; -// } -// -// @Override -// public void loadTransferRects() { -// transferRects.add(new RecipeTransferRect(new Rectangle(90, 32, 22, 16), "alchemicalwizardry.altar")); -// } -// -// @Override -// public String getRecipeName() { -// return " " + StatCollector.translateToLocal("tile.bloodAltar.name"); -// } -// -// @Override -// public String getGuiTexture() { -// return new ResourceLocation("alchemicalwizardry", "gui/nei/altar.png").toString(); -// } -// -// public static Point getMousePosition() { -// Dimension size = displaySize(); -// Dimension res = displayRes(); -// return new Point(Mouse.getX() * size.width / res.width, size.height - Mouse.getY() * size.height / res.height - 1); -// } -// -// public static Dimension displaySize() { -// Minecraft mc = Minecraft.getMinecraft(); -// ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); -// return new Dimension(res.getScaledWidth(), res.getScaledHeight()); -// } -// -// public static Dimension displayRes() { -// Minecraft mc = Minecraft.getMinecraft(); -// return new Dimension(mc.displayWidth, mc.displayHeight); -// } -//} +package WayofTime.alchemicalWizardry.client.nei; + +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Rectangle; +import java.lang.reflect.Field; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +import org.lwjgl.input.Mouse; + +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe; +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.GuiRecipe; +import codechicken.nei.recipe.TemplateRecipeHandler; + +/** + * NEI Altar Recipe Handler by joshie * + */ +public class NEIAltarRecipeHandler extends TemplateRecipeHandler { + public class CachedAltarRecipe extends CachedRecipe { + PositionedStack input; +// PositionedStack inputItems; + PositionedStack output; + int tier, lp_amount, consumption, drain; + + public CachedAltarRecipe(AltarRecipe recipe) { +// inputItems = new PositionedStack(recipe.input, 38, 2, false); + input = new PositionedStack(recipe.requiredItem, 38, 2, false); + output = new PositionedStack(recipe.result, 132, 32, false); + tier = recipe.minTier; + lp_amount = recipe.liquidRequired; + consumption = recipe.consumptionRate; + drain = recipe.drainRate; + } + + @Override + public PositionedStack getIngredient() { + return input; + } + + @Override + public PositionedStack getResult() { + return output; + } + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals("alchemicalwizardry.altar") && getClass() == NEIAltarRecipeHandler.class) { + for(AltarRecipe recipe: AltarRecipeRegistry.altarRecipes) { + if(recipe != null && recipe.result != null) arecipes.add(new CachedAltarRecipe(recipe)); + } + } else { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) { + for(AltarRecipe recipe: AltarRecipeRegistry.altarRecipes) { + if(NEIServerUtils.areStacksSameTypeCrafting(recipe.result, result)) { + if(recipe != null && recipe.result != null) arecipes.add(new CachedAltarRecipe(recipe)); + } + } + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) { + for(AltarRecipe recipe: AltarRecipeRegistry.altarRecipes) { + if(NEIServerUtils.areStacksSameTypeCrafting(recipe.requiredItem, ingredient)) { + if(recipe != null && recipe.result != null) arecipes.add(new CachedAltarRecipe(recipe)); + } + } + } + + //Mouse Position helper + public Point getMouse(int width, int height) { + Point mousepos = getMousePosition(); + int guiLeft = (width - 176) / 2; + int guiTop = (height - 166) / 2; + Point relMouse = new Point(mousepos.x - guiLeft, mousepos.y - guiTop); + return relMouse; + } + + //width helper, getting width normal way hates me on compile + public int getGuiWidth(GuiRecipe gui) { + try { + Field f = gui.getClass().getField("width"); + return (Integer) f.get(gui); + } catch (NoSuchFieldException e) { + try { + Field f = gui.getClass().getField("field_146294_l"); + return (Integer) f.get(gui); + } catch (Exception e2) { + return 0; + } + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + //height helper, getting height normal way hates me on compile + public int getGuiHeight(GuiRecipe gui) { + try { + Field f = gui.getClass().getField("height"); + return (Integer) f.get(gui); + } catch (NoSuchFieldException e) { + try { + Field f = gui.getClass().getField("field_146295_m"); + return (Integer) f.get(gui); + } catch (Exception e2) { + return 0; + } + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + @Override + public void drawExtras(int id) { + CachedAltarRecipe recipe = (CachedAltarRecipe) arecipes.get(id); + Minecraft.getMinecraft().fontRendererObj.drawString("\u00a77" + StatCollector.translateToLocal("bm.string.tier") + ": " + recipe.tier, 78, 5, 0); + Minecraft.getMinecraft().fontRendererObj.drawString("\u00a77" + "LP: " + recipe.lp_amount, 78, 15, 0); + } + + @Override + public List handleTooltip(GuiRecipe gui, List currenttip, int id) { + currenttip = super.handleTooltip(gui, currenttip, id); + Point mouse = getMouse(getGuiWidth(gui), getGuiHeight(gui)); + CachedAltarRecipe recipe = (CachedAltarRecipe) arecipes.get(id); + int yLow = id % 2 == 0 ? 38 : 102; + int yHigh = id % 2 == 0 ? 72 : 136; + if(mouse.x >= 19 && mouse.x <= 80 && mouse.y >= yLow && mouse.y <= yHigh) { + currenttip.add(StatCollector.translateToLocal("bm.string.consume") + ": " + recipe.consumption + "LP/t"); + currenttip.add(StatCollector.translateToLocal("bm.string.drain") + ": " + recipe.drain + "LP/t"); + } + + return currenttip; + } + + @Override + public String getOverlayIdentifier() { + return "altarrecipes"; + } + + @Override + public void loadTransferRects() { + transferRects.add(new RecipeTransferRect(new Rectangle(90, 32, 22, 16), "alchemicalwizardry.altar")); + } + + @Override + public String getRecipeName() { + return " " + StatCollector.translateToLocal("tile.bloodAltar.name"); + } + + @Override + public String getGuiTexture() { + return new ResourceLocation("alchemicalwizardry", "gui/nei/altar.png").toString(); + } + + public static Point getMousePosition() { + Dimension size = displaySize(); + Dimension res = displayRes(); + return new Point(Mouse.getX() * size.width / res.width, size.height - Mouse.getY() * size.height / res.height - 1); + } + + public static Dimension displaySize() { + Minecraft mc = Minecraft.getMinecraft(); + ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); + return new Dimension(res.getScaledWidth(), res.getScaledHeight()); + } + + public static Dimension displayRes() { + Minecraft mc = Minecraft.getMinecraft(); + return new Dimension(mc.displayWidth, mc.displayHeight); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBindingRitualHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBindingRitualHandler.java index 58e9196d..21f2fba8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBindingRitualHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBindingRitualHandler.java @@ -1,136 +1,136 @@ -//package WayofTime.alchemicalWizardry.client.nei; -// -//import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe; -//import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry; -//import codechicken.nei.NEIServerUtils; -//import codechicken.nei.PositionedStack; -//import codechicken.nei.recipe.TemplateRecipeHandler; -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.ScaledResolution; -//import net.minecraft.item.ItemStack; -//import net.minecraft.util.ResourceLocation; -//import org.lwjgl.input.Mouse; -// -//import java.awt.*; -// -///** -// * Binding Ritual Handler by Arcaratus -// */ -//public class NEIBindingRitualHandler extends TemplateRecipeHandler -//{ -// public class CachedBindingRecipe extends CachedRecipe -// { -// PositionedStack input, output; -// -// public CachedBindingRecipe(BindingRecipe recipe) -// { -// input = new PositionedStack(recipe.requiredItem, 37, 21, false); -// output = new PositionedStack(recipe.outputItem, 110, 21, false); -// } -// -// @Override -// public PositionedStack getIngredient() -// { -// return input; -// } -// -// @Override -// public PositionedStack getResult() -// { -// return output; -// } -// } -// -// @Override -// public void loadCraftingRecipes(String outputId, Object... results) -// { -// if (outputId.equals("alchemicalwizardry.bindingritual") && getClass() == NEIBindingRitualHandler.class) -// { -// for (BindingRecipe recipe : BindingRegistry.bindingRecipes) -// { -// if (recipe != null && recipe.outputItem != null) -// { -// arecipes.add(new CachedBindingRecipe(recipe)); -// } -// } -// } -// else -// { -// super.loadCraftingRecipes(outputId, results); -// } -// } -// -// @Override -// public void loadCraftingRecipes(ItemStack result) -// { -// for (BindingRecipe recipe: BindingRegistry.bindingRecipes) -// { -// if (NEIServerUtils.areStacksSameTypeCrafting(recipe.outputItem, result)) -// { -// if (recipe != null && recipe.outputItem != null) -// { -// arecipes.add(new CachedBindingRecipe(recipe)); -// } -// } -// } -// } -// -// @Override -// public void loadUsageRecipes(ItemStack ingredient) -// { -// for (BindingRecipe recipe: BindingRegistry.bindingRecipes) -// { -// if (NEIServerUtils.areStacksSameTypeCrafting(recipe.requiredItem, ingredient)) -// { -// if (recipe != null && recipe.outputItem != null) -// { -// arecipes.add(new CachedBindingRecipe(recipe)); -// } -// } -// } -// } -// -// @Override -// public String getOverlayIdentifier() -// { -// return "alchemicalwizardry.bindingritual"; -// } -// -// @Override -// public void loadTransferRects() -// { -// transferRects.add(new RecipeTransferRect(new Rectangle(68, 20, 22, 16), "alchemicalwizardry.bindingritual")); -// } -// -// @Override -// public String getRecipeName() -// { -// return "Binding Ritual"; -// } -// -// @Override -// public String getGuiTexture() -// { -// return new ResourceLocation("alchemicalwizardry", "gui/nei/bindingRitual.png").toString(); -// } -// -// public static Point getMousePosition() -// { -// Dimension size = displaySize(); -// Dimension res = displayRes(); -// return new Point(Mouse.getX() * size.width / res.width, size.height - Mouse.getY() * size.height / res.height - 1); -// } -// -// public static Dimension displaySize() -// { -// Minecraft mc = Minecraft.getMinecraft(); -// ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); -// return new Dimension(res.getScaledWidth(), res.getScaledHeight()); -// } -// -// public static Dimension displayRes() -// { -// Minecraft mc = Minecraft.getMinecraft(); -// return new Dimension(mc.displayWidth, mc.displayHeight); -// } -//} \ No newline at end of file +package WayofTime.alchemicalWizardry.client.nei; + +import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRecipe; +import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.TemplateRecipeHandler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; + +import java.awt.*; + +/** + * Binding Ritual Handler by Arcaratus + */ +public class NEIBindingRitualHandler extends TemplateRecipeHandler +{ + public class CachedBindingRecipe extends CachedRecipe + { + PositionedStack input, output; + + public CachedBindingRecipe(BindingRecipe recipe) + { + input = new PositionedStack(recipe.requiredItem, 37, 21, false); + output = new PositionedStack(recipe.outputItem, 110, 21, false); + } + + @Override + public PositionedStack getIngredient() + { + return input; + } + + @Override + public PositionedStack getResult() + { + return output; + } + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) + { + if (outputId.equals("alchemicalwizardry.bindingritual") && getClass() == NEIBindingRitualHandler.class) + { + for (BindingRecipe recipe : BindingRegistry.bindingRecipes) + { + if (recipe != null && recipe.outputItem != null) + { + arecipes.add(new CachedBindingRecipe(recipe)); + } + } + } + else + { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) + { + for (BindingRecipe recipe: BindingRegistry.bindingRecipes) + { + if (NEIServerUtils.areStacksSameTypeCrafting(recipe.outputItem, result)) + { + if (recipe != null && recipe.outputItem != null) + { + arecipes.add(new CachedBindingRecipe(recipe)); + } + } + } + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) + { + for (BindingRecipe recipe: BindingRegistry.bindingRecipes) + { + if (NEIServerUtils.areStacksSameTypeCrafting(recipe.requiredItem, ingredient)) + { + if (recipe != null && recipe.outputItem != null) + { + arecipes.add(new CachedBindingRecipe(recipe)); + } + } + } + } + + @Override + public String getOverlayIdentifier() + { + return "alchemicalwizardry.bindingritual"; + } + + @Override + public void loadTransferRects() + { + transferRects.add(new RecipeTransferRect(new Rectangle(68, 20, 22, 16), "alchemicalwizardry.bindingritual")); + } + + @Override + public String getRecipeName() + { + return "Binding Ritual"; + } + + @Override + public String getGuiTexture() + { + return new ResourceLocation("alchemicalwizardry", "gui/nei/bindingRitual.png").toString(); + } + + public static Point getMousePosition() + { + Dimension size = displaySize(); + Dimension res = displayRes(); + return new Point(Mouse.getX() * size.width / res.width, size.height - Mouse.getY() * size.height / res.height - 1); + } + + public static Dimension displaySize() + { + Minecraft mc = Minecraft.getMinecraft(); + ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); + return new Dimension(res.getScaledWidth(), res.getScaledHeight()); + } + + public static Dimension displayRes() + { + Minecraft mc = Minecraft.getMinecraft(); + return new Dimension(mc.displayWidth, mc.displayHeight); + } +} \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapedHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapedHandler.java index e67afd56..b32f47cd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapedHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapedHandler.java @@ -1,142 +1,142 @@ -//package WayofTime.alchemicalWizardry.client.nei; -// -//import java.awt.Rectangle; -//import java.util.ArrayList; -//import java.util.List; -// -//import net.minecraft.item.Item; -//import net.minecraft.item.ItemStack; -//import net.minecraft.item.crafting.CraftingManager; -//import net.minecraft.item.crafting.IRecipe; -//import net.minecraft.util.StatCollector; -//import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; -//import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; -//import codechicken.nei.NEIServerUtils; -//import codechicken.nei.PositionedStack; -//import codechicken.nei.recipe.ShapedRecipeHandler; -// -///** -// * NEI Blood Orb Shaped Recipe Handler by joshie * -// */ -//public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler { -// public class CachedBloodOrbRecipe extends CachedShapedRecipe { -// public CachedBloodOrbRecipe(int width, int height, Object[] items, ItemStack out) { -// super(width, height, items, out); -// } -// -// @Override -// public void setIngredients(int width, int height, Object[] items) { -// for (int x = 0; x < width; x++) { -// for (int y = 0; y < height; y++) { -// if (items[y * width + x] == null) -// continue; -// -// Object o = items[y * width + x]; -// if (o instanceof ItemStack) { -// PositionedStack stack = new PositionedStack(items[y * width + x], 25 + x * 18, 6 + y * 18, false); -// stack.setMaxSize(1); -// ingredients.add(stack); -// } else if (o instanceof Integer) { -// ArrayList orbs = new ArrayList(); -// for (Item item : NEIConfig.bloodOrbs) { -// if (((IBloodOrb) item).getOrbLevel() >= (Integer) o) { -// orbs.add(new ItemStack(item)); -// } -// } -// -// PositionedStack stack = new PositionedStack(orbs, 25 + x * 18, 6 + y * 18, false); -// stack.setMaxSize(1); -// ingredients.add(stack); -// }else if(o instanceof List) -// { -// PositionedStack stack = new PositionedStack(o, 25 + x * 18, 6 + y * 18, false); -// stack.setMaxSize(1); -// ingredients.add(stack); -// } -// } -// } -// } -// } -// -// @Override -// public void loadCraftingRecipes(String outputId, Object... results) { -// if (outputId.equals("crafting") && getClass() == NEIBloodOrbShapedHandler.class) { -// for (IRecipe irecipe : (List) CraftingManager.getInstance().getRecipeList()) { -// if (irecipe instanceof ShapedBloodOrbRecipe) { -// CachedBloodOrbRecipe recipe = forgeShapedRecipe((ShapedBloodOrbRecipe) irecipe); -// if (recipe == null) -// continue; -// -// recipe.computeVisuals(); -// arecipes.add(recipe); -// } -// } -// } else { -// super.loadCraftingRecipes(outputId, results); -// } -// } -// -// @Override -// public void loadCraftingRecipes(ItemStack result) { -// for (IRecipe irecipe : (List) CraftingManager.getInstance().getRecipeList()) { -// if (irecipe instanceof ShapedBloodOrbRecipe) { -// CachedBloodOrbRecipe recipe = forgeShapedRecipe((ShapedBloodOrbRecipe) irecipe); -// if (recipe == null || !NEIServerUtils.areStacksSameTypeCrafting(recipe.result.item, result)) -// continue; -// -// recipe.computeVisuals(); -// arecipes.add(recipe); -// } -// } -// } -// -// @Override -// public void loadUsageRecipes(ItemStack ingredient) { -// for (IRecipe irecipe : (List) CraftingManager.getInstance().getRecipeList()) { -// CachedShapedRecipe recipe = null; -// if (irecipe instanceof ShapedBloodOrbRecipe) -// recipe = forgeShapedRecipe((ShapedBloodOrbRecipe) irecipe); -// -// if (recipe == null || !recipe.contains(recipe.ingredients, ingredient.getItem())) -// continue; -// -// recipe.computeVisuals(); -// if (recipe.contains(recipe.ingredients, ingredient)) { -// recipe.setIngredientPermutation(recipe.ingredients, ingredient); -// arecipes.add(recipe); -// } -// } -// } -// -// private CachedBloodOrbRecipe forgeShapedRecipe(ShapedBloodOrbRecipe recipe) { -// int width; -// int height; -// try { -// width = recipe.width; -// height = recipe.height; -// } catch (Exception e) { -// e.printStackTrace(); -// return null; -// } -// -// Object[] items = recipe.getInput(); -// for (Object item : items) -// if (item instanceof List && ((List) item).isEmpty())// ore -// // handler, -// // no ores -// return null; -// -// return new CachedBloodOrbRecipe(width, height, items, recipe.getRecipeOutput()); -// } -// -// @Override -// public void loadTransferRects() { -// transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18), "crafting")); -// } -// -// -// @Override -// public String getRecipeName() { -// return StatCollector.translateToLocal("bm.string.crafting.orb.shaped"); -// } -//} +package WayofTime.alchemicalWizardry.client.nei; + +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.StatCollector; +import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.ShapedRecipeHandler; + +/** + * NEI Blood Orb Shaped Recipe Handler by joshie * + */ +public class NEIBloodOrbShapedHandler extends ShapedRecipeHandler { + public class CachedBloodOrbRecipe extends CachedShapedRecipe { + public CachedBloodOrbRecipe(int width, int height, Object[] items, ItemStack out) { + super(width, height, items, out); + } + + @Override + public void setIngredients(int width, int height, Object[] items) { + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + if (items[y * width + x] == null) + continue; + + Object o = items[y * width + x]; + if (o instanceof ItemStack) { + PositionedStack stack = new PositionedStack(items[y * width + x], 25 + x * 18, 6 + y * 18, false); + stack.setMaxSize(1); + ingredients.add(stack); + } else if (o instanceof Integer) { + ArrayList orbs = new ArrayList(); + for (Item item : NEIConfig.bloodOrbs) { + if (((IBloodOrb) item).getOrbLevel() >= (Integer) o) { + orbs.add(new ItemStack(item)); + } + } + + PositionedStack stack = new PositionedStack(orbs, 25 + x * 18, 6 + y * 18, false); + stack.setMaxSize(1); + ingredients.add(stack); + }else if(o instanceof List) + { + PositionedStack stack = new PositionedStack(o, 25 + x * 18, 6 + y * 18, false); + stack.setMaxSize(1); + ingredients.add(stack); + } + } + } + } + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals("crafting") && getClass() == NEIBloodOrbShapedHandler.class) { + for (IRecipe irecipe : (List) CraftingManager.getInstance().getRecipeList()) { + if (irecipe instanceof ShapedBloodOrbRecipe) { + CachedBloodOrbRecipe recipe = forgeShapedRecipe((ShapedBloodOrbRecipe) irecipe); + if (recipe == null) + continue; + + recipe.computeVisuals(); + arecipes.add(recipe); + } + } + } else { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) { + for (IRecipe irecipe : (List) CraftingManager.getInstance().getRecipeList()) { + if (irecipe instanceof ShapedBloodOrbRecipe) { + CachedBloodOrbRecipe recipe = forgeShapedRecipe((ShapedBloodOrbRecipe) irecipe); + if (recipe == null || !NEIServerUtils.areStacksSameTypeCrafting(recipe.result.item, result)) + continue; + + recipe.computeVisuals(); + arecipes.add(recipe); + } + } + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) { + for (IRecipe irecipe : (List) CraftingManager.getInstance().getRecipeList()) { + CachedShapedRecipe recipe = null; + if (irecipe instanceof ShapedBloodOrbRecipe) + recipe = forgeShapedRecipe((ShapedBloodOrbRecipe) irecipe); + + if (recipe == null || !recipe.contains(recipe.ingredients, ingredient.getItem())) + continue; + + recipe.computeVisuals(); + if (recipe.contains(recipe.ingredients, ingredient)) { + recipe.setIngredientPermutation(recipe.ingredients, ingredient); + arecipes.add(recipe); + } + } + } + + private CachedBloodOrbRecipe forgeShapedRecipe(ShapedBloodOrbRecipe recipe) { + int width; + int height; + try { + width = recipe.width; + height = recipe.height; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + + Object[] items = recipe.getInput(); + for (Object item : items) + if (item instanceof List && ((List) item).isEmpty())// ore + // handler, + // no ores + return null; + + return new CachedBloodOrbRecipe(width, height, items, recipe.getRecipeOutput()); + } + + @Override + public void loadTransferRects() { + transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18), "crafting")); + } + + + @Override + public String getRecipeName() { + return StatCollector.translateToLocal("bm.string.crafting.orb.shaped"); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapelessHandler.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapelessHandler.java index ce531bb0..ebf7afba 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapelessHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIBloodOrbShapelessHandler.java @@ -1,135 +1,135 @@ -//package WayofTime.alchemicalWizardry.client.nei; -// -//import java.awt.Rectangle; -//import java.util.ArrayList; -//import java.util.List; -// -//import net.minecraft.item.Item; -//import net.minecraft.item.ItemStack; -//import net.minecraft.item.crafting.CraftingManager; -//import net.minecraft.item.crafting.IRecipe; -//import net.minecraft.util.StatCollector; -//import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe; -//import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; -//import codechicken.nei.NEIServerUtils; -//import codechicken.nei.PositionedStack; -//import codechicken.nei.recipe.ShapelessRecipeHandler; -// -///** -// * NEI Blood Orb Shapeless Recipe Handler by joshie * -// */ -//public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler { -// public class CachedBloodOrbRecipe extends CachedShapelessRecipe { -// public CachedBloodOrbRecipe(ArrayList items, ItemStack recipeOutput) { -// super(items, recipeOutput); -// } -// -// @Override -// public void setIngredients(List items) { -// ingredients.clear(); -// for (int ingred = 0; ingred < items.size(); ingred++) { -// Object o = items.get(ingred); -// if (o instanceof ItemStack) { -// PositionedStack stack = new PositionedStack(items.get(ingred), 25 + stackorder[ingred][0] * 18, 6 + stackorder[ingred][1] * 18); -// stack.setMaxSize(1); -// ingredients.add(stack); -// } else if (o instanceof Integer) { -// ArrayList orbs = new ArrayList(); -// for (Item item : NEIConfig.bloodOrbs) { -// if (((IBloodOrb) item).getOrbLevel() >= (Integer) o) { -// orbs.add(new ItemStack(item)); -// } -// } -// -// PositionedStack stack = new PositionedStack(orbs, 25 + stackorder[ingred][0] * 18, 6 + stackorder[ingred][1] * 18); -// stack.setMaxSize(1); -// ingredients.add(stack); -// }else if(o instanceof List) -// { -// PositionedStack stack = new PositionedStack(o, 25 + stackorder[ingred][0] * 18, 6 + stackorder[ingred][1] * 18); -// stack.setMaxSize(1); -// ingredients.add(stack); -// } -// } -// } -// } -// -// @Override -// public void loadCraftingRecipes(String outputId, Object... results) { -// if (outputId.equals("crafting") && getClass() == NEIBloodOrbShapelessHandler.class) { -// List allrecipes = CraftingManager.getInstance().getRecipeList(); -// for (IRecipe irecipe : allrecipes) { -// CachedBloodOrbRecipe recipe = null; -// if (irecipe instanceof ShapelessBloodOrbRecipe) -// recipe = forgeShapelessRecipe((ShapelessBloodOrbRecipe) irecipe); -// -// if (recipe == null) -// continue; -// -// arecipes.add(recipe); -// } -// } else { -// super.loadCraftingRecipes(outputId, results); -// } -// } -// -// @Override -// public void loadCraftingRecipes(ItemStack result) { -// List allrecipes = CraftingManager.getInstance().getRecipeList(); -// for (IRecipe irecipe : allrecipes) { -// if (NEIServerUtils.areStacksSameTypeCrafting(irecipe.getRecipeOutput(), result)) { -// CachedBloodOrbRecipe recipe = null; -// if (irecipe instanceof ShapelessBloodOrbRecipe) -// recipe = forgeShapelessRecipe((ShapelessBloodOrbRecipe) irecipe); -// -// if (recipe == null) -// continue; -// -// arecipes.add(recipe); -// } -// } -// } -// -// @Override -// public void loadUsageRecipes(ItemStack ingredient) { -// List allrecipes = CraftingManager.getInstance().getRecipeList(); -// for (IRecipe irecipe : allrecipes) { -// CachedBloodOrbRecipe recipe = null; -// if (irecipe instanceof ShapelessBloodOrbRecipe) -// recipe = forgeShapelessRecipe((ShapelessBloodOrbRecipe) irecipe); -// -// if (recipe == null) -// continue; -// -// if (recipe.contains(recipe.ingredients, ingredient)) { -// recipe.setIngredientPermutation(recipe.ingredients, ingredient); -// arecipes.add(recipe); -// } -// } -// } -// -// public CachedBloodOrbRecipe forgeShapelessRecipe(ShapelessBloodOrbRecipe recipe) { -// ArrayList items = recipe.getInput(); -// -// for (Object item : items) -// if (item instanceof List && ((List) item).isEmpty())//ore handler, no ores -// return null; -// -// return new CachedBloodOrbRecipe(items, recipe.getRecipeOutput()); -// } -// -// @Override -// public void loadTransferRects() { -// transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18), "crafting")); -// } -// -// @Override -// public String getOverlayIdentifier() { -// return "crafting"; -// } -// -// @Override -// public String getRecipeName() { -// return StatCollector.translateToLocal("bm.string.crafting.orb.shapeless"); -// } -//} +package WayofTime.alchemicalWizardry.client.nei; + +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.StatCollector; +import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe; +import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.ShapelessRecipeHandler; + +/** + * NEI Blood Orb Shapeless Recipe Handler by joshie * + */ +public class NEIBloodOrbShapelessHandler extends ShapelessRecipeHandler { + public class CachedBloodOrbRecipe extends CachedShapelessRecipe { + public CachedBloodOrbRecipe(ArrayList items, ItemStack recipeOutput) { + super(items, recipeOutput); + } + + @Override + public void setIngredients(List items) { + ingredients.clear(); + for (int ingred = 0; ingred < items.size(); ingred++) { + Object o = items.get(ingred); + if (o instanceof ItemStack) { + PositionedStack stack = new PositionedStack(items.get(ingred), 25 + stackorder[ingred][0] * 18, 6 + stackorder[ingred][1] * 18); + stack.setMaxSize(1); + ingredients.add(stack); + } else if (o instanceof Integer) { + ArrayList orbs = new ArrayList(); + for (Item item : NEIConfig.bloodOrbs) { + if (((IBloodOrb) item).getOrbLevel() >= (Integer) o) { + orbs.add(new ItemStack(item)); + } + } + + PositionedStack stack = new PositionedStack(orbs, 25 + stackorder[ingred][0] * 18, 6 + stackorder[ingred][1] * 18); + stack.setMaxSize(1); + ingredients.add(stack); + }else if(o instanceof List) + { + PositionedStack stack = new PositionedStack(o, 25 + stackorder[ingred][0] * 18, 6 + stackorder[ingred][1] * 18); + stack.setMaxSize(1); + ingredients.add(stack); + } + } + } + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals("crafting") && getClass() == NEIBloodOrbShapelessHandler.class) { + List allrecipes = CraftingManager.getInstance().getRecipeList(); + for (IRecipe irecipe : allrecipes) { + CachedBloodOrbRecipe recipe = null; + if (irecipe instanceof ShapelessBloodOrbRecipe) + recipe = forgeShapelessRecipe((ShapelessBloodOrbRecipe) irecipe); + + if (recipe == null) + continue; + + arecipes.add(recipe); + } + } else { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) { + List allrecipes = CraftingManager.getInstance().getRecipeList(); + for (IRecipe irecipe : allrecipes) { + if (NEIServerUtils.areStacksSameTypeCrafting(irecipe.getRecipeOutput(), result)) { + CachedBloodOrbRecipe recipe = null; + if (irecipe instanceof ShapelessBloodOrbRecipe) + recipe = forgeShapelessRecipe((ShapelessBloodOrbRecipe) irecipe); + + if (recipe == null) + continue; + + arecipes.add(recipe); + } + } + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) { + List allrecipes = CraftingManager.getInstance().getRecipeList(); + for (IRecipe irecipe : allrecipes) { + CachedBloodOrbRecipe recipe = null; + if (irecipe instanceof ShapelessBloodOrbRecipe) + recipe = forgeShapelessRecipe((ShapelessBloodOrbRecipe) irecipe); + + if (recipe == null) + continue; + + if (recipe.contains(recipe.ingredients, ingredient)) { + recipe.setIngredientPermutation(recipe.ingredients, ingredient); + arecipes.add(recipe); + } + } + } + + public CachedBloodOrbRecipe forgeShapelessRecipe(ShapelessBloodOrbRecipe recipe) { + ArrayList items = recipe.getInput(); + + for (Object item : items) + if (item instanceof List && ((List) item).isEmpty())//ore handler, no ores + return null; + + return new CachedBloodOrbRecipe(items, recipe.getRecipeOutput()); + } + + @Override + public void loadTransferRects() { + transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18), "crafting")); + } + + @Override + public String getOverlayIdentifier() { + return "crafting"; + } + + @Override + public String getRecipeName() { + return StatCollector.translateToLocal("bm.string.crafting.orb.shapeless"); + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIConfig.java b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIConfig.java index b074ba6e..4fa27786 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIConfig.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/nei/NEIConfig.java @@ -1,35 +1,36 @@ -//package WayofTime.alchemicalWizardry.client.nei; -// -//import java.util.ArrayList; -// -//import net.minecraft.item.Item; -//import codechicken.nei.api.API; -//import codechicken.nei.api.IConfigureNEI; -// -//public class NEIConfig implements IConfigureNEI { -// public static ArrayList bloodOrbs = new ArrayList(); -// -// @Override -// public void loadConfig() { -// API.registerRecipeHandler(new NEIAlchemyRecipeHandler()); -// API.registerUsageHandler(new NEIAlchemyRecipeHandler()); -// API.registerRecipeHandler(new NEIAltarRecipeHandler()); -// API.registerUsageHandler(new NEIAltarRecipeHandler()); -// API.registerRecipeHandler(new NEIBloodOrbShapedHandler()); -// API.registerUsageHandler(new NEIBloodOrbShapedHandler()); -// API.registerRecipeHandler(new NEIBloodOrbShapelessHandler()); -// API.registerUsageHandler(new NEIBloodOrbShapelessHandler()); -// API.registerRecipeHandler(new NEIBindingRitualHandler()); -// API.registerUsageHandler(new NEIBindingRitualHandler()); -// } -// -// @Override -// public String getName() { -// return "Blood Magic NEI"; -// } -// -// @Override -// public String getVersion() { -// return "1.3"; -// } -//} +package WayofTime.alchemicalWizardry.client.nei; + + +import java.util.ArrayList; + +import net.minecraft.item.Item; +import codechicken.nei.api.API; +import codechicken.nei.api.IConfigureNEI; + +public class NEIConfig implements IConfigureNEI { + public static ArrayList bloodOrbs = new ArrayList(); + + @Override + public void loadConfig() { + API.registerRecipeHandler(new NEIAlchemyRecipeHandler()); + API.registerUsageHandler(new NEIAlchemyRecipeHandler()); + API.registerRecipeHandler(new NEIAltarRecipeHandler()); + API.registerUsageHandler(new NEIAltarRecipeHandler()); + API.registerRecipeHandler(new NEIBloodOrbShapedHandler()); + API.registerUsageHandler(new NEIBloodOrbShapedHandler()); + API.registerRecipeHandler(new NEIBloodOrbShapelessHandler()); + API.registerUsageHandler(new NEIBloodOrbShapelessHandler()); + API.registerRecipeHandler(new NEIBindingRitualHandler()); + API.registerUsageHandler(new NEIBindingRitualHandler()); + } + + @Override + public String getName() { + return "Blood Magic NEI"; + } + + @Override + public String getVersion() { + return "1.3"; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java index 502d4334..7c551e80 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RenderHelper.java @@ -167,7 +167,7 @@ public class RenderHelper private static List getHUDElements(Minecraft mc) { - List elements = new ArrayList(); + List elements = new ArrayList(); MovingObjectPosition movingobjectposition = mc.objectMouseOver; World world = mc.theWorld; diff --git a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RitualDivinerRender.java b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RitualDivinerRender.java index e2ceb005..9b877d3f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RitualDivinerRender.java +++ b/src/main/java/WayofTime/alchemicalWizardry/client/renderer/RitualDivinerRender.java @@ -21,8 +21,7 @@ import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner; - -/* +/** * Created in Scala by Alex-Hawks * Translated and implemented by Arcaratus */ diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java b/src/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java index 867e2b15..5fdf116b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/CommonProxy.java @@ -33,38 +33,16 @@ public class CommonProxy // Nothing here as the server doesn't render graphics! } - public void registerPostSideObjects() - { - - } + public void registerPostSideObjects() {} - public void registerEntities() - { - } + public void registerEntities() {} public World getClientWorld() { return null; } - public void registerActions() - { - } - - public void registerEvents() - { - } - - public void registerSoundHandler() - { - // Nothing here as this is a server side proxy - } - - public void registerTileEntities() - { - GameRegistry.registerTileEntity(TEAltar.class, "containerAltar"); - GameRegistry.registerTileEntity(TEMasterStone.class, "containerMasterStone"); - } + public void registerEvents() {} public void registerEntityTrackers() { @@ -88,12 +66,5 @@ public class CommonProxy EntityRegistry.registerModEntity(BookEntityItem.class, "bookEntityItem", 17, AlchemicalWizardry.instance, 120, 3, true); } - public void registerTickHandlers() - { - } - - public void InitRendering() - { - // TODO Auto-generated method stub - } + public void initRendering() {} } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsMod.java b/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsMod.java index c499c440..9511664d 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsMod.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsMod.java @@ -10,7 +10,7 @@ import java.util.List; public class AchievementsMod extends Achievement { - public static List achievements = new ArrayList(); + public static List achievements = new ArrayList(); public AchievementsMod(String name, int x, int y, ItemStack icon, Achievement parent) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsRegistry.java index 2f09461d..cd5f27b5 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/achievements/AchievementsRegistry.java @@ -10,8 +10,8 @@ import java.util.List; public class AchievementsRegistry { - public final static List craftinglist = new ArrayList(); - public final static List pickupList = new ArrayList(); + public final static List craftinglist = new ArrayList(); + public final static List pickupList = new ArrayList(); public static void init() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java index 0ac3bf52..0c0c4618 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/alchemy/CombinedPotionRegistry.java @@ -11,7 +11,7 @@ import java.util.List; public class CombinedPotionRegistry { - public static List potionList = new ArrayList(); + public static List potionList = new ArrayList(); public static void registerCombinedPotionRecipe(Potion result, Potion pot1, Potion pot2) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java b/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java index 7b064de4..013b550b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/bloodAltarUpgrade/UpgradedAltars.java @@ -14,11 +14,11 @@ import WayofTime.alchemicalWizardry.common.block.BlockBloodRune; public class UpgradedAltars { - public static List secondTierAltar = new ArrayList(); - public static List thirdTierAltar = new ArrayList(); - public static List fourthTierAltar = new ArrayList(); - public static List fifthTierAltar = new ArrayList(); - public static List sixthTierAltar = new ArrayList(); + public static List secondTierAltar = new ArrayList(); + public static List thirdTierAltar = new ArrayList(); + public static List fourthTierAltar = new ArrayList(); + public static List fifthTierAltar = new ArrayList(); + public static List sixthTierAltar = new ArrayList(); public static int highestAltar = 6; public static int isAltarValid(World world, BlockPos pos) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java index 527b60dc..6186b6c9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BlockSet.java @@ -40,7 +40,7 @@ public class BlockSet { this.blockid = blockid; this.metadata = new int[4]; - positions = new ArrayList(); + positions = new ArrayList(); } public BlockSet(Block block) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java index fb706a13..6c62e88a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/BuildingSchematic.java @@ -30,7 +30,7 @@ public class BuildingSchematic public BuildingSchematic(String name) { this.name = name; - blockList = new ArrayList(); + blockList = new ArrayList(); this.doorX = 0; this.doorZ = 0; this.doorY = 0; @@ -90,7 +90,7 @@ public class BuildingSchematic public List getGriddedPositions(EnumFacing dir) { - List positionList = new ArrayList(); + List positionList = new ArrayList(); for (BlockSet blockSet : blockList) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java deleted file mode 100644 index a135df1a..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/TileBlockSet.java +++ /dev/null @@ -1,8 +0,0 @@ -package WayofTime.alchemicalWizardry.common.demonVillage; - -import net.minecraft.nbt.NBTTagCompound; - -public class TileBlockSet extends BlockSet -{ - public NBTTagCompound tag; -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityDemonAIHurtByTarget.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityDemonAIHurtByTarget.java index a80ea0ba..303ab7a2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityDemonAIHurtByTarget.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/ai/EntityDemonAIHurtByTarget.java @@ -36,7 +36,7 @@ public class EntityDemonAIHurtByTarget extends EntityAIHurtByTarget this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - if (this.entityCallsForHelp && this.taskOwner instanceof IHoardDemon) + if (this.entityCallsForHelp) { if(portal instanceof TEDemonPortal) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonHoardPacket.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonHoardPacket.java index ba35ddde..8d0274ad 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonHoardPacket.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonHoardPacket.java @@ -5,10 +5,7 @@ import net.minecraft.world.World; public abstract class DemonHoardPacket { - public DemonHoardPacket() - { - - } + public DemonHoardPacket() {} public abstract int summonDemons(TEDemonPortal teDemonPortal, World world, int x, int y, int z, DemonType type, int tier, boolean spawnGuardian); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonPacketRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonPacketRegistry.java index fd193f95..2d30d788 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonPacketRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/DemonPacketRegistry.java @@ -9,7 +9,7 @@ import net.minecraft.world.World; public class DemonPacketRegistry { - public static Map packetMap = new HashMap(); + public static Map packetMap = new HashMap(); public static boolean registerDemonPacket(String string, DemonHoardPacket packet) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java index 613eaf56..f257f01b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/EntityMinorDemonGrunt.java @@ -513,6 +513,6 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan BlockPos position = demon.getPortalLocation(); TileEntity portal = worldObj.getTileEntity(this.demonPortal); - return portal instanceof TEDemonPortal ? portal == worldObj.getTileEntity(position) : false; + return portal instanceof TEDemonPortal && portal == worldObj.getTileEntity(position); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java index 61732750..aee48836 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/demonHoard/demon/IHoardDemon.java @@ -5,7 +5,10 @@ import net.minecraft.util.BlockPos; public interface IHoardDemon { void setPortalLocation(BlockPos position); + BlockPos getPortalLocation(); + boolean thrallDemon(BlockPos location); + boolean isSamePortal(IHoardDemon demon); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java index 2b648fb8..b5e4d0d1 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/loot/DemonVillageLootRegistry.java @@ -11,7 +11,7 @@ import WayofTime.alchemicalWizardry.ModItems; public class DemonVillageLootRegistry { - public static ArrayList list1 = new ArrayList(); + public static ArrayList list1 = new ArrayList(); public static void init() { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonChest.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonChest.java index 8444a3a9..528d6142 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonChest.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonChest.java @@ -43,10 +43,7 @@ public class TEDemonChest extends TileEntityChest implements ITilePortalNode } @Override - public void checkForAdjacentChests() - { - - } + public void checkForAdjacentChests() {} @Override public void setPortalLocation(TEDemonPortal teDemonPortal) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java index a086a797..d5a1fee6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/demonVillage/tileEntity/TEDemonPortal.java @@ -66,9 +66,9 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox public static int[] tierCostList = new int[]{1500}; - public Set hoardList = new HashSet(); + public Set hoardList = new HashSet(); - public static List buildingList = new ArrayList(); + public static List buildingList = new ArrayList(); public Random rand = new Random(); private GridSpace[][] area; @@ -168,7 +168,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox { float totalChance = 0; - Map map = new HashMap(); + Map map = new HashMap(); map.put("roadChance", this.getRoadChance()); map.put("houseChance", this.getHouseChance()); map.put("demonPortalChance", this.getDemonPortalChance()); @@ -661,7 +661,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox public List findValidExtentionDirection(int x, int z) { - List directions = new LinkedList(); + List directions = new LinkedList(); if (this.getGridSpace(x, z) == null || !this.getGridSpace(x, z).isRoadSegment()) { @@ -1197,7 +1197,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox // GridSpaceHolder grid = this.createGSH(); - List directions = new ArrayList(); + List directions = new ArrayList(); for (int i = 2; i < 6; i++) { @@ -1210,7 +1210,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return 0; } - HashMap> schemMap = new HashMap(); + HashMap> schemMap = new HashMap>(); for (EnumFacing nextDir : directions) { @@ -1226,7 +1226,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox schemMap.get(nextDir).add(build); } else { - schemMap.put(nextDir, new ArrayList()); + schemMap.put(nextDir, new ArrayList()); schemMap.get(nextDir).add(build); } } @@ -1353,7 +1353,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return 0; } - List directions = new ArrayList(); + List directions = new ArrayList(); for (int i = 2; i < 6; i++) { @@ -1369,7 +1369,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox return 0; } - HashMap> schemMap = new HashMap(); + HashMap> schemMap = new HashMap>(); for (EnumFacing nextDir : directions) { @@ -1390,7 +1390,7 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox schemMap.get(nextDir).add(build); } else { - schemMap.put(nextDir, new ArrayList()); + schemMap.put(nextDir, new ArrayList()); schemMap.get(nextDir).add(build); } } else @@ -1418,10 +1418,6 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox build.setAllGridSpaces(x + xOff, z + zOff, yLevel, chosenDirection.getOpposite(), GridSpace.HOUSE, grid); this.loadGSH(grid); - DemonVillagePath path = new DemonVillagePath(pos.getX() + (x) * 5, yLevel, pos.getZ() + (z) * 5, chosenDirection, 2); - - Int3AndBool temp = path.constructFullPath(this, worldObj, this.getRoadStepClearance()); - return build.getNumberOfGridSpaces(); } @@ -1451,11 +1447,6 @@ public class TEDemonPortal extends TileEntity implements IUpdatePlayerListBox public void createRoad(int xi, int yi, int zi, EnumFacing dir, int length, boolean doesNotDrop) { - int curX = xi; - int curY = yi; - int curZ = zi; - int roadRadius = this.getRoadRadius(); - if (dir.getFrontOffsetY() != 0) { return; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java index 58b13aa2..08dbb8bc 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBileDemon.java @@ -17,8 +17,6 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry; public class EntityBileDemon extends EntityDemon { - - public EntityBileDemon(World par1World) { super(par1World, AlchemicalWizardry.entityBileDemonID); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java index 973908d4..7d431217 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityBoulderFist.java @@ -21,9 +21,6 @@ public class EntityBoulderFist extends EntityDemon { private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); - private static float maxTamedHealth = 60.0F; - private static float maxUntamedHealth = 50.0F; - public EntityBoulderFist(World par1World) { super(par1World, AlchemicalWizardry.entityBoulderFistID); @@ -56,6 +53,8 @@ public class EntityBoulderFist extends EntityDemon super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + float maxTamedHealth = 60.0F; + float maxUntamedHealth = 50.0F; //My guess is that this will alter the max health if (this.isTamed()) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java index c65baff2..ad095378 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityDemon.java @@ -9,7 +9,6 @@ import net.minecraft.entity.monster.EntityGhast; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.ItemFood; @@ -183,6 +182,7 @@ public class EntityDemon extends EntityTameable implements IDemon } } + @Override /** * main AI tick function, replaces updateEntityActionState */ @@ -191,6 +191,7 @@ public class EntityDemon extends EntityTameable implements IDemon this.dataWatcher.updateObject(18, this.getHealth()); } + @Override protected void entityInit() { super.entityInit(); @@ -207,6 +208,7 @@ public class EntityDemon extends EntityTameable implements IDemon this.playSound("mob.zombie.step", 0.15F, 1.0F); } + @Override /** * (abstract) Protected helper method to write subclass entity data to NBT. */ @@ -217,6 +219,7 @@ public class EntityDemon extends EntityTameable implements IDemon par1NBTTagCompound.setByte("attackTimer", (byte) attackTimer); } + @Override /** * (abstract) Protected helper method to read subclass entity data from NBT. */ @@ -228,6 +231,7 @@ public class EntityDemon extends EntityTameable implements IDemon attackTimer = par1NBTTagCompound.getByte("attackTimer"); } + @Override /** * Returns the sound this mob makes while it's alive. */ @@ -236,6 +240,7 @@ public class EntityDemon extends EntityTameable implements IDemon return "none"; } + @Override /** * Returns the sound this mob makes when it is hurt. */ @@ -244,6 +249,7 @@ public class EntityDemon extends EntityTameable implements IDemon return "mob.irongolem.hit"; } + @Override /** * Returns the sound this mob makes on death. */ @@ -252,6 +258,7 @@ public class EntityDemon extends EntityTameable implements IDemon return "mob.irongolem.death"; } + @Override /** * Returns the volume for the sounds this mob makes. */ @@ -273,6 +280,7 @@ public class EntityDemon extends EntityTameable implements IDemon return attackTimer; } + @Override /** * Called to update the entity's position/logic. */ @@ -281,11 +289,13 @@ public class EntityDemon extends EntityTameable implements IDemon super.onUpdate(); } + @Override public float getEyeHeight() { return this.height * 0.8F; } + @Override /** * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently * use in wolves. @@ -295,6 +305,7 @@ public class EntityDemon extends EntityTameable implements IDemon return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); } + @Override /** * Called when the entity is attacked. */ @@ -317,6 +328,7 @@ public class EntityDemon extends EntityTameable implements IDemon } } + @Override public boolean attackEntityAsMob(Entity par1Entity) { this.attackTimer = 10; @@ -332,6 +344,7 @@ public class EntityDemon extends EntityTameable implements IDemon return flag; } + @Override public void setTamed(boolean par1) { super.setTamed(par1); @@ -402,7 +415,7 @@ public class EntityDemon extends EntityTameable implements IDemon if (itemstack.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null); + par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null); } if (!this.worldObj.isRemote) @@ -463,41 +476,7 @@ public class EntityDemon extends EntityTameable implements IDemon } } - /** - * Return this wolf's collar color. - */ - public int getCollarColor() - { - return this.dataWatcher.getWatchableObjectByte(20) & 15; - } - - /** - * Set this wolf's collar color. - */ - public void setCollarColor(int par1) - { - this.dataWatcher.updateObject(20, par1 & 15); - } - - /** - * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. - */ - public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) - { - return null; - } - - public void func_70918_i(boolean par1) - { - if (par1) - { - this.dataWatcher.updateObject(19, 1); - } else - { - this.dataWatcher.updateObject(19, 0); - } - } - + @Override /** * Returns true if the mob is currently able to mate with the specified mob. */ @@ -511,6 +490,7 @@ public class EntityDemon extends EntityTameable implements IDemon return this.dataWatcher.getWatchableObjectByte(19) == 1; } + @Override /** * Determines if an entity can be despawned, used on idle far away entities */ diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java index 99934c7f..b37b4695 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityElemental.java @@ -45,19 +45,20 @@ public class EntityElemental extends EntityDemon } } - public int courseChangeCooldown; +// public int courseChangeCooldown; public double waypointX; public double waypointY; public double waypointZ; - private Entity targetedEntity; +/* private Entity targetedEntity; /** * Cooldown time between target loss and new target aquirement. - */ + private int aggroCooldown; public int prevAttackCounter; public int attackCounter; - +*/ + @Override /** * The explosion radius of spawned fireballs. */ @@ -69,18 +70,7 @@ public class EntityElemental extends EntityDemon } } - protected void fall(float par1) - { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - protected void updateFallState(double par1, boolean par3) - { - } - + @Override /** * Moves the entity based on the specified heading. Args: strafe, forward */ @@ -140,6 +130,7 @@ public class EntityElemental extends EntityDemon this.limbSwing += this.limbSwingAmount; } + @Override /** * returns true if this entity is by a ladder, false otherwise */ @@ -177,6 +168,7 @@ public class EntityElemental extends EntityDemon return true; } + @Override /** * Will return how many at most can spawn in a chunk at once. */ @@ -185,6 +177,7 @@ public class EntityElemental extends EntityDemon return 1; } + @Override /** * (abstract) Protected helper method to write subclass entity data to NBT. */ @@ -193,6 +186,7 @@ public class EntityElemental extends EntityDemon super.writeEntityToNBT(par1NBTTagCompound); } + @Override /** * (abstract) Protected helper method to read subclass entity data from NBT. */ @@ -221,6 +215,7 @@ public class EntityElemental extends EntityDemon } } + @Override /** * Returns true if the newer Entity AI code should be run */ @@ -229,6 +224,7 @@ public class EntityElemental extends EntityDemon return false; } + @Override /** * Sets the active target the Task system uses for tracking */ @@ -245,6 +241,7 @@ public class EntityElemental extends EntityDemon } } + @Override /** * main AI tick function, replaces updateEntityActionState */ @@ -253,6 +250,7 @@ public class EntityElemental extends EntityDemon this.dataWatcher.updateObject(18, this.getHealth()); } + @Override protected void entityInit() { super.entityInit(); @@ -261,6 +259,7 @@ public class EntityElemental extends EntityDemon this.dataWatcher.addObject(25, 0); } + @Override /** * Plays step sound at given x, y, z for the entity */ @@ -269,6 +268,7 @@ public class EntityElemental extends EntityDemon this.playSound("mob.zombie.step", 0.15F, 1.0F); } + @Override /** * Returns the sound this mob makes while it's alive. */ @@ -278,6 +278,7 @@ public class EntityElemental extends EntityDemon return "none"; } + @Override /** * Returns the sound this mob makes when it is hurt. */ @@ -286,6 +287,7 @@ public class EntityElemental extends EntityDemon return "none"; } + @Override /** * Returns the sound this mob makes on death. */ @@ -294,6 +296,7 @@ public class EntityElemental extends EntityDemon return "none"; } + @Override /** * Returns the volume for the sounds this mob makes. */ @@ -302,6 +305,7 @@ public class EntityElemental extends EntityDemon return 0.4F; } + @Override /** * Returns the item ID for the item the mob drops on death. */ @@ -310,6 +314,7 @@ public class EntityElemental extends EntityDemon return -1; } + @Override /** * Called to update the entity's position/logic. */ @@ -323,11 +328,13 @@ public class EntityElemental extends EntityDemon } } + @Override public float getEyeHeight() { return this.height * 0.8F; } + @Override /** * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently * use in wolves. @@ -337,6 +344,7 @@ public class EntityElemental extends EntityDemon return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); } + @Override /** * Called when the entity is attacked. */ @@ -359,12 +367,14 @@ public class EntityElemental extends EntityDemon } } + @Override public boolean attackEntityAsMob(Entity par1Entity) { int i = this.isTamed() ? 6 : 7; return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i); } + @Override public void setTamed(boolean par1) { super.setTamed(par1); @@ -378,10 +388,7 @@ public class EntityElemental extends EntityDemon } } - /** - * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. - */ - + @Override /** * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on * the animal type) @@ -391,6 +398,7 @@ public class EntityElemental extends EntityDemon return false; } + @Override /** * Determines whether this wolf is angry or not. */ @@ -399,6 +407,7 @@ public class EntityElemental extends EntityDemon return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; } + @Override /** * Sets whether this wolf is angry or not. */ @@ -426,6 +435,7 @@ public class EntityElemental extends EntityDemon } } + @Override /** * Returns true if the mob is currently able to mate with the specified mob. */ @@ -434,11 +444,13 @@ public class EntityElemental extends EntityDemon return false; } + @Override public boolean func_70922_bv() { return this.dataWatcher.getWatchableObjectByte(19) == 1; } + @Override /** * Determines if an entity can be despawned, used on idle far away entities */ diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java index 2fc2b8e5..8c654f08 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFallenAngel.java @@ -25,9 +25,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F); private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); - private static float maxTamedHealth = 50.0F; - private static float maxUntamedHealth = 50.0F; - public EntityFallenAngel(World par1World) { super(par1World, AlchemicalWizardry.entityFallenAngelID); @@ -60,6 +57,8 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + float maxTamedHealth = 50.0F; + float maxUntamedHealth = 50.0F; //My guess is that this will alter the max health if (this.isTamed()) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFireElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFireElemental.java index b09aa6e5..c54d4588 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFireElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityFireElemental.java @@ -15,6 +15,7 @@ public class EntityFireElemental extends EntityElemental implements IMob this.isImmuneToFire = true; } + @Override public void inflictEffectOnEntity(Entity target) { if (target instanceof EntityLivingBase) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityHolyElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityHolyElemental.java index 51be44c9..bbccf90e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityHolyElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityHolyElemental.java @@ -16,6 +16,7 @@ public class EntityHolyElemental extends EntityElemental implements IMob super(world, AlchemicalWizardry.entityHolyElementalID); } + @Override public void inflictEffectOnEntity(Entity target) { if (target instanceof EntityLivingBase) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java index 7f221801..33f72245 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityIceDemon.java @@ -24,9 +24,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 30, 50, 15.0F); private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); - private static float maxTamedHealth = 50.0F; - private static float maxUntamedHealth = 30.0F; - public EntityIceDemon(World par1World) { super(par1World, AlchemicalWizardry.entityIceDemonID); @@ -56,6 +53,8 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.40000001192092896D); + float maxTamedHealth = 50.0F; + float maxUntamedHealth = 30.0F; //My guess is that this will alter the max health if (this.isTamed()) @@ -67,6 +66,7 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob } } + @Override /** * Attack the specified entity using a ranged attack. */ diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java index 7b38c3df..6429aa2c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityLowerGuardian.java @@ -19,10 +19,6 @@ import WayofTime.alchemicalWizardry.common.EntityAITargetAggro; public class EntityLowerGuardian extends EntityDemon { - private static float maxTamedHealth = 50.0F; - private static float maxUntamedHealth = 30.0F; - private int attackTimer; - public EntityLowerGuardian(World par1World) { super(par1World, AlchemicalWizardry.entityLowerGuardianID); @@ -41,7 +37,6 @@ public class EntityLowerGuardian extends EntityDemon this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false)); this.setAggro(false); this.setTamed(false); - attackTimer = 0; } @Override @@ -50,6 +45,8 @@ public class EntityLowerGuardian extends EntityDemon super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + float maxTamedHealth = 50.0F; + float maxUntamedHealth = 30.0F; //My guess is that this will alter the max health if (this.isTamed()) @@ -61,8 +58,10 @@ public class EntityLowerGuardian extends EntityDemon } } - public EntityAgeable createChild(EntityAgeable par1EntityAgeable) +/* public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { return this.spawnBabyAnimal(par1EntityAgeable); } + I don't know what this method changed to + */ } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java index 299a2efc..4f76dc33 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShade.java @@ -22,9 +22,6 @@ public class EntityShade extends EntityDemon { private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); - private static float maxTamedHealth = 50.0F; - private static float maxUntamedHealth = 100.0F; - public EntityShade(World par1World) { super(par1World, AlchemicalWizardry.entityShadeID); @@ -56,6 +53,8 @@ public class EntityShade extends EntityDemon super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + float maxTamedHealth = 50.0F; + float maxUntamedHealth = 100.0F; //My guess is that this will alter the max health if (this.isTamed()) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShadeElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShadeElemental.java index 004fcce4..3e5ed0f3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShadeElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityShadeElemental.java @@ -15,6 +15,7 @@ public class EntityShadeElemental extends EntityElemental implements IMob super(world, AlchemicalWizardry.entityShadeElementalID); } + @Override public void inflictEffectOnEntity(Entity target) { if (target instanceof EntityLivingBase) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java index ea827fcd..d8b5da90 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntitySmallEarthGolem.java @@ -25,9 +25,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 25, 25, 15.0F); private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); - private static float maxTamedHealth = 20.0F; - private static float maxUntamedHealth = 10.0F; - public EntitySmallEarthGolem(World par1World) { super(par1World, AlchemicalWizardry.entitySmallEarthGolemID); @@ -58,6 +55,8 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.40000001192092896D); + float maxTamedHealth = 20.0F; + float maxUntamedHealth = 10.0F; //My guess is that this will alter the max health if (this.isTamed()) @@ -68,7 +67,8 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth); } } - + + @Override /** * Attack the specified entity using a ranged attack. */ diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWaterElemental.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWaterElemental.java index ab141887..449a1ea2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWaterElemental.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWaterElemental.java @@ -14,6 +14,7 @@ public class EntityWaterElemental extends EntityElemental implements IMob super(world, AlchemicalWizardry.entityWaterElementalID); } + @Override public void inflictEffectOnEntity(Entity target) { if (target instanceof EntityLivingBase) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java index 5b6720db..ef2de0c2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/mob/EntityWingedFireDemon.java @@ -25,9 +25,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F); private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); - private static float maxTamedHealth = 100.0F; - private static float maxUntamedHealth = 200.0F; - public EntityWingedFireDemon(World par1World) { super(par1World, AlchemicalWizardry.entityWingedFireDemonID); @@ -60,6 +57,8 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM super.applyEntityAttributes(); //This line affects the speed of the monster this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + float maxTamedHealth = 100.0F; + float maxUntamedHealth = 200.0F; //My guess is that this will alter the max health if (this.isTamed()) @@ -73,6 +72,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM //this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D); } + @Override /** * Attack the specified entity using a ranged attack. */ diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java index 3d6b7e36..57cde54c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EnergyBlastProjectile.java @@ -24,7 +24,7 @@ import net.minecraftforge.fml.common.registry.IThrowableEntity; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -//Shamelessly ripped off from x3n0ph0b3 +//Shamelessly ripped off from x3n0ph0b3 //Shame! public class EnergyBlastProjectile extends Entity implements IProjectile, IThrowableEntity { protected int xTile = -1; @@ -39,8 +39,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow public EntityLivingBase shootingEntity; protected int ticksInAir = 0; protected int maxTicksInAir = 600; - private int ricochetCounter = 0; - private boolean scheduledForDeath = false; protected int projectileDamage; public EnergyBlastProjectile(World par1World) @@ -114,7 +112,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow double d4 = d0 / d3; double d5 = d2 / d3; this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3); - float f4 = (float) d3 * 0.2F; this.setThrowableHeading(d0, d1, d2, par4, par5); } @@ -261,6 +258,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow double var7 = 0.0D; Iterator var9 = var6.iterator(); float var11; + boolean scheduledForDeath = false; while (var9.hasNext()) { @@ -358,13 +356,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow return false; } - /** - * Sets the amount of knockback the arrow applies when it hits a mob. - */ - public void setKnockbackStrength(int par1) - { - } - /** * If returns false, the item will not inflict any damage against entities. */ @@ -483,6 +474,5 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow { if (entity instanceof EntityLivingBase) this.shootingEntity = (EntityLivingBase) entity; - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBeamParticle.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBeamParticle.java deleted file mode 100644 index d4029d91..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBeamParticle.java +++ /dev/null @@ -1,16 +0,0 @@ -package WayofTime.alchemicalWizardry.common.entity.projectile; - -import net.minecraft.client.particle.EntityFX; -import net.minecraft.world.World; - -public class EntityBeamParticle extends EntityFX -{ - - protected EntityBeamParticle(World p_i1218_1_, double p_i1218_2_, - double p_i1218_4_, double p_i1218_6_) - { - super(p_i1218_1_, p_i1218_2_, p_i1218_4_, p_i1218_6_); - // TODO Auto-generated constructor stub - } - -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java index 0cc5adf7..4b1665fb 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityBloodLightProjectile.java @@ -11,7 +11,6 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import WayofTime.alchemicalWizardry.ModBlocks; - public class EntityBloodLightProjectile extends EnergyBlastProjectile { public EntityBloodLightProjectile(World par1World) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java index 11617db3..55f8b9f0 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaMainProjectile.java @@ -53,7 +53,7 @@ public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile this.onImpact(mop.entityHit); } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { - worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float) (5.0f), false); + worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, 5.0f, false); this.spawnSecondaryProjectiles(); } @@ -74,7 +74,7 @@ public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile spawnSecondaryProjectiles(); } - worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float) (5.0f), false); + worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, 5.0f, false); } spawnHitParticles(EnumParticleTypes.CRIT_MAGIC, 8); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java index 992b733d..ad105632 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityEnergyBazookaSecondaryProjectile.java @@ -302,13 +302,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil return false; } - /** - * Sets the amount of knockback the arrow applies when it hits a mob. - */ - public void setKnockbackStrength(int par1) - { - } - /** * If returns false, the item will not inflict any damage against entities. */ @@ -318,6 +311,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil return false; } + @Override /** * Whether the arrow has a stream of critical hit particles flying behind * it. @@ -335,6 +329,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil } } + @Override /** * Whether the arrow has a stream of critical hit particles flying behind * it. @@ -345,6 +340,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil return (var1 & 1) != 0; } + @Override public void onImpact(MovingObjectPosition mop) { if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mop.entityHit != null) @@ -362,6 +358,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil } } + @Override public void onImpact(Entity mop) { if (mop == shootingEntity && ticksInAir > 3) @@ -383,6 +380,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil return rand.nextInt(6) + 1; } + @Override protected void spawnHitParticles(EnumParticleTypes type, int i) { for (int particles = 0; particles < i; particles++) @@ -391,11 +389,13 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil } } + @Override public void doDamage(int i, Entity mop) { mop.attackEntityFrom(this.getDamageSource(), i); } + @Override public DamageSource getDamageSource() { return DamageSource.causeMobDamage(shootingEntity); @@ -406,11 +406,13 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil this.ricochet(sideHit); } + @Override public double smallGauss(double d) { return (worldObj.rand.nextFloat() - 0.5D) * d; } + @Override public double gaussian(double d) { return d + d * ((rand.nextFloat() - 0.5D) / 4); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java index e2a0ba8e..32ac5547 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/EntityParticleBeam.java @@ -34,7 +34,6 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl public EntityLivingBase shootingEntity; protected int ticksInAir = 0; protected int maxTicksInAir = 600; - private int ricochetCounter = 0; private boolean scheduledForDeath = false; protected int projectileDamage; @@ -109,7 +108,6 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl double d4 = d0 / d3; double d5 = d2 / d3; this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3); - float f4 = (float) d3 * 0.2F; this.setThrowableHeading(d0, d1, d2, par4, par5); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java index f01f4812..19b1086a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/FireProjectile.java @@ -86,12 +86,12 @@ public class FireProjectile extends EnergyBlastProjectile { if (mop instanceof EntityLivingBase) { - ((EntityLivingBase) mop).setFire(10 * this.projectileDamage); + mop.setFire(10 * this.projectileDamage); ((EntityLivingBase) mop).setRevengeTarget(shootingEntity); - if (((EntityLivingBase) mop).isPotionActive(Potion.fireResistance) || ((EntityLivingBase) mop).isImmuneToFire()) + if (((EntityLivingBase) mop).isPotionActive(Potion.fireResistance) || mop.isImmuneToFire()) { - ((EntityLivingBase) mop).attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); + mop.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1); } else { doDamage(projectileDamage, mop); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java index 24fb77fa..f662ab31 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/HolyProjectile.java @@ -52,7 +52,7 @@ public class HolyProjectile extends EnergyBlastProjectile } this.onImpact(mop.entityHit); - } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + } //else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { } @@ -72,7 +72,7 @@ public class HolyProjectile extends EnergyBlastProjectile { if (((EntityLivingBase) mop).isEntityUndead()) { - doDamage((int) (projectileDamage * 2), mop); + doDamage(projectileDamage * 2, mop); } else { doDamage(projectileDamage, mop); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java index 29d44965..130f88f9 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/IceProjectile.java @@ -54,7 +54,7 @@ public class IceProjectile extends EnergyBlastProjectile } this.onImpact(mop.entityHit); - } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + }// else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { } this.setDead(); @@ -71,9 +71,9 @@ public class IceProjectile extends EnergyBlastProjectile { if (mop instanceof EntityLivingBase) { - if (((EntityLivingBase) mop).isImmuneToFire()) + if (mop.isImmuneToFire()) { - doDamage((int) (projectileDamage * 2), mop); + doDamage(projectileDamage * 2, mop); ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 2)); } else { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java index 938a94c8..6995f529 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/MudProjectile.java @@ -60,7 +60,7 @@ public class MudProjectile extends EnergyBlastProjectile } this.onImpact(mop.entityHit); - } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + }// else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java index 6ed6d1a2..8b2308b7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/TeleportProjectile.java @@ -84,7 +84,7 @@ public class TeleportProjectile extends EnergyBlastProjectile { if (shootingEntity.isRiding()) { - shootingEntity.mountEntity((Entity) null); + shootingEntity.mountEntity(null); } shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); } @@ -118,7 +118,7 @@ public class TeleportProjectile extends EnergyBlastProjectile { if (shootingEntity.isRiding()) { - shootingEntity.mountEntity((Entity) null); + shootingEntity.mountEntity(null); } shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java index d76b227b..556bddbe 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WaterProjectile.java @@ -49,7 +49,7 @@ public class WaterProjectile extends EnergyBlastProjectile } this.onImpact(mop.entityHit); - } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + }// else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { } @@ -66,7 +66,7 @@ public class WaterProjectile extends EnergyBlastProjectile { if (mop instanceof EntityLivingBase) { - if (((EntityLivingBase) mop).isImmuneToFire()) + if (mop.isImmuneToFire()) { doDamage(projectileDamage * 2, mop); ((EntityLivingBase) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 80, 1)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java index 59562027..6af663b7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/entity/projectile/WindGustProjectile.java @@ -52,7 +52,7 @@ public class WindGustProjectile extends EnergyBlastProjectile } this.onImpact(mop.entityHit); - } else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + }// else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java index d4716f18..06c4b2fc 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IEnchantmentGlyph.java @@ -5,6 +5,7 @@ import net.minecraft.world.World; public interface IEnchantmentGlyph extends IStabilityGlyph { - public int getEnchantability(World world, BlockPos pos, int meta); - public int getEnchantmentLevel(World world, BlockPos pos, int meta); + int getEnchantability(World world, BlockPos pos, int meta); + + int getEnchantmentLevel(World world, BlockPos pos, int meta); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java index 97bf5814..2b826b0f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/IStabilityGlyph.java @@ -5,5 +5,5 @@ import net.minecraft.world.World; public interface IStabilityGlyph { - public int getAdditionalStabilityForFaceCount(World world, BlockPos pos, int meta, int faceCount); + int getAdditionalStabilityForFaceCount(World world, BlockPos pos, int meta, int faceCount); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaRegistry.java b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaRegistry.java index d8106b55..0f804337 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaRegistry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/omega/OmegaRegistry.java @@ -9,7 +9,7 @@ import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour; public class OmegaRegistry { - public static HashMap omegaList = new HashMap(); + public static HashMap omegaList = new HashMap(); public static void registerParadigm(Reagent reagent, OmegaParadigm parad) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java index d3aeb4d9..29185083 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/AlchemyCircleRenderer.java @@ -2,7 +2,6 @@ package WayofTime.alchemicalWizardry.common.renderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @@ -48,15 +47,12 @@ public class AlchemyCircleRenderer extends MRSRenderer } GL11.glPushMatrix(); - float f1 = 1.0f; Tessellator tessellator = Tessellator.getInstance(); this.bindTexture(resourceLocation); 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.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); - float f2 = 0; - float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); // GL11.glEnable(GL11.GL_BLEND); // GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/BeamRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/BeamRenderer.java deleted file mode 100644 index 5617feb8..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/BeamRenderer.java +++ /dev/null @@ -1,150 +0,0 @@ -package WayofTime.alchemicalWizardry.common.renderer; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import WayofTime.alchemicalWizardry.api.ColourAndCoords; - -public class BeamRenderer -{ - private static final ResourceLocation field_110629_a = new ResourceLocation("textures/entity/beacon_beam.png"); - - public int xInit; - public int yInit; - public int zInit; - - public int xFinal; - public int yFinal; - public int zFinal; - - public int colourRed; - public int colourGreen; - public int colourBlue; - public int colourIntensity; - - public double size; - - public void setInitialPosition(int x, int y, int z) - { - this.xInit = x; - this.yInit = y; - this.zInit = z; - } - - public void setColourAndFinalPosition(ColourAndCoords col) - { - this.colourRed = col.colourRed; - this.colourGreen = col.colourGreen; - this.colourBlue = col.colourBlue; - this.colourIntensity = col.colourIntensity; - - this.xFinal = col.xCoord; - this.yFinal = col.yCoord; - this.zFinal = col.zCoord; - } - - public void setSize(double size) - { - this.size = size; - } - - protected static void bindTexture(ResourceLocation p_147499_1_) - { - TextureManager texturemanager = TileEntityRendererDispatcher.instance.renderEngine; - - if (texturemanager != null) - { - texturemanager.bindTexture(p_147499_1_); - } - } - - public void render(double d0, double d1, double d2) - { - int xDiff = this.xFinal - this.xInit; - int yDiff = this.yFinal - this.yInit; - int zDiff = this.zFinal - this.zInit; - - float planarAngle = (float) (Math.atan2(-zDiff, xDiff) * 180d / Math.PI); //Radians - float verticalAngle = (float) (Math.atan2(yDiff, Math.sqrt(xDiff * xDiff + zDiff + zDiff)) * 180d / Math.PI); - - float distance = (float) Math.sqrt(xDiff * xDiff + yDiff * yDiff + zDiff * zDiff); //Total distance - - GL11.glPushMatrix(); - float f1 = 1.0f; - Tessellator tessellator = Tessellator.getInstance(); - BeamRenderer.bindTexture(field_110629_a); - 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.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - float f2 = 0; - float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - - GL11.glDepthMask(false); - WorldRenderer wr = tessellator.getWorldRenderer(); - - wr.startDrawingQuads(); - wr.func_178961_b(colourRed, colourGreen, colourBlue, colourIntensity); - - double inside = -(this.size / 2d); - double outside = 1.0d - (0.50d - this.size / 2d) - 0.5d; - - double d18 = inside; - double d19 = inside; - double d20 = outside; - double d21 = inside; - double d22 = inside; - double d23 = outside; - double d24 = outside; - double d25 = outside; - double d26 = (double) (distance * f1);// + 0.2; - double d27 = 0.0D; - double d28 = 1.0D; - double d29 = (double) (-1.0F + f3); - double d30 = (double) (distance * f1) + d29; - - GL11.glTranslated(d0 + 0.5, d1 + 0.5, d2 + 0.5); - - GL11.glRotatef(planarAngle, 0F, 1F, 0F); //Rotate on planar axis - GL11.glRotatef(verticalAngle, 0F, 0F, 1F); //Rotate vertical axis - //GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically - - double offset = 0; - -// tessellator.setBrightness(240); - float s = 1F / 16F; - wr.addVertexWithUV(d26, d18, d19, d28, d30); - wr.addVertexWithUV(offset, d18, d19, d28, d29); - wr.addVertexWithUV(offset, d20, d21, d27, d29); - wr.addVertexWithUV(d26, d20, d21, d27, d30); - wr.addVertexWithUV(d26, d24, d25, d28, d30); - wr.addVertexWithUV(offset, d24, d25, d28, d29); - wr.addVertexWithUV(offset, d22, d23, d27, d29); - wr.addVertexWithUV(d26, d22, d23, d27, d30); - wr.addVertexWithUV(d26, d20, d21, d28, d30); - wr.addVertexWithUV(offset, d20, d21, d28, d29); - wr.addVertexWithUV(offset, d24, d25, d27, d29); - wr.addVertexWithUV(d26, d24, d25, d27, d30); - wr.addVertexWithUV(d26, d22, d23, d28, d30); - wr.addVertexWithUV(offset, d22, d23, d28, d29); - wr.addVertexWithUV(offset, d18, d19, d27, d29); - wr.addVertexWithUV(d26, d18, d19, d27, d30); - - tessellator.draw(); - GL11.glDepthMask(true); - - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glPopMatrix(); - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicCalcinator.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicalCalcinator.java similarity index 96% rename from src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicCalcinator.java rename to src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicalCalcinator.java index 8ab63111..defed192 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicCalcinator.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAlchemicalCalcinator.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.renderer.block; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicalCalcinator; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; @@ -19,16 +20,15 @@ import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator; -public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer +public class RenderAlchemicalCalcinator extends TileEntitySpecialRenderer { private final RenderItem customRenderItem; private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator(); private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/Reagent.png"); - public RenderAlchemicCalcinator() + public RenderAlchemicalCalcinator() { customRenderItem = Minecraft.getMinecraft().getRenderItem(); } @@ -36,9 +36,9 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer @Override public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) { - if (tileEntity instanceof TEAlchemicCalcinator) + if (tileEntity instanceof TEAlchemicalCalcinator) { - TEAlchemicCalcinator tileAltar = (TEAlchemicCalcinator) tileEntity; + TEAlchemicalCalcinator tileAltar = (TEAlchemicalCalcinator) tileEntity; GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAltar.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAltar.java new file mode 100644 index 00000000..6f1294a2 --- /dev/null +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderAltar.java @@ -0,0 +1,80 @@ +package WayofTime.alchemicalWizardry.common.renderer.block; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; + +public class RenderAltar extends TileEntitySpecialRenderer +{ + private ModelBloodAltar modelBloodAltar = new ModelBloodAltar(); + private final RenderItem customRenderItem; + + public RenderAltar() + { + customRenderItem = Minecraft.getMinecraft().getRenderItem(); + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) + { + modelBloodAltar.renderBloodAltar((TEAltar) tileEntity, d0, d1, d2); + modelBloodAltar.renderBloodLevel((TEAltar) tileEntity, d0, d1, d2); + + if (tileEntity instanceof TEAltar) + { + TEAltar tileAltar = (TEAltar) tileEntity; + GL11.glPushMatrix(); + + if (tileAltar.getStackInSlot(0) != null) + { + float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); + float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0; + EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld()); + ghostEntityItem.hoverStart = 0.0F; + ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); + float displacement = 0.2F; + + if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) + { + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F); + } else + { + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.6F, (float) d2 + 0.5F); + } + GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); + GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); + customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel + } + + GL11.glPopMatrix(); + } + } + + private float getGhostItemScaleFactor(ItemStack itemStack) + { + float scaleFactor = 1.0F; + + if (itemStack != null) + { + if (itemStack.getItem() instanceof ItemBlock) + { + return 0.9f; + } else + { + return 0.65f; + } + } + + return scaleFactor; + } +} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderChemistrySet.java similarity index 56% rename from src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java rename to src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderChemistrySet.java index 32177778..cc3aa790 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderWritingTable.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderChemistrySet.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.renderer.block; +import WayofTime.alchemicalWizardry.common.tileEntity.TEChemistrySet; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -7,21 +8,19 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.client.FMLClientHandler; import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelWritingTable; -import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelChemistrySet; -public class RenderWritingTable extends TileEntitySpecialRenderer +public class RenderChemistrySet extends TileEntitySpecialRenderer { - private ModelWritingTable modelWritingTable = new ModelWritingTable(); + private ModelChemistrySet modelChemistrySet = new ModelChemistrySet(); private final RenderItem customRenderItem; - public RenderWritingTable() + public RenderChemistrySet() { customRenderItem = Minecraft.getMinecraft().getRenderItem(); } @@ -29,9 +28,9 @@ public class RenderWritingTable extends TileEntitySpecialRenderer @Override public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int a) { - if (tileEntity instanceof TEWritingTable) + if (tileEntity instanceof TEChemistrySet) { - TEWritingTable tileAltar = (TEWritingTable) tileEntity; + TEChemistrySet tileAltar = (TEChemistrySet) tileEntity; GL11.glDisable(GL11.GL_LIGHTING); GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); @@ -39,7 +38,7 @@ public class RenderWritingTable extends TileEntitySpecialRenderer FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - this.modelWritingTable.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + this.modelChemistrySet.render(null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); @@ -164,102 +163,4 @@ public class RenderWritingTable extends TileEntitySpecialRenderer return 0.0f; } } - - private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, EnumFacing forgeDirection) - { - if (ghostItemStack != null) - { - if (ghostItemStack.getItem() instanceof ItemBlock) - { - switch (forgeDirection) - { - case DOWN: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); - return; - } - - case UP: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); - return; - } - - case NORTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); - return; - } - - case SOUTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); - return; - } - - case EAST: - { - GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); - return; - } - - case WEST: - { - GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); - return; - } - - default: - { - - } - } - } else - { - switch (forgeDirection) - { - case DOWN: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); - return; - } - - case UP: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); - return; - } - - case NORTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); - return; - } - - case SOUTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); - return; - } - - case EAST: - { - GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); - return; - } - - case WEST: - { - GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); - return; - } - - default: - { - - } - } - } - } - } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java index dcbacfcf..2eb6d20a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderConduit.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.renderer.block; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.client.FMLClientHandler; @@ -27,7 +26,7 @@ public class RenderConduit extends TileEntitySpecialRenderer FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileConduit.getInputDirection(), tileConduit.getOutputDirection()); + this.modelConduit.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileConduit.getInputDirection(), tileConduit.getOutputDirection()); GL11.glPopMatrix(); GL11.glPopMatrix(); } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java index 5ee91be0..fbd21044 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderCrystalBelljar.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.renderer.block; +import WayofTime.alchemicalWizardry.common.tileEntity.TEBelljar; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -15,7 +16,6 @@ import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack; import WayofTime.alchemicalWizardry.common.renderer.model.ModelCrystalBelljar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; public class RenderCrystalBelljar extends TileEntitySpecialRenderer { @@ -23,13 +23,12 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/Reagent.png"); - @Override public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) { - if (tileEntity instanceof TEBellJar) + if (tileEntity instanceof TEBelljar) { - TEBellJar tileAltar = (TEBellJar) tileEntity; + TEBelljar tileAltar = (TEBelljar) tileEntity; GL11.glPushMatrix(); GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png"); @@ -57,15 +56,12 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity) { GL11.glPushMatrix(); - float f1 = 1.0f; Tessellator tessellator = Tessellator.getInstance(); this.bindTexture(resourceLocation); 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.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); - float f2 = 0; - float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDepthMask(false); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java index 452c5a44..21e05777 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPedestal.java @@ -7,7 +7,6 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.client.FMLClientHandler; @@ -95,102 +94,4 @@ public class RenderPedestal extends TileEntitySpecialRenderer return scaleFactor; } - - private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, EnumFacing forgeDirection) - { - if (ghostItemStack != null) - { - if (ghostItemStack.getItem() instanceof ItemBlock) - { - switch (forgeDirection) - { - case DOWN: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); - return; - } - - case UP: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); - return; - } - - case NORTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); - return; - } - - case SOUTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); - return; - } - - case EAST: - { - GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); - return; - } - - case WEST: - { - GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); - return; - } - - default: - { - - } - } - } else - { - switch (forgeDirection) - { - case DOWN: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); - return; - } - - case UP: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); - return; - } - - case NORTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); - return; - } - - case SOUTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); - return; - } - - case EAST: - { - GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); - return; - } - - case WEST: - { - GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); - return; - } - - default: - { - - } - } - } - } - } } \ No newline at end of file diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java index af26a435..759c6e97 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/RenderPlinth.java @@ -7,7 +7,6 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.client.FMLClientHandler; @@ -89,102 +88,4 @@ public class RenderPlinth extends TileEntitySpecialRenderer return scaleFactor; } - - private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, EnumFacing forgeDirection) - { - if (ghostItemStack != null) - { - if (ghostItemStack.getItem() instanceof ItemBlock) - { - switch (forgeDirection) - { - case DOWN: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); - return; - } - - case UP: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); - return; - } - - case NORTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); - return; - } - - case SOUTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); - return; - } - - case EAST: - { - GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); - return; - } - - case WEST: - { - GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); - return; - } - - default: - { - - } - } - } else - { - switch (forgeDirection) - { - case DOWN: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); - return; - } - - case UP: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); - return; - } - - case NORTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); - return; - } - - case SOUTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); - return; - } - - case EAST: - { - GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); - return; - } - - case WEST: - { - GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); - return; - } - - default: - { - - } - } - } - } - } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/ShaderHelper.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/ShaderHelper.java deleted file mode 100644 index 7e72c42e..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/ShaderHelper.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * File Created @ [Apr 9, 2014, 11:20:26 PM (GMT)] - */ -package WayofTime.alchemicalWizardry.common.renderer.block; - -import org.lwjgl.opengl.ARBFragmentShader; -import org.lwjgl.opengl.ARBShaderObjects; -import org.lwjgl.opengl.ARBVertexShader; -import org.lwjgl.opengl.GL11; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; - -public final class ShaderHelper -{ - - private static final int VERT = ARBVertexShader.GL_VERTEX_SHADER_ARB; - private static final int FRAG = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB; - - public static int beam = 0; - - public static void initShaders() - { - beam = createProgram(null, "/assets/alchemicalwizardry/shaders/beam.frag"); - } - - public static void useShaderWithProps(int shader, Object... props) - { - ARBShaderObjects.glUseProgramObjectARB(shader); - - if (shader != 0 && props.length % 2 == 0) - { - int propCount = props.length / 2; - for (int i = 0; i < propCount; i++) - { - String propName = (String) props[i * 2]; - Object propVal = props[i * 2 + 1]; - - int uniform = ARBShaderObjects.glGetUniformLocationARB(shader, propName); - if (propVal instanceof Integer) - ARBShaderObjects.glUniform1iARB(uniform, (Integer) propVal); - if (propVal instanceof Float) - ARBShaderObjects.glUniform1fARB(uniform, (Float) propVal); - } - } - } - - public static void useShader(int shader) - { - useShaderWithProps(shader); - } - - public static void releaseShader() - { - useShader(0); - } - - public static boolean useShaders() - { - return true; - } - - // Most of the code taken from the LWJGL wiki - // http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL - private static int createProgram(String vert, String frag) - { - int vertId = 0, fragId = 0, program = 0; - if (vert != null) - vertId = createShader(vert, VERT); - if (frag != null) - fragId = createShader(frag, FRAG); - - program = ARBShaderObjects.glCreateProgramObjectARB(); - if (program == 0) - return 0; - - if (vert != null) - ARBShaderObjects.glAttachObjectARB(program, vertId); - if (frag != null) - ARBShaderObjects.glAttachObjectARB(program, fragId); - - ARBShaderObjects.glLinkProgramARB(program); - if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) - { - return 0; - } - - ARBShaderObjects.glValidateProgramARB(program); - if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) - { - return 0; - } - - return program; - } - - private static int createShader(String filename, int shaderType) - { - int shader = 0; - try - { - shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType); - - if (shader == 0) - return 0; - - ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename)); - ARBShaderObjects.glCompileShaderARB(shader); - - if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE) - throw new RuntimeException("Error creating shader: " + getLogInfo(shader)); - - return shader; - } catch (Exception e) - { - ARBShaderObjects.glDeleteObjectARB(shader); - e.printStackTrace(); - return -1; - } - } - - private static String getLogInfo(int obj) - { - return ARBShaderObjects.glGetInfoLogARB(obj, ARBShaderObjects.glGetObjectParameteriARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB)); - } - - private static String readFileAsString(String filename) throws Exception - { - StringBuilder source = new StringBuilder(); - InputStream in = ShaderHelper.class.getResourceAsStream(filename); - Exception exception = null; - BufferedReader reader; - - if (in == null) - return ""; - - try - { - reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); - - Exception innerExc = null; - try - { - String line; - while ((line = reader.readLine()) != null) - source.append(line).append('\n'); - } catch (Exception exc) - { - exception = exc; - } finally - { - try - { - reader.close(); - } catch (Exception exc) - { - if (innerExc == null) - innerExc = exc; - else exc.printStackTrace(); - } - } - - if (innerExc != null) - throw innerExc; - } catch (Exception exc) - { - exception = exc; - } finally - { - try - { - in.close(); - } catch (Exception exc) - { - if (exception == null) - exception = exc; - else exc.printStackTrace(); - } - - if (exception != null) - throw exception; - } - - return source.toString(); - } -} - diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java deleted file mode 100644 index cecd038d..00000000 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/TEAltarRenderer.java +++ /dev/null @@ -1,178 +0,0 @@ -package WayofTime.alchemicalWizardry.common.renderer.block; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; - -import org.lwjgl.opengl.GL11; - -import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; - -public class TEAltarRenderer extends TileEntitySpecialRenderer -{ - private ModelBloodAltar modelBloodAltar = new ModelBloodAltar(); - private final RenderItem customRenderItem; - - public TEAltarRenderer() - { - customRenderItem = Minecraft.getMinecraft().getRenderItem(); - } - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i) - { - modelBloodAltar.renderBloodAltar((TEAltar) tileEntity, d0, d1, d2); - modelBloodAltar.renderBloodLevel((TEAltar) tileEntity, d0, d1, d2); - - if (tileEntity instanceof TEAltar) - { - TEAltar tileAltar = (TEAltar) tileEntity; - GL11.glPushMatrix(); - - if (tileAltar.getStackInSlot(0) != null) - { - float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0)); - float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0; - EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld()); - ghostEntityItem.hoverStart = 0.0F; - ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0)); - float displacement = 0.2F; - - if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) - { - GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F); - } else - { - GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.6F, (float) d2 + 0.5F); - } - GL11.glScalef(scaleFactor, scaleFactor, scaleFactor); - GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F); - customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel - } - - GL11.glPopMatrix(); - } - } - - private float getGhostItemScaleFactor(ItemStack itemStack) - { - float scaleFactor = 1.0F; - - if (itemStack != null) - { - if (itemStack.getItem() instanceof ItemBlock) - { - return 0.9f; - } else - { - return 0.65f; - } - } - - return scaleFactor; - } - - private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, EnumFacing forgeDirection) - { - if (ghostItemStack != null) - { - if (ghostItemStack.getItem() instanceof ItemBlock) - { - switch (forgeDirection) - { - case DOWN: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F); - return; - } - - case UP: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F); - return; - } - - case NORTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F); - return; - } - - case SOUTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F); - return; - } - - case EAST: - { - GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F); - return; - } - - case WEST: - { - GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F); - return; - } - - default: - { - return; - } - } - } else - { - switch (forgeDirection) - { - case DOWN: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F); - return; - } - - case UP: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F); - return; - } - - case NORTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F); - return; - } - - case SOUTH: - { - GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F); - return; - } - - case EAST: - { - GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F); - return; - } - - case WEST: - { - GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F); - return; - } - - default: - { - return; - } - } - } - } - } -} diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEChemistrySetItemRenderer.java similarity index 88% rename from src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java rename to src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEChemistrySetItemRenderer.java index 43bf7569..2292f83b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEWritingTableItemRenderer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEChemistrySetItemRenderer.java @@ -8,15 +8,15 @@ import net.minecraftforge.fml.client.FMLClientHandler; import org.lwjgl.opengl.GL11; -import WayofTime.alchemicalWizardry.common.renderer.model.ModelWritingTable; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelChemistrySet; -public class TEWritingTableItemRenderer implements IItemRenderer +public class TEChemistrySetItemRenderer implements IItemRenderer { - private ModelWritingTable model; + private ModelChemistrySet model; - public TEWritingTableItemRenderer() + public TEChemistrySetItemRenderer() { - model = new ModelWritingTable(); + model = new ModelChemistrySet(); } @Override diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWritingTable.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelChemistrySet.java similarity index 98% rename from src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWritingTable.java rename to src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelChemistrySet.java index 15dede34..2dfc6c8f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelWritingTable.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/model/ModelChemistrySet.java @@ -4,7 +4,7 @@ import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -public class ModelWritingTable extends ModelBase +public class ModelChemistrySet extends ModelBase { //fields ModelRenderer base; @@ -21,7 +21,7 @@ public class ModelWritingTable extends ModelBase ModelRenderer input3; ModelRenderer Shape1; - public ModelWritingTable() + public ModelChemistrySet() { textureWidth = 64; textureHeight = 64; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java index 3ea79b1e..826cec70 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderEnergyBazookaMainProjectile.java @@ -20,11 +20,11 @@ public class RenderEnergyBazookaMainProjectile extends Render public ModelBase model = new ModelEnergyBazookaMainProjectile(); private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/EnergyBazookaMainProjectile.png"); - private float scale = 1.0f; @Override public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { + float scale = 1.0f; GL11.glPushMatrix(); GL11.glTranslatef((float) d0, (float) d1, (float) d2); GL11.glEnable(GL12.GL_RESCALE_NORMAL); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java index cbbd4374..f33d1178 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/renderer/projectile/RenderMeteor.java @@ -21,11 +21,11 @@ public class RenderMeteor extends Render public ModelBase model = new ModelMeteor(); private static final ResourceLocation field_110833_a = new ResourceLocation("alchemicalwizardry", "textures/models/Meteor.png"); - private float scale = 1.0f; @Override public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { + float scale = 1.0f; GL11.glPushMatrix(); GL11.glTranslatef((float) d0, (float) d1, (float) d2); GL11.glEnable(GL12.GL_RESCALE_NORMAL); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java index 4274305b..a9068614 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAnimalGrowth.java @@ -133,7 +133,7 @@ public class RitualEffectAnimalGrowth extends RitualEffect @Override public List getRitualComponentList() { - ArrayList animalGrowthRitual = new ArrayList(); + ArrayList animalGrowthRitual = new ArrayList(); animalGrowthRitual.add(new RitualComponent(0, 0, 2, RitualComponent.DUSK)); animalGrowthRitual.add(new RitualComponent(2, 0, 0, RitualComponent.DUSK)); animalGrowthRitual.add(new RitualComponent(0, 0, -2, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java index e0657394..f1878498 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectApiaryOverclock.java @@ -57,7 +57,7 @@ public class RitualEffectApiaryOverclock extends RitualEffect @Override public List getRitualComponentList() { - ArrayList apiaryRitual = new ArrayList(); + ArrayList apiaryRitual = new ArrayList(); apiaryRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); apiaryRitual.add(new RitualComponent(1, 0, 1, RitualComponent.DUSK)); apiaryRitual.add(new RitualComponent(1, 0, -1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java index a763c07b..c8406e13 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectAutoAlchemy.java @@ -45,7 +45,7 @@ public class RitualEffectAutoAlchemy extends RitualEffect int flag = 0; TileEntity topEntity = world.getTileEntity(pos.offsetUp()); - if (!(topEntity instanceof IBloodAltar) || !(topEntity instanceof IBloodAltar)) + if (!(topEntity instanceof IBloodAltar)) { return; } @@ -88,7 +88,7 @@ public class RitualEffectAutoAlchemy extends RitualEffect } else if (southEntity instanceof TEChemistrySet) { alchemyEntity = (TEChemistrySet) southEntity; - if (northEntity instanceof IInventory && !(northEntity instanceof TEChemistrySet)) + if (northEntity instanceof IInventory) { outputInv = (IInventory) northEntity; } @@ -107,26 +107,26 @@ public class RitualEffectAutoAlchemy extends RitualEffect { outputInv = (IInventory) westEntity; } - if (northEntity instanceof IInventory && !(northEntity instanceof TEChemistrySet)) + if (northEntity instanceof IInventory) { inputInv1 = (IInventory) northEntity; } - if (southEntity instanceof IInventory && !(southEntity instanceof TEChemistrySet)) + if (southEntity instanceof IInventory) { inputInv2 = (IInventory) southEntity; } } else if (westEntity instanceof TEChemistrySet) { alchemyEntity = (TEChemistrySet) westEntity; - if (eastEntity instanceof IInventory && !(eastEntity instanceof TEChemistrySet)) + if (eastEntity instanceof IInventory) { outputInv = (IInventory) eastEntity; } - if (northEntity instanceof IInventory && !(northEntity instanceof TEChemistrySet)) + if (northEntity instanceof IInventory) { inputInv1 = (IInventory) northEntity; } - if (southEntity instanceof IInventory && !(southEntity instanceof TEChemistrySet)) + if (southEntity instanceof IInventory) { inputInv2 = (IInventory) southEntity; } @@ -135,7 +135,7 @@ public class RitualEffectAutoAlchemy extends RitualEffect return; } - if (alchemyEntity != null && hasPotentia) + if (hasPotentia) { alchemyEntity.setAccelerationTime(5); if (alchemyEntity.isWorking()) @@ -239,7 +239,6 @@ public class RitualEffectAutoAlchemy extends RitualEffect break; } } - continue; } } @@ -404,7 +403,7 @@ public class RitualEffectAutoAlchemy extends RitualEffect @Override public List getRitualComponentList() { - ArrayList autoAlchemyRitual = new ArrayList(); + ArrayList autoAlchemyRitual = new ArrayList(); autoAlchemyRitual.add(new RitualComponent(1, 0, 1, RitualComponent.DUSK)); autoAlchemyRitual.add(new RitualComponent(1, 0, -1, RitualComponent.DUSK)); autoAlchemyRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBinding.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBinding.java index 5e1343db..5416441b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBinding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBinding.java @@ -159,7 +159,7 @@ public class RitualEffectBinding extends RitualEffect @Override public List getRitualComponentList() { - ArrayList boundSoulRitual = new ArrayList(); + ArrayList boundSoulRitual = new ArrayList(); boundSoulRitual.add(new RitualComponent(3, 0, 0, 2)); boundSoulRitual.add(new RitualComponent(-3, 0, 0, 2)); boundSoulRitual.add(new RitualComponent(0, 0, 3, 2)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java index fd1d6c92..a113d896 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java @@ -215,8 +215,6 @@ public class RitualEffectBiomeChanger extends RitualEffect } } - boolean wantsSnow = false; - boolean wantsRain = true; int biomeID = 1; BiomeGenBase[] biomeList = BiomeGenBase.getBiomeGenArray(); int iteration = 0; @@ -290,7 +288,7 @@ public class RitualEffectBiomeChanger extends RitualEffect @Override public List getRitualComponentList() { - ArrayList biomeChangerRitual = new ArrayList(); + ArrayList biomeChangerRitual = new ArrayList(); biomeChangerRitual.add(new RitualComponent(1, 0, -2, RitualComponent.AIR)); biomeChangerRitual.add(new RitualComponent(1, 0, -3, RitualComponent.AIR)); biomeChangerRitual.add(new RitualComponent(2, 0, -1, RitualComponent.AIR)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java index 231a638a..bdd237f6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectContainment.java @@ -44,7 +44,6 @@ public class RitualEffectContainment extends RitualEffect List entityList = SpellHelper.getEntitiesInRange(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, d0, d0); boolean flag = false; boolean hasCrepitous = this.canDrainReagent(ritualStone, ReagentRegistry.crepitousReagent, crepitousDrain, false); - boolean hasTerrae = this.canDrainReagent(ritualStone, ReagentRegistry.terraeReagent, terraeDrain, false); boolean hasMagicales = this.canDrainReagent(ritualStone, ReagentRegistry.magicalesReagent, magicalesDrain, false); for (Entity entity : entityList) @@ -108,7 +107,7 @@ public class RitualEffectContainment extends RitualEffect @Override public List getRitualComponentList() { - ArrayList containmentRitual = new ArrayList(); + ArrayList containmentRitual = new ArrayList(); containmentRitual.add(new RitualComponent(1, 0, 0, 3)); containmentRitual.add(new RitualComponent(-1, 0, 0, 3)); containmentRitual.add(new RitualComponent(0, 0, 1, 3)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java index 630665a0..5b5a623b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrafting.java @@ -98,7 +98,7 @@ public class RitualEffectCrafting extends RitualEffect { if(((IInventory) inv).getSizeInventory() <= slotDesignation || !((IInventory) inv).isItemValidForSlot(slotDesignation, ((IInventory) inv).getStackInSlot(slotDesignation))) { - continue; + }else { ItemStack invStack = ((IInventory) inv).getStackInSlot(slotDesignation); @@ -131,7 +131,7 @@ public class RitualEffectCrafting extends RitualEffect IInventory outputInv = null; - List invList = new ArrayList(); + List invList = new ArrayList(); TileEntity northEntity = world.getTileEntity(pos.add(0, -1, -2)); TileEntity southEntity = world.getTileEntity(pos.add(0, -1, 2)); @@ -250,7 +250,7 @@ public class RitualEffectCrafting extends RitualEffect invList.add(outputInv); } - Map> syphonMap = new HashMap(); //Inventory, Slot, how much claimed + Map> syphonMap = new HashMap>(); //Inventory, Slot, how much claimed for(int n = 0; n < recipe.length; n++) //Look for the correct items { @@ -299,7 +299,7 @@ public class RitualEffectCrafting extends RitualEffect Map slotMap = syphonMap.get(i); if(slotMap == null) { - slotMap = new HashMap(); + slotMap = new HashMap(); syphonMap.put(i, slotMap); } @@ -389,7 +389,7 @@ public class RitualEffectCrafting extends RitualEffect @Override public List getRitualComponentList() { - ArrayList autoCraftingRitual = new ArrayList(); + ArrayList autoCraftingRitual = new ArrayList(); this.addCornerRunes(autoCraftingRitual, 1, 1, RitualComponent.EARTH); this.addParallelRunes(autoCraftingRitual, 1, 1, RitualComponent.EARTH); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java index f5d4296a..7d461d57 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectCrushing.java @@ -82,7 +82,6 @@ public class RitualEffectCrushing extends RitualEffect boolean hasVirtus = this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false); boolean hasIncendium = this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, incendiumDrain, false); - boolean isSilkTouch = hasCrystallos; int fortuneLevel = 0; if (hasOrbisTerrae) { @@ -117,17 +116,17 @@ public class RitualEffectCrushing extends RitualEffect continue; } - if (block != null && !world.isAirBlock(newPos)) + if (!world.isAirBlock(newPos)) { if ((block.equals(ModBlocks.ritualStone) || block.equals(ModBlocks.blockMasterStone)) || SpellHelper.isBlockFluid(block)) { continue; } - if (isSilkTouch && block.canSilkHarvest(world, newPos, state, null)) + if (hasCrystallos && block.canSilkHarvest(world, newPos, state, null)) { ItemStack item = new ItemStack(block, 1, block.getMetaFromState(state)); - ItemStack copyStack = item.copyItemStack(item); + ItemStack copyStack = ItemStack.copyItemStack(item); SpellHelper.insertStackIntoInventory(copyStack, tileEntity, EnumFacing.DOWN); @@ -151,7 +150,7 @@ public class RitualEffectCrushing extends RitualEffect for (ItemStack item : itemDropList) { hasIncendium = hasIncendium && this.canDrainReagent(ritualStone, ReagentRegistry.incendiumReagent, incendiumDrain, false); - ItemStack copyStack = item.copyItemStack(item); + ItemStack copyStack = ItemStack.copyItemStack(item); if (this.usesIncendium(copyStack)) { @@ -206,9 +205,6 @@ public class RitualEffectCrushing extends RitualEffect { return true; } - } else - { - } } return false; @@ -233,9 +229,6 @@ public class RitualEffectCrushing extends RitualEffect copyStack = new ItemStack(Blocks.netherrack, stackSize, 0); } } - } else - { - } return copyStack; @@ -252,7 +245,7 @@ public class RitualEffectCrushing extends RitualEffect @Override public List getRitualComponentList() { - ArrayList crushingRitual = new ArrayList(); + ArrayList crushingRitual = new ArrayList(); crushingRitual.add(new RitualComponent(0, 0, 1, RitualComponent.EARTH)); crushingRitual.add(new RitualComponent(1, 0, 0, RitualComponent.EARTH)); crushingRitual.add(new RitualComponent(0, 0, -1, RitualComponent.EARTH)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java index 2a93bb54..2674b0ce 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectDemonPortal.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; +import WayofTime.alchemicalWizardry.common.tileEntity.TEBelljar; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -21,7 +22,6 @@ import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal; import WayofTime.alchemicalWizardry.api.tile.IBloodAltar; -import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar; public class RitualEffectDemonPortal extends RitualEffect { @@ -136,7 +136,7 @@ public class RitualEffectDemonPortal extends RitualEffect for(Int3 pos : jarLocations) { - if(!(ritualStone.getWorldObj().getTileEntity(position.add(pos.xCoord, pos.yCoord, pos.zCoord)) instanceof TEBellJar)) + if(!(ritualStone.getWorldObj().getTileEntity(position.add(pos.xCoord, pos.yCoord, pos.zCoord)) instanceof TEBelljar)) { return false; } @@ -148,7 +148,7 @@ public class RitualEffectDemonPortal extends RitualEffect @Override public List getRitualComponentList() { - ArrayList demonRitual = new ArrayList(); + ArrayList demonRitual = new ArrayList(); this.addParallelRunes(demonRitual, 3, 0, RitualComponent.FIRE); this.addParallelRunes(demonRitual, 5, 0, RitualComponent.FIRE); this.addCornerRunes(demonRitual, 2, 0, RitualComponent.AIR); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java index a44aae46..bdb47c52 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEllipsoid.java @@ -192,7 +192,7 @@ public class RitualEffectEllipsoid extends RitualEffect @Override public List getRitualComponentList() { - ArrayList ellipsoidRitual = new ArrayList(); + ArrayList ellipsoidRitual = new ArrayList(); ellipsoidRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.DUSK)); ellipsoidRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java index 7d83e46c..53c81bba 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectEvaporation.java @@ -138,7 +138,7 @@ public class RitualEffectEvaporation extends RitualEffect @Override public List getRitualComponentList() { - ArrayList ellipsoidRitual = new ArrayList(); + ArrayList ellipsoidRitual = new ArrayList(); ellipsoidRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.DUSK)); ellipsoidRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java index 92e57285..74d0926b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectExpulsion.java @@ -163,14 +163,14 @@ public class RitualEffectExpulsion extends RitualEffect double z = entityLiving.posZ; Random rand = new Random(); double d0 = x + (rand.nextDouble() - 0.5D) * distance; - double d1 = y + (double) (rand.nextInt((int) distance) - (distance) / 2); + double d1 = y + (rand.nextInt((int) distance) - (distance) / 2); double d2 = z + (rand.nextDouble() - 0.5D) * distance; int i = 0; while (!teleportTo(entityLiving, d0, d1, d2, x, y, z) && i < 100) { d0 = x + (rand.nextDouble() - 0.5D) * distance; - d1 = y + (double) (rand.nextInt((int) distance) - (distance) / 2); + d1 = y + (rand.nextInt((int) distance) - (distance) / 2); d2 = z + (rand.nextDouble() - 0.5D) * distance; i++; } @@ -192,9 +192,6 @@ public class RitualEffectExpulsion extends RitualEffect return false; } - double d3 = lastX; - double d4 = lastY; - double d5 = lastZ; SpellTeleport.moveEntityViaTeleport(entityLiving, event.targetX, event.targetY, event.targetZ); boolean flag = false; @@ -237,7 +234,7 @@ public class RitualEffectExpulsion extends RitualEffect if (!flag) { - SpellTeleport.moveEntityViaTeleport(entityLiving, d3, d4, d5); + SpellTeleport.moveEntityViaTeleport(entityLiving, lastX, lastY, lastZ); return false; } else { @@ -249,9 +246,9 @@ public class RitualEffectExpulsion extends RitualEffect float f = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; float f1 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; float f2 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F; - double d7 = d3 + (entityLiving.posX - d3) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; - double d8 = d4 + (entityLiving.posY - d4) * d6 + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height; - double d9 = d5 + (entityLiving.posZ - d5) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; + double d7 = lastX + (entityLiving.posX - lastX) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; + double d8 = lastY + (entityLiving.posY - lastY) * d6 + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height; + double d9 = lastZ + (entityLiving.posZ - lastZ) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D; entityLiving.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d7, d8, d9, (double) f, (double) f1, (double) f2); } return true; @@ -262,7 +259,7 @@ public class RitualEffectExpulsion extends RitualEffect { if (entityLiving instanceof EntityPlayer) { - if (entityLiving != null && entityLiving instanceof EntityPlayerMP) + if (entityLiving instanceof EntityPlayerMP) { EntityPlayerMP entityplayermp = (EntityPlayerMP) entityLiving; @@ -274,7 +271,7 @@ public class RitualEffectExpulsion extends RitualEffect { if (entityLiving.isRiding()) { - entityLiving.mountEntity((Entity) null); + entityLiving.mountEntity(null); } entityLiving.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); } @@ -289,7 +286,7 @@ public class RitualEffectExpulsion extends RitualEffect @Override public List getRitualComponentList() { - ArrayList expulsionRitual = new ArrayList(); + ArrayList expulsionRitual = new ArrayList(); expulsionRitual.add(new RitualComponent(2, 0, 2, RitualComponent.EARTH)); expulsionRitual.add(new RitualComponent(2, 0, 1, RitualComponent.EARTH)); expulsionRitual.add(new RitualComponent(1, 0, 2, RitualComponent.EARTH)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java index cd446a38..6b8faa20 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredEarth.java @@ -102,7 +102,7 @@ public class RitualEffectFeatheredEarth extends RitualEffect //Nullifies all fal @Override public List getRitualComponentList() { - ArrayList featheredEarthRitual = new ArrayList(); + ArrayList featheredEarthRitual = new ArrayList(); featheredEarthRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); featheredEarthRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.DUSK)); featheredEarthRitual.add(new RitualComponent(0, 0, 1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java index 8d0e9579..39c0e4e7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFeatheredKnife.java @@ -135,7 +135,7 @@ public class RitualEffectFeatheredKnife extends RitualEffect @Override public List getRitualComponentList() { - ArrayList featheredKnifeRitual = new ArrayList(); + ArrayList featheredKnifeRitual = new ArrayList(); featheredKnifeRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); featheredKnifeRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.DUSK)); featheredKnifeRitual.add(new RitualComponent(0, 0, 1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java index b3b7102a..177d7a7e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFlight.java @@ -95,7 +95,7 @@ public class RitualEffectFlight extends RitualEffect @Override public List getRitualComponentList() { - ArrayList flightRitual = new ArrayList(); + ArrayList flightRitual = new ArrayList(); flightRitual.add(new RitualComponent(1, 0, 0, RitualComponent.DUSK)); flightRitual.add(new RitualComponent(-1, 0, 0, RitualComponent.DUSK)); flightRitual.add(new RitualComponent(0, 0, 1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java index 36bb9bf8..2d967606 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectFullStomach.java @@ -113,7 +113,7 @@ public class RitualEffectFullStomach extends RitualEffect @Override public List getRitualComponentList() { - ArrayList fullRitual = new ArrayList(); + ArrayList fullRitual = new ArrayList(); fullRitual.add(new RitualComponent(0, 0, 3, RitualComponent.FIRE)); fullRitual.add(new RitualComponent(0, 0, -3, RitualComponent.FIRE)); fullRitual.add(new RitualComponent(3, 0, 0, RitualComponent.FIRE)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java index 6502585e..3ec289cd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectGrowth.java @@ -111,7 +111,7 @@ public class RitualEffectGrowth extends RitualEffect @Override public List getRitualComponentList() { - ArrayList growthRitual = new ArrayList(); + ArrayList growthRitual = new ArrayList(); growthRitual.add(new RitualComponent(1, 0, 0, 1)); growthRitual.add(new RitualComponent(-1, 0, 0, 1)); growthRitual.add(new RitualComponent(0, 0, 1, 1)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java index c0f7dcf6..55307e88 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHarvest.java @@ -109,7 +109,7 @@ public class RitualEffectHarvest extends RitualEffect @Override public List getRitualComponentList() { - ArrayList harvestRitual = new ArrayList(); + ArrayList harvestRitual = new ArrayList(); harvestRitual.add(new RitualComponent(1, 0, 1, RitualComponent.DUSK)); harvestRitual.add(new RitualComponent(1, 0, -1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java index f2eac94b..8a39075a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectHealing.java @@ -82,7 +82,7 @@ public class RitualEffectHealing extends RitualEffect if (livingEntity.getHealth() + 0.1f < livingEntity.getMaxHealth()) { PotionEffect effect = livingEntity.getActivePotionEffect(Potion.regeneration); - if (effect == null || (effect != null && effect.getAmplifier() <= potency && effect.getDuration() <= timeDelay)) + if (effect == null || (effect.getAmplifier() <= potency && effect.getDuration() <= timeDelay)) { if (!hasVirtus || (this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, false))) { @@ -128,7 +128,7 @@ public class RitualEffectHealing extends RitualEffect @Override public List getRitualComponentList() { - ArrayList healingRitual = new ArrayList(); + ArrayList healingRitual = new ArrayList(); healingRitual.add(new RitualComponent(4, 0, 0, RitualComponent.AIR)); healingRitual.add(new RitualComponent(5, 0, -1, RitualComponent.AIR)); healingRitual.add(new RitualComponent(5, 0, 1, RitualComponent.AIR)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java index 63447ab4..6a6253dd 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectInterdiction.java @@ -123,7 +123,7 @@ public class RitualEffectInterdiction extends RitualEffect @Override public List getRitualComponentList() { - ArrayList interdictionRitual = new ArrayList(); + ArrayList interdictionRitual = new ArrayList(); interdictionRitual.add(new RitualComponent(1, 0, 0, 4)); interdictionRitual.add(new RitualComponent(-1, 0, 0, 4)); interdictionRitual.add(new RitualComponent(0, 0, 1, 4)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java index 73defce4..ab737d9b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemRouting.java @@ -1,10 +1,7 @@ package WayofTime.alchemicalWizardry.common.rituals; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.Random; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -19,21 +16,17 @@ import WayofTime.alchemicalWizardry.api.RoutingFocusPosAndFacing; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; -import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.common.items.routing.InputRoutingFocus; import WayofTime.alchemicalWizardry.common.items.routing.OutputRoutingFocus; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; public class RitualEffectItemRouting extends RitualEffect { - Random rand = new Random(); - @Override public void performEffect(IMasterRitualStone ritualStone) { String owner = ritualStone.getOwner(); - int currentEssence = SoulNetworkHandler.getCurrentEssence(owner); World world = ritualStone.getWorldObj(); BlockPos pos = ritualStone.getPosition(); @@ -42,9 +35,7 @@ public class RitualEffectItemRouting extends RitualEffect return; } - Map tileMap = new HashMap(); - - List outputList = new ArrayList(); + List outputList = new ArrayList(); for(int i=0; i<4; i++) //Check output foci chests, return if none available { Int3 outputFocusChest = this.getOutputBufferChestLocation(i); @@ -64,7 +55,7 @@ public class RitualEffectItemRouting extends RitualEffect for(IInventory outputFocusInventory : outputList) { { - OutputRoutingFocus outputFocus;; + OutputRoutingFocus outputFocus; RoutingFocusParadigm parad = new RoutingFocusParadigm(); @@ -168,7 +159,7 @@ public class RitualEffectItemRouting extends RitualEffect if(parad.doesItemMatch(keyStack, syphonedStack)) { - ItemStack newStack = null; + ItemStack newStack; if(parad.maximumAmount <= 0) { newStack = SpellHelper.insertStackIntoInventory(syphonedStack, outputChestInventory, inputDirection); @@ -181,9 +172,7 @@ public class RitualEffectItemRouting extends RitualEffect continue; } - int numberSyphoned = size - newStack.stackSize; - - if(newStack != null && newStack.stackSize <= 0) + if(newStack.stackSize <= 0) { size = newStack.stackSize; newStack = null; @@ -246,7 +235,7 @@ public class RitualEffectItemRouting extends RitualEffect @Override public List getRitualComponentList() { - ArrayList omegaRitual = new ArrayList(); + ArrayList omegaRitual = new ArrayList(); this.addCornerRunes(omegaRitual, 1, 0, RitualComponent.BLANK); this.addOffsetRunes(omegaRitual, 2, 1, 0, RitualComponent.FIRE); @@ -256,6 +245,4 @@ public class RitualEffectItemRouting extends RitualEffect return omegaRitual; } - - } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java index cccb4273..0e5112be 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectItemSuction.java @@ -21,8 +21,6 @@ public class RitualEffectItemSuction extends RitualEffect { public static final int reductusDrain = 1; - public static final int timeDelayMin = 60; - @Override public void performEffect(IMasterRitualStone ritualStone) { @@ -61,8 +59,6 @@ public class RitualEffectItemSuction extends RitualEffect if (itemDropList != null) { - int invSize = tileEntity.getSizeInventory(); - for (EntityItem itemEntity : itemDropList) { // hasReductus = hasReductus && this.canDrainReagent(ritualStone, ReagentRegistry.reductusReagent, reductusDrain, false); @@ -70,7 +66,6 @@ public class RitualEffectItemSuction extends RitualEffect // { // continue; // } - ItemStack item = itemEntity.getEntityItem(); ItemStack copyStack = itemEntity.getEntityItem().copy(); int pastAmount = copyStack.stackSize; @@ -100,7 +95,6 @@ public class RitualEffectItemSuction extends RitualEffect if (count > 0) { SoulNetworkHandler.syphonFromNetwork(owner, this.getCostPerRefresh() * Math.min(count, 100)); - return; } } } @@ -114,7 +108,7 @@ public class RitualEffectItemSuction extends RitualEffect @Override public List getRitualComponentList() { - ArrayList suctionRitual = new ArrayList(); + ArrayList suctionRitual = new ArrayList(); suctionRitual.add(new RitualComponent(2, 0, 0, RitualComponent.AIR)); suctionRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.AIR)); suctionRitual.add(new RitualComponent(0, 0, 2, RitualComponent.AIR)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java index be388038..bd77b632 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectJumping.java @@ -18,8 +18,8 @@ import java.util.List; public class RitualEffectJumping extends RitualEffect { - public static final int aetherDrain = 10; - public static final int terraeDrain = 10; + public final int aetherDrain = 10; + public final int terraeDrain = 10; @Override public void performEffect(IMasterRitualStone ritualStone) @@ -98,7 +98,7 @@ public class RitualEffectJumping extends RitualEffect @Override public List getRitualComponentList() { - ArrayList jumpingRitual = new ArrayList(); + ArrayList jumpingRitual = new ArrayList(); for (int i = -1; i <= 1; i++) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java index d21f233b..030ab73a 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLava.java @@ -115,8 +115,6 @@ public class RitualEffectLava extends RitualEffect } } } - - } @Override @@ -128,7 +126,7 @@ public class RitualEffectLava extends RitualEffect @Override public List getRitualComponentList() { - ArrayList lavaRitual = new ArrayList(); + ArrayList lavaRitual = new ArrayList(); lavaRitual.add(new RitualComponent(1, 0, 0, 2)); lavaRitual.add(new RitualComponent(-1, 0, 0, 2)); lavaRitual.add(new RitualComponent(0, 0, 1, 2)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java index 47c54f00..2774c4fb 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLeap.java @@ -208,7 +208,7 @@ public class RitualEffectLeap extends RitualEffect @Override public List getRitualComponentList() { - ArrayList leapingRitual = new ArrayList(); + ArrayList leapingRitual = new ArrayList(); leapingRitual.add(new RitualComponent(0, 0, -2, RitualComponent.DUSK)); leapingRitual.add(new RitualComponent(1, 0, -1, RitualComponent.AIR)); leapingRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.AIR)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java index 65b28ff9..da3b7397 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectLifeConduit.java @@ -97,7 +97,7 @@ public class RitualEffectLifeConduit extends RitualEffect @Override public List getRitualComponentList() { - ArrayList conduitRitual = new ArrayList(); + ArrayList conduitRitual = new ArrayList(); conduitRitual.add(new RitualComponent(-1, 0, -1, RitualComponent.FIRE)); conduitRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.FIRE)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java index ab661c3a..8aed0a4c 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectMagnetic.java @@ -172,7 +172,6 @@ public class RitualEffectMagnetic extends RitualEffect j = pos.getY() - 1; this.setLastPosition(ritualStone.getCustomRitualTag(), new Int3(i, j, k)); - return; } } } @@ -204,7 +203,7 @@ public class RitualEffectMagnetic extends RitualEffect @Override public List getRitualComponentList() { - ArrayList magneticRitual = new ArrayList(); + ArrayList magneticRitual = new ArrayList(); magneticRitual.add(new RitualComponent(1, 0, 1, RitualComponent.EARTH)); magneticRitual.add(new RitualComponent(1, 0, -1, RitualComponent.EARTH)); magneticRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.EARTH)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java index b3fe7231..363e5d6f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaStalling.java @@ -72,7 +72,7 @@ public class RitualEffectOmegaStalling extends RitualEffect @Override public List getRitualComponentList() { - ArrayList omegaRitual = new ArrayList(); + ArrayList omegaRitual = new ArrayList(); this.addCornerRunes(omegaRitual, 1, 0, RitualComponent.FIRE); this.addOffsetRunes(omegaRitual, 2, 1, 0, RitualComponent.DUSK); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java index d2460140..1092ad61 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectOmegaTest.java @@ -67,7 +67,7 @@ public class RitualEffectOmegaTest extends RitualEffect Reagent reagent = null; - Map reagentMap = new HashMap(); + Map reagentMap = new HashMap(); for(int i=0; i<4; i++) { Int3 jarLoc = this.getJarLocation(i); @@ -133,7 +133,7 @@ public class RitualEffectOmegaTest extends RitualEffect if(!isTesting) { - int drainLeft = this.drainTotal; + int drainLeft = drainTotal; for(int i = 0; i < 4; i++) { if(drainLeft <= 0) @@ -173,7 +173,7 @@ public class RitualEffectOmegaTest extends RitualEffect @Override public List getRitualComponentList() { - ArrayList omegaRitual = new ArrayList(); + ArrayList omegaRitual = new ArrayList(); this.addCornerRunes(omegaRitual, 1, 0, RitualComponent.DUSK); this.addCornerRunes(omegaRitual, 2, 0, RitualComponent.DUSK); this.addCornerRunes(omegaRitual, 3, 0, RitualComponent.BLANK); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java index 07a11c4d..5cb2deda 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSpawnWard.java @@ -34,9 +34,9 @@ public class RitualEffectSpawnWard extends RitualEffect int dimension = world.provider.getDimensionId(); - if (AlchemicalWizardryEventHooks.respawnMap.containsKey(new Integer(dimension))) + if (AlchemicalWizardryEventHooks.respawnMap.containsKey(dimension)) { - List list = AlchemicalWizardryEventHooks.respawnMap.get(new Integer(dimension)); + List list = AlchemicalWizardryEventHooks.respawnMap.get(dimension); if (list != null) { if (!list.contains(new CoordAndRange(pos, horizRange, vertRange))) @@ -55,15 +55,15 @@ public class RitualEffectSpawnWard extends RitualEffect } } else { - list = new LinkedList(); + list = new LinkedList(); list.add(new CoordAndRange(pos, horizRange, vertRange)); - AlchemicalWizardryEventHooks.respawnMap.put(new Integer(dimension), list); + AlchemicalWizardryEventHooks.respawnMap.put(dimension, list); } } else { - List list = new LinkedList(); + List list = new LinkedList(); list.add(new CoordAndRange(pos, horizRange, vertRange)); - AlchemicalWizardryEventHooks.respawnMap.put(new Integer(dimension), list); + AlchemicalWizardryEventHooks.respawnMap.put(dimension, list); } @@ -80,7 +80,7 @@ public class RitualEffectSpawnWard extends RitualEffect @Override public List getRitualComponentList() { - ArrayList wardRitualRitual = new ArrayList(); + ArrayList wardRitualRitual = new ArrayList(); for (int i = 2; i <= 4; i++) { diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSphereCreator.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSphereCreator.java index aead349e..49d79db6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSphereCreator.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSphereCreator.java @@ -170,8 +170,6 @@ public class RitualEffectSphereCreator extends RitualEffect ritualStone.setActive(false); this.setLastPosition(ritualStone.getCustomRitualTag(), new Int3(i, j, k)); - return; - } } @@ -203,7 +201,7 @@ public class RitualEffectSphereCreator extends RitualEffect @Override public List getRitualComponentList() { - ArrayList magneticRitual = new ArrayList(); + ArrayList magneticRitual = new ArrayList(); magneticRitual.add(new RitualComponent(1, 0, 1, RitualComponent.EARTH)); magneticRitual.add(new RitualComponent(1, 0, -1, RitualComponent.EARTH)); magneticRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.EARTH)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java index 9e4cb891..48969c77 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSummonMeteor.java @@ -103,7 +103,7 @@ public class RitualEffectSummonMeteor extends RitualEffect @Override public List getRitualComponentList() { - ArrayList meteorRitual = new ArrayList(); + ArrayList meteorRitual = new ArrayList(); meteorRitual.add(new RitualComponent(2, 0, 0, RitualComponent.FIRE)); meteorRitual.add(new RitualComponent(-2, 0, 0, RitualComponent.FIRE)); meteorRitual.add(new RitualComponent(0, 0, 2, RitualComponent.FIRE)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java index 851c97bf..dc3150e8 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectSupression.java @@ -123,7 +123,7 @@ public class RitualEffectSupression extends RitualEffect @Override public List getRitualComponentList() { - ArrayList supressionRitual = new ArrayList(); + ArrayList supressionRitual = new ArrayList(); supressionRitual.add(new RitualComponent(2, 0, 2, RitualComponent.WATER)); supressionRitual.add(new RitualComponent(2, 0, -2, RitualComponent.WATER)); supressionRitual.add(new RitualComponent(-2, 0, 2, RitualComponent.WATER)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java index aaa76a64..8bd7bbbc 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectUnbinding.java @@ -166,7 +166,7 @@ public class RitualEffectUnbinding extends RitualEffect @Override public List getRitualComponentList() { - ArrayList unbindingRitual = new ArrayList(); + ArrayList unbindingRitual = new ArrayList(); unbindingRitual.add(new RitualComponent(-2, 0, 0, 4)); unbindingRitual.add(new RitualComponent(2, 0, 0, 4)); unbindingRitual.add(new RitualComponent(0, 0, 2, 4)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java index 0710499e..b1efd0e2 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectVeilOfEvil.java @@ -34,9 +34,9 @@ public class RitualEffectVeilOfEvil extends RitualEffect int dimension = world.provider.getDimensionId(); - if (AlchemicalWizardryEventHooks.forceSpawnMap.containsKey(new Integer(dimension))) + if (AlchemicalWizardryEventHooks.forceSpawnMap.containsKey(dimension)) { - List list = AlchemicalWizardryEventHooks.forceSpawnMap.get(new Integer(dimension)); + List list = AlchemicalWizardryEventHooks.forceSpawnMap.get(dimension); if (list != null) { if (!list.contains(new CoordAndRange(pos, horizRange, vertRange))) @@ -57,15 +57,15 @@ public class RitualEffectVeilOfEvil extends RitualEffect } } else { - list = new LinkedList(); + list = new LinkedList(); list.add(new CoordAndRange(pos, horizRange, vertRange)); - AlchemicalWizardryEventHooks.forceSpawnMap.put(new Integer(dimension), list); + AlchemicalWizardryEventHooks.forceSpawnMap.put(dimension, list); } } else { - List list = new LinkedList(); + List list = new LinkedList(); list.add(new CoordAndRange(pos, horizRange, vertRange)); - AlchemicalWizardryEventHooks.forceSpawnMap.put(new Integer(dimension), list); + AlchemicalWizardryEventHooks.forceSpawnMap.put(dimension, list); } @@ -82,7 +82,7 @@ public class RitualEffectVeilOfEvil extends RitualEffect @Override public List getRitualComponentList() { - ArrayList veilRitual = new ArrayList(); + ArrayList veilRitual = new ArrayList(); veilRitual.add(new RitualComponent(1, 0, 2, RitualComponent.DUSK)); veilRitual.add(new RitualComponent(2, 0, 1, RitualComponent.DUSK)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java index e0080ad8..87e19084 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWater.java @@ -193,7 +193,7 @@ public class RitualEffectWater extends RitualEffect @Override public List getRitualComponentList() { - ArrayList waterRitual = new ArrayList(); + ArrayList waterRitual = new ArrayList(); waterRitual.add(new RitualComponent(-1, 0, 1, 1)); waterRitual.add(new RitualComponent(-1, 0, -1, 1)); waterRitual.add(new RitualComponent(1, 0, -1, 1)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java index c6bba4f3..365e40b7 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectWellOfSuffering.java @@ -35,7 +35,7 @@ public class RitualEffectWellOfSuffering extends RitualEffect World world = ritualStone.getWorldObj(); BlockPos pos = ritualStone.getPosition(); - if (world.getWorldTime() % this.timeDelay != 0) + if (world.getWorldTime() % timeDelay != 0) { return; } @@ -95,7 +95,7 @@ public class RitualEffectWellOfSuffering extends RitualEffect entityCount++; - tileAltar.sacrificialDaggerCall(this.amount * (hasTennebrae ? 2 : 1) * (hasOffensa ? 2 : 1), true); + tileAltar.sacrificialDaggerCall(amount * (hasTennebrae ? 2 : 1) * (hasOffensa ? 2 : 1), true); } } @@ -117,7 +117,7 @@ public class RitualEffectWellOfSuffering extends RitualEffect @Override public List getRitualComponentList() { - ArrayList wellOfSufferingRitual = new ArrayList(); + ArrayList wellOfSufferingRitual = new ArrayList(); wellOfSufferingRitual.add(new RitualComponent(1, 0, 1, RitualComponent.FIRE)); wellOfSufferingRitual.add(new RitualComponent(-1, 0, 1, RitualComponent.FIRE)); wellOfSufferingRitual.add(new RitualComponent(1, 0, -1, RitualComponent.FIRE)); diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicIgnMeta.java b/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicIgnMeta.java index 7fb2f489..2dd2077b 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicIgnMeta.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicIgnMeta.java @@ -8,6 +8,6 @@ public class RoutingFocusLogicIgnMeta extends RoutingFocusLogic @Override public boolean getDefaultMatch(ItemStack keyStack, ItemStack checkedStack) { - return (keyStack != null ? checkedStack != null && keyStack.getItem() == checkedStack.getItem() : false); + return keyStack != null && checkedStack != null && keyStack.getItem() == checkedStack.getItem(); } } diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicLimit.java b/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicLimit.java index 26fb3495..ad1aed90 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicLimit.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/routing/RoutingFocusLogicLimit.java @@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.api.RoutingFocusLogic; public class RoutingFocusLogicLimit extends RoutingFocusLogic implements ILimitingLogic { + @Override public int getRoutingLimit() { return 0; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java index 5a984a87..0891c0f3 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/spell/simple/SpellEarthBender.java @@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.spell.simple; import java.util.Random; +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -78,7 +79,7 @@ public class SpellEarthBender extends HomSpell if (!player.capabilities.isCreativeMode) { - EnergyItems.syphonAndDamageWhileInContainer(stack, player, this.getDefensiveEnergy()); + SoulNetworkHandler.syphonAndDamageFromNetwork(stack, player, this.getDefensiveEnergy()); } double xCoord = player.posX; @@ -144,7 +145,7 @@ public class SpellEarthBender extends HomSpell if (!player.capabilities.isCreativeMode) { - EnergyItems.syphonAndDamageWhileInContainer(stack, player, this.getEnvironmentalEnergy()); + SoulNetworkHandler.syphonAndDamageFromNetwork(stack, player, this.getEnvironmentalEnergy()); } int range = 3; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiChemistrySet.java similarity index 93% rename from src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java rename to src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiChemistrySet.java index 06339896..e1a05602 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiWritingTable.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiChemistrySet.java @@ -10,9 +10,9 @@ import org.lwjgl.opengl.GL11; import WayofTime.alchemicalWizardry.common.tileEntity.TEChemistrySet; import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable; -public class GuiWritingTable extends GuiContainer +public class GuiChemistrySet extends GuiContainer { - public GuiWritingTable(InventoryPlayer inventoryPlayer, TEChemistrySet tileEntity) + public GuiChemistrySet(InventoryPlayer inventoryPlayer, TEChemistrySet tileEntity) { super(new ContainerWritingTable(inventoryPlayer, tileEntity)); xSize = 176; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java index 496aac83..8245881e 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiHandler.java @@ -1,7 +1,6 @@ package WayofTime.alchemicalWizardry.common.tileEntity.gui; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.World; @@ -55,8 +54,6 @@ public class GuiHandler implements IGuiHandler TileEntity tileEntity; BlockPos pos = new BlockPos(x, y, z); - ItemStack held = player.getHeldItem(); - switch (id) { case 0: @@ -64,7 +61,7 @@ public class GuiHandler implements IGuiHandler if (tileEntity instanceof TEChemistrySet) { - return new GuiWritingTable(player.inventory, (TEChemistrySet) tileEntity); + return new GuiChemistrySet(player.inventory, (TEChemistrySet) tileEntity); } break; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java index 35187582..050849d6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java @@ -2,7 +2,6 @@ package WayofTime.alchemicalWizardry.common.tileEntity.gui; import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer; -import net.minecraft.client.gui.inventory.GuiBrewingStand; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation;