More Progress on Rewrite
Continued fixing things across various classes to make them work with our new core classes. I've also cleaned up indentation and random code snippets along the way.
This commit is contained in:
@@ -2,12 +2,8 @@ package StevenDimDoors.mod_pocketDim.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -16,40 +12,25 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.core.PocketManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class itemRiftRemover extends Item
|
||||
{
|
||||
private Material doorMaterial;
|
||||
|
||||
public itemRiftRemover(int par1, Material par2Material)
|
||||
{
|
||||
super(par1);
|
||||
this.setMaxStackSize(1);
|
||||
// this.setTextureFile("/PocketBlockTextures.png");
|
||||
this.setCreativeTab(mod_pocketDim.dimDoorsCreativeTab);
|
||||
|
||||
// this.itemIcon=6;
|
||||
this.setMaxDamage(5);
|
||||
this.hasSubtypes=true;
|
||||
//TODO move to proxy
|
||||
this.hasSubtypes = true;
|
||||
}
|
||||
|
||||
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon(mod_pocketDim.modid + ":" + this.getUnlocalizedName());
|
||||
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack par1ItemStack)
|
||||
{
|
||||
// adds effect if item has a link stored
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static MovingObjectPosition getBlockTarget(World par1World, EntityPlayer par2EntityPlayer, boolean par3)
|
||||
@@ -78,59 +59,27 @@ public class itemRiftRemover extends Item
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
{
|
||||
MovingObjectPosition hit = this.getBlockTarget(par3EntityPlayer.worldObj, par3EntityPlayer, false );
|
||||
if(hit!=null)
|
||||
{
|
||||
//System.out.println(hit.hitVec);
|
||||
if(PocketManager.instance.removeRift(par2World, hit.blockX, hit.blockY, hit.blockZ, 1, par3EntityPlayer, par1ItemStack))
|
||||
{
|
||||
par3EntityPlayer.worldObj.playSoundAtEntity(par3EntityPlayer,"mods.DimDoors.sfx.riftClose", (float) .8, 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// dimHelper.removeRift( par3World, par4, par5, par6, range, par2EntityPlayer, par1ItemStack);
|
||||
|
||||
|
||||
}
|
||||
MovingObjectPosition hit = getBlockTarget(par3EntityPlayer.worldObj, par3EntityPlayer, false);
|
||||
if (hit != null)
|
||||
{
|
||||
if (PocketManager.removeRift(par2World, hit.blockX, hit.blockY, hit.blockZ, 1, par3EntityPlayer, par1ItemStack))
|
||||
{
|
||||
par3EntityPlayer.worldObj.playSoundAtEntity(par3EntityPlayer,"mods.DimDoors.sfx.riftClose", 0.8f, 1);
|
||||
}
|
||||
}
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* allows items to add custom lines of information to the mouseover description
|
||||
*/
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
|
||||
|
||||
par3List.add("Use near exposed rift");
|
||||
par3List.add ("to remove it and");
|
||||
par3List.add("any nearby rifts");
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if(!par2World.isRemote)
|
||||
{
|
||||
/**
|
||||
//creates the first half of the link on item creation
|
||||
int key= dimHelper.instance.createUniqueInterDimLinkKey();
|
||||
LinkData linkData= new LinkData(par2World.provider.dimensionId,MathHelper.floor_double(par3EntityPlayer.posX),MathHelper.floor_double(par3EntityPlayer.posY),MathHelper.floor_double(par3EntityPlayer.posZ));
|
||||
System.out.println(key);
|
||||
|
||||
dimHelper.instance.interDimLinkList.put(key, linkData);
|
||||
par1ItemStack.setItemDamage(key);
|
||||
**/
|
||||
}
|
||||
}
|
||||
par3List.add("Use near exposed rift");
|
||||
par3List.add("to remove it and");
|
||||
par3List.add("any nearby rifts.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user