Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by Atijaf

  1. Thanks! I made sure to only run it on server side. It's working now, but basically... I have a TileEntity that stores ItemStacks. The amount it stores can vary, so if the container is full and the amount it can store is decreased, it checks if it can place the items that it can no longer stored, can be placed into the player's inventory. If not, spawn EntityItem below player. Unfortunately, when in creative mode, it always says the player has inventory space, even when he doesn't. So yeah. Don't test in creative mode. haha. Thanks for the help!
  2. From inside a class that implements IInventory. The method is called on both Server and client. As for player.lastTickPos, I've noticed that sometimes "player.playerLocation" or "player.posX" is null.
  3. EntityItem droppedItem = new EntityItem(player.worldObj, player.lastTickPosX, player.lastTickPosY + 2, player.lastTickPosZ, stack.copy()); player.worldObj.spawnEntityInWorld(droppedItem); There is obviously something wrong with my code, because it isn't working. I'm just unable to find it... Any help will be great.
  4. haha, duhh! dang I can't believe I missed that. Thanks!
  5. I have a variable within my TileEntity that is used to determine which items are shown. This variable will be changed within the gui. GuiModTileEntity public class GuiModTileEntity extends GuiContainer{ private int tabX = 250; private int tabY = 220; public GuiModTileEntity(IInventory playerInv, ModTileEntity te) { super(new ContainerModTileEntity(playerInv, te)); this.xSize = 274; this.ySize = 224; } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { } /** THIS METHOD */ @Override protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) { //Set variable within ModTileEntity? } } How can I access the current tile entity that is activated, or should I go about it a different way?
  6. That was exactly what I needed. Thanks for the help once again!
  7. How can I go about making a scroll bar?
  8. What methods would help me within the TileEntity?
  9. I haven't got the exact idea down or what my "wasteland" idea is, so lets use a silly example. Lets say the world is really hot and I have air conditioning blocks. The closer you are to this ac block, the less hot you are. The further away you are, the more hot you are and the more chance you have of losing health. While that's not exactly how the player will see it, that is exactly what the code will be doing. (Kinda like your health could be the number of potatoes you have, and if you have 0 potatoes, you die... Idek hahaha!)
  10. Is there a way to efficiently check if a specific block is within the range of a player, without checking every block?. (Atleast 100 blocks)
  11. Strange. I thought I tried that... inventory.armorInventory[1-4] = null; Either way, it's working now. Thankyou!
  12. How can I remove, or destroy, armor from the player from within playerTickEvent?
  13. When Creating a new recipe, you get to choose the amount of the result; // This GameRegistry.addRecipe(new ItemStack(Blocks.stone, 10), new Object[] {"CCC","CCC","CC ", 'C', Blocks.cobblestone}); I want to retrieve the number 10 from within the even "ItemCraftedEvent", but have run into a wall. @SubscribeEvent public void onCraft(ItemCraftedEvent event){ int amount = event.crafting.stackSize;//This should return 10 right? Returns 0... Amount is 0 when it should be 10. Am I missing something?
  14. Thank you for the replies. I will probably create a wrapper class that holds the item, stack size(Maybe), and metadata and override hashcode.
  15. How would I put and obtain the values within hashmap. It always returns null? class 1 public static HashMap<ItemStack, Integer> Levels = new HashMap(200) ...//code ItemStack stack = new ItemStack(Blocks.stone); Levels.put(stack, 5) class2 ItemStack stack = new ItemStack(Blocks.stone); int requiredLevel = Levels.get(stack)//Is Null
  16. Oh man I feel dumb! Haha and btw, I really enjoy how you respond. With such horror:p. They're memorable. As for overriding absolutely everything, I gave that a thought, but then life happened.. Thanks for answering my questions. They solved my problem, as well as some of my ideas.
  17. So in the map, the key would be the crafting recipe I'm guessing. Why shouldn't I store the value in my customShapedRecipe? Here's the class, just in case you were wondering what exactly it is I'm doing. (It mostly copies ShapedOreRecipe) http://pastebin.com/NqyNydHM How I register the crafting recipe GameRegistry.addRecipe(new customShapedRecipe(new ItemStack(Blocks.stone, 1), new Object[] {"CCC","CCC","CCC", 'C', Blocks.cobblestone, Ints.asList(5, 1), Arrays.asList("WoodCutting", "Mining"), Arrays.asList("IronMan", "Daniel wasn't there")}));
  18. I'm open to suggestions.. I'm just not sure how to go about setting requirements for crafting recipes without setting a variable for each recipe.
  19. Upon crafting the item, the player gets crafting xp which depends on the level that is required to craft it. That level is stored as a member variable inside my customShapedRecipe class. I use ItemCraftedEvent to give the player xp when he crafts it.
  20. One more question! So in my class that extends ShapedOreRecipes, I have a member variable, named requiredLevel, that is assigned a value through a constructor. How would I later obtain this value? Better yet, how would I obtain this value through the event, "ItemCraftedEvent"? Thanks again for all the help
  21. I have a skill, named crafting skill (Imagine that), and every crafting recipe gives a said amount of xp.. I have all that working, so to the point. Is there a way to obtain if the player takes the item out of the crafting table and what that item is?
  22. This is just a guess, but you seem to be missing a parenthesis at the end of this bit of code GameRegistry.addRecipe(new ItemStack(test_block),new Object[]{"ddd","ddd","dd ",'d',Blocks.dirt});<-- Add this Let me know if that does anything.
  23. Thanks a bunch. I thought I'd have to make a class for each recipe, but nope! haha:) Great news. Thanks again!
  24. Where would I add the shaped recipe? Within the class that you showed an example of, or with GameRegistry?
  25. Would there be a way to add a shaped recipe?
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.