本文整理汇总了Java中net.minecraft.init.Blocks.STRUCTURE_BLOCK属性的典型用法代码示例。如果您正苦于以下问题:Java Blocks.STRUCTURE_BLOCK属性的具体用法?Java Blocks.STRUCTURE_BLOCK怎么用?Java Blocks.STRUCTURE_BLOCK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.STRUCTURE_BLOCK属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNearbyCornerBlocks
private List<TileEntityStructure> getNearbyCornerBlocks(BlockPos p_184418_1_, BlockPos p_184418_2_)
{
List<TileEntityStructure> list = Lists.<TileEntityStructure>newArrayList();
for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(p_184418_1_, p_184418_2_))
{
IBlockState iblockstate = this.world.getBlockState(blockpos$mutableblockpos);
if (iblockstate.getBlock() == Blocks.STRUCTURE_BLOCK)
{
TileEntity tileentity = this.world.getTileEntity(blockpos$mutableblockpos);
if (tileentity != null && tileentity instanceof TileEntityStructure)
{
list.add((TileEntityStructure)tileentity);
}
}
}
return list;
}
示例2: getNearbyCornerBlocks
private List<TileEntityStructure> getNearbyCornerBlocks(BlockPos p_184418_1_, BlockPos p_184418_2_)
{
List<TileEntityStructure> list = Lists.<TileEntityStructure>newArrayList();
for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(p_184418_1_, p_184418_2_))
{
IBlockState iblockstate = this.worldObj.getBlockState(blockpos$mutableblockpos);
if (iblockstate.getBlock() == Blocks.STRUCTURE_BLOCK)
{
TileEntity tileentity = this.worldObj.getTileEntity(blockpos$mutableblockpos);
if (tileentity != null && tileentity instanceof TileEntityStructure)
{
list.add((TileEntityStructure)tileentity);
}
}
}
return list;
}
示例3: getDataBlocks
public Map<BlockPos, String> getDataBlocks(BlockPos pos, PlacementSettings placementIn)
{
Map<BlockPos, String> map = Maps.<BlockPos, String>newHashMap();
StructureBoundingBox structureboundingbox = placementIn.getBoundingBox();
for (Template.BlockInfo template$blockinfo : this.blocks)
{
BlockPos blockpos = transformedBlockPos(placementIn, template$blockinfo.pos).add(pos);
if (structureboundingbox == null || structureboundingbox.isVecInside(blockpos))
{
IBlockState iblockstate = template$blockinfo.blockState;
if (iblockstate.getBlock() == Blocks.STRUCTURE_BLOCK && template$blockinfo.tileentityData != null)
{
TileEntityStructure.Mode tileentitystructure$mode = TileEntityStructure.Mode.valueOf(template$blockinfo.tileentityData.getString("mode"));
if (tileentitystructure$mode == TileEntityStructure.Mode.DATA)
{
map.put(blockpos, template$blockinfo.tileentityData.getString("metadata"));
}
}
}
}
return map;
}
示例4: updateBlockState
private void updateBlockState()
{
if (this.world != null)
{
BlockPos blockpos = this.getPos();
IBlockState iblockstate = this.world.getBlockState(blockpos);
if (iblockstate.getBlock() == Blocks.STRUCTURE_BLOCK)
{
this.world.setBlockState(blockpos, iblockstate.withProperty(BlockStructure.MODE, this.mode), 2);
}
}
}
示例5: setMode
public void setMode(TileEntityStructure.Mode modeIn)
{
this.mode = modeIn;
IBlockState iblockstate = this.world.getBlockState(this.getPos());
if (iblockstate.getBlock() == Blocks.STRUCTURE_BLOCK)
{
this.world.setBlockState(this.getPos(), iblockstate.withProperty(BlockStructure.MODE, modeIn), 2);
}
}
示例6: getRenderBoundingBox
/**
* Return an {@link AxisAlignedBB} that controls the visible scope of a {@link TileEntitySpecialRenderer} associated with this {@link TileEntity}
* Defaults to the collision bounding box {@link Block#getCollisionBoundingBoxFromPool(World, int, int, int)} associated with the block
* at this location.
*
* @return an appropriately size {@link AxisAlignedBB} for the {@link TileEntity}
*/
@SideOnly(Side.CLIENT)
public net.minecraft.util.math.AxisAlignedBB getRenderBoundingBox()
{
net.minecraft.util.math.AxisAlignedBB bb = INFINITE_EXTENT_AABB;
Block type = getBlockType();
BlockPos pos = getPos();
if (type == Blocks.ENCHANTING_TABLE)
{
bb = new net.minecraft.util.math.AxisAlignedBB(pos, pos.add(1, 1, 1));
}
else if (type == Blocks.CHEST || type == Blocks.TRAPPED_CHEST)
{
bb = new net.minecraft.util.math.AxisAlignedBB(pos.add(-1, 0, -1), pos.add(2, 2, 2));
}
else if (type == Blocks.STRUCTURE_BLOCK)
{
bb = INFINITE_EXTENT_AABB;
}
else if (type != null && type != Blocks.BEACON)
{
net.minecraft.util.math.AxisAlignedBB cbb = null;
try
{
cbb = worldObj.getBlockState(getPos()).getCollisionBoundingBox(worldObj, pos).addCoord(pos.getX(), pos.getY(), pos.getZ());
}
catch (Exception e)
{
// We have to capture any exceptions that may occur here because BUKKIT servers like to send
// the tile entity data BEFORE the chunk data, you know, the OPPOSITE of what vanilla does!
// So we can not GARENTEE that the world state is the real state for the block...
// So, once again in the long line of US having to accommodate BUKKIT breaking things,
// here it is, assume that the TE is only 1 cubic block. Problem with this is that it may
// cause the TileEntity renderer to error further down the line! But alas, nothing we can do.
cbb = new net.minecraft.util.math.AxisAlignedBB(getPos().add(-1, 0, -1), getPos().add(1, 1, 1));
}
if (cbb != null) bb = cbb;
}
return bb;
}
示例7: updateBlockState
private void updateBlockState()
{
if (this.worldObj != null)
{
BlockPos blockpos = this.getPos();
IBlockState iblockstate = this.worldObj.getBlockState(blockpos);
if (iblockstate.getBlock() == Blocks.STRUCTURE_BLOCK)
{
this.worldObj.setBlockState(blockpos, iblockstate.withProperty(BlockStructure.MODE, this.mode), 2);
}
}
}
示例8: setMode
public void setMode(TileEntityStructure.Mode modeIn)
{
this.mode = modeIn;
IBlockState iblockstate = this.worldObj.getBlockState(this.getPos());
if (iblockstate.getBlock() == Blocks.STRUCTURE_BLOCK)
{
this.worldObj.setBlockState(this.getPos(), iblockstate.withProperty(BlockStructure.MODE, modeIn), 2);
}
}
示例9: canDestroyBlock
public static boolean canDestroyBlock(Block blockIn)
{
return blockIn != Blocks.BEDROCK && blockIn != Blocks.END_PORTAL && blockIn != Blocks.END_PORTAL_FRAME && blockIn != Blocks.COMMAND_BLOCK && blockIn != Blocks.REPEATING_COMMAND_BLOCK && blockIn != Blocks.CHAIN_COMMAND_BLOCK && blockIn != Blocks.BARRIER && blockIn != Blocks.STRUCTURE_BLOCK && blockIn != Blocks.STRUCTURE_VOID;
}