streamlined teleport code
fixed bug with FoR
This commit is contained in:
@@ -2,10 +2,14 @@ package StevenDimDoors.mod_pocketDim;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -39,26 +43,42 @@ public class BlockDimWall extends Block
|
||||
{
|
||||
if(!par1World.isRemote&&entityPlayer.getCurrentEquippedItem()!=null)
|
||||
{
|
||||
Item playerEquip = entityPlayer.getCurrentEquippedItem().getItem();
|
||||
|
||||
if(!(playerEquip instanceof ItemBlock))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Block block= Block.blocksList[playerEquip.itemID];
|
||||
if(!Block.isNormalCube(playerEquip.itemID))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(block instanceof BlockContainer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(entityPlayer.getCurrentEquippedItem().getItem() instanceof ItemBlock)
|
||||
{
|
||||
|
||||
|
||||
if(!entityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
entityPlayer.getCurrentEquippedItem().stackSize--;
|
||||
}
|
||||
par1World.setBlockAndMetadataWithNotify(par2, par3, par4, entityPlayer.getCurrentEquippedItem().itemID, entityPlayer.getCurrentEquippedItem().getItemDamage());
|
||||
par1World.setBlockAndMetadata(par2, par3, par4, entityPlayer.getCurrentEquippedItem().itemID, entityPlayer.getCurrentEquippedItem().getItemDamage());
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
if(par1World.isRemote&&entityPlayer.getCurrentEquippedItem()!=null)
|
||||
else
|
||||
{
|
||||
|
||||
if(entityPlayer.getCurrentEquippedItem().getItem() instanceof ItemBlock)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user