Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GotoLink

Members
  • Joined

  • Last visited

Everything posted by GotoLink

  1. 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) {}
  2. 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.
  3. mods/DeepStorageTanks/textures/blocks/ So, this is the expected folder. Obviously, itself in the src folder when in dev.
  4. When do you call this method ?
  5. Whenever ? Use a method in the Item class, or a TickHandler.
  6. 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); }
  7. The tutorial works. Read it again.
  8. If no meta-inf folder was here, you didn't run from an unmodified jar. Get an unmodified jar and redo the installation.
  9. 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.
  10. Seriously dude, read the tutorial. http://www.minecraftforge.net/wiki/Basic_Modding
  11. Did you replace public static FlintBase instance = new FlintBase(); with @Instance(FlintBase.modid) public static FlintBase instance; ?
  12. 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
  13. 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
  14. It is deprecated, ie changed for a better one.
  15. 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)
  16. @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.
  17. 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.
  18. 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.
  19. 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.
  20. @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.
  21. 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
  22. Sending a packet to other players when one player change the content of its slot.
  23. Build a new world generator, with a new dimension.
  24. 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.
  25. 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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.