Everything posted by Draco18s
-
[SOLVED]My mod can't load in zip format
Error logs are really easy to read, if you'd actually bother doing so. 2013-05-04 16:40:39 [sEVERE] [ForgeModLoader] Caught exception from XplosionCore java.lang.ClassNotFoundException: com.big_Xplosion.xplosionCore.XplosionCore
-
1.5.2 Issue
The first thing that instantly springs to mind and that you should have thought of and tried was to move things out of the /mods folder inside your zip/dev environment. (My guess is that Mojang changed the texture loading code without telling anyone)
-
[1.5] Destroy a block with onItemUse? [Solved]
Because onItemUse isn't passed those extra parameters.
-
Textures dont work!
So in otherwords.... Exactly what we told you.
-
Textures dont work!
No one should ever need to follow this advice. I still have no idea why it keeps getting suggested. If you're using Forge, no jar editing should be required, unless you've made base class edits.
-
Here's an Oddity - Two different results from the same code
Below is the entire class for an extending ladder block I made. When updating it to 1.5.1 (below code is for 1.5.1) I noticed that when broken under certain conditions, it will drop 1 item less than it should. Basic premise: place the block then activate it (right click) and it will auto-place more ladders vertically (going up) until it a ladder is placed in a "supporting" position (against a solid block), you run out of item-copies in your inventory, or it hits the build height. All of that works correctly. The ladder can be removed (broken) only from the top-most or bottom-most block. Here's the fun part. If you're breaking it from the bottom most block and the top-most block is in a supported location, the correct number of items drop (so if you start with 10, you'll end with 10). But if the top most block is adjacent to air, one less item will drop (so if you started with 10, you'll have 9). (Breaking from the top seems to work just fine, but not as extensively tested). But as far as I can tell, the code neither cares what the adjacent blocks are (it should only check the adjacent top blocks when breaking from the top, in order to determine where it should drop the items so they don't fall down the hole), nor does the harvest function iterate differently in the two scenarios. Why is this? What's going on that I'm not seeing? package draco18s.micromods.extendingladders.blocks; import static net.minecraftforge.common.ForgeDirection.*; import java.util.Random; import cpw.mods.fml.relauncher.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.*; import net.minecraft.item.ItemStack; import net.minecraft.network.packet.Packet3Chat; import net.minecraft.server.MinecraftServer; import net.minecraft.stats.StatList; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.Icon; import net.minecraft.world.*; public class ExtendingLadder extends Block { private Icon ropeA; private Icon ropeB; public ExtendingLadder(int par1, Material par2Material) { super(par1, par2Material); setCreativeTab(CreativeTabs.tabDecorations); setUnlocalizedName("Extending Ladder"); setHardness(0.4F); setStepSound(soundLadderFootstep); } public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); } @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); } public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { this.updateLadderBounds(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); } public void registerIcons(IconRegister par1IconRegister) { blockIcon = par1IconRegister.registerIcon("ExtendingLadders:extend-ladder"); //these two icons are part of the custom renderer to make the ladder //look kind of like this: //http://www.rishabqualityladders.com/aluminium-extension-ladder.htm ropeA = par1IconRegister.registerIcon("ExtendingLadders:extend-rope1"); ropeB = par1IconRegister.registerIcon("ExtendingLadders:extend-rope2"); } @SideOnly(Side.CLIENT) public Icon getBlockTextureFromSideAndMetadata(int side, int meta){ if(side <= 1) return blockIcon; else if(side == 2) return ropeA; else return ropeB; } public void updateLadderBounds(int par1) { float var3 = 0.125F; if (par1 == 2) { this.setBlockBounds(0.0F, 0.0F, 1.0F - var3, 1.0F, 1.0F, 1.0F); } if (par1 == 3) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var3); } if (par1 == 4) { this.setBlockBounds(1.0F - var3, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } if (par1 == 5) { this.setBlockBounds(0.0F, 0.0F, 0.0F, var3, 1.0F, 1.0F); } } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } public int getRenderType() { return ExtendingLaddersBase.extLadderRenderID; //normal ladder renderer ( would be a sufficient replacement } public boolean canPlaceBlockAt(World world, int x, int y, int z, int side) { if (side == 2 && world.isBlockSolidOnSide(x, y, z + 1, NORTH)) { return true; } if (side == 3 && world.isBlockSolidOnSide(x, y, z - 1, SOUTH)) { return true; } if (side == 4 && world.isBlockSolidOnSide(x + 1, y, z, WEST)) { return true; } if (side == 5 && world.isBlockSolidOnSide(x - 1, y, z, EAST)) { return true; } return false; } public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) || par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) || par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) || par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH); } public int onBlockPlaced(World world, int x, int y, int z, int par5, float par6, float par7, float par8, int par9) { int var10 = par9; if ((var10 == 0 || par5 == 2) && world.isBlockSolidOnSide(x, y, z + 1, NORTH)) { var10 = 2; } if ((var10 == 0 || par5 == 3) && world.isBlockSolidOnSide(x, y, z - 1, SOUTH)) { var10 = 3; } if ((var10 == 0 || par5 == 4) && world.isBlockSolidOnSide(x + 1, y, z, WEST)) { var10 = 4; } if ((var10 == 0 || par5 == 5) && world.isBlockSolidOnSide(x - 1, y, z, EAST)) { var10 = 5; } return var10; } @Override public void updateTick(World world, int x, int y, int z, Random par5Random) { this.onNeighborBlockChange(world, x, y, z, 0); } public void onNeighborBlockChange(World world, int x, int y, int z, int par5) { if (world.getBlockId(x, y + 1, z) != blockID && world.getBlockId(x, y - 1, z) != blockID) { int var6 = world.getBlockMetadata(x, y, z); boolean var7 = false; if (var6 == 2 && world.isBlockSolidOnSide(x, y, z + 1, NORTH)) { var7 = true; } if (var6 == 3 && world.isBlockSolidOnSide(x, y, z - 1, SOUTH)) { var7 = true; } if (var6 == 4 && world.isBlockSolidOnSide(x + 1, y, z, WEST)) { var7 = true; } if (var6 == 5 && world.isBlockSolidOnSide(x - 1, y, z, EAST)) { var7 = true; } if (!var7) { harvestBlock(world, world.getClosestPlayer(x, y, z, 6), x, y, z, 0); world.setBlockToAir(x, y, z); } } super.onNeighborBlockChange(world, x, y, z, par5); } @Override public void onBlockAdded(World world, int x, int y, int z) { onBlockPlaced(world, x, y, z, 1, 0F, 0F, 0F, 0); } public int quantityDropped(Random par1Random) { return 1; } @Override public boolean isLadder(World world, int x, int y, int z) { return true; } public void harvestBlock(World world, EntityPlayer par2EntityPlayer, int x, int y, int z, int par6) { int meta = 0; int n = 1; if (world.getBlockId(x, y + 1, z) != blockID) { while (world.getBlockId(x, y - n, z) == blockID) { if (meta == 0) { meta = world.getBlockMetadata(x, y - n, z); } world.setBlock(x, y - n, z, 0); if (!par2EntityPlayer.capabilities.isCreativeMode) { if (meta == 2) { if (world.getBlockId(x, y + 1, z + 1) == 0) { dropBlockAsItem(world, x, y + 1, z + 1, meta, 0); } else if (world.getBlockId(x, y + 1, z - 1) == 0) { dropBlockAsItem(world, x, y + 1, z - 1, meta, 0); } else { dropBlockAsItem(world, x, y + 1, z, meta, 0); } } else if (meta == 3) { if (world.getBlockId(x, y + 1, z - 1) == 0) { dropBlockAsItem(world, x, y + 1, z - 1, meta, 0); } else if (world.getBlockId(x, y + 1, z + 1) == 0) { dropBlockAsItem(world, x, y + 1, z + 1, meta, 0); } else { dropBlockAsItem(world, x, y + 1, z, meta, 0); } } else if (meta == 4) { if (world.getBlockId(x + 1, y + 1, z) == 0) { dropBlockAsItem(world, x + 1, y + 1, z, meta, 0); } else if (world.getBlockId(x - 1, y + 1, z) == 0) { dropBlockAsItem(world, x - 1, y + 1, z, meta, 0); } else { dropBlockAsItem(world, x, y + 1, z, meta, 0); } } else if (meta == 5) { if (world.getBlockId(x - 1, y + 1, z) == 0) { dropBlockAsItem(world, x - 1, y + 1, z, meta, 0); } else if (world.getBlockId(x + 1, y + 1, z) == 0) { dropBlockAsItem(world, x + 1, y + 1, z, meta, 0); } else { dropBlockAsItem(world, x, y + 1, z, meta, 0); } } else { dropBlockAsItem(world, x, y + 1, z, meta, 0); } } n++; } } else if (world.getBlockId(x, y - 1, z) != blockID) { while (world.getBlockId(x, y + n, z) == blockID) { if (meta == 0) { meta = world.getBlockMetadata(x, y + n, z); } world.setBlock(x, y + n, z, 0); if (!par2EntityPlayer.capabilities.isCreativeMode) { dropBlockAsItem(world, x, y, z, meta, 0); } n++; } } else { if (meta == 0) { meta = world.getBlockMetadata(x, y + n, z); } world.setBlock(x, y, z, blockID, meta, 3); world.markBlockForUpdate(x, y, z); } if (par2EntityPlayer != null && !par2EntityPlayer.capabilities.isCreativeMode) { if (meta == 2) { if (world.getBlockId(x, y + 1, z + 1) == 0) { dropBlockAsItem(world, x, y + 1, z + 1, meta, 0); } else if (world.getBlockId(x, y + 1, z - 1) == 0) { dropBlockAsItem(world, x, y + 1, z - 1, meta, 0); } else { dropBlockAsItem(world, x, y + 1, z, meta, 0); } } else if (meta == 3) { if (world.getBlockId(x, y + 1, z - 1) == 0) { dropBlockAsItem(world, x, y + 1, z - 1, meta, 0); } else if (world.getBlockId(x, y + 1, z + 1) == 0) { dropBlockAsItem(world, x, y + 1, z + 1, meta, 0); } else { dropBlockAsItem(world, x, y + 1, z, meta, 0); } } else if (meta == 4) { if (world.getBlockId(x + 1, y + 1, z) == 0) { dropBlockAsItem(world, x + 1, y + 1, z, meta, 0); } else if (world.getBlockId(x - 1, y + 1, z) == 0) { dropBlockAsItem(world, x - 1, y + 1, z, meta, 0); } else { dropBlockAsItem(world, x, y + 1, z, meta, 0); } } else if (meta == 5) { if (world.getBlockId(x - 1, y + 1, z) == 0) { dropBlockAsItem(world, x - 1, y + 1, z, meta, 0); } else if (world.getBlockId(x + 1, y + 1, z) == 0) { dropBlockAsItem(world, x + 1, y + 1, z, meta, 0); } else { dropBlockAsItem(world, x, y + 1, z, meta, 0); } } } } public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { int n = 1; int var10 = world.getBlockMetadata(x, y, z); while (y+n < MinecraftServer.getServer().getBuildLimit()-1 && world.getBlockId(x, y + n, z) == 0 && !canPlaceBlockAt(world, x, y + n, z, var10)) { if (par5EntityPlayer.capabilities.isCreativeMode || par5EntityPlayer.inventory.consumeInventoryItem(blockID)) { world.setBlock(x, y + n, z, blockID, var10, 3); n++; } else { break; } } if(!world.isRemote && y+n >= MinecraftServer.getServer().getBuildLimit()-1) { EntityPlayerMP p = (EntityPlayerMP) par5EntityPlayer; p.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat("" + EnumChatFormatting.GRAY + "Hit world ceiling.")); } if (world.getBlockId(x, y + n, z) == 0 && canPlaceBlockAt(world, x, y + n, z, var10) && (par5EntityPlayer.capabilities.isCreativeMode || par5EntityPlayer.inventory.consumeInventoryItem(blockID))) { world.setBlock(x, y + n, z, blockID, var10, 3); } return true; } public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int par6) { //if solo block, do a drop, as the harvestBlock function will not drop any in such a case if(world.getBlockId(x, y - 1, z) != blockID && world.getBlockId(x, y + 1, z) != blockID) dropBlockAsItem(world, x, y + 1, z, 0, 0); harvestBlock(world, world.getClosestPlayer(x, y, z, 6), x, y, z, par6); } }
-
How do i Check for block neighbor that is for example 5 blocks away
Wow, really cool.
-
Textures dont work!
He's trying to put them in the zip file to distribute.
-
Textures dont work!
I'm not sure what the problem is if blocks and armor is working, but not items. :\
-
Generate plant near a certain block only
You might want to look at the existing plant code. IIRC there's already a "nearby water" detection loop for spawning reeds.
-
Items are not appearing
You honestly expected blocks to show up in the creative inventory without explicitly telling them to show up? And then were surprised when explicitly telling them to show up actually does that!?
-
Items are not appearing
// TODO Auto-generated constructor stub You might want to replace that with actual code.
-
Textures dont work!
Well, it wouldn't be the src folder, but rather the compiled mod's top-level package. Typically "ModName" as well. "com" or "AuthorName" are also frequently used. Depends on the hierarchical organization of the given author. I don't use "com.whatever" because I don't have a domain name to use. But essentially correct. OP: you probably forgot to add the /mods/[textures] folder to the zip manually. The compiler does NOT bring textures over.
-
How do i Check for block neighbor that is for example 5 blocks away
couldnt make it work.... besides can you show me how id make it so that it checks for a block in xPos 1-20 for example? Loops.
-
Changing sun/moon texture in a dimension.
I haven't worked with things the way you're working with them, but pulling up the code I have... Which is subclassing a Mystcraft thing and is a custom renderer I've got GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1.getTexture("/mods/CustomCelestials/textures/environment/custom_moon_phases.png")); And I can put the texture inside my packaged zip. Not sure that'll help you any, though. :\
-
1.5.1 Item icons is not show
See this thread. What tutorial are you following, so we can go punch that guy in the face for giving bad code?
-
[Solved]Dimension Teleportation refuses to stop.
Or putting a delay on the teleport, like the vanilla nether portal.
-
Having issue's with setting my item icons :\
This was for some blocks, but items will just be in /items instead of /blocks
-
Having issue's with setting my item icons :\
The override actually has no impact on his problem. He's just not putting his textures in the right place. Have a look at this post: http://www.minecraftforge.net/forum/index.php/topic,8041.msg40615.html#msg40615
-
Just keeps eating and eating
One at a time should be sufficient in most cases. I don't think anyone will really notice.
-
Problem with textures minecraft 1.5.1 and iconIndex variable
"resources" is a bad name for a top-level folder. You really should name it the same as your mod-name. The folder structure will look like this: [mcp]/src/minecraft/mods/MODNAME/textures/items/ITEMNAME.png Where MODNAME and ITEMNAME are what you specify in the registerIcon function. In this case, you have "resources:SteelPickaxe" so your texture file should be named "SteelPickaxe.png" and it will be located at "[mcp]/src/minecraft/mods/resources/textures/items/"
-
Just keeps eating and eating
Does it subtract a stack of size zero...or is it subtracting a stack of (size minus 0)? I'm not familiar with the functions there, but it would seem to me that adding a check for 'no fuel needed' would be best.
-
Just keeps eating and eating
if (getFuelLevelRoom() < fuelToAdd) What happens here if getFuelLevelRoom() returns zero?
-
Gravity not working for setBlock()
That would be a function that's implemented by a subclass. Because if that function did actually nothing, a hell of a lot of stuff wouldn't work (most redstone, for instance).
-
Ore Dictionary: get all ores
And you fail to miss my point: While there is code to prevent NETWORK overloading there is not code to prevent TICK-UPDATE OVERLOADING. At least, not so far as I've noticed.
IPS spam blocked by CleanTalk.