Everything posted by Draco18s
-
Suggestions for Efficient Mod Making Please?
But you don't need a LanguageRegistry at all ;_;
-
Textures Disappear When Reobfuscating
/assets are not moved into /reobf, you have to do that yourself.
-
Suggestions for Efficient Mod Making Please?
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.
-
[Not Solved]Nbt integer values sometimes returning 0 ?
Packets.
-
Suggestions for Efficient Mod Making Please?
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.
-
[Not Solved]Nbt integer values sometimes returning 0 ?
Client/Server?
-
[1.6.4]Rendering TileEntities in Inventory
Use an IItemRenderer
-
Custom entity Applying bonemeal - like effects to plants in certain area?
Take a look at what I did here https://github.com/Draco18s/Decaying-World/blob/master/draco18s/decay/blocks/HealthFence.java
-
[1.6.2]Detecting Right Clicking a Mob
public boolean interact(EntityPlayer player)?
-
Out of bounds exception.
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.
-
[1.6.4] Making a transparent block that gives out light.
@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
-
[1.6.4] Changable block textures (solved)
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 )
-
[1.6.4] EntityLiving and NBT Data
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).
-
[1.7.2] [Solved] GameRegistry.addShapelessRecipe() Don't work!
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.
-
[1.7.2] New Achievement Crash!
[me=Draco18s]sees code and no crash, still doesn't know what kind of problem to look for.[/me]
-
Spawning a flowing water block?
You'd need to set the metadata as well, as metadata 0 implies a source block.
-
1.6.4 Limiting spawning of Custom Mob
Well you could clone the mob's own bounding box and then use .expand() instead of creating a new AABB.
-
Custom Explosion
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.
-
[1.7.2] Can't find item in creative tab
You should probably use a tab other than tabAllSearch, too.
-
1.6.4 Limiting spawning of Custom Mob
You mean like this.posX?
-
[1.7.2]what to use instead of onInventoryChanged() method
It's probably not removed. Just not deobfuscated. In any case, I don't know the answer.
-
Custom Explosion
I tried messing with explosions once too and never got anywhere. I'll have to bookmark that.
-
[1.7.2] New Achievement Crash!
[me=Draco18s]sees no code and no crash report[/me] [me=Draco18s]shrugs and leaves[/me]
-
Naming item based on state
public String getItemDisplayName(ItemStack par1ItemStack) { } Just be sure to use an untranslated string and then translate it. eg. return StatCollector.translateToLocal("item.myItem.name");
-
Reduce durability in chest
All in all: Bad all around.
IPS spam blocked by CleanTalk.