Jump to content

GotoLink

Members
  • Posts

    2012
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by GotoLink

  1. I would use GuiOpenEvent to replace the Gui with the right one when you want.
  2. IEntityAdditionalSpawnData that would help syncing the things at spawn time.
  3. //first, we parasitically use the first player in the world list. //(change this later) World world=Minecraft.getMinecraft().theWorld; You need to change that now. It is client-side only, while placing blocks is server side.
  4. Save the thing. Redoing the calculation would be a waste of computing power, since you can't be sure the memory is freed every time you remove the reference in Java.
  5. Put the counter in the entity onUpdate(). Put a default constructor with World as parameter. Use the keyhandler to send a packet to server side to start the entity counter. You'll need a way to link the entity with a player...maybe his username when the entity is spawned ?
  6. Look into ForgeHooks. By the way, shears are not tools (meaning, ItemShears only extend Item, not ItemTool), so they aren't registered as a tool class. I'd recommend making your block implement IShearable, that is an easier way to achieve what you want.
  7. That code is called when the player is attacked, not the other way around. Use AttackEntityEvent for that.
  8. No, by using the item instance. Item#itemID
  9. //In EntityPlayer public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { if (ForgeHooks.onLivingAttack(this, par1DamageSource, par2)) return false; //some intermediate code return super.attackEntityFrom(par1DamageSource, par2); } } } } //In EntityLivingBase public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { if (ForgeHooks.onLivingAttack(this, par1DamageSource, par2)) return false; Sounds redundant, huh ? Well actually, there is no difference between these too, when considering EntityPlayer. They both call LivingAttackEvent, and further processing is cancel when the event is. Except the first one is called sooner, even if player is immune or damage is 0. Does it matter ? I don't think so.
  10. System.out.println("Ore Spawned Succesfully"); Did that print ? If not, you may want to check your generator registration.
  11. Configuration(File)#getItem(String...)#getInt()
  12. If you don't want slots, you don't need a container. Register a IGuiHandler with NetworkRegistry.registerGuiHandler, then return an instance of a GuiScreen in getClientGuiElement, that is enough.
  13. If that wasn't clear, I am suggesting to make a custom WorldChunkManager which overrides getBiomesForGeneration. Since OP was talking about "his world", it would make sense to change this part of the world generation.
  14. if(stack0!=null) { if(stack0.stackSize--<=0) tileEntityGrinder.setInventorySlotContents(0,null); This is really common code, you know.
  15. I'd go with the general process of any computer work: -Learn a bit -Think a bit -Try a bit -Repeat forever (or until satisfied)
  16. I'd recommend: try{ Field field = SoundSystem.class.getDeclaredField("soundLibrary"); field.setAccessible(true); Library soundLibrary = Library.class.cast(field.get(classMainEventHandler.soundManager.sndSystem)); }catch(Exception e){ }
  17. public class Blocks { public static Block block; You have only one reference of Block in your Blocks class.
  18. You should call super.onUpdate()
  19. You don't touch the BiomeGenBase, that would remove biomes for all worlds. I'd recommend you to look into WorldChunkManager#getBiomesForGeneration.
  20. You could do something like this in your TileEntity: private boolean mark = true; private String[] players = new String[2]; public boolean getNextMark(){//returns a boolean opposite each time, equivalent to 0 or X mark = !mark; return mark; } public boolean isNextPlayer(EntityPlayer player){//check that a player can play this game, on this turn return player.username.equals(players[mark?0:1]); } public boolean setPlayer(EntityPlayer player){//sets a player, return true if it was added to the game if(players[0]==null){ players[0] = player.username; return true; }else if(players[1]==null){ players[1] = player.username; return true; } return false; }
  21. You are not keeping track of the game at all. You are not saving anything to the NBT methods.
  22. Do you want it to be completely random, or rely on types (like horses ?).
  23. boundingBox is set by Entity#setSize(...). I assume you don't want your grenade to be bigger, so I'd recommend using AxisAlignedBB#expand(double,double,double) on boundingBox. By the way, EntityPlayer is not an EntityLiving in recent Minecraft versions, you may want to check for EntityLivingBase instead. You will probably need a counter too, to avoid the grenade exploding in the player hands.
  24. A...resource pack ?
  25. I don't understand why you used an Item and an Entity. You can place the blocks themselves, and they already contain the TileEntity. My advice: Merge the entity-placing-blocks code into the "item use" method, then move that content into the "block placed" method, finally delete everything about the item and the entity. The TileEntity should store everything related to the play. Not optimal, but better. Then you could improve the thing by using only one TileEntity, for example in the middle block. With two block states based on metadata, only one having the TileEntity. (do not use BlockContainer, prefer hasTileEntity(metadata)...) The "block placed" method would check around for other similar blocks, and set the middle block to the state with a TileEntity, when the board is complete. The "block activated" method would check around for a block with the tileentity, and write to it.
×
×
  • Create New...

Important Information

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