diff --git a/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch b/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch index be417f9..34ee192 100644 --- a/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch +++ b/patches/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -250,9 +250,9 @@ + Chunk chunk = (Chunk) this.loadedChunkHashMap_KC.get(LongHash.toLong(p_73154_1_, p_73154_2_)); + chunk = chunk == null ? (shouldLoadChunk() ? this.loadChunk(p_73154_1_, p_73154_2_) : this.defaultEmptyChunk) : chunk; // Cauldron handle forge server tick events and load the chunk within 5 seconds of the world being loaded (for chunk loaders) + -+ if (chunk == this.defaultEmptyChunk || chunk == null) ++ if (chunk == defaultEmptyChunk || chunk == null) + { -+ return chunk; ++ return defaultEmptyChunk; + } + + if ((p_73154_1_ != chunk.xPosition || p_73154_2_ != chunk.zPosition) && !worldObj.isProfilingWorld()) diff --git a/src/main/java/kcauldron/wrapper/ProcessingQueue.java b/src/main/java/kcauldron/wrapper/ProcessingQueue.java index 630d32c..d44885d 100644 --- a/src/main/java/kcauldron/wrapper/ProcessingQueue.java +++ b/src/main/java/kcauldron/wrapper/ProcessingQueue.java @@ -6,119 +6,119 @@ import java.util.Queue; import java.util.concurrent.atomic.AtomicInteger; public class ProcessingQueue extends QueueWrapper { - public class ProcessingIterator implements Iterator { - private Iterator mRealIterator = mCollection.iterator(); + public class ProcessingIterator implements Iterator { + private Iterator mRealIterator = mCollection.iterator(); - @Override - public boolean hasNext() { - return mRealIterator.hasNext(); - } + @Override + public boolean hasNext() { + return mRealIterator.hasNext(); + } - @Override - public T next() { - return mRealIterator.next(); - } + @Override + public T next() { + return mRealIterator.next(); + } - @Override - public void remove() { - mRealIterator.remove(); - mSize.decrementAndGet(); - } - } + @Override + public void remove() { + mRealIterator.remove(); + mSize.decrementAndGet(); + } + } - private final AtomicInteger mSize; + private final AtomicInteger mSize; - @Override - public boolean add(T e) { - boolean result = super.add(e); - if (result) { - mSize.incrementAndGet(); - } - return result; - }; + @Override + public boolean add(T e) { + boolean result = super.add(e); + if (result) { + mSize.incrementAndGet(); + } + return result; + }; - @Override - public boolean offer(T e) { - boolean result = super.offer(e); - if (result) { - mSize.incrementAndGet(); - } - return result; - } + @Override + public boolean offer(T e) { + boolean result = super.offer(e); + if (result) { + mSize.incrementAndGet(); + } + return result; + } - @Override - public boolean addAll(Collection c) { - boolean result = false; - for (T t : c) { - result |= add(t); - } - return result; - } + @Override + public boolean addAll(Collection c) { + boolean result = false; + for (T t : c) { + result |= add(t); + } + return result; + } - @Override - public T remove() { - T result = super.remove(); - mSize.decrementAndGet(); - return result; - } + @Override + public T remove() { + T result = super.remove(); + mSize.decrementAndGet(); + return result; + } - @Override - public boolean remove(Object o) { - boolean result = super.remove(o); - if (result) { - mSize.decrementAndGet(); - } - return result; - } + @Override + public boolean remove(Object o) { + boolean result = super.remove(o); + if (result) { + mSize.decrementAndGet(); + } + return result; + } - @Override - public boolean removeAll(Collection c) { - boolean result = false; - for (Object t : c) { - result |= remove(t); - } - return result; - } + @Override + public boolean removeAll(Collection c) { + boolean result = false; + for (Object t : c) { + result |= remove(t); + } + return result; + } - @Override - public boolean retainAll(Collection c) { - boolean result = super.retainAll(c); - if (result) { - mSize.set(mCollection.size()); - } - return result; - } + @Override + public boolean retainAll(Collection c) { + boolean result = super.retainAll(c); + if (result) { + mSize.set(mCollection.size()); + } + return result; + } - @Override - public T poll() { - T result = super.remove(); - if (result != null) { - mSize.decrementAndGet(); - } - return result; - } + @Override + public T poll() { + T result = super.remove(); + if (result != null) { + mSize.decrementAndGet(); + } + return result; + } - public ProcessingQueue(Queue collection) { - super(collection); - mSize = new AtomicInteger(collection.size()); - } + public ProcessingQueue(Queue collection) { + super(collection); + mSize = new AtomicInteger(collection.size()); + } - @Override - public ProcessingIterator iterator() { - return new ProcessingIterator(); - } + @Override + public ProcessingIterator iterator() { + return new ProcessingIterator(); + } - @Override - public String toString() { - if (size() == 0) - return "[]"; - StringBuilder builder = new StringBuilder(); - for (T t : this) { - builder.append(','); - builder.append(t == null ? "null" : t.getClass().getSimpleName()); - } - builder.setCharAt(0, '['); - builder.append(']'); - return builder.toString(); - } + @Override + public String toString() { + if (size() == 0) + return "[]"; + StringBuilder builder = new StringBuilder(); + for (T t : this) { + builder.append(','); + builder.append(t == null ? "null" : t.getClass().getSimpleName()); + } + builder.setCharAt(0, '['); + builder.append(']'); + return builder.toString(); + } }