Everything posted by GotoLink
- 
	
		
		Help with telling if a swing is in progress
		
		You should try again "Find call hierarchy". This method is called when an item is left clicked on the given entity. As the comment says, this is called just before EntityLivingAttackEvent. Prefer: public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {}
 - 
	
		
		Crafting recipe error when using custom items
		
		cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:239) mod.tdm.TdmBase.load(TdmBase.java:34) Error at line 34 of TdmBase.java, in the load method, at GameRegistry.addRecipe(args) you are giving a null.
 - 
	
		
		[Solved] Trouble getting textures onto my block.
		
		mods/DeepStorageTanks/textures/blocks/ So, this is the expected folder. Obviously, itself in the src folder when in dev.
 - 
	
		
		[1.6.2] PlayerTick on other player
		
		When do you call this method ?
 - 
	
		
		Help with telling if a swing is in progress
		
		Whenever ? Use a method in the Item class, or a TickHandler.
 - 
	
		
		How to preserve TileEntity info when a block is picked up?
		
		Use the item values to change the tileentity state. Something like: onItemUse(world, itemstack,x,y,z...) { data = getData(itemstack.getTagCompound()); (MyTileEntity)world.getBlockTileEntity(x,y,z).changeState(data); }
 - 
	
		
		My mod is not work for minecraft
		
		The tutorial works. Read it again.
 - 
	
		
		1.6.2 crashed after installing forge
		
		If no meta-inf folder was here, you didn't run from an unmodified jar. Get an unmodified jar and redo the installation.
 - 
	
		
		Vanilla saplings on custom dirt
		
		Look at public boolean canSustainPlant(World world, int x, int y, int z, ForgeDirection direction, IPlantable plant) in Block. Override in your dirt block if needed.
 - 
	
		
		My mod is not work for minecraft
		
		Seriously dude, read the tutorial. http://www.minecraftforge.net/wiki/Basic_Modding
 - 
	
		
		calling Id of block or item
		
		Did you replace public static FlintBase instance = new FlintBase(); with @Instance(FlintBase.modid) public static FlintBase instance; ?
 - 
	
		
		calling Id of block or item
		
		flintshovel = new ItemFlintShovel(flintshovelid).setUnlocalizedName("flintshovel"); //this line is a reference i take in your class file, it uses flintshovelid, which is a field declared (static int flintshovelid;) at the beginning, this is good int flintshovelid; //this line is below, doesn't do anything and conflict with the field, this is bad ->remove Now you can use flintshovel.itemID, after this line, it won't be null or 0. From an external class: FlintBase.instance.flintshovel.itemID
 - 
	
		
		How to create an instance to hook into a variable from another class
		
		Only because you tested on your own server. When you are the server owner, obviously, both client and server classes will share static fields because they are on the same computer. This isn't magic, only JVM at work
 - 
	
		
		TileEntity unbinds from block so NBTTag is worthless
		
		It is deprecated, ie changed for a better one.
 - 
	
		
		[New Question] [1.5.2] Sand that Falls Up
		
		There also is a possibility to override from the parent class (BlockSand). public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (!par1World.isRemote) { this.tryToFall(par1World, par2, par3, par4); } } since this is the only call to tryToFall(args)
 - 
	
		
		Help with telling if a swing is in progress
		
		@ForgeSubscribe public boolean onEntitySwing(LivingAttackEvent event) { This is correct event use, congrats Now, read the LivingAttackEvent class. This class contains a few (non static ) fields. Use them with the "event" argument. If you have Eclipse, you can also use "Find call hierarchy" with a right click on the event constructor (in LivingAttackEvent), to see where the event comes from, and what each field contains.
 - 
	
		
		calling Id of block or item
		
		flintshovel = new ItemFlintShovel(flintshovelid).setUnlocalizedName("flintshovel"); int flintshovelid; Remove the variable declaration line, this might confuse with the field. Basic Java: public static FlintBase instance = new FlintBase(); means you are creating an object which is a new FlintBase(). You don't need to do this with Forge. @Instance(FlintBase.modid) public static FlintBase instance; is recommended. "instance" field will be populated by the API.
 - 
	
		
		Help with telling if a swing is in progress
		
		Basic Java: With a static call, you use a static field or static method. Foo.staticMethod(); is a static call, because Foo is the class, not an instance. public class Foo{ public boolean init= false; public Foo() { init=true; } public static void staticMethod() { System.out.println("Hello world"); } public boolean void nonStaticMethod() { return this.init; } } To use nonStaticMethod(), you need an instance of Foo. Foo instance = new Foo();//this is creating a new instance, instance.nonStaticMethod(); In your case you have to get your instance from somewhere... A method with @ForgeSubscribe needs one of the Event class as argument.
 - 
	
		
		How to create an instance to hook into a variable from another class
		
		Well if you hardcoded the key check into the entity, the only person able to drive the entity will be the server owner. Entities should be affected by the packets, not the other way around. Just make the value non static, seriously. It can't make a difference on the way it is sent.
 - 
	
		
		GUI Phantom Item, GUI Shift-Click and TileEntity Redstone Strength
		
		@Override public void updateEntity() { ticks++; if (ticks == 20) { ticks = 0; //ModLoader.getMinecraftInstance().thePlayer.addChatMessage(blockspushed + "/" + redstonestrength); if (blockspushed < redstonestrength) { switch(worldObj.getBlockMetadata(xCoord, yCoord, zCoord)) { case 1: nextplaceblock = PlaceBlockValid(xCoord, yCoord, zCoord - blockspushed); break; case 2: nextplaceblock = PlaceBlockValid(xCoord, yCoord, zCoord + blockspushed); break; case 3: nextplaceblock = PlaceBlockValid(xCoord - blockspushed, yCoord, zCoord); break; case 4: nextplaceblock = PlaceBlockValid(xCoord + blockspushed, yCoord, zCoord); break; } if (nextplaceblock) { blockspushed++; nextplaceblock=false; } } else if(blockspushed > redstonestrength) { switch(worldObj.getBlockMetadata(xCoord, yCoord, zCoord)) { case 1: nextremoveblock = RemoveBlockValid(xCoord, yCoord, zCoord + blockspushed); break; case 2: nextremoveblock = RemoveBlockValid(xCoord, yCoord, zCoord - blockspushed); break; case 3: nextremoveblock = RemoveBlockValid(xCoord - blockspushed, yCoord, zCoord); break; case 4: nextremoveblock = RemoveBlockValid(xCoord + blockspushed, yCoord, zCoord); break; } if (nextremoveblock) { blockspushed--; nextremoveblock = false; } } } } Something like this.
 - 
	
		
		[New Question] [1.5.2] Sand that Falls Up
		
		This is due to one of the basics of Java. You can't override a private method. private void tryToFall(World par1World, int par2, int par3, int par4) This method in your block will never be called, since it is the one in BlockSand that is declared first. Solution: don't extend BlockSand
 - 
	
		
		Getting another players inventory smp
		
		Sending a packet to other players when one player change the content of its slot.
 - 
	
		
		using Biome "decorator" to replace all blocks of a certain type?
		
		Build a new world generator, with a new dimension.
 - 
	
		
		HashMap seems to not be recording data
		
		Man, you couldn't use a Map<EntityPlayer,String> directly ? You are holding SupernaturalPlayerHandler objects all over the place... By the way, containsKey(obj) is known to behave differently depending on equals(obj) and hashcode implementations in the object. Considering you are dealing with player objects, using get and handling null cases would be easier.
 - 
	
		
		collisions are weird with custom block model
		
		I'd recommend searching where the player walking is handled. You might want to add this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); in your block constructor, since they are at least half blocks Overriding public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) may be worth a shot.
 
IPS spam blocked by CleanTalk.