Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. But you don't need a LanguageRegistry at all ;_;
  2. /assets are not moved into /reobf, you have to do that yourself.
  3. Yes. I'm doing it with a 1.6.2 mod. It's standard BBCode. [i ], [b ], etc. Only without a space. There's also a toolbar if you do a full reply instead of a quick reply.
  4. Personally I do registration right in my mod's main class file. Keep the static references there too (though I experimented with each block/item holding its own reference, as I'd seen someone else do, but I decided that there was no advantage to that). Did make my main class extremely large, but as things are broken out into sections (config, instanciation, registration, recipes) it's not difficult to navigate. As for the LanguageRegistry, don't use it. It's much much better to use language files. You just create a text file called en_US.lang inside your /assets/lang directory. Then add translations like so: this.to.translate=translate this Bam. Done.
  5. Take a look at what I did here https://github.com/Draco18s/Decaying-World/blob/master/draco18s/decay/blocks/HealthFence.java
  6. public boolean interact(EntityPlayer player)?
  7. What? Thats a thing...wow.. i feel dumb....ive never had that problem. Ill change them to well below that then i suppose then give it a shot. Thank you Item IDs are shifted by 255 to avoid conflicts with (originally) vanilla blocks.
  8. @Override { return false; } @Override public boolean renderAsNormalBlock() { return false; } People will still bump into it and you will still be able to highlight it with the reticule. If you want something that is truly not-there, take a look at this class: https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/block/BlockLight.java
  9. This is both really easy to do and really difficult, due to edge cases and weirdness the player can do if you're not careful. Namely if someone places this light block on top of another one. Here's some code I have that will steal the texture for the next not-this block in an orthogonal direction (that is, it looks for a not itself block in a direction until it hits air, if it finds air it tries another direction, if it fails it uses grass). Its not the greatest code, but it works. public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) { //int mymeta = world.getBlockMetadata(x, y, z); //if(mymeta == 0) { int[] id = {world.getBlockId(x, y-1, z),world.getBlockId(x-1, y, z),world.getBlockId(x+1, y, z),world.getBlockId(x, y, z-1),world.getBlockId(x, y, z+1),world.getBlockId(x, y+1, z)}; int[] meta = {world.getBlockMetadata(x, y-1, z),world.getBlockMetadata(x-1, y, z),world.getBlockMetadata(x+1, y, z),world.getBlockMetadata(x, y, z-1),world.getBlockMetadata(x, y, z+1),world.getBlockMetadata(x, y+1, z)}; //.get.getBlockTextureFromSideAndMetadata(par5, par1IBlockAccess.getBlockMetadata(par2, par3, par4)); for(int i = 0; i < id.length; i++) { Block block = Block.blocksList[id[i]]; if(block != null) { if(block != this && block.isOpaqueCube()) { Icon icon = block.getIcon(side, meta[i]); if(icon != null) { return icon; } } else if(block == this) { Icon icon = Block.grass.getBlockTextureFromSide(1); switch(i) { case 0: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x, y-1, z, side, 0); break; case 1: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x-1, y, z, side, 2); break; case 2: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x+1, y, z, side, 3); break; case 3: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x, y, z-1, side, 4); break; case 4: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x, y, z+1, side, 5); break; case 5: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x, y+1, z, side, 1); break; } if(icon != null && icon != Block.grass.getBlockTextureFromSide(1)) { return icon; } } } } return Block.grass.getBlockTextureFromSide(1); /*} else { return blockIcon; }*/ } public Icon getBlockTextureDirectional(IBlockAccess world, int x, int y, int z, int side, int direction) { int id = world.getBlockId(x, y, z); int meta = world.getBlockMetadata(x, y, z); Block block = Block.blocksList[id]; if(block != null) { if(block != this) { Icon icon = block.getIcon(side, meta); if(icon != null) { return icon; } } else { Icon icon = Block.grass.getBlockTextureFromSide(1); switch(direction) { case 0: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x, y-1, z, side, 0); break; case 1: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x, y+1, z, side, 1); break; case 2: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x-1, y, z, side, 2); break; case 3: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x+1, y, z, side, 3); break; case 4: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x, y, z-1, side, 4); break; case 5: icon = ((BlockIllusionary)block).getBlockTextureDirectional(world, x, y, z+1, side, 5); break; } return icon; } } return Block.grass.getBlockTextureFromSide(1); } The cast to BlockIllusionary will need to be replaced with a cast to your block type. (Bad intenting due to copy/paste from github, original here: https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/block/BlockIllusionary.java )
  10. Packets aren't that bad. There are some tutorials out there, and while it takes some getting used to, it's basically "write this data, now send the packet" and "oh I got a packet, lets read the data." It's always best practice to write an integer to your packets first, indicating how the packet handler should proceed from there (essentially a packet ID).
  11. What on earth. I doubt you know what you are doing. It means if a, b, c, d, e and f are equal... You can also do this and get the same result. if(a == b && a == c && a == d && a == e && a == f) if a == b and a == c, you don't need to then check b == c. It's called the transitive property of mathematics.
  12. [me=Draco18s]sees code and no crash, still doesn't know what kind of problem to look for.[/me]
  13. You'd need to set the metadata as well, as metadata 0 implies a source block.
  14. Well you could clone the mob's own bounding box and then use .expand() instead of creating a new AABB.
  15. Yeah, it was really annoying not being able to do anything with them outside the changing the radius. Feel free to use and modify that class however you need. It's pretty flexible already, but there's always room for improvement At the time I had been trying to make shaped explosions. But yeah. I might get back to it eventually, little too deep in other things right now.
  16. You should probably use a tab other than tabAllSearch, too.
  17. You mean like this.posX?
  18. It's probably not removed. Just not deobfuscated. In any case, I don't know the answer.
  19. I tried messing with explosions once too and never got anywhere. I'll have to bookmark that.
  20. [me=Draco18s]sees no code and no crash report[/me] [me=Draco18s]shrugs and leaves[/me]
  21. public String getItemDisplayName(ItemStack par1ItemStack) { } Just be sure to use an untranslated string and then translate it. eg. return StatCollector.translateToLocal("item.myItem.name");
  22. All in all: Bad all around.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.