Advertisement
Modder112

TileEntityTest.java

Aug 30th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3. import net.minecraft.client.Minecraft;
  4. import dan200.computer.api.IComputerAccess;
  5. import dan200.computer.api.IPeripheral;
  6.  
  7. public class TileEntityTest extends TileEntity implements IPeripheral{
  8.    
  9.     public Minecraft mcc = ModLoader.getMinecraftInstance();
  10.     public boolean canAttachToSide(int side)
  11.     {
  12.         return true;
  13.     }
  14.  
  15.      public String getType()
  16.       {
  17.         return "casblock";
  18.       }
  19.    
  20.     public String[] getMethodNames()
  21.     {
  22.        String[] methods = { "getstring" };
  23.  
  24.        return methods;
  25.      }
  26.  
  27.      
  28.       public Object[] callMethod(IComputerAccess arg0, int arg1, Object[] arg2)
  29.                 throws Exception
  30.         {
  31.                 if (arg1 == 0)
  32.                 {
  33.                     return new Object[] { "This is a CC Test Mod!" };
  34.                 }
  35.                 else {                 
  36.                     return new Object[] { "Dieses Argument kenne ich nicht!" };
  37.                 }
  38.     }
  39.  
  40.     @Override
  41.     public void attach(IComputerAccess computer, String computerSide) {
  42.         mcc.thePlayer.sendChatMessage("Addet to " + computer.getID() + " on side " + computerSide);
  43.         computer.mountFixedDir("rom/apis/testmod", "mods/ModTets/casmods/mod_tets/code.lua", true);
  44.     }
  45.  
  46.     @Override
  47.     public void detach(IComputerAccess computer) {
  48.         computer.unmount("rom/apis/testmod");
  49.             }
  50.    
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement