本文整理匯總了Java中net.minecraft.world.World.setTileEntity方法的典型用法代碼示例。如果您正苦於以下問題:Java World.setTileEntity方法的具體用法?Java World.setTileEntity怎麽用?Java World.setTileEntity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.world.World
的用法示例。
在下文中一共展示了World.setTileEntity方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean active, World world, int x, int y, int z) {
int direction = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
isBurning = true;
if(active)
world.setBlock(x, y, z, TechnicalBlock.GrinderActive);
else
world.setBlock(x, y, z, TechnicalBlock.GrinderIdle);
isBurning = false;
world.setBlockMetadataWithNotify(x, y, z, direction, 2);
if(tileEntity != null) {
tileEntity.validate();
world.setTileEntity(x, y, z, tileEntity);
}
}
示例2: setState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void setState(boolean active, World worldIn, BlockPos pos) {
IBlockState iblockstate = worldIn.getBlockState(pos);
TileEntity tileentity = worldIn.getTileEntity(pos);
keepInventory = true;
if (active) {
worldIn.setBlockState(pos, CraftingBlocks.craftiniumForgeLit.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
worldIn.setBlockState(pos, CraftingBlocks.craftiniumForgeLit.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
} else {
worldIn.setBlockState(pos, CraftingBlocks.craftiniumForge.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
worldIn.setBlockState(pos, CraftingBlocks.craftiniumForge.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
}
keepInventory = false;
if (tileentity != null) {
tileentity.validate();
worldIn.setTileEntity(pos, tileentity);
}
}
示例3: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean lit, World world, BlockPos pos)
{
IBlockState state = world.getBlockState(pos);
TileEntity tileEntity = world.getTileEntity(pos);
if (lit)
{
world.setBlockState(pos, RegisterBlocks.obsidianKilnLit.getDefaultState()
.withProperty(FACING, state.getValue(FACING)), 3);
}
else
{
world.setBlockState(pos, RegisterBlocks.obsidianKiln.getDefaultState()
.withProperty(FACING, state.getValue(FACING)), 3);
}
if (tileEntity != null)
{
tileEntity.validate();
world.setTileEntity(pos, tileEntity);
}
}
示例4: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean active, World world, int x, int y, int z) {
int direction = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
isBurning = true;
if(active)
world.setBlock(x, y, z, TechnicalBlock.RepairingForgeMediumActive);
else
world.setBlock(x, y, z, TechnicalBlock.RepairingForgeMediumIdle);
isBurning = false;
world.setBlockMetadataWithNotify(x, y, z, direction, 2);
if(tileEntity != null) {
tileEntity.validate();
world.setTileEntity(x, y, z, tileEntity);
}
}
示例5: setState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void setState(boolean active, World worldIn, BlockPos pos)
{
IBlockState iblockstate = worldIn.getBlockState(pos);
TileEntity tileentity = worldIn.getTileEntity(pos);
keepInventory = true;
if (active)
{
worldIn.setBlockState(pos, Blocks.lit_furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
worldIn.setBlockState(pos, Blocks.lit_furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
}
else
{
worldIn.setBlockState(pos, Blocks.furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
worldIn.setBlockState(pos, Blocks.furnace.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
}
keepInventory = false;
if (tileentity != null)
{
tileentity.validate();
worldIn.setTileEntity(pos, tileentity);
}
}
示例6: setState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void setState(boolean active, World worldIn, BlockPos pos)
{
IBlockState iblockstate = worldIn.getBlockState(pos);
TileEntity tileentity = worldIn.getTileEntity(pos);
keepInventory = true;
if (active)
{
worldIn.setBlockState(pos, Blocks.LIT_FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
worldIn.setBlockState(pos, Blocks.LIT_FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
}
else
{
worldIn.setBlockState(pos, Blocks.FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
worldIn.setBlockState(pos, Blocks.FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
}
keepInventory = false;
if (tileentity != null)
{
tileentity.validate();
worldIn.setTileEntity(pos, tileentity);
}
}
示例7: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean active, World world, int x, int y, int z) {
int direction = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
isBurning = true;
if(active)
world.setBlock(x, y, z, TechnicalBlock.CentrifugeMediumActive);
else
world.setBlock(x, y, z, TechnicalBlock.CentrifugeMediumIdle);
isBurning = false;
world.setBlockMetadataWithNotify(x, y, z, direction, 2);
if(tileEntity != null) {
tileEntity.validate();
world.setTileEntity(x, y, z, tileEntity);
}
}
示例8: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean active, World world, int x, int y, int z) {
int direction = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
isBurning = true;
if (active)
world.setBlock(x, y, z, TechnicalBlock.ElectricFurnaceBasicActive);
else
world.setBlock(x, y, z, TechnicalBlock.ElectricFurnaceBasicIdle);
isBurning = false;
world.setBlockMetadataWithNotify(x, y, z, direction, 2);
if (tileEntity != null) {
tileEntity.validate();
world.setTileEntity(x, y, z, tileEntity);
}
}
示例9: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean lit, World world, BlockPos pos)
{
IBlockState state = world.getBlockState(pos);
TileEntity tileEntity = world.getTileEntity(pos);
if (lit)
{
world.setBlockState(pos, RegisterBlocks.enderSmelterLit.getDefaultState()
.withProperty(FACING, state.getValue(FACING)), 3);
}
else
{
world.setBlockState(pos, RegisterBlocks.enderSmelter.getDefaultState()
.withProperty(FACING, state.getValue(FACING)), 3);
}
if (tileEntity != null)
{
tileEntity.validate();
world.setTileEntity(pos, tileEntity);
}
}
示例10: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean active, World world, int x, int y, int z) {
int direction = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
isBurning = true;
if (active)
world.setBlock(x, y, z, TechnicalBlock.ElectricFurnaceMediumActive);
else
world.setBlock(x, y, z, TechnicalBlock.ElectricFurnaceMediumIdle);
isBurning = false;
world.setBlockMetadataWithNotify(x, y, z, direction, 2);
if (tileEntity != null) {
tileEntity.validate();
world.setTileEntity(x, y, z, tileEntity);
}
}
示例11: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean active, World world, int x, int y, int z) {
int direction = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
isBurning = true;
if(active)
world.setBlock(x, y, z, TechnicalBlock.ElectrolyserMediumActive);
else
world.setBlock(x, y, z, TechnicalBlock.ElectrolyserMediumIdle);
isBurning = false;
world.setBlockMetadataWithNotify(x, y, z, direction, 2);
if(tileEntity != null) {
tileEntity.validate();
world.setTileEntity(x, y, z, tileEntity);
}
}
示例12: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean active, World world, int x, int y, int z) {
int direction = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
isBurning = true;
if (active)
world.setBlock(x, y, z, TechnicalBlock.PumpActive);
else
world.setBlock(x, y, z, TechnicalBlock.PumpIdle);
isBurning = false;
world.setBlockMetadataWithNotify(x, y, z, direction, 2);
if (tileEntity != null) {
tileEntity.validate();
world.setTileEntity(x, y, z, tileEntity);
}
}
示例13: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean active, World world, int x, int y, int z) {
int direction = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
isBurning = true;
if (active)
world.setBlock(x, y, z, TechnicalBlock.BlastFurnaceAdvancedActive);
else
world.setBlock(x, y, z, TechnicalBlock.BlastFurnaceAdvancedIdle);
isBurning = false;
world.setBlockMetadataWithNotify(x, y, z, direction, 2);
if (tileEntity != null) {
tileEntity.validate();
world.setTileEntity(x, y, z, tileEntity);
}
}
示例14: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean active, World world, int x, int y, int z) {
int direction = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
isBurning = true;
if(active)
world.setBlock(x, y, z, TechnicalBlock.ElectrolyserActive);
else
world.setBlock(x, y, z, TechnicalBlock.ElectrolyserIdle);
isBurning = false;
world.setBlockMetadataWithNotify(x, y, z, direction, 2);
if(tileEntity != null) {
tileEntity.validate();
world.setTileEntity(x, y, z, tileEntity);
}
}
示例15: updateBlockState
import net.minecraft.world.World; //導入方法依賴的package包/類
public static void updateBlockState(boolean active, World world, int x, int y, int z) {
int direction = world.getBlockMetadata(x, y, z);
TileEntity tileEntity = world.getTileEntity(x, y, z);
isBurning = true;
if(active)
world.setBlock(x, y, z, TechnicalBlock.WasherActive);
else
world.setBlock(x, y, z, TechnicalBlock.WasherIdle);
isBurning = false;
world.setBlockMetadataWithNotify(x, y, z, direction, 2);
if(tileEntity != null) {
tileEntity.validate();
world.setTileEntity(x, y, z, tileEntity);
}
}