• 2

    posted a message on Forge Lava Boat immune to lava still burns player [solved]
    Quote from Lolcroc

    Sorry, but I still don't agree. There's no way you can remember exactly what, where and how you edited the base classes when a new version of minecraft gets released. You're talking about exact results; if you want to do that, go code for Mojang. Modding API's are not perfect, but you're overestimating the limitations of Forge. Example: one problem I stumbled upon was that the potionTypes array in Potion.class was too small; I fixed this with java reflection, not the easiest fix, but it works the same way as editing base classes.

    I haven't even mentioned compatibility with other mods. And despite that, when I see people say "it's for personal use", it still isn't a valid argument not to use modding APIs. Modding APIs gives you a box that you can code in, it's easy to find your errors because it's organized.


    Not to mention APIs usually have code shortcuts in place (such as in Forge, you can make a block or item incredibly quickly with little effort), so you don't need to work out how to do X, Y, Z or duplicate code as the API does it for you.

    Speaking of duping, in Forge's case you don't need to make a server and clientside version; Forge only needs a universal one which means less work for the modder.
    Posted in: Modification Development
  • 2

    posted a message on Forge Lava Boat immune to lava still burns player [solved]
    Quote from microjunk

    I will keep this in mind, but I was going to use a tick handler, and yes I am using forge....


    I would use the hurt event as it's more specific (and thus more optimized) for your purposes.
    Posted in: Modification Development
  • 1

    posted a message on [HELP] understanding light values
    Quote from ibbignerd

    Earlier I was trying to get the light level of a player and found the following method. It works with artificial light and when the sunlight is blocked (by either a cave or platform). The only thing that doesn't work is when it turns to night. While it should decrease the light level by 1 every 10 seconds from 15 to 4, it stays at 15 day and night.
    mc.theWorld.getBlockLightValue(xpos, ypos, zpos);

    Is there a better method or something to add in to account for dusk, night, and dawn?


    The block light value is the value the block makes light for. (For example, if the spot has Glowstone in it it would return 15, but if it was a stone block it would return 0.)

    I think you want the actual brightness, in which case there's a method somewhere in world for that.
    Posted in: Modification Development
  • 1

    posted a message on [1.0.0] Nether Better (WIP) [1.3! FINALLY!]
    It's not dead but college has taken up all my time, so technically yes it's dead, but no in the sense that I have it, have been updating it, but every time I get close to a release MC jumps a version and said version usually has major changes so I need to start the process again.

    Eventually i'm just going to go 'to heck with it' and upload a beta just so there's SOMETHING you guys can play...
    Posted in: WIP Mods
  • 0

    posted a message on Change Your Minecraft Name? Possibly In The Future
    I am certain if this is implemented it will work like Steam names; which is to say you have your original username/email as your actual account registar but everything asthetic will display your custom name. And there's an easy fix for users constantly changing names:
    In the view-online-users menu for servers, just put both the registar name AND the nickname. Problem solved; you can ban griefers, you can tell who is lying about thier account name, there's probably a loophole through this but I can't see it.
    Posted in: Discussion
  • 0

    posted a message on How do you set structure rarity?
    Quote from Mark719

    Thank you, worked perfectly, you don't happen to know how to generate chests with loot in them? and Mob spawners?


    Chest:
    public boolean generateChest(World world, int i, int j, int k, ItemStack[] lootIDArray, int amountOfItems)
    {
      Random random = new Random();
      world.setBlockAndMetadataWithVerify(i, j, k, chestID, 0);
      Block chest = Block.chest; //replace with the trapped chest if you wanna use that
      EntityLiving posEnt = new EntityPig(world); //uses a 'fake' pig to set the rotational data
      posEnt.setPosition(i + 0.5F, j, k + 0.5F);
      if(world.getBlockMaterial(i - 1, j, k).isSolid())
      {
       posEnt.rotationYaw = 90F;
      }else
      if(world.getBlockMaterial(i + 1, j, k).isSolid())
      {
       posEnt.rotationYaw = 270F;
      }else
      if(world.getBlockMaterial(i, j, k - 1).isSolid())
      {
       posEnt.rotationYaw = 180F;
      }else
      if(world.getBlockMaterial(i, j, k + 1).isSolid())
      {
       posEnt.rotationYaw = 0F;
      }
      chest.onBlockPlacedBy(world, i, j, k, posEnt);
    	    TileEntityChest tileentitychest = (TileEntityChest)world.getBlockTileEntity(i, j, k);
      if(tileentitychest == null)
      {
       return false;
      }else
      {
    		    int m1 = 0;
    		    do
    		    {
    			    if(m1 > amountOfItems)
    			    {
    				    break;
    			    }
    			    ItemStack itemstack = lootIDArray[random.nextInt(Math.max(1, lootIDArray.length - 1))]; //gets an itemstack from the loot array provided.
    			    if(itemstack != null)
    			    {
    				    tileentitychest.setInventorySlotContents(random.nextInt(tileentitychest.getSizeInventory()), itemstack);
    			    }
    			    m1++;
    		    } while(true);
       return true;
      }
    }


    Mob Spawner:
    public boolean generateMobSpawner(World world, int i, int j, int k, String mobName)
    {
      if(world.setBlockWithNotify i, j, k, Block.mobSpawner.blockID))
      {
       TileEntityMobSpawner ms = (TileEntityMobSpawner)world.getBlockTileEntity(i, j, k);
       if(ms == null)
       {
        return false;
       }else
       {
        ms.setMobID(mobName);
        return true;
       }
      }
      return false;
    }
    Posted in: Modification Development
  • 1

    posted a message on How do you set structure rarity?
    What I often do is just add a random call which usually sorts out rarity:

    private void generateSurface(World world, Random random, int blockX, int blockZ)
    {
    if(random.nextInt(5) == 0) //adjust the number in nextInt(). Higher values == rarer.
    {
    int Xcoord1 = blockX + random.nextInt(16);
    int Ycoord1 = random.nextInt(60);
    int Zcoord1 = blockZ + random.nextInt(16);
    (new towerDungeonEasy()).generate(world, random, Xcoord1, Ycoord1, Zcoord1);
    }
    }
    Posted in: Modification Development
  • 2

    posted a message on How do you generate ores in the end?
    I think he meant (in a cryptic way) that you have the dimension IDs for the Nether and End mixed up. The End's ID is 1, and in your code, you assume the ID is -1, which is the Nether.

    For future refrence, the Nether is -1, the Overworld is 0, and the End is 1.

    Also he is right on needing another GenMineable as the original assumes it is replacing Stone, not End Stone, thus it wouldn't show up at all. Just copypaste to a new class and replace all Stone calls with End Stone calls.
    Posted in: Modification Development
  • 0

    posted a message on trees
    Quote from microjunk

    I have the leaves code fixed, lag has been reduced a good bit, but Id still like to get them more rare so here is the mod class for a tree

    package net.minecraft.src;
    import java.util.List;
    import java.util.Random;
    import net.minecraft.client.Minecraft;
    public class mod_RainTrees extends BaseMod
    {
    public String getVersion()
    {
    
    return "1.2.5";
    
    }
    
    //Rain Tree
    public static final Block waterLeaves = new BlockWaterLeaves(185, 0).setHardness(0.2F).setLightOpacity(1).setStepSound(Block.soundGrassFootstep).setBlockName("Water Leaves").setRequiresSelfNotify();
    public static final Block waterSapling = new BlockWaterSapling(186, 0).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setBlockName("Water Sapling").setRequiresSelfNotify();
    public static final Item avocado = new ItemFood(2000, 2, 1F, false).setItemName("Avocado");
    //public static final Item treeGrowth = (new ItemTreeGrowth(2001)).setItemName("Tree Growth").setIconIndex(ModLoader.addOverride("/gui/items.png", "/micro/TreeGrowth.png"));
    
    public void load()
    {
    
    ModLoader.addName(waterLeaves,"Water Leaves");
    ModLoader.registerBlock(waterLeaves);
    waterLeaves.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/micro/WaterLeaves.png");
    
    ModLoader.addName(waterSapling,"Water Sapling");
    ModLoader.registerBlock(waterSapling);
    waterSapling.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/micro/WaterSapling.png");
    
    avocado.iconIndex = ModLoader.addOverride("/gui/items.png","/micro/Avocado.png");
    ModLoader.addName(avocado, "Avocado");
    
    //treeGrowth.iconIndex = ModLoader.addOverride("/gui/items.png", "/micro/TreeGrowth.png");
    //ModLoader.addName(treeGrowth, "Tree Growth");
    //ModLoader.addRecipe(new ItemStack(, 1), new Object[] {" S ", " SS", "S ", Character.valueOf('S'), Item.stick});
    
    }
    public void generateSurface(World world, Random rand, int chunkX, int chunkZ)
    {
    BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
    WorldGenRainTrees tree = new WorldGenRainTrees(false); //Change this to the World Gens or your tree and make sure that the parameters match if you get errors!
    if(biome instanceof BiomeGenDesert)
    {
    for(int c = 0; c < 1; c++)
    {
    int Xcoord = chunkX + rand.nextInt(16);
    int Zcoord = chunkZ + rand.nextInt(16);
    		 int i = world.getHeightValue(Xcoord, Zcoord);
    		 tree.generate(world, rand, Xcoord, i, Zcoord);
    }
    }
    }
    
    
    }


    Is there any way to make them more rare, I would be greatly appreciative


    Can you post your WorldGenRainTrees.java file, as there's probably a loop in the file creates the large amount of them.
    Posted in: Modification Development
  • 0

    posted a message on mods,bugs and youtubers
    I don't have an open beta for mods I make purely because I do not want someone stealing my work, which has happened before. I also have a slower pace at modding, so keeping it closed allows me to update it at my own pace.
    Posted in: Mods Discussion
  • 0

    posted a message on Communicating to Client from Integrated Server
    Something i've noticed is that all new AI Task functions have no clientside counterpart (ie they are never called clientside), and thus adding clientside-only functions (such as spawning particles) doesn't work. If this were a dedicated server, i'd just send a custom packet containing the particle data, but since this is Integrated that option isn't available. Trying to spawn them from Minecraft.getMinecraft().theWorld doesn't work either.

    Anyone have any insight on how to do this?
    Posted in: Modification Development
  • 0

    posted a message on How to trap the wither
    Quote from Ttzara

    Its highly improbable that Mojang allows us to put the wither on minecarts and if they do, its going to be ridiculous... i mean trap a boss in a minecart to make its killing easier.... doesnt sounds likely man, they are going to fix that if they didnt fixed it already... or at least as soon as any mojang memmber sees that is possible.

    Another way to avoid this is making the wither only spawnable in a certain area but who knows how is going to be.


    This would be correct if not for the fact that Ender Dragons can be put in minecarts. This is because ANY entity can be put into a minecart (even particles count as 'entities' that the minecart can hold, it just doesn't normally do it. You can set a particle to it tho, it's really funny) It's *REALLY* hard to do it legit, but by manually spawning it you can get it into a minecart.
    Posted in: Recent Updates and Snapshots
  • 3

    posted a message on How to trap the wither
    I have succeeded in making a garenteed way to get the Wither into a minecart with minimal chances of escape.Firstly it builds on the design shown in this thread to keep the wither in one spot without movement. You place one water block under the top stone block, and wait for the Wither to break it (from drowning damage). Then you pull the bottommost lever, which drops a sand block in the middle, wither falls and pushes minecart, thus mounting it, and your free to do what you want with the minecart'd Wither. (in the screen above I just threw it into a deep pool of water. It never dies but periodically breaks the water blocks lol.Notice how the minecart is not on it's rail but halfway over the edge. This is important, to make sure the Wither pushes the cart which will make it mount it. The sand block being held up by iron bars is important too; a normal block left enough footing to prevent the Wither from falling down. (these can be replaced with glass panes or fences; both work.) When the sand block falls down into the hole, it finished a redstone curcuit and the rail the minecart is on gets powered, pushing it (and the Wither) off to wherever you choose.As for killing him, I had an idea. The Wither cannot break bedrock, but it's not easily available. HOWEVER, there is one place where is it set up so it can be used to suffocate him: The Nether's ceiling.If you dump the cart there he can die of suffocation damage and not break the blocks suffocating him.EDIT: based on my tests, the above method not only works, you can freely go up and hit him with a sword and he can't fight back!
    Posted in: Recent Updates and Snapshots
  • 0

    posted a message on Entity with Multiple Types
    Quote from Cimera42

    I've played around a bit and found that the problem is in ModLoader.registerEntityID part. As it uses the actual EntityChair.class file, each entity that is made with it changes it's ID.
    This leads to a problem in spawnEntity method, which makes it always return the last entityID that was registered to the entity class.

    This is what my problem is, no matter what I do in the spawning method in the item file, it always spawns the entity with the fourth texture.


    Then why not just have it load the texture in the spawnEntity method?

    ie use w/e your using to get the texture set up, put it in it's own method, and call the method right after making the EntityChar instance:
    public Entity spawnEntity(int var1, World var2, double var3, double var5, double var7)
    {
    if(var1 == 240)
    {
    EntityChair entitychair = new EntityChair(var2, 0);
    entitychair.setTextureFromItem(); // something like this
    return entitychair;
    }
    else
    {
    return null;
    }
    }
    Posted in: Modification Development
  • 0

    posted a message on How to trap the wither
    So I did some testing and came to some conclusions:

    1. This still works if you place the water block after spawning him, while he is charging.
    2. Wait until he takes drowning damage, as he then breaks the water block.
    3. Build a rail system to the trap and 'fire' a minecart into the trap.

    Once the Wither is in a minecart, it suddenly is much less threatening. It loses his ability to break blocks and essentially becomes neutral, only attacking things that attack it. I haven't tested if this works with the player but it has not attacked any mobs I've spawned.
    Posted in: Recent Updates and Snapshots
  • To post a comment, please or register a new account.