本文整理匯總了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}