Skip to content

Commit

Permalink
Merge pull request #19 from Sefiraat/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Sefiraat authored Nov 10, 2021
2 parents e90b67e + d9c9304 commit ed6cda2
Show file tree
Hide file tree
Showing 57 changed files with 706 additions and 421 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<sonar.organization>sefiraat</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

<sonar.issue.ignore.multicriteria>e1,e2</sonar.issue.ignore.multicriteria>
<sonar.issue.ignore.multicriteria>e1,e2,e3</sonar.issue.ignore.multicriteria>
<sonar.issue.ignore.multicriteria.e1.ruleKey>java:S6212</sonar.issue.ignore.multicriteria.e1.ruleKey>
<sonar.issue.ignore.multicriteria.e1.resourceKey>**</sonar.issue.ignore.multicriteria.e1.resourceKey>

Expand Down Expand Up @@ -113,6 +113,12 @@
<version>b8f7dc</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.TheBusyBiscuit</groupId>
<artifactId>ExoticGarden</artifactId>
<version>a2c4b6d</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.github.sefiraat.crystamaehistoria.slimefun.Tools;
import io.github.sefiraat.crystamaehistoria.stories.BlockDefinition;
import io.github.sefiraat.crystamaehistoria.stories.StoriesManager;
import io.github.sefiraat.crystamaehistoria.utils.CrystaTag;
import io.github.sefiraat.crystamaehistoria.utils.PlayerStatUtils;
import io.github.thebusybiscuit.slimefun4.libraries.dough.collections.Pair;
import org.apache.commons.lang.Validate;
Expand Down Expand Up @@ -155,8 +154,6 @@ public void enable() {
getAddonCommand().addSub(new TestSpell());
getAddonCommand().addSub(new OpenSpellCompendium());
getAddonCommand().addSub(new OpenStoryCompendium());

CrystaTag.getCachedValues();
}

