diff --git a/src/main/java/io/github/teampropulsive/Blocks.java b/src/main/java/io/github/teampropulsive/Blocks.java index b469ca0..9e8f12b 100644 --- a/src/main/java/io/github/teampropulsive/Blocks.java +++ b/src/main/java/io/github/teampropulsive/Blocks.java @@ -12,6 +12,15 @@ public class Blocks { public static final Block VOLCANIC_MOON_REGOLITH = new Block( FabricBlockSettings.create().requiresTool().strength(4.0f, 10.0f) ); + public static final Block ALUMINUM_DEEPSLATE_ORE = new Block( + FabricBlockSettings.create().requiresTool().strength(4.5f, 3.0f) + ); + public static final Block ALUMINUM_ORE = new Block( + FabricBlockSettings.create().requiresTool().strength(1.5f, 6.0f) + ); + public static final Block ALUMINUM_BLOCK = new Block( + FabricBlockSettings.create().requiresTool().strength(5.0f, 6.0f) + ); public static final Block ANORTHOSITE = new Block( FabricBlockSettings.create().requiresTool().strength(5.0f, 11.0f) ); @@ -19,6 +28,10 @@ public static void register() { registerBlock(MOON_REGOLITH, "lunar_regolith"); registerBlock(VOLCANIC_MOON_REGOLITH, "volcanic_lunar_regolith"); registerBlock(ANORTHOSITE, "anorthosite"); + + registerBlock(ALUMINUM_BLOCK, "lunar_regolith"); + registerBlock(ALUMINUM_ORE, "lunar_regolith"); + registerBlock(ALUMINUM_DEEPSLATE_ORE, "lunar_regolith"); } private static void registerBlock(Block block, String name) { diff --git a/src/main/java/io/github/teampropulsive/Items.java b/src/main/java/io/github/teampropulsive/Items.java index 7db0a97..9626aa5 100644 --- a/src/main/java/io/github/teampropulsive/Items.java +++ b/src/main/java/io/github/teampropulsive/Items.java @@ -33,6 +33,10 @@ public static void register() { registerBlockItem("lunar_regolith", Blocks.MOON_REGOLITH); registerBlockItem("volcanic_lunar_regolith", Blocks.VOLCANIC_MOON_REGOLITH); registerBlockItem("anorthosite", Blocks.ANORTHOSITE); + + registerBlockItem("aluminum_block", Blocks.ALUMINUM_BLOCK); + registerBlockItem("aluminum_ore", Blocks.ALUMINUM_ORE); + registerBlockItem("aluminum_deepslate_ore", Blocks.ALUMINUM_DEEPSLATE_ORE); } private static void registerItem(String path, Item item) { Registry.register(Registries.ITEM, Propulsive.id(path), item); diff --git a/src/main/java/io/github/teampropulsive/space/spacecraft/SpacecraftEntity.java b/src/main/java/io/github/teampropulsive/space/spacecraft/SpacecraftEntity.java index aeca476..9491552 100644 --- a/src/main/java/io/github/teampropulsive/space/spacecraft/SpacecraftEntity.java +++ b/src/main/java/io/github/teampropulsive/space/spacecraft/SpacecraftEntity.java @@ -4,14 +4,12 @@ import io.github.teampropulsive.space.rocket.RocketEntity; import io.github.teampropulsive.types.Planet; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; -import net.fabricmc.loader.impl.lib.sat4j.core.Vec; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.passive.AbstractHorseEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; -import net.minecraft.util.TypeFilter; import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; import net.minecraft.world.EntityView; @@ -134,10 +132,20 @@ public void move(Vec3d offset) { this.setPosition(this.getPos().add(offset)); } public void moveWithModules(Vec3d offset) { + this.move(offset); + ArrayList done = new ArrayList<>(); + done.add(this); + moveWithModulesIter(offset, done); + } + + private void moveWithModulesIter(Vec3d offset, ArrayList done) { this.move(offset); for (SpacecraftEntity craft : this.dockedCraft) { // Could maybe be optimised later? Could be a little intensive with larger ships - craft.moveWithModules(offset); + if (!done.contains(craft)) { + craft.moveWithModulesIter(offset, done); + } } + done.add(this); } protected Vec3d calculateGravity() { // This probably works idk Vec3d velocity = Vec3d.ZERO;