mirror of
https://github.com/GTNewHorizons/Avaritia.git
synced 2026-11-22 13:10:00 +00:00
Calamari, Pneumatics, and Air Hammers
This commit is contained in:
1 parent
a41ed9366a
commit
574a524953
5 files changed
+64
-8
No files matched your search
@@ -8,6 +8,7 @@ import fox.spiteful.avaritia.items.tools.ItemSwordInfinity;
|
||||
import fox.spiteful.avaritia.items.tools.ToolHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -23,12 +24,14 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import static net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||
import static net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;
|
||||
|
||||
public class LudicrousEvents {
|
||||
@@ -165,6 +168,19 @@ public class LudicrousEvents {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void diggity(BreakSpeed event){
|
||||
if(event.entityPlayer.getHeldItem() != null){
|
||||
ItemStack held = event.entityPlayer.getHeldItem();
|
||||
if(held.getItem() == LudicrousItems.infinity_pickaxe){
|
||||
if(!event.entityPlayer.onGround)
|
||||
event.newSpeed *= 5;
|
||||
if(!event.entityPlayer.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(event.entityPlayer))
|
||||
event.newSpeed *= 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addDrop(LivingDropsEvent event, ItemStack drop) {
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, drop);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
|
||||
@@ -292,6 +292,7 @@ public class Compat {
|
||||
OreDictionary.registerOre("cropCorn", new ItemStack(crop, 1, 7));
|
||||
OreDictionary.registerOre("cropTomato", new ItemStack(crop, 1, 8));
|
||||
OreDictionary.registerOre("rawMutton", new ItemStack(meat, 1, 0));
|
||||
OreDictionary.registerOre("rawCalamari", new ItemStack(meat, 1, 1));
|
||||
}
|
||||
catch (Throwable e){
|
||||
Lumberjack.log(Level.INFO, "Avaritia got bored of waiting for magical crops to grow.");
|
||||
@@ -316,7 +317,9 @@ public class Compat {
|
||||
try {
|
||||
Item mutton = getItem("harvestcraft", "muttonrawItem");
|
||||
Item beet = getItem("harvestcraft", "beetItem");
|
||||
Item calamari = getItem("harvestcraft", "calamarirawItem");
|
||||
OreDictionary.registerOre("rawMutton", new ItemStack(mutton, 1, 0));
|
||||
OreDictionary.registerOre("rawCalamari", new ItemStack(calamari, 1, 0));
|
||||
OreDictionary.registerOre("cropBeetroot", new ItemStack(beet, 1, 0));
|
||||
}
|
||||
catch (Throwable e){
|
||||
|
||||
@@ -196,6 +196,9 @@ public class Grinder {
|
||||
if(!OreDictionary.getOres("ingotTartarite").isEmpty()){
|
||||
catalyst.getInput().add(OreDictionary.getOres("ingotTartarite"));
|
||||
}
|
||||
if(!OreDictionary.getOres("blockIronCompressed").isEmpty()){
|
||||
catalyst.getInput().add(OreDictionary.getOres("blockIronCompressed"));
|
||||
}
|
||||
|
||||
ExtremeCraftingManager.getInstance().addExtremeShapedOreRecipe(new ItemStack(LudicrousItems.endest_pearl), new Object[]{
|
||||
" EEE ",
|
||||
|
||||
@@ -19,7 +19,7 @@ public class Mincer {
|
||||
// here's where all the food magic goes on
|
||||
private static String[] sacredCropNames = new String[]{"cropWheat", "cropCarrot", "cropPotato", "cropApple", "cropMelon", "cropPumpkin", "cropCactus", "cropMushroomRed", "cropMushroomBrown"};
|
||||
private static String[] forbiddenCropNames = new String[] {"cropEdibleroot", "cropWhitemushroom", "cropBeet", "cropCotton"};
|
||||
private static String[] knownMeatEntries = new String[]{"ingotMeatRaw", "dustMeat", "rawMutton"};
|
||||
private static String[] knownMeatEntries = new String[]{"ingotMeatRaw", "dustMeat", "rawMutton", "rawCalamari"};
|
||||
private static List<ItemStack> knownMeats = new ArrayList<ItemStack>();
|
||||
|
||||
static {
|
||||
@@ -175,14 +175,14 @@ public class Mincer {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<meatNames.size(); i++) {
|
||||
/*for (int i=0; i<meatNames.size(); i++) {
|
||||
if (!rawMeats.contains(meatNames.get(i))) {
|
||||
List<ItemStack> meatstacks = OreDictionary.getOres(meatNames.get(i));
|
||||
if (!meatstacks.isEmpty()) {
|
||||
meatSortingList.add(new FoodInfo(meatNames.get(i), meatstacks.size()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if(Compat.twilight){
|
||||
try {
|
||||
|
||||
@@ -3,6 +3,7 @@ package fox.spiteful.avaritia.items;
|
||||
import com.google.common.collect.Multimap;
|
||||
import fox.spiteful.avaritia.Avaritia;
|
||||
import fox.spiteful.avaritia.Lumberjack;
|
||||
import fox.spiteful.avaritia.compat.Compat;
|
||||
import fox.spiteful.avaritia.render.ModelArmorInfinity;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import fox.spiteful.avaritia.PotionHelper;
|
||||
@@ -14,8 +15,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import org.apache.logging.log4j.Level;
|
||||
@@ -27,15 +31,18 @@ import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import vazkii.botania.api.item.IPhantomInkable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"),
|
||||
@Optional.Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft")
|
||||
@Optional.Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"),
|
||||
@Optional.Interface(iface = "vazkii.botania.api.item.IPhantomInkable", modid = "Botania")
|
||||
})
|
||||
public class ItemArmorInfinity extends ItemArmor implements IGoggles, IRevealer, IVisDiscountGear {
|
||||
public class ItemArmorInfinity extends ItemArmor implements IGoggles, IRevealer, IVisDiscountGear, IPhantomInkable {
|
||||
|
||||
public static final ArmorMaterial infinite_armor = EnumHelper.addArmorMaterial("infinity", 9999, new int[]{6, 16, 12, 6}, 1000);
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -56,6 +63,9 @@ public class ItemArmorInfinity extends ItemArmor implements IGoggles, IRevealer,
|
||||
//if(slot == 2)
|
||||
// return "avaritia:textures/models/infinity_pants.png";
|
||||
//else
|
||||
if(Compat.botan && hasPhantomInk(stack))
|
||||
return "botania:textures/model/invisibleArmor.png";
|
||||
else
|
||||
return "avaritia:textures/models/infinity_armor.png";
|
||||
}
|
||||
|
||||
@@ -117,8 +127,6 @@ public class ItemArmorInfinity extends ItemArmor implements IGoggles, IRevealer,
|
||||
public Multimap getAttributeModifiers(ItemStack stack)
|
||||
{
|
||||
Multimap multimap = super.getAttributeModifiers(stack);
|
||||
if(armorType == 2)
|
||||
multimap.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Armor modifier", 1.0, 1));
|
||||
if(armorType == 3)
|
||||
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Armor modifier", 0.7, 1));
|
||||
return multimap;
|
||||
@@ -143,7 +151,33 @@ public class ItemArmorInfinity extends ItemArmor implements IGoggles, IRevealer,
|
||||
@Optional.Method(modid = "Thaumcraft")
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack itemStack, EntityPlayer entityPlayer, Aspect aspect){
|
||||
return 10;
|
||||
return 20;
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
if(Compat.thaumic)
|
||||
list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " + this.getVisDiscount(stack, player, (Aspect)null) + "%");
|
||||
if(Compat.botan) {
|
||||
if (hasPhantomInk(stack))
|
||||
list.add(StatCollector.translateToLocal("botaniamisc.hasPhantomInk").replaceAll("&", "\u00a7"));
|
||||
}
|
||||
super.addInformation(stack, player, list, par4);
|
||||
}
|
||||
|
||||
public boolean hasPhantomInk(ItemStack stack) {
|
||||
if(stack.getTagCompound() == null)
|
||||
return false;
|
||||
return stack.getTagCompound().getBoolean("phantomInk");
|
||||
}
|
||||
|
||||
public void setPhantomInk(ItemStack stack, boolean ink) {
|
||||
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if(tag == null){
|
||||
tag = new NBTTagCompound();
|
||||
stack.setTagCompound(tag);
|
||||
}
|
||||
tag.setBoolean("phantomInk", ink);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user