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. That's not how you compare Item Stacks. You should, in this case, be doing hand.getItem() == Items.dirt
  2. JD GUI does a great job. The only thing it can't recover is the friendly names for vanilla methods and fields (you get SRG names and have to do a manual lookup on each one* but class names come through just fine). *Speaking of, while I have the methods.csv and fields.csv for 1.6.4, I can't find the srg <-> friendly names list for 1.7.x
  3. if(player.isSneaking) { ... } ? (or is it player.capabilities.isSneaking , I can't remember)
  4. GameRegistry.registerTileEntity(...)?
  5. The answer is yes: Forge does it, there's a log message on startup that says, "running in a deobfuscated environment, either it won't work properly or you're in dev.
  6. When it inflicts the damage, inflict it as coming from the player that threw it. Arrows do this, I believe, as does TNT.
  7. Note: In pass 1, alpha below 0.1 is also drawn as fully transparent. It's really annoying.
  8. My first suggestion would be to tell the block to render in Pass == 1 (transparent pass) but that would just alter the transparency problem, not the bounds problem. The bounds problem I believe needs to be fixed by adding bounds parameters to the model json.
  9. I can do a two-pass render and have OpenGL do the blending, sure. But the question I asked was if I could get access to the texture data and prebake the overlay, saving the result as an iicon. I'm not averse to mucking around with bitmap data. I've done run-time graphics before, for different things (one was a DynamicTexture object which was drawn in a GUI and , the other was procedural graphic sprites done in Flash). The former is inappropriate for a block texture, as the texture is not dynamic: it's two static images pre-rendered into a single icon. The latter is more appropriate, but I don't know how to do that within Minecraft's iicon system.
  10. At least the rotation isn't handled in quaternions. (If anyone legitimately understands how to rotate things in quaternions: you're abnormal)
  11. Ok, yeah, I'm not sure how that's going to help me at all. What I want to do is take an icon that isn't mine (vanilla stone and the 1.8 stones supplied by Gany's Surface--if present--as I'm still working with 1.7.10) and modify them based on block metadata so that they have different appearances, as the metadata versions have different behaviors. I want to take two sets of texture data: http://s10.postimg.org/5ut5g05r9/stone_overlay_0.png[/img]http://s15.postimg.org/u92typ1x3/stone_overlay_1.png[/img]http://s15.postimg.org/iy06abv1z/stone_overlay_5.png[/img] And combine them into a single set of texture data, so that I can supply 7 overlays and generate the required 8 icons (original, original/overlay1, original/overlay2, etc) without having to do this: Which was a huge pain in the ass, as I kept screwing up and having to redo it.
  12. http://www.minecraftforge.net/wiki/Tutorials
  13. Draco18s replied to fraxker's topic in Modder Support
    Sounds like you should get Mystcraft.
  14. I have yet to see any sensible reason why BlockPostion and BlockState was adopted over x/y/z and metadata. A modder still needs to translate from block state to metadata and back (or in some cases other states modifying values in a tile entity). Texturing likewise got more complicated and as of yet there's no sensible way to register textures either. I mean seriously: Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(obliteratorAxe, 0, new ModelResourceLocation("perstools:obliteratorAxe", "inventory")); WTF.
  15. Oh you're right it is. But it's apparently too good to be listed in the "list of all versions" drop down. Instead you have to scroll the page, past the recommended listing for half a dozen versions to link that takes you to a separate page. Which I might add, is below the bottom of my browser window.
  16. Well i looked at files.minecraftforge.net which did not have a1.8 branch. Looking at the GitHub was not an obvious place to look
  17. Well, seeing as only FML is updated for 1.8 and EnumHelper is a Forge class, my guess is... Reflection. Or wait for Forge.
  18. Look at the pressure plate. It does something entirely different and way more reliable.
  19. Digging around, those functions are only good for animated textures. Non-animating ones never use the list and instead have their data built into the sprite sheet. But I still can't find a way to get the texture data in that sprite sheet. There's a function in TextureUtil to modify the data, but not retrieve it.
  20. Alright, having a problem: Not sure how to get access to the texture data. There's TextureAtlasSprite#getFrameTextureData, but it says that Index: 0 is out of bounds, Size: 0 e.g. there's no texture data for that icon. As far as I can tell, the TextureAtlasSprite stores its bitmap data in a protected list field, framesTextureData and once the resources are loaded, this list should contain 1 or more int[][] values (see: TextureAtlasSprite#loadSprite lines 249, 273 and 284). Yes, I know that this list will be empty during the registerBlockIcons phase, but I've attempted to run-time-alter the texture data once when the game calls getIcon (at which point TextureAtlasSprite#loadSprite should already have been called). public class BlockUnstableStone extends Block{ private IIcon[] icons; private IIcon[] ticons; private boolean iconsSet = false; @Override public void registerBlockIcons(IIconRegister iconRegister) { TextureAtlasSprite sprite; this.icons = new IIcon[9]; this.ticons = new IIcon[7]; icons[1] = icons[0] = ((TextureAtlasSprite) iconRegister.registerIcon(this.textureName)); //base, original texture for(int o = 0; o < 7; o++) { ticons[o] = iconRegister.registerIcon("hazards:stone_overlay_"+o); //the common overlay texture icons[o+2] = iconRegister.registerIcon(this.textureName+"_"+"damaged_"+o); //uniquely named, non-existent texture } } @SideOnly(Side.CLIENT) @Override public IIcon getIcon(int side, int metadata) { if(!iconsSet) { TextureAtlasSprite temp; int[][] overlay; int[][] base; int[][] newIconData; int sr, sg, sb; float sa; int dr, dg, db; for(int o = 0; o < 7; o++) { overlay = StoneRegistry.getIconOverlay(o); //get the pixel data if cached if(overlay == null) { //get the pixel data and cache it temp = (TextureAtlasSprite)ticons[o]; overlay = temp.getFrameTextureData(0); //crash here StoneRegistry.setIconOverlay(overlay.clone()); } base = ((TextureAtlasSprite)icons[0]).getFrameTextureData(0); //combine newIconData = base.clone(); for(int x=0; x < newIconData.length; x++) { for(int y=0; y < newIconData[x].length; y++) { sa = (overlay[x][y] >> 24 & 255)/255f; sr = overlay[x][y] >> 16 & 255; sg = overlay[x][y] >> 8 & 255; sb = overlay[x][y] >> 0 & 255; //da = 0xFF; dr = newIconData[x][y] >> 16 & 255; dg = newIconData[x][y] >> 8 & 255; db = newIconData[x][y] >> 0 & 255; dr = (int) (sr*sa + dr*(1-sa)); dg = (int) (sg*sa + dg*(1-sa)); db = (int) (sb*sa + db*(1-sa)); newIconData[x][y] = (dr<<16) + (dg<< + (db); } } List data = new ArrayList(); data.add(newIconData); ((TextureAtlasSprite)icons[o+2]).setFramesTextureData(data); } } if(metadata > 3) { metadata = 3; } return this.icons[metadata]; } } Whole class
  21. You'd also want to make sure that your cauldron supports water, or that you replace in reverse when a water bucket is used, in order to maintain functionality.
  22. You're going to need to post your GUI and Container class as well. By the way, if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) { That will never be true and you can remove it. You may also want to add the writeToNBT and readFromNBT methods, along with getDescriptionPacket and handleDescriptionPacket (if I spelled those correctly).

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.