1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

Added Makeshift Smeltery + Tree Growth Accelerator

This commit is contained in:
TheBusyBiscuit 2020-03-16 02:18:35 +01:00
parent fef2a4ae2d
commit 0c5ef6fc83
7 changed files with 24 additions and 13 deletions

View File

@ -46,6 +46,9 @@
#### Additions
* Added some new charts to bStats
* Added a new language: Turkish
* Multiblocks that use Fences or Trap doors now accept all wood types
* Added Makeshift Smeltery
* Added Tree Growth Accelerator
#### Changes
* Removed some deprecated parts of the API
@ -53,6 +56,7 @@
* Changed Automatic Ignition Chamber to be a Dropper
* Teleporters are now significantly faster
* Item permissions have been moved to a seperate permissions.yml file
* Salt now only requires 2 blocks of Sand
#### Fixes
* Fixed some languages showing numbers larger than 100%

View File

@ -35,10 +35,13 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
* @see AnimalGrowthAccelerator
*
*/
public abstract class TreeGrowthAccelerator extends SlimefunItem implements InventoryBlock, EnergyNetComponent {
public class TreeGrowthAccelerator extends SlimefunItem implements InventoryBlock, EnergyNetComponent {
private static final int[] border = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 };
private static final int ENERGY_CONSUMPTION = 24;
private static final int RADIUS = 9;
public TreeGrowthAccelerator(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, recipeType, recipe);
@ -66,12 +69,6 @@ public abstract class TreeGrowthAccelerator extends SlimefunItem implements Inve
}
}
public abstract int getEnergyConsumption();
public abstract int getRadius();
public abstract int getSpeed();
@Override
public int[] getInputSlots() {
return new int[] { 10, 11, 12, 13, 14, 15, 16 };
@ -124,8 +121,8 @@ public abstract class TreeGrowthAccelerator extends SlimefunItem implements Inve
private int work(Block b, BlockMenu inv) {
int work = 0;
for (int x = -getRadius(); x <= getRadius(); x++) {
for (int z = -getRadius(); z <= getRadius(); z++) {
for (int x = -RADIUS; x <= RADIUS; x++) {
for (int z = -RADIUS; z <= RADIUS; z++) {
Block block = b.getRelative(x, 0, z);
if (Tag.SAPLINGS.isTagged(block.getType())) {
@ -134,8 +131,8 @@ public abstract class TreeGrowthAccelerator extends SlimefunItem implements Inve
if (sapling.getStage() < sapling.getMaximumStage()) {
for (int slot : getInputSlots()) {
if (SlimefunManager.isItemSimilar(inv.getItemInSlot(slot), SlimefunItems.FERTILIZER, false)) {
if (work > (getSpeed() - 1) || ChargableBlock.getCharge(b) < getEnergyConsumption()) return work;
ChargableBlock.addCharge(b, -getEnergyConsumption());
if (work > 3 || ChargableBlock.getCharge(b) < ENERGY_CONSUMPTION) return work;
ChargableBlock.addCharge(b, -ENERGY_CONSUMPTION);
sapling.setStage(sapling.getStage() + 1);
block.setBlockData(sapling);

View File

@ -256,6 +256,7 @@ public final class ResearchSetup {
register("magnesium_generator", 253, "Power from Magnesium", 20, SlimefunItems.MAGNESIUM_SALT, SlimefunItems.MAGNESIUM_GENERATOR);
register("kelp_cookie", 254, "Tasty Kelp", 4, SlimefunItems.KELP_COOKIE);
register("makeshift_smeltery", 255, "Improvised Smeltery", 6, SlimefunItems.MAKESHIFT_SMELTERY);
register("tree_growth_accelerator", 256, "Faster Trees", 18, SlimefunItems.TREE_GROWTH_ACCELERATOR);
}
private static void register(String key, int id, String name, int defaultCost, ItemStack... items) {

View File

@ -93,6 +93,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.Freezer;
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.HeatedPressureChamber;
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.Refinery;
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.TreeGrowthAccelerator;
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.WitherAssembler;
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.XPCollector;
import io.github.thebusybiscuit.slimefun4.implementation.items.electric.reactors.NetherStarReactor;
@ -2944,7 +2945,11 @@ public final class SlimefunItemSetup {
new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.WHEAT_ORGANIC_FOOD, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.AUTO_BREEDER, SlimefunItems.REINFORCED_ALLOY_INGOT})
.register(plugin);
new XPCollector(Categories.ELECTRICITY, (SlimefunItemStack) SlimefunItems.XP_COLLECTOR, RecipeType.ENHANCED_CRAFTING_TABLE,
new TreeGrowthAccelerator(Categories.ELECTRICITY, SlimefunItems.TREE_GROWTH_ACCELERATOR, RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {null, SlimefunItems.CARBONADO, null, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.DIAMOND_AXE), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.MAGNESIUM_SALT, SlimefunItems.BIG_CAPACITOR, SlimefunItems.MAGNESIUM_SALT})
.register(plugin);
new XPCollector(Categories.ELECTRICITY, (SlimefunItemStack) SlimefunItems.XP_COLLECTOR, RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.AUTO_ENCHANTER, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRONZE_INGOT})
.register(plugin);

View File

@ -732,6 +732,7 @@ public final class SlimefunItems {
public static final SlimefunItemStack ANIMAL_GROWTH_ACCELERATOR = new SlimefunItemStack("ANIMAL_GROWTH_ACCELERATOR", Material.HAY_BLOCK, "&bAnimal Growth Accelerator", "", "&rRuns on &aOrganic Food", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(28));
public static final SlimefunItemStack CROP_GROWTH_ACCELERATOR = new SlimefunItemStack("CROP_GROWTH_ACCELERATOR", Material.LIME_TERRACOTTA, "&aCrop Growth Accelerator", "", "&rRuns on &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Radius: 7x7", "&8\u21E8 &7Speed: &a3/time", LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(50));
public static final SlimefunItemStack CROP_GROWTH_ACCELERATOR_2 = new SlimefunItemStack("CROP_GROWTH_ACCELERATOR_2", Material.LIME_TERRACOTTA, "&aCrop Growth Accelerator &7(&eII&7)", "", "&rRuns on &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Radius: 9x9", "&8\u21E8 &7Speed: &a4/time", LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(60));
public static final SlimefunItemStack TREE_GROWTH_ACCELERATOR = new SlimefunItemStack("TREE_GROWTH_ACCELERATOR", Material.BROWN_TERRACOTTA, "&aTree Growth Accelerator", "", "&rRuns on &aOrganic Fertilizer", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Radius: 9x9", "&8\u21E8 &7Speed: &a4/time", LoreBuilder.powerBuffer(1024), LoreBuilder.powerPerSecond(48));
public static final SlimefunItemStack FOOD_FABRICATOR = new SlimefunItemStack("FOOD_FABRICATOR", Material.GREEN_STAINED_GLASS, "&cFood Fabricator", "", "&rProduces &aOrganic Food", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), "&8\u21E8 &7Speed: 1x", LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(14));
public static final SlimefunItemStack FOOD_FABRICATOR_2 = new SlimefunItemStack("FOOD_FABRICATOR_2", Material.GREEN_STAINED_GLASS, "&cFood Fabricator &7(&eII&7)", "", "&rProduces &aOrganic Food", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7Speed: 6x", LoreBuilder.powerBuffer(512), LoreBuilder.powerPerSecond(48));

View File

@ -230,3 +230,5 @@ slimefun:
xp_collector: Erfahrungssammler
bound_backpack: Ein treuer Rucksack
armored_jetboots: Gepanzerte Raketenstiefel
makeshift_smeltery: Improvisierter Schmelzofen
tree_growth_accelerator: Schnelle Bäume

View File

@ -230,3 +230,4 @@ slimefun:
magnesium_generator: Power from Magnesium
kelp_cookie: Tasty Kelp
makeshift_smeltery: Improvised Smeltery
tree_growth_accelerator: Faster Trees