Jump to content

DarkGuardsman

Forge Modder
  • Posts

    1479
  • Joined

  • Last visited

Everything posted by DarkGuardsman

  1. I'm not using metadata for changing textures. I'm using it to change what the block does and its tileEntity. was actual about to just make my own custom render but was trying to avoid that. Though i could do some cool things with a custom model and render for the block. If i can't get this working using a normal block i'll try that . Also i've used that tut to make my steam pipes worked out well so far. Also i am using a variable stored in the tile entity which is resulting in a texture change. Just for some reason it changes the texture for all blocks of the same type and stores the same value. Now that i'm thinking of it i can store a value to change what the block does. Is there a way to add data to a tileEntity when you place it?
  2. Ya i noticed that but not sure how too change it much. I think no matter what i change this would always be the case since a player can only have one name tag.do you have any suggestions on how to get it working without conflict?
  3. It is a bash script, it auto-mods everything from a definition in the filesystem, launches the server, launches the client, done. The automodding is done every time, but not a big deal, with like 30 mods it takes like 5 seconds. That sounds simple but what do you mean by auotmodding? do you mean installing the mods and resetting the configs? I have mc and the server in special locations, mods in various numbered subdirectories, it then unzips/zips everything back up properly based on numbered priority (with a 'Rest' directory for no care, most things go in here), and when zipped up it copies it into the play directory, then starts it. That is very cool and very impressive. think you can upload that bat file of yours so i can understand it on the code level. I've never seen a bat file that does more than launch an application. Also did you write this bat file so that you can switch between mods based on the world?
  4. Didn't quite understand that but, how would i go by making it so it only changes the texture of one instance of the block.
  5. Meh, my MC is run in a certain setup that runs a server behind the client so even my single player worlds are run with server abilities (like other worlds keep working when I am not there), BTW does not support MP so I cannot use it. A new topic in the general discussion area might be good though, pictures would be interesting. Actually, let me split this topic and move that part over there. Could you tell us about your MC setup It is a bash script, it auto-mods everything from a definition in the filesystem, launches the server, launches the client, done. The automodding is done every time, but not a big deal, with like 30 mods it takes like 5 seconds. That sounds simple but what do you mean by auotmodding? do you mean installing the mods and resetting the configs?
  6. I did, the way the furnace does it is by using metadata to change facing direction. Since i plan to put 16 machines in this one block i cant do that. Right now i know ic2 and redpower use tileEntities to control the textures, but since i can't look at there code i don't know how they do it. They just lookup the TE in the callback and pass the arguments to it and return what it returns, simple. that's what i thought so i added a function in my tileentity and got it to return the facing side. It worked at first but then the blocks started to all change facing direction with each other. They textures rotate on placement so i know its at least storing and getting the facing direction. However, i think what happening is when i go to change the texture i do it for every block instead of just one.
  7. Since you use github could you explain how to use it. The guides i've read are not very helpful
  8. I did, the way the furnace does it is by using metadata to change facing direction. Since i plan to put 16 machines in this one block i cant do that. Right now i know ic2 and redpower use tileEntities to control the textures, but since i can't look at there code i don't know how they do it.
  9. Meh, my MC is run in a certain setup that runs a server behind the client so even my single player worlds are run with server abilities (like other worlds keep working when I am not there), BTW does not support MP so I cannot use it. A new topic in the general discussion area might be good though, pictures would be interesting. Actually, let me split this topic and move that part over there. Could you tell us about your MC setup
  10. After finishing some code up for one of my block i decided to change the face texture of the block during placement. I've got the texture switching on placement but its doing it for every single block. I'm also storing the facing direction in a tileEntity so it stays per block, but this doesn't help. I think what i'm doing wrong is changing the texture of the block which changes it for all block. Though i'm too tire right now to figure out how to correct it. So any suggestion on how to fix this would be helpful. BlockCode package net.minecraft.src.eui; import java.util.Random; import net.minecraft.src.*; 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) { // zero is bottom one is top int facing = TileEntityMachine.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; } /** * 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"; } } TileEntityMachine Code package net.minecraft.src.eui; import net.minecraft.src.*; import net.minecraft.src.ueapi.*; public class TileEntityMachine extends TileEntity { private static int facing = 0; public static int getFacingDireciton() { return facing; } public static void setFacingDireciton(int side) { 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"); } }
  11. does the sword item have a render class too it. Might have to add add render code to get it too show up.
  12. hmm i'll try that, Thank you.
  13. Cool, since i use forge then i don't have to worry about conserving Entity IDs You sure, when registering the tileEntity it wants an ID. Also how do you register the gui id i can't seem to find a tutorial on it. Though my gui's seem to be working.
  14. Ok, last question. Is there any mod that could serve as an example? (Preferably written with Forge) Even the smallest example could help there is a mod that does server side commands on this forum that is server side only. Another is my teams mod(click pic bellow) which is server side only too.
  15. set max damage i do believe has something too do with it.
  16. yes you can write server side only mods. you just have too tell the mod that no client side mod is required. However, you are limited too what you can do since most things require client side in order to show player's things.
  17. can the usePortal() functon be used to create teleportation points or is it just for switching worlds.
  18. I'm looking for a way to pass name, strings, words or urls too the client. I know i can send stuff using forge packet system but how do i send words not numbers?
  19. is this the same for entities and tileEntities?
  20. get bukkit is about the only current way but it would be nice to see a none bukkit area protection. Maybe someone could program a mod that is similar to area protection of spawn. Then instead of making it op only can build in the area switch it to player base. http://www.mcportcentral.co.za/index.php <- link to mod version of bukkit
  21. i have not found a way to get the directory in the same way but if you remove getting the directory part it seem to work just fine. I think you only need to get the directory is if the file your finding is not in the same file as the application.
  22. I recommend getting pistons plus it will give you pistons that can reach 4 blocks. Makes trap doors of any kind easy. Since you can just make a 3x3 slap and push it left to right. Other than that you have too do it the hard way of pull all but the center out wards. Then center will be pulled down and pulled sideways again by more pistons. Don't know how you didn't find tuts on it took me 3 secs
  23. i think so. just make it update the value every activation.
  24. no but when declaring the block's properties there is a setting for light level of the block. Too add the effect that the block is actual glowing just changed the texture on activation.
  25. I think it would be useful to everyone. Ever had a creeper take out your chest room, or dumped a clogged buildcraft pipe.. It can cause lag even on a high end computer. Also for a server it can cause even more lag sending the packet data to tell the player that the items are there.
×
×
  • Create New...

Important Information

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