Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.drin.mods.time;
- import net.minecraft.src.EntityPlayer;
- import net.minecraft.src.EntityPlayerMP;
- import net.minecraft.src.Item;
- import net.minecraft.src.ItemStack;
- import net.minecraft.src.World;
- public class TimeMachine extends Item {
- public TimeMachine(int id, int spriteIndex) {
- super(id);
- setIconIndex(spriteIndex);
- setItemName("timeMachine");
- setCreativeTab(TimeTravelMod.tabTimeTravel);
- }
- @Override
- public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
- System.out.println(world.provider.getDimensionName());
- switch(world.provider.dimensionId) {
- case -1:
- TimeTravelMod.mcServer.getConfigurationManager().transferPlayerToDimension((EntityPlayerMP)player, 0, new TimeTeleporter(TimeTravelMod.mcServer.worldServerForDimension(0)));
- break;
- case 0:
- TimeTravelMod.mcServer.getConfigurationManager().transferPlayerToDimension((EntityPlayerMP)player, 1885, new TimeTeleporter(TimeTravelMod.mcServer.worldServerForDimension(1885)));
- break;
- }
- return stack;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement