Jump to content

opssemnik

Members
  • Posts

    269
  • Joined

  • Last visited

Posts posted by opssemnik

  1. @PreInit

    public void LEARNMOREJAVA(FMLPreInitializationEvent e){

    MinecraftForge.EVENT_BUS.register(this)

    }

    public void DONTBEANOOB(LivingDeathEvent e){

    if(e.entity instanceof EntityPig){

    e.entity.dropItem(MOD.ITEM.itemID, quantity);

    }

    }

    OR

    @PreInit

    public void LEARNMOREJAVA(FMLPreInitializationEvent e){

    MinecraftForge.EVENT_BUS.register(this)

    }

    public void DONTBEANOOB(LivingDropsEvent e){

    if(e.entity instanceof EntityPig){

    e.entity.dropItem(MOD.ITEM.itemID, quantity);

    }

    }

     

  2. just check to see if hasNoSky is false. minecraft use this boolean to create a random spawn point in surface :) (u can take a look how minecraft create this spawn point, because it only creates at surface, but the better way it just see, if hasNoSky returned false, u do the temperature things, the most real way, its getting the biome temperature and checking if is raining or not.

  3. OLD CODE

    public IChunkProvider getChunkProvider()

    {

     

      return new ChunkProviderTheVoid(worldObj, worldObj.getSeed(), false);

     

    }

    ITS NOW

    public IChunkProvider createChunkGenerator()

    {

     

      return new ChunkProviderTheVoid(worldObj, worldObj.getSeed(), false);

     

    }

    ...

  4. in client proxy

        KeyBindingRegistry.registerKeyBinding(new MyKeys());

    then

    package RPGCraft.central;

     

    import java.util.EnumSet;

     

    import org.lwjgl.input.Keyboard;

     

    import net.minecraft.client.Minecraft;

    import net.minecraft.client.settings.KeyBinding;

    import net.minecraft.src.ModLoader;

    import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler;

    import cpw.mods.fml.common.TickType;

     

    public class MyKeys extends KeyHandler {

     

    public QuestKeys(KeyBinding[] keyBindings, boolean[] repeatings) {

    super(keyBindings, repeatings);

    // TODO Auto-generated constructor stub

    }

     

    @Override

    public String getLabel() {

     

    return "Quests";

    }

     

    @Override

    public void keyDown(EnumSet<TickType> types, KeyBinding kb,

    boolean tickEnd, boolean isRepeat) {

     

      if(!tickEnd ){

            //do other things the kb.keyCode its the pressed key

    System.out.println(kb.keyCode);

    }

     

    }

     

    @Override

    public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) {

    // TODO Auto-generated method stub

     

    }

     

    @Override

    public EnumSet<TickType> ticks() {

    // TODO Auto-generated method stub

    return EnumSet.of(TickType.CLIENT);

    }

     

    }

     

  5. hope this helps

    @PreInit

    public void myEventsForBiomes(FMLPreInitializationEvent e){

    MinecraftForge.TERRAIN_GEN_BUS.register(this);

    }

    @ForgeSubscribe

    public void my_biomes(BiomeEvent.BlockReplacement e){

    if(e.biome.topBlock == Block.grass.blockID){

    e.biome.topBlock = (byte)Block.bed.blockID;

    }

    }

    this will change the grass to bed, but u can do other things

  6. instead of creating strings and stuff, just create an object of the list, and then you check if the obj instanceof Block.torchWood

     

    like

          //player coordinates
                        int plX = (int)Minecraft.getMinecraft().thePlayer.posX;
          int plY = (int)Minecraft.getMinecraft().thePlayer.posY;
          int plZ = (int)Minecraft.getMinecraft().thePlayer.posZ;
                        //the radius of your player->Block detection
                        double boundingBoxRadius = 3;                    
    
                //that it'll work only if the player is there
                if(Minecraft.getMinecraft().thePlayer != null)
         {
                        //set the box for collision detection with other boxes
                        AxisAlignedBB var4 = AxisAlignedBB.getBoundingBox(plX, plY, plZ, plX + 1.0D, plY + 1.0D, plZ + 1.0D).expand(boundingBoxRadius , boundingBoxRadius , boundingBoxRadius);
                        //get all colliding boundingBoxes with our var4 box
          List list = Minecraft.getMinecraft().theWorld.getAllCollidingBoundingBoxes(var4);
                 
                        //only work if theres something in the list
                 if(list != null)
                 {
                      Object obj = list;//or list.iterator; or list.iterator.hasNext();    
                      if(obj instanceof BlockTorch){
                            
                              System.out.println("FOUND TORCH!"); 
                       }
                  
                          
                }

×
×
  • Create New...

Important Information

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