use of me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel in project Slimefun4 by Slimefun.
the class ProgrammableAndroid method consumeFuel.
@ParametersAreNonnullByDefault
private void consumeFuel(Block b, BlockMenu menu) {
ItemStack item = menu.getItemInSlot(43);
if (item != null && item.getType() != Material.AIR) {
for (MachineFuel fuel : fuelTypes) {
if (fuel.test(item)) {
menu.consumeItem(43);
if (getFuelSource() == AndroidFuelSource.LIQUID) {
menu.pushItem(new ItemStack(Material.BUCKET), getOutputSlots());
}
int fuelLevel = fuel.getTicks();
BlockStorage.addBlockInfo(b, "fuel", String.valueOf(fuelLevel));
break;
}
}
}
}
use of me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel in project Slimefun4 by Slimefun.
the class ProgrammableAndroid method getDisplayRecipes.
@Override
public List<ItemStack> getDisplayRecipes() {
List<ItemStack> list = new ArrayList<>();
for (MachineFuel fuel : fuelTypes) {
ItemStack item = fuel.getInput().clone();
ItemMeta im = item.getItemMeta();
List<String> lore = new ArrayList<>();
lore.add(ChatColors.color("&8\u21E8 &7Lasts " + NumberUtils.getTimeLeft(fuel.getTicks() / 2)));
im.setLore(lore);
item.setItemMeta(im);
list.add(item);
}
return list;
}
use of me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel in project Slimefun4 by Slimefun.
the class ProgrammableAndroid method registerDefaultFuelTypes.
private void registerDefaultFuelTypes() {
switch(getFuelSource()) {
case SOLID:
registerFuelType(new MachineFuel(80, new ItemStack(Material.COAL_BLOCK)));
registerFuelType(new MachineFuel(45, new ItemStack(Material.BLAZE_ROD)));
registerFuelType(new MachineFuel(70, new ItemStack(Material.DRIED_KELP_BLOCK)));
// Coal & Charcoal
registerFuelType(new MachineFuel(8, new ItemStack(Material.COAL)));
registerFuelType(new MachineFuel(8, new ItemStack(Material.CHARCOAL)));
// Logs
for (Material mat : Tag.LOGS.getValues()) {
registerFuelType(new MachineFuel(2, new ItemStack(mat)));
}
// Wooden Planks
for (Material mat : Tag.PLANKS.getValues()) {
registerFuelType(new MachineFuel(1, new ItemStack(mat)));
}
break;
case LIQUID:
registerFuelType(new MachineFuel(100, new ItemStack(Material.LAVA_BUCKET)));
registerFuelType(new MachineFuel(200, SlimefunItems.OIL_BUCKET));
registerFuelType(new MachineFuel(500, SlimefunItems.FUEL_BUCKET));
break;
case NUCLEAR:
registerFuelType(new MachineFuel(2500, SlimefunItems.URANIUM));
registerFuelType(new MachineFuel(1200, SlimefunItems.NEPTUNIUM));
registerFuelType(new MachineFuel(3000, SlimefunItems.BOOSTED_URANIUM));
break;
default:
throw new IllegalStateException("Unhandled Fuel Source: " + getFuelSource());
}
}
use of me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel in project Slimefun4 by Slimefun.
the class AbstractEnergyProvider method getDisplayRecipes.
@Override
public List<ItemStack> getDisplayRecipes() {
List<ItemStack> list = new ArrayList<>();
for (MachineFuel fuel : fuelTypes) {
ItemStack item = fuel.getInput().clone();
ItemMeta im = item.getItemMeta();
List<String> lore = new ArrayList<>();
lore.add(ChatColors.color("&8\u21E8 &7Lasts " + NumberUtils.getTimeLeft(fuel.getTicks() / 2)));
lore.add(ChatColors.color("&8\u21E8 &e\u26A1 &7" + getEnergyProduction() * 2) + " J/s");
lore.add(ChatColors.color("&8\u21E8 &e\u26A1 &7" + NumberUtils.getCompactDouble((double) fuel.getTicks() * getEnergyProduction()) + " J in total"));
im.setLore(lore);
item.setItemMeta(im);
list.add(item);
}
return list;
}
use of me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel in project Slimefun4 by Slimefun.
the class CoalGenerator method registerDefaultFuelTypes.
@Override
protected void registerDefaultFuelTypes() {
registerFuel(new MachineFuel(80, new ItemStack(Material.COAL_BLOCK)));
registerFuel(new MachineFuel(12, new ItemStack(Material.BLAZE_ROD)));
registerFuel(new MachineFuel(20, new ItemStack(Material.DRIED_KELP_BLOCK)));
// Boats
for (Material mat : Tag.ITEMS_BOATS.getValues()) {
registerFuel(new MachineFuel(5, new ItemStack(mat)));
}
// Coal & Charcoal
registerFuel(new MachineFuel(8, new ItemStack(Material.COAL)));
registerFuel(new MachineFuel(8, new ItemStack(Material.CHARCOAL)));
// Logs
for (Material mat : Tag.LOGS.getValues()) {
registerFuel(new MachineFuel(4, new ItemStack(mat)));
}
// Wooden Planks
for (Material mat : Tag.PLANKS.getValues()) {
registerFuel(new MachineFuel(1, new ItemStack(mat)));
}
// Wooden Slabs
for (Material mat : Tag.WOODEN_SLABS.getValues()) {
registerFuel(new MachineFuel(1, new ItemStack(mat)));
}
// Wooden Buttons
for (Material mat : Tag.WOODEN_BUTTONS.getValues()) {
registerFuel(new MachineFuel(1, new ItemStack(mat)));
}
// Wooden Fences
for (Material mat : Tag.WOODEN_FENCES.getValues()) {
registerFuel(new MachineFuel(1, new ItemStack(mat)));
}
// wooden Trapdoors
for (Material mat : Tag.WOODEN_TRAPDOORS.getValues()) {
registerFuel(new MachineFuel(3, new ItemStack(mat)));
}
// Wooden Pressure Plates
for (Material mat : Tag.WOODEN_PRESSURE_PLATES.getValues()) {
registerFuel(new MachineFuel(2, new ItemStack(mat)));
}
// Wooden Doors
for (Material mat : Tag.WOODEN_DOORS.getValues()) {
registerFuel(new MachineFuel(2, new ItemStack(mat)));
}
// Signs
for (Material mat : Tag.STANDING_SIGNS.getValues()) {
registerFuel(new MachineFuel(2, new ItemStack(mat)));
}
}
Aggregations