Jump to content

Leaderboard

Popular Content

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

  1. To my knowledge, you will have to do it yourself. BlockPos has a method (BlockPos#getAllInBox) to retrieve all the BlockPos within a rectangular prism, but not a sphere. In general, I would pull all the blocks with a cube with the player at the center and using your radius as half the side length. You can then filter out the unwanted blocks with a simple distance check (BlockPos#distanceSq). If you want to only get blocks with a certain properties, it might be a good call to use Google's Iterators#filter with the iterator returned from BlockPos and a custom predicate, which would filter for the distance as well as the block properties you want.
    1 point
  2. Yesterday was not my finest day
    1 point
  3. This line is completely unnecessary. You create a stack with a size of 1, and then check in case it's not 1..?
    1 point
  4. I'm working on a mod called MOAR STUFF. It adds stuff in general to Minecraft. I've added ench. emerald and obsidian armor, a grill, more weapons. Im planning to make a teleporter and a security camera. You know, just some useful nice stuff. What about you?
    1 point
  5. Couldn't you just register a custom IWorldEventListener in the World.Load event and do your logic in IWorldEventListener#notifyBlockUpdate? The method itself passes 2 block state parameters: the current block state and what the previous block state was. You can check if the old block was your custom block and the new block is fire, which would emulate your block "being consumed by fire". The only instance where this fails is if the block is set to fire by a command, but you could probably get around that by tracking the console/chat log (although that's a bit hacky, not 100% fool proof and not really clean). It's not perfect but probably as close as you can get without an official hook. Edit: Also probably a good idea to only register the listener on the server world.
    1 point
  6. "Next version" ha, that's funny. More like sixteen. But I had to do that to get the crop growth event I wanted.
    1 point
×
×
  • Create New...

Important Information

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