Jump to content

KoadMaster

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by KoadMaster

  1. I am thinking along the same lines, currently is does work, and having it so that repairing it with my method makes it more expensive to repair on an anvil does sort of make sense (though it is likely that if someone tried to use my repair method on an object that had been repaired in the anvil before hand the object would likely just break, due to how I have it coded, but I guess that is fine). In general, I think I will just be using what I have, hopefully in the future it can be improved, but it works fine enough now. Thank you for you help
  2. Well, actually it is a furnace like device that repairs tools, however, I want it to give the tool a stacking debuff that will cause it to break faster, therefor making it unrepairble at a certain point (that I have not determined yet). Generally speaking, I worked on it quite a bit since posting and have something that "works" it checks for the NBTT tag called repairCost (used in the anvil) and uses it to keep track of the amount of times it has been repaired, and then simply sets that duration of the item repaired to be less each time. However, I realize that it is probably not the greatest way to go about things as it does potentially cause some incompatibility with the anvil (which in some ways is ok, but if Icould avoid it that would probably be better). So the trouble I have is actually setting a stacking debuff on an item that can be referenced by the repairing process. As far as your last line, I was thinking it would be coolest if it just broke faster while still looking like it was full, but I think just making it set the current durability to less is simpler and perhaps more user friendly. So basically I want the durability to go down in a crafting type situation, but I have figured out how to do that.
  3. So, in general, I am trying to make something that increases the rate at which am vanilla item runs out of durability. My first thought was to somehow decrease the max durability of only the particular item that the player has (I don't want to make all items of that type have less durability, only the ones that are debuffed). However, this is either really hard, or I am missing something simple. Therefor I thought that it would certainly be possible to make a new enchantment that works essentially the same way as unbreaking, but with the opposite effect (it would remove durability instead of preserve it). I am pretty sure forge has event hooks that could be used to accomplish this, bt I have essentially no knowledge of how to use them. Any help would be appreciated. -Thank You-
  4. Uh yes, it does have a model (which is essentially a big square), and it has the texture that should be mapped to it, though, to my knowledge, it doesn't seem to render said model unless I make it spawn a client side net. As far as the debugging, I generally try that as well, though I didn't think to put things in the actual onUpdate statement, that said, upon trying it it does claim to find the entity to set in the web, though it doesn't seem to actually do it, I will have to look into that, however, it still does actually render Yeah, I am kinda lazy about that... Even though I shouldn't be, I will probably try to do better with that in the future. EDIT: So, it seems that how I have it set up right now the net entity will actually effect mobs that are in it, however, these mobs 'lag' as in, if they would be falling while in the net it will fall and then bounce back to where it actually should be due to the nets slow... To my knowledge the net does not effect players whatsoever. EDIT2: So, I have tried to solve one issue at a time and then move on, so I commented out all of the unnecessary code in the EntityNetOut class, so that I could focus on just getting the entity to render properly, thus far I have not been able to get it to work, even when I replaced the render file with a different render file that I have made for a different entity that I know works, so I am not sure what is up with that, but my entity is not rendering properly EDIT3: (and yeah, I edit a lot) So, (and I like leading off with 'so,') I have come to some degree of a conclusion about what is going on, though I don't know how to fix it as of yet, basically the problem is that my netOutEntity, when spawned on the server side, doesn't correctly do anything on the client side, this puzzles me, because basically my netOut entity is a boat, with similar code in the entity file, but it leads me to think that it is possible that the problem is actually that I am missing something the boat does somewhere besides the actual entity file that causes the synergy between sever and client... EDIT4: (for the lols) So, ( ) I figured out that the basic problem was that I was registering the entity slightly wrong due to a typo, and that caused all sorts of problems, so, it really wasn't as complicated as I thought, regardless, I have worked it out and fixed it. Thank you for your time
  5. Ok, so the title isn't exactly long enough for me to say my entire problem, but basically I have a throwable entity that works like any other throwable entity, with the following as a the onImpact method: protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { EntityNetOut entity = new EntityNetOut(this.worldObj, this.posX, this.posY, this.posZ); if (par1MovingObjectPosition.entityHit != null) { System.out.println( "Entity" ); par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); } if (!this.worldObj.isRemote) { entity.rotationYaw = this.rotationYaw; entity.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); this.worldObj.spawnEntityInWorld(entity); this.setDead(); } } } basically if it hits anything it should spawn a "EntityNetOut" which is a entity that I have made, now the basic problem is that it doesn't appear to actually do it, after some effort I found that if I take away the "if (!this.worldObj.isRemote)" line it will kinda spawn, but it will have all kinds of problems (which is kinda expected). This leads me to think that it is probably a problem with client/server relations and my entity. However, after further tests, I found that the entity did in fact spawn but simply didn't effect anything, (entitynetout class:) package kodithemaster.Pirates; import java.util.Iterator; import java.util.List; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; public class EntityNetOut extends Entity { public EntityNetOut(World par1World, double x, double y, double z) { super(par1World); this.setPosition(x, y, z); this.setSize(2F, 2F); } public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { par1EntityPlayer.setInWeb(); } public AxisAlignedBB getCollisionBox(Entity par1Entity) { return null; } /** * returns the bounding box for this entity */ public AxisAlignedBB getBoundingBox() { return null; } public void onUpdate() { float f = 1.0F; List list = this.worldObj.getEntitiesWithinAABB(Entity.class, this.boundingBox.expand((double)f, (double)f, (double)f)); Iterator iterator = list.iterator(); while (iterator.hasNext()) { ((Entity) iterator.next()).setInWeb(); } } @Override protected void entityInit() {} @Override public void readEntityFromNBT(NBTTagCompound var1) {} @Override public void writeEntityToNBT(NBTTagCompound var1) {} } as you can see, the onUpdate method should cause surrounding entities to be slowed, however, it only does that if I have the EntityNet spawn a new one on the client side. Additionally, if I set the EntityNet to spawn a boat, or any other vanilla entity, it works fine, which leads me to think that the problem actually has something to do with my EntityNetOut, but I don't know what would actually be wrong with it. Right now I am trying to get it to actually render properly if only spawned on the server side, after which I plan to work on actually getting it to slow things properly, so here is my Render file: package kodithemaster.Pirates; import net.minecraft.block.Block; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBoat; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; import org.lwjgl.opengl.GL11; public class RenderNetOut extends Render { protected ModelBase modelNet; private ResourceLocation tex = new ResourceLocation("koadpirates", "textures/entity/NetOut.png"); public RenderNetOut() { this.modelNet = new ModelNetOut(); } public void doRender(EntityNetOut par1EntityNetOut, double par2, double par4, double par6, float par8, float par9) { // // // // I need what goes here!!!! // // // GL11.glPushMatrix(); this.bindEntityTexture(par1EntityNetOut); long i = (long)par1EntityNetOut.getEntityId() * 493286711L; i = i * i * 4392167121L + i * 98761L; float f2 = (((float)(i >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; float f3 = (((float)(i >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; float f4 = (((float)(i >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; GL11.glTranslatef(f2, f3, f4); double d3 = par1EntityNetOut.lastTickPosX + (par1EntityNetOut.posX - par1EntityNetOut.lastTickPosX) * (double)par9; double d4 = par1EntityNetOut.lastTickPosY + (par1EntityNetOut.posY - par1EntityNetOut.lastTickPosY) * (double)par9; double d5 = par1EntityNetOut.lastTickPosZ + (par1EntityNetOut.posZ - par1EntityNetOut.lastTickPosZ) * (double)par9; double d6 = 0.30000001192092896D; float f5 = par1EntityNetOut.prevRotationPitch + (par1EntityNetOut.rotationPitch - par1EntityNetOut.prevRotationPitch) * par9; GL11.glTranslatef((float)par2, (float)par4, (float)par6); GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-f5, 0.0F, 0.0F, 1.0F); GL11.glScalef(-1.0F, -1.0F, 1.0F); this.modelNet.render(par1EntityNetOut, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } protected ResourceLocation getEntityTexture(EntityNetOut par1Entity) { return tex; } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(Entity par1Entity) { return this.getEntityTexture((EntityNetOut)par1Entity); } @Override public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { this.doRender((EntityNetOut)par1Entity, par2, par4, par6, par8, par9); } } (based on render minecart code I think) So any help would be appreciated FIXED Thank You.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.