本文整理匯總了Java中net.minecraft.util.math.BlockPos.fromLong方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockPos.fromLong方法的具體用法?Java BlockPos.fromLong怎麽用?Java BlockPos.fromLong使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.util.math.BlockPos
的用法示例。
在下文中一共展示了BlockPos.fromLong方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: readFromNBT
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void readFromNBT(NBTTagCompound compound) {
super.readFromNBT(compound);
timeout = compound.getInteger("timeout");
portalSide = EnumFacing.VALUES[compound.getByte("portalSide")];
BlockPos pos = BlockPos.fromLong(compound.getLong("pos"));
int dim = compound.getInteger("dim");
EnumFacing side = EnumFacing.VALUES[compound.getByte("side")];
other = new TeleportDestination("", dim, pos, side);
NBTTagList list = compound.getTagList("bl", Constants.NBT.TAG_COMPOUND);
blackListed.clear();
for (int i = 0 ; i < list.tagCount() ; i++) {
NBTTagCompound tc = list.getCompoundTagAt(i);
UUID uuid = new UUID(tc.getLong("m"), tc.getLong("l"));
blackListed.add(uuid);
}
}
示例2: readFromNBT
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void readFromNBT(NBTTagCompound tag) {
NBTTagList list = tag.getTagList("blocks", Constants.NBT.TAG_LONG);
blocks.clear();
for (int i = 0; i < list.tagCount(); i++) {
blocks.add(BlockPos.fromLong(((NBTTagLong) list.get(i)).getLong()));
}
list = tag.getTagList("leaves", Constants.NBT.TAG_COMPOUND);
leavesToTick.clear();
for (int i = 0; i < list.tagCount(); i++) {
NBTTagCompound tc = list.getCompoundTagAt(i);
BlockPos pos = BlockPos.fromLong(tc.getLong("p"));
int counter = tc.getInteger("c");
leavesToTick.put(pos, counter);
}
}
示例3: fromBytes
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void fromBytes(ByteBuf buf) {
int dim = buf.readInt();
BlockPos pos = BlockPos.fromLong(buf.readLong());
World world = SimpleTubes.proxy.getWorld(dim);
this.tile = world.getTileEntity(pos);
this.id = buf.readInt();
}
示例4: fromBytes
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void fromBytes(ByteBuf buf) {
int dim = buf.readInt();
BlockPos pos = BlockPos.fromLong(buf.readLong());
World world = SimpleTubes.proxy.getWorld(dim);
if(world != null)
this.tile = world.getTileEntity(pos);
this.id = buf.readInt();
this.progress = buf.readFloat();
this.direction = buf.readByte();
this.color = buf.readInt();
}
示例5: isValid
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
public boolean isValid(World world, long pos) {
if (pos == -1L) {
return false;
}
BlockPos p = BlockPos.fromLong(pos);
IBlockState state = world.getBlockState(p);
Block block = state.getBlock();
if (Config.getBlocksBlocking().contains(block.getRegistryName())) {
// Special case for doors
if (block instanceof BlockDoor) {
return state.getValue(BlockDoor.OPEN);
}
if (block instanceof BlockTrapDoor) {
return state.getValue(BlockTrapDoor.OPEN);
}
return false;
}
if (Config.getBlocksNonBlocking().contains(block.getRegistryName())) {
return true;
}
if (block.isAir(state, world, p)) {
return true;
} else {
AxisAlignedBB box = state.getCollisionBoundingBox(world, p);
if (box == null) {
return true;
}
return !block.isOpaqueCube(state);
}
}
示例6: fromBytes
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void fromBytes(ByteBuf buf) {
int dim = buf.readInt();
BlockPos pos = BlockPos.fromLong(buf.readLong());
World world = SimpleTubes.proxy.getWorld(dim);
this.tile = world.getTileEntity(pos);
this.id = buf.readInt();
this.stack = ByteBufUtils.readItemStack(buf);
this.progress = buf.readFloat();
this.direction = buf.readByte();
this.color = buf.readInt();
}
示例7: fromBytes
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void fromBytes(ByteBuf buf) {
selectedBlock = BlockPos.fromLong(buf.readLong());
selectedSide = EnumFacing.VALUES[buf.readByte()];
destination = new TeleportDestination(NetworkTools.readStringUTF8(buf), buf.readInt(), BlockPos.fromLong(buf.readLong()),
EnumFacing.VALUES[buf.readByte()]);
}
示例8: fromBytes
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void fromBytes(ByteBuf buf) {
destination = new TeleportDestination(NetworkTools.readStringUTF8(buf), buf.readInt(),
BlockPos.fromLong(buf.readLong()),
EnumFacing.VALUES[buf.readByte()]);
destinationIndex = buf.readInt();
}
示例9: fromBytes
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void fromBytes(ByteBuf buf) {
int dim = buf.readInt();
BlockPos pos = BlockPos.fromLong(buf.readLong());
World world = SimpleTubes.proxy.getWorld(dim);
this.tile = world.getTileEntity(pos);
this.mode = buf.readInt();
}
示例10: removePreviousProbe
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
private void removePreviousProbe(NBTTagCompound data, MessageUsingProbe message, EntityPlayerMP player) {
if (data.hasKey(NBT_KEY)) {
BlockPos pos = BlockPos.fromLong(data.getLong(NBT_KEY));
if (!pos.equals(message.target)) {
removeProbe(player.world, pos);
}
}
}
示例11: fromBytes
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void fromBytes(ByteBuf buf) {
pos = BlockPos.fromLong(buf.readLong());
enable = buf.readBoolean();
}
示例12: readCustomNBT
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void readCustomNBT(NBTTagCompound tag) {
this.core = BlockPos.fromLong(tag.getLong("Core"));
inv.deserializeNBT(tag.getCompoundTag("inventory"));
}
示例13: fromBytes
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void fromBytes(ByteBuf buf)
{
pos = BlockPos.fromLong(buf.readLong());
storedXP = buf.readInt();
}
示例14: readFromNBT
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
@Override
public void readFromNBT(NBTTagCompound compound) {
super.readFromNBT(compound);
isCooking = compound.getBoolean("cooking");
parentRange = BlockPos.fromLong(compound.getLong("parent"));
}
示例15: renderHighlightedBlocks
import net.minecraft.util.math.BlockPos; //導入方法依賴的package包/類
private static void renderHighlightedBlocks(RenderWorldLastEvent evt, EntityPlayerSP p, Map<Long, Byte> cleanAir) {
double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * evt.getPartialTicks();
double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * evt.getPartialTicks();
double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * evt.getPartialTicks();
GlStateManager.pushMatrix();
GlStateManager.translate(-doubleX, -doubleY, -doubleZ);
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
Minecraft.getMinecraft().getTextureManager().bindTexture(BLUEGLOW);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
for (Map.Entry<Long, Byte> entry : cleanAir.entrySet()) {
int value = entry.getValue() & 0xff;
BlockPos coordinate = BlockPos.fromLong(entry.getKey());
float x = coordinate.getX();
float y = coordinate.getY();
float z = coordinate.getZ();
buffer.setTranslation(buffer.xOffset + x, buffer.yOffset + y, buffer.zOffset + z);
int alpha = value;
float mult = 0.4f; // 1.1f
if (alpha < 25) {
mult = 0.025f;
} else if (alpha < 50) {
mult = 0.05f;
} else if (alpha < 80) {
mult = 0.1f;
} else if (alpha < 110) {
mult = 0.15f;
} else if (alpha < 130) {
mult = 0.2f;
} else if (alpha < 150) {
mult = 0.25f;
} else if (alpha < 180) {
mult = 0.3f;
} else if (alpha < 210) {
mult = 0.35f;
}
float offset = 0.5f - (mult/2);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.UP.ordinal(), mult, offset, alpha);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.DOWN.ordinal(), mult, offset, alpha);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.NORTH.ordinal(), mult, offset, alpha);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.SOUTH.ordinal(), mult, offset, alpha);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.WEST.ordinal(), mult, offset, alpha);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.EAST.ordinal(), mult, offset, alpha);
buffer.setTranslation(buffer.xOffset - x, buffer.yOffset - y, buffer.zOffset - z);
}
tessellator.draw();
GlStateManager.disableBlend();
GlStateManager.popMatrix();
}