mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 12:42:19 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -7,66 +7,68 @@ import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.entity.EntityProjectile;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ItemThrowingWeapon extends ItemNpcInterface{
|
||||
private boolean rotating = false;
|
||||
private int damage = 2;
|
||||
private boolean dropItem = false;
|
||||
|
||||
public ItemThrowingWeapon(int par1) {
|
||||
super(par1);
|
||||
setCreativeTab(CustomItems.tabWeapon);
|
||||
}
|
||||
public class ItemThrowingWeapon extends ItemNpcInterface {
|
||||
private boolean rotating = false;
|
||||
private int damage = 2;
|
||||
private boolean dropItem = false;
|
||||
|
||||
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World worldObj, EntityPlayer player, int par4)
|
||||
{
|
||||
if(worldObj.isRemote){
|
||||
player.swingItem();
|
||||
return;
|
||||
}
|
||||
EntityProjectile projectile = new EntityProjectile(worldObj, player, new ItemStack(par1ItemStack.getItem(), 1,par1ItemStack.getItemDamage()), false);
|
||||
projectile.damage = damage;
|
||||
projectile.canBePickedUp = !player.capabilities.isCreativeMode && dropItem;
|
||||
projectile.setRotating(rotating);;
|
||||
projectile.setIs3D(true);
|
||||
projectile.setStickInWall(true);
|
||||
projectile.setHasGravity(true);
|
||||
projectile.setSpeed(12);
|
||||
|
||||
if(!player.capabilities.isCreativeMode){
|
||||
consumeItem(player, this);
|
||||
}
|
||||
projectile.shoot(1);
|
||||
worldObj.playSoundAtEntity(player, "customnpcs:misc.swosh", 1.0F,1);
|
||||
worldObj.spawnEntityInWorld(projectile);
|
||||
public ItemThrowingWeapon(int par1) {
|
||||
super(par1);
|
||||
setCreativeTab(CustomItems.tabWeapon);
|
||||
}
|
||||
public ItemThrowingWeapon setRotating(){
|
||||
rotating = true;
|
||||
return this;
|
||||
|
||||
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World worldObj, EntityPlayer player, int par4) {
|
||||
if (worldObj.isRemote) {
|
||||
player.swingItem();
|
||||
return;
|
||||
}
|
||||
EntityProjectile projectile = new EntityProjectile(worldObj, player, new ItemStack(par1ItemStack.getItem(), 1, par1ItemStack.getItemDamage()), false);
|
||||
projectile.damage = damage;
|
||||
projectile.canBePickedUp = !player.capabilities.isCreativeMode && dropItem;
|
||||
projectile.setRotating(rotating);
|
||||
;
|
||||
projectile.setIs3D(true);
|
||||
projectile.setStickInWall(true);
|
||||
projectile.setHasGravity(true);
|
||||
projectile.setSpeed(12);
|
||||
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
consumeItem(player, this);
|
||||
}
|
||||
projectile.shoot(1);
|
||||
worldObj.playSoundAtEntity(player, "customnpcs:misc.swosh", 1.0F, 1);
|
||||
worldObj.spawnEntityInWorld(projectile);
|
||||
}
|
||||
public ItemThrowingWeapon setDamage(int damage){
|
||||
this.damage = damage;
|
||||
return this;
|
||||
|
||||
public ItemThrowingWeapon setRotating() {
|
||||
rotating = true;
|
||||
return this;
|
||||
}
|
||||
public ItemThrowingWeapon setDropItem(){
|
||||
dropItem = true;
|
||||
return this;
|
||||
|
||||
public ItemThrowingWeapon setDamage(int damage) {
|
||||
this.damage = damage;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderSpecial(){
|
||||
super.renderSpecial();
|
||||
|
||||
public ItemThrowingWeapon setDropItem() {
|
||||
dropItem = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderSpecial() {
|
||||
super.renderSpecial();
|
||||
GL11.glTranslatef(0.2F, 0.1f, 0.06f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
|
||||
return par1ItemStack;
|
||||
}
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack par1ItemStack)
|
||||
{
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack par1ItemStack) {
|
||||
return 72000;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user