mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-28 07:55:39 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -6,68 +6,70 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityChairMount extends Entity{
|
||||
public class EntityChairMount extends Entity {
|
||||
|
||||
public EntityChairMount(World world) {
|
||||
super(world);
|
||||
setSize(0, 0);
|
||||
}
|
||||
|
||||
public double getMountedYOffset(){
|
||||
public EntityChairMount(World world) {
|
||||
super(world);
|
||||
setSize(0, 0);
|
||||
}
|
||||
|
||||
public double getMountedYOffset() {
|
||||
return 0.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
}
|
||||
|
||||
public void onEntityUpdate(){
|
||||
super.onEntityUpdate();
|
||||
if(this.worldObj != null && !this.worldObj.isRemote && riddenByEntity == null)
|
||||
isDead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntityInvulnerable(){
|
||||
protected void entityInit() {
|
||||
}
|
||||
|
||||
public void onEntityUpdate() {
|
||||
super.onEntityUpdate();
|
||||
if (this.worldObj != null && !this.worldObj.isRemote && riddenByEntity == null)
|
||||
isDead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntityInvulnerable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isInvisible(){
|
||||
public boolean isInvisible() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveEntity(double p_70091_1_, double p_70091_3_, double p_70091_5_){
|
||||
|
||||
public void moveEntity(double p_70091_1_, double p_70091_3_, double p_70091_5_) {
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith(){
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBePushed(){
|
||||
@Override
|
||||
public boolean canBePushed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fall(float p_70069_1_){
|
||||
|
||||
@Override
|
||||
protected void fall(float p_70069_1_) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_){
|
||||
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) {
|
||||
this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_);
|
||||
this.setRotation(p_70056_7_, p_70056_8_);
|
||||
}
|
||||
|
||||
@@ -11,85 +11,83 @@ import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class EntityCustomNpc extends EntityNPCFlying {
|
||||
public ModelData modelData = new ModelData();
|
||||
public ModelData modelData = new ModelData();
|
||||
|
||||
public EntityCustomNpc(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound compound) {
|
||||
super.readEntityFromNBT(compound);
|
||||
if(compound.hasKey("NpcModelData")) {
|
||||
npcVersion = compound.getInteger("ModRev");
|
||||
VersionCompatibility.CheckModelCompatibility(this, compound);
|
||||
modelData.readFromNBT(compound.getCompoundTag("NpcModelData"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound compound) {
|
||||
super.writeEntityToNBT(compound);
|
||||
compound.setTag("NpcModelData", modelData.writeToNBT());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(){
|
||||
super.onUpdate();
|
||||
if(isRemote()){
|
||||
ModelPartData particles = modelData.getPartData("particles");
|
||||
if(particles != null && !isKilled()){
|
||||
CustomNpcs.proxy.spawnParticle(this, "ModelData", modelData, particles);
|
||||
}
|
||||
EntityLivingBase entity = modelData.getEntity(this);
|
||||
if(entity != null){
|
||||
try{
|
||||
entity.onUpdate();
|
||||
}
|
||||
catch(Exception e){
|
||||
|
||||
}
|
||||
EntityUtil.Copy(this, entity);
|
||||
}
|
||||
}
|
||||
public EntityCustomNpc(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mountEntity(Entity par1Entity){
|
||||
super.mountEntity(par1Entity);
|
||||
updateHitbox();
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound compound) {
|
||||
super.readEntityFromNBT(compound);
|
||||
if (compound.hasKey("NpcModelData")) {
|
||||
npcVersion = compound.getInteger("ModRev");
|
||||
VersionCompatibility.CheckModelCompatibility(this, compound);
|
||||
modelData.readFromNBT(compound.getCompoundTag("NpcModelData"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateHitbox() {
|
||||
Entity entity = modelData.getEntity(this);
|
||||
if(modelData == null || entity == null){
|
||||
baseHeight = 1.9f - modelData.getBodyY() + (modelData.modelScale.head.scaleY - 1) / 2;
|
||||
super.updateHitbox();
|
||||
}
|
||||
else{
|
||||
if(entity instanceof EntityNPCInterface)
|
||||
((EntityNPCInterface)entity).updateHitbox();
|
||||
width = (entity.width / 5f) * display.modelSize;
|
||||
height = (entity.height / 5f) * display.modelSize;
|
||||
if(display.hitboxData.isHitboxEnabled()){
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound compound) {
|
||||
super.writeEntityToNBT(compound);
|
||||
compound.setTag("NpcModelData", modelData.writeToNBT());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
if (isRemote()) {
|
||||
ModelPartData particles = modelData.getPartData("particles");
|
||||
if (particles != null && !isKilled()) {
|
||||
CustomNpcs.proxy.spawnParticle(this, "ModelData", modelData, particles);
|
||||
}
|
||||
EntityLivingBase entity = modelData.getEntity(this);
|
||||
if (entity != null) {
|
||||
try {
|
||||
entity.onUpdate();
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
EntityUtil.Copy(this, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mountEntity(Entity par1Entity) {
|
||||
super.mountEntity(par1Entity);
|
||||
updateHitbox();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateHitbox() {
|
||||
Entity entity = modelData.getEntity(this);
|
||||
if (modelData == null || entity == null) {
|
||||
baseHeight = 1.9f - modelData.getBodyY() + (modelData.modelScale.head.scaleY - 1) / 2;
|
||||
super.updateHitbox();
|
||||
} else {
|
||||
if (entity instanceof EntityNPCInterface)
|
||||
((EntityNPCInterface) entity).updateHitbox();
|
||||
width = (entity.width / 5f) * display.modelSize;
|
||||
height = (entity.height / 5f) * display.modelSize;
|
||||
if (display.hitboxData.isHitboxEnabled()) {
|
||||
width = width * display.hitboxData.getWidthScale();
|
||||
height = height * display.hitboxData.getHeightScale();
|
||||
}
|
||||
|
||||
if(width < 0.1f)
|
||||
width = 0.1f;
|
||||
if(height < 0.1f)
|
||||
height = 0.1f;
|
||||
if(isKilled() && stats.hideKilledBody){
|
||||
if (width < 0.1f)
|
||||
width = 0.1f;
|
||||
if (height < 0.1f)
|
||||
height = 0.1f;
|
||||
if (isKilled() && stats.hideKilledBody) {
|
||||
width = 0.00001f;
|
||||
}
|
||||
if(width / 2 > worldObj.MAX_ENTITY_RADIUS) {
|
||||
if (width / 2 > worldObj.MAX_ENTITY_RADIUS) {
|
||||
worldObj.MAX_ENTITY_RADIUS = width / 2;
|
||||
}
|
||||
|
||||
this.setPosition(posX, posY, posZ);
|
||||
}
|
||||
}
|
||||
this.setPosition(posX, posY, posZ);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,30 +3,30 @@ package noppes.npcs.entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityDialogNpc extends EntityNPCInterface{
|
||||
public class EntityDialogNpc extends EntityNPCInterface {
|
||||
|
||||
public EntityDialogNpc(World world) {
|
||||
super(world);
|
||||
}
|
||||
public EntityDialogNpc(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isInvisibleToPlayer(EntityPlayer player){
|
||||
@Override
|
||||
public boolean isInvisibleToPlayer(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvisible(){
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean isInvisible() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean interact(EntityPlayer player) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean interact(EntityPlayer player) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,10 @@ package noppes.npcs.entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityFakeLiving extends EntityLiving{
|
||||
public class EntityFakeLiving extends EntityLiving {
|
||||
|
||||
public EntityFakeLiving(World par1World) {
|
||||
super(par1World);
|
||||
}
|
||||
public EntityFakeLiving(World par1World) {
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,31 +5,31 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityMagicProjectile extends EntityProjectile{
|
||||
private EntityPlayer player;
|
||||
private ItemStack equiped;
|
||||
public class EntityMagicProjectile extends EntityProjectile {
|
||||
private EntityPlayer player;
|
||||
private ItemStack equiped;
|
||||
|
||||
public EntityMagicProjectile(World par1World){
|
||||
super(par1World);
|
||||
}
|
||||
public EntityMagicProjectile(World par1World) {
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
public EntityMagicProjectile(World par1World,
|
||||
EntityPlayer player, ItemStack item, boolean isNPC) {
|
||||
super(par1World, player, item, isNPC);
|
||||
public EntityMagicProjectile(World par1World,
|
||||
EntityPlayer player, ItemStack item, boolean isNPC) {
|
||||
super(par1World, player, item, isNPC);
|
||||
|
||||
this.player = player;
|
||||
this.equiped = player.inventory.getCurrentItem();
|
||||
}
|
||||
this.player = player;
|
||||
this.equiped = player.inventory.getCurrentItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(){
|
||||
if(!worldObj.isRemote && (player == null || player.inventory.getCurrentItem() != equiped))
|
||||
this.setDead();
|
||||
super.onUpdate();
|
||||
}
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (!worldObj.isRemote && (player == null || player.inventory.getCurrentItem() != equiped))
|
||||
this.setDead();
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandSenderName(){
|
||||
return StatCollector.translateToLocal("entity.throwableitem.name");
|
||||
}
|
||||
@Override
|
||||
public String getCommandSenderName() {
|
||||
return StatCollector.translateToLocal("entity.throwableitem.name");
|
||||
}
|
||||
}
|
||||
@@ -14,30 +14,29 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFly(){
|
||||
public boolean canFly() {
|
||||
return ais.movementType == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fall(float distance) {
|
||||
if(!canFly())
|
||||
if (!canFly())
|
||||
super.fall(distance);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateFallState(double p_180433_1_, boolean p_180433_3_) {
|
||||
if(!canFly())
|
||||
if (!canFly())
|
||||
super.updateFallState(p_180433_1_, p_180433_3_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOnLadder(){
|
||||
public boolean isOnLadder() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_)
|
||||
{
|
||||
if(!this.canFly() || this.hurtTime != 0 || !this.canBreathe()) {
|
||||
public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) {
|
||||
if (!this.canFly() || this.hurtTime != 0 || !this.canBreathe()) {
|
||||
super.moveEntityWithHeading(p_70612_1_, p_70612_2_);
|
||||
return;
|
||||
}
|
||||
@@ -45,9 +44,9 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
|
||||
boolean aboveLimit = false;
|
||||
double heightOffGround = this.posY - this.worldObj.getTopSolidOrLiquidBlock((int) this.posX, (int) this.posZ);
|
||||
if (heightOffGround < 0) {
|
||||
Vec3 pos = Vec3.createVectorHelper(this.posX,this.posY,this.posZ);
|
||||
Vec3 posLimit = Vec3.createVectorHelper(this.posX,this.posY - this.ais.flyHeightLimit,this.posZ);
|
||||
MovingObjectPosition mob = this.worldObj.rayTraceBlocks(pos,posLimit,true);
|
||||
Vec3 pos = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||
Vec3 posLimit = Vec3.createVectorHelper(this.posX, this.posY - this.ais.flyHeightLimit, this.posZ);
|
||||
MovingObjectPosition mob = this.worldObj.rayTraceBlocks(pos, posLimit, true);
|
||||
if (mob == null || mob.typeOfHit == MovingObjectPosition.MovingObjectType.MISS) {
|
||||
aboveLimit = true;
|
||||
}
|
||||
|
||||
@@ -13,48 +13,44 @@ import noppes.npcs.entity.data.ModelData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCGolem extends EntityNPCInterface
|
||||
{
|
||||
public class EntityNPCGolem extends EntityNPCInterface {
|
||||
|
||||
public EntityNPCGolem(World world)
|
||||
{
|
||||
public EntityNPCGolem(World world) {
|
||||
super(world);
|
||||
display.texture = "customnpcs:textures/entity/golem/Iron Golem.png";
|
||||
|
||||
width = 1.4f;
|
||||
height = 2.5f;
|
||||
width = 1.4f;
|
||||
height = 2.5f;
|
||||
}
|
||||
|
||||
public void updateHitbox() {
|
||||
currentAnimation = EnumAnimation.values()[dataWatcher.getWatchableObjectInt(14)];
|
||||
if(currentAnimation == EnumAnimation.LYING){
|
||||
width = height = 0.5f;
|
||||
}
|
||||
else if (currentAnimation == EnumAnimation.SITTING){
|
||||
width = 1.4f;
|
||||
height = 2f;
|
||||
}
|
||||
else{
|
||||
width = 1.4f;
|
||||
height = 2.5f;
|
||||
}
|
||||
}
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
currentAnimation = EnumAnimation.values()[dataWatcher.getWatchableObjectInt(14)];
|
||||
if (currentAnimation == EnumAnimation.LYING) {
|
||||
width = height = 0.5f;
|
||||
} else if (currentAnimation == EnumAnimation.SITTING) {
|
||||
width = 1.4f;
|
||||
height = 2f;
|
||||
} else {
|
||||
width = 1.4f;
|
||||
height = 2.5f;
|
||||
}
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityNPCGolem.class);
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityNPCGolem.class);
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -566,7 +566,7 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
|
||||
return false;
|
||||
|
||||
// Attribute
|
||||
if(!DBCAddon.IsAvailable() && attackingEntity instanceof EntityPlayer)
|
||||
if (!DBCAddon.IsAvailable() && attackingEntity instanceof EntityPlayer)
|
||||
i = AttributeAttackUtil.calculateDamagePlayerToNPC((EntityPlayer) attackingEntity, this, i);
|
||||
|
||||
// Resistances
|
||||
@@ -727,7 +727,7 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
|
||||
if (isKilled())
|
||||
return;
|
||||
|
||||
if(!faction.isPassive()){
|
||||
if (!faction.isPassive()) {
|
||||
IEntitySelector attackEntitySelector = new NPCAttackSelector(this);
|
||||
this.targetTasks.addTask(0, new EntityAIClearTarget(this));
|
||||
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
|
||||
// Jad home page: http://www.kpdus.com/jad.html
|
||||
// Decompiler options: packimports(3) braces deadcode fieldsfirst
|
||||
// Decompiler options: packimports(3) braces deadcode fieldsfirst
|
||||
|
||||
package noppes.npcs.entity;
|
||||
|
||||
@@ -9,36 +9,33 @@ import net.minecraft.world.World;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNpcCrystal extends EntityNPCInterface
|
||||
{
|
||||
public EntityNpcCrystal(World world)
|
||||
{
|
||||
public class EntityNpcCrystal extends EntityNPCInterface {
|
||||
public EntityNpcCrystal(World world) {
|
||||
super(world);
|
||||
scaleX = 0.7f;
|
||||
scaleY = 0.7f;
|
||||
scaleZ = 0.7f;
|
||||
display.texture = "customnpcs:textures/entity/crystal/EnderCrystal.png";
|
||||
scaleX = 0.7f;
|
||||
scaleY = 0.7f;
|
||||
scaleZ = 0.7f;
|
||||
display.texture = "customnpcs:textures/entity/crystal/EnderCrystal.png";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityNpcCrystal.class);
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityNpcCrystal.class);
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,98 +5,98 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
|
||||
public class EntityNpcDragon extends EntityNPCInterface{
|
||||
public EntityNpcDragon(World world)
|
||||
{
|
||||
public class EntityNpcDragon extends EntityNPCInterface {
|
||||
public EntityNpcDragon(World world) {
|
||||
super(world);
|
||||
field_40162_d = new double[64][3];
|
||||
field_40164_e = -1;
|
||||
field_40173_aw = 0.0F;
|
||||
field_40172_ax = 0.0F;
|
||||
field_40178_aA = 0;
|
||||
scaleX = 0.4f;
|
||||
scaleY = 0.4f;
|
||||
scaleZ = 0.4f;
|
||||
display.texture = "customnpcs:textures/entity/dragon/BlackDragon.png";
|
||||
scaleX = 0.4f;
|
||||
scaleY = 0.4f;
|
||||
scaleZ = 0.4f;
|
||||
display.texture = "customnpcs:textures/entity/dragon/BlackDragon.png";
|
||||
|
||||
width = 1.8f;
|
||||
height = 1.4f;
|
||||
}
|
||||
|
||||
width = 1.8f;
|
||||
height = 1.4f;
|
||||
}
|
||||
public double field_40162_d[][];
|
||||
public int field_40164_e;
|
||||
public float field_40173_aw;
|
||||
public float field_40172_ax;
|
||||
public int field_40178_aA;
|
||||
|
||||
|
||||
public boolean isFlying = false;
|
||||
|
||||
|
||||
@Override
|
||||
public double getMountedYOffset(){
|
||||
return 1.1;
|
||||
public double getMountedYOffset() {
|
||||
return 1.1;
|
||||
}
|
||||
|
||||
public double[] func_40160_a(int i, float f)
|
||||
{
|
||||
public double[] func_40160_a(int i, float f) {
|
||||
f = 1.0F - f;
|
||||
int j = field_40164_e - i * 1 & 0x3f;
|
||||
int k = field_40164_e - i * 1 - 1 & 0x3f;
|
||||
double ad[] = new double[3];
|
||||
double d = field_40162_d[j][0];
|
||||
double d1;
|
||||
for(d1 = field_40162_d[k][0] - d; d1 < -180D; d1 += 360D) { }
|
||||
for(; d1 >= 180D; d1 -= 360D) { }
|
||||
ad[0] = d + d1 * (double)f;
|
||||
for (d1 = field_40162_d[k][0] - d; d1 < -180D; d1 += 360D) {
|
||||
}
|
||||
for (; d1 >= 180D; d1 -= 360D) {
|
||||
}
|
||||
ad[0] = d + d1 * (double) f;
|
||||
d = field_40162_d[j][1];
|
||||
d1 = field_40162_d[k][1] - d;
|
||||
ad[1] = d + d1 * (double)f;
|
||||
ad[2] = field_40162_d[j][2] + (field_40162_d[k][2] - field_40162_d[j][2]) * (double)f;
|
||||
ad[1] = d + d1 * (double) f;
|
||||
ad[2] = field_40162_d[j][2] + (field_40162_d[k][2] - field_40162_d[j][2]) * (double) f;
|
||||
return ad;
|
||||
}
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityNpcDragon.class);
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityNpcDragon.class);
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
private boolean exploded = false;
|
||||
|
||||
@Override
|
||||
public void onLivingUpdate()
|
||||
{
|
||||
public void onLivingUpdate() {
|
||||
field_40173_aw = field_40172_ax;
|
||||
if(worldObj.isRemote && getHealth() <= 0)
|
||||
{
|
||||
if(!exploded){
|
||||
exploded = true;
|
||||
float f = (rand.nextFloat() - 0.5F) * 8F;
|
||||
float f2 = (rand.nextFloat() - 0.5F) * 4F;
|
||||
float f4 = (rand.nextFloat() - 0.5F) * 8F;
|
||||
worldObj.spawnParticle("largeexplode", posX + (double)f, posY + 2D + (double)f2, posZ + (double)f4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
else{
|
||||
exploded = false;
|
||||
//func_41011_ay();
|
||||
float f1 = 0.2F / (MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ) * 10F + 1.0F);
|
||||
f1 = 0.045f;
|
||||
f1 *= (float)Math.pow(2D, motionY);
|
||||
field_40172_ax += f1 * 0.5F;
|
||||
if (worldObj.isRemote && getHealth() <= 0) {
|
||||
if (!exploded) {
|
||||
exploded = true;
|
||||
float f = (rand.nextFloat() - 0.5F) * 8F;
|
||||
float f2 = (rand.nextFloat() - 0.5F) * 4F;
|
||||
float f4 = (rand.nextFloat() - 0.5F) * 8F;
|
||||
worldObj.spawnParticle("largeexplode", posX + (double) f, posY + 2D + (double) f2, posZ + (double) f4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
} else {
|
||||
exploded = false;
|
||||
//func_41011_ay();
|
||||
float f1 = 0.2F / (MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ) * 10F + 1.0F);
|
||||
f1 = 0.045f;
|
||||
f1 *= (float) Math.pow(2D, motionY);
|
||||
field_40172_ax += f1 * 0.5F;
|
||||
}
|
||||
super.onLivingUpdate();
|
||||
}
|
||||
|
||||
// public float ticks = 0.0f;
|
||||
// public float ticks = 0.0f;
|
||||
// public void updateRiderPosition()
|
||||
// {
|
||||
// if (riddenByEntity == null)
|
||||
@@ -105,7 +105,7 @@ public class EntityNpcDragon extends EntityNPCInterface{
|
||||
// return;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// {
|
||||
// float f6 = field_40173_aw + (field_40172_ax - field_40173_aw) * ticks;
|
||||
// float f7 = (float)(Math.sin(f6 * 3.141593F * 2.0F - 1.0F) + 1.0D);
|
||||
// riddenByEntity.setPosition(posX , posY + getMountedYOffset() + riddenByEntity.getYOffset() - f7 / 12, posZ);
|
||||
@@ -113,9 +113,9 @@ public class EntityNpcDragon extends EntityNPCInterface{
|
||||
// }
|
||||
// }
|
||||
@Override
|
||||
public void updateHitbox() {
|
||||
width = 1.8f;
|
||||
height = 1.4f;
|
||||
}
|
||||
public void updateHitbox() {
|
||||
width = 1.8f;
|
||||
height = 1.4f;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,37 +5,34 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
|
||||
public class EntityNpcPony extends EntityNPCInterface
|
||||
{
|
||||
public class EntityNpcPony extends EntityNPCInterface {
|
||||
public boolean isPegasus = false;
|
||||
public boolean isUnicorn = false;
|
||||
public boolean isFlying = false;
|
||||
|
||||
|
||||
public ResourceLocation checked = null;
|
||||
|
||||
public EntityNpcPony(World world)
|
||||
{
|
||||
|
||||
public EntityNpcPony(World world) {
|
||||
super(world);
|
||||
display.texture = "customnpcs:textures/entity/ponies/MineLP Derpy Hooves.png";
|
||||
}
|
||||
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityNpcPony.class);
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityNpcPony.class);
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,40 +4,39 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
|
||||
public class EntityNpcSlime extends EntityNPCInterface{
|
||||
public EntityNpcSlime(World world)
|
||||
{
|
||||
public class EntityNpcSlime extends EntityNPCInterface {
|
||||
public EntityNpcSlime(World world) {
|
||||
super(world);
|
||||
scaleX = 2f;
|
||||
scaleY = 2f;
|
||||
scaleZ = 2f;
|
||||
display.texture = "customnpcs:textures/entity/slime/Slime.png";
|
||||
width = 0.8f;
|
||||
height = 0.8f;
|
||||
}
|
||||
@Override
|
||||
public void updateHitbox() {
|
||||
width = 0.8f;
|
||||
height = 0.8f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
scaleX = 2f;
|
||||
scaleY = 2f;
|
||||
scaleZ = 2f;
|
||||
display.texture = "customnpcs:textures/entity/slime/Slime.png";
|
||||
width = 0.8f;
|
||||
height = 0.8f;
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityNpcSlime.class);
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
@Override
|
||||
public void updateHitbox() {
|
||||
width = 0.8f;
|
||||
height = 0.8f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityNpcSlime.class);
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -23,8 +23,8 @@ public class DataSkinOverlays implements IOverlayHandler {
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbtTagCompound) {
|
||||
HashMap<Integer,ISkinOverlay> skinOverlays = new HashMap<>();
|
||||
NBTTagList skinOverlayList = nbtTagCompound.getTagList("SkinOverlayData",10);
|
||||
HashMap<Integer, ISkinOverlay> skinOverlays = new HashMap<>();
|
||||
NBTTagList skinOverlayList = nbtTagCompound.getTagList("SkinOverlayData", 10);
|
||||
for (int i = 0; i < skinOverlayList.tagCount(); i++) {
|
||||
int tagID = skinOverlayList.getCompoundTagAt(i).getInteger("SkinOverlayID");
|
||||
SkinOverlay skinOverlay = (SkinOverlay) SkinOverlay.overlayFromNBT(skinOverlayList.getCompoundTagAt(i));
|
||||
@@ -38,14 +38,14 @@ public class DataSkinOverlays implements IOverlayHandler {
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
NBTTagList overlayList = new NBTTagList();
|
||||
if (!this.overlayList.isEmpty()) {
|
||||
for (Map.Entry<Integer,ISkinOverlay> overlayData : this.overlayList.entrySet()) {
|
||||
for (Map.Entry<Integer, ISkinOverlay> overlayData : this.overlayList.entrySet()) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setInteger("SkinOverlayID", overlayData.getKey());
|
||||
compound = ((SkinOverlay) overlayData.getValue()).writeToNBT(compound);
|
||||
overlayList.appendTag(compound);
|
||||
}
|
||||
}
|
||||
nbttagcompound.setTag("SkinOverlayData",overlayList);
|
||||
nbttagcompound.setTag("SkinOverlayData", overlayList);
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,9 @@ public class DataSkinOverlays implements IOverlayHandler {
|
||||
return removed;
|
||||
}
|
||||
|
||||
public int size() { return this.overlayList.size(); }
|
||||
public int size() {
|
||||
return this.overlayList.size();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.overlayList.clear();
|
||||
|
||||
@@ -31,7 +31,7 @@ public class DataTimers implements ITimers {
|
||||
}
|
||||
|
||||
public void start(int id, int ticks, boolean repeat) {
|
||||
if(this.timers.containsKey(id)) {
|
||||
if (this.timers.containsKey(id)) {
|
||||
throw new CustomNPCsException("There is already a timer with id: " + id);
|
||||
} else {
|
||||
this.timers.put(id, new DataTimers.Timer(id, ticks, repeat));
|
||||
@@ -56,46 +56,46 @@ public class DataTimers implements ITimers {
|
||||
timer.ticks = 0;
|
||||
}
|
||||
|
||||
public int ticks(int id){
|
||||
public int ticks(int id) {
|
||||
this.timerException(id);
|
||||
return this.timers.get(id).ticks;
|
||||
}
|
||||
|
||||
public void setTicks(int id, int ticks){
|
||||
public void setTicks(int id, int ticks) {
|
||||
this.timerException(id);
|
||||
|
||||
DataTimers.Timer timer = this.timers.get(id);
|
||||
if(ticks < 0)
|
||||
if (ticks < 0)
|
||||
ticks = 0;
|
||||
if(ticks > timer.timerTicks)
|
||||
if (ticks > timer.timerTicks)
|
||||
ticks = timer.timerTicks;
|
||||
|
||||
timer.ticks = ticks;
|
||||
}
|
||||
|
||||
public int maxTicks(int id){
|
||||
public int maxTicks(int id) {
|
||||
this.timerException(id);
|
||||
return this.timers.get(id).timerTicks;
|
||||
}
|
||||
|
||||
public void setMaxTicks(int id, int maxTicks){
|
||||
public void setMaxTicks(int id, int maxTicks) {
|
||||
this.timerException(id);
|
||||
|
||||
DataTimers.Timer timer = this.timers.get(id);
|
||||
if(maxTicks < 0)
|
||||
if (maxTicks < 0)
|
||||
maxTicks = 0;
|
||||
if(timer.ticks > maxTicks)
|
||||
if (timer.ticks > maxTicks)
|
||||
timer.ticks = maxTicks;
|
||||
|
||||
timer.timerTicks = maxTicks;
|
||||
}
|
||||
|
||||
public boolean repeats(int id){
|
||||
public boolean repeats(int id) {
|
||||
this.timerException(id);
|
||||
return this.timers.get(id).repeat;
|
||||
}
|
||||
|
||||
public void setRepeats(int id, boolean repeat){
|
||||
public void setRepeats(int id, boolean repeat) {
|
||||
this.timerException(id);
|
||||
this.timers.get(id).repeat = repeat;
|
||||
}
|
||||
@@ -104,8 +104,8 @@ public class DataTimers implements ITimers {
|
||||
NBTTagList list = new NBTTagList();
|
||||
Iterator var3 = this.timers.values().iterator();
|
||||
|
||||
while(var3.hasNext()) {
|
||||
DataTimers.Timer timer = (DataTimers.Timer)var3.next();
|
||||
while (var3.hasNext()) {
|
||||
DataTimers.Timer timer = (DataTimers.Timer) var3.next();
|
||||
NBTTagCompound c = new NBTTagCompound();
|
||||
c.setInteger("ID", timer.id);
|
||||
c.setInteger("TimerTicks", timer.timerTicks);
|
||||
@@ -127,7 +127,7 @@ public class DataTimers implements ITimers {
|
||||
HashMap<Integer, DataTimers.Timer> timers = new HashMap<>();
|
||||
NBTTagList list = compound.getTagList("NpcsTimers", 10);
|
||||
|
||||
if(list != null) {
|
||||
if (list != null) {
|
||||
for (int i = 0; i < list.tagCount(); ++i) {
|
||||
NBTTagCompound c = list.getCompoundTagAt(i);
|
||||
DataTimers.Timer t = new DataTimers.Timer(c.getInteger("ID"), c.getInteger("TimerTicks"), c.getBoolean("Repeat"));
|
||||
@@ -152,7 +152,9 @@ public class DataTimers implements ITimers {
|
||||
this.timers = new HashMap<>();
|
||||
}
|
||||
|
||||
public int size() { return this.timers.size(); }
|
||||
public int size() {
|
||||
return this.timers.size();
|
||||
}
|
||||
|
||||
class Timer {
|
||||
public int id;
|
||||
@@ -168,8 +170,8 @@ public class DataTimers implements ITimers {
|
||||
}
|
||||
|
||||
public void update() {
|
||||
if(this.ticks-- <= 0) {
|
||||
if(this.repeat) {
|
||||
if (this.ticks-- <= 0) {
|
||||
if (this.repeat) {
|
||||
this.ticks = this.timerTicks;
|
||||
} else {
|
||||
DataTimers.this.stop(this.id);
|
||||
@@ -177,13 +179,11 @@ public class DataTimers implements ITimers {
|
||||
|
||||
Object ob = DataTimers.this.parent;
|
||||
if (ob instanceof EntityNPCInterface) {
|
||||
EventHooks.onNPCTimer((EntityNPCInterface)ob, this.id);
|
||||
}
|
||||
else if(ob instanceof PlayerData) {
|
||||
EventHooks.onPlayerTimer((PlayerData)ob, this.id);
|
||||
}
|
||||
else if(ob instanceof TileScripted) {
|
||||
EventHooks.onScriptBlockTimer((TileScripted)ob, this.id);
|
||||
EventHooks.onNPCTimer((EntityNPCInterface) ob, this.id);
|
||||
} else if (ob instanceof PlayerData) {
|
||||
EventHooks.onPlayerTimer((PlayerData) ob, this.id);
|
||||
} else if (ob instanceof TileScripted) {
|
||||
EventHooks.onScriptBlockTimer((TileScripted) ob, this.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,40 +6,40 @@ import net.minecraft.world.World;
|
||||
import noppes.npcs.compat.PixelmonHelper;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class ModelData extends ModelDataShared{
|
||||
|
||||
public EntityLivingBase getEntity(EntityNPCInterface npc){
|
||||
if(entityClass == null)
|
||||
return null;
|
||||
if(entity == null){
|
||||
try {
|
||||
entity = entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {npc.worldObj});
|
||||
public class ModelData extends ModelDataShared {
|
||||
|
||||
entity.readEntityFromNBT(extra);
|
||||
|
||||
if(entity instanceof EntityLiving){
|
||||
EntityLiving living = (EntityLiving)entity;
|
||||
living.setCurrentItemOrArmor(0, npc.getHeldItem() != null?npc.getHeldItem():npc.getOffHand());
|
||||
living.setCurrentItemOrArmor(1, npc.inventory.armorItemInSlot(3));
|
||||
living.setCurrentItemOrArmor(2, npc.inventory.armorItemInSlot(2));
|
||||
living.setCurrentItemOrArmor(3, npc.inventory.armorItemInSlot(1));
|
||||
living.setCurrentItemOrArmor(4, npc.inventory.armorItemInSlot(0));
|
||||
}
|
||||
if(PixelmonHelper.isPixelmon(entity) && npc.worldObj.isRemote){
|
||||
if(extra.hasKey("Name"))
|
||||
PixelmonHelper.setName(entity, extra.getString("Name"));
|
||||
else
|
||||
PixelmonHelper.setName(entity, "Abra");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
public ModelData copy(){
|
||||
ModelData data = new ModelData();
|
||||
data.readFromNBT(this.writeToNBT());
|
||||
return data;
|
||||
}
|
||||
public EntityLivingBase getEntity(EntityNPCInterface npc) {
|
||||
if (entityClass == null)
|
||||
return null;
|
||||
if (entity == null) {
|
||||
try {
|
||||
entity = entityClass.getConstructor(new Class[]{World.class}).newInstance(new Object[]{npc.worldObj});
|
||||
|
||||
entity.readEntityFromNBT(extra);
|
||||
|
||||
if (entity instanceof EntityLiving) {
|
||||
EntityLiving living = (EntityLiving) entity;
|
||||
living.setCurrentItemOrArmor(0, npc.getHeldItem() != null ? npc.getHeldItem() : npc.getOffHand());
|
||||
living.setCurrentItemOrArmor(1, npc.inventory.armorItemInSlot(3));
|
||||
living.setCurrentItemOrArmor(2, npc.inventory.armorItemInSlot(2));
|
||||
living.setCurrentItemOrArmor(3, npc.inventory.armorItemInSlot(1));
|
||||
living.setCurrentItemOrArmor(4, npc.inventory.armorItemInSlot(0));
|
||||
}
|
||||
if (PixelmonHelper.isPixelmon(entity) && npc.worldObj.isRemote) {
|
||||
if (extra.hasKey("Name"))
|
||||
PixelmonHelper.setName(entity, extra.getString("Name"));
|
||||
else
|
||||
PixelmonHelper.setName(entity, "Abra");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
public ModelData copy() {
|
||||
ModelData data = new ModelData();
|
||||
data.readFromNBT(this.writeToNBT());
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -13,403 +13,404 @@ import java.util.HashMap;
|
||||
|
||||
|
||||
public class ModelDataShared implements IModelData {
|
||||
public ModelScale modelScale = new ModelScale();
|
||||
public ModelScale modelScale = new ModelScale();
|
||||
|
||||
public boolean enableRotation = false;
|
||||
public ModelRotate rotation = new ModelRotate();
|
||||
public boolean enableRotation = false;
|
||||
public ModelRotate rotation = new ModelRotate();
|
||||
|
||||
public ModelPartData legParts = new ModelPartData();
|
||||
|
||||
public Class<? extends EntityLivingBase> entityClass;
|
||||
public EntityLivingBase entity;
|
||||
|
||||
public NBTTagCompound extra = new NBTTagCompound();
|
||||
|
||||
private HashMap<String,ModelPartData> parts = new HashMap<String,ModelPartData>();
|
||||
public byte breasts = 0;
|
||||
public ModelPartData legParts = new ModelPartData();
|
||||
|
||||
public byte headwear = 2;
|
||||
public byte bodywear = 0;
|
||||
// Hide Arm/Legwear [0: None, 1: Both, 2: Right, 3: Left],
|
||||
public byte armwear = 0;
|
||||
public byte legwear = 0;
|
||||
public Class<? extends EntityLivingBase> entityClass;
|
||||
public EntityLivingBase entity;
|
||||
|
||||
// Solid or normal arm/legwear [0: None, 1: Both, 2: Right, 3: Left]
|
||||
public byte solidArmwear = 0;
|
||||
public byte solidLegwear = 0;
|
||||
public NBTTagCompound extra = new NBTTagCompound();
|
||||
|
||||
// Hide Body Parts [0: None, 1: Both, 2: Right, 3: Left],
|
||||
public byte hideHead = 0;
|
||||
public byte hideBody = 0;
|
||||
public byte hideArms = 0;
|
||||
public byte hideLegs = 0;
|
||||
private HashMap<String, ModelPartData> parts = new HashMap<String, ModelPartData>();
|
||||
public byte breasts = 0;
|
||||
|
||||
public NBTTagCompound writeToNBT(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
public byte headwear = 2;
|
||||
public byte bodywear = 0;
|
||||
// Hide Arm/Legwear [0: None, 1: Both, 2: Right, 3: Left],
|
||||
public byte armwear = 0;
|
||||
public byte legwear = 0;
|
||||
|
||||
if(entityClass != null)
|
||||
compound.setString("EntityClass", entityClass.getCanonicalName());
|
||||
// Solid or normal arm/legwear [0: None, 1: Both, 2: Right, 3: Left]
|
||||
public byte solidArmwear = 0;
|
||||
public byte solidLegwear = 0;
|
||||
|
||||
compound = this.modelScale.writeToNBT(compound);
|
||||
// Hide Body Parts [0: None, 1: Both, 2: Right, 3: Left],
|
||||
public byte hideHead = 0;
|
||||
public byte hideBody = 0;
|
||||
public byte hideArms = 0;
|
||||
public byte hideLegs = 0;
|
||||
|
||||
compound.setTag("LegParts", legParts.writeToNBT());
|
||||
public NBTTagCompound writeToNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
compound.setByte("Headwear", headwear);
|
||||
compound.setByte("Bodywear", bodywear);
|
||||
compound.setByte("Armwear", armwear);
|
||||
compound.setByte("Legwear", legwear);
|
||||
if (entityClass != null)
|
||||
compound.setString("EntityClass", entityClass.getCanonicalName());
|
||||
|
||||
compound.setByte("SolidArmwear", solidArmwear);
|
||||
compound.setByte("SolidLegwear", solidLegwear);
|
||||
compound = this.modelScale.writeToNBT(compound);
|
||||
|
||||
compound.setByte("hideHead", hideHead);
|
||||
compound.setByte("hideBody", hideBody);
|
||||
compound.setByte("hideArms", hideArms);
|
||||
compound.setByte("hideLegs", hideLegs);
|
||||
compound.setTag("LegParts", legParts.writeToNBT());
|
||||
|
||||
compound.setBoolean("EnableRotation", enableRotation);
|
||||
if(enableRotation)
|
||||
compound.setTag("ModelRotation", rotation.writeToNBT());
|
||||
compound.setByte("Headwear", headwear);
|
||||
compound.setByte("Bodywear", bodywear);
|
||||
compound.setByte("Armwear", armwear);
|
||||
compound.setByte("Legwear", legwear);
|
||||
|
||||
compound.setByte("Breasts", breasts);
|
||||
compound.setTag("ExtraData", extra);
|
||||
compound.setByte("SolidArmwear", solidArmwear);
|
||||
compound.setByte("SolidLegwear", solidLegwear);
|
||||
|
||||
NBTTagList list = new NBTTagList();
|
||||
for(String name : parts.keySet()){
|
||||
NBTTagCompound item = parts.get(name).writeToNBT();
|
||||
item.setString("PartName", name);
|
||||
list.appendTag(item);
|
||||
}
|
||||
compound.setTag("Parts", list);
|
||||
|
||||
return compound;
|
||||
}
|
||||
compound.setByte("hideHead", hideHead);
|
||||
compound.setByte("hideBody", hideBody);
|
||||
compound.setByte("hideArms", hideArms);
|
||||
compound.setByte("hideLegs", hideLegs);
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
setEntity(compound.getString("EntityClass"));
|
||||
compound.setBoolean("EnableRotation", enableRotation);
|
||||
if (enableRotation)
|
||||
compound.setTag("ModelRotation", rotation.writeToNBT());
|
||||
|
||||
this.modelScale.readFromNBT(compound);
|
||||
compound.setByte("Breasts", breasts);
|
||||
compound.setTag("ExtraData", extra);
|
||||
|
||||
legParts.readFromNBT(compound.getCompoundTag("LegParts"));
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (String name : parts.keySet()) {
|
||||
NBTTagCompound item = parts.get(name).writeToNBT();
|
||||
item.setString("PartName", name);
|
||||
list.appendTag(item);
|
||||
}
|
||||
compound.setTag("Parts", list);
|
||||
|
||||
headwear = compound.getByte("Headwear");
|
||||
bodywear = compound.getByte("Bodywear");
|
||||
armwear = compound.getByte("Armwear");
|
||||
legwear = compound.getByte("Legwear");
|
||||
return compound;
|
||||
}
|
||||
|
||||
solidArmwear = compound.getByte("SolidArmwear");
|
||||
solidLegwear = compound.getByte("SolidLegwear");
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
setEntity(compound.getString("EntityClass"));
|
||||
|
||||
hideHead = compound.getByte("hideHead");
|
||||
hideBody = compound.getByte("hideBody");
|
||||
hideArms = compound.getByte("hideArms");
|
||||
hideLegs = compound.getByte("hideLegs");
|
||||
this.modelScale.readFromNBT(compound);
|
||||
|
||||
enableRotation = compound.getBoolean("EnableRotation");
|
||||
if(enableRotation)
|
||||
rotation.readFromNBT(compound.getCompoundTag("ModelRotation"));
|
||||
legParts.readFromNBT(compound.getCompoundTag("LegParts"));
|
||||
|
||||
breasts = compound.getByte("Breasts");
|
||||
extra = compound.getCompoundTag("ExtraData");
|
||||
headwear = compound.getByte("Headwear");
|
||||
bodywear = compound.getByte("Bodywear");
|
||||
armwear = compound.getByte("Armwear");
|
||||
legwear = compound.getByte("Legwear");
|
||||
|
||||
HashMap<String,ModelPartData> parts = new HashMap<String,ModelPartData>();
|
||||
NBTTagList list = compound.getTagList("Parts", 10);
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound item = list.getCompoundTagAt(i);
|
||||
ModelPartData part = new ModelPartData();
|
||||
part.readFromNBT(item);
|
||||
parts.put(item.getString("PartName"), part);
|
||||
}
|
||||
this.parts = parts;
|
||||
|
||||
}
|
||||
|
||||
public void setEntityClass(Class<? extends EntityLivingBase> entityClass){
|
||||
this.entityClass = entityClass;
|
||||
entity = null;
|
||||
extra = new NBTTagCompound();
|
||||
if(entityClass == EntityHorse.class)
|
||||
extra.setInteger("Type", -1);
|
||||
}
|
||||
|
||||
public Class<? extends EntityLivingBase> getEntityClass(){
|
||||
return entityClass;
|
||||
}
|
||||
solidArmwear = compound.getByte("SolidArmwear");
|
||||
solidLegwear = compound.getByte("SolidLegwear");
|
||||
|
||||
public float offsetY() {
|
||||
if(entity == null)
|
||||
return -getBodyY();
|
||||
return entity.height - 1.8f;
|
||||
}
|
||||
hideHead = compound.getByte("hideHead");
|
||||
hideBody = compound.getByte("hideBody");
|
||||
hideArms = compound.getByte("hideArms");
|
||||
hideLegs = compound.getByte("hideLegs");
|
||||
|
||||
public void clearEntity() {
|
||||
entity = null;
|
||||
}
|
||||
|
||||
|
||||
public ModelPartData getPartData(String type){
|
||||
return parts.get(type);
|
||||
}
|
||||
enableRotation = compound.getBoolean("EnableRotation");
|
||||
if (enableRotation)
|
||||
rotation.readFromNBT(compound.getCompoundTag("ModelRotation"));
|
||||
|
||||
public void removePart(String type) {
|
||||
parts.remove(type);
|
||||
}
|
||||
breasts = compound.getByte("Breasts");
|
||||
extra = compound.getCompoundTag("ExtraData");
|
||||
|
||||
public ModelPartData getOrCreatePart(String type) {
|
||||
ModelPartData part = parts.get(type);
|
||||
if(part == null)
|
||||
parts.put(type, part = new ModelPartData());
|
||||
return part;
|
||||
}
|
||||
|
||||
public float getBodyY(){
|
||||
if(legParts.type == 3)
|
||||
return (0.9f - modelScale.body.scaleY) * 0.75f + getLegsY();
|
||||
if(legParts.type == 3)
|
||||
return (0.5f - modelScale.body.scaleY) * 0.75f + getLegsY();
|
||||
return (1 - modelScale.body.scaleY) * 0.75f + getLegsY();
|
||||
}
|
||||
HashMap<String, ModelPartData> parts = new HashMap<String, ModelPartData>();
|
||||
NBTTagList list = compound.getTagList("Parts", 10);
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound item = list.getCompoundTagAt(i);
|
||||
ModelPartData part = new ModelPartData();
|
||||
part.readFromNBT(item);
|
||||
parts.put(item.getString("PartName"), part);
|
||||
}
|
||||
this.parts = parts;
|
||||
|
||||
public float getLegsY() {
|
||||
if(legParts.type == 3)
|
||||
return (0.87f - modelScale.legs.scaleY);
|
||||
return (1 - modelScale.legs.scaleY) * 0.75f;
|
||||
}
|
||||
}
|
||||
|
||||
//0 - hidden, 1 - 2d, 2 - 3d
|
||||
public void headWear(byte config) {
|
||||
headwear = ValueUtil.clamp(config, (byte)0, (byte)2);
|
||||
}
|
||||
public void setEntityClass(Class<? extends EntityLivingBase> entityClass) {
|
||||
this.entityClass = entityClass;
|
||||
entity = null;
|
||||
extra = new NBTTagCompound();
|
||||
if (entityClass == EntityHorse.class)
|
||||
extra.setInteger("Type", -1);
|
||||
}
|
||||
|
||||
public byte headWear() {
|
||||
return this.headwear;
|
||||
}
|
||||
public Class<? extends EntityLivingBase> getEntityClass() {
|
||||
return entityClass;
|
||||
}
|
||||
|
||||
//0 - hidden, 1 - 2d, 2 - 3d
|
||||
public void bodyWear(byte config) {
|
||||
bodywear = ValueUtil.clamp(config, (byte)0, (byte)2);
|
||||
}
|
||||
public float offsetY() {
|
||||
if (entity == null)
|
||||
return -getBodyY();
|
||||
return entity.height - 1.8f;
|
||||
}
|
||||
|
||||
public byte bodyWear() {
|
||||
return this.bodywear;
|
||||
}
|
||||
public void clearEntity() {
|
||||
entity = null;
|
||||
}
|
||||
|
||||
//0 - hidden, 1 - 2d, 2 - 3d
|
||||
public void rightArmWear(byte config) {
|
||||
config = ValueUtil.clamp(config, (byte)0, (byte)2);
|
||||
|
||||
// Hide Arm/Legwear [0: None, 1: Both, 2: Right, 3: Left],
|
||||
if (config == 1 || config == 2) {
|
||||
if (armwear == 0)
|
||||
armwear = 2;
|
||||
else if (armwear == 3)
|
||||
armwear = 1;
|
||||
} else {
|
||||
if (armwear == 1)
|
||||
armwear = 3;
|
||||
else if (armwear == 2)
|
||||
armwear = 0;
|
||||
}
|
||||
public ModelPartData getPartData(String type) {
|
||||
return parts.get(type);
|
||||
}
|
||||
|
||||
// Solid or normal arm/legwear [0: None, 1: Both, 2: Right, 3: Left]
|
||||
if (config == 1) {
|
||||
solidArmwear = 0;
|
||||
} else if (config == 2) {
|
||||
if (solidArmwear == 0) {
|
||||
solidArmwear = 2;
|
||||
} else if (solidArmwear == 3) {
|
||||
solidArmwear = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void removePart(String type) {
|
||||
parts.remove(type);
|
||||
}
|
||||
|
||||
public byte rightArmWear() {
|
||||
if (armwear == 0 || armwear == 3) {
|
||||
return 0;
|
||||
} else if (solidArmwear == 1 || solidArmwear == 2) {
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
public ModelPartData getOrCreatePart(String type) {
|
||||
ModelPartData part = parts.get(type);
|
||||
if (part == null)
|
||||
parts.put(type, part = new ModelPartData());
|
||||
return part;
|
||||
}
|
||||
|
||||
//0 - hidden, 1 - 2d, 2 - 3d
|
||||
public void leftArmWear(byte config) {
|
||||
config = ValueUtil.clamp(config, (byte)0, (byte)2);
|
||||
public float getBodyY() {
|
||||
if (legParts.type == 3)
|
||||
return (0.9f - modelScale.body.scaleY) * 0.75f + getLegsY();
|
||||
if (legParts.type == 3)
|
||||
return (0.5f - modelScale.body.scaleY) * 0.75f + getLegsY();
|
||||
return (1 - modelScale.body.scaleY) * 0.75f + getLegsY();
|
||||
}
|
||||
|
||||
// Hide Arm/Legwear [0: None, 1: Both, 2: Right, 3: Left],
|
||||
if (config == 1 || config == 2) {
|
||||
if (armwear == 0)
|
||||
armwear = 3;
|
||||
else if (armwear == 2)
|
||||
armwear = 1;
|
||||
} else {
|
||||
if (armwear == 1)
|
||||
armwear = 2;
|
||||
else if (armwear == 3)
|
||||
armwear = 0;
|
||||
}
|
||||
public float getLegsY() {
|
||||
if (legParts.type == 3)
|
||||
return (0.87f - modelScale.legs.scaleY);
|
||||
return (1 - modelScale.legs.scaleY) * 0.75f;
|
||||
}
|
||||
|
||||
// Solid or normal arm/legwear [0: None, 1: Both, 2: Right, 3: Left]
|
||||
if (config == 1) {
|
||||
solidArmwear = 0;
|
||||
} else if (config == 2) {
|
||||
if (solidArmwear == 0) {
|
||||
solidArmwear = 3;
|
||||
} else if (solidArmwear == 2) {
|
||||
solidArmwear = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//0 - hidden, 1 - 2d, 2 - 3d
|
||||
public void headWear(byte config) {
|
||||
headwear = ValueUtil.clamp(config, (byte) 0, (byte) 2);
|
||||
}
|
||||
|
||||
public byte leftArmWear() {
|
||||
if (armwear == 0 || armwear == 2) {
|
||||
return 0;
|
||||
} else if (solidArmwear == 1 || solidArmwear == 3) {
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
public byte headWear() {
|
||||
return this.headwear;
|
||||
}
|
||||
|
||||
public void rightLegWear(byte config) {
|
||||
config = ValueUtil.clamp(config, (byte)0, (byte)2);
|
||||
//0 - hidden, 1 - 2d, 2 - 3d
|
||||
public void bodyWear(byte config) {
|
||||
bodywear = ValueUtil.clamp(config, (byte) 0, (byte) 2);
|
||||
}
|
||||
|
||||
// Hide Arm/Legwear [0: None, 1: Both, 2: Right, 3: Left],
|
||||
if (config == 1 || config == 2) {
|
||||
if (legwear == 0)
|
||||
legwear = 2;
|
||||
else if (legwear == 3)
|
||||
legwear = 1;
|
||||
} else {
|
||||
if (legwear == 1)
|
||||
legwear = 3;
|
||||
else if (legwear == 2)
|
||||
legwear = 0;
|
||||
}
|
||||
public byte bodyWear() {
|
||||
return this.bodywear;
|
||||
}
|
||||
|
||||
// Solid or normal arm/legwear [0: None, 1: Both, 2: Right, 3: Left]
|
||||
if (config == 1) {
|
||||
solidLegwear = 0;
|
||||
} else if (config == 2) {
|
||||
if (solidLegwear == 0) {
|
||||
solidLegwear = 2;
|
||||
} else if (solidLegwear == 3) {
|
||||
solidLegwear = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//0 - hidden, 1 - 2d, 2 - 3d
|
||||
public void rightArmWear(byte config) {
|
||||
config = ValueUtil.clamp(config, (byte) 0, (byte) 2);
|
||||
|
||||
public byte rightLegWear() {
|
||||
if (legwear == 0 || legwear == 3) {
|
||||
return 0;
|
||||
} else if (solidLegwear == 1 || solidLegwear == 2) {
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
// Hide Arm/Legwear [0: None, 1: Both, 2: Right, 3: Left],
|
||||
if (config == 1 || config == 2) {
|
||||
if (armwear == 0)
|
||||
armwear = 2;
|
||||
else if (armwear == 3)
|
||||
armwear = 1;
|
||||
} else {
|
||||
if (armwear == 1)
|
||||
armwear = 3;
|
||||
else if (armwear == 2)
|
||||
armwear = 0;
|
||||
}
|
||||
|
||||
public void leftLegWear(byte config) {
|
||||
config = ValueUtil.clamp(config, (byte)0, (byte)2);
|
||||
// Solid or normal arm/legwear [0: None, 1: Both, 2: Right, 3: Left]
|
||||
if (config == 1) {
|
||||
solidArmwear = 0;
|
||||
} else if (config == 2) {
|
||||
if (solidArmwear == 0) {
|
||||
solidArmwear = 2;
|
||||
} else if (solidArmwear == 3) {
|
||||
solidArmwear = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hide Arm/Legwear [0: None, 1: Both, 2: Right, 3: Left],
|
||||
if (config == 1 || config == 2) {
|
||||
if (legwear == 0)
|
||||
legwear = 3;
|
||||
else if (legwear == 2)
|
||||
legwear = 1;
|
||||
} else {
|
||||
if (legwear == 1)
|
||||
legwear = 2;
|
||||
else if (legwear == 3)
|
||||
legwear = 0;
|
||||
}
|
||||
public byte rightArmWear() {
|
||||
if (armwear == 0 || armwear == 3) {
|
||||
return 0;
|
||||
} else if (solidArmwear == 1 || solidArmwear == 2) {
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Solid or normal arm/legwear [0: None, 1: Both, 2: Right, 3: Left]
|
||||
if (config == 1) {
|
||||
solidLegwear = 0;
|
||||
} else if (config == 2) {
|
||||
if (solidLegwear == 0) {
|
||||
solidLegwear = 3;
|
||||
} else if (solidLegwear == 2) {
|
||||
solidLegwear = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
//0 - hidden, 1 - 2d, 2 - 3d
|
||||
public void leftArmWear(byte config) {
|
||||
config = ValueUtil.clamp(config, (byte) 0, (byte) 2);
|
||||
|
||||
public byte leftLegWear() {
|
||||
if (legwear == 0 || legwear == 2) {
|
||||
return 0;
|
||||
} else if (solidLegwear == 1 || solidLegwear == 3) {
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
// Hide Arm/Legwear [0: None, 1: Both, 2: Right, 3: Left],
|
||||
if (config == 1 || config == 2) {
|
||||
if (armwear == 0)
|
||||
armwear = 3;
|
||||
else if (armwear == 2)
|
||||
armwear = 1;
|
||||
} else {
|
||||
if (armwear == 1)
|
||||
armwear = 2;
|
||||
else if (armwear == 3)
|
||||
armwear = 0;
|
||||
}
|
||||
|
||||
public void hidePart(int part, byte hide) {
|
||||
part = ValueUtil.clamp(part,0,3);
|
||||
hide = part > 1 ? ValueUtil.clamp(hide,(byte) 0,(byte) 3) : ValueUtil.clamp(hide,(byte) 0,(byte) 1);
|
||||
switch (part) {
|
||||
case 0:
|
||||
this.hideHead = hide;
|
||||
break;
|
||||
case 1:
|
||||
this.hideBody = hide;
|
||||
break;
|
||||
case 2:
|
||||
this.hideArms = hide;
|
||||
break;
|
||||
case 3:
|
||||
this.hideLegs = hide;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Solid or normal arm/legwear [0: None, 1: Both, 2: Right, 3: Left]
|
||||
if (config == 1) {
|
||||
solidArmwear = 0;
|
||||
} else if (config == 2) {
|
||||
if (solidArmwear == 0) {
|
||||
solidArmwear = 3;
|
||||
} else if (solidArmwear == 2) {
|
||||
solidArmwear = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int hidden(int part) {
|
||||
part = ValueUtil.clamp(part,0,3);
|
||||
switch (part) {
|
||||
case 0:
|
||||
return this.hideHead;
|
||||
case 1:
|
||||
return this.hideBody;
|
||||
case 2:
|
||||
return this.hideArms;
|
||||
case 3:
|
||||
return this.hideLegs;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
public byte leftArmWear() {
|
||||
if (armwear == 0 || armwear == 2) {
|
||||
return 0;
|
||||
} else if (solidArmwear == 1 || solidArmwear == 3) {
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
public void enableRotation(boolean enableRotation) {
|
||||
this.enableRotation = enableRotation;
|
||||
}
|
||||
public void rightLegWear(byte config) {
|
||||
config = ValueUtil.clamp(config, (byte) 0, (byte) 2);
|
||||
|
||||
public boolean enableRotation() {
|
||||
return this.enableRotation;
|
||||
}
|
||||
// Hide Arm/Legwear [0: None, 1: Both, 2: Right, 3: Left],
|
||||
if (config == 1 || config == 2) {
|
||||
if (legwear == 0)
|
||||
legwear = 2;
|
||||
else if (legwear == 3)
|
||||
legwear = 1;
|
||||
} else {
|
||||
if (legwear == 1)
|
||||
legwear = 3;
|
||||
else if (legwear == 2)
|
||||
legwear = 0;
|
||||
}
|
||||
|
||||
public IModelRotate getRotation() {
|
||||
return this.rotation;
|
||||
}
|
||||
// Solid or normal arm/legwear [0: None, 1: Both, 2: Right, 3: Left]
|
||||
if (config == 1) {
|
||||
solidLegwear = 0;
|
||||
} else if (config == 2) {
|
||||
if (solidLegwear == 0) {
|
||||
solidLegwear = 2;
|
||||
} else if (solidLegwear == 3) {
|
||||
solidLegwear = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IModelScale getScale() {
|
||||
return this.modelScale;
|
||||
}
|
||||
public byte rightLegWear() {
|
||||
if (legwear == 0 || legwear == 3) {
|
||||
return 0;
|
||||
} else if (solidLegwear == 1 || solidLegwear == 2) {
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
public void setEntity(String string) {
|
||||
entityClass = null;
|
||||
entity = null;
|
||||
try {
|
||||
Class<?> cls = Class.forName(string);
|
||||
if (EntityLivingBase.class.isAssignableFrom(cls))
|
||||
entityClass = cls.asSubclass(EntityLivingBase.class);
|
||||
public void leftLegWear(byte config) {
|
||||
config = ValueUtil.clamp(config, (byte) 0, (byte) 2);
|
||||
|
||||
} catch (ClassNotFoundException ignored) {}
|
||||
}
|
||||
// Hide Arm/Legwear [0: None, 1: Both, 2: Right, 3: Left],
|
||||
if (config == 1 || config == 2) {
|
||||
if (legwear == 0)
|
||||
legwear = 3;
|
||||
else if (legwear == 2)
|
||||
legwear = 1;
|
||||
} else {
|
||||
if (legwear == 1)
|
||||
legwear = 2;
|
||||
else if (legwear == 3)
|
||||
legwear = 0;
|
||||
}
|
||||
|
||||
public String getEntity() {
|
||||
return entityClass == null ? null : entityClass.getName();
|
||||
}
|
||||
// Solid or normal arm/legwear [0: None, 1: Both, 2: Right, 3: Left]
|
||||
if (config == 1) {
|
||||
solidLegwear = 0;
|
||||
} else if (config == 2) {
|
||||
if (solidLegwear == 0) {
|
||||
solidLegwear = 3;
|
||||
} else if (solidLegwear == 2) {
|
||||
solidLegwear = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public byte leftLegWear() {
|
||||
if (legwear == 0 || legwear == 2) {
|
||||
return 0;
|
||||
} else if (solidLegwear == 1 || solidLegwear == 3) {
|
||||
return 2;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
public void hidePart(int part, byte hide) {
|
||||
part = ValueUtil.clamp(part, 0, 3);
|
||||
hide = part > 1 ? ValueUtil.clamp(hide, (byte) 0, (byte) 3) : ValueUtil.clamp(hide, (byte) 0, (byte) 1);
|
||||
switch (part) {
|
||||
case 0:
|
||||
this.hideHead = hide;
|
||||
break;
|
||||
case 1:
|
||||
this.hideBody = hide;
|
||||
break;
|
||||
case 2:
|
||||
this.hideArms = hide;
|
||||
break;
|
||||
case 3:
|
||||
this.hideLegs = hide;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public int hidden(int part) {
|
||||
part = ValueUtil.clamp(part, 0, 3);
|
||||
switch (part) {
|
||||
case 0:
|
||||
return this.hideHead;
|
||||
case 1:
|
||||
return this.hideBody;
|
||||
case 2:
|
||||
return this.hideArms;
|
||||
case 3:
|
||||
return this.hideLegs;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void enableRotation(boolean enableRotation) {
|
||||
this.enableRotation = enableRotation;
|
||||
}
|
||||
|
||||
public boolean enableRotation() {
|
||||
return this.enableRotation;
|
||||
}
|
||||
|
||||
public IModelRotate getRotation() {
|
||||
return this.rotation;
|
||||
}
|
||||
|
||||
public IModelScale getScale() {
|
||||
return this.modelScale;
|
||||
}
|
||||
|
||||
public void setEntity(String string) {
|
||||
entityClass = null;
|
||||
entity = null;
|
||||
try {
|
||||
Class<?> cls = Class.forName(string);
|
||||
if (EntityLivingBase.class.isAssignableFrom(cls))
|
||||
entityClass = cls.asSubclass(EntityLivingBase.class);
|
||||
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
public String getEntity() {
|
||||
return entityClass == null ? null : entityClass.getName();
|
||||
}
|
||||
}
|
||||
@@ -4,76 +4,75 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class ModelPartData {
|
||||
public int color = 0xFFFFFF;
|
||||
public String texture;
|
||||
public byte type = 0;
|
||||
public int color = 0xFFFFFF;
|
||||
public String texture;
|
||||
public byte type = 0;
|
||||
public byte pattern = 0;
|
||||
public boolean playerTexture;
|
||||
public boolean playerTexture;
|
||||
|
||||
private ResourceLocation location;
|
||||
private ResourceLocation location;
|
||||
|
||||
public ModelPartData(){
|
||||
playerTexture = true;
|
||||
}
|
||||
public ModelPartData() {
|
||||
playerTexture = true;
|
||||
}
|
||||
|
||||
public ModelPartData(String texture) {
|
||||
this.texture = texture;
|
||||
playerTexture = false;
|
||||
}
|
||||
public ModelPartData(String texture) {
|
||||
this.texture = texture;
|
||||
playerTexture = false;
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToNBT(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setByte("Type", type);
|
||||
compound.setInteger("Color", color);
|
||||
public NBTTagCompound writeToNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setByte("Type", type);
|
||||
compound.setInteger("Color", color);
|
||||
compound.setByte("Pattern", pattern);
|
||||
if(texture != null && !texture.isEmpty()) {
|
||||
compound.setString("Texture", texture);
|
||||
}
|
||||
compound.setBoolean("PlayerTexture", playerTexture);
|
||||
return compound;
|
||||
}
|
||||
if (texture != null && !texture.isEmpty()) {
|
||||
compound.setString("Texture", texture);
|
||||
}
|
||||
compound.setBoolean("PlayerTexture", playerTexture);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
type = compound.getByte("Type");
|
||||
color = compound.getInteger("Color");
|
||||
texture = compound.getString("Texture");
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
type = compound.getByte("Type");
|
||||
color = compound.getInteger("Color");
|
||||
texture = compound.getString("Texture");
|
||||
pattern = compound.getByte("Pattern");
|
||||
playerTexture = compound.getBoolean("PlayerTexture");
|
||||
location = null;
|
||||
}
|
||||
playerTexture = compound.getBoolean("PlayerTexture");
|
||||
location = null;
|
||||
}
|
||||
|
||||
public ResourceLocation getResource(){
|
||||
if(texture.isEmpty())
|
||||
return null;
|
||||
if(location != null)
|
||||
return location;
|
||||
location = new ResourceLocation(texture);
|
||||
return location;
|
||||
}
|
||||
public ResourceLocation getResource() {
|
||||
if (texture.isEmpty())
|
||||
return null;
|
||||
if (location != null)
|
||||
return location;
|
||||
location = new ResourceLocation(texture);
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setTexture(String texture, int type) {
|
||||
this.type = (byte) type;
|
||||
this.location = null;
|
||||
if(texture.isEmpty()){
|
||||
playerTexture = true;
|
||||
this.texture = texture;
|
||||
}
|
||||
else{
|
||||
this.texture = "customnpcs:textures/parts/"+ texture + ".png";
|
||||
playerTexture = false;
|
||||
}
|
||||
}
|
||||
public void setTexture(String texture, int type) {
|
||||
this.type = (byte) type;
|
||||
this.location = null;
|
||||
if (texture.isEmpty()) {
|
||||
playerTexture = true;
|
||||
this.texture = texture;
|
||||
} else {
|
||||
this.texture = "customnpcs:textures/parts/" + texture + ".png";
|
||||
playerTexture = false;
|
||||
}
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return "Color: " + color + " Type: " + type;
|
||||
}
|
||||
public String toString() {
|
||||
return "Color: " + color + " Type: " + type;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
String str = Integer.toHexString(color);
|
||||
public String getColor() {
|
||||
String str = Integer.toHexString(color);
|
||||
|
||||
while(str.length() < 6)
|
||||
str = "0" + str;
|
||||
while (str.length() < 6)
|
||||
str = "0" + str;
|
||||
|
||||
return str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
@@ -6,83 +6,83 @@ import noppes.npcs.api.entity.data.IModelRotatePart;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
public class ModelRotate implements IModelRotate {
|
||||
// Rotation
|
||||
public boolean whileStanding = true;
|
||||
public boolean whileAttacking = false;
|
||||
public boolean whileMoving = false;
|
||||
// Rotation
|
||||
public boolean whileStanding = true;
|
||||
public boolean whileAttacking = false;
|
||||
public boolean whileMoving = false;
|
||||
|
||||
public ModelRotatePart head = new ModelRotatePart();
|
||||
public ModelRotatePart body = new ModelRotatePart();
|
||||
public ModelRotatePart larm = new ModelRotatePart();
|
||||
public ModelRotatePart rarm = new ModelRotatePart();
|
||||
public ModelRotatePart lleg = new ModelRotatePart();
|
||||
public ModelRotatePart rleg = new ModelRotatePart();
|
||||
public ModelRotatePart head = new ModelRotatePart();
|
||||
public ModelRotatePart body = new ModelRotatePart();
|
||||
public ModelRotatePart larm = new ModelRotatePart();
|
||||
public ModelRotatePart rarm = new ModelRotatePart();
|
||||
public ModelRotatePart lleg = new ModelRotatePart();
|
||||
public ModelRotatePart rleg = new ModelRotatePart();
|
||||
|
||||
public NBTTagCompound writeToNBT(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setBoolean("PuppetStanding", whileStanding);
|
||||
compound.setBoolean("PuppetAttacking", whileAttacking);
|
||||
compound.setBoolean("PuppetMoving", whileMoving);
|
||||
compound.setTag("PuppetHead", head.writeToNBT());
|
||||
compound.setTag("PuppetBody", body.writeToNBT());
|
||||
compound.setTag("PuppetRArm", rarm.writeToNBT());
|
||||
compound.setTag("PuppetLArm", larm.writeToNBT());
|
||||
compound.setTag("PuppetRLeg", rleg.writeToNBT());
|
||||
compound.setTag("PuppetLLeg", lleg.writeToNBT());
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
whileStanding = compound.getBoolean("PuppetStanding");
|
||||
whileAttacking = compound.getBoolean("PuppetAttacking");
|
||||
whileMoving = compound.getBoolean("PuppetMoving");
|
||||
head.readFromNBT(compound.getCompoundTag("PuppetHead"));
|
||||
body.readFromNBT(compound.getCompoundTag("PuppetBody"));
|
||||
rarm.readFromNBT(compound.getCompoundTag("PuppetRArm"));
|
||||
larm.readFromNBT(compound.getCompoundTag("PuppetLArm"));
|
||||
rleg.readFromNBT(compound.getCompoundTag("PuppetRLeg"));
|
||||
lleg.readFromNBT(compound.getCompoundTag("PuppetLLeg"));
|
||||
}
|
||||
public NBTTagCompound writeToNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setBoolean("PuppetStanding", whileStanding);
|
||||
compound.setBoolean("PuppetAttacking", whileAttacking);
|
||||
compound.setBoolean("PuppetMoving", whileMoving);
|
||||
compound.setTag("PuppetHead", head.writeToNBT());
|
||||
compound.setTag("PuppetBody", body.writeToNBT());
|
||||
compound.setTag("PuppetRArm", rarm.writeToNBT());
|
||||
compound.setTag("PuppetLArm", larm.writeToNBT());
|
||||
compound.setTag("PuppetRLeg", rleg.writeToNBT());
|
||||
compound.setTag("PuppetLLeg", lleg.writeToNBT());
|
||||
return compound;
|
||||
}
|
||||
|
||||
public boolean whileStanding() {
|
||||
return this.whileStanding;
|
||||
}
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
whileStanding = compound.getBoolean("PuppetStanding");
|
||||
whileAttacking = compound.getBoolean("PuppetAttacking");
|
||||
whileMoving = compound.getBoolean("PuppetMoving");
|
||||
head.readFromNBT(compound.getCompoundTag("PuppetHead"));
|
||||
body.readFromNBT(compound.getCompoundTag("PuppetBody"));
|
||||
rarm.readFromNBT(compound.getCompoundTag("PuppetRArm"));
|
||||
larm.readFromNBT(compound.getCompoundTag("PuppetLArm"));
|
||||
rleg.readFromNBT(compound.getCompoundTag("PuppetRLeg"));
|
||||
lleg.readFromNBT(compound.getCompoundTag("PuppetLLeg"));
|
||||
}
|
||||
|
||||
public void whileStanding(boolean whileStanding) {
|
||||
this.whileStanding = whileStanding;
|
||||
}
|
||||
public boolean whileStanding() {
|
||||
return this.whileStanding;
|
||||
}
|
||||
|
||||
public boolean whileAttacking() {
|
||||
return this.whileAttacking;
|
||||
}
|
||||
public void whileStanding(boolean whileStanding) {
|
||||
this.whileStanding = whileStanding;
|
||||
}
|
||||
|
||||
public void whileAttacking(boolean whileAttacking) {
|
||||
this.whileAttacking = whileAttacking;
|
||||
}
|
||||
public boolean whileAttacking() {
|
||||
return this.whileAttacking;
|
||||
}
|
||||
|
||||
public boolean whileMoving() {
|
||||
return this.whileMoving;
|
||||
}
|
||||
public void whileAttacking(boolean whileAttacking) {
|
||||
this.whileAttacking = whileAttacking;
|
||||
}
|
||||
|
||||
public void whileMoving(boolean whileMoving) {
|
||||
this.whileMoving = whileMoving;
|
||||
}
|
||||
public boolean whileMoving() {
|
||||
return this.whileMoving;
|
||||
}
|
||||
|
||||
public IModelRotatePart getPart(int part) {
|
||||
switch (ValueUtil.clamp(part,0,5)) {
|
||||
case 0:
|
||||
return head;
|
||||
case 1:
|
||||
return body;
|
||||
case 2:
|
||||
return larm;
|
||||
case 3:
|
||||
return rarm;
|
||||
case 4:
|
||||
return lleg;
|
||||
case 5:
|
||||
return rleg;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void whileMoving(boolean whileMoving) {
|
||||
this.whileMoving = whileMoving;
|
||||
}
|
||||
|
||||
public IModelRotatePart getPart(int part) {
|
||||
switch (ValueUtil.clamp(part, 0, 5)) {
|
||||
case 0:
|
||||
return head;
|
||||
case 1:
|
||||
return body;
|
||||
case 2:
|
||||
return larm;
|
||||
case 3:
|
||||
return rarm;
|
||||
case 4:
|
||||
return lleg;
|
||||
case 5:
|
||||
return rleg;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -5,48 +5,48 @@ import noppes.npcs.api.entity.data.IModelRotatePart;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
public class ModelRotatePart implements IModelRotatePart {
|
||||
public float rotationX = 0f, rotationY = 0f, rotationZ = 0f;
|
||||
public boolean disabled = false;
|
||||
public float rotationX = 0f, rotationY = 0f, rotationZ = 0f;
|
||||
public boolean disabled = false;
|
||||
|
||||
public NBTTagCompound writeToNBT(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setBoolean("Disabled", disabled);
|
||||
compound.setFloat("RotationX", rotationX);
|
||||
compound.setFloat("RotationY", rotationY);
|
||||
compound.setFloat("RotationZ", rotationZ);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
disabled = compound.getBoolean("Disabled");
|
||||
rotationX = ValueUtil.clamp(compound.getFloat("RotationX"), -0.5f, 0.5f);
|
||||
rotationY = ValueUtil.clamp(compound.getFloat("RotationY"), -0.5f, 0.5f);
|
||||
rotationZ = ValueUtil.clamp(compound.getFloat("RotationZ"), -0.5f, 0.5f);
|
||||
}
|
||||
public NBTTagCompound writeToNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setBoolean("Disabled", disabled);
|
||||
compound.setFloat("RotationX", rotationX);
|
||||
compound.setFloat("RotationY", rotationY);
|
||||
compound.setFloat("RotationZ", rotationZ);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void setRotation(float x, float y, float z) {
|
||||
this.rotationX = ValueUtil.clamp(x, -0.5f, 0.5f);
|
||||
this.rotationY = ValueUtil.clamp(y, -0.5f, 0.5f);
|
||||
this.rotationZ = ValueUtil.clamp(z, -0.5f, 0.5f);
|
||||
}
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
disabled = compound.getBoolean("Disabled");
|
||||
rotationX = ValueUtil.clamp(compound.getFloat("RotationX"), -0.5f, 0.5f);
|
||||
rotationY = ValueUtil.clamp(compound.getFloat("RotationY"), -0.5f, 0.5f);
|
||||
rotationZ = ValueUtil.clamp(compound.getFloat("RotationZ"), -0.5f, 0.5f);
|
||||
}
|
||||
|
||||
public float getRotateX() {
|
||||
return this.rotationX;
|
||||
}
|
||||
public void setRotation(float x, float y, float z) {
|
||||
this.rotationX = ValueUtil.clamp(x, -0.5f, 0.5f);
|
||||
this.rotationY = ValueUtil.clamp(y, -0.5f, 0.5f);
|
||||
this.rotationZ = ValueUtil.clamp(z, -0.5f, 0.5f);
|
||||
}
|
||||
|
||||
public float getRotateY() {
|
||||
return this.rotationY;
|
||||
}
|
||||
public float getRotateX() {
|
||||
return this.rotationX;
|
||||
}
|
||||
|
||||
public float getRotateZ() {
|
||||
return this.rotationZ;
|
||||
}
|
||||
public float getRotateY() {
|
||||
return this.rotationY;
|
||||
}
|
||||
|
||||
public void disabled(boolean disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
public float getRotateZ() {
|
||||
return this.rotationZ;
|
||||
}
|
||||
|
||||
public boolean disabled() {
|
||||
return this.disabled;
|
||||
}
|
||||
public void disabled(boolean disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
|
||||
public boolean disabled() {
|
||||
return this.disabled;
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public class ModelScale implements IModelScale {
|
||||
|
||||
@Override
|
||||
public IModelScalePart getPart(int part) {
|
||||
switch (ValueUtil.clamp(part,0,3)) {
|
||||
switch (ValueUtil.clamp(part, 0, 3)) {
|
||||
case 0:
|
||||
return head;
|
||||
case 1:
|
||||
|
||||
@@ -5,47 +5,47 @@ import noppes.npcs.api.entity.data.IModelScalePart;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
public class ModelScalePart implements IModelScalePart {
|
||||
public float scaleX = 1, scaleY = 1, scaleZ = 1;
|
||||
public float scaleX = 1, scaleY = 1, scaleZ = 1;
|
||||
|
||||
public NBTTagCompound writeToNBT(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setFloat("ScaleX", scaleX);
|
||||
compound.setFloat("ScaleY", scaleY);
|
||||
compound.setFloat("ScaleZ", scaleZ);
|
||||
public NBTTagCompound writeToNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setFloat("ScaleX", scaleX);
|
||||
compound.setFloat("ScaleY", scaleY);
|
||||
compound.setFloat("ScaleZ", scaleZ);
|
||||
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
scaleX = ValueUtil.clamp(compound.getFloat("ScaleX"), 0.5f, 1.5f);
|
||||
scaleY = ValueUtil.clamp(compound.getFloat("ScaleY"), 0.5f, 1.5f);
|
||||
scaleZ = ValueUtil.clamp(compound.getFloat("ScaleZ"), 0.5f, 1.5f);
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return "ScaleX: " + scaleX + " - ScaleY: " + scaleY + " - ScaleZ: " + scaleZ;
|
||||
}
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void setScale(float x, float y) {
|
||||
scaleZ = scaleX = x;
|
||||
scaleY = y;
|
||||
}
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
scaleX = ValueUtil.clamp(compound.getFloat("ScaleX"), 0.5f, 1.5f);
|
||||
scaleY = ValueUtil.clamp(compound.getFloat("ScaleY"), 0.5f, 1.5f);
|
||||
scaleZ = ValueUtil.clamp(compound.getFloat("ScaleZ"), 0.5f, 1.5f);
|
||||
}
|
||||
|
||||
public void setScale(float x, float y, float z) {
|
||||
scaleX = ValueUtil.clamp(x, 0.5f, 1.5f);
|
||||
scaleY = ValueUtil.clamp(y, 0.5f, 1.5f);
|
||||
scaleZ = ValueUtil.clamp(z, 0.5f, 1.5f);
|
||||
}
|
||||
public String toString() {
|
||||
return "ScaleX: " + scaleX + " - ScaleY: " + scaleY + " - ScaleZ: " + scaleZ;
|
||||
}
|
||||
|
||||
public float getScaleX() {
|
||||
return scaleX;
|
||||
}
|
||||
public void setScale(float x, float y) {
|
||||
scaleZ = scaleX = x;
|
||||
scaleY = y;
|
||||
}
|
||||
|
||||
public float getScaleY() {
|
||||
return scaleY;
|
||||
}
|
||||
public void setScale(float x, float y, float z) {
|
||||
scaleX = ValueUtil.clamp(x, 0.5f, 1.5f);
|
||||
scaleY = ValueUtil.clamp(y, 0.5f, 1.5f);
|
||||
scaleZ = ValueUtil.clamp(z, 0.5f, 1.5f);
|
||||
}
|
||||
|
||||
public float getScaleZ() {
|
||||
return scaleZ;
|
||||
}
|
||||
public float getScaleX() {
|
||||
return scaleX;
|
||||
}
|
||||
|
||||
public float getScaleY() {
|
||||
return scaleY;
|
||||
}
|
||||
|
||||
public float getScaleZ() {
|
||||
return scaleZ;
|
||||
}
|
||||
}
|
||||
@@ -14,33 +14,31 @@ import noppes.npcs.entity.data.ModelData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCDwarfFemale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNPCDwarfFemale(World world)
|
||||
{
|
||||
public class EntityNPCDwarfFemale extends EntityNPCInterface {
|
||||
public EntityNPCDwarfFemale(World world) {
|
||||
super(world);
|
||||
scaleX = scaleZ = 0.75f;
|
||||
scaleY = 0.6275f;
|
||||
display.texture = "customnpcs:textures/entity/dwarffemale/Simone.png";
|
||||
}
|
||||
|
||||
public void onUpdate(){
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.legs.setScale(0.8f,1.05f);
|
||||
data.modelScale.arms.setScale(0.8f,1.05f);
|
||||
data.modelScale.body.setScale(0.8f,1.05f);
|
||||
data.modelScale.head.setScale(0.8f,0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.legs.setScale(0.8f, 1.05f);
|
||||
data.modelScale.arms.setScale(0.8f, 1.05f);
|
||||
data.modelScale.body.setScale(0.8f, 1.05f);
|
||||
data.modelScale.head.setScale(0.8f, 0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -14,32 +14,30 @@ import noppes.npcs.entity.data.ModelData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCDwarfMale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNPCDwarfMale(World world)
|
||||
{
|
||||
public class EntityNPCDwarfMale extends EntityNPCInterface {
|
||||
public EntityNPCDwarfMale(World world) {
|
||||
super(world);
|
||||
scaleX = scaleZ = 0.85f;
|
||||
scaleY = 0.6875f;
|
||||
display.texture = "customnpcs:textures/entity/dwarfmale/Simon.png";
|
||||
}
|
||||
|
||||
public void onUpdate(){
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.modelScale.legs.setScale(1.1f,0.7f, 0.9f);
|
||||
data.modelScale.arms.setScale(0.9f,0.7f);
|
||||
data.modelScale.body.setScale(1.2f, 0.7f, 1.5f);
|
||||
data.modelScale.head.setScale(0.85f,0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.modelScale.legs.setScale(1.1f, 0.7f, 0.9f);
|
||||
data.modelScale.arms.setScale(0.9f, 0.7f);
|
||||
data.modelScale.body.setScale(1.2f, 0.7f, 1.5f);
|
||||
data.modelScale.head.setScale(0.85f, 0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -14,35 +14,33 @@ import noppes.npcs.entity.data.ModelData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCElfFemale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNPCElfFemale(World world)
|
||||
{
|
||||
public class EntityNPCElfFemale extends EntityNPCInterface {
|
||||
public EntityNPCElfFemale(World world) {
|
||||
super(world);
|
||||
display.texture = "customnpcs:textures/entity/elffemale/ElfFemale.png";
|
||||
scaleX = 0.8f;
|
||||
scaleY = 1f;
|
||||
scaleZ = 0.8f;
|
||||
scaleX = 0.8f;
|
||||
scaleY = 1f;
|
||||
scaleZ = 0.8f;
|
||||
}
|
||||
|
||||
|
||||
public void onUpdate(){
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.legs.setScale(0.8f,1.05f);
|
||||
data.modelScale.arms.setScale(0.8f,1.05f);
|
||||
data.modelScale.body.setScale(0.8f,1.05f);
|
||||
data.modelScale.head.setScale(0.8f,0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.legs.setScale(0.8f, 1.05f);
|
||||
data.modelScale.arms.setScale(0.8f, 1.05f);
|
||||
data.modelScale.body.setScale(0.8f, 1.05f);
|
||||
data.modelScale.head.setScale(0.8f, 0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -14,34 +14,32 @@ import noppes.npcs.entity.data.ModelData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCElfMale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNPCElfMale(World world)
|
||||
{
|
||||
public class EntityNPCElfMale extends EntityNPCInterface {
|
||||
public EntityNPCElfMale(World world) {
|
||||
super(world);
|
||||
scaleX = 0.85f;
|
||||
scaleY = 1.07f;
|
||||
scaleZ = 0.85f;
|
||||
display.texture = "customnpcs:textures/entity/elfmale/ElfMale.png";
|
||||
scaleX = 0.85f;
|
||||
scaleY = 1.07f;
|
||||
scaleZ = 0.85f;
|
||||
display.texture = "customnpcs:textures/entity/elfmale/ElfMale.png";
|
||||
}
|
||||
|
||||
|
||||
public void onUpdate(){
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.modelScale.legs.setScale(0.85f,1.15f);
|
||||
data.modelScale.arms.setScale(0.85f,1.15f);
|
||||
data.modelScale.body.setScale(0.85f,1.15f);
|
||||
data.modelScale.head.setScale(0.85f,0.95f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.modelScale.legs.setScale(0.85f, 1.15f);
|
||||
data.modelScale.arms.setScale(0.85f, 1.15f);
|
||||
data.modelScale.body.setScale(0.85f, 1.15f);
|
||||
data.modelScale.head.setScale(0.85f, 0.95f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -12,50 +12,45 @@ import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
|
||||
public class EntityNPCEnderman extends EntityNpcEnderchibi
|
||||
{
|
||||
public EntityNPCEnderman(World world)
|
||||
{
|
||||
public class EntityNPCEnderman extends EntityNpcEnderchibi {
|
||||
public EntityNPCEnderman(World world) {
|
||||
super(world);
|
||||
display.texture = "customnpcs:textures/entity/enderman/enderman.png";
|
||||
//display.glowTexture = ;
|
||||
display.skinOverlayData.overlayList.put(0,new SkinOverlay("customnpcs:textures/overlays/ender_eyes.png"));
|
||||
display.skinOverlayData.overlayList.put(0, new SkinOverlay("customnpcs:textures/overlays/ender_eyes.png"));
|
||||
this.width = 0.6F;
|
||||
this.height = 2.9F;
|
||||
}
|
||||
|
||||
public void updateHitbox() {
|
||||
|
||||
if(currentAnimation == EnumAnimation.LYING){
|
||||
width = height = 0.2f;
|
||||
}
|
||||
else if (currentAnimation == EnumAnimation.SITTING){
|
||||
width = 0.6f;
|
||||
height = 2.3f;
|
||||
}
|
||||
else{
|
||||
width = 0.6f;
|
||||
height = 2.9f;
|
||||
}
|
||||
width = (width / 5f) * display.modelSize;
|
||||
height = (height / 5f) * display.modelSize;
|
||||
}
|
||||
if (currentAnimation == EnumAnimation.LYING) {
|
||||
width = height = 0.2f;
|
||||
} else if (currentAnimation == EnumAnimation.SITTING) {
|
||||
width = 0.6f;
|
||||
height = 2.3f;
|
||||
} else {
|
||||
width = 0.6f;
|
||||
height = 2.9f;
|
||||
}
|
||||
width = (width / 5f) * display.modelSize;
|
||||
height = (height / 5f) * display.modelSize;
|
||||
}
|
||||
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityEnderman.class);
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityEnderman.class);
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -15,41 +15,39 @@ import noppes.npcs.entity.data.ModelPartData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCFurryFemale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNPCFurryFemale(World world)
|
||||
{
|
||||
public class EntityNPCFurryFemale extends EntityNPCInterface {
|
||||
public EntityNPCFurryFemale(World world) {
|
||||
super(world);
|
||||
scaleX = scaleY = scaleZ = 0.9075f;
|
||||
display.texture = "customnpcs:textures/entity/furryfemale/WolfBlack.png";
|
||||
}
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.head.setScale(0.95f,0.95f);
|
||||
data.modelScale.legs.setScale(0.92f,0.92f);
|
||||
data.modelScale.arms.setScale(0.80f,0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
ModelPartData hair = data.getOrCreatePart("ears");
|
||||
hair.playerTexture = true;
|
||||
ModelPartData snout = data.getOrCreatePart("snout");
|
||||
snout.playerTexture = true;
|
||||
snout.type = 1;
|
||||
ModelPartData tail = data.getOrCreatePart("tail");
|
||||
tail.playerTexture = true;
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.head.setScale(0.95f, 0.95f);
|
||||
data.modelScale.legs.setScale(0.92f, 0.92f);
|
||||
data.modelScale.arms.setScale(0.80f, 0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
ModelPartData hair = data.getOrCreatePart("ears");
|
||||
hair.playerTexture = true;
|
||||
ModelPartData snout = data.getOrCreatePart("snout");
|
||||
snout.playerTexture = true;
|
||||
snout.type = 1;
|
||||
ModelPartData tail = data.getOrCreatePart("tail");
|
||||
tail.playerTexture = true;
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -15,36 +15,33 @@ import noppes.npcs.entity.data.ModelPartData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCFurryMale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNPCFurryMale(World world)
|
||||
{
|
||||
public class EntityNPCFurryMale extends EntityNPCInterface {
|
||||
public EntityNPCFurryMale(World world) {
|
||||
super(world);
|
||||
display.texture = "customnpcs:textures/entity/furrymale/WolfGrey.png";
|
||||
}
|
||||
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
ModelPartData hair = data.getOrCreatePart("ears");
|
||||
hair.playerTexture = true;
|
||||
ModelPartData snout = data.getOrCreatePart("snout");
|
||||
snout.playerTexture = true;
|
||||
snout.type = 1;
|
||||
ModelPartData tail = data.getOrCreatePart("tail");
|
||||
tail.playerTexture = true;
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
ModelPartData hair = data.getOrCreatePart("ears");
|
||||
hair.playerTexture = true;
|
||||
ModelPartData snout = data.getOrCreatePart("snout");
|
||||
snout.playerTexture = true;
|
||||
snout.type = 1;
|
||||
ModelPartData tail = data.getOrCreatePart("tail");
|
||||
tail.playerTexture = true;
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,32 +14,30 @@ import noppes.npcs.entity.data.ModelData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCHumanFemale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNPCHumanFemale(World world)
|
||||
{
|
||||
public class EntityNPCHumanFemale extends EntityNPCInterface {
|
||||
public EntityNPCHumanFemale(World world) {
|
||||
super(world);
|
||||
scaleX = scaleY = scaleZ = 0.9075f;
|
||||
display.texture = "customnpcs:textures/entity/humanfemale/Stephanie.png";
|
||||
}
|
||||
|
||||
public void onUpdate(){
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.head.setScale(0.95f,0.95f);
|
||||
data.modelScale.legs.setScale(0.92f,0.92f);
|
||||
data.modelScale.arms.setScale(0.80f,0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.head.setScale(0.95f, 0.95f);
|
||||
data.modelScale.legs.setScale(0.92f, 0.92f);
|
||||
data.modelScale.arms.setScale(0.80f, 0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
|
||||
// Jad home page: http://www.kpdus.com/jad.html
|
||||
// Decompiler options: packimports(3) braces deadcode fieldsfirst
|
||||
// Decompiler options: packimports(3) braces deadcode fieldsfirst
|
||||
|
||||
package noppes.npcs.entity.old;
|
||||
|
||||
@@ -10,28 +10,26 @@ import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCHumanMale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNPCHumanMale(World world)
|
||||
{
|
||||
public class EntityNPCHumanMale extends EntityNPCInterface {
|
||||
public EntityNPCHumanMale(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
|
||||
public void onUpdate(){
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -14,32 +14,30 @@ import noppes.npcs.entity.data.ModelData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCOrcFemale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNPCOrcFemale(World world)
|
||||
{
|
||||
public class EntityNPCOrcFemale extends EntityNPCInterface {
|
||||
public EntityNPCOrcFemale(World world) {
|
||||
super(world);
|
||||
scaleX = scaleY = scaleZ = 0.9375f;
|
||||
display.texture = "customnpcs:textures/entity/orcfemale/StrandedFemaleOrc.png";
|
||||
scaleX = scaleY = scaleZ = 0.9375f;
|
||||
display.texture = "customnpcs:textures/entity/orcfemale/StrandedFemaleOrc.png";
|
||||
}
|
||||
|
||||
public void onUpdate(){
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.legs.setScale(0.9f,0.65f);
|
||||
data.modelScale.arms.setScale(0.9f,0.65f);
|
||||
data.modelScale.body.setScale(1f, 0.65f, 1.1f);
|
||||
data.modelScale.head.setScale(0.85f,0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.legs.setScale(0.9f, 0.65f);
|
||||
data.modelScale.arms.setScale(0.9f, 0.65f);
|
||||
data.modelScale.body.setScale(1f, 0.65f, 1.1f);
|
||||
data.modelScale.head.setScale(0.85f, 0.85f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -14,32 +14,30 @@ import noppes.npcs.entity.data.ModelData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCOrcMale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNPCOrcMale(World world)
|
||||
{
|
||||
public class EntityNPCOrcMale extends EntityNPCInterface {
|
||||
public EntityNPCOrcMale(World world) {
|
||||
super(world);
|
||||
scaleY = 1f;
|
||||
scaleX = scaleZ = 1.2f;
|
||||
scaleY = 1f;
|
||||
scaleX = scaleZ = 1.2f;
|
||||
display.texture = "customnpcs:textures/entity/orcmale/StrandedOrc.png";
|
||||
}
|
||||
|
||||
public void onUpdate(){
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.modelScale.legs.setScale(1.2f,1.05f);
|
||||
data.modelScale.arms.setScale(1.2f,1.05f);
|
||||
data.modelScale.body.setScale(1.4f, 1.1f, 1.5f);
|
||||
data.modelScale.head.setScale(1.2f,1.1f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.modelScale.legs.setScale(1.2f, 1.05f);
|
||||
data.modelScale.arms.setScale(1.2f, 1.05f);
|
||||
data.modelScale.body.setScale(1.4f, 1.1f, 1.5f);
|
||||
data.modelScale.head.setScale(1.2f, 1.1f);
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -15,30 +15,28 @@ import noppes.npcs.entity.data.ModelData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNPCVillager extends EntityNPCInterface
|
||||
{
|
||||
public class EntityNPCVillager extends EntityNPCInterface {
|
||||
|
||||
public EntityNPCVillager(World world)
|
||||
{
|
||||
public EntityNPCVillager(World world) {
|
||||
super(world);
|
||||
display.texture = "textures/entity/villager/villager.png";
|
||||
}
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityVillager.class);
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntityVillager.class);
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,32 +15,30 @@ import noppes.npcs.entity.data.ModelPartData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNpcEnderchibi extends EntityNPCInterface
|
||||
{
|
||||
public EntityNpcEnderchibi(World world)
|
||||
{
|
||||
public class EntityNpcEnderchibi extends EntityNPCInterface {
|
||||
public EntityNpcEnderchibi(World world) {
|
||||
super(world);
|
||||
display.texture = "customnpcs:textures/entity/enderchibi/MrEnderchibi.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.modelScale.legs.setScale(0.65f,0.75f);
|
||||
data.modelScale.arms.setScale(0.50f,1.45f);
|
||||
ModelPartData part = data.getOrCreatePart("particles");
|
||||
part.playerTexture = true;
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.modelScale.legs.setScale(0.65f, 0.75f);
|
||||
data.modelScale.arms.setScale(0.50f, 1.45f);
|
||||
ModelPartData part = data.getOrCreatePart("particles");
|
||||
part.playerTexture = true;
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,34 +15,32 @@ import noppes.npcs.entity.data.ModelData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNpcMonsterFemale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNpcMonsterFemale(World world)
|
||||
{
|
||||
public class EntityNpcMonsterFemale extends EntityNPCInterface {
|
||||
public EntityNpcMonsterFemale(World world) {
|
||||
super(world);
|
||||
scaleX = scaleY = scaleZ = 0.9075f;
|
||||
display.texture = "customnpcs:textures/entity/monsterfemale/ZombieStephanie.png";
|
||||
}
|
||||
|
||||
public void onUpdate(){
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.head.setScale(0.95f,0.95f);
|
||||
data.modelScale.legs.setScale(0.92f,0.92f);
|
||||
data.modelScale.arms.setScale(0.80f,0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
npc.ais.animationType = EnumAnimation.HUG;
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.head.setScale(0.95f, 0.95f);
|
||||
data.modelScale.legs.setScale(0.92f, 0.92f);
|
||||
data.modelScale.arms.setScale(0.80f, 0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
npc.ais.animationType = EnumAnimation.HUG;
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,27 +14,25 @@ import noppes.npcs.entity.EntityNPCInterface;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNpcMonsterMale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNpcMonsterMale(World world)
|
||||
{
|
||||
public class EntityNpcMonsterMale extends EntityNPCInterface {
|
||||
public EntityNpcMonsterMale(World world) {
|
||||
super(world);
|
||||
display.texture = "customnpcs:textures/entity/monstermale/ZombieSteve.png";
|
||||
}
|
||||
|
||||
public void onUpdate(){
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
npc.ais.animationType = EnumAnimation.HUG;
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
npc.ais.animationType = EnumAnimation.HUG;
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,36 +15,34 @@ import noppes.npcs.entity.data.ModelPartData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNpcNagaFemale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNpcNagaFemale(World world)
|
||||
{
|
||||
public class EntityNpcNagaFemale extends EntityNPCInterface {
|
||||
public EntityNpcNagaFemale(World world) {
|
||||
super(world);
|
||||
scaleX = scaleY = scaleZ = 0.9075f;
|
||||
display.texture = "customnpcs:textures/entity/nagafemale/Claire.png";
|
||||
}
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.head.setScale(0.95f,0.95f);
|
||||
data.modelScale.legs.setScale(0.92f,0.92f);
|
||||
data.modelScale.arms.setScale(0.80f,0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
ModelPartData legs = data.legParts;
|
||||
legs.playerTexture = true;
|
||||
legs.type = 1;
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.breasts = 2;
|
||||
data.modelScale.head.setScale(0.95f, 0.95f);
|
||||
data.modelScale.legs.setScale(0.92f, 0.92f);
|
||||
data.modelScale.arms.setScale(0.80f, 0.92f);
|
||||
data.modelScale.body.setScale(0.92f, 0.92f);
|
||||
ModelPartData legs = data.legParts;
|
||||
legs.playerTexture = true;
|
||||
legs.type = 1;
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -15,31 +15,28 @@ import noppes.npcs.entity.data.ModelPartData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNpcNagaMale extends EntityNPCInterface
|
||||
{
|
||||
public EntityNpcNagaMale(World world)
|
||||
{
|
||||
public class EntityNpcNagaMale extends EntityNPCInterface {
|
||||
public EntityNpcNagaMale(World world) {
|
||||
super(world);
|
||||
display.texture = "customnpcs:textures/entity/nagamale/Cobra.png";
|
||||
}
|
||||
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
ModelPartData legs = data.legParts;
|
||||
legs.playerTexture = true;
|
||||
legs.type = 1;
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
ModelPartData legs = data.legParts;
|
||||
legs.playerTexture = true;
|
||||
legs.type = 1;
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
@@ -15,30 +15,27 @@ import noppes.npcs.entity.data.ModelData;
|
||||
// EntityAnimal, Item, EntityPlayer, InventoryPlayer,
|
||||
// ItemStack, World, NBTTagCompound
|
||||
|
||||
public class EntityNpcSkeleton extends EntityNPCInterface
|
||||
{
|
||||
public EntityNpcSkeleton(World world)
|
||||
{
|
||||
public class EntityNpcSkeleton extends EntityNPCInterface {
|
||||
public EntityNpcSkeleton(World world) {
|
||||
super(world);
|
||||
display.texture = "customnpcs:textures/entity/skeleton/Skeleton.png";
|
||||
}
|
||||
|
||||
public void onUpdate()
|
||||
{
|
||||
isDead = true;
|
||||
public void onUpdate() {
|
||||
isDead = true;
|
||||
|
||||
if(!worldObj.isRemote){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (!worldObj.isRemote) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntitySkeleton.class);
|
||||
writeToNBT(compound);
|
||||
EntityCustomNpc npc = new EntityCustomNpc(worldObj);
|
||||
npc.readFromNBT(compound);
|
||||
ModelData data = npc.modelData;
|
||||
data.setEntityClass(EntitySkeleton.class);
|
||||
|
||||
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
super.onUpdate();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user