Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
boy0001 committed Mar 1, 2016
2 parents 8bf3cea + 0bbfd0f commit 109715e
Show file tree
Hide file tree
Showing 22 changed files with 380 additions and 210 deletions.
2 changes: 1 addition & 1 deletion Bukkit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies {
compile project(':Core')
compile 'org.bukkit:bukkit:1.8.8-R0.1-SNAPSHOT'
compile 'org.bukkit:bukkit:1.9-R0.1-SNAPSHOT'
compile 'net.milkbowl.vault:VaultAPI:1.5'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ public boolean run(final APlotMeConnector connector) {
PS.get().config.set("worlds." + world + ".road.width", pathwidth);

Integer pathheight = PLOTME_DG_YML.getInt("worlds." + plotMeWorldName + ".RoadHeight"); //
if ((pathheight == null) || (pathheight == 0)) {
if (pathheight == 0) {
pathheight = 64;
}
PS.get().config.set("worlds." + world + ".road.height", pathheight);
PS.get().config.set("worlds." + world + ".wall.height", pathheight);
PS.get().config.set("worlds." + world + ".plot.height", pathheight);
Integer plotsize = PLOTME_DG_YML.getInt("worlds." + plotMeWorldName + ".PlotSize"); //
if ((plotsize == null) || (plotsize == 0)) {
if (plotsize == 0) {
plotsize = 32;
}
PS.get().config.set("worlds." + world + ".plot.size", plotsize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ public boolean unloadChunk(final String world, final Chunk chunk) {
final int z = Z << 4;
final int x2 = x + 15;
final int z2 = z + 15;
Thread thread = new Thread();
Plot plot = new Location(world, x, 1, z).getOwnedPlotAbs();
if (plot != null && plot.hasOwner()) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ public int getHighestBlock(final String world, final int x, final int z) {
public int getBiomeFromString(final String biomeStr) {
try {
final Biome biome = Biome.valueOf(biomeStr.toUpperCase());
if (biome == null) {
return -1;
}
return Arrays.asList(Biome.values()).indexOf(biome);
} catch (final IllegalArgumentException e) {
return -1;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.plotsquared.bukkit.util.block;

import com.intellectualcrafters.plot.util.PlotChunk;
import com.intellectualcrafters.plot.util.SetQueue;
import com.plotsquared.bukkit.util.BukkitUtil;
import org.bukkit.Chunk;

public class FastChunk_1_9 extends PlotChunk<Chunk> {

public FastChunk_1_9(SetQueue.ChunkWrapper wrap) {
super(wrap);
}

@Override
public Chunk getChunkAbs() {
SetQueue.ChunkWrapper loc = getChunkWrapper();
return BukkitUtil.getWorld(loc.world).getChunkAt(loc.x, loc.z);
}

@Override public void setBlock(int x, int y, int z, int id, byte data) {

}

@Override public void setBiome(int x, int z, int biome) {

}

@Override public PlotChunk clone() {
return null;
}

@Override public PlotChunk shallowClone() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ public class FastQueue_1_8_3 extends SlowQueue {
private final RefClass classBlockPosition = getRefClass("{nms}.BlockPosition");
private final RefClass classChunkSection = getRefClass("{nms}.ChunkSection");
public HashMap<ChunkWrapper, Chunk> toUpdate = new HashMap<>();
private RefMethod methodGetHandlePlayer;
private RefMethod methodGetHandleChunk;
private RefConstructor MapChunk;
private RefField connection;
private RefMethod send;
private RefMethod methodInitLighting;
private RefConstructor classBlockPositionConstructor;
private RefConstructor classChunkSectionConstructor;
Expand All @@ -64,12 +61,9 @@ public class FastQueue_1_8_3 extends SlowQueue {
private RefMethod methodGetIdArray;

public FastQueue_1_8_3() throws NoSuchMethodException, RuntimeException {
methodGetHandlePlayer = classCraftPlayer.getMethod("getHandle");
methodGetHandleChunk = classCraftChunk.getMethod("getHandle");
methodInitLighting = classChunk.getMethod("initLighting");
MapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), boolean.class, int.class);
connection = classEntityPlayer.getField("playerConnection");
send = classConnection.getMethod("sendPacket", classPacket.getRealClass());
classBlockPositionConstructor = classBlockPosition.getConstructor(int.class, int.class, int.class);
methodX = classWorld.getMethod("x", classBlockPosition.getRealClass());
fieldSections = classChunk.getField("sections");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.plotsquared.bukkit.util.block;

import com.intellectualcrafters.plot.util.PlotChunk;
import com.intellectualcrafters.plot.util.SetQueue;
import org.bukkit.Chunk;

public class FastQueue_1_9 extends SlowQueue {

@Override public PlotChunk<Chunk> getChunk(SetQueue.ChunkWrapper wrap) {
return new FastChunk_1_9(wrap);
}
}
2 changes: 2 additions & 0 deletions Core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
dependencies {
testCompile 'junit:junit:4.12'
compile 'org.yaml:snakeyaml:1.16'
compile 'com.google.code.gson:gson:2.2.4'
}

sourceCompatibility = 1.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public static String getAlias(final Class<? extends ConfigurationSerializable> c

final SerializableAs alias = clazz.getAnnotation(SerializableAs.class);

if ((alias != null) && (alias.value() != null)) {
if (alias != null) {
return alias.value();
}

Expand Down
Loading

0 comments on commit 109715e

Please sign in to comment.