mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-15 23:20:44 +00:00
add crude oil weight
This commit is contained in:
@@ -16,6 +16,7 @@ import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import net.civmc.zorweth.RocketTransferKeys;
|
||||
import net.civmc.zorweth.ZorwethPlugin;
|
||||
import net.civmc.zorweth.mechanics.Fuel;
|
||||
import net.civmc.zorweth.transfer.RocketBlockPosition;
|
||||
import net.civmc.zorweth.transfer.RocketChestTransfer;
|
||||
import net.civmc.zorweth.transfer.RocketEntityPosition;
|
||||
@@ -153,6 +154,8 @@ public class LaunchHandler {
|
||||
double itemMass = itemAmount / (double) item.getMaxStackSize();
|
||||
if (FlightComputer.isFuel(item)) {
|
||||
itemMass = itemAmount * FUEL_ITEM_MASS_KG;
|
||||
} else if (Fuel.isCrudeOil(item)) {
|
||||
itemMass = itemAmount * Fuel.CRUDE_OIL_ITEM_MASS_KG;
|
||||
}
|
||||
mass += itemMass;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import vg.civcraft.mc.civmodcore.inventory.CustomItem;
|
||||
|
||||
public class Fuel {
|
||||
|
||||
public static final double CRUDE_OIL_ITEM_MASS_KG = 0.5;
|
||||
|
||||
public static void registerCustomItems() {
|
||||
createCrudeOil();
|
||||
createRocketFuel();
|
||||
@@ -25,7 +27,8 @@ public class Fuel {
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
meta.itemName(Component.text("Crude Oil", TextColor.color(64, 52, 40)));
|
||||
meta.lore(List.of(Component.text("It smells pretty noxious.", NamedTextColor.WHITE),
|
||||
Component.text("Can be refined to rocket fuel.", NamedTextColor.WHITE)));
|
||||
Component.text("Can be refined to rocket fuel.", NamedTextColor.WHITE),
|
||||
Component.text("Each item weighs 0.5 kg in rockets.", NamedTextColor.WHITE)));
|
||||
meta.setEnchantmentGlintOverride(true);
|
||||
item.setItemMeta(meta);
|
||||
CustomItem.registerCustomItem("crude_oil", item);
|
||||
@@ -62,4 +65,8 @@ public class Fuel {
|
||||
public static boolean isRocketFuel(final ItemStack item) {
|
||||
return CustomItem.isCustomItem(item, "rocket_fuel");
|
||||
}
|
||||
|
||||
public static boolean isCrudeOil(final ItemStack item) {
|
||||
return CustomItem.isCustomItem(item, "crude_oil");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user