package com.example.spacemod;
import net.fabricmc.api.ModInitializer;
public class SpaceTravelMod implements ModInitializer {
public static final String MOD_ID = "spacemod";
@Override
public void onInitialize() {
System.out.println("Space Travel Mod loaded!");
}
// =====================================================
// PLANETEN
// =====================================================
public enum Planet {
MOON,
MARS,
VENUS,
MERCURY
}
// =====================================================
// RAUMANZUG
// =====================================================
public static class SpaceSuit {
public boolean helmet;
public boolean chestplate;
public boolean leggings;
public boolean boots;
public SpaceSuit() {
helmet = false;
chestplate = false;
leggings = false;
boots = false;
}
public boolean isComplete() {
return helmet
&& chestplate
&& leggings
&& boots;
}
}
// =====================================================
// RAKETE
// =====================================================
public static class Rocket {
private boolean launched;
private int height;
private Planet destination;
public Rocket() {
launched = false;
height = 0;
destination = null;
}
public void launch(Planet planet) {
if (launched || planet == null) {
return;
}
destination = planet;
launched = true;
height = 0;
}
public void tick() {
if (!launched) {
return;
}
height += 10;
if (height >= 1000) {
arrive();
}
}
private void arrive() {
if (destination == null) {
return;
}
// Hier wird die echte Minecraft-Dimension
// des jeweiligen Planeten angesprochen.
launched = false;
}
public int getHeight() {
return height;
}
public Planet getDestination() {
return destination;
}
public boolean isLaunched() {
return launched;
}
}
// =====================================================
// PLANETEN-SCHUTZ
// =====================================================
public static class PlanetEnvironment {
public static boolean requiresSpaceSuit(Planet planet) {
return planet == Planet.MOON
|| planet == Planet.MARS
|| planet == Planet.VENUS
|| planet == Planet.MERCURY;
}
public static boolean playerCanSurvive(
Planet planet,
SpaceSuit suit) {
if (!requiresSpaceSuit(planet)) {
return true;
}
return suit != null && suit.isComplete();
}
}
// =====================================================
// MARS
// =====================================================
public static class MarsSystem {
public static final double SAND_TO_IRON_CHANCE = 0.01;
public static boolean canConvertSand(
boolean isMars,
boolean isSand) {
return isMars && isSand;
}
}
// =====================================================
// SPACE SUIT REZEPT
// =====================================================
public static class SpaceSuitRecipe {
public static boolean valid(
boolean ironArmor,
boolean copperBlock) {
return ironArmor && copperBlock;
}
}
}