Everything posted by Draco18s
-
How does extra utilitie's impossible object render?
Awesome, thanks!
-
Minecraft forge mod: Remove a block and place a new block
That's not how you compare Item Stacks. You should, in this case, be doing hand.getItem() == Items.dirt
-
How does extra utilitie's impossible object render?
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
-
Trying to call a shift-right click in air on an item.
if(player.isSneaking) { ... } ? (or is it player.capabilities.isSneaking , I can't remember)
-
[1.7.10] Save TileEntity data to NBT
GameRegistry.registerTileEntity(...)?
-
[1.7.10] Knowing if mod is deobfuscated?
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.
-
[1.7.10] Setting damage type
When it inflicts the damage, inflict it as coming from the player that threw it. Arrows do this, I believe, as does TNT.
-
Block with composite texture
Note: In pass 1, alpha below 0.1 is also drawn as fully transparent. It's really annoying.
-
[1.8] How to create the JSON model file for block with custom bounds?
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.
-
How about run-time altered icons
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.
-
[1.7.10] Ore Gen in the Nether?
See my sig.
-
[1.8]rotate your custome blocks based on steve facing like Furnaces do<SOLVED>
At least the rotation isn't handled in quaternions. (If anyone legitimately understands how to rotate things in quaternions: you're abnormal)
-
How about run-time altered icons
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.
-
How to start coding with the Forge API?
http://www.minecraftforge.net/wiki/Tutorials
-
How about run-time altered icons
No fuckin' clue
-
Nether gen
Sounds like you should get Mystcraft.
-
[1.8]rotate your custome blocks based on steve facing like Furnaces do<SOLVED>
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.
-
[1.8]Item Material
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.
-
[1.8]Item Material
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
-
[1.8]Item Material
Well, seeing as only FML is updated for 1.8 and EnumHelper is a Forge class, my guess is... Reflection. Or wait for Forge.
-
[1.8] onEntityCollidedWithBlock() not being called properly.
Look at the pressure plate. It does something entirely different and way more reliable.
-
How about run-time altered icons
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.
-
How about run-time altered icons
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
-
Milk barrel
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.
-
[1.7.2] Inventory problem
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).
IPS spam blocked by CleanTalk.