mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Added awesome battle music and music discs you can get that contain said music.
This commit is contained in:
1 parent
b3abe6e514
commit
79062bda9b
17 files changed
+174
-12
No files matched your search
@@ -22,9 +22,11 @@ import net.minecraft.client.renderer.entity.RenderSnowball;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemRecord;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntitySkull;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSettings.GameType;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
@@ -261,7 +263,7 @@ public class ClientProxy extends CommonProxy {
|
||||
public boolean isTheClientPlayer(EntityLivingBase entity) {
|
||||
return entity == Minecraft.getMinecraft().thePlayer;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isClientPlayerWearingMonocle() {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
@@ -308,6 +310,17 @@ public class ClientProxy extends CommonProxy {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playRecordClientSided(World world, int x, int y, int z, ItemRecord record) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if(record == null)
|
||||
world.playAuxSFXAtEntity(null, 1005, x, y, z, 0);
|
||||
else {
|
||||
world.playAuxSFXAtEntity(null, 1005, x, y, z, Item.getIdFromItem(record));
|
||||
mc.ingameGUI.setRecordPlayingMessage(record.getRecordNameLocal());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getWorldElapsedTicks() {
|
||||
return ClientTickHandler.ticksInGame;
|
||||
|
||||
@@ -173,6 +173,8 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.terrasteelLegs);
|
||||
addItem(ModItems.terrasteelBoots);
|
||||
addItem(ModItems.phantomInk);
|
||||
addItem(ModItems.recordGaia1);
|
||||
addItem(ModItems.recordGaia2);
|
||||
addItem(ModItems.ancientWill);
|
||||
addItem(ModItems.pinkinator);
|
||||
if(ConfigHandler.relicsEnabled) {
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.core.proxy;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemRecord;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
@@ -177,6 +178,10 @@ public class CommonProxy {
|
||||
public boolean openWikiPage(World world, Block block, MovingObjectPosition pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void playRecordClientSided(World world, int x, int y, int z, ItemRecord record) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
public long getWorldElapsedTicks() {
|
||||
return MinecraftServer.getServer().worldServers[0].getTotalWorldTime();
|
||||
|
||||
@@ -31,6 +31,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemRecord;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
@@ -96,6 +97,8 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
boolean spawnPixies = false;
|
||||
boolean anyWithArmor = false;
|
||||
|
||||
private static boolean isPlayingMusic = false;
|
||||
|
||||
public EntityDoppleganger(World par1World) {
|
||||
super(par1World);
|
||||
setSize(0.6F, 1.8F);
|
||||
@@ -279,11 +282,11 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
setTPDelay(4);
|
||||
spawnPixies = isAggored();
|
||||
}
|
||||
|
||||
|
||||
setAggroed(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDeath(DamageSource p_70645_1_) {
|
||||
super.onDeath(p_70645_1_);
|
||||
@@ -293,6 +296,9 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
if(!anyWithArmor)
|
||||
((EntityPlayer) entitylivingbase).addStat(ModAchievements.gaiaGuardianNoArmor, 1);
|
||||
}
|
||||
|
||||
worldObj.playSoundAtEntity(this, "random.explode", 20F, (1F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
worldObj.spawnParticle("hugeexplosion", posX, posY, posZ, 1D, 0D, 0D);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -313,7 +319,8 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
if(par1) {
|
||||
boolean hard = isHardMode();
|
||||
entityDropItem(new ItemStack(ModItems.manaResource, hard ? 16 : 8, 5), 1F);
|
||||
|
||||
boolean droppedRecord = false;
|
||||
|
||||
if(hard) {
|
||||
entityDropItem(new ItemStack(ModItems.ancientWill, 1, rand.nextInt(6)), 1F);
|
||||
if(ConfigHandler.relicsEnabled)
|
||||
@@ -336,15 +343,27 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
if(Math.random() < 0.2)
|
||||
entityDropItem(new ItemStack(ModItems.pinkinator), 1F);
|
||||
if(Math.random() < 0.3) {
|
||||
int i = Item.getIdFromItem(Items.record_13);
|
||||
int j = Item.getIdFromItem(Items.record_wait);
|
||||
int k = i + this.rand.nextInt(j - i + 1);
|
||||
entityDropItem(new ItemStack(Item.getItemById(k)), 1F);
|
||||
int i = Item.getIdFromItem(Items.record_13);
|
||||
int j = Item.getIdFromItem(Items.record_wait);
|
||||
int k = i + this.rand.nextInt(j - i + 1);
|
||||
entityDropItem(new ItemStack(Item.getItemById(k)), 1F);
|
||||
droppedRecord = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!droppedRecord && Math.random() < 0.20)
|
||||
entityDropItem(new ItemStack(hard ? ModItems.recordGaia2 : ModItems.recordGaia1), 1F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDead() {
|
||||
ChunkCoordinates source = getSource();
|
||||
Botania.proxy.playRecordClientSided(worldObj, source.posX, source.posY, source.posZ, null);
|
||||
isPlayingMusic = false;
|
||||
super.setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLivingUpdate() {
|
||||
super.onLivingUpdate();
|
||||
@@ -355,6 +374,11 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
ChunkCoordinates source = getSource();
|
||||
boolean hard = isHardMode();
|
||||
|
||||
if(worldObj.isRemote && !isPlayingMusic && !isDead) {
|
||||
Botania.proxy.playRecordClientSided(worldObj, source.posX, source.posY, source.posZ, (ItemRecord) (hard ? ModItems.recordGaia2 : ModItems.recordGaia1));
|
||||
isPlayingMusic = true;
|
||||
}
|
||||
|
||||
float range = 32F;
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(source.posX + 0.5 - range, source.posY + 0.5 - range, source.posZ + 0.5 - range, source.posX + 0.5 + range, source.posY + 0.5 + range, source.posZ + 0.5 + range));
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class EntityMagicLandmine extends Entity {
|
||||
Botania.proxy.wispFX(worldObj, posX - range + Math.random() * range * 2, posY, posZ - range + Math.random() * range * 2, r, g, b, 0.4F, -0.015F, 1);
|
||||
|
||||
if(ticksExisted >= 55) {
|
||||
worldObj.playSoundEffect(posX, posY, posZ, "botania:gaiaTrap", 0.6F, 1F);
|
||||
worldObj.playSoundEffect(posX, posY, posZ, "botania:gaiaTrap", 0.3F, 1F);
|
||||
|
||||
float m = 0.35F;
|
||||
g = 0.4F;
|
||||
|
||||
@@ -82,6 +82,8 @@ import vazkii.botania.common.item.material.ItemPestleAndMortar;
|
||||
import vazkii.botania.common.item.material.ItemPetal;
|
||||
import vazkii.botania.common.item.material.ItemQuartz;
|
||||
import vazkii.botania.common.item.material.ItemRune;
|
||||
import vazkii.botania.common.item.record.ItemRecordGaia1;
|
||||
import vazkii.botania.common.item.record.ItemRecordGaia2;
|
||||
import vazkii.botania.common.item.relic.ItemAesirRing;
|
||||
import vazkii.botania.common.item.relic.ItemDice;
|
||||
import vazkii.botania.common.item.relic.ItemExcaliber;
|
||||
@@ -232,6 +234,8 @@ public final class ModItems {
|
||||
public static Item dice;
|
||||
public static Item keepIvy;
|
||||
public static Item blackHoleTalisman;
|
||||
public static Item recordGaia1;
|
||||
public static Item recordGaia2;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
@@ -360,7 +364,9 @@ public final class ModItems {
|
||||
dice = new ItemDice();
|
||||
keepIvy = new ItemKeepIvy();
|
||||
blackHoleTalisman = new ItemBlackHoleTalisman();
|
||||
|
||||
recordGaia1 = new ItemRecordGaia1();
|
||||
recordGaia2 = new ItemRecordGaia2();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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 the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Apr 11, 2015, 9:56:00 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.record;
|
||||
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemRecord;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class ItemModRecord extends ItemRecord {
|
||||
|
||||
private final String file;
|
||||
|
||||
public ItemModRecord(String record, String name) {
|
||||
super("botania:" + record);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setUnlocalizedName(name);
|
||||
file = "botania:music." + record;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item setUnlocalizedName(String par1Str) {
|
||||
GameRegistry.registerItem(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item\\.", "item." + LibResources.PREFIX_MOD);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getRecordResource(String name) {
|
||||
return new ResourceLocation(file);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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 the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Apr 11, 2015, 10:03:46 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.record;
|
||||
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemRecordGaia1 extends ItemModRecord {
|
||||
|
||||
public ItemRecordGaia1() {
|
||||
super("gaia1", LibItemNames.RECORD_GAIA1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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 the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Apr 11, 2015, 10:06:28 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item.record;
|
||||
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemRecordGaia2 extends ItemModRecord {
|
||||
|
||||
public ItemRecordGaia2() {
|
||||
super("gaia2", LibItemNames.RECORD_GAIA2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -139,6 +139,8 @@ public final class LibItemNames {
|
||||
public static final String DICE = "dice";
|
||||
public static final String KEEP_IVY = "keepIvy";
|
||||
public static final String BLACK_HOLE_TALISMAN = "blackHoleTalisman";
|
||||
public static final String RECORD_GAIA1 = "recordGaia1";
|
||||
public static final String RECORD_GAIA2 = "recordGaia2";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
|
||||
Reference in new issue
Block a user