本文整理匯總了Java中net.minecraft.util.math.BlockPos.ORIGIN屬性的典型用法代碼示例。如果您正苦於以下問題:Java BlockPos.ORIGIN屬性的具體用法?Java BlockPos.ORIGIN怎麽用?Java BlockPos.ORIGIN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類net.minecraft.util.math.BlockPos
的用法示例。
在下文中一共展示了BlockPos.ORIGIN屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateVillageRadiusAndCenter
private void updateVillageRadiusAndCenter()
{
int i = this.villageDoorInfoList.size();
if (i == 0)
{
this.center = BlockPos.ORIGIN;
this.villageRadius = 0;
}
else
{
this.center = new BlockPos(this.centerHelper.getX() / i, this.centerHelper.getY() / i, this.centerHelper.getZ() / i);
int j = 0;
for (VillageDoorInfo villagedoorinfo : this.villageDoorInfoList)
{
j = Math.max(villagedoorinfo.getDistanceToDoorBlockSq(this.center), j);
}
this.villageRadius = Math.max(32, (int)Math.sqrt((double)j) + 1);
}
}
示例2: update
@Override
public void update()
{
Entity ent = Minecraft.getMinecraft().getRenderViewEntity();
if(ent != null)
{
BlockPos closest = BlockPos.ORIGIN;
double dist = 1000000D;
for(TileEntityGlassBase base : placement.activeBlocks)
{
double d0 = ent.posX - (base.getPos().getX() + 0.5D);
double d1 = ent.posY + ent.getEyeHeight() - (base.getPos().getY() + 0.5D);
double d2 = ent.posZ - (base.getPos().getZ() + 0.5D);
double dista = (double)MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
if(dista < dist)
{
dist = dista;
closest = base.getPos();
}
}
if(dist != 1000000D)
{
this.xPosF = (float)closest.getX() + 0.5F;
this.yPosF = (float)closest.getY() + 0.5F;
this.zPosF = (float)closest.getZ() + 0.5F;
}
}
}
示例3: AnvilContainer
@SideOnly(Side.CLIENT)
public AnvilContainer(InventoryPlayer playerInv, World worldIn, AnvilTileEntity ate) {
this(playerInv, worldIn, BlockPos.ORIGIN,ate);
}
示例4: addPos
public BlockPos addPos()
{
return BlockPos.ORIGIN;
}
示例5: HarshenTemplate
protected HarshenTemplate(ResourceLocation location) {
String s = location.getResourceDomain();
String s1 = location.getResourcePath();
InputStream stream = null;
boolean flag;
try
{
stream = getClass().getResourceAsStream("/assets/" + HarshenCastle.MODID + "/structures/" + s1 + ".nbt");
NBTTagCompound compound = CompressedStreamTools.readCompressed(stream);
if (!compound.hasKey("DataVersion", 99))
{
compound.setInteger("DataVersion", 500);
}
Template template = new Template();
DataFixer fixer;
try
{
fixer = Minecraft.getMinecraft().getDataFixer();
}
catch (Throwable e) {
fixer = FMLServerHandler.instance().getDataFixer();
}
template.read(fixer.process(FixTypes.STRUCTURE, compound));
this.blocks.clear();
NBTTagList nbttaglist = compound.getTagList("size", 3);
this.size = new BlockPos(nbttaglist.getIntAt(0), nbttaglist.getIntAt(1), nbttaglist.getIntAt(2));
NBTTagList nbttaglist4 = compound.getTagList("pos", 3);
if(nbttaglist4.hasNoTags())
this.pos = BlockPos.ORIGIN;
else
this.pos = new BlockPos(nbttaglist4.getIntAt(0), nbttaglist4.getIntAt(1), nbttaglist4.getIntAt(2));
BasicPalette template$basicpalette = new BasicPalette();
NBTTagList nbttaglist1 = compound.getTagList("palette", 10);
for (int i = 0; i < nbttaglist1.tagCount(); ++i)
{
template$basicpalette.addMapping(NBTUtil.readBlockState(nbttaglist1.getCompoundTagAt(i)), i);
}
NBTTagList nbttaglist3 = compound.getTagList("blocks", 10);
for (int j = 0; j < nbttaglist3.tagCount(); ++j)
{
NBTTagCompound nbttagcompound = nbttaglist3.getCompoundTagAt(j);
NBTTagList nbttaglist2 = nbttagcompound.getTagList("pos", 3);
BlockPos blockpos = new BlockPos(nbttaglist2.getIntAt(0), nbttaglist2.getIntAt(1), nbttaglist2.getIntAt(2));
IBlockState iblockstate = template$basicpalette.stateFor(nbttagcompound.getInteger("state"));
NBTTagCompound nbttagcompound1;
if (nbttagcompound.hasKey("nbt"))
{
nbttagcompound1 = nbttagcompound.getCompoundTag("nbt");
}
else
{
nbttagcompound1 = null;
}
if(!(iblockstate.getBlock() instanceof BlockStructure))
this.blocks.add(new Template.BlockInfo(blockpos, iblockstate, nbttagcompound1));
}
}
catch (Throwable var10)
{
}
finally
{
IOUtils.closeQuietly(stream);
}
}
示例6: onClientTick
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event)
{
if(event.phase == TickEvent.Phase.END)
{
Minecraft mc = Minecraft.getMinecraft();
if(mc.world != null)
{
if(!clickedPos.equals(BlockPos.ORIGIN))
{
TileEntity te = mc.world.getTileEntity(clickedPos);
if(te instanceof TileEntityGlassBase && ((TileEntityGlassBase)te).active && mc.playerController.getIsHittingBlock())
{
TileEntityGlassBase base = (TileEntityGlassBase)te;
if(base.fadeoutTime < TileEntityGlassBase.FADEOUT_TIME - TileEntityGlassBase.PROPAGATE_TIME)
{
base.fadeoutTime = TileEntityGlassBase.FADEOUT_TIME;
base.fadePropagate = TileEntityGlassBase.PROPAGATE_TIME;
base.fadeDistance = 2;
base.fadePropagate();
}
}
else
{
clickedPos = BlockPos.ORIGIN;
}
}
Iterator<Map.Entry<String, Integer>> ite = terminalPlacementCreationTimeout.entrySet().iterator();
while(ite.hasNext())
{
Map.Entry<String, Integer> e = ite.next();
e.setValue(e.getValue() - 1);
if(e.getValue() < 0)
{
ite.remove();
}
}
}
}
}
示例7: readObjectNoData
private void readObjectNoData() throws ObjectStreamException
{
this.dim = 0;
this.pos = BlockPos.ORIGIN;
}
示例8: onRender
@Override
public void onRender(float partialTicks)
{
if(currentBlock == null)
return;
// GL settings
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GL11.glLineWidth(2);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glPushMatrix();
GL11.glTranslated(-TileEntityRendererDispatcher.staticPlayerX,
-TileEntityRendererDispatcher.staticPlayerY,
-TileEntityRendererDispatcher.staticPlayerZ);
AxisAlignedBB box = new AxisAlignedBB(BlockPos.ORIGIN);
float p = prevProgress + (progress - prevProgress) * partialTicks;
float red = p * 2F;
float green = 2 - red;
GL11.glTranslated(currentBlock.getX(), currentBlock.getY(),
currentBlock.getZ());
if(p < 1)
{
GL11.glTranslated(0.5, 0.5, 0.5);
GL11.glScaled(p, p, p);
GL11.glTranslated(-0.5, -0.5, -0.5);
}
GL11.glColor4f(red, green, 0, 0.25F);
RenderUtils.drawSolidBox(box);
GL11.glColor4f(red, green, 0, 0.5F);
RenderUtils.drawOutlinedBox(box);
GL11.glPopMatrix();
// GL resets
GL11.glColor4f(1, 1, 1, 1);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
示例9: getPosition
/**
* Get the position in the world. <b>{@code null} is not allowed!</b> If you are not an entity in the world, return
* the coordinates 0, 0, 0
*/
public BlockPos getPosition()
{
return BlockPos.ORIGIN;
}
示例10: ContainerRepair
public ContainerRepair(InventoryPlayer playerInventory, World worldIn, EntityPlayer player)
{
this(playerInventory, worldIn, BlockPos.ORIGIN, player);
}
示例11: ContainerEnchantment
public ContainerEnchantment(InventoryPlayer playerInv, World worldIn)
{
this(playerInv, worldIn, BlockPos.ORIGIN);
}
示例12: GuiCrafting
public GuiCrafting(InventoryPlayer playerInv, World worldIn)
{
this(playerInv, worldIn, BlockPos.ORIGIN);
}
示例13: PacketNetherBrickOvenFuelLevel
public PacketNetherBrickOvenFuelLevel()
{
pos = BlockPos.ORIGIN;
fluidStack = null;
}
示例14: ContainerRepair
@SideOnly(Side.CLIENT)
public ContainerRepair(InventoryPlayer playerInventory, World worldIn, EntityPlayer player)
{
this(playerInventory, worldIn, BlockPos.ORIGIN, player);
}
示例15: ContainerEnchantment
@SideOnly(Side.CLIENT)
public ContainerEnchantment(InventoryPlayer playerInv, World worldIn)
{
this(playerInv, worldIn, BlockPos.ORIGIN);
}