Jump to content

opssemnik

Members
  • Posts

    269
  • Joined

  • Last visited

Posts posted by opssemnik

  1. remove it from Blocks.class would be too much hasle, you could just hook the method that makes the block portal (i dont remember if its block obsidian or  item flint and steel).

    I have a old utility class that i done back in 1.3 that replaces classes at runtime (all of it, not just one), i could send for you to take a look, but it would be better to look if forge already provides hook for that, or if use asm, replace just the method itself, not the whole class

  2. just a bit of hijack(sorry), but i use asm to replace items, blocks and remove some entities,while i do a bunch of sanity checks, can it still corrupt worlds? if so, do i need to hook the world load/save events and make backups of the world? thanks

    edit:

    its just me or this guy decompiled a mod using JAD? (hence line numbers and obfuscated names)

  3.  

     

    public boolean placeBook(EntityPlayer entityPlayer, TileEntityDesk tileEntityDesk)
     {
    	 ItemStack book = entityPlayer.getHeldItem();
    	 if(book != null)
    	 {
    		 Item bookTest = book.getItem();
    		 if(bookTest instanceof ItemBook)
    		 {
    			 int bookReturn = tileEntityDesk.addBook(book);
    			 if(bookReturn == 0)
    			 {
    				 entityPlayer.inventory.mainInventory[entityPlayer.inventory.currentItem] = null;
    
    			 }
    			 if(bookReturn > 0)
    			 {
    				 entityPlayer.inventory.mainInventory[entityPlayer.inventory.currentItem] = book;
    				 return true;
    			 }
    		 }
    	 }
    	 return false;
     }
    

     

     

    TO

     

    public boolean placeBook(EntityPlayer entityPlayer, TileEntityDesk tileEntityDesk)
     {
    	 ItemStack book = entityPlayer.getHeldItem();
                     int stackSZ =0;
    	 if(book != null)
    	 {
                               stackSZ = book.stackSize;
    		 Item bookTest = book.getItem();
    		 if(bookTest instanceof ItemBook)
    		 {
    			 int bookReturn = tileEntityDesk.addBook(book);
    			 if(bookReturn == 0)
    			 {
    				 entityPlayer.inventory.mainInventory[entityPlayer.inventory.currentItem] = null;
    
    			 }
    			 if(bookReturn > 0)
    			 {
    				book.stackSize = stackSZ-1;
                                           entityPlayer.inventory.mainInventory[entityPlayer.inventory.currentItem] = book;
    				 return true;
    			 }
    		 }
    	 }
    	 return false;
     }
    

     

     

  4. Tip: if you have problems that you cant solve, and inolves inventory stuff, just look iron chest source on cpw´s github, if the problem is new names, just look at commits and see what cpw has changed.

    (i wouldn´t recommend minecraft because you did this thread as you couldn´t look at minecraft source correctly, so using the iron chest one is more easier because of the commits)

  5. MovingObjectPosition m = new MovingObjectPosition(e.entityPlayer);

    if(!e.entityPlayer.worldOb.isRemote && (e.entityPlayer.worldObj.getBlock(m.blockX, m.blockY, m.blockZ) == Block.furnaceIdle ||e.entityPlayer.worldObj.getBlock(m.blockX, m.blockY, m.blockZ) == Block.furnaceActivated)){

    //do your stuff

    }

     

    Edit if you want a smp mod..., send the messages on the furnace destroy event, the same way as i told you to use on the interact event.....

×
×
  • Create New...

Important Information

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