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

desht

Members
  • Content Count

    244
  • Joined

  • Last visited

  • Days Won

    13

Everything posted by desht

  1. But the OP wants to do this via the DecorateBiomeEvent.Post event, which is fired after the chunk has been generated. Gravel stays where it is during chunk generation because it's placed via a ChunkPrimer object, which is not affected by block physics in any way. Given that this is part of chunk generation, it sounds like some custom world gen might be a better option here? Making big terrain changes via the post event can't be good for chunk generation performance, and as the event name suggests, it's really intended for biome decoration, not terrain modification.
  2. When you call World#setBlockState() - or Chunk#setBlockState() - Block#onBlockAdded() is called for the block you've set, if the block has actually changed. BlockFalling#onBlockAdded() calls World#scheduleUpdate(), which leads eventually to BlockFalling#updateTick(), and that method will turn the block into an EntityFallingBlock (via BlockFalling#checkFallable) if the block isn't supported from beneath. So... it doesn't seem directly possible to spawn gravel/sand/anvils in the air and not have them fall, even if you don't see the block update flag, i.e. bitmask 1 in the flags argument to
  3. If the only reason for marking an update is to sync tile entity data to the client for rendering purposes, then worldObj.notifyBlockUpdate(pos, oldState, newState, flags) looks to be a better option. markAndNotifyBlock() works - it calls notifyBlockUpdate() - but it also notifies the block's neighbours of a blockstate change, and may cause some comparator recalculation - extra unnecessary server load if you're just syncing TE data.
  4. Yep, that did the trick. Thanks everyone! I now appear to have a fully functional camouflaged block
  5. Well, I got this pretty much working today, going with option (2) - I ended up registering a custom model (RouterModel) for each variant of my block, passing the uncamouflaged model as a parameter to my custom baked model. Then I can return either the camo model or the underlying (real) model based on the presence or absence of an unlisted property. The code's all on GH now: see in particular: https://github.com/desht/ModularRouters/blob/master/src/main/java/me/desht/modularrouters/proxy/ClientProxy.java#L31 https://github.com/desht/ModularRouters/blob/master/src/main/java/me/desht/mo
  6. I'm working through TheGreyGhost's dynamic models tutorial on GitHub right now: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe04_block_dynamic_block_model1 and getting it close to working, but there's one problem I can't quite get my head round, and most likely due to me not fully understanding how variants and model loading works. The background: I have an existing block with several blockstate properties which affect the block rendering. That's all working fine, and you can see the blockstate & model JSON at: https://githu
  7. Works nicely, thanks One very minor note: it's StateMap.Builder rather than StateMapBase.Builder .
  8. The background: I have a tile entity which can sometimes (depending on how it's configured by the player) be a redstone power provider, and sometimes (probably more commonly) not. When it's a power provider, I obviously want Block#canProvidePower() to return true. But when it isn't a power provider, I want that method to return false (having it return true messes up things like propagating a strong redstone signal). Now, canProvidePower() only takes an IBlockState parameter, so I don't have access to the tile entity to see if it's currently able to provide power. Therefore I figure
  9. Botania has some code to generate lightning bolt effects using the particle system. I'd recommend perusing that code (it's in the vazkii.botania.client.fx package), and refer to http://botaniamod.net/license.php if you want to use the code (the license is reasonably liberal).
  10. "is a chest"? You mean, you're directly extending TileEntityChest, or you're creating a tile entity with chest-like functionality? Have you looked at the code for TileEntityChest (note, it gets tricky because of double chests). You'll see that even vanilla chests implement getCapability() & hasCapability() for ITEM_HANDLER_CAPABILITY. But I think the short answer to your question is no: you don't need to implement any of those interfaces.
  11. If you don't expose an IItemHandler capability on any side, there will be no automated interaction with your TE's inventory (or inventories), but players can of course still interact via any GUI you choose to attach to it via a Container. What do you mean by "implement IItemHandler..." ? Your TE shouldn't be doing that at all; your TE should contain an object implementing IItemHandler (commonly just an ItemStackHandler) for each inventory it has, and, if it wants to make those available to other mods (and vanilla!), return those from getCapability(), like I do here: https://github.com/des
  12. I actually came up with this idea a few years back when I wrote Bukkit plugins (and implemented it in the Sensible Toolbox plugin). But then I quit Bukkit and didn't do much of any development until a couple of months ago, when I decided to have a play with Forge modding. So here it is: Modular Routers. The idea: one block (the Item Router) and a collection of modules and upgrades which can be installed in said router to manipulate items which pass through the router. The router has only a single-slot inventory, and any installed modules (up to 9) do something with the buffer - e.g. dr
  13. This had me confused for a while too, until I realised that in 1.9+, the player now has two usable hands... event.getHand() will be your friend here.
  14. Also remember that any IDE worth using will have a way of automatically adding an overridden method. For example, Ctrl-O in Intellij presents a list of overrideable methods, and will insert the correct method definition for you (along with an @Override annotation of course). I presume Eclipse has something similar. It's always worth using this when you're extending a base class.
  15. The scenario: I have a block (with a tile entity) which can output a redstone signal on each or any of its six sides; the redstone power level for each side depends in various ways on the contents of the tile entity's inventory: @Override public boolean canProvidePower(IBlockState state) { return true; } @Override public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { TileEntity te = blockAccess.getTileEntity(pos); if (te instanceof MyTileEntity) { return ((MyTileEntity) te).getRedstoneLevel(side); } else
  16. I know Quark does this - when you press 'B' to toggle the 1.10 auto-jump, it displays a little icon which fades after a couple of seconds. Probably worth looking at how Vazkii handles that.
  17. Hi, trying to figure out the correct & most efficient way to do this. If I have two arbitrary items (say one in a filter list, and one being checked against the filter), what's the correct way to check for oredict equivalence? From looking at the OreDictionary class, the only method which converts an ItemStack to anything is OreDictionary.getOreIDs() - can I use that on both stacks and check for an intersection of the ids in the two returned int[] arrays? I can't help feeling there's a better way, but I can't see it...
×
×
  • Create New...

Important Information

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