
Everything posted by SuperHB
-
[1.7.x] How to add custom Drops to vanilla mobs
I tried the code and it gave me an error saying you have to put stuff in the () and it auto added it for me and it still doesn't work. And yes I am from PMC. JustKilling is my username on it Here is the code: //PreInitialize public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new LivingDropsEvent(null, null, null, 0, false, 0)); proxy.initCapes(); } That's what it add for it to not have an error
-
[1.7.x] How to add custom Drops to vanilla mobs
How do i do that? I never had to do that before And here is the code I'm using now and it still doesn't work package net.net46.thesuperhb.MobDrops; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.entity.passive.*; import net.minecraft.entity.monster.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent; public class LivingDropEvent { public static double rand; @SubscribeEvent public void onDrop(LivingDropsEvent event) { // you can also check the random chance here, rather than every time, // since you use the exact same probability for all your cases if (event.source.getDamageType().equals("player") && event.entity.worldObj.rand.nextFloat() < 1.00F) { if (event.entity instanceof EntityCow) { event.entityLiving.dropItem(Items.bone, 12); event.entityLiving.dropItem(MobDrops.cowHorn, 2); event.entityLiving.dropItem(MobDrops.ribCage, 1); } else if (event.entity instanceof EntityMooshroom) { event.entityLiving.dropItem(Items.bone, 12); event.entityLiving.dropItem(MobDrops.cowHorn, 2); event.entityLiving.dropItem(MobDrops.ribCage, 1); event.entityLiving.dropItem(MobDrops.redLeather, 3); } } } } I commented out the rest of the code so I could just try it out with the Cow and Mooshroom. Still doesn't work
-
[1.7.2] I need help with my texturing, It's not working
This is the code I used for my Block package net.net46.thesuperhb.MobDrops.Block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.net46.thesuperhb.MobDrops.MobDrops; public class BlockGrill extends Block { public BlockGrill(Material p_i45394_1_) { super(p_i45394_1_); setCreativeTab(MobDrops.mobDrops); setHardness(5F); setResistance(4.0F); setBlockName("GrillBlock"); setBlockTextureName(MobDrops.MODID + ":beta"); //Texture :BlockGrill } }
-
[1.7.2] I need help with my texturing, It's not working
Yeah,it gave me errors because there wasn't a "this." and because it was .setTextureName inestead of .setBlocTextureName don't put a period before it
-
[1.7.x] How to add custom Drops to vanilla mobs
I'm getting an error at if (event.source.getDamageType().equals("player") && event.entity.getWorldObj().rand.nextFloat() < 0.1F) { where it is at event.entity.getWorldObj I added one. Doesn't do much ._. @SubscribeEvent public void onEntityDropCow(LivingDropsEvent event) { if (event.source.getDamageType().equals("player")) { rand = Math.random(); if (event.entityLiving instanceof EntityCow) { //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100% if (rand < 0.17d) { event.entityLiving.dropItem(Items.bone, 12); event.entityLiving.dropItem(MobDrops.cowHorn, 2); event.entityLiving.dropItem(MobDrops.ribCage, 1); } } } }
-
[1.7.x] How to add custom Drops to vanilla mobs
I only use the same probability for passive and different probability for aggressive mobs is there a way to set it for different mob groups?
-
[1.7.2] I need help with my texturing, It's not working
did you try my method?
-
[1.7.2] I need help with my texturing, It's not working
Try this: Put Texture Code in the BlockPlatOre and it should look like this EXACT: package k3.moreMetals; import net.minecraft.block.Block; import net.minecraft.block.material.Material; public class BlockPlatOre extends Block { public BlockPlatOre() { super(Material.iron); setTextureName(moreMetalsMod.MODID + ":orePlatinum"); } } It should work that's what I used for my code
-
[1.7.x] How to add custom Drops to vanilla mobs
Hi was wondering if any knows how to add custom drops to vanilla mobs. This was the code that I used in 1.6 but i doesn't work anymore. http://pastebin.com/Y61EDXJD Please help, Thanks SuperHB
-
[1.6.4] Custom Obj Block Bounds
Okay so I'm working on a mod and I'm using an OBJ model and I can't figure out how to set the block bounds for more than 1 block. I tried using the set block bound code but it doesn't work out when I try to make it out of 1 block. Here is my code that I'm using for my block. http://pastebin.com/DK5xqGX4 I've searched online and they said to check the BedBlock code and I see this thing with footBlockToHeadBlockMap and other stuff. Please Help Thanks, SuperHB
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
Bump....
-
[1.7.2] [forge-1.7.2-10.12.0.1024-src] Recommended but still doesn't work.
Okay, so forge-1.7.2-10.12.0.1024-src was Recommended for awhile and I was setting it up for my mode and when I set it up it still gets errors. Does this happen for anyone else or just me? I also tried importing code from my mod to 1.7.2 and I get errors... I thought this was fixed alreay! If this is an issue that only a few people are getting please help! But if they are still working on then please let me know! Thanks, SuperHB
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
Bumpity-bump...
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
Okay, so I tried pretty much EVERY... SINGLE... code in the AxisAlignedBB class and it still doesn't work... Here is all the code I used for it: /** * Sets the Collision of the Tardis so you can't walk through it. */ @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } } @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } } public AxisAlignedBB getOffsetBoundingBox(World world, double par1, double par3, double par5, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par1, maxY + par3, maxZ + par5); case 2: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par1, maxY + par3, maxZ + par5); default: return AxisAlignedBB.getAABBPool().getAABB(par1 + 36.0D, par3 + 48.0D, par5 + 36.0D, par1 + 36.0D, par3 + 48.0D, par5 + 36.0D); } } public AxisAlignedBB setBounds(World world, double par1, double par3, double par5, double par7, double par9, double par11, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par7, maxY + par9, maxZ + par11); case 2: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par7, maxY + par9, maxZ + par11); default: return AxisAlignedBB.getAABBPool().getAABB(par1 + 36.0D, par3 + 48.0D, par5 + 36.0D, par7 + 36.0D, par9 + 48.0D, par11 + 36.0D); } } public AxisAlignedBB expand(World world, double par1, double par3, double par5, double par7, double par9, double par11, int x, int y, int z) { double d3 = this.minX - par1; double d4 = this.minY - par3; double d5 = this.minZ - par5; double d6 = this.maxX + par1; double d7 = this.maxY + par3; double d8 = this.maxZ + par5; switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par7, maxY + par9, maxZ + par11); case 2: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par7, maxY + par9, maxZ + par11); case 4: return AxisAlignedBB.getAABBPool().getAABB(d3, d4, d5, d6, d7, d8); default: return AxisAlignedBB.getAABBPool().getAABB(par1 + 36.0D, par3 + 48.0D, par5 + 36.0D, par7 + 36.0D, par9 + 48.0D, par11 + 36.0D); } }
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
tried a bunch can't figure this out!
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
Okay... I have been trying for like an hour and couldn't find anything and i'm using the code from GalaticCraft
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
okay, i'll try it EDIT: Tried it... Didn't Work Here is the code: @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(36.0D, 48.0D, 36.0D, 36.0D, 48.0D, 36.0D); } } @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(36.0D, 48.0D, 36.0D, 36.0D, 48.0D, 36.0D); } } It removed the model and just made a regular block that I was able to walk through
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
Okay so for the cases I changed it. here is the new code: @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } } @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } } But it still does nothing. and for the second thing you said how do i exactly fix that?
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
Oh, because the AABB code does nothing. I think it is because of the regular block that is inside my model
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
Bump
-
[1.7.2][SOLVED] Where is the Minecraft source code?
The source code can no longer be found in the new forge.
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
This is my AABB code that I'm using, it's in my Block class: @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } } @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } }
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
okay so I found a video about AABB Collision Detection and it was for a 2D Indie Game. Not sure if it is the same but I'll try it, but I don't understand it much.
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
no
-
[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid
Okay so I saw the code and I am completely lost... can you give me an example of how to use the code? this is what I found: /** * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity */ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { AxisAlignedBB axisalignedbb1 = this.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); if (axisalignedbb1 != null && par5AxisAlignedBB.intersectsWith(axisalignedbb1)) { par6List.add(axisalignedbb1); } } and this is code to set it: getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);
IPS spam blocked by CleanTalk.