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

Moved the Soulbound Backpack to "Magical Gadgets"

This commit is contained in:
TheBusyBiscuit 2020-07-10 18:02:51 +02:00
parent f93117ffa3
commit 058f34879a
6 changed files with 10 additions and 10 deletions

View File

@ -65,6 +65,7 @@
* Thunderstorms now count as night time for Solar Generators
* Coolant Cells can no longer be placed on the ground
* Crafting Nether Ice Coolant Cells now results in 4 items
* Moved Soulbound Backpack to the "Magical Gadgets" Category
#### Fixes
* Fixed #2005

View File

@ -14,7 +14,6 @@ import org.bukkit.metadata.FixedMetadataValue;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
public abstract class ButcherAndroid extends ProgrammableAndroid {
@ -31,14 +30,14 @@ public abstract class ButcherAndroid extends ProgrammableAndroid {
}
@Override
protected void attack(Block b, Predicate<LivingEntity> predicate) {
protected void attack(Block b, BlockFace face, Predicate<LivingEntity> predicate) {
double damage = getTier() >= 3 ? 20D : 4D * getTier();
double radius = 4.0 + getTier();
for (Entity n : b.getWorld().getNearbyEntities(b.getLocation(), radius, radius, radius, n -> n instanceof LivingEntity && !(n instanceof ArmorStand) && !(n instanceof Player) && n.isValid() && predicate.test((LivingEntity) n))) {
boolean attack = false;
switch (BlockFace.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "rotation"))) {
switch (face) {
case NORTH:
attack = n.getLocation().getZ() < b.getZ();
break;

View File

@ -83,22 +83,22 @@ enum Instruction {
// Action - Sword
ATTACK_MOBS_ANIMALS(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> {
Predicate<LivingEntity> predicate = e -> true;
android.attack(b, predicate);
android.attack(b, face, predicate);
}),
ATTACK_MOBS(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> {
Predicate<LivingEntity> predicate = e -> e instanceof Monster;
android.attack(b, predicate);
android.attack(b, face, predicate);
}),
ATTACK_ANIMALS(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> {
Predicate<LivingEntity> predicate = e -> e instanceof Animals;
android.attack(b, predicate);
android.attack(b, face, predicate);
}),
ATTACK_ANIMALS_ADULT(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> {
Predicate<LivingEntity> predicate = e -> e instanceof Animals && e instanceof Ageable && ((Ageable) e).isAdult();
android.attack(b, predicate);
android.attack(b, face, predicate);
}),
// Action - Axe

View File

@ -814,7 +814,7 @@ public abstract class ProgrammableAndroid extends SlimefunItem implements Invent
}
}
protected void attack(Block b, Predicate<LivingEntity> predicate) {
protected void attack(Block b, BlockFace face, Predicate<LivingEntity> predicate) {
throw new UnsupportedOperationException("Non-butcher Android tried to butcher!");
}

View File

@ -35,7 +35,7 @@ class DefaultCategories {
protected final Category weapons = new Category(new NamespacedKey(SlimefunPlugin.instance(), "weapons"), new CustomItem(SlimefunItems.BLADE_OF_VAMPIRES, "&7Weapons"), 1);
protected final Category tools = new Category(new NamespacedKey(SlimefunPlugin.instance(), "tools"), new CustomItem(SlimefunItems.SMELTERS_PICKAXE, "&7Tools"), 1);
protected final Category usefulItems = new Category(new NamespacedKey(SlimefunPlugin.instance(), "items"), new CustomItem(SlimefunItems.BACKPACK_MEDIUM, "&7Useful Items"), 1);
protected final Category basicMachines = new Category(new NamespacedKey(SlimefunPlugin.instance(), "basic_machines"), new CustomItem(Material.CRAFTING_TABLE, "&7Basic Machines"), 1);
protected final Category basicMachines = new Category(new NamespacedKey(SlimefunPlugin.instance(), "basic_machines"), new CustomItem(SlimefunItems.ENHANCED_CRAFTING_TABLE, "&7Basic Machines"), 1);
protected final Category food = new Category(new NamespacedKey(SlimefunPlugin.instance(), "food"), new CustomItem(SlimefunItems.FORTUNE_COOKIE, "&7Food"), 2);
protected final Category armor = new Category(new NamespacedKey(SlimefunPlugin.instance(), "armor"), new CustomItem(SlimefunItems.DAMASCUS_STEEL_CHESTPLATE, "&7Armor"), 2);

View File

@ -1108,7 +1108,7 @@ public final class SlimefunItemSetup {
new ItemStack[] {SlimefunItems.ENDER_LUMP_3, SlimefunItems.AIR_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.EARTH_RUNE, SlimefunItems.NECROTIC_SKULL, SlimefunItems.FIRE_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.WATER_RUNE, SlimefunItems.ENDER_LUMP_3})
.register(plugin);
new SoulboundBackpack(36, categories.usefulItems, SlimefunItems.BOUND_BACKPACK, RecipeType.MAGIC_WORKBENCH,
new SoulboundBackpack(36, categories.magicalGadgets, SlimefunItems.BOUND_BACKPACK, RecipeType.MAGIC_WORKBENCH,
new ItemStack[] {SlimefunItems.ENDER_LUMP_2, null, SlimefunItems.ENDER_LUMP_2, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.WOVEN_BACKPACK, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.ENDER_LUMP_2, null, SlimefunItems.ENDER_LUMP_2})
.register(plugin);