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

Finished merge of PR #2015 and updated language keys

This commit is contained in:
TheBusyBiscuit 2020-06-24 21:25:21 +02:00
parent cccc8f2162
commit c64b311ee2
8 changed files with 33 additions and 29 deletions

View File

@ -28,6 +28,7 @@
* Compatibility mode status is now included in /sf versions
* Added Nether Quartz Ore Crusher Recipe
* Added a new language: Tagalog
* Added Magical Zombie Pills
#### Changes
* Coolant Cells now last twice as long

View File

@ -328,7 +328,7 @@ public final class SlimefunItems {
public static final SlimefunItemStack ENDER_LUMP_2 = new SlimefunItemStack("ENDER_LUMP_2", Material.GOLD_NUGGET, "&5Ender Lump &7- &eII", "", "&c&oTier: II");
public static final SlimefunItemStack ENDER_LUMP_3 = new SlimefunItemStack("ENDER_LUMP_3", Material.GOLD_NUGGET, "&5Ender Lump &7- &eIII", "", "&c&oTier: III");
public static final SlimefunItemStack MAGICAL_BOOK_COVER = new SlimefunItemStack("MAGICAL_BOOK_COVER", Material.PAPER, "&6Magical Book Cover", "", "&a&oUsed for various Magic Books");
public static final SlimefunItemStack MAGIC_PILLS = new SlimefunItemStack("MAGIC_PILLS", Material.NETHER_WART, "&cMagic Pills", "", "&a&oUsed to cure zombie villagers instantly");
public static final SlimefunItemStack MAGICAL_ZOMBIE_PILLS = new SlimefunItemStack("MAGICAL_ZOMBIE_PILLS", Material.NETHER_WART, "&6Magical Zombie Pills", "", "&eRight Click &7a Zombified Villager to", "&7instantly cure it from its curse");
public static final SlimefunItemStack BASIC_CIRCUIT_BOARD = new SlimefunItemStack("BASIC_CIRCUIT_BOARD", Material.ACTIVATOR_RAIL, "&bBasic Circuit Board");
public static final SlimefunItemStack ADVANCED_CIRCUIT_BOARD = new SlimefunItemStack("ADVANCED_CIRCUIT_BOARD", Material.POWERED_RAIL, "&bAdvanced Circuit Board");
public static final SlimefunItemStack WHEAT_FLOUR = new SlimefunItemStack("WHEAT_FLOUR", Material.SUGAR, "&rWheat Flour");

View File

@ -19,15 +19,18 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
/**
* This {@link SlimefunItem} allows you to convert any {@link ZombieVillager} to
* their {@link Villager} variant. It is also one of the very few utilisations of {@link EntityInteractHandler}.
*
* This item does not work on earlier versions than 1.14 as the {@link ZombieVillager} {@link EntityType}
* did not exist back then.
*
* @author Linox
*
* @see EntityInteractHandler
*
*/
public class MagicPills extends SimpleSlimefunItem<EntityInteractHandler> {
public class MagicalZombiePills extends SimpleSlimefunItem<EntityInteractHandler> {
public MagicPills(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) {
public MagicalZombiePills(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) {
super(category, item, recipeType, recipe, recipeOutput);
}
@ -40,14 +43,10 @@ public class MagicPills extends SimpleSlimefunItem<EntityInteractHandler> {
p.playSound(p.getLocation(), Sound.ENTITY_ZOMBIE_VILLAGER_CONVERTED, 1, 1);
ZombieVillager zombieVillager = (ZombieVillager) entity;
if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_14)) {
zombieVillager.setConversionTime(1);
if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
zombieVillager.setConversionPlayer(p);
}
zombieVillager.setConversionTime(1);
} else {
zombieVillager.setVillager(true);
if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_15)) {
zombieVillager.setConversionPlayer(p);
}
}
};

View File

