Advertisement
drinfernoo

Untitled

Dec 1st, 2012
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. package com.drin.mods.time;
  2.  
  3. import net.minecraft.src.EntityPlayer;
  4. import net.minecraft.src.EntityPlayerMP;
  5. import net.minecraft.src.Item;
  6. import net.minecraft.src.ItemStack;
  7. import net.minecraft.src.World;
  8.  
  9. public class TimeMachine extends Item {
  10.    
  11.     public TimeMachine(int id, int spriteIndex) {
  12.         super(id);
  13.         setIconIndex(spriteIndex);
  14.         setItemName("timeMachine");
  15.         setCreativeTab(TimeTravelMod.tabTimeTravel);
  16.     }
  17.    
  18.     @Override
  19.     public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
  20.         System.out.println(world.provider.getDimensionName());
  21.         switch(world.provider.dimensionId) {
  22.         case -1:
  23.             TimeTravelMod.mcServer.getConfigurationManager().transferPlayerToDimension((EntityPlayerMP)player, 0, new TimeTeleporter(TimeTravelMod.mcServer.worldServerForDimension(0)));
  24.             break;
  25.         case 0:
  26.             TimeTravelMod.mcServer.getConfigurationManager().transferPlayerToDimension((EntityPlayerMP)player, 1885, new TimeTeleporter(TimeTravelMod.mcServer.worldServerForDimension(1885)));
  27.             break;
  28.         }
  29.         return stack;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement