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:
parent
f93117ffa3
commit
058f34879a
@ -65,6 +65,7 @@
|
|||||||
* Thunderstorms now count as night time for Solar Generators
|
* Thunderstorms now count as night time for Solar Generators
|
||||||
* Coolant Cells can no longer be placed on the ground
|
* Coolant Cells can no longer be placed on the ground
|
||||||
* Crafting Nether Ice Coolant Cells now results in 4 items
|
* Crafting Nether Ice Coolant Cells now results in 4 items
|
||||||
|
* Moved Soulbound Backpack to the "Magical Gadgets" Category
|
||||||
|
|
||||||
#### Fixes
|
#### Fixes
|
||||||
* Fixed #2005
|
* Fixed #2005
|
||||||
|
@ -14,7 +14,6 @@ import org.bukkit.metadata.FixedMetadataValue;
|
|||||||
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
|
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
|
||||||
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||||
import me.mrCookieSlime.Slimefun.Objects.Category;
|
import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||||
import me.mrCookieSlime.Slimefun.api.BlockStorage;
|
|
||||||
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||||
|
|
||||||
public abstract class ButcherAndroid extends ProgrammableAndroid {
|
public abstract class ButcherAndroid extends ProgrammableAndroid {
|
||||||
@ -31,14 +30,14 @@ public abstract class ButcherAndroid extends ProgrammableAndroid {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 damage = getTier() >= 3 ? 20D : 4D * getTier();
|
||||||
double radius = 4.0 + 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))) {
|
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;
|
boolean attack = false;
|
||||||
|
|
||||||
switch (BlockFace.valueOf(BlockStorage.getLocationInfo(b.getLocation(), "rotation"))) {
|
switch (face) {
|
||||||
case NORTH:
|
case NORTH:
|
||||||
attack = n.getLocation().getZ() < b.getZ();
|
attack = n.getLocation().getZ() < b.getZ();
|
||||||
break;
|
break;
|
||||||
|
@ -83,22 +83,22 @@ enum Instruction {
|
|||||||
// Action - Sword
|
// Action - Sword
|
||||||
ATTACK_MOBS_ANIMALS(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> {
|
ATTACK_MOBS_ANIMALS(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> {
|
||||||
Predicate<LivingEntity> predicate = e -> true;
|
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) -> {
|
ATTACK_MOBS(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> {
|
||||||
Predicate<LivingEntity> predicate = e -> e instanceof Monster;
|
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) -> {
|
ATTACK_ANIMALS(AndroidType.FIGHTER, HeadTexture.SCRIPT_ATTACK, (android, b, inv, face) -> {
|
||||||
Predicate<LivingEntity> predicate = e -> e instanceof Animals;
|
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) -> {
|
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();
|
Predicate<LivingEntity> predicate = e -> e instanceof Animals && e instanceof Ageable && ((Ageable) e).isAdult();
|
||||||
android.attack(b, predicate);
|
android.attack(b, face, predicate);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Action - Axe
|
// Action - Axe
|
||||||
|
@ -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!");
|
throw new UnsupportedOperationException("Non-butcher Android tried to butcher!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 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 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 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 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);
|
protected final Category armor = new Category(new NamespacedKey(SlimefunPlugin.instance(), "armor"), new CustomItem(SlimefunItems.DAMASCUS_STEEL_CHESTPLATE, "&7Armor"), 2);
|
||||||
|
|
||||||
|
@ -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})
|
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);
|
.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})
|
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);
|
.register(plugin);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user