當前位置: 首頁>>代碼示例>>Java>>正文


Java BptSlotInfo類代碼示例

本文整理匯總了Java中buildcraft.api.blueprints.BptSlotInfo的典型用法代碼示例。如果您正苦於以下問題:Java BptSlotInfo類的具體用法?Java BptSlotInfo怎麽用?Java BptSlotInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BptSlotInfo類屬於buildcraft.api.blueprints包,在下文中一共展示了BptSlotInfo類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: rotateLeft

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
	int orientation = (slot.meta & 3);
	int others = slot.meta - orientation;

	switch (orientation) {
	case 0:
		slot.meta = 1 + others;
		break;
	case 1:
		slot.meta = 2 + others;
		break;
	case 2:
		slot.meta = 3 + others;
		break;
	case 3:
		slot.meta = 0 + others;
		break;
	}
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:21,代碼來源:BptBlockDoor.java

示例2: rotateLeft

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
	switch (slot.meta) {
	case 0:
		slot.meta = 1;
		break;
	case 1:
		slot.meta = 2;
		break;
	case 2:
		slot.meta = 3;
		break;
	case 3:
		slot.meta = 0;
		break;
	}
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:18,代碼來源:BptBlockPumpkin.java

示例3: rotateLeft

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
	final int XPos = 2;
	final int XNeg = 1;
	final int ZPos = 4;
	final int ZNeg = 3;

	switch (slot.meta) {
	case XPos:
		slot.meta = ZPos;
		break;
	case ZNeg:
		slot.meta = XPos;
		break;
	case XNeg:
		slot.meta = ZNeg;
		break;
	case ZPos:
		slot.meta = XNeg;
		break;
	}
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:23,代碼來源:BptBlockWallSide.java

示例4: rotateLeft

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
	switch (slot.meta) {
	case 0:
		slot.meta = 2;
		break;
	case 1:
		slot.meta = 3;
		break;
	case 2:
		slot.meta = 1;
		break;
	case 3:
		slot.meta = 0;
		break;
	}
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:18,代碼來源:BptBlockStairs.java

示例5: rotateLeft

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
	int step = slot.meta - (slot.meta & 3);

	switch (slot.meta - step) {
	case 0:
		slot.meta = 1 + step;
		break;
	case 1:
		slot.meta = 2 + step;
		break;
	case 2:
		slot.meta = 3 + step;
		break;
	case 3:
		slot.meta = 0 + step;
		break;
	}
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:20,代碼來源:BptBlockRedstoneRepeater.java

示例6: rotateLeft

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
	int orientation = (slot.meta & 7);
	int others = slot.meta - orientation;

	switch (orientation) {
	case 0:
		slot.meta = 1 + others;
		break;
	case 1:
		slot.meta = 2 + others;
		break;
	case 2:
		slot.meta = 3 + others;
		break;
	case 3:
		slot.meta = 0 + others;
		break;
	}
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:21,代碼來源:BptBlockBed.java

示例7: buildBlock

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
	context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);
	context.world().setBlock(slot.x, slot.y + 1, slot.z, slot.blockId, slot.meta + 8,1);

	context.world().setBlockMetadataWithNotify(slot.x, slot.y + 1, slot.z, slot.meta + 8,1);
	context.world().setBlockMetadataWithNotify(slot.x, slot.y, slot.z, slot.meta,1);

}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:10,代碼來源:BptBlockDoor.java

示例8: rotateLeft

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
	if (!isWall) {
		double angle = ((slot.meta) * 360.0) / 16.0;
		angle += 90.0;
		if (angle >= 360) {
			angle -= 360;
		}
		slot.meta = (int) (angle / 360.0 * 16.0);
	} else {
		// slot.meta = ForgeDirection.values()[slot.meta].rotateLeft().ordinal();
	}
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:14,代碼來源:BptBlockSign.java

示例9: buildBlock

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
	super.buildBlock(slot, context);

	IInventory inv = (IInventory) context.world().getBlockTileEntity(slot.x, slot.y, slot.z);

	for (int i = 0; i < inv.getSizeInventory(); ++i) {
		inv.setInventorySlotContents(i, null);
	}

}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:12,代碼來源:BptBlockRotateInventory.java

示例10: addRequirements

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
	BptSlotInfo newSlot = slot.clone();
	slot.blockId = delegateTo;

	if (BlueprintManager.blockBptProps[delegateTo] != null) {
		BlueprintManager.blockBptProps[delegateTo].addRequirements(newSlot, context, requirements);
	} else {
		super.addRequirements(newSlot, context, requirements);
	}
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:12,代碼來源:BptBlockDelegate.java

示例11: isValid

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public boolean isValid(BptSlotInfo slot, IBptContext context) {
	BptSlotInfo newSlot = slot.clone();
	slot.blockId = delegateTo;

	if (BlueprintManager.blockBptProps[delegateTo] != null)
		return BlueprintManager.blockBptProps[delegateTo].isValid(newSlot, context);
	else
		return super.isValid(newSlot, context);
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:11,代碼來源:BptBlockDelegate.java

示例12: rotateLeft

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
	BptSlotInfo newSlot = slot.clone();
	slot.blockId = delegateTo;

	if (BlueprintManager.blockBptProps[delegateTo] != null) {
		BlueprintManager.blockBptProps[delegateTo].rotateLeft(newSlot, context);
	} else {
		super.rotateLeft(newSlot, context);
	}
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:12,代碼來源:BptBlockDelegate.java

示例13: rotateLeft

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
	int pos = slot.meta & infoMask;
	int others = slot.meta - pos;

	if (rotateForward) {
		if (pos == rot[0]) {
			pos = rot[1];
		} else if (pos == rot[1]) {
			pos = rot[2];
		} else if (pos == rot[2]) {
			pos = rot[3];
		} else if (pos == rot[3]) {
			pos = rot[0];
		}
	} else {
		if (pos == rot[0]) {
			pos = rot[3];
		} else if (pos == rot[1]) {
			pos = rot[2];
		} else if (pos == rot[2]) {
			pos = rot[0];
		} else if (pos == rot[3]) {
			pos = rot[1];
		}
	}

	slot.meta = pos + others;
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:30,代碼來源:BptBlockRotateMeta.java

示例14: rotateLeft

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
	int status = slot.meta - (slot.meta & 7);

	slot.meta -= status;
	super.rotateLeft(slot, context);
	slot.meta += status;

}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:10,代碼來源:BptBlockLever.java

示例15: buildBlock

import buildcraft.api.blueprints.BptSlotInfo; //導入依賴的package包/類
@Override
public void buildBlock(BptSlotInfo slot, IBptContext context) {
	if ((slot.meta & 8) != 0)
		return;

	context.world().setBlock(slot.x, slot.y, slot.z, slot.blockId, slot.meta,1);

	int x2 = slot.x;
	int z2 = slot.z;

	switch (slot.meta) {
	case 0:
		z2++;
		break;
	case 1:
		x2--;
		break;
	case 2:
		z2--;
		break;
	case 3:
		x2++;
		break;
	}

	context.world().setBlock(x2, slot.y, z2, slot.blockId, slot.meta + 8,1);
}
 
開發者ID:austinv11,項目名稱:PeripheralsPlusPlus,代碼行數:28,代碼來源:BptBlockBed.java


注:本文中的buildcraft.api.blueprints.BptSlotInfo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。