mirror of
https://github.com/GTNewHorizons/ForgeRelocation.git
synced 2026-11-12 16:37:30 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bfcd5cd98 | ||
|
|
7bee6aa9c4 |
No files matched your search
@@ -61,6 +61,13 @@ object StickRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def resolveStick(w: World, pos: BlockCoord, side: Int): Boolean = {
|
def resolveStick(w: World, pos: BlockCoord, side: Int): Boolean = {
|
||||||
|
val p2 = pos.copy.offset(side)
|
||||||
|
val target = getBlock(w, p2)
|
||||||
|
if (
|
||||||
|
target != null &&
|
||||||
|
target.getBlockHardness(w, p2.x, p2.y, p2.z) < 0
|
||||||
|
) return false
|
||||||
|
|
||||||
def getFrame(pos: BlockCoord): IFrame = {
|
def getFrame(pos: BlockCoord): IFrame = {
|
||||||
val b = getBlock(w, pos)
|
val b = getBlock(w, pos)
|
||||||
if (b.isInstanceOf[IFrame]) return b.asInstanceOf[IFrame]
|
if (b.isInstanceOf[IFrame]) return b.asInstanceOf[IFrame]
|
||||||
@@ -68,10 +75,8 @@ object StickRegistry {
|
|||||||
if (te != null) return te
|
if (te != null) return te
|
||||||
interactionList.find(_.canInteract(w, pos.x, pos.y, pos.z)).orNull
|
interactionList.find(_.canInteract(w, pos.x, pos.y, pos.z)).orNull
|
||||||
}
|
}
|
||||||
|
|
||||||
val f1 = getFrame(pos)
|
val f1 = getFrame(pos)
|
||||||
if (f1 != null && f1.stickOut(w, pos.x, pos.y, pos.z, side)) {
|
if (f1 != null && f1.stickOut(w, pos.x, pos.y, pos.z, side)) {
|
||||||
val p2 = pos.copy.offset(side)
|
|
||||||
val f2 = getFrame(p2)
|
val f2 = getFrame(p2)
|
||||||
return f2 == null || f2.stickIn(w, p2.x, p2.y, p2.z, side ^ 1)
|
return f2 == null || f2.stickIn(w, p2.x, p2.y, p2.z, side ^ 1)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,6 +126,12 @@ object MovementManager2 {
|
|||||||
c: IMovementCallback
|
c: IMovementCallback
|
||||||
): Boolean = {
|
): Boolean = {
|
||||||
if (blocks.size > RelocationConfig.moveLimit) return false
|
if (blocks.size > RelocationConfig.moveLimit) return false
|
||||||
|
if (
|
||||||
|
blocks.exists { b =>
|
||||||
|
val block = w.getBlock(b.x, b.y, b.z)
|
||||||
|
block != null && block.getBlockHardness(w, b.x, b.y, b.z) < 0
|
||||||
|
}
|
||||||
|
) return false
|
||||||
|
|
||||||
val map = new MHashMap[(Int, Int), MSet[Int]]
|
val map = new MHashMap[(Int, Int), MSet[Int]]
|
||||||
with MMultiMap[(Int, Int), Int]
|
with MMultiMap[(Int, Int), Int]
|
||||||
|
|||||||
Reference in new issue
Block a user