Jump to content

drinfernoo

Members
  • Posts

    59
  • Joined

  • Last visited

Posts posted by drinfernoo

  1. Thanks for the hint about editable source :-)

     

    -TGG

     

    I believe the hint was that you shouldn't edit Vanilla code. Any mods should be written from scratch (or using APIs), rather than editing base code, so as to retain the maximum compatibility and ease of porting between versions. That's kind of the point of everything Forge has been working towards :D

  2. So Srg2Source will effectively decrease the amount of time and effort it takes to go from MCP release to Forge/Bukkit/etc... release in future versions? Will it have any impact on the initial effort of updating MCP?

  3. It kind of depends on which mod, and what you mean by "does it not work like that". Basically, mods built with ModLoader should work that way, since Forge has FML. However, mods which edit base classes or for some other reason require that they are installed in the Jar usually won't work by just dropping them in the mods folder. We've come a long way, but it seems like there are still a handful of mods that still go back to those archaic roots :D

  4. I have been having an issue with not being able to texture my blocks correctly. This is the first mod I've written for 1.5.1, and I think I have mostly everything figured out except the textures. I have a block with 15 metadata values, but when it shows up in-game or in eclipse, there is no texture.

     

    The original thread is here and has more information.

     

    Thank you!

  5. It did not work :[ This is my code:

     

    package redx36.enderite;
    
    import java.util.Random;
    
    import net.minecraft.src.IChunkProvider;
    import net.minecraft.src.World;
    import net.minecraft.src.WorldGenMinable;
    import cpw.mods.fml.common.IWorldGenerator;
    
    public class EnderiteWorldGenerator implements IWorldGenerator {
    
    @Override
    public void generate (final Random random, final int chunkX, final int chunkZ, final World world, final IChunkProvider chunkGenerator, final IChunkProvider chunkProvider) {
    
    	if (world.provider.dimensionId == 1) {
    
    		for (int i = 0; i < 30; i++) {
    
    			final int randPosX = chunkX + random.nextInt(16);
    			final int randPosY = random.nextInt(64);
    			final int randPosZ = chunkZ + random.nextInt(16);
    
    			new WorldGenMinable(Enderite.enderiteOre.blockID, 10).generate(world, random, randPosX, randPosY, randPosZ);
    
    		}
    
    	}
    
    }
    
    }

     

    The first thing I noticed is that you shouldn't have the final keyword in front of the variables in your method.

     

    What is it not doing? Does it not generate, or does it give an error, or a crash? What's going on? I am currently using this method to generate ores and structures in two different dimensions in the mod I've been working on.

  6. I actually wrote a tutorial on this :)

     

    Basically, follow my tutorial, but put your generation code in the generateEnd() method. Also, this would work for any dimension ID (just add a switch case), just in case you ever made your own dimensions.

     

    It's also how you make structures and such generate, simply by changing WorldGenMinable to WorldGenYourStructure, written with a bunch of setBlock()'s to build your structure :)

  7. So I actually figured it out!

     

    Here's my code, from the item I'm using as a "portal":

            @Override
    public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
    	System.out.println(world.provider.getDimensionName());
    
    	switch(world.provider.dimensionId) {
    	case 1885:
    		travelTime(0, player);
    		break;
    	case 0:
    		travelTime(1885, player);
    		break;
    	}
    	return stack;
    }
    
    public void travelTime(int dimensionID, Entity player) {
    	if (!player.worldObj.isRemote && !player.isDead) {
    		MinecraftServer mcServer = MinecraftServer.getServer();
    		WorldServer newWorld = mcServer.worldServerForDimension(dimensionID);
    
    		mcServer.getConfigurationManager().transferPlayerToDimension((EntityPlayerMP)player, dimensionID, new TimeTeleporter(newWorld));
    	}
    }
    

    My TimeTeleporter() class is just an extension of Teleporter, but to use the same basic Teleporter as default, you should use this:

    mcServer.worldServerForDimension(dimensionID).func_85176_s()
    

    as the third parameter :)

  8. From what I understand, the shift-click thing is actually a different method (I can't remember what it's called), but I do know that in order to restrict what items can go into/come out of a Slot, you have to make your own Slot class that extends Slot, and then override some methods so it does what you want.

  9. No sure exactly, but I believe that method is for when you pick up a single/multiple item(s) from the stack, and it combines them. You know, so that if you have three picked up and you pick up another, it takes one away from the Slot and then you have five.

     

    I think.

  10. My dimension isn't working right but I did find a function for the transfer:

     

    transferToDimension that is in the EntityPlayer class... seems to get around those other issues I ran into trying to do it the other way.

     

    Did you finally get it working?

     

    I ended up using

    mcServer.getConfigurationManager().transferEntityToWorld(player, dimensionID, currentWorld, newWorld, new Teleporter(newWorld));

    But it gives me some wierd errors, as well as not teleporting me to the right place.

     

    The Teleporter problem I can fix, the error it gives me is if I try to use it twice in a row, like to go back to the Dimension I just left, it crashes saying something about "Entity is already being tracked!", and I can't figure out what's wrong.

     

    I can use the transferToDimension one, but it makes a Teleporter wherever I transport to, and then I just fall back into it, which isn't very helpful :P Thus, I am trying to specify a custom Teleporter so that it won't make the portal everytime I use my item.

  11. I am working on a mod where I have an item that acts as a portal, and transports you between "Dimensions". In order to test it, I have an Item with this method:

     

     

     

    @Override
    public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
    	switch(world.provider.dimensionId) {
    	case -1:
    		player.travelToDimension(0);
    		break;
    	case 0:
    		player.travelToDimension(-1);
    		break;
    	}
    	return stack;
    }
    

     

     

     

    I was hoping that would bounce me back and forth between the Overworld and the Nether. However, whenever I use it, it makes a Nether Portal wherever I teleport to, and I'm automatically in it, so it sends me back. Is there a way to not make it make that portal? Or is that part of travelToDimension()? I don't really want the portals there, because I'm going to be making more Dimensions, and I want to only go between them with my Item.

     

    The Item shows up, works, and everything is good, except for the teleporting :P

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.