Skip 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. Lighting up in the dark "and being bright all the time" are largely indistinguishable, because of the way lighting works.
  2. Did you run it? Note that this line: int a = theWorld.calculateSkylightSubtracted(0); //force calculation of current lighting levels Gets how much below 15 the current light level is (note the SUBTRACTED part). Oddly I didn't find the "get current light level" function. Either I missed seeing it, or it's part of a different class.
  3. IBlockAccess is an interface. It supplied a handful of methods that might be relevant for that function call. It's like World-lite. In any case, I found that IBlockAccess was insufficient for the desired effect. Here's what I ended up with: public class GlowFlower extends Block { //If you want a flower as per flower, extend BlockFlower. I wanted mine to be placable under water, so I couldn't. protected static World theWorld; public GlowFlower(int par1, int par2, Material par3Material) { super(par1, par2, par3Material); setBlockName("Glow Moss"); setStepSound(soundGrassFootstep); setTickRandomly(true); float var4 = 0.2F; setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var4 * 3.0F, 0.5F + var4); setCreativeTab(CreativeTabs.tabDecorations); } public GlowFlower(int par1, Material par2) { super(par1, par2); setBlockName("Glow Moss"); setStepSound(soundGrassFootstep); float var4 = 0.2F; setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var4 * 3.0F, 0.5F + var4); setCreativeTab(CreativeTabs.tabDecorations); } public void onBlockAdded(World world, int x, int y, int z) { if(theWorld == null) theWorld = world; world.scheduleBlockUpdate(x, y, z, blockID, 600); } public void updateTick(World world, int x, int y, int z, Random par5Random) { if(theWorld == null) theWorld = world; //make sure theWorld is not null getLightValue(null, x, y, z); //force recheck of light level, probably not needed world.scheduleBlockUpdate(x, y, z, blockID, 600); //schedule another update } @Override public int getLightValue(IBlockAccess world, int x, int y, int z) { if(theWorld != null) { int a = theWorld.calculateSkylightSubtracted(0); //force calculation of current lighting levels if(a > return 8; else return 0; } else return 8; //light level when the world is loaded (loading from save does not call onAdded, onPlaced, etc.) } public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } public int getRenderType() { return 1; } It DOES light up at night and turn off during the day, but it's updates are once a minute (I didn't feel like burdening the system with frequent updates). And I had to make a class-level reference to the World in order to get the current sky light level.
  4. That's a shame. Oh well.
  5. It's just an integer, but it's one of those "conflicts with other dimension mods" if you try to use the same ID. Use a config value for it and pick a random 3-digit number* as your default (odds are you won't conflict, I think Mystcraft uses...12 and DivineRPG uses 7**). *I don't know what the maximum acceptable value is, fyi. But I'd be willing to bet that it's greater than 16. **For a while they were both on 7.
  6. Oh fancy. Still if that method isn't working for you, the redstone lamp way works
  7. Textures go in: /mcp/src/minecraft/mods/%MODNAME%/textures/%TYPE%/%FILENAME%.png Where %MODNAME% and %FILENAME% are specified in the call to iconRegister.registerIcon(...) e.g. for an item, iconRegister.registerIcon("MyMod:MyItem") will look for a texture at: /mcp/src/minecraft/mods/MyMod/textures/items/MyItem.png for a block, it will look in ...textures/blocks/ instead of ...textures/items/
  8. Unfortunately setLightValue is a class-wide...thing. If you open up BlockRedstoneLamp you'll see that it actually uses two block IDs to be lit or unlit: Block.java public static final Block redstoneLampIdle = (new BlockRedstoneLight(123, false)) public static final Block redstoneLampActive = (new BlockRedstoneLight(124, true)) BlockRedstoneLight.java public BlockRedstoneLight(int par1, boolean par2) { super(par1, 211, Material.redstoneLight); this.powered = par2; if (par2) { this.setLightValue(1.0F); ++this.blockIndexInTexture; } }
  9. OK, so I went looking at this. What is the farthest back a mod can be and still make use of the version independence? There's a guy going around on the Minecraft forums telling all the 1.4.7 mod owners to "reobfuscate with the latest reobfuscale_srg" and it'll magically update them to 1.5.1 But I can't seem to get it to work. I can't just add "--srgnames" to the end of the reobfuscate.bat file, I get an error: reobfuscate.py: error: no such option: --srgnames
  10. 1.5.1 likely changed something that causes your mod, betterrecipes.java at line 79 to no longer work correctly. Likely a function name changed.
  11. I was using another mod as a reference. The sloped blocks one, actually (the source is up on Github, IIRC).
  12. I've been having a similar issue. You're doing things a little differently than I am, but the solution will likely work for both of us. Whatever it is.
  13. What I mean is, I don't know why the coordinates of the block are relevant. I mean, we already did this: Block block = Block.blocksList[par1World.getBlockId(var38, var41, var44)]; So we're already looking at the block that we want to replace, why would we want that block's mine-ability to be based on...not itself?
  14. Oh, a vanilla class. *Peers at it* That looks like it should work. But only for the overworld WorldGenMinable's generate calls block.isGenMineableReplaceable which will only return true for smooth stone. Don't even ask me why it takes a world, x, y, and z parameters, it doesn't use them. No really: public boolean isGenMineableReplaceable(World world, int x, int y, int z) { return blockID == stone.blockID; }
  15. dropXpOnBlockBreak(...)
  16. What does WorldGenMinable do?
  17. Two things in this function: 1) you haven't asked the world for a biome 2) you're generating a random value from 0 to 64 (inclusive) with your randPosY. In order to generate from 50 to 65, you need to make that randPosY= Random.nextInt(15) + 55; In order to get the biomeID, you need... BiomeGenBase b = world.getBiomeGenForCoords(chunkX, chunkZ); if(b.biomeName.equals("Desert") || b.biomeName.equals("DesertHills")) { //existing code } If you want to make sure you only generate under sand, you'd have to check the block ID at the selected X,Y,Z coordinate: world.getBlockId(randX, randY, randZ) == Block.sand) Though you might want to check the block above rather than the exact x,y,z or you could check against sandstone instead.
  18. I think most people do the config and myBlock = new MyBlock(...) in the @preinit with the various registrations in init. At least, that's what I've seen and do.
  19. I was referring to the fact that the guys reading your post couldn't know that. The only info you provided was that you did not use the original rendering for ladders... And it worked, since it made you show the code you have written. Now it's possible for someone to debugg this thing I figured it was a more common problem than simply being a matter of the code I used because I did nothing special.
  20. The custom renderer (implementing ISimpleBlockRenderingHandler) has in its renderWorldBlock function the same code as the RenderBlocks (the vanilla renderer) renderBlockLadder function, only with a second face for each metadata (to render the back face). The other functions are basically empty (renderInventoryBlock is blank, shouldRender3DInInventory returns false, getRenderId returns the render ID assigned to it, via the base mod file). So I don't know what you're referring to. Full render class.
  21. The block: http://s23.postimg.org/wdglu929n/2013_03_27_12_18_16.png[/img] The block, while breaking: http://s14.postimg.org/m0xhohfi9/2013_03_27_12_18_22.png[/img] How do I fix this? I'm not using the vanilla ladder renderer because I need the block to be rendered from both sides (as it can be freestanding).

Important Information

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

Account

Navigation

Search

Search

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.