-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from Sefiraat/dev
Dev
- Loading branch information
Showing
65 changed files
with
1,028 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/io/github/sefiraat/crystamaehistoria/commands/OpenSpellCompendium.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package io.github.sefiraat.crystamaehistoria.commands; | ||
|
||
import io.github.mooy1.infinitylib.commands.SubCommand; | ||
import io.github.sefiraat.crystamaehistoria.magic.CastInformation; | ||
import io.github.sefiraat.crystamaehistoria.magic.SpellType; | ||
import io.github.sefiraat.crystamaehistoria.magic.spells.core.Spell; | ||
import io.github.sefiraat.crystamaehistoria.slimefun.ItemGroups; | ||
import io.github.sefiraat.crystamaehistoria.slimefun.itemgroups.SpellCollectionFlexGroup; | ||
import io.github.sefiraat.crystamaehistoria.utils.theme.ThemeType; | ||
import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; | ||
import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; | ||
import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideMode; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.OfflinePlayer; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public class OpenSpellCompendium extends SubCommand { | ||
|
||
public OpenSpellCompendium() { | ||
super("spells", "Opens the spell compendium", false); | ||
} | ||
|
||
@Override | ||
@ParametersAreNonnullByDefault | ||
protected void execute(CommandSender sender, String[] args) { | ||
if (sender instanceof Player) { | ||
Player player = (Player) sender; | ||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(player.getUniqueId()); | ||
Optional<PlayerProfile> playerProfile = PlayerProfile.find(offlinePlayer); | ||
playerProfile.ifPresent(profile -> ItemGroups.SPELL_COLLECTION.open(player, profile, SlimefunGuideMode.SURVIVAL_MODE)); | ||
} | ||
} | ||
|
||
@Override | ||
@ParametersAreNonnullByDefault | ||
protected void complete(CommandSender commandSender, String[] strings, List<String> list) { | ||
|
||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/io/github/sefiraat/crystamaehistoria/commands/OpenStoryCompendium.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package io.github.sefiraat.crystamaehistoria.commands; | ||
|
||
import io.github.mooy1.infinitylib.commands.SubCommand; | ||
import io.github.sefiraat.crystamaehistoria.slimefun.ItemGroups; | ||
import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; | ||
import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideMode; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.OfflinePlayer; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public class OpenStoryCompendium extends SubCommand { | ||
|
||
public OpenStoryCompendium() { | ||
super("stories", "Opens the story compendium", false); | ||
} | ||
|
||
@Override | ||
@ParametersAreNonnullByDefault | ||
protected void execute(CommandSender sender, String[] args) { | ||
if (sender instanceof Player) { | ||
Player player = (Player) sender; | ||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(player.getUniqueId()); | ||
Optional<PlayerProfile> playerProfile = PlayerProfile.find(offlinePlayer); | ||
playerProfile.ifPresent(profile -> ItemGroups.STORY_COLLECTION.open(player, profile, SlimefunGuideMode.SURVIVAL_MODE)); | ||
} | ||
} | ||
|
||
@Override | ||
@ParametersAreNonnullByDefault | ||
protected void complete(CommandSender commandSender, String[] strings, List<String> list) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/io/github/sefiraat/crystamaehistoria/listeners/DisplayItemListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.github.sefiraat.crystamaehistoria.listeners; | ||
|
||
import io.github.sefiraat.crystamaehistoria.utils.Keys; | ||
import io.github.thebusybiscuit.slimefun4.libraries.dough.data.persistent.PersistentDataAPI; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.inventory.InventoryPickupItemEvent; | ||
|
||
public class DisplayItemListener implements Listener { | ||
|
||
@EventHandler | ||
public void onArmorStandManipulate(InventoryPickupItemEvent e) { | ||
if (PersistentDataAPI.hasBoolean(e.getItem(), Keys.PDC_IS_DISPLAY_ITEM)) { | ||
e.setCancelled(true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.