Jump to content

DarkGuardsman

Forge Modder
  • Posts

    1479
  • Joined

  • Last visited

Everything posted by DarkGuardsman

  1. door are two blocks as well they just move with each other and act as one thing. I know this because i have cheated in the bottom half of the door to make short doors. also good too see your changing your missile launcher too not be one block. In real life they would be 8 - 10 stores tall and buried under ground. Maybe you should think of animating the missile to appear above your block instead of just being in a slot. Would look really cool
  2. ty but, that is the same as counting the ticks on each update. I'm looking to see if there is another way that simply tells minecraft not even to think of updating the tileEntity til x time has passed. I'm trying to get it so the entire tileEntity will not update a single part of itself time x time has passed. counting ticks would cause an if statement in almost every part of my code to insure it everything is timed.
  3. maybe a nub question but how would i change the tick update of a tileEntity. change it so my TileEntitiy only does an update every 20 - 60 ticks rather than every tick. Also without doing a counter than simply delays the update til the tick time has passed.
  4. 3 blocks tall what are you working on today . but anyways i've had issues with this when i started working on my addon and i'm not sure how to correct it other than custom models or Entities. What you could do is have 3 separate blocks that appear when you place the first one. Similar to how a bed works when placed, its actual formed from two different blocks.
  5. i'm interested in your code if you like to share some of it. Been looking for a way to download texture for my NPC so servers can descide what texture the NPCs have.
  6. very nice ideal, would love too see something like this. Even though i can reprogram my own NPC guards sometimes i wish i could give each on different AI code. Like guard A gets patrol AI code but guard B get Stand ground AI code.
  7. i install optifine after installing forge and it works just fine for me.
  8. might try to reinstall everything in a correct order. Usual modloader is the first things installed, forge the second and then anything else that goes in your jar. Also might want to check if those mods you installed use the same files as forge or even need to be installed in the jar.
  9. Though forge had something for this. Saw this in the player render class might lead you too something. 179 IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var3, EQUIPPED);
  10. original i was looking for a way to remove conflict with the fact my mod ComeCloser would conflict with anything that effected player render. The mod does the simplest thing and change the range at which name tags render for the player. So say you 10 blocks from me your name would show above your head in game for me. My mod changes this so at 10 blocks i can't see your name tag but at 8 i can. I was also looking to hook into this for other conditions say your in water the range is even less. Or if i use a smoke grenade it reduces to almost zero. Also for another mod i'm working on i want to add a team name before or under the player's name without conflicting with my other mod or another mod.
  11. ahh this is an easy one just change the names in the item as well. public String getItemNameIS(ItemStack itemstack) { switch(itemstack.getItemDamage()) { case 0: return "Skeleton2"; case 1: return "RedArcher"; case 2: return "BlueArcher"; case 3: return "EmptyItem"; case 4: return "RedGuard"; case 5: return "BlueGuard"; case 6: return "Red3"; case 7: return "Blue3"; case 8: return "Red4"; case 9: return "Blue4"; case 10: return "RedMage"; case 11: return "BlueMage"; } return "Blank"; } Also might want to try this with it ModLoader.addName(new ItemStack(CardSpawn, 1, 0), "Skeleton2");
  12. there is a method that is called something along the lines of needsUpdate() that needs to return true here some things i found that might help public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {} protected Block setLightOpacity(int par1) { lightOpacity[this.blockID] = par1; return this; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } private Set blocksNeedingUpdate = new HashSet(); his.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4));
  13. i've noticed a lot of mods have issues with lighting. Have you tried to change the render type and render pass of the block. Also try making the block act like glass and let light pass threw it.
  14. i don't think so but you could just get the blocks meta data using IBlockAccess.getBlockMetadata(x, y, z); or something similar.
  15. interesting if you manage too get this working 100% i can stop using bukkit since my only reason for using it is the protection. The rest of the plugins i use can be recreated easily.
  16. Easy, I remove a few vanilla recipes in my mod as I move them to other things. This can be done without changing the workbench's recipe code?
  17. hmm its hiding in one of the class but something there updates the bar correctly. i'll take a look for you later after i'm done updating my server
  18. I changed my code to setBlockMetadataWithNotify . The texture still doesn't update unless there is a block change nearby. EDIT: I figured it out. I need to set this: this.setRequiresSelfNotify(); EDIT 2: OK I have another problem now. I decided NOT to use metadata to save the direction and to use the tile entity instead. After the change, the texture of the block will not change or update unless a block besides it changes. Same problem. I tried cheating by setting the block metadata into the same metadata but it doesn't work. have you tried to call the getTexture method when changing direction. Not sure if it will work but its worth a try. Also try set block needs updating similar to how redstone wire calls for updating.
  19. I could code an anvil up but since the workbench does all the metal crafting i don't see the point. Unless someone knows how to remove the crafting recipes from the workbench without changing its code.
  20. the item class has something for updating the item per tick. The compass also updates it's graphics every tick to show the correct direction. Possible look at it to find out how to cause the bar to update.
  21. yes your are right but i spent a week figuring this out. Even though i like it when people learn, sometimes it help if they have something too start with. Then they can learn when they go to edit the code i have up there to meet there needs. Similar to how i started, i copied and pasted code for the few things i did. Then i started to change how it worked too meet my needs. After that i was deep into figuring things out myself, with a few post like this when i got stuck. With a little bit of using what i figured out and i usual get how to code it each time. Reading that just made me release if i use your wrench from the base mod How do i rotate my machines. Would i just make a method that gets the item the player is right clicking with? and then do the rotations stuff.
  22. duo, i fill stupid missed this public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { return this.getBlockTextureFromSideAndMetadata(par5, par1IBlockAccess.getBlockMetadata(par2, par3, par4)); } started scanning threw the block.class as i was think what you meant and found it. Should help me get this working now that i can get the xyz. Thank you again for help me and not doing it for me. Edit: had to do a little more but that was basically it once i moved the texture code back into the block class. Spent 10 mins correcting the directions when place and i am done. Here is a simply version of my code for the next person who needs it. TileEntity***.class public class TileEntity*** extends TileEntity { private int facing; public int getFacingDireciton() { return this.facing; } public void setFacingDireciton(int side) { this.facing = side; } public void writeToNBT(NBTTagCompound par1NBTTagCompound) { super.writeToNBT(par1NBTTagCompound); par1NBTTagCompound.setInteger("facing", (int)this.facing); } public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); this.facing = par1NBTTagCompound.getInteger("facing"); } } and Block***.class public block extends Block { //normal block code snipped public int getBlockTexture(IBlockAccess par1IBlockAccess, int x, int y, int z, int side) { TileEntity blockEntity = par1IBlockAccess.getBlockTileEntity(x, y, z); int meta = par1IBlockAccess.getBlockMetadata(x, y, z); if(side == 1) { switch(meta) { case 0: return #; default: return #; } } if(side == ((TileEntity***)blockEntity).getFacingDireciton()) { switch(meta) { case 0: return #; default: return #; } } return #; } public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; TileEntity blockEntity = (TileEntity) par1World.getBlockTileEntity(par2, par3, par4); //0-4 are directions the player is facing on the compass, though i don't know which is which, but trial and error got me the write answers if (var6 == 0) { ((TileEntity***)blockEntity).setFacingDireciton(2); } if (var6 == 1) { ((TileEntity***)blockEntity).setFacingDireciton(5); } if (var6 == 2) { ((TileEntity***)blockEntity).setFacingDireciton(3); } if (var6 == 3) { ((TileEntity***)blockEntity).setFacingDireciton(4); } } } public TileEntity getBlockEntity(int meta) { switch(meta) { case 0: return new TileEntity***(); } return null; } This code should work
  23. here is my current tileEntityMachine code package net.minecraft.src.eui; import net.minecraft.src.*; import net.minecraft.src.ueapi.*; public class TileEntityMachine extends TileEntity { private int facing = 0; public int getFacingDireciton() { return this.facing; } public void setFacingDireciton(int side) { this.facing = side; } public void writeToNBT(NBTTagCompound par1NBTTagCompound) { super.writeToNBT(par1NBTTagCompound); par1NBTTagCompound.setInteger("facing", (int)this.facing); } public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); this.facing = par1NBTTagCompound.getInteger("facing"); } public int getBlockTexture(int side, int meta) { // zero is bottom one is top int facing = this.getFacingDireciton(); switch(meta) { case 0: if(side == 1) { return 6; } if(side == 0) { return 5; } if(side == facing) { return 2; } else { return 1; } } return meta; } } I'm trying to recode the block code right now but can't seem to get it's xyz coords inorder to get the tileEntity at its location. it hasn't changed much but i moving some of the texture code inside the tileEntity package net.minecraft.src.eui; import java.util.Random; import net.minecraft.src.*; import net.minecraft.src.IBlockAccess; import net.minecraft.src.eui.grinder.GuiGrinder; import net.minecraft.src.eui.grinder.TileEntityGrinder; import net.minecraft.src.forge.*; public class BlockMachine extends BlockContainer implements ITextureProvider { private Random furnaceRand = new Random(); private static boolean keepFurnaceInventory = true; public BlockMachine(int par1) { super(par1, Material.iron); } public int idDropped(int par1, Random par2Random, int par3) { return this.blockID; } public int getBlockTextureFromSideAndMetadata(int side, int meta) { TileEntity blockEntity = (TileEntity)World.getBlockTileEntity(, par3, par4); //error here since i can't get par2, par3 and par4 inside this method return ((TileEntityMachine) blockEntity).getBlockTexture(side,meta); } /** * Called upon block activation (left or right click on the block.). The three integers represent x,y,z of the * block. */ public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { if (par1World.isRemote) { return true; } else { TileEntity blockEntity = (TileEntity)par1World.getBlockTileEntity(par2, par3, par4); if (blockEntity != null) { if(blockEntity instanceof TileEntityGrinder) { TileEntity var6 = (TileEntityGrinder)par1World.getBlockTileEntity(par2, par3, par4); ModLoader.openGUI(par5EntityPlayer, new GuiGrinder(par5EntityPlayer.inventory, (TileEntityGrinder) var6 )); ; } } return true; } } @Override public TileEntity getBlockEntity(int meta) { switch(meta) { case 0: return new TileEntityGrinder(); } return null; } /** * Called when the block is placed in the world. */ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; TileEntityMachine blockEntity = (TileEntityMachine) par1World.getBlockTileEntity(par2, par3, par4); if (var6 == 0) { blockEntity.setFacingDireciton(2); } if (var6 == 1) { blockEntity.setFacingDireciton(3); } if (var6 == 2) { blockEntity.setFacingDireciton(4); } if (var6 == 3) { blockEntity.setFacingDireciton(5); } } /** * Called whenever the block is removed. */ public void onBlockRemoval(World par1World, int par2, int par3, int par4) { if (!keepFurnaceInventory) { TileEntityGrinder var5 = (TileEntityGrinder)par1World.getBlockTileEntity(par2, par3, par4); if (var5 != null) { for (int var6 = 0; var6 < var5.getSizeInventory(); ++var6) { ItemStack var7 = var5.getStackInSlot(var6); if (var7 != null) { float var8 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; float var9 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; float var10 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; while (var7.stackSize > 0) { int var11 = this.furnaceRand.nextInt(21) + 10; if (var11 > var7.stackSize) { var11 = var7.stackSize; } var7.stackSize -= var11; EntityItem var12 = new EntityItem(par1World, (double)((float)par2 + var8), (double)((float)par3 + var9), (double)((float)par4 + var10), new ItemStack(var7.itemID, var11, var7.getItemDamage())); if (var7.hasTagCompound()) { var12.item.setTagCompound((NBTTagCompound)var7.getTagCompound().copy()); } float var13 = 0.05F; var12.motionX = (double)((float)this.furnaceRand.nextGaussian() * var13); var12.motionY = (double)((float)this.furnaceRand.nextGaussian() * var13 + 0.2F); var12.motionZ = (double)((float)this.furnaceRand.nextGaussian() * var13); par1World.spawnEntityInWorld(var12); } } } } } super.onBlockRemoval(par1World, par2, par3, par4); } @Override public TileEntity getBlockEntity() { // TODO Auto-generated method stub return null; } @Override public String getTextureFile() { // TODO Auto-generated method stub return "/eui/blocks.png"; } }
  24. lol miss read bash as bat. I'm running windows 7 but i do have multi copies of Linux in a cd case. Though i've never run minecraft on a Linux and don't have much experience with linux. Sound like it will be a nice learning experience in my free time.
×
×
  • Create New...

Important Information

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