Browse Source

Push several fixes to upstream

pull/2/head 2.23.3-SNAPSHOT
Stefatorus 4 years ago
parent
commit
e42b9cb6a0
  1. 2
      .classpath
  2. 30
      src/cx/sfy/LagAssist/Data.java
  3. 2
      src/cx/sfy/LagAssist/mobs/SmartMob.java
  4. 7
      src/cx/sfy/LagAssist/utils/V1_13.java

2
.classpath

@ -14,7 +14,7 @@
<classpathentry kind="lib" path="W:/Minecraft Versions/Paper-1.13.2-b624.jar"/> <classpathentry kind="lib" path="W:/Minecraft Versions/Paper-1.13.2-b624.jar"/>
<classpathentry kind="lib" path="W:/Minecraft Versions/Paper-1.12.2-b1618.jar"/> <classpathentry kind="lib" path="W:/Minecraft Versions/Paper-1.12.2-b1618.jar"/>
<classpathentry kind="lib" path="W:/Minecraft Versions/PaperSpigot-1.8.8-R0.1-SNAPSHOT-latest.jar"/> <classpathentry kind="lib" path="W:/Minecraft Versions/PaperSpigot-1.8.8-R0.1-SNAPSHOT-latest.jar"/>
<classpathentry kind="lib" path="W:/Minecraft Versions/Spigot-1.15.jar"/>
<classpathentry kind="lib" path="W:/Custom Plugins/Vault.jar"/> <classpathentry kind="lib" path="W:/Custom Plugins/Vault.jar"/>
<classpathentry kind="lib" path="W:/Minecraft Versions/spigot-1.16.4.jar"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

30
src/cx/sfy/LagAssist/Data.java

@ -42,7 +42,6 @@ public class Data {
if (!data.contains("version")) { if (!data.contains("version")) {
if (data.contains("hoppers")) { if (data.contains("hoppers")) {
for (String rawh : data.getConfigurationSection("hoppers").getKeys(false)) { for (String rawh : data.getConfigurationSection("hoppers").getKeys(false)) {
String loc = "hoppers." + rawh; String loc = "hoppers." + rawh;
@ -61,20 +60,23 @@ public class Data {
} }
private static long last;
private static void saveData() { private static void saveData() {
//
// if (System.currentTimeMillis() - last < 1000) {
// return;
// }
//
//
// Bukkit.getScheduler().runTaskAsynchronously(Main.p, () -> {
try {
data.save(dataf);
} catch (IOException e) {
e.printStackTrace();
if (System.currentTimeMillis() - last < 3000) {
return;
} }
// });
last = System.currentTimeMillis();
Bukkit.getScheduler().runTaskAsynchronously(Main.p, () -> {
try {
data.save(dataf);
} catch (IOException e) {
e.printStackTrace();
}
});
} }
private static short genMapId() { private static short genMapId() {
@ -138,7 +140,7 @@ public class Data {
} }
} }
public static OfflinePlayer getOwningPlayer(Location loc) {
public static OfflinePlayer getOwningPlayer(Location loc) {
String cloc = "hoppers." + WorldMgr.serializeLocation(loc); String cloc = "hoppers." + WorldMgr.serializeLocation(loc);
if (data.contains(cloc + ".owner")) { if (data.contains(cloc + ".owner")) {

2
src/cx/sfy/LagAssist/mobs/SmartMob.java

@ -27,6 +27,8 @@ import cx.sfy.LagAssist.utils.WorldMgr;
public class SmartMob implements Listener { public class SmartMob implements Listener {
EventPriority prio;
private static SplittableRandom rand = new SplittableRandom(); private static SplittableRandom rand = new SplittableRandom();
public static boolean Spawning; public static boolean Spawning;

7
src/cx/sfy/LagAssist/utils/V1_13.java

@ -64,13 +64,18 @@ public class V1_13 {
public static List<ItemStack> getLootTable(Entity ent) { public static List<ItemStack> getLootTable(Entity ent) {
LootTables lt = LootTables.valueOf(ent.getType().toString()); LootTables lt = LootTables.valueOf(ent.getType().toString());
// TODO: FIX in 1.16
// java.lang.IllegalArgumentException:
// Missing required parameters:
// [<parameter minecraft:this_entity>, <parameter minecraft:damage_source>]
List<ItemStack> itms = new ArrayList<ItemStack>(); List<ItemStack> itms = new ArrayList<ItemStack>();
if (lt == null) { if (lt == null) {
return itms; return itms;
} }
itms.addAll(lt.getLootTable().populateLoot(r, new LootContext.Builder(ent.getLocation()).build()));
itms.addAll(lt.getLootTable().populateLoot(r, new LootContext.Builder(ent.getLocation()).lootedEntity(ent).build()));
return itms; return itms;
} }

Loading…
Cancel
Save