Everything posted by Draco18s
-
[1.6.4]Warnings?
One of the warnings that exists looks like this: if(entity instanceof EntityZombie) { par2 = par2; } It does nothing, but that's what exists inside Mojang's code. We aren't sure what they meant to do there, and thus the warning sticks around.
-
[1.7.2] Registering block and items
It appears that you are trying to specify block and item IDs. You don't need those. You should not even be aware that they exist.
-
[1.6.4] Collision with custom block (Solved)
That would do it!
-
Forge Event for EXP Orb Pickup
The new one would then throw its OWN EntityJoinWorldEvent, which would be bad. You'd be better off modifying the properties of the one that joined the world.
-
Help with making a block that generates in the sky
if(y >= 255) { return; }
-
Forge Event for EXP Orb Pickup
Do this: System.out.println(event.entity); if(event.entity instanceof EntityXPOrb) That'll tell you what's going on.
-
recompile IconRegister errors
Version of Minecraft/Forge?
-
[1.6.4] Collision with custom block (Solved)
This is a really old block (like 1.5 or before) but I had the same problem and solved it. I thought that was it, but see if this helps you at all. package draco18s.micromods.peephole; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockPeepHole extends Block { public BlockPeepHole(int par1, int par2, Material par3Material) { super(par1, par2, par3Material); this.setBlockName("Peephole"); setHardness(1.0F); setResistance(5.0F); setStepSound(soundStoneFootstep); setCreativeTab(CreativeTabs.tabBlock); setLightOpacity(0); } public String getTextureFile() { return CommonProxy.BLOCKS_PNG; } public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { int var6 = world.getBlockMetadata(x, y, z); switch(var6) { case 1: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); break; case 2: this.setBlockBounds(0.0F, 0.0F, 0.9375F, 1.0F, 1.0F, 1.0F); break; case 3: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.0625F); break; case 4: this.setBlockBounds(0.9375F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); break; case 5: this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0625F, 1.0F, 1.0F); break; case 6: this.setBlockBounds(0.0F, 0.9375F, 0.0F, 1.0F, 1.0F, 1.0F); break; case 0: case 7: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); break; } } public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; } public void onBlockAdded(World par1World, int par2, int par3, int par4) { super.onBlockAdded(par1World, par2, par3, par4); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); this.setDefaultDirection(par1World, par2, par3, par4); this.onNeighborBlockChange(par1World, par2, par3, par4, this.blockID); } private void setDefaultDirection(World par1World, int par2, int par3, int par4) { if (!par1World.isRemote) { int var5 = par1World.getBlockId(par2, par3, par4 - 1); int var6 = par1World.getBlockId(par2, par3, par4 + 1); int var7 = par1World.getBlockId(par2 - 1, par3, par4); int var8 = par1World.getBlockId(par2 + 1, par3, par4); int var10 = par1World.getBlockId(par2, par3-1, par4); int var11 = par1World.getBlockId(par2, par3+1, par4); byte var9 = 7; if ((var5 != blockID && Block.opaqueCubeLookup[var5]) && !Block.opaqueCubeLookup[var6]) { var9 = 3; } if ((var6 != blockID && Block.opaqueCubeLookup[var6]) && !Block.opaqueCubeLookup[var5]) { var9 = 2; } if ((var7 != blockID && Block.opaqueCubeLookup[var7]) && !Block.opaqueCubeLookup[var8]) { var9 = 5; } if ((var8 != blockID && Block.opaqueCubeLookup[var8]) && !Block.opaqueCubeLookup[var7]) { var9 = 4; } if ((var10 != blockID && Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var11]) { var9 = 1; } if ((var11 != blockID && Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var10]) { var9 = 6; } int var99 = ((var5 != blockID && Block.opaqueCubeLookup[var5])?1:0) + ((var6 != blockID && Block.opaqueCubeLookup[var6])?1:0) + ((var7 != blockID && Block.opaqueCubeLookup[var7])?1:0) + ((var8 != blockID && Block.opaqueCubeLookup[var8])?1:0) + ((var10 != blockID && Block.opaqueCubeLookup[var10])?1:0) + ((var11 != blockID && Block.opaqueCubeLookup[var11])?1:0); if(var99 > 1) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 7); } else { par1World.setBlockMetadataWithNotify(par2, par3, par4, var9); } } } public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); if(var6 == 0 || var6 == 7) { return this.blockIndexInTexture+1; } else if(var6 == 6) { var6 = 0; } return par5 != var6 ? this.blockIndexInTexture+1:this.blockIndexInTexture; } public boolean isOpaqueCube() { return true; } public boolean renderAsNormalBlock() { return false; } public void setBlockBoundsForItemRender() { this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5F); } public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { //int var6 = par1World.getBlockMetadata(par2, par3, par4); boolean var7 = canPlaceBlockAt(par1World, par2, par3, par4); if (!var7) { this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); par1World.setBlockWithNotify(par2, par3, par4, 0); } super.onNeighborBlockChange(par1World, par2, par3, par4, par5); } public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { int var5 = par1World.getBlockId(par2, par3, par4 - 1); int var6 = par1World.getBlockId(par2, par3, par4 + 1); int var7 = par1World.getBlockId(par2 - 1, par3, par4); int var8 = par1World.getBlockId(par2 + 1, par3, par4); int var10 = par1World.getBlockId(par2, par3-1, par4); int var11 = par1World.getBlockId(par2, par3+1, par4); /*if (var5 == blockID || var6 == blockID || var7 == blockID || var8 == blockID || var10 == blockID || var11 == blockID) { return false; }*/ byte var9 = 7; if ((var5 != blockID && Block.opaqueCubeLookup[var5]) && !Block.opaqueCubeLookup[var6]) { var9 = 3; } if ((var6 != blockID && Block.opaqueCubeLookup[var6]) && !Block.opaqueCubeLookup[var5]) { var9 = 2; } if ((var7 != blockID && Block.opaqueCubeLookup[var7]) && !Block.opaqueCubeLookup[var8]) { var9 = 5; } if ((var8 != blockID && Block.opaqueCubeLookup[var8]) && !Block.opaqueCubeLookup[var7]) { var9 = 4; } if ((var10 != blockID && Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var11]) { var9 = 1; } if ((var11 != blockID && Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var10]) { var9 = 6; } if (var9 == 7) { return false; } int var99 = ((var5 != blockID && Block.opaqueCubeLookup[var5])?1:0) + ((var6 != blockID && Block.opaqueCubeLookup[var6])?1:0) + ((var7 != blockID && Block.opaqueCubeLookup[var7])?1:0) + ((var8 != blockID && Block.opaqueCubeLookup[var8])?1:0) + ((var10 != blockID && Block.opaqueCubeLookup[var10])?1:0) + ((var11 != blockID && Block.opaqueCubeLookup[var11])?1:0); if (var99 != 1) { return false; } return true; } }
-
[1.6.4] Collision with custom block (Solved)
Ah here we are. You need to override getCollisionBoundingBoxFromPool. You'll have to work out what bounding box you need, but the syntax looks like this: public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return AxisAlignedBB.getAABBPool(xmin, ymin, zmin, xmax, ymax, zmax); }
-
[1.6.4] Java 6 or 7?
Use Java 7. Because J6 is end-of-lifed there's no reason for people to still have it.
-
[1.6.4] Collision with custom block (Solved)
I've run into this, and every time I have it's a pain in the ass to fix. I'll try and find the solution...
-
[1.7.2]Armor texture
Lets see... public String getArmorTexture(ItemStack itemstack, Entity entity, int slot, String type) { if (itemstack == new ItemStack(Your item)) { return "more:textures/models/armor/Your.png"; } return "more:textures/models/armor/Your.png"; } So first off you have an if statement checking to see if the item stack passed to this function is the same as a new item stack of this item. Under the assumption that == actually works here, that will always return true. Except that == doesn't work that was for complex data types (like ItemStack) and will always return false. Second, both returns are identical, making the if-statement redundant. The only reason it "works for you" is because the default return statement is correct for you. Here's a REAL function that DOES something USEFUL. @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { //slot will tell us helmet vs. boots //type will be either null or overlay (cloth armor) //can use stack.stackTagCompound.getString("matName") for material, etc. String layer = "1"; String material = stack.stackTagCompound.getString("matName").toLowerCase(); if(type == null) { type = ""; //all type use the same base texture (which is colorized) material = "iron"; } if(slot == 2) { layer="2"; } return "artifacts:textures/models/armor/"+material+"_layer_"+layer+type+".png"; }
-
[1.7.2] Problem with colored chat message
No. I haven't messed with chat formatting in chat strings, only addInformation() which doesn't support newlines.
-
[Solved][1.6.4] Crashes while loading mods in a dev environment.
This. It's really cool and very valuable.
-
[1.7.2] Problem with colored chat message
His problem is that it isn't effecting the whole string, it's only effecting until a new-line.
-
Trying to create a bow to shoot two arrows
Messing around with Utility Mobs for my own purposes, I mucked about with Toast's custom arrow class to allow multiple arrows to hit a single target. That would also work. Duplicate the arrow, then when it deals damage just set the entity's hurtTime (hurtResistanceTime?) to 0.
-
[1.6.4] Some code isn't accessed
More efficient code: this.currentPower += power; Usually the two compile to the same thing. += is faster to type though.
-
[1.5.2] TileEntity problems.
You need to tweak fml.py to have different URLs. Here's my fml.py that worked for Forge 871 (its basically the same as the last non-gradle 1.6.4) so it should work for you.
-
[1.5.2] TileEntity problems.
GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); You mean this? I already had this. Not a solution... Then either: a) meta isn't getting set correctly b) meta is getting 0'd somewhere c) you aren't reading the meta correctly
-
java.lang.NullPointerException
What mardiff is saying:
-
Change player height !
Is, or is not, your thread titled "change player height"? If it is, what the fuck do you mean by that? If it isn't it sure looks like it to me!
-
[1.5.2] TileEntity problems.
Which you are.
-
[1.5.2] TileEntity problems.
Or your TileEntitySpecialRenderer, if you're using one.
-
Trying to create a bow to shoot two arrows
The second one bounces off because there's a hurt delay on all mobs: when they take damage they become invulnerable for about a second. During this time other attacks will do no damage (and arrows will bounce off).
-
Change player height !
Well. I am. But I'm not psychic.
IPS spam blocked by CleanTalk.