Move transport and ammunition to authored AstraPlus capabilities
This commit is contained in:
+6
-6
@@ -15,8 +15,8 @@ import net.minecraft.world.phys.*;
|
||||
import net.neoforged.neoforge.common.util.FakePlayerFactory;
|
||||
import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
import online.astradev.content.train.*;
|
||||
import online.astradev.content.transport.SlimeBounce;
|
||||
import online.astradev.plus.capability.transport.train.*;
|
||||
import online.astradev.plus.capability.transport.collision.SurfaceBounce;
|
||||
import online.astradev.plus.api.BlockLine;
|
||||
|
||||
import java.nio.file.*;
|
||||
@@ -73,7 +73,7 @@ final class TrainVerification {
|
||||
for (var cart : carts) {
|
||||
cart.setOldPosAndRot();
|
||||
cart.tick();
|
||||
SlimeBounce.flush(cart);
|
||||
SurfaceBounce.flush(cart);
|
||||
}
|
||||
Trains.show(level);
|
||||
}
|
||||
@@ -297,7 +297,7 @@ final class TrainVerification {
|
||||
for (int t = 0; t < 15; t++) {
|
||||
cart.setOldPosAndRot();
|
||||
cart.tick();
|
||||
SlimeBounce.flush(cart);
|
||||
SurfaceBounce.flush(cart);
|
||||
double v = cart.getDeltaMovement().dot(direction(turn, 1));
|
||||
if (v < -.1) {
|
||||
reflected = true;
|
||||
@@ -321,7 +321,7 @@ final class TrainVerification {
|
||||
level.addFreshEntity(boat);
|
||||
boat.setDeltaMovement(dir);
|
||||
boat.move(MoverType.SELF, dir);
|
||||
SlimeBounce.flush(boat);
|
||||
SurfaceBounce.flush(boat);
|
||||
require(boat.getDeltaMovement().dot(dir) < -.99, "boat full speed bounce " + turn);
|
||||
boat.discard();
|
||||
}
|
||||
@@ -362,7 +362,7 @@ final class TrainVerification {
|
||||
level.setBlock(at(4, 0, 0, 0), Blocks.SLIME_BLOCK.defaultBlockState(), 2);
|
||||
var cart = cart(level, at(3, 0, 0, 0), new Vec3(1, 0, .2));
|
||||
cart.move(MoverType.SELF, cart.getDeltaMovement());
|
||||
SlimeBounce.flush(cart);
|
||||
SurfaceBounce.flush(cart);
|
||||
require(
|
||||
Math.abs(cart.getDeltaMovement().x + 1) < .001
|
||||
&& Math.abs(cart.getDeltaMovement().z - .2) < .001,
|
||||
|
||||
Reference in New Issue
Block a user