fix bastion box

This commit is contained in:
okx-code
2025-09-28 01:51:14 +01:00
parent 74b52744f7
commit 3c9b0c6d25
2 changed files with 2 additions and 3 deletions

View File

@@ -4,7 +4,6 @@ import com.github.davidmoten.rtree2.Entry;
import com.github.davidmoten.rtree2.RTree;
import com.github.davidmoten.rtree2.geometry.Rectangle;
import com.github.davidmoten.rtree2.geometry.internal.PointDouble;
import com.github.davidmoten.rtree2.geometry.internal.PointFloat;
import isaac.bastion.Bastion;
import isaac.bastion.BastionBlock;
import isaac.bastion.BastionType;
@@ -226,7 +225,7 @@ public class BastionBlockStorage {
* @return A set of QTBoxes (bastions) that overlap with the location
*/
public Set<BastionBlock> forLocation(Location loc) {
Iterable<Entry<BastionBlock, Rectangle>> search = blocks.get(loc.getWorld()).search(PointFloat.create(loc.getBlockX(), loc.getBlockZ()));
Iterable<Entry<BastionBlock, Rectangle>> search = blocks.get(loc.getWorld()).search(PointDouble.create(loc.getBlockX(), loc.getBlockZ()));
Set<BastionBlock> result = new HashSet<>();
for (Entry<BastionBlock, Rectangle> qt : search) {
if (qt.value().inField(loc)) {

View File

@@ -18,6 +18,6 @@ public interface QTBox {
int qtZMax();
default Rectangle asRectangle() {
return RectangleDouble.create(qtXMin(), qtXMax(), qtZMin(), qtXMax());
return RectangleDouble.create(qtXMin(), qtXMax(), qtZMin(), qtZMax());
}
}