
deenkayros
Members-
Posts
111 -
Joined
-
Last visited
Everything posted by deenkayros
-
Thank you Draco, now eclipse work fine but build.gradle not, it says: Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory. my enviroment variable is setted: Path=C:\Program Files (x86)\Java\jdk1.7.0_09\bin I forgot something?
-
hi Lex, I've only a question: Will be 1.8.1 forge vers retro-compatible with 1.8? I ask you this because currently I'm developing very hard on 1.8 but as you know that MC vers is full of bugs and I'm developing in perspective on later more stable versions (aka 1.8.1). Anyway thank you so much for your effort on this.
-
Hello, After update my java vers, when open my eclips project i notice an error on this code line: IProxy.simpleNetworkWrapper.registerMessage(PacketPortalName.class, PacketPortalName.class, 0, Side.CLIENT); Error: The type java.lang.reflect.AnnotatedElement cannot be resolved. It is indirectly referenced from required .class files Please help....
-
I'm using a static boolean that says to the model class when the entity shot, this because into the model class I can set "aimedBow" only when the entity is shooting. Now when I setted "not static" the variable "isShooting" the model class cant recognizes the value even if changed.... also using the "get" function: Entity.class private static boolean isShooting = false; protected void updateAITasks() { super.updateAITasks(); if (this.getHeldItem() != null && !this.isSitting()) { if (this.getAttackTarget() != null) { this.isShooting = true; } else { this.isShooting = false; } } } protected boolean getShooting() { return this.isShooting; } Model.class public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { this.aimedBow = (((EntityWizard)p_78086_1_).getShooting()); super.setLivingAnimations(p_78086_1_, p_78086_2_, p_78086_3_, p_78086_4_); } Render.class public class RenderWizard extends RenderBiped { private static final ResourceLocation relaxWizardTexture = new ResourceLocation("mymod:textures/families/wizard.png"); private static final ResourceLocation tamedWizardTexture = new ResourceLocation("mymod:textures/families/wizard_tamed.png"); public RenderWizard(ModelBiped wizard, float par2) { super(wizard, par2); } protected ResourceLocation getEntityTexture(EntityWizard p_110775_1_) { //return p_110775_1_.isTamed() ? tamedWizardTexture : (p_110775_1_.isAngry() ? tamedWizardTexture : relaxWizardTexture); return p_110775_1_.isTamed() ? relaxWizardTexture : relaxWizardTexture; } protected ResourceLocation getEntityTexture(Entity entity) { return this.getEntityTexture((EntityWizard)entity); } protected ResourceLocation getEntityTexture(EntityLiving entity) { return this.getEntityTexture((EntityWizard)entity); } } If the variable "isShooting" is "not static" the model.class get "isShooting" always = false even if changed ... If the variable "isShooting" is "static" ALL entities instance are "aimedBow" synchronized ...
-
Hello, When my custom Entity try to throw the EntityThrowable it's invisible, instead work fine when i try to do it with myself entityplayer. please help EntityThrowable public class SummonSphereShoes extends EntityThrowable { private EntityPlayer player; private float my_rotation = 0.0F; public SummonSphereShoes(World par1World) { super(par1World); } public SummonSphereShoes(World par1World, EntityPlayer par2EntityLivingBase) { super(par1World, par2EntityLivingBase); this.player = par2EntityLivingBase; } public SummonSphereShoes(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } /** * Called when this EntityThrowable hits a block or entity. */ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { if (par1MovingObjectPosition.entityHit != null) { float var2 = 3.0F; par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, getThrower()), var2); } for (int var3 = 0; var3 < 4; var3++) { this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("reddust", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); } if (!this.worldObj.isRemote) { setDead(); } } public void onUpdate() { super.onUpdate(); this.my_rotation += 20.0F; while (this.my_rotation > 360.0F) { this.my_rotation -= 360.0F; } this.rotationPitch = (this.prevRotationPitch = this.my_rotation); } } Entity public class EntityElf extends EntityTameable implements IRangedAttackMob { public EntityElf(World p_i1696_1_) { super(p_i1696_1_); this.setSize(0.5F, 1.75F); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityMob.class, 0.8F, 0.80000000000000004D, 1.3300000000000001D)); } /** * Returns true if the newer Entity AI code should be run */ public boolean isAIEnabled() { return true; } protected void entityInit() { super.entityInit(); this.dataWatcher.addObject(13, new Byte((byte)0)); this.dataWatcher.addObject(18, new Float(this.getHealth())); //this.dataWatcher.addObject(19, new Byte((byte)0)); //this.dataWatcher.addObject(20, new Byte((byte)BlockColored.func_150032_b(1))); } /** * Attack the specified entity using a ranged attack. */ public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { int j = this.rand.nextInt(3); for (int k = 0; k < j; ++k) { SummonSphereShoes var2 = new SummonSphereShoes(this.worldObj); double var3 = p_82196_1_.posX - this.posX; double var5 = p_82196_1_.posY + p_82196_1_.getEyeHeight() - 1.1D - var2.posY; double var7 = p_82196_1_.posZ - this.posZ; float var9 = MathHelper.sqrt_double(var3 * var3 + var7 * var7) * 0.2F; var2.setThrowableHeading(var3, var5 + var9, var7, 1.8F, 4.0F); this.worldObj.playSoundAtEntity(this, "random.bow", 0.75F, 1.0F / (getRNG().nextFloat() * 0.4F + 0.8F)); this.worldObj.spawnEntityInWorld(var2); } } }
-
[1.7.10] Custom Entity can't hold Items in hand
deenkayros replied to deenkayros's topic in Modder Support
SOLVED thank you -
[1.7.10] Custom Entity can't hold Items in hand
deenkayros replied to deenkayros's topic in Modder Support
thanks now i changed my class to "RenderBiped" ... but I cant register the entity: RenderingRegistry.registerEntityRenderingHandler(EntityWarrior.class, new RenderWarrior(new Warrior(), 0)); Or you have an example to render the equippedItems by myself? EDIT: just changed related class type Thank you again ... -
[1.7.10] Custom Entity can't hold Items in hand
deenkayros replied to deenkayros's topic in Modder Support
My Render class: package com.summonsphere.mobs; import org.lwjgl.opengl.GL11; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; public class RenderWarrior extends RenderLiving { private static final ResourceLocation mobTextures = new ResourceLocation("summonsphere:textures/mobs/warrior1.png"); public RenderWarrior(ModelBase par1ModelBase, float par2) { super(par1ModelBase, par2); } protected ResourceLocation getEntityTexture(EntityWarrior entity) { return mobTextures; } protected ResourceLocation getEntityTexture(Entity entity) { return this.getEntityTexture((EntityWarrior)entity); } } -
Hello again, My custom mob dont want hold items in hand when SPAWN, here's the code: package com.summonsphere.mobs; import java.util.Calendar; import java.util.List; import java.util.UUID; import com.summonsphere.items.SummonItems; import com.summonsphere.main.mainRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; ........ import net.minecraft.world.WorldProviderHell; import net.minecraftforge.common.ForgeModContainer; public class EntityWarrior extends EntityAnimal implements IEntityOwnable, IRangedAttackMob { public EntityWarrior(World parWorld) { super(parWorld); this.setSize(0.6F, 1.99F); this.getNavigator().setBreakDoors(false); this.getNavigator().setAvoidsWater(false); this.getNavigator().setCanSwim(true); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAILookIdle(this)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 3.0F, 1.0F)); this.tasks.addTask(9, new EntityAIWander(this, 0.6D)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMob.class, 0, true)); } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(150.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.35D); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); //this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5.0D); } protected void entityInit() { super.entityInit(); this.dataWatcher.addObject(13, new Byte((byte)0)); this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); this.dataWatcher.addObject(17, ""); } public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { p_110161_1_ = super.onSpawnWithEgg(p_110161_1_); this.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword)); return p_110161_1_; } pls help ...
-
thank you soooooo much
-
Hello, Since I made a custom block all inventory icons become darkness only when i crafting my block, here the code: TutChestRenderer.class: package com.summonsphere.render.tile_entity; import java.util.Calendar; import net.minecraft.block.Block; import net.minecraft.client.model.ModelChest; import net.minecraft.client.model.ModelLargeChest; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import com.summonsphere.blocks.TutChest; import com.summonsphere.tile_entity.TileEntityTutChest; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class TutChestRenderer extends TileEntitySpecialRenderer { private static final ResourceLocation field_147505_d = new ResourceLocation("summonsphere:textures/blocks/LargeTutChest.png"); private static final ResourceLocation field_147504_g = new ResourceLocation("summonsphere:textures/blocks/TutChest.png"); private ModelChest field_147510_h = new ModelChest(); private ModelChest field_147511_i = new ModelLargeChest(); private boolean field_147509_j; private static final String __OBFID = "CL_00000965"; public TutChestRenderer() { Calendar calendar = Calendar.getInstance(); if (calendar.get(2) + 1 == 12 && calendar.get(5) >= 24 && calendar.get(5) <= 26) { this.field_147509_j = true; } } public void renderTileEntityAt(TileEntityTutChest p_147502_1_, double p_147502_2_, double p_147502_4_, double p_147502_6_, float p_147502_8_) { int i; if (!p_147502_1_.hasWorldObj()) { i = 0; } else { Block block = p_147502_1_.getBlockType(); i = p_147502_1_.getBlockMetadata(); if (block instanceof TutChest && i == 0) { try { ((TutChest)block).func_149954_e(p_147502_1_.getWorldObj(), p_147502_1_.xCoord, p_147502_1_.yCoord, p_147502_1_.zCoord); } catch (ClassCastException e) { FMLLog.severe("Attempted to render a chest at %d, %d, %d that was not a chest", p_147502_1_.xCoord, p_147502_1_.yCoord, p_147502_1_.zCoord); } i = p_147502_1_.getBlockMetadata(); } p_147502_1_.checkForAdjacentChests(); } if (p_147502_1_.adjacentChestZNeg == null && p_147502_1_.adjacentChestXNeg == null) { ModelChest modelchest; if (p_147502_1_.adjacentChestXPos == null && p_147502_1_.adjacentChestZPos == null) { modelchest = this.field_147510_h; this.bindTexture(field_147504_g); } else { modelchest = this.field_147511_i; this.bindTexture(field_147505_d); } GL11.glPushMatrix(); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glTranslatef((float)p_147502_2_, (float)p_147502_4_ + 1.0F, (float)p_147502_6_ + 1.0F); GL11.glScalef(1.0F, -1.0F, -1.0F); GL11.glTranslatef(0.5F, 0.5F, 0.5F); short short1 = 0; if (i == 2) { short1 = 180; } if (i == 3) { short1 = 0; } if (i == 4) { short1 = 90; } if (i == 5) { short1 = -90; } if (i == 2 && p_147502_1_.adjacentChestXPos != null) { GL11.glTranslatef(1.0F, 0.0F, 0.0F); } if (i == 5 && p_147502_1_.adjacentChestZPos != null) { GL11.glTranslatef(0.0F, 0.0F, -1.0F); } GL11.glRotatef((float)short1, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); float f1 = p_147502_1_.prevLidAngle + (p_147502_1_.lidAngle - p_147502_1_.prevLidAngle) * p_147502_8_; float f2; if (p_147502_1_.adjacentChestZNeg != null) { f2 = p_147502_1_.adjacentChestZNeg.prevLidAngle + (p_147502_1_.adjacentChestZNeg.lidAngle - p_147502_1_.adjacentChestZNeg.prevLidAngle) * p_147502_8_; if (f2 > f1) { f1 = f2; } } if (p_147502_1_.adjacentChestXNeg != null) { f2 = p_147502_1_.adjacentChestXNeg.prevLidAngle + (p_147502_1_.adjacentChestXNeg.lidAngle - p_147502_1_.adjacentChestXNeg.prevLidAngle) * p_147502_8_; if (f2 > f1) { f1 = f2; } } f1 = 1.0F - f1; f1 = 1.0F - f1 * f1 * f1; modelchest.chestLid.rotateAngleX = -(f1 * (float)Math.PI / 2.0F); modelchest.renderAll(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); } } public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { this.renderTileEntityAt((TileEntityTutChest)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); } } ItemRenderTutChest: package com.summonsphere.render.item; import net.minecraft.client.model.ModelChest; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; import com.summonsphere.tile_entity.TileEntityTutChest; public class ItemRenderTutChest implements IItemRenderer { private ModelChest chestModel; public ItemRenderTutChest() { chestModel = new ModelChest(); } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return true; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEntityTutChest(), 0.0D, 0.0D, 0.0D, 0.0F); } } pls help
-
Hello, I need to know when the player is in stand by or inactive, i mean which param become true when the inventory's player is open or the line command is activated or a gui is open. Thank you so much
-
Hello, I need to create a recipe with 2 stacks of torches (64+64): D-- -FE TTF D=diamond F=IronIngot E=ender_pearl T=64 torches GameRegistry.addShapedRecipe(new ItemStack(SummonItems.SonicDrill, 1), "d ", " fe", "ttf", 'd', new ItemStack(Items.diamond), 'f', new ItemStack(Items.iron_ingot), 'e', new ItemStack(Items.ender_pearl), 't', new ItemStack(Blocks.torch, 64)); But wont work, what's wrong? thx
-
thank you for reply, but i've never understood the packet handler, have you a VERY sample tutorial? I mean i know how to setup one but i dont know how to apply it in my case ...
-
Hello, random results of this code: @SubscribeEvent public void onPlayerTick(PlayerTickEvent event) { // Swap HotBar if (Keyboard.isKeyDown(Keyboard.KEY_B)) { if (!event.player.worldObj.isRemote) { int s = 0; ItemStack InvetoryPlayer[] = event.player.inventory.mainInventory.clone(); System.out.println("Length = " + InvetoryPlayer.length); for (s = 0; s < 9; ++s) { if(InvetoryPlayer[s] != null){ System.out.println("Slot = " + s + " -> " + InvetoryPlayer[s].getDisplayName()); } event.player.inventory.setInventorySlotContents(s, InvetoryPlayer[s+9]); } for (s = 9; s < 18; ++s) { if(InvetoryPlayer[s] != null){ System.out.println("Slot = " + s + " -> " + InvetoryPlayer[s].getDisplayName()); } event.player.inventory.setInventorySlotContents(s, InvetoryPlayer[s-9]); } InvetoryPlayer = null; } } } I need to swap the first inventory line with the hotbar every time i press "B" but it working only sometime. I think a misalignment client/server side ... Also the output is duplicated but this procedure is only server side ... i guess ... Please help.
-
[1.7.x] Rotate Entities on spawn [UNSOLVED] :(
deenkayros replied to deenkayros's topic in Modder Support
I tried to spawn also a Vanilla entity but same problem: myYawVar = 90.0F; EntityZombie eZombie = new EntityZombie(myPlayer.worldObj); eZombie.setLocationAndAngles(X, Y, Z, myYawVar, 0.0F); myPlayer.worldObj.spawnEntityInWorld(eZombie); eZombie.rotationYaw = myYawVar; -
[1.7.x] Rotate Entities on spawn [UNSOLVED] :(
deenkayros replied to deenkayros's topic in Modder Support
nope, it doesn't works. I think it's changed by the model class but setRotationYawHead is enough for me ..., thank you -
[1.7.x] Rotate Entities on spawn [UNSOLVED] :(
deenkayros replied to deenkayros's topic in Modder Support
yes something similar: Logger.setRotationYawHead(180.0F); works!! but the body wont rotate -
[1.7.x] Rotate Entities on spawn [UNSOLVED] :(
deenkayros replied to deenkayros's topic in Modder Support
yes but it isnt the player, it's a custom mob entity with model class. in summary i tried the follows solutions without success: -
[1.7.x] Rotate Entities on spawn [UNSOLVED] :(
deenkayros replied to deenkayros's topic in Modder Support
surely, but if i put "180.0F" or "90.0F" anyway it spawns always with yaw value equal to 0. why? -
Hello, I need to spawn an entity with the face always in front to the player but trying this code doesn't works: I mean the entity spawn correctly but with the face always to the same direction ... what am I doing wrong? thank you.
-
I found this code but crash mc: Crash:
-
Hello, I wonder if there's a "onHitBlockByPlayer()" event into EntityPlayer's @SubscribeEvent with which is possible to retrieve all block affected attributes ?? thank you so much
-
I've the same zedblade problem but i dont know what is "FOV update event", have you a tutorial/sample that makes a specific overview zoom? thanks a lot