@ -29,19 +29,22 @@ public class PlayerInteractEntityListener implements Listener {
@EventHandler
public void onInteractEntity(PlayerInteractAtEntityEvent e) {
if (!e.getRightClicked().isValid()) return;
if (!e.getRightClicked().isValid()) {
return;
}
ItemStack itemStack;
if (e.getHand() == EquipmentSlot.OFF_HAND) {
itemStack = e.getPlayer().getInventory().getItemInOffHand();
} else {
}
else {
itemStack = e.getPlayer().getInventory().getItemInMainHand();
}
SlimefunItem sfItem = SlimefunItem.getByItem(itemStack);
if (sfItem == null) return;
if (Slimefun.hasUnlocked(e.getPlayer(), sfItem, true)) {
SlimefunItem sfItem = SlimefunItem.getByItem(itemStack);
if (sfItem != null && Slimefun.hasUnlocked(e.getPlayer(), sfItem, true)) {
sfItem.callItemHandler(EntityInteractHandler.class, handler -> handler.onInteract(e.getPlayer(), e.getRightClicked(), itemStack, e.getHand() == EquipmentSlot.OFF_HAND));
}
}

View File

@ -265,7 +265,7 @@ public final class ResearchSetup {
register("tree_growth_accelerator", 256, "Faster Trees", 18, SlimefunItems.TREE_GROWTH_ACCELERATOR);
register("industrial_miner", 95, "Industrial Mining", 28, SlimefunItems.INDUSTRIAL_MINER);
register("advanced_industrial_miner", 98, "Better Mining", 36, SlimefunItems.ADVANCED_INDUSTRIAL_MINER);
register("magic_pills", 257, "De-Zombification", 22, SlimefunItems.MAGIC_PILLS);
register("magical_zombie_pills", 257, "De-Zombification", 22, SlimefunItems.MAGICAL_ZOMBIE_PILLS);
}
private static void register(String key, int id, String name, int defaultCost, ItemStack... items) {

View File

@ -121,7 +121,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfusedMa
import io.github.thebusybiscuit.slimefun4.implementation.items.magical.KnowledgeFlask;
import io.github.thebusybiscuit.slimefun4.implementation.items.magical.KnowledgeTome;
import io.github.thebusybiscuit.slimefun4.implementation.items.magical.MagicEyeOfEnder;
import io.github.thebusybiscuit.slimefun4.implementation.items.magical.MagicPills;
import io.github.thebusybiscuit.slimefun4.implementation.items.magical.MagicalZombiePills;
import io.github.thebusybiscuit.slimefun4.implementation.items.magical.SoulboundItem;
import io.github.thebusybiscuit.slimefun4.implementation.items.magical.SoulboundRune;
import io.github.thebusybiscuit.slimefun4.implementation.items.magical.StormStaff;
@ -779,17 +779,18 @@ public final class SlimefunItemSetup {
new StormStaff(categories.magicalGadgets, SlimefunItems.STAFF_STORM, RecipeType.ANCIENT_ALTAR,
new ItemStack[] {SlimefunItems.LIGHTNING_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.LIGHTNING_RUNE, SlimefunItems.STAFF_WATER, SlimefunItems.MAGIC_SUGAR, SlimefunItems.STAFF_WIND, SlimefunItems.LIGHTNING_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.LIGHTNING_RUNE})
.register(plugin);
ItemStack weaknessPotion = new ItemStack(Material.POTION);
PotionMeta meta = (PotionMeta) weaknessPotion.getItemMeta();
meta.setBasePotionData(new PotionData(PotionType.WEAKNESS, false, false));
weaknessPotion.setItemMeta(meta);
new MagicalZombiePills(categories.magicalGadgets, SlimefunItems.MAGICAL_ZOMBIE_PILLS, RecipeType.MAGIC_WORKBENCH,
new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT), new ItemStack(Material.APPLE), weaknessPotion, new ItemStack(Material.APPLE), new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT)},
new CustomItem(SlimefunItems.MAGICAL_ZOMBIE_PILLS, 2))
.register(plugin);
}
ItemStack magicPillsRecipePotion = new ItemStack(Material.POTION);
PotionMeta meta = (PotionMeta) magicPillsRecipePotion.getItemMeta();
meta.setBasePotionData(new PotionData(PotionType.WEAKNESS, false, false));
magicPillsRecipePotion.setItemMeta(meta);
new MagicPills(categories.magicalGadgets, SlimefunItems.MAGIC_PILLS, RecipeType.MAGIC_WORKBENCH,
new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT), new ItemStack(Material.APPLE), magicPillsRecipePotion, new ItemStack(Material.APPLE), new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT)},
new CustomItem(SlimefunItems.MAGIC_PILLS, 4))
.register(plugin);
new SmeltersPickaxe(categories.tools, SlimefunItems.SMELTERS_PICKAXE, RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null})
.register(plugin);

View File

@ -327,6 +327,7 @@ languages:
ja: 'Japanese'
fa: 'Persian'
th: 'Thai'
tl: 'Tagalog'
ro: 'Romanian'
bg: 'Bulgarian'
ko: 'Korean'
@ -335,4 +336,3 @@ languages:
mk: 'Macedonian'
sr: 'Serbian'
be: 'Belarusian'
tl: 'Tagalog'

View File

@ -233,4 +233,4 @@ slimefun:
tree_growth_accelerator: Faster Trees
industrial_miner: Industrial Mining
advanced_industrial_miner: Better Mining
magic_pills: De-Zombification
magical_zombie_pills: De-Zombification