Fix for nbt

This commit is contained in:
Jesse Boyd 2016-04-03 05:19:14 +10:00
parent ed50071901
commit d11bb1ac0a
6 changed files with 20 additions and 13 deletions

3
.gitignore vendored
View File

@ -10,4 +10,5 @@
/target/
/.gradle
/.idea
/forge/build
/forge/build
forge/.gradle/gradle.log

View File

@ -123,11 +123,17 @@ public abstract class BukkitQueue_0 extends FaweQueue implements Listener {
@Override
public void addTask(String world, int x, int y, int z, Runnable runnable) {
// TODO Auto-generated method stub
final ChunkLoc wrap = new ChunkLoc(world, x >> 4, z >> 4);
FaweChunk<Chunk> result = this.blocks.get(wrap);
if (result == null) {
throw new IllegalArgumentException("Task must be accompanied by a block change or manually adding to queue!");
result = this.getChunk(wrap);
result.addTask(runnable);
final FaweChunk<Chunk> previous = this.blocks.put(wrap, result);
if (previous == null) {
return;
}
this.blocks.put(wrap, previous);
result = previous;
}
result.addTask(runnable);
}

View File

@ -1,10 +1,7 @@
package com.boydti.fawe.object.extent;
import java.util.List;
import com.boydti.fawe.util.SetQueue;
import com.boydti.fawe.util.TaskManager;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.BlockVector;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.Vector;
@ -18,6 +15,7 @@ import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BaseBiome;
import java.util.List;
public class FastWorldEditExtent extends AbstractDelegateExtent {
@ -141,9 +139,7 @@ public class FastWorldEditExtent extends AbstractDelegateExtent {
case 33:
case 151:
case 178: {
SetQueue.IMP.setBlock(this.world, x, y, z, id, (byte) block.getData());
if (block.hasNbtData()) {
final CompoundTag nbt = block.getNbtData();
SetQueue.IMP.addTask(this.world, x, y, z, new Runnable() {
@Override
public void run() {

View File

@ -188,7 +188,6 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
}
return false;
}
SetQueue.IMP.setBlock(this.world, x, location.getBlockY(), z, id, (byte) block.getData());
if (block.hasNbtData()) {
SetQueue.IMP.addTask(this.world, x, location.getBlockY(), z, new Runnable() {
@Override

View File

@ -33,11 +33,17 @@ public abstract class SpongeQueue_0 extends FaweQueue {
@Override
public void addTask(String world, int x, int y, int z, Runnable runnable) {
// TODO Auto-generated method stub
final ChunkLoc wrap = new ChunkLoc(world, x >> 4, z >> 4);
FaweChunk<Chunk> result = this.blocks.get(wrap);
if (result == null) {
throw new IllegalArgumentException("Task must be accompanied by a block change or manually adding to queue!");
result = this.getChunk(wrap);
result.addTask(runnable);
final FaweChunk<Chunk> previous = this.blocks.put(wrap, result);
if (previous == null) {
return;
}
this.blocks.put(wrap, previous);
result = previous;
}
result.addTask(runnable);
}

View File

@ -81,7 +81,6 @@ public class SpongeQueue_1_8 extends SpongeQueue_0 {
Chunk spongeChunk = fc.getChunk();
net.minecraft.world.World nmsWorld = (net.minecraft.world.World) spongeChunk.getWorld();
ChunkLoc wrapper = fc.getChunkLoc();
spongeChunk.loadChunk(true);
try {
boolean flag = !nmsWorld.provider.getHasNoSky();
// Sections
@ -151,7 +150,7 @@ public class SpongeQueue_1_8 extends SpongeQueue_0 {
fs.setCount(j, Short.MAX_VALUE);
}
}
// Clear
// // Clear
} catch (Throwable e) {
e.printStackTrace();
}