Jump to content

yooksi

Members
  • Posts

    112
  • Joined

  • Last visited

Everything posted by yooksi

  1. Have you made absolutely sure that the positions on both client and server are identical? I recommend checking again with either a debugger or by printing out individual cords with a logger.
  2. Read this part and think about it: In the future consider using spoiler tags to hide the body of your log message. It makes the thread more readable.
  3. This will work if the position indeed needs to be corrected with an offset, otherwise remove that part. @Override // In Block 2 public boolean canPlaceBlockAt(World worldIn, BlockPos pos) { // Block block1 = new Block1(); if (worldIn.getBlockState(pos.offset(EnumFacing.DOWN)).getBlock().equals(block1)) { return true; } else return false; }
  4. I have a problem connected with custom item NBT updates and block breaking that I am trying to resolve. The custom item mentioned is a torch with it's own custom class and NBT values that are regularly updated twice every 20 ticks. The problem occurs when I try to break blocks with the torch selected. The moment the item runs an NBT update the break progress is stopped with an Action.ABORT_DESTROY_BLOCK action. My plan to solve this is to create a static map which would contain ItemStack references and boolean flags that would return true while the block is being mined with the belonging item, try to catch the block breaking event and raise these flags, and finally either stop updating until the flags are false or update to a local container somewhere and copy to NBT later. I've tracked down the cause of the problem (check down for more info), however I would like to know if there is a more elegant solution then the one I have in mind. The mentioned solution requires a lot of work around and I would rather avoid it if possible. Here's an open issue on GitHub with additional information: https://github.com/yooksi/FierySouls/issues/5 Thank you in advance!
  5. Can you link the issue on GitHub here? Might be easier to find out what was the problem like this for the rest of us.
  6. You're welcome, have fun and keep learning.
  7. The reasons you would like to use nested static classes are explained here: http://stackoverflow.com/a/253521
  8. What version of Eclipse are you running? If the problem is exclusive to your IDE then perhaps this might be of some assistance: http://stackoverflow.com/questions/13436337/eclipse-juno-no-debug-toolbar Have you properly setup Forge by setting up both your dev environment and configuring it for eclipse?
  9. I've recently written some code that was dependent on detecting ItemBlocks being used trying to activate a block. This is not a problem on Forge 1.8-11.14. It's quite possible this is a genuine bug for 1.8.8. You should consider opening an issue on GitHub.
  10. Thank you for providing very useful information on this subject! I've been struggling a long time trying to properly remove recipes. After reading what you guys wrote here (especially Draco18s) I've finally managed to understand the problem I've been facing. I failed to account for the element movement in the list after we remove something thus I kept using the wrong index. This is what I've written so far, do you guys think this can be written any more elegant? private static int removeRecipe(Item toRemove) { int recipesRemoved = 0; List<IRecipe> recipeList = CraftingManager.getInstance().getRecipeList(); // Iterate through the recipe list and find the recipes we're looking for. // Search using iterators instead of manual indexing to increase reliability. java.util.Iterator<IRecipe> recipeEntry = recipeList.iterator(); while (recipeEntry.hasNext()) { ItemStack outputItem = recipeEntry.next().getRecipeOutput(); if (outputItem != null && outputItem.getItem() == toRemove) { recipeEntry.remove(); recipesRemoved++; } } return recipesRemoved; } Edit: improved the code a bit.
×
×
  • Create New...

Important Information

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