Skip to content

Commit

Permalink
2.0.2 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Seosean committed Mar 16, 2024
1 parent 3970824 commit 9e14879
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "2.0.1"
version = "2.0.2"
group= "com.seosean.showspawntime" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "ShowSpawnTime"

Expand Down
29 changes: 26 additions & 3 deletions src/main/java/com/seosean/showspawntime/ShowSpawnTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
import com.seosean.showspawntime.features.dpscounter.DPSCounter;
import com.seosean.showspawntime.features.dpscounter.DPSCounterRenderer;
import com.seosean.showspawntime.features.frcooldown.FastReviveCoolDown;
import com.seosean.showspawntime.features.leftnotice.LeftNotice;
import com.seosean.showspawntime.features.lrqueue.LRQueueRenderer;
import com.seosean.showspawntime.features.playerinvisibility.PlayerInvisibility;
import com.seosean.showspawntime.features.powerups.PowerupDetect;
import com.seosean.showspawntime.features.powerups.PowerupRenderer;
import com.seosean.showspawntime.features.spawntimes.SpawnNotice;
Expand Down Expand Up @@ -45,7 +47,7 @@
public class ShowSpawnTime
{
public static final String MODID = "showspawntime";
public static final String VERSION = "2.0.1";
public static final String VERSION = "2.0.2";
public static final String EMOJI_REGEX = "(?:[\uD83C\uDF00-\uD83D\uDDFF]|[\uD83E\uDD00-\uD83E\uDDFF]|[\uD83D\uDE00-\uD83D\uDE4F]|[\uD83D\uDE80-\uD83D\uDEFF]|[\u2600-\u26FF]\uFE0F?|[\u2700-\u27BF]\uFE0F?|\u24C2\uFE0F?|[\uD83C\uDDE6-\uD83C\uDDFF]{1,2}|[\uD83C\uDD70\uD83C\uDD71\uD83C\uDD7E\uD83C\uDD7F\uD83C\uDD8E\uD83C\uDD91-\uD83C\uDD9A]\uFE0F?|[\u0023\u002A\u0030-\u0039]\uFE0F?\u20E3|[\u2194-\u2199\u21A9-\u21AA]\uFE0F?|[\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55]\uFE0F?|[\u2934\u2935]\uFE0F?|[\u3030\u303D]\uFE0F?|[\u3297\u3299]\uFE0F?|[\uD83C\uDE01\uD83C\uDE02\uD83C\uDE1A\uD83C\uDE2F\uD83C\uDE32-\uD83C\uDE3A\uD83C\uDE50\uD83C\uDE51]\uFE0F?|[\u203C\u2049]\uFE0F?|[\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE]\uFE0F?|[\u00A9\u00AE]\uFE0F?|[\u2122\u2139]\uFE0F?|\uD83C\uDC04\uFE0F?|\uD83C\uDCCF\uFE0F?|[\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA]\uFE0F?)";
public static final String COLOR_REGEX = "§[a-zA-Z0-9]";
public static boolean isAutoSplitsLoaded;
Expand All @@ -64,9 +66,11 @@ public class ShowSpawnTime
private static PowerupRenderer powerupRenderer;
private static SpawnTimeRenderer spawnTimeRenderer;
private static DPSCounterRenderer dpsCounterRenderer;
private static PlayerInvisibility playerInvisibility;
private static LRQueueRenderer lrQueueRenderer;
private static SpawnTimes spawnTimes;
private static SpawnNotice spawnNotice;
private static LeftNotice leftNotice;
private static DPSCounter dpsCounter;
private static FastReviveCoolDown fastReviveCoolDown;
@EventHandler
Expand All @@ -77,8 +81,17 @@ public void preinit(FMLPreInitializationEvent event){
File modConfigFolder = new File(event.getModConfigurationDirectory(), MODID);
if (!modConfigFolder.exists()) {
try {
modConfigFolder.createNewFile();
} catch (Exception ignored) {}
modConfigFolder.mkdir();
} catch (Exception e) {
e.printStackTrace();
}
} else if (!modConfigFolder.isDirectory()) {
modConfigFolder.deleteOnExit();
try {
modConfigFolder.mkdir();
} catch (Exception e) {
e.printStackTrace();
}
}

CONFIGURATION = new Configuration(new File(modConfigFolder, MODID + ".cfg"));
Expand Down Expand Up @@ -110,6 +123,8 @@ public void init(FMLInitializationEvent event)
MinecraftForge.EVENT_BUS.register(powerupRenderer = new PowerupRenderer());
MinecraftForge.EVENT_BUS.register(spawnTimeRenderer = new SpawnTimeRenderer());
MinecraftForge.EVENT_BUS.register(dpsCounterRenderer = new DPSCounterRenderer());
MinecraftForge.EVENT_BUS.register(playerInvisibility = new PlayerInvisibility());
MinecraftForge.EVENT_BUS.register(leftNotice = new LeftNotice());

RENDERER_LIST.add(lrQueueRenderer);
RENDERER_LIST.add(powerupRenderer);
Expand Down Expand Up @@ -194,10 +209,18 @@ public static DPSCounterRenderer getDPSCounterRenderer() {
return dpsCounterRenderer;
}

public static PlayerInvisibility getPlayerInvisibility() {
return playerInvisibility;
}

public static FastReviveCoolDown getFastReviveCoolDown() {
return fastReviveCoolDown;
}

public static LeftNotice getLeftNotice() {
return leftNotice;
}

public static Logger getLogger() {
return LOGGER;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public MainConfiguration(Configuration config, Logger logger) {
public static Minecraft minecraft;
public static String[] AARoundsRecord = new String[]{"OFF", "Quintuple", "Tenfold","ALL"};
public static String[] DEBBRoundsRecord = new String[]{"OFF", "Quintuple", "Tenfold","ALL"};
public static KeyBinding keyTogglePlayerInvisible = new KeyBinding("Player Invisible", Keyboard.KEY_NONE, "Show Spawn Time");
public static KeyBinding keyOpenConfig = new KeyBinding("Config", Keyboard.KEY_NONE, "Show Spawn Time");
public static KeyBinding keyTogglePlayerInvisible = new KeyBinding("SST Player Invisible", Keyboard.KEY_NONE, "Show Spawn Time");
public static KeyBinding keyOpenConfig = new KeyBinding("SST Config", Keyboard.KEY_NONE, "Show Spawn Time");

public static Configuration config;
public static Logger logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
Expand Down Expand Up @@ -53,8 +55,11 @@ public void checkUpdates() {
new Thread(() -> {
try {
URL url = new URL("https://raw.githubusercontent.com/Seosean/ShowSpawnTime/2.0/build.gradle");

// Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10809));
URLConnection connection = url.openConnection();
connection.setReadTimeout(5000);

connection.setReadTimeout(20000);
connection.addRequestProperty("User-Agent", "ShowSpawnTime update checker");
connection.setDoOutput(true);
final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.seosean.showspawntime.config.MainConfiguration;
import com.seosean.showspawntime.features.powerups.Powerup;
import com.seosean.showspawntime.utils.DebugUtils;
import com.seosean.showspawntime.utils.DelayedTask;
import com.seosean.showspawntime.utils.LanguageUtils;
import com.seosean.showspawntime.utils.PlayerUtils;
Expand All @@ -12,6 +13,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class DPSCounter {

Expand All @@ -22,17 +24,17 @@ public DPSCounter () {

private static final List<String> soundList = new ArrayList<>();
static {
weaponInfos.add(new WeaponInfo("Pistol", "mob.irongolem.hit", 2.0F, 10, 15, Item.getByNameOrId("minecraft:wooden_hoe"), 6, 6));
weaponInfos.add(new WeaponInfo("Shotgun", "random.explode", 2.0F, 8, 12, Item.getByNameOrId("minecraft:iron_hoe"), 4.5, 4.5));
weaponInfos.add(new WeaponInfo("Sniper", "fireworks.blast", 0.5F, 30, 45, Item.getByNameOrId("minecraft:wooden_shovel"), 30, 40));
weaponInfos.add(new WeaponInfo("Rifle", "fireworks.largeBlast", 2.0F, 7, 10, Item.getByNameOrId("minecraft:stone_hoe"), 6, 8));
weaponInfos.add(new WeaponInfo("Pistol", "mob.irongolem.hit", 2.5F, 10, 15, Item.getByNameOrId("minecraft:wooden_hoe"), 6, 6));
weaponInfos.add(new WeaponInfo("Shotgun", "random.explode", 2.5F, 8, 12, Item.getByNameOrId("minecraft:iron_hoe"), 4.5, 4.5));
weaponInfos.add(new WeaponInfo("Sniper", "fireworks.blast_far", 0.5F, 30, 45, Item.getByNameOrId("minecraft:wooden_shovel"), 30, 40));
weaponInfos.add(new WeaponInfo("Rifle", "fireworks.largeBlast", 2.5F, 7, 10, Item.getByNameOrId("minecraft:stone_hoe"), 6, 8));
weaponInfos.add(new WeaponInfo("ZombieZapper", "fire.ignite", 0.5F, 15, 20, Item.getByNameOrId("minecraft:diamond_pickaxe"), 12, 18));
weaponInfos.add(new WeaponInfo("ElderGun", "ambient.weather.thunder", 2.0F, 20, 30, Item.getByNameOrId("minecraft:shears"), 15, 20));
weaponInfos.add(new WeaponInfo("FlameThrower", "fire.fire", 2.0F, 4, 6, Item.getByNameOrId("minecraft:golden_hoe"), 2, 2));
weaponInfos.add(new WeaponInfo("BlowDart", "random.bow", 0.5F, 20, 30, Item.getByNameOrId("minecraft:iron_shovel"), 10, 10));
weaponInfos.add(new WeaponInfo("ZombieSoaker", "mob.slime.attack", 2.0F, 5, 10, Item.getByNameOrId("minecraft:diamond_hoe"), 5, 8));
weaponInfos.add(new WeaponInfo("RainbowRifle", "fireworks.largeBlast", 2.0F, 5, 7, Item.getByNameOrId("minecraft:golden_shovel"), 5, 6, 6.5, 7));
weaponInfos.add(new WeaponInfo("DoubleBarrelShotgun", "fireworks.largeBlast", 1.0F, 8, 12, Item.getByNameOrId("minecraft:flint_and_steel"), 7, 7, 8, 8));
weaponInfos.add(new WeaponInfo("RainbowRifle", "fireworks.largeBlast", 2.5F, 5, 7, Item.getByNameOrId("minecraft:golden_shovel"), 5, 6, 6.5, 7));
weaponInfos.add(new WeaponInfo("DoubleBarrelShotgun", "fireworks.largeBlast", 0.8F, 8, 12, Item.getByNameOrId("minecraft:flint_and_steel"), 7, 7, 8, 8));
weaponInfos.add(new WeaponInfo("GoldDigger", "dig.stone", 2.0F, 10, 15, Item.getByNameOrId("minecraft:golden_pickaxe"), 6, 8, 10, 12, 15, 20));

for (WeaponInfo weaponInfo : weaponInfos) {
Expand Down Expand Up @@ -67,6 +69,7 @@ public static void detectWeaponBehavior(String sound, float pitch) {
readyWeapon = null;
} else if (soundList.contains(sound)) {
List<WeaponInfo> probableWeaponInfos = new ArrayList<>();

for (WeaponInfo weaponInfo : weaponInfos) {
if (weaponInfo.getSound().equalsIgnoreCase(sound) && Math.abs(weaponInfo.getPitch() - pitch) < epsilon) {
probableWeaponInfos.add(weaponInfo);
Expand All @@ -87,11 +90,9 @@ public void onChatReceived(ClientChatReceivedEvent event) {
if (event.type != 1 && event.type != 0) {
return;
}

if (!PlayerUtils.isInZombies()) {
return;
}

String messsage = StringUtils.trim(event.message.getUnformattedText());
if (messsage.contains(":")) {
return;
Expand Down Expand Up @@ -121,7 +122,6 @@ public void onChatReceived(ClientChatReceivedEvent event) {
}
}
}

DPSCounter.probableWeaponInfos = new ArrayList<>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -47,8 +48,8 @@ public PowerupDetect(){
public List<Integer> ssRounds = new ArrayList<>();

public void iniPowerupPatterns(){
Powerup.powerups.clear();
Powerup.incPowerups.clear();
Powerup.powerups = new HashMap<>();
Powerup.incPowerups = new ArrayList<>();
insRounds = new ArrayList<>();
maxRounds = new ArrayList<>();
ssRounds = new ArrayList<>();
Expand Down

0 comments on commit 9e14879

Please sign in to comment.