Infused downwards gen removed for now

This commit is contained in:
Niels Vergucht 2018-12-14 15:07:40 +01:00
parent d577a3c3c9
commit ebe2bcdf0a
3 changed files with 30 additions and 30 deletions

View File

@ -121,7 +121,7 @@
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
<repository>
<id>33_aikar</id>
<id>3_aikar</id>
<url>https://repo.aikar.co/content/groups/aikar/</url>
</repository>
<repository>

View File

@ -113,19 +113,19 @@ public abstract class Genbucket {
protected boolean gravityGenInfused(int moved, BlockFace blockFace) {
Block b = getNextBlock(moved, blockFace);
if (isBelowVoid(moved + 1)) return false;
if (b.getRelative(getBlockFace()).getType() != Material.AIR) {
if (b.getRelative(getBlockFace()).getType() != XMaterial.COBBLESTONE.parseMaterial()) {
if (b.getRelative(BlockFace.DOWN).getType() != Material.AIR) {
if (b.getRelative(BlockFace.DOWN).getType() != XMaterial.COBBLESTONE.parseMaterial()) {
b.setType(getGenItem().getType());
return false;
}
}
b.getRelative(getBlockFace()).setType(XMaterial.COBBLESTONE.parseMaterial());
b.getRelative(BlockFace.DOWN).setType(XMaterial.COBBLESTONE.parseMaterial());
b.setType(getGenItem().getType());
return true;
}
protected Block getNextBlock(int moved, BlockFace blockFace) {
return sourceBlock.getRelative(0, moved, 0);
return clickedBlock.getRelative(blockFace).getRelative(0, moved, 0);
}
protected Block getNextBlock() {

View File

@ -24,32 +24,32 @@ public class Infused extends Genbucket {
BukkitRunnable runnable = new BukkitRunnable() {
@Override
public void run() {
if (isGravityGen()) {
if (!side1 && !side2) {
epicBuckets.getGenbucketManager().unregisterGenbucketForPlayer(getOwner(), getGenUUID());
cancel();
return;
}
if (side1 && !gravityGenInfused(blocksPlaced, getBlockFace())) {
side1 = false;
}
if (side2 && !gravityGenInfused(blocksPlaced, getBlockFace().getOppositeFace())) {
side2 = false;
}
} else {
if ((!side1 && !side2) || blocksPlaced >= epicBuckets.getConfigManager().getMaxVerticalHeight()) {
epicBuckets.getGenbucketManager().unregisterGenbucketForPlayer(getOwner(), getGenUUID());
cancel();
return;
}
if (side1 && !placeGen(getNextBlock(blocksPlaced, getBlockFace()))) {
side1 = false;
}
if (side2 && !placeGen(getNextBlock(blocksPlaced, getBlockFace().getOppositeFace()))) {
side2 = false;
}
blocksPlaced++;
// if (isGravityGen()) {
// if (!side1 && !side2) {
// epicBuckets.getGenbucketManager().unregisterGenbucketForPlayer(getOwner(), getGenUUID());
// cancel();
// return;
// }
// if (side1 && !gravityGenInfused(blocksPlaced, getBlockFace())) {
// side1 = false;
// }
// if (side2 && !gravityGenInfused(blocksPlaced, getBlockFace().getOppositeFace())) {
// side2 = false;
// }
// } else {
if ((!side1 && !side2) || blocksPlaced >= epicBuckets.getConfigManager().getMaxVerticalHeight()) {
epicBuckets.getGenbucketManager().unregisterGenbucketForPlayer(getOwner(), getGenUUID());
cancel();
return;
}
if (side1 && !placeGen(getNextBlock(blocksPlaced, getBlockFace()))) {
side1 = false;
}
if (side2 && !placeGen(getNextBlock(blocksPlaced, getBlockFace().getOppositeFace()))) {
side2 = false;
}
blocksPlaced++;
// }
}
};
setGeneration(runnable.runTaskTimer(EpicBuckets.getInstance(), 0, epicBuckets.getConfigManager().getDelay()));