コード例 #1
0
 public void updateCraftingInventorySlot(CraftingInventoryCB craftinginventorycb, int i, ItemStack itemstack)
 {
     if (craftinginventorycb.getSlot(i) is SlotCrafting)
     {
         return;
     }
     if (isChangingQuantityOnly)
     {
         return;
     }
     else
     {
         playerNetServerHandler.sendPacket(new Packet103(craftinginventorycb.windowId, i, itemstack));
         return;
     }
 }
コード例 #2
0
ファイル: EntityPlayer.cs プロジェクト: riverar/Crafty
 public EntityPlayer(World world)
     : base(world)
 {
     inventory = new InventoryPlayer(this);
     field_9152_am = 0;
     score = 0;
     isSwinging = false;
     swingProgressInt = 0;
     damageRemainder = 0;
     fishEntity = null;
     personalCraftingInventory = new CraftingInventoryPlayerCB(inventory, !world.singleplayerWorld);
     currentCraftingInventory = personalCraftingInventory;
     yOffset = 1.62F;
     ChunkCoordinates chunkcoordinates = world.func_22078_l();
     setLocationAndAngles(chunkcoordinates.posX + 0.5D, chunkcoordinates.posY + 1,
                          chunkcoordinates.posZ + 0.5D, 0.0F, 0.0F);
     health = 20;
     entityType = "humanoid";
     field_9117_aI = 180F;
     fireResistance = 20;
     texture = "/mob/char.png";
 }
コード例 #3
0
        public EntityPlayer(World world) : base(world)
        {
            inventory                 = new InventoryPlayer(this);
            field_9152_am             = 0;
            score                     = 0;
            isSwinging                = false;
            swingProgressInt          = 0;
            damageRemainder           = 0;
            fishEntity                = null;
            personalCraftingInventory = new CraftingInventoryPlayerCB(inventory, !world.singleplayerWorld);
            currentCraftingInventory  = personalCraftingInventory;
            yOffset                   = 1.62F;
            ChunkCoordinates chunkcoordinates = world.func_22078_l();

            setLocationAndAngles(chunkcoordinates.posX + 0.5D, chunkcoordinates.posY + 1,
                                 chunkcoordinates.posZ + 0.5D, 0.0F, 0.0F);
            health         = 20;
            entityType     = "humanoid";
            field_9117_aI  = 180F;
            fireResistance = 20;
            texture        = "/mob/char.png";
        }
コード例 #4
0
ファイル: EntityPlayer.cs プロジェクト: riverar/Crafty
 public virtual void usePersonalCraftingInventory()
 {
     currentCraftingInventory = personalCraftingInventory;
 }
コード例 #5
0
ファイル: EntityPlayer.cs プロジェクト: riverar/Crafty
 public override void onUpdate()
 {
     if (isPlayerSleeping())
     {
         sleepTimer++;
         if (sleepTimer > 100)
         {
             sleepTimer = 100;
         }
         if (!inBed())
         {
             wakeUpPlayer(true, true);
         }
         else if (!worldObj.singleplayerWorld && worldObj.isDaytime())
         {
             wakeUpPlayer(false, true);
         }
     }
     else if (sleepTimer > 0)
     {
         sleepTimer++;
         if (sleepTimer >= 110)
         {
             sleepTimer = 0;
         }
     }
     base.onUpdate();
     if (!worldObj.singleplayerWorld && currentCraftingInventory != null &&
         !currentCraftingInventory.canInteractWith(this))
     {
         usePersonalCraftingInventory();
         currentCraftingInventory = personalCraftingInventory;
     }
     field_20047_ay = field_20050_aB;
     field_20046_az = field_20049_aC;
     field_20051_aA = field_20048_aD;
     double d = posX - field_20050_aB;
     double d1 = posY - field_20049_aC;
     double d2 = posZ - field_20048_aD;
     double d3 = 10D;
     if (d > d3)
     {
         field_20047_ay = field_20050_aB = posX;
     }
     if (d2 > d3)
     {
         field_20051_aA = field_20048_aD = posZ;
     }
     if (d1 > d3)
     {
         field_20046_az = field_20049_aC = posY;
     }
     if (d < -d3)
     {
         field_20047_ay = field_20050_aB = posX;
     }
     if (d2 < -d3)
     {
         field_20051_aA = field_20048_aD = posZ;
     }
     if (d1 < -d3)
     {
         field_20046_az = field_20049_aC = posY;
     }
     field_20050_aB += d*0.25D;
     field_20048_aD += d2*0.25D;
     field_20049_aC += d1*0.25D;
 }
コード例 #6
0
 public void updateCraftingInventoryInfo(CraftingInventoryCB craftinginventorycb, int i, int j)
 {
     playerNetServerHandler.sendPacket(new Packet105(craftinginventorycb.windowId, i, j));
 }
コード例 #7
0
 public void updateCraftingInventory(CraftingInventoryCB craftinginventorycb, List list)
 {
     playerNetServerHandler.sendPacket(new Packet104(craftinginventorycb.windowId, list));
     playerNetServerHandler.sendPacket(new Packet103(-1, -1, inventory.getItemStack()));
 }
コード例 #8
0
        public override void onUpdate()
        {
            if (isPlayerSleeping())
            {
                sleepTimer++;
                if (sleepTimer > 100)
                {
                    sleepTimer = 100;
                }
                if (!inBed())
                {
                    wakeUpPlayer(true, true);
                }
                else if (!worldObj.singleplayerWorld && worldObj.isDaytime())
                {
                    wakeUpPlayer(false, true);
                }
            }
            else if (sleepTimer > 0)
            {
                sleepTimer++;
                if (sleepTimer >= 110)
                {
                    sleepTimer = 0;
                }
            }
            base.onUpdate();
            if (!worldObj.singleplayerWorld && currentCraftingInventory != null &&
                !currentCraftingInventory.canInteractWith(this))
            {
                usePersonalCraftingInventory();
                currentCraftingInventory = personalCraftingInventory;
            }
            field_20047_ay = field_20050_aB;
            field_20046_az = field_20049_aC;
            field_20051_aA = field_20048_aD;
            double d  = posX - field_20050_aB;
            double d1 = posY - field_20049_aC;
            double d2 = posZ - field_20048_aD;
            double d3 = 10D;

            if (d > d3)
            {
                field_20047_ay = field_20050_aB = posX;
            }
            if (d2 > d3)
            {
                field_20051_aA = field_20048_aD = posZ;
            }
            if (d1 > d3)
            {
                field_20046_az = field_20049_aC = posY;
            }
            if (d < -d3)
            {
                field_20047_ay = field_20050_aB = posX;
            }
            if (d2 < -d3)
            {
                field_20051_aA = field_20048_aD = posZ;
            }
            if (d1 < -d3)
            {
                field_20046_az = field_20049_aC = posY;
            }
            field_20050_aB += d * 0.25D;
            field_20048_aD += d2 * 0.25D;
            field_20049_aC += d1 * 0.25D;
        }
コード例 #9
0
 public virtual void usePersonalCraftingInventory()
 {
     currentCraftingInventory = personalCraftingInventory;
 }