本文整理了Java中net.minecraft.world.World.markChunkDirty()
方法的一些代码示例,展示了World.markChunkDirty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.markChunkDirty()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:markChunkDirty
暂无
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
public void saveChanges( final ICellInventory<?> cellInventory )
{
this.world.markChunkDirty( this.pos, this );
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
public void saveChanges()
{
if( this.world != null )
{
this.world.markChunkDirty( this.pos, this );
if( !this.markDirtyQueued )
{
TickHandler.INSTANCE.addCallable( null, this::markDirtyAtEndOfTick );
this.markDirtyQueued = true;
}
}
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
public void saveChanges( final ICellInventory<?> cellInventory )
{
if( cellInventory != null )
{
cellInventory.persist();
}
this.world.markChunkDirty( this.pos, this );
}
代码示例来源:origin: raoulvdberge/refinedstorage
@Override
public void markDirty() {
if (world != null) {
world.markChunkDirty(pos, this);
}
}
}
代码示例来源:origin: ExtraCells/ExtraCells2
@Override
public void saveChanges(ICellInventory<?> imeInventory) {
this.world.markChunkDirty( this.pos, this );
}
代码示例来源:origin: CoFH/CoFHCore
public void markChunkDirty() {
world.markChunkDirty(pos, this);
}
代码示例来源:origin: OpenMods/OpenModsLib
public void markUpdated() {
world.markChunkDirty(pos, this);
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void markChunkDirty(@Nonnull BlockPos pos, @Nonnull TileEntity unusedTileEntity) {
wrapped.markChunkDirty(pos, unusedTileEntity);
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public void markChunkDirty(BlockPos pos, TileEntity unusedTileEntity) {
getActualWorld().markChunkDirty(pos, unusedTileEntity);
}
代码示例来源:origin: WayofTime/BloodMagic
@SubscribeEvent
public static void onServerWorldTick(TickEvent.WorldTickEvent event) {
if (event.world.isRemote)
return;
int dim = event.world.provider.getDimension();
if (event.phase == TickEvent.Phase.END) {
if (!SERVER_TICKS.containsKey(dim))
SERVER_TICKS.put(dim, 0);
int ticks = (SERVER_TICKS.get(dim));
if (ticks % 20 == 0) {
CopyOnWriteArrayList<PosXY> dirtyChunks = WorldDemonWillHandler.dirtyChunks.get(dim);
if ((dirtyChunks != null) && (dirtyChunks.size() > 0)) {
for (PosXY pos : dirtyChunks)
event.world.markChunkDirty(new BlockPos(pos.x * 16, 5, pos.y * 16), null);
dirtyChunks.clear();
}
}
SERVER_TICKS.put(dim, ticks + 1);
}
}
代码示例来源: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: 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 doSetAccessMode(@Nonnull AccessMode accesmode) {
ta.setAccessMode(accesmode);
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: SleepyTrousers/EnderCore
@Override
public void markDirty() {
if (hasWorld() && world.isBlockLoaded(getPos())) { // we need the loaded check to make sure we don't trigger a chunk load while the chunk is loaded
world.markChunkDirty(pos, this);
IBlockState state = world.getBlockState(pos);
if (state.hasComparatorInputOverride()) {
world.updateComparatorOutputLevel(pos, state.getBlock());
}
}
}
代码示例来源: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 doSetVisible(boolean visible) {
ta.setVisible(visible);
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: PrinceOfAmber/Cyclic
public static boolean destroyBlock(World world, BlockPos pos) {
if (world.getTileEntity(pos) != null) {
world.removeTileEntity(pos);
}
try {
boolean setToAirSuccess = world.setBlockToAir(pos);
if (setToAirSuccess == false) {
setToAirSuccess = world.destroyBlock(pos, false);//destroy with no drops if setToAir failed
}
}
catch (Exception e) {
ModCyclic.logger.error("Error thrown by a tile entity when removing the block: " + e.getMessage());
e.printStackTrace();
return false;
}
world.markChunkDirty(pos, null);//dont forget to update the old pos as well as the new position for server sync
// IN CASE OF DOUBLE CHESTS
tryUpdateNeighbour(world, pos.north());
tryUpdateNeighbour(world, pos.south());
tryUpdateNeighbour(world, pos.east());
tryUpdateNeighbour(world, pos.west());
return true;
}
代码示例来源:origin: SleepyTrousers/EnderIO
private void setConduitVolumes() {
if (tank.containsValidLiquid() && !getConduits().isEmpty()) {
FluidStack fluidPerConduit = tank.getFluid().copy();
int numCons = getConduits().size();
int leftOvers = fluidPerConduit.amount % numCons;
fluidPerConduit.amount = fluidPerConduit.amount / numCons;
for (AdvancedLiquidConduit con : getConduits()) {
FluidStack f = fluidPerConduit.copy();
if (leftOvers > 0) {
f.amount += 1;
leftOvers--;
}
con.getTank().setLiquid(f);
BlockPos pos = con.getBundle().getLocation();
con.getBundle().getEntity().getWorld().markChunkDirty(pos, con.getBundle().getEntity());
}
}
}
代码示例来源:origin: ForestryMC/Binnie
public void onUpdate() {
if (!this.getWorld().isRemote) {
for (final MachineComponent component : this.getComponents()) {
component.onUpdate();
}
} else {
//noinspection MethodCallSideOnly
updateClient();
}
if (this.queuedInventoryUpdate) {
for (final MachineComponent component : this.getComponents()) {
component.onInventoryUpdate();
}
TileEntity tileEntity = getTileEntity();
getWorld().markChunkDirty(tileEntity.getPos(), tileEntity);
this.queuedInventoryUpdate = false;
}
}
代码示例来源:origin: PrinceOfAmber/Cyclic
public void run() {
EntityPlayerMP player = ctx.getServerHandler().player;
World world = player.getEntityWorld();
TileEntityPassword tile = (TileEntityPassword) world.getTileEntity(message.pos);
if (tile != null) {
switch (message.type) {
case ACTIVETYPE:
tile.toggleActiveType();
break;
case PASSTEXT:
tile.setMyPassword(message.password);
break;
case USERSALLOWED:
tile.toggleUserType();
break;
case USERCLAIM:
tile.toggleClaimedHash(player);
break;
}
tile.markDirty();
player.getEntityWorld().markChunkDirty(message.pos, tile);
final IBlockState oldState = world.getBlockState(message.pos);
//http://www.minecraftforge.net/forum/index.php?topic=38710.0
world.notifyBlockUpdate(message.pos, oldState, oldState, 3);
}
}
});
代码示例来源:origin: JurassiCraftTeam/JurassiCraft2
public void cleanItem() {
if (this.canClean()) {
for (int i = 2; i < 8; i++) {
ItemStack slot = this.slots.get(i);
if (isStackable(slot, this.cleanedItemResult)) {
if (slot.isEmpty()) {
this.slots.set(i, this.cleanedItemResult.copy());
} else {
slot.grow(this.cleanedItemResult.getCount());
}
ItemStack shrinked = this.slots.get(0).copy();
shrinked.shrink(1);
this.setInventorySlotContents(0, shrinked);
this.cleanedItemResult = ItemStack.EMPTY;
if (this.slots.get(0).getCount() <= 0) {
this.setInventorySlotContents(0, ItemStack.EMPTY);
}
this.world.markChunkDirty(this.pos, this);
break;
}
}
}
}
代码示例来源:origin: PrinceOfAmber/Cyclic
newTile.markDirty();
world.markChunkDirty(posMoveToHere, newTile);
内容来源于网络,如有侵权,请联系作者删除!