THE PINKINATOR

This commit is contained in:
Lizbeth Rika committed 2015-03-25 20:49:05 +00:00
1 parent a7c44cacf7
commit d7cfbb2695
14 files changed
+219 -2

No files matched your search

@@ -64,6 +64,7 @@ import vazkii.botania.client.render.block.RenderSpreader;
import vazkii.botania.client.render.block.RenderTinyPotato;
import vazkii.botania.client.render.entity.RenderCorporeaSpark;
import vazkii.botania.client.render.entity.RenderDoppleganger;
import vazkii.botania.client.render.entity.RenderPinkWither;
import vazkii.botania.client.render.entity.RenderPixie;
import vazkii.botania.client.render.entity.RenderPoolMinecart;
import vazkii.botania.client.render.entity.RenderSpark;
@@ -116,6 +117,7 @@ import vazkii.botania.common.core.version.VersionChecker;
import vazkii.botania.common.entity.EntityCorporeaSpark;
import vazkii.botania.common.entity.EntityDoppleganger;
import vazkii.botania.common.entity.EntityEnderAirBottle;
import vazkii.botania.common.entity.EntityPinkWither;
import vazkii.botania.common.entity.EntityPixie;
import vazkii.botania.common.entity.EntityPoolMinecart;
import vazkii.botania.common.entity.EntitySpark;
@@ -232,6 +234,7 @@ public class ClientProxy extends CommonProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityCorporeaSpark.class, new RenderCorporeaSpark());
RenderingRegistry.registerEntityRenderingHandler(EntityEnderAirBottle.class, new RenderSnowball(ModItems.manaResource, 15));
RenderingRegistry.registerEntityRenderingHandler(EntityPoolMinecart.class, new RenderPoolMinecart());
RenderingRegistry.registerEntityRenderingHandler(EntityPinkWither.class, new RenderPinkWither());
ShaderHelper.initShaders();
}
@@ -107,6 +107,7 @@ public final class LibResources {
public static final String MODEL_MINI_ISLAND_PODZOL = PREFIX_MODEL + "miniIslandPodzol.png";
public static final String MODEL_MINI_ISLAND_MYCEL = PREFIX_MODEL + "miniIslandMycelium.png";
public static final String MODEL_MINI_ISLAND_SNOW = PREFIX_MODEL + "miniIslandSnow.png";
public static final String MODEL_PINK_WITHER = PREFIX_MODEL + "pinkWither.png";
public static final String MISC_PARTICLES = PREFIX_MISC + "particles.png";
public static final String MISC_WISP_LARGE = PREFIX_MISC + "wispLarge.png";
@@ -0,0 +1,41 @@
/**
* 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 @ [Mar 25, 2015, 5:55:59 PM (GMT)]
*/
package vazkii.botania.client.render.entity;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.client.lib.LibResources;
import net.minecraft.client.model.ModelWither;
import net.minecraft.client.renderer.entity.RenderWither;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.boss.BossStatus;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.util.ResourceLocation;
public class RenderPinkWither extends RenderWither {
private static final ResourceLocation resource = new ResourceLocation(LibResources.MODEL_PINK_WITHER);
int idk = -1;
public void doRender(EntityWither p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
if(BossStatus.bossName.equals(p_76986_1_.func_145748_c_().getFormattedText())) {
BossStatus.statusBarTime = -1;
BossStatus.hasColorModifier = false;
}
}
@Override
protected ResourceLocation getEntityTexture(EntityWither p_110775_1_) {
return resource;
}
}
@@ -172,6 +172,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addItem(ModItems.terrasteelBoots);
addItem(ModItems.ancientWill);
addItem(ModItems.phantomInk);
addItem(ModItems.pinkinator);
addItem(ModItems.tinyPlanet);
addBlock(ModBlocks.tinyPlanet);
@@ -324,4 +325,4 @@ public final class BotaniaCreativeTab extends CreativeTabs {
block.getSubBlocks(stack.getItem(), this, list);
}
}
}
@@ -328,6 +328,9 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
entityDropItem(new ItemStack(ModItems.manaResource, 4 + rand.nextInt(3), 2), 1F);
if(Math.random() < 0.3)
entityDropItem(new ItemStack(ModItems.rune, 2 + rand.nextInt(3), rand.nextInt(16)), 1F);
if(Math.random() < 0.2)
entityDropItem(new ItemStack(ModItems.pinkinator), 1F);
}
}
}
@@ -0,0 +1,100 @@
/**
* 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 @ [Mar 25, 2015, 5:49:28 PM (GMT)]
*/
package vazkii.botania.common.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class EntityPinkWither extends EntityWither {
public EntityPinkWither(World p_i1701_1_) {
super(p_i1701_1_);
}
@Override
public void onLivingUpdate() {
super.onLivingUpdate();
if(Math.random() < 0.1)
for(int j = 0; j < 3; ++j) {
double d10 = this.func_82214_u(j);
double d2 = this.func_82208_v(j);
double d4 = this.func_82213_w(j);
this.worldObj.spawnParticle("heart", d10 + this.rand.nextGaussian() * 0.30000001192092896D, d2 + this.rand.nextGaussian() * 0.30000001192092896D, d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D);
}
}
@Override
public void setAttackTarget(EntityLivingBase p_70624_1_) {
// NO-OP
}
@Override
protected void attackEntity(Entity p_70785_1_, float p_70785_2_) {
// NO-OP
}
@Override
public boolean attackEntityAsMob(Entity p_70652_1_) {
return false;
}
@Override
protected boolean interact(EntityPlayer player) {
player.mountEntity(this);
return true;
}
@Override
protected boolean isAIEnabled() {
return false;
}
// COPYPASTA
private double func_82214_u(int p_82214_1_)
{
if (p_82214_1_ <= 0)
{
return this.posX;
}
else
{
float f = (this.renderYawOffset + (float)(180 * (p_82214_1_ - 1))) / 180.0F * (float)Math.PI;
float f1 = MathHelper.cos(f);
return this.posX + (double)f1 * 1.3D;
}
}
private double func_82208_v(int p_82208_1_)
{
return p_82208_1_ <= 0 ? this.posY + 3.0D : this.posY + 2.2D;
}
private double func_82213_w(int p_82213_1_)
{
if (p_82213_1_ <= 0)
{
return this.posZ;
}
else
{
float f = (this.renderYawOffset + (float)(180 * (p_82213_1_ - 1))) / 180.0F * (float)Math.PI;
float f1 = MathHelper.sin(f);
return this.posZ + (double)f1 * 1.3D;
}
}
}
@@ -10,6 +10,7 @@
*/
package vazkii.botania.common.entity;
import net.minecraft.entity.boss.EntityWither;
import vazkii.botania.common.Botania;
import vazkii.botania.common.lib.LibEntityNames;
import cpw.mods.fml.common.registry.EntityRegistry;
@@ -33,6 +34,7 @@ public final class ModEntities {
EntityRegistry.registerModEntity(EntityCorporeaSpark.class, LibEntityNames.CORPOREA_SPARK, id++, Botania.instance, 64, 10, false);
EntityRegistry.registerModEntity(EntityEnderAirBottle.class, LibEntityNames.ENDER_AIR_BOTTLE, id++, Botania.instance, 64, 10, true);
EntityRegistry.registerModEntity(EntityPoolMinecart.class, LibEntityNames.POOL_MINECART, id++, Botania.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityPinkWither.class, LibEntityNames.PINK_WITHER, id++, Botania.instance, 80, 3, false);
}
}
@@ -0,0 +1,60 @@
/**
* 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 @ [Mar 25, 2015, 6:03:28 PM (GMT)]
*/
package vazkii.botania.common.item;
import java.util.List;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import vazkii.botania.common.Botania;
import vazkii.botania.common.entity.EntityPinkWither;
import vazkii.botania.common.lib.LibItemNames;
public class ItemPinkinator extends ItemMod {
public ItemPinkinator() {
setUnlocalizedName(LibItemNames.PINKINATOR);
setMaxStackSize(1);
setFull3D();
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
int range = 16;
List<EntityWither> withers = world.getEntitiesWithinAABB(EntityWither.class, AxisAlignedBB.getBoundingBox(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range));
for(EntityWither wither : withers)
if(!wither.isDead && !(wither instanceof EntityPinkWither)) {
if(!world.isRemote) {
wither.setDead();
EntityPinkWither pink = new EntityPinkWither(world);
pink.setLocationAndAngles(wither.posX, wither.posY, wither.posZ, wither.rotationYaw, wither.rotationPitch);
world.spawnEntityInWorld(pink);
world.playSoundAtEntity(wither, "random.explode", 4F, (1F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F);
}
world.spawnParticle("hugeexplosion", wither.posX, wither.posY, wither.posZ, 1D, 0D, 0D);
stack.stackSize--;
return stack;
}
return stack;
}
@Override
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
p_77624_3_.add(StatCollector.translateToLocal("botaniamisc.pinkinatorDesc"));
}
}
@@ -213,6 +213,7 @@ public final class ModItems {
public static Item flowerBag;
public static Item phantomInk;
public static Item poolMinecart;
public static Item pinkinator;
public static void init() {
lexicon = new ItemLexicon();
@@ -330,7 +331,8 @@ public final class ModItems {
flowerBag = new ItemFlowerBag();
phantomInk = new ItemPhantomInk();
poolMinecart = new ItemPoolMinecart();
pinkinator = new ItemPinkinator();
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
for(int i = 0; i < 16; i++) {
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
@@ -28,5 +28,6 @@ public final class LibEntityNames {
public static final String CORPOREA_SPARK = LibResources.PREFIX_MOD + "corporeaSpark";
public static final String ENDER_AIR_BOTTLE = LibResources.PREFIX_MOD + "enderAirBottle";
public static final String POOL_MINECART = LibResources.PREFIX_MOD + "poolMinecart";
public static final String PINK_WITHER = LibResources.PREFIX_MOD + "pinkWither";
}
@@ -128,6 +128,7 @@ public final class LibItemNames {
public static final String FLOWER_BAG = "flowerBag";
public static final String PHANTOM_INK = "phantomInk";
public static final String POOL_MINECART = "poolMinecart";
public static final String PINKINATOR = "pinkinator";
public static final String[] LENS_NAMES = new String[] {
"lensNormal",