-
-
Notifications
You must be signed in to change notification settings - Fork 341
fix: correct lazycopy dimensions and world usage #3520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| package com.fastasyncworldedit.core.extent.clipboard; | ||
|
|
||
| import com.fastasyncworldedit.core.Fawe; | ||
| import com.fastasyncworldedit.core.queue.implementation.SingleThreadQueueExtent; | ||
| import com.fastasyncworldedit.core.util.ExtentTraverser; | ||
| import com.sk89q.worldedit.EditSession; | ||
| import com.sk89q.worldedit.EditSessionBuilder; | ||
| import com.sk89q.worldedit.WorldEdit; | ||
|
|
@@ -39,17 +42,19 @@ public WorldCopyClipboard(Supplier<Extent> supplier, Region region) { | |
| */ | ||
| @Deprecated(forRemoval = true, since = "2.13.0") | ||
| public WorldCopyClipboard(Supplier<Extent> supplier, Region region, boolean hasEntities, boolean hasBiomes) { | ||
| super(region); | ||
| this.hasBiomes = hasBiomes; | ||
| this.hasEntities = hasEntities; | ||
| this.extent = supplier.get(); | ||
| this(supplier.get(), region, hasEntities, hasBiomes); | ||
| } | ||
|
|
||
| private WorldCopyClipboard(Extent extent, Region region, boolean hasEntities, boolean hasBiomes) { | ||
| super(region); | ||
| this.hasBiomes = hasBiomes; | ||
| this.hasEntities = hasEntities; | ||
| this.extent = extent; | ||
| if (new ExtentTraverser<>(extent).find(SingleThreadQueueExtent.class) != null) { | ||
| // If we have a SingleThreadQueueExtent present, uncache so it cannot be used again for pasting (and therefore | ||
| // potentially resetting the world) | ||
| Fawe.instance().getQueueHandler().unCache(); | ||
| } | ||
| } | ||
|
|
||
| public static WorldCopyClipboard of(Extent extent, Region region) { | ||
|
|
@@ -64,6 +69,11 @@ public static WorldCopyClipboard of(Extent extent, Region region, boolean hasEnt | |
| return new WorldCopyClipboard(extent, region, hasEntities, hasBiomes); | ||
| } | ||
|
|
||
| @Override | ||
| public long getMaxSize() { | ||
| return -1; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just use
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to convey actually unlimited rather than functionally unlimited. It should go into the javadoc though yeah |
||
| } | ||
|
|
||
| public Extent getExtent() { | ||
| return extent; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An instance method is somehow the wrong approach, mainly because it requires an escaping
thisin the constructor, and it also doesn't have any different use really. MaybeSimpleClipboardis generally a rather problematic abstraction?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, but altering the hierarchy is rather a v3 change and it would be nice to have this working a little sooner than that... We could always deprecate for removal upon implementation and put the change into V3 immediately.
Alternatively I suppose we could just reimplement in a different class entirely? Certainly the clipboard hierarchy could do with some cleanup at some point regardless