Skip to content

Commit

Permalink
Added aluminum block, aluminum ore and aluminum deepslate ore
Browse files Browse the repository at this point in the history
  • Loading branch information
JunePrimavera committed Sep 1, 2023
1 parent a468164 commit 0090e51
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
13 changes: 13 additions & 0 deletions src/main/java/io/github/teampropulsive/Blocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,26 @@ 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)
);
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) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/io/github/teampropulsive/Items.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -134,10 +132,20 @@ public void move(Vec3d offset) {
this.setPosition(this.getPos().add(offset));
}
public void moveWithModules(Vec3d offset) {
this.move(offset);
ArrayList<SpacecraftEntity> done = new ArrayList<>();
done.add(this);
moveWithModulesIter(offset, done);
}

private void moveWithModulesIter(Vec3d offset, ArrayList<SpacecraftEntity> 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;
Expand Down

0 comments on commit 0090e51

Please sign in to comment.