Variable renames

This commit is contained in:
MattBDev 2019-08-13 18:10:04 -04:00
parent 265f0c6615
commit d7c72d5f75
5 changed files with 11 additions and 17 deletions

View File

@ -30,8 +30,8 @@ public class Schematic {
public boolean setBlock(BlockVector3 position, BaseBlock block) throws WorldEditException { public boolean setBlock(BlockVector3 position, BaseBlock block) throws WorldEditException {
if (clipboard.getRegion().contains(position)) { if (clipboard.getRegion().contains(position)) {
BlockVector3 v = position.subtract(clipboard.getRegion().getMinimumPoint()); BlockVector3 vector3 = position.subtract(clipboard.getRegion().getMinimumPoint());
clipboard.setBlock(v, block); clipboard.setBlock(vector3, block);
return true; return true;
} else { } else {
return false; return false;
@ -39,9 +39,9 @@ public class Schematic {
} }
public void save(File file) throws IOException { public void save(File file) throws IOException {
try (SpongeSchematicWriter ssw = new SpongeSchematicWriter( try (SpongeSchematicWriter schematicWriter = new SpongeSchematicWriter(
new NBTOutputStream(new FileOutputStream(file)))) { new NBTOutputStream(new FileOutputStream(file)))) {
ssw.write(clipboard); schematicWriter.write(clipboard);
} }
} }
} }

View File

@ -327,9 +327,9 @@ public abstract class SchematicHandler {
public Schematic getSchematic(@NotNull URL url) { public Schematic getSchematic(@NotNull URL url) {
try { try {
ReadableByteChannel rbc = Channels.newChannel(url.openStream()); ReadableByteChannel readableByteChannel = Channels.newChannel(url.openStream());
InputStream is = Channels.newInputStream(rbc); InputStream inputStream = Channels.newInputStream(readableByteChannel);
return getSchematic(is); return getSchematic(inputStream);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -338,15 +338,15 @@ public abstract class SchematicHandler {
public Schematic getSchematic(@NotNull InputStream is) { public Schematic getSchematic(@NotNull InputStream is) {
try { try {
SpongeSchematicReader ssr = SpongeSchematicReader schematicReader =
new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(is))); new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(is)));
BlockArrayClipboard clip = (BlockArrayClipboard) ssr.read(); BlockArrayClipboard clip = (BlockArrayClipboard) schematicReader.read();
return new Schematic(clip); return new Schematic(clip);
} catch (IOException ignored) { } catch (IOException ignored) {
try { try {
MCEditSchematicReader msr = MCEditSchematicReader schematicReader =
new MCEditSchematicReader(new NBTInputStream(new GZIPInputStream(is))); new MCEditSchematicReader(new NBTInputStream(new GZIPInputStream(is)));
BlockArrayClipboard clip = (BlockArrayClipboard) msr.read(); BlockArrayClipboard clip = (BlockArrayClipboard) schematicReader.read();
return new Schematic(clip); return new Schematic(clip);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -23,7 +23,6 @@ public abstract class BasicLocalBlockQueue extends LocalBlockQueue {
private int lastZ = Integer.MIN_VALUE; private int lastZ = Integer.MIN_VALUE;
public BasicLocalBlockQueue(String world) { public BasicLocalBlockQueue(String world) {
super(world);
this.world = world; this.world = world;
this.modified = System.currentTimeMillis(); this.modified = System.currentTimeMillis();
} }

View File

@ -8,7 +8,6 @@ public class DelegateLocalBlockQueue extends LocalBlockQueue {
private final LocalBlockQueue parent; private final LocalBlockQueue parent;
public DelegateLocalBlockQueue(LocalBlockQueue parent) { public DelegateLocalBlockQueue(LocalBlockQueue parent) {
super(parent == null ? null : parent.getWorld());
this.parent = parent; this.parent = parent;
} }

View File

@ -16,10 +16,6 @@ import java.util.Map;
public abstract class LocalBlockQueue { public abstract class LocalBlockQueue {
public LocalBlockQueue(String world) {
// Implement this elsewhere
}
public ScopedLocalBlockQueue getForChunk(int x, int z) { public ScopedLocalBlockQueue getForChunk(int x, int z) {
int bx = x << 4; int bx = x << 4;
int bz = z << 4; int bz = z << 4;