本文整理了Java中net.minecraft.world.World.notifyBlockUpdate()
方法的一些代码示例,展示了World.notifyBlockUpdate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.notifyBlockUpdate()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:notifyBlockUpdate
暂无
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
private void dropTorch( final World w, final BlockPos pos )
{
final IBlockState prev = w.getBlockState( pos );
w.destroyBlock( pos, true );
w.notifyBlockUpdate( pos, prev, w.getBlockState( pos ), 3 );
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
private void dropCrank( final World world, final BlockPos pos )
{
world.destroyBlock( pos, true ); // w.destroyBlock( x, y, z, true );
world.notifyBlockUpdate( pos, this.getDefaultState(), world.getBlockState( pos ), 3 );
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
private void dropTorch( final World w, final BlockPos pos )
{
final IBlockState prev = w.getBlockState( pos );
w.destroyBlock( pos, true );
w.notifyBlockUpdate( pos, prev, w.getBlockState( pos ), 3 );
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
private void dropTorch( final World w, final BlockPos pos )
{
final IBlockState prev = w.getBlockState( pos );
w.destroyBlock( pos, true );
w.notifyBlockUpdate( pos, prev, w.getBlockState( pos ), 3 );
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
public void markForUpdate()
{
if( this.renderFragment > 0 )
{
this.renderFragment |= 1;
}
else
{
// TODO: Optimize Network Load
if( this.world != null )
{
AELog.blockUpdate( this.pos, this );
this.world.notifyBlockUpdate( this.pos, this.getBlockState(), this.getBlockState(), 3 );
}
}
}
代码示例来源:origin: Vazkii/Botania
@Nonnull
@Override
public EnumActionResult onItemUse(EntityPlayer p, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xs, float ys, float zs) {
TileEntity tile = world.getTileEntity(pos);
if(tile != null && tile instanceof TileCraftCrate) {
TileCraftCrate crate = (TileCraftCrate) tile;
crate.pattern = p.getHeldItem(hand).getItemDamage();
world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 8);
return EnumActionResult.SUCCESS;
}
return EnumActionResult.PASS;
}
代码示例来源:origin: Vazkii/Botania
@Override
public boolean placeBlockAt(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, World world, @Nonnull BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, @Nonnull IBlockState newState) {
boolean placed = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState);
if(placed) {
String type = getType(stack);
TileEntity te = world.getTileEntity(pos);
if(te instanceof TileSpecialFlower) {
TileSpecialFlower tile = (TileSpecialFlower) te;
tile.setSubTile(type);
tile.onBlockAdded(world, pos, newState);
tile.onBlockPlacedBy(world, pos, newState, player, stack);
if(!world.isRemote)
world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 8);
}
}
return placed;
}
代码示例来源:origin: Vazkii/Botania
void swap(TilePlatform tile, boolean empty) {
tile.camoState = empty ? null : camoState;
world.notifyBlockUpdate(tile.getPos(), world.getBlockState(tile.getPos()), world.getBlockState(tile.getPos()), 8);
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
public void moveTile( final TileEntity te, final World w, final BlockPos newPosition )
{
te.setWorld( w );
te.setPos( newPosition );
final Chunk c = w.getChunkFromBlockCoords( newPosition );
c.addTileEntity( newPosition, te );
if( c.isLoaded() )
{
final IBlockState state = w.getBlockState( newPosition );
w.addTileEntity( te );
w.notifyBlockUpdate( newPosition, state, state, 1 );
}
}
}
代码示例来源:origin: Vazkii/Botania
@Nonnull
@Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float xv, float yv, float zv) {
TileEntity tile = world.getTileEntity(pos);
if(tile != null && (tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.UP) || tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null))
&& !CorporeaHelper.doesBlockHaveSpark(world, pos)) {
ItemStack stack = player.getHeldItem(hand);
stack.shrink(1);
if(!world.isRemote) {
EntityCorporeaSpark spark = new EntityCorporeaSpark(world);
if(stack.getItemDamage() == 1)
spark.setMaster(true);
spark.setPosition(pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5);
world.spawnEntity(spark);
world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 0);
}
return EnumActionResult.SUCCESS;
}
return EnumActionResult.PASS;
}
代码示例来源:origin: Vazkii/Botania
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
TileEntity tile = world.getTileEntity(pos);
if(world.isRemote)
return true;
ItemStack currentStack = player.getHeldItem(hand);
if(!currentStack.isEmpty()
&& Block.getBlockFromItem(currentStack.getItem()) != null
&& tile instanceof TileCamo) {
TileCamo camo = (TileCamo) tile;
IBlockState changeState = Block.getBlockFromItem(currentStack.getItem()).getStateForPlacement(world, pos, side, hitX, hitY, hitZ, currentStack.getItemDamage(), player);
if(isValidBlock(changeState) && !(changeState.getBlock() instanceof BlockCamo) && changeState.getMaterial() != Material.AIR) {
camo.camoState = changeState;
world.notifyBlockUpdate(pos, state, state, 8);
return true;
}
}
return false;
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void onBlockPlacedBy(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityLivingBase player,
@Nonnull ItemStack stack) {
setPaintSource(state, world, pos, PaintUtil.getSourceBlock(stack));
if (!world.isRemote) {
world.notifyBlockUpdate(pos, state, state, 3);
}
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void onBlockPlacedBy(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityLivingBase player,
@Nonnull ItemStack stack) {
setPaintSource(state, world, pos, PaintUtil.getSourceBlock(stack));
if (!world.isRemote) {
world.notifyBlockUpdate(pos, state, state, 3);
}
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void onBlockPlacedBy(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityLivingBase player,
@Nonnull ItemStack stack) {
setPaintSource(state, world, pos, PaintUtil.getSourceBlock(stack));
if (!world.isRemote) {
world.notifyBlockUpdate(pos, state, state, 3);
}
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void onBlockPlacedBy(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityLivingBase placer,
@Nonnull ItemStack stack) {
setPaintSource(state, world, pos, PaintUtil.getSourceBlock(stack));
if (!world.isRemote) {
world.notifyBlockUpdate(pos, state, state, 3);
}
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
this.world.notifyBlockUpdate( pos, this.world.getBlockState( pos ), this.world.getBlockState( pos ), z );
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public IMessage onMessage(PacketOCConduitSignalColor message, MessageContext ctx) {
IOCConduit con = message.getConduit(ctx);
if (con != null) {
con.setSignalColor(message.dir, message.col);
IBlockState bs = message.getWorld(ctx).getBlockState(message.getPos());
message.getWorld(ctx).notifyBlockUpdate(message.getPos(), bs, bs, 3);
}
return null;
}
代码示例来源:origin: SleepyTrousers/EnderIO
private void doConduitsDirty() {
IBlockState bs = world.getBlockState(pos);
world.notifyBlockUpdate(pos, bs, bs, 3);
world.neighborChanged(pos, getBlockType(), pos);
markDirty();
forceUpdatePlayers();
conduitsDirty = false;
}
代码示例来源:origin: SleepyTrousers/EnderIO
@SuppressWarnings("null") // gah, Eclipse thinks a final field can go null from one side of the comma to the next
@Override
public IMessage doSetLabel(@Nullable String label) {
ta.setLabel(label);
if (te != null) { // TODO what's this? overkill?
IBlockState bs = te.getWorld().getBlockState(te.getPos());
te.getWorld().notifyBlockUpdate(te.getPos(), bs, bs, 3);
te.getWorld().markChunkDirty(te.getPos(), te);
}
return null;
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
world.setTileEntity( d, nte );
world.notifyBlockUpdate( d, prev, state, 3 );
内容来源于网络,如有侵权,请联系作者删除!