private void setupBstats() {
Expand Down Expand Up @@ -217,5 +214,4 @@ private void setupSlimefun() {
Gadgets.setup();
Tools.setup();
}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
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;
Expand Down Expand Up @@ -39,6 +33,6 @@ protected void execute(CommandSender sender, String[] args) {
@Override
@ParametersAreNonnullByDefault
protected void complete(CommandSender commandSender, String[] strings, List<String> list) {

// Not required
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ protected void execute(CommandSender sender, String[] args) {
@Override
@ParametersAreNonnullByDefault
protected void complete(CommandSender commandSender, String[] strings, List<String> list) {

// Not required
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ public void onArmorStandManipulate(PlayerArmorStandManipulateEvent e) {

@EventHandler
public void onArmorDispense(BlockDispenseArmorEvent e) {
if (e.getTargetEntity() instanceof ArmorStand) {
if (ArmourStandUtils.isDisplayStand((ArmorStand) e.getTargetEntity())) e.setCancelled(true);
if (e.getTargetEntity() instanceof ArmorStand
&& ArmourStandUtils.isDisplayStand((ArmorStand) e.getTargetEntity())
) {
e.setCancelled(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class ListenerManager {

public ListenerManager() {
addListener(new ArmorStandInteract());
addListener(new PlayerInteract());
addListener(new SpellCastListener());
addListener(new SpellEffectListener());
addListener(new CrystalBreakListener());
addListener(new BlockRemovalListener());
Expand All @@ -17,6 +17,7 @@ public ListenerManager() {
addListener(new EndermanInhibitorListener());
addListener(new MobCandleListener());
addListener(new DisplayItemListener());
addListener(new MiscListener());
}

private void addListener(Listener listener) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package io.github.sefiraat.crystamaehistoria.listeners;

import io.github.sefiraat.crystamaehistoria.slimefun.gadgets.MysteriousTicker;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;

public class MiscListener implements Listener {

@EventHandler
public void onDontTouchMyCrap(PlayerInteractEvent e) {
Block block = e.getClickedBlock();
if (e.getAction() == Action.RIGHT_CLICK_BLOCK && block != null) {
SlimefunItem slimefunItem = BlockStorage.check(block);
if (slimefunItem instanceof MysteriousTicker) {
e.setCancelled(true);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import io.github.sefiraat.crystamaehistoria.magic.DisplayItem;
import io.github.sefiraat.crystamaehistoria.slimefun.Materials;
import io.github.sefiraat.crystamaehistoria.slimefun.mechanisms.gadgets.ExpCollector;
import io.github.sefiraat.crystamaehistoria.slimefun.gadgets.ExpCollector;
import io.github.sefiraat.crystamaehistoria.slimefun.mechanisms.liquefactionbasin.LiquefactionBasin;
import io.github.sefiraat.crystamaehistoria.slimefun.tools.RefactingLens;
import io.github.sefiraat.crystamaehistoria.stories.definition.StoryType;
Expand Down Expand Up @@ -62,7 +62,7 @@ private void liquefactionBasin(Player player, SlimefunItem blockItem, Block clic
for (Map.Entry<StoryType, Integer> entry : cacheMap.entrySet()) {
final Integer integer = entry.getValue();
final StoryType storyType = entry.getKey();
final ItemStack itemStack = Materials.DUMMY_CRYSTAL_MAP.get(storyType).getItem().clone();
final ItemStack itemStack = Materials.getDummyCrystalMap().get(storyType).getItem().clone();
final double xOffset = (space * xPos) - evenOffset;

final Vector pointVector = new Vector(xOffset, 0, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,23 @@
import io.github.sefiraat.crystamaehistoria.magic.CastInformation;
import io.github.sefiraat.crystamaehistoria.magic.CastResult;
import io.github.sefiraat.crystamaehistoria.magic.spells.core.InstanceStave;
import io.github.sefiraat.crystamaehistoria.slimefun.mechanisms.gadgets.MysteriousTicker;
import io.github.sefiraat.crystamaehistoria.slimefun.tools.stave.SpellSlot;
import io.github.sefiraat.crystamaehistoria.slimefun.tools.stave.Stave;
import io.github.sefiraat.crystamaehistoria.utils.Keys;
import io.github.sefiraat.crystamaehistoria.utils.datatypes.DataTypeMethods;
import io.github.sefiraat.crystamaehistoria.utils.datatypes.PersistentStaveDataType;
import io.github.sefiraat.crystamaehistoria.utils.theme.ThemeType;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class PlayerInteract implements Listener {
public class SpellCastListener implements Listener {

@EventHandler
public void onInteract(PlayerInteractEvent e) {
Expand All @@ -49,7 +45,7 @@ public void onInteract(PlayerInteractEvent e) {
);
stack.setItemMeta(itemMeta);
staveInstance.buildLore();
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(
player.sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(
ThemeType.SUCCESS.getColor() + "Casting spell: " + castInformation.getSpellType().getId()
));
} else {
Expand All @@ -59,16 +55,4 @@ public void onInteract(PlayerInteractEvent e) {
}
}
}

@EventHandler
public void onDontTouchMyCrap(PlayerInteractEvent e) {
Block block = e.getClickedBlock();
if (e.getAction() == Action.RIGHT_CLICK_BLOCK && block != null) {
SlimefunItem slimefunItem = BlockStorage.check(block);
if (slimefunItem instanceof MysteriousTicker) {
e.setCancelled(true);
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerEggThrowEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.weather.LightningStrikeEvent;
import org.bukkit.inventory.ItemStack;
Expand Down Expand Up @@ -109,13 +108,6 @@ public void onFallingBlockLands(EntityChangeBlockEvent event) {
}
}

@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onEggThrow(PlayerEggThrowEvent event) {
if (CrystamaeHistoria.getProjectileMap().containsKey(event.getEgg().getUniqueId())) {
event.setHatching(false);
}
}

private boolean entityHitAllowed(CastInformation castInformation, Entity hitEntity) {
final Player player = Bukkit.getPlayer(castInformation.getCaster());
return hitEntity instanceof LivingEntity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
import io.github.sefiraat.crystamaehistoria.magic.spells.tier1.TimeCompression;
import io.github.sefiraat.crystamaehistoria.magic.spells.tier1.TimeDilation;
import io.github.sefiraat.crystamaehistoria.magic.spells.tier1.Tracer;
import io.github.sefiraat.crystamaehistoria.magic.spells.tier1.TunnelBore;
import io.github.sefiraat.crystamaehistoria.magic.spells.tier1.Vacuum;
import io.github.sefiraat.crystamaehistoria.magic.spells.tier1.WitherWeather;
import io.github.sefiraat.crystamaehistoria.slimefun.mechanisms.liquefactionbasin.LiquefactionBasinCache;
Expand Down Expand Up @@ -150,7 +149,6 @@ public enum SpellType {
TIME_COMPRESSION(new TimeCompression()),
TIME_DILATION(new TimeDilation()),
TRACER(new Tracer()),
TUNNEL_BORE(new TunnelBore()),
VACUUM(new Vacuum()),
WITHER_WEATHER(new WitherWeather());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@ private void castBlood(CastInformation castInformation, Location location, doubl
getDamage(castInformation)
);
ParticleUtils.displayParticleEffect(livingEntity, 2, 10, dustOptions);
if (iteration <= 5) {
if (livingEntity.getHealth() <= 0) {
GeneralUtils.pushEntity(castInformation.getCaster(), castInformation.getCastLocation(), entity, 5);
ParticleUtils.displayParticleEffect(livingEntity, 4, 20, dustOptions);
entity.remove();
castBlood(castInformation, livingEntity.getLocation(), 2, iteration + 1);
}
if (iteration <= 5 && livingEntity.getHealth() <= 0) {
GeneralUtils.pushEntity(castInformation.getCaster(), castInformation.getCastLocation(), entity, 5);
ParticleUtils.displayParticleEffect(livingEntity, 4, 20, dustOptions);
entity.remove();
castBlood(castInformation, livingEntity.getLocation(), 2, iteration + 1);
}
}
}
Expand Down
Loading

0 comments on commit ed6cda2

Please sign in to comment.