Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More blocks added, adjustments for initialization.
Chests are treated as single chests always, so there is a little potential for interaction getting through (blockinteract.visible). Snow is just treated as before, data-based height adjustment (to be added as a model, as Bukkit supports getting the level in a generic way, same for water).
- Loading branch information
Showing
8 changed files
with
250 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...it/src/main/java/fr/neatmonster/nocheatplus/compat/bukkit/model/BukkitBottomCentered.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package fr.neatmonster.nocheatplus.compat.bukkit.model; | ||
|
||
import org.bukkit.World; | ||
|
||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache; | ||
|
||
/** | ||
* Bottom center cuboid. | ||
* | ||
* @author asofold | ||
* | ||
*/ | ||
public class BukkitBottomCentered implements BukkitShapeModel { | ||
|
||
private final double minXZ; | ||
private final double maxXZ; | ||
private final double height; | ||
|
||
// TODO: Add modifications (shape alteration interface). | ||
|
||
public BukkitBottomCentered(double inset, double height) { | ||
this(inset, 1.0 - inset, height); | ||
} | ||
|
||
public BukkitBottomCentered(double minXZ, double maxXZ, double height) { | ||
this.minXZ = minXZ; | ||
this.maxXZ = maxXZ; | ||
this.height = height; | ||
} | ||
|
||
@Override | ||
public double[] getShape(final BlockCache blockCache, | ||
final World world, final int x, final int y, final int z) { | ||
return new double[] {minXZ, 0.0, minXZ, maxXZ, height, maxXZ}; | ||
} | ||
|
||
@Override | ||
public int getFakeData(final BlockCache blockCache, | ||
final World world, final int x, final int y, final int z) { | ||
return 0; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...mpatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/bukkit/model/BukkitStatic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package fr.neatmonster.nocheatplus.compat.bukkit.model; | ||
|
||
import org.bukkit.World; | ||
|
||
import fr.neatmonster.nocheatplus.utilities.map.BlockCache; | ||
|
||
public class BukkitStatic implements BukkitShapeModel { | ||
|
||
private final double minX; | ||
private final double minY; | ||
private final double minZ; | ||
private final double maxX; | ||
private final double maxY; | ||
private final double maxZ; | ||
|
||
/** | ||
* Initialize with the given height and with full xz-bounds. | ||
* | ||
* @param height | ||
*/ | ||
public BukkitStatic(double height) { | ||
this(0.0, height); | ||
} | ||
|
||
/** | ||
* Initialize with the given height and xz-inset. | ||
* | ||
* @param xzInset | ||
* @param height | ||
*/ | ||
public BukkitStatic(double xzInset, double height) { | ||
this(xzInset, 0.0, xzInset, 1.0 - xzInset, height, 1.0 - xzInset); | ||
} | ||
|
||
public BukkitStatic(double minX, double minY, double minZ, | ||
double maxX, double maxY, double maxZ) { | ||
this.minX = minX; | ||
this.minY = minY; | ||
this.minZ = minZ; | ||
this.maxX = maxX; | ||
this.maxY = maxY; | ||
this.maxZ = maxZ; | ||
|
||
} | ||
|
||
@Override | ||
public double[] getShape(final BlockCache blockCache, | ||
final World world, final int x, final int y, final int z) { | ||
return new double[] {minX, minY, minZ, maxX, maxY, maxZ}; | ||
} | ||
|
||
@Override | ||
public int getFakeData(final BlockCache blockCache, | ||
final World world, final int x, final int y, final int z) { | ||
return 0; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters