Merged and fixed Amnet's features

This commit is contained in:
Adubbz 2013-04-06 08:37:26 +11:00
parent aaf7cae4d3
commit bc3d8a2c44
4 changed files with 107 additions and 27 deletions

View file

@ -1,23 +1,27 @@
package tdwp_ftw.biomesop; package tdwp_ftw.biomesop;
import net.minecraftforge.client.MinecraftForgeClient; import tdwp_ftw.biomesop.declarations.BOPItems;
import net.minecraftforge.common.MinecraftForge; import tdwp_ftw.biomesop.items.projectiles.EntityMudball;
import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraftforge.client.MinecraftForgeClient;
public class ClientProxy extends CommonProxy { public class ClientProxy extends CommonProxy {
@Override
public void registerRenderers() {
MinecraftForgeClient.preloadTexture(ARMOR_MUD1_PNG);
MinecraftForgeClient.preloadTexture(ARMOR_MUD2_PNG);
MinecraftForgeClient.preloadTexture(ARMOR_AMETHYST1_PNG);
MinecraftForgeClient.preloadTexture(ARMOR_AMETHYST2_PNG);
} @Override
public void registerRenderers()
@Override {
public int addArmor(String armor) MinecraftForgeClient.preloadTexture(ARMOR_MUD1_PNG);
{ MinecraftForgeClient.preloadTexture(ARMOR_MUD2_PNG);
return RenderingRegistry.addNewArmourRendererPrefix(armor); MinecraftForgeClient.preloadTexture(ARMOR_AMETHYST1_PNG);
} MinecraftForgeClient.preloadTexture(ARMOR_AMETHYST2_PNG);
RenderingRegistry.registerEntityRenderingHandler(EntityMudball.class, new RenderSnowball(BOPItems.mudBall));
}
@Override
public int addArmor(String armor)
{
return RenderingRegistry.addNewArmourRendererPrefix(armor);
}
} }

View file

@ -1,28 +1,52 @@
package tdwp_ftw.biomesop.items; package tdwp_ftw.biomesop.items;
import tdwp_ftw.biomesop.declarations.BOPItems;
import tdwp_ftw.biomesop.items.projectiles.EntityMudball;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemBOP extends Item public class ItemBOP extends Item
{ {
public int boptextureid = 0; public int boptextureid = 0;
public ItemBOP(int id, int texture) public ItemBOP(int id, int texture)
{ {
super(id); super(id);
boptextureid = texture; boptextureid = texture;
} }
public void updateIcons(IconRegister iconRegister) public void updateIcons(IconRegister iconRegister)
{ {
if(boptextureid==0){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); } if(boptextureid==0){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); }
else if(boptextureid==1){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudbrick"); } else if(boptextureid==1){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudbrick"); }
else if(boptextureid==2){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:moss"); } else if(boptextureid==2){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:moss"); }
else if(boptextureid==3){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:ash"); } else if(boptextureid==3){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:ash"); }
else if(boptextureid==4){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethyst"); } else if(boptextureid==4){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:amethyst"); }
else if(boptextureid==5){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:staffhandle"); } else if(boptextureid==5){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:staffhandle"); }
else if(boptextureid==6){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:staffpole"); } else if(boptextureid==6){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:staffpole"); }
else if(boptextureid==7){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:stafftopper"); } else if(boptextureid==7){ iconIndex = iconRegister.registerIcon("BiomesOPlenty:stafftopper"); }
else { iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); } else { iconIndex = iconRegister.registerIcon("BiomesOPlenty:mudball"); }
} }
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (par1ItemStack.isItemEqual(new ItemStack(BOPItems.mudBall)))
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityMudball(par2World, par3EntityPlayer));
}
}
return par1ItemStack;
}
} }

View file

@ -0,0 +1,49 @@
package tdwp_ftw.biomesop.items.projectiles;
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import net.minecraft.client.particle.EntityBreakingFX;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.RenderEngine;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.item.Item;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityMudball extends EntityThrowable
{
public EntityMudball(World par1World)
{
super(par1World);
}
public EntityMudball(World par1World, EntityLiving par2EntityLiving)
{
super(par1World, par2EntityLiving);
}
public EntityMudball(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
@Override
protected void onImpact(MovingObjectPosition par1MovingObjectPosition) {
if (par1MovingObjectPosition.entityHit != null)
{
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 1);
}
for (int i = 0; i < 16; ++i)
{
this.worldObj.spawnParticle("splash", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
}
if (!this.worldObj.isRemote)
{
this.setDead();
}
}
}

View file

@ -41,6 +41,7 @@ import tdwp_ftw.biomesop.declarations.BOPConfiguration;
import tdwp_ftw.biomesop.declarations.BOPItems; import tdwp_ftw.biomesop.declarations.BOPItems;
import tdwp_ftw.biomesop.helpers.*; import tdwp_ftw.biomesop.helpers.*;
import tdwp_ftw.biomesop.items.*; import tdwp_ftw.biomesop.items.*;
import tdwp_ftw.biomesop.items.projectiles.EntityMudball;
import tdwp_ftw.biomesop.mobs.*; import tdwp_ftw.biomesop.mobs.*;
import tdwp_ftw.biomesop.worldtype.WTBiomesOP; import tdwp_ftw.biomesop.worldtype.WTBiomesOP;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
@ -173,6 +174,8 @@ public class mod_BiomesOPlenty
LanguageRegistry.instance().addStringLocalization("entity.BiomesOPlenty.Rosester.name", "en_US", "Rosester"); LanguageRegistry.instance().addStringLocalization("entity.BiomesOPlenty.Rosester.name", "en_US", "Rosester");
EntityRegistry.addSpawn(EntityRosester.class, 10, 2, 4, EnumCreatureType.creature, BOPBiomes.garden); EntityRegistry.addSpawn(EntityRosester.class, 10, 2, 4, EnumCreatureType.creature, BOPBiomes.garden);
registerEntityEgg(EntityRosester.class, 14831439, 16756224); registerEntityEgg(EntityRosester.class, 14831439, 16756224);
EntityRegistry.registerModEntity(EntityMudball.class, "MudBall", EntityRegistry.findGlobalUniqueEntityId(), this, 80, 3, true);
DimensionManager.registerProviderType(promisedLandDim, WorldProviderPromised.class, false); DimensionManager.registerProviderType(promisedLandDim, WorldProviderPromised.class, false);