Most of API

This commit is contained in:
Vincent Lee committed 2016-03-18 12:30:10 -05:00
1 parent 3bb203e371
commit 58e06ae86b
4 files changed
+72 -8

No files matched your search

@@ -29,6 +29,7 @@ import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
@@ -103,16 +104,16 @@ public final class BotaniaAPI {
public static Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<>();
public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", "manasteel", 16, new int[] { 2, 6, 5, 2 }, 18);
public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", "manasteel", 16, new int[] { 2, 6, 5, 2 }, 18, SoundEvents.item_armor_equip_iron);
public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
public static ArmorMaterial elementiumArmorMaterial = EnumHelper.addArmorMaterial("B_ELEMENTIUM", "b_elementium", 18, new int[] { 2, 6, 5, 2 }, 18);
public static ArmorMaterial elementiumArmorMaterial = EnumHelper.addArmorMaterial("B_ELEMENTIUM", "b_elementium", 18, new int[] { 2, 6, 5, 2 }, 18, SoundEvents.item_armor_equip_iron);
public static ToolMaterial elementiumToolMaterial = EnumHelper.addToolMaterial("B_ELEMENTIUM", 3, 720, 6.2F, 2F, 20);
public static ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", "terrasteel", 34, new int[] {3, 8, 6, 3}, 26);
public static ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", "terrasteel", 34, new int[] {3, 8, 6, 3}, 26, SoundEvents.item_armor_equip_iron);
public static ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 4, 2300, 9F, 3F, 26);
public static ArmorMaterial manaweaveArmorMaterial = EnumHelper.addArmorMaterial("MANAWEAVE", "manaweave", 5, new int[] { 1, 2, 2, 1 }, 18);
public static ArmorMaterial manaweaveArmorMaterial = EnumHelper.addArmorMaterial("MANAWEAVE", "manaweave", 5, new int[] { 1, 2, 2, 1 }, 18, SoundEvents.item_armor_equip_iron);
public static EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", TextFormatting.GOLD, "Relic");
@@ -0,0 +1,58 @@
package vazkii.botania.api.sound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
/**
* Use these to play Botania sounds.
* Do not access this class before Botania preinits!
*/
public final class BotaniaSoundEvents {
public static final SoundEvent airRod = getRegisteredSoundEvent("botania:airRod");
public static final SoundEvent agricarnation = getRegisteredSoundEvent("botania:agricarnation");
public static final SoundEvent altarCraft = getRegisteredSoundEvent("botania:altarCraft");
public static final SoundEvent babylonAttack = getRegisteredSoundEvent("botania:babylonAttack");
public static final SoundEvent babylonSpawn = getRegisteredSoundEvent("botania:babylonSpawn");
public static final SoundEvent bellows = getRegisteredSoundEvent("botania:bellows");
public static final SoundEvent bifrostRod = getRegisteredSoundEvent("botania:bifrostRod");
public static final SoundEvent blackLotus = getRegisteredSoundEvent("botania:blackLotus");
public static final SoundEvent dash = getRegisteredSoundEvent("botania:dash");
public static final SoundEvent ding = getRegisteredSoundEvent("botania:ding");
public static final SoundEvent divaCharm = getRegisteredSoundEvent("botania:divaCharm");
public static final SoundEvent divinationRod = getRegisteredSoundEvent("botania:divinationRod");
public static final SoundEvent doit = getRegisteredSoundEvent("botania:doit");
public static final SoundEvent enchanterBlock = getRegisteredSoundEvent("botania:enchanterBlock");
public static final SoundEvent enchanterEnchant = getRegisteredSoundEvent("botania:enchanterEnchant");
public static final SoundEvent endoflame = getRegisteredSoundEvent("botania:endoflame");
public static final SoundEvent equipBauble = getRegisteredSoundEvent("botania:equipBauble");
public static final SoundEvent gaiaTrap = getRegisteredSoundEvent("botania:gaiaTrap");
public static final SoundEvent goldenLaurel = getRegisteredSoundEvent("botania:goldenLaurel");
public static final SoundEvent holyCloak = getRegisteredSoundEvent("botania:holyCloak");
public static final SoundEvent laputaStart = getRegisteredSoundEvent("botania:laputaStart");
public static final SoundEvent lexiconOpen = getRegisteredSoundEvent("botania:lexiconOpen");
public static final SoundEvent lexiconPage = getRegisteredSoundEvent("botania:lexiconPage");
public static final SoundEvent lightRelay = getRegisteredSoundEvent("botania:lightRelay");
public static final SoundEvent manaBlaster = getRegisteredSoundEvent("botania:manaBlaster");
public static final SoundEvent manaPoolCraft = getRegisteredSoundEvent("botania:manaPoolCraft");
public static final SoundEvent missile = getRegisteredSoundEvent("botania:missile");
public static final SoundEvent orechid = getRegisteredSoundEvent("botania:orechid");
public static final SoundEvent potionCreate = getRegisteredSoundEvent("botania:potionCreate");
public static final SoundEvent runeAltarCraft = getRegisteredSoundEvent("botania:runeAltarCraft");
public static final SoundEvent runeAltarStart = getRegisteredSoundEvent("botania:runeAltarStart");
public static final SoundEvent spreaderFire = getRegisteredSoundEvent("botania:spreaderFire");
public static final SoundEvent starcaller = getRegisteredSoundEvent("botania:starcaller");
public static final SoundEvent terraBlade = getRegisteredSoundEvent("botania:terraBlade");
public static final SoundEvent terraformRod = getRegisteredSoundEvent("botania:terraformRod");
public static final SoundEvent terraPickMode = getRegisteredSoundEvent("botania:terraPickMode");
public static final SoundEvent terrasteelCraft = getRegisteredSoundEvent("botania:terrasteelCraft");
public static final SoundEvent thermalily = getRegisteredSoundEvent("botania:thermalily");
public static final SoundEvent unholyCloak = getRegisteredSoundEvent("botania:unholyCloak");
public static final SoundEvent way = getRegisteredSoundEvent("botania:way");
private static SoundEvent getRegisteredSoundEvent(String name) {
return SoundEvent.soundEventRegistry.getObject(new ResourceLocation(name));
}
private BotaniaSoundEvents() {}
}
@@ -18,12 +18,14 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.text.translation.I18n;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.internal.IManaNetwork;
import vazkii.botania.api.mana.IManaPool;
import vazkii.botania.api.sound.BotaniaSoundEvents;
/**
* The basic class for a Functional Flower.
@@ -133,7 +135,7 @@ public class SubTileFunctional extends SubTileEntity {
return false;
knownMana = mana;
player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F);
player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F);
return super.onWanded(player, wand);
}
@@ -23,6 +23,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.text.translation.I18n;
@@ -30,6 +31,7 @@ import net.minecraft.world.World;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.internal.IManaNetwork;
import vazkii.botania.api.mana.IManaCollector;
import vazkii.botania.api.sound.BotaniaSoundEvents;
/**
* The basic class for a Generating Flower.
@@ -99,8 +101,9 @@ public class SubTileGenerating extends SubTileEntity {
int muhBalance = BotaniaAPI.internalHandler.getPassiveFlowerDecay();
if(passive && muhBalance > 0 && passiveDecayTicks > muhBalance) {
supertile.getWorld().playAuxSFX(2001, supertile.getPos(), Block.getIdFromBlock(supertile.getBlockType()));
if(supertile.getWorld().getBlockState(supertile.getPos().down()).getBlock().isSideSolid(supertile.getWorld(), supertile.getPos().down(), EnumFacing.UP))
IBlockState state = supertile.getWorld().getBlockState(supertile.getPos());
supertile.getWorld().playAuxSFX(2001, supertile.getPos(), Block.getStateId(state));
if(supertile.getWorld().getBlockState(supertile.getPos().down()).isSideSolid(supertile.getWorld(), supertile.getPos().down(), EnumFacing.UP))
supertile.getWorld().setBlockState(supertile.getPos(), Blocks.deadbush.getDefaultState());
else supertile.getWorld().setBlockToAir(supertile.getPos());
}
@@ -219,7 +222,7 @@ public class SubTileGenerating extends SubTileEntity {
sync();
knownMana = mana;
player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F);
player.worldObj.playSound(null, player.posX, player.posY, player.posZ, BotaniaSoundEvents.ding, SoundCategory.PLAYERS, 0.1F, 1F);
return super.onWanded(player, wand);
}