aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/api')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/KillTracking.java61
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java65
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/events/LocationChangeEvent.java15
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/events/ProfileJoinedEvent.java12
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/events/ProfileSwitchedEvent.java12
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarLineUpdateEvent.java22
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPostEvent.java21
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPreGetEvent.java18
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/events/SkyBlockEntityKilled.java18
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/item/IAbility.java7
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeHelper.java36
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeRegistry.java27
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/SkyBlockEntity.java27
13 files changed, 0 insertions, 341 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/KillTracking.java b/src/main/java/com/thatgravyboat/skyblockhud/api/KillTracking.java
deleted file mode 100644
index 84882e1f4..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/KillTracking.java
+++ /dev/null
@@ -1,61 +0,0 @@
-//package com.thatgravyboat.skyblockhud.api;
-//
-//import com.thatgravyboat.skyblockhud.DevModeConstants;
-//import com.thatgravyboat.skyblockhud.api.events.SkyBlockEntityKilled;
-//import com.thatgravyboat.skyblockhud.api.sbentities.EntityTypeRegistry;
-//import java.util.HashSet;
-//import java.util.Set;
-//import java.util.UUID;
-//import net.minecraft.client.Minecraft;
-//import net.minecraft.nbt.NBTTagCompound;
-//import net.minecraft.util.DamageSource;
-//import net.minecraftforge.common.MinecraftForge;
-//import net.minecraftforge.event.entity.EntityJoinWorldEvent;
-//import net.minecraftforge.event.entity.living.LivingDeathEvent;
-//import net.minecraftforge.event.entity.player.AttackEntityEvent;
-//import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-//
-//public class KillTracking {
-//
-// public static final Set<UUID> attackedEntities = new HashSet<>();
-//
-// @SubscribeEvent
-// public void onAttack(AttackEntityEvent event) {
-// if (event.target != null) {
-// attackedEntities.add(event.target.getUniqueID());
-// }
-// }
-//
-// @SubscribeEvent
-// public void onDeath(LivingDeathEvent event) {
-// if (DevModeConstants.mobDeathLogging) {
-// //Used for testing
-// System.out.println("----------------------------------------------------------------------------------------------------------------");
-// System.out.println("Name : " + event.entity.getName());
-// System.out.println("UUID : " + event.entity.getUniqueID());
-// NBTTagCompound compound = new NBTTagCompound();
-// event.entity.writeToNBT(compound);
-// System.out.println("Tag : " + compound);
-// System.out.println("Damage : " + getDamageSourceString(event.source));
-// System.out.println("SBH Entity ID: " + EntityTypeRegistry.getEntityId(event.entity));
-// System.out.println("----------------------------------------------------------------------------------------------------------------");
-// }
-// if (attackedEntities.contains(event.entity.getUniqueID())) {
-// if (EntityTypeRegistry.getEntityId(event.entity) != null) {
-// MinecraftForge.EVENT_BUS.post(new SkyBlockEntityKilled(EntityTypeRegistry.getEntityId(event.entity), event.entity));
-// }
-// attackedEntities.remove(event.entity.getUniqueID());
-// }
-// }
-//
-// public static String getDamageSourceString(DamageSource source) {
-// return ("{ " + source.getDamageType() + ", " + source.isDamageAbsolute() + ", " + source.isDifficultyScaled() + ", " + source.isFireDamage() + ", " + source.isProjectile() + ", " + source.isUnblockable() + ", " + source.isExplosion() + ", " + source.isMagicDamage() + ", " + source.isCreativePlayer() + ", " + source.getSourceOfDamage() + " }");
-// }
-//
-// @SubscribeEvent
-// public void onWorldChange(EntityJoinWorldEvent event) {
-// if (event.entity == Minecraft.getMinecraft().thePlayer) {
-// attackedEntities.clear();
-// }
-// }
-//}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java b/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java
deleted file mode 100644
index de485ef5e..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/LeaderboardGetter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-//package com.thatgravyboat.skyblockhud.api;
-//
-//import static com.thatgravyboat.skyblockhud.ComponentHandler.SCOREBOARD_CHARACTERS;
-//
-//import at.lorenz.mod.LorenzMod;
-//import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
-//import com.thatgravyboat.skyblockhud.api.events.SidebarPostEvent;
-//import com.thatgravyboat.skyblockhud.api.events.SidebarPreGetEvent;
-//import com.thatgravyboat.skyblockhud.utils.Utils;
-//import java.util.*;
-//import java.util.stream.Collectors;
-//import net.minecraft.client.Minecraft;
-//import net.minecraft.scoreboard.Score;
-//import net.minecraft.scoreboard.ScoreObjective;
-//import net.minecraft.scoreboard.ScorePlayerTeam;
-//import net.minecraft.scoreboard.Scoreboard;
-//import net.minecraftforge.common.MinecraftForge;
-//import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-//import net.minecraftforge.fml.common.gameevent.TickEvent;
-//
-//public class LeaderboardGetter {
-//
-// private static Map<Integer, String> cachedScores = new HashMap<>();
-// private static List<String> cachedScoresList = new ArrayList<>();
-//
-// private static int ticks = 0;
-//
-// public static List<String> getCachedScores() {
-// return cachedScoresList;
-// }
-//
-// @SubscribeEvent
-// public void onClientUpdate(TickEvent.ClientTickEvent event) {
-// if (event.phase.equals(TickEvent.Phase.START)) return;
-// ticks++;
-// if (ticks % 5 != 0) return;
-//
-// Minecraft mc = Minecraft.getMinecraft();
-// if (mc.theWorld != null && LorenzMod.hasSkyblockScoreboard()) {
-// Scoreboard scoreboard = mc.theWorld.getScoreboard();
-// ScoreObjective sidebarObjective = scoreboard.getObjectiveInDisplaySlot(1);
-//
-// if (sidebarObjective != null && !MinecraftForge.EVENT_BUS.post(new SidebarPreGetEvent(scoreboard, sidebarObjective))) {
-// Collection<Score> scoreList = sidebarObjective.getScoreboard().getSortedScores(sidebarObjective);
-// Map<Integer, String> scores = scoreList.stream().collect(Collectors.toMap(Score::getScorePoints, this::getLine, (s1, s2) -> s1));
-//
-// if (!cachedScores.equals(scores)) {
-// scores.forEach((score, name) -> {
-// if (cachedScores.get(score) == null || !cachedScores.get(score).equals(name)) {
-// MinecraftForge.EVENT_BUS.post(new SidebarLineUpdateEvent(name, SCOREBOARD_CHARACTERS.matcher(name).replaceAll("").trim(), score, scores.size(), scoreboard, sidebarObjective));
-// }
-// });
-// cachedScores = scores;
-// cachedScoresList = scores.values().stream().map(name -> SCOREBOARD_CHARACTERS.matcher(name).replaceAll("").trim()).collect(Collectors.toList());
-// }
-// MinecraftForge.EVENT_BUS.post(new SidebarPostEvent(scoreboard, sidebarObjective, cachedScoresList));
-// }
-// }
-// }
-//
-// public String getLine(Score score) {
-// ScorePlayerTeam scorePlayerTeam = score.getScoreScoreboard().getPlayersTeam(score.getPlayerName());
-// return Utils.removeColor(ScorePlayerTeam.formatPlayerName(scorePlayerTeam, score.getPlayerName()));
-// }
-//}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/events/LocationChangeEvent.java b/src/main/java/com/thatgravyboat/skyblockhud/api/events/LocationChangeEvent.java
deleted file mode 100644
index 560ad32e4..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/events/LocationChangeEvent.java
+++ /dev/null
@@ -1,15 +0,0 @@
-//package com.thatgravyboat.skyblockhud.api.events;
-//
-//import com.thatgravyboat.skyblockhud.location.Locations;
-//import net.minecraftforge.fml.common.eventhandler.Event;
-//
-//public class LocationChangeEvent extends Event {
-//
-// public Locations oldLocation;
-// public Locations newLocation;
-//
-// public LocationChangeEvent(Locations oldLocation, Locations newLocation) {
-// this.oldLocation = oldLocation;
-// this.newLocation = newLocation;
-// }
-//}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/events/ProfileJoinedEvent.java b/src/main/java/com/thatgravyboat/skyblockhud/api/events/ProfileJoinedEvent.java
deleted file mode 100644
index f1d4d38b8..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/events/ProfileJoinedEvent.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.thatgravyboat.skyblockhud.api.events;
-
-import net.minecraftforge.fml.common.eventhandler.Event;
-
-public class ProfileJoinedEvent extends Event {
-
- public String profile;
-
- public ProfileJoinedEvent(String profile) {
- this.profile = profile;
- }
-}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/events/ProfileSwitchedEvent.java b/src/main/java/com/thatgravyboat/skyblockhud/api/events/ProfileSwitchedEvent.java
deleted file mode 100644
index 408ac8ade..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/events/ProfileSwitchedEvent.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.thatgravyboat.skyblockhud.api.events;
-
-import net.minecraftforge.fml.common.eventhandler.Event;
-
-public class ProfileSwitchedEvent extends Event {
-
- public String profile;
-
- public ProfileSwitchedEvent(String profile) {
- this.profile = profile;
- }
-}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarLineUpdateEvent.java b/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarLineUpdateEvent.java
deleted file mode 100644
index 2737ee911..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarLineUpdateEvent.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.thatgravyboat.skyblockhud.api.events;
-
-import net.minecraft.scoreboard.ScoreObjective;
-import net.minecraft.scoreboard.Scoreboard;
-import net.minecraftforge.fml.common.eventhandler.Event;
-
-public class SidebarLineUpdateEvent extends Event {
-
- public String rawLine;
- public String formattedLine;
- public int position;
- public Scoreboard scoreboard;
- public ScoreObjective objective;
-
- public SidebarLineUpdateEvent(String rawLine, String formattedLine, int score, int max, Scoreboard scoreboard, ScoreObjective objective) {
- this.rawLine = rawLine;
- this.formattedLine = formattedLine;
- this.position = max - score;
- this.scoreboard = scoreboard;
- this.objective = objective;
- }
-}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPostEvent.java b/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPostEvent.java
deleted file mode 100644
index 34d27e6bc..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPostEvent.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.thatgravyboat.skyblockhud.api.events;
-
-import java.util.List;
-import net.minecraft.scoreboard.ScoreObjective;
-import net.minecraft.scoreboard.Scoreboard;
-import net.minecraftforge.fml.common.eventhandler.Event;
-
-public class SidebarPostEvent extends Event {
-
- public Scoreboard scoreboard;
- public ScoreObjective objective;
- public List<String> scores;
- public String[] arrayScores;
-
- public SidebarPostEvent(Scoreboard scoreboard, ScoreObjective objective, List<String> scores) {
- this.scoreboard = scoreboard;
- this.objective = objective;
- this.scores = scores;
- this.arrayScores = scores.toArray(new String[] {});
- }
-}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPreGetEvent.java b/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPreGetEvent.java
deleted file mode 100644
index 0db1895c6..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SidebarPreGetEvent.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.thatgravyboat.skyblockhud.api.events;
-
-import net.minecraft.scoreboard.ScoreObjective;
-import net.minecraft.scoreboard.Scoreboard;
-import net.minecraftforge.fml.common.eventhandler.Cancelable;
-import net.minecraftforge.fml.common.eventhandler.Event;
-
-@Cancelable
-public class SidebarPreGetEvent extends Event {
-
- public Scoreboard scoreboard;
- public ScoreObjective objective;
-
- public SidebarPreGetEvent(Scoreboard scoreboard, ScoreObjective objective) {
- this.scoreboard = scoreboard;
- this.objective = objective;
- }
-}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SkyBlockEntityKilled.java b/src/main/java/com/thatgravyboat/skyblockhud/api/events/SkyBlockEntityKilled.java
deleted file mode 100644
index 61f8d824f..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SkyBlockEntityKilled.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.thatgravyboat.skyblockhud.api.events;
-
-import javax.annotation.Nullable;
-import net.minecraft.entity.Entity;
-import net.minecraftforge.fml.common.eventhandler.Event;
-
-public class SkyBlockEntityKilled extends Event {
-
- public String id;
-
- @Nullable
- public Entity entity;
-
- public SkyBlockEntityKilled(String id, @Nullable Entity entity) {
- this.id = id;
- this.entity = entity;
- }
-}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/item/IAbility.java b/src/main/java/com/thatgravyboat/skyblockhud/api/item/IAbility.java
deleted file mode 100644
index 4f330d9a3..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/item/IAbility.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.thatgravyboat.skyblockhud.api.item;
-
-public interface IAbility {
- String getAbility();
-
- int getAbilityTime();
-}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeHelper.java b/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeHelper.java
deleted file mode 100644
index 2d8a17e4b..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeHelper.java
+++ /dev/null
@@ -1,36 +0,0 @@
-//package com.thatgravyboat.skyblockhud.api.sbentities;
-//
-//import com.thatgravyboat.skyblockhud.location.LocationHandler;
-//import com.thatgravyboat.skyblockhud.location.Locations;
-//import net.minecraft.entity.Entity;
-//import net.minecraft.entity.monster.EntityEnderman;
-//import net.minecraft.entity.monster.EntityZombie;
-//import net.minecraft.init.Blocks;
-//import net.minecraft.init.Items;
-//
-//public class EntityTypeHelper {
-//
-// public static boolean isZealot(Entity entity) {
-// if (entity instanceof EntityEnderman) {
-// EntityEnderman enderman = ((EntityEnderman) entity);
-// double maxHealthBase = enderman.getAttributeMap().getAttributeInstanceByName("generic.maxHealth").getBaseValue();
-// if (maxHealthBase == 13000 || (maxHealthBase == 2000d && enderman.getHeldBlockState().getBlock().equals(Blocks.end_portal_frame))) {
-// return LocationHandler.getCurrentLocation().equals(Locations.DRAGONSNEST);
-// }
-// }
-// return false;
-// }
-//
-// public static boolean isCrypt(Entity entity) {
-// if (entity instanceof EntityZombie) {
-// EntityZombie zombie = ((EntityZombie) entity);
-// double maxHealthBase = zombie.getAttributeMap().getAttributeInstanceByName("generic.maxHealth").getBaseValue();
-// if (maxHealthBase != 2000d) return false;
-// if (zombie.getEquipmentInSlot(0) == null || !zombie.getEquipmentInSlot(0).getItem().equals(Items.iron_sword)) return false;
-// if (zombie.getEquipmentInSlot(1) == null || !zombie.getEquipmentInSlot(1).getItem().equals(Items.chainmail_boots)) return false;
-// if (zombie.getEquipmentInSlot(2) == null || !zombie.getEquipmentInSlot(2).getItem().equals(Items.chainmail_leggings)) return false;
-// return zombie.getEquipmentInSlot(3) != null && zombie.getEquipmentInSlot(3).getItem().equals(Items.chainmail_chestplate);
-// }
-// return false;
-// }
-//}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeRegistry.java b/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeRegistry.java
deleted file mode 100644
index d507eecfd..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeRegistry.java
+++ /dev/null
@@ -1,27 +0,0 @@
-//package com.thatgravyboat.skyblockhud.api.sbentities;
-//
-//import com.google.common.collect.ImmutableList;
-//import com.google.common.collect.Maps;
-//import java.util.List;
-//import java.util.Map;
-//import net.minecraft.entity.Entity;
-//import net.minecraft.entity.monster.EntityEnderman;
-//import net.minecraft.entity.monster.EntityZombie;
-//
-//public class EntityTypeRegistry {
-//
-// private static final Map<Class<? extends Entity>, List<SkyBlockEntity>> entities = Maps.newHashMap();
-//
-// static {
-// entities.put(EntityEnderman.class, ImmutableList.of(SkyBlockEntity.of("ZEALOT", EntityTypeHelper::isZealot)));
-// entities.put(EntityZombie.class, ImmutableList.of(SkyBlockEntity.of("CRYPT_GHOUL", EntityTypeHelper::isCrypt)));
-// }
-//
-// public static String getEntityId(Entity entity) {
-// if (!entities.containsKey(entity.getClass())) return null;
-// for (SkyBlockEntity skyBlockEntity : entities.get(entity.getClass())) {
-// if (skyBlockEntity.isEntity(entity)) return skyBlockEntity.getName();
-// }
-// return null;
-// }
-//}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/SkyBlockEntity.java b/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/SkyBlockEntity.java
deleted file mode 100644
index bcd1196f5..000000000
--- a/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/SkyBlockEntity.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.thatgravyboat.skyblockhud.api.sbentities;
-
-import java.util.function.Predicate;
-import net.minecraft.entity.Entity;
-
-public class SkyBlockEntity {
-
- private final String name;
- private final Predicate<Entity> predicate;
-
- public static SkyBlockEntity of(String name, Predicate<Entity> predicate) {
- return new SkyBlockEntity(name, predicate);
- }
-
- private SkyBlockEntity(String name, Predicate<Entity> predicate) {
- this.name = name;
- this.predicate = predicate;
- }
-
- public String getName() {
- return name;
- }
-
- public boolean isEntity(Entity entity) {
- return predicate.test(entity);
- }
-}