Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/29/17 in all areas

  1. Ah! I know what it is. Your TE changes your blockstate when it gets an output item. Changing the block state results in the TE itself being deleted and recreated. You need to override...shouldRefresh in your TileEntity like so.
    1 point
  2. If you want, you can take a look at how I accomplished this. https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/util/RecipesUtils.java#L85
    1 point
  3. You can't compare ItemStacks using Object#equals, you need to use one of the static equality methods in the ItemStack class. You shouldn't be creating a new ItemStack at all, though. You need to get the ItemStack key from the Iterator and check its Item, metadata and NBT as appropriate to determine whether it should be removed. Iterator<E> is a generic type, don't use it (or any other generic type) without specifying its type argument.
    1 point
  4. Calling Map#remove with a new ItemStack on a Map with ItemStack keys won't do anything. ItemStack doesn't override Object#equals or Object#hashCode, so two ItemStacks are only considered to be the same key if they're the same object. Map#remove will only work here if you call it with an ItemStack object that's already a key in the Map.
    1 point
  5. get the EntrySet of the furnaceRecipes. get the iterator. while(iterator.hasNext) get the iterator item if item.value is stone iterator.remove easy.
    1 point
  6. You would need to write that code yourself. There is no way to tell vanilla to highlight a block, even if vanilla has code that does it. You need to recreate it yourself, in your own code, and invoke your own code. That, however, still leaves you the problem of displaying it as debug output which you can't, because your code will say "draw these blocks" then "delete all these blocks" and both of those will execute before any render code gets done to actually draw the highlight. The blocks are already gone.
    1 point
  7. That is the event that deals with drawing the wireframe around the block the player is looking at. That doesn't do what you want, not in the way you think.
    1 point
  8. Ok simple explanation, however I don't know if it's still needed. Every Log that is beeing broken informs all leaves in a specific range of this, the Leaves check then if there are any other Logs in range that can maintain them. If not its decay tag will be changed to true, this means you can simply check for leaves having their decay tag set to true.
    1 point
  9. I don't think this is currently possible using the vanilla passive spawning system. When WorldEntitySpawner#findChunksForSpawning tries to spawn an entity, it calls WorldServer#canCreatureTypeSpawnHere and WorldEntitySpawner#canCreatureTypeSpawnAtLocation and only proceeds if they both return true. You can use WorldEvent.PotentialSpawns to change the result of the former, but the latter is hardcoded to check for water if the entity uses EntityLiving.SpawnPlacementType.IN_WATER and call Block#canCreatureSpawn (which calls (Block#isSideSolid with EnumFacing.UP) for any other EntityLiving.SpawnPlacementType. Lava isn't water or a solid block, so entities won't be spawned in it. I think Forge would need to add an event in WorldEntitySpawner#canCreatureTypeSpawnAtLocation to allow the result of the method to be changed.
    1 point
×
×
  • Create New...

Important Information

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