I don't know what the diff is here

This commit is contained in:
TheTechRobo 2022-03-17 21:28:16 -04:00
parent 02b791e1c6
commit 5ce1c594d8
4 changed files with 175 additions and 4 deletions

View File

@ -1,4 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
org.eclipse.jdt.core.builder.invalidClasspath=abort
@ -9,6 +10,15 @@ org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
@ -18,11 +28,103 @@ org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.incompatibleJDKLevel=ignore

View File

@ -15,6 +15,8 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
import net.kyori.adventure.text.Component;
public class DeathListener implements Listener {
public ScoreboardWrapper scores;
private ArrayList<String> skulllore;
@ -43,6 +45,7 @@ public class DeathListener implements Listener {
Boolean rightclickair = (e.getAction() == Action.RIGHT_CLICK_AIR);
if (!rightclickair) {
Limbo.debug(p, this.scores);
return;
}
Boolean heartblock = (i.getType() == Material.PLAYER_HEAD && rightclickair);
@ -54,7 +57,7 @@ public class DeathListener implements Listener {
return;
}
if (!(i.hasDisplayName())) return;
Boolean condition1a = (i.getItemMeta().displayName().equals(d.dn));
Boolean condition1a = (i.getItemMeta().displayName().equals(Component.text(d.dn)));
Boolean condition1b = (i.getType() == d.m);
Boolean lifeblock = (condition1a && condition1b && rightclickair);
if (lifeblock) {
@ -64,7 +67,7 @@ public class DeathListener implements Listener {
}
LifeExtractor f = new LifeExtractor();
f.create();
if ((i.getType() == f.m) && (i.getItemMeta().displayName().equals(f.dn))) {
if ((i.getType() == f.m) && (i.getItemMeta().displayName().equals(Component.text(f.dn)))) {
if (p.getInventory().firstEmpty() == (-1)) {
p.sendMessage("§4Not enough room in your inventory.");
p.playSound(p, Sound.ENTITY_ENDERMAN_TELEPORT, 76, 0);

View File

@ -0,0 +1,37 @@
// Idea of Limbo inspired by Hypixel
package ca.thetechrobo.smp;
import java.time.Instant;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
public class Limbo {
public static void tpPlayer(Player p, ScoreboardWrapper sw) {
long currentTS = Instant.now().getEpochSecond();
//long banEnds = currentTS + 432000;
long banEnds = currentTS + 10;
sw.saveLong(p, banEnds , "banExpires");
Location loc = p.getLocation();
sw.save(p, loc.getBlockX(), "prebanX");
sw.save(p, loc.getBlockY(), "prebanY");
sw.save(p, loc.getBlockZ(), "prebanZ");
Component pmsg = Component.text("You have lost all of your lives.")
.color(TextColor.color(245, 5, 5));
p.sendMessage(pmsg);
p.sendMessage(Component.text("You are in Limbo for the next 5 days. A peaceful place, with no one to hear you ")
.append(Component.text(" scream...").color(TextColor.color(255, 0, 0))));
}
public static void debug(Player p, ScoreboardWrapper sw) {
long currentTS = Instant.now().getEpochSecond();
long expiry = sw.loadLong(p, "banExpires", 0L);
Boolean hi = (expiry < currentTS);
sw.load(p, "prebanX", 0, false);
sw.load(p, "prebanY", 0, false);
sw.load(p, "prebanZ", 0, false);
}
}

View File

@ -36,6 +36,10 @@ public class ScoreboardWrapper {
NamespacedKey key = new NamespacedKey(this.plugin, keystr);
p.getPersistentDataContainer().set(key, PersistentDataType.INTEGER, i);
}
public void saveLong(Player p, Long i, String keystr) {
NamespacedKey key = new NamespacedKey(this.plugin, keystr);
p.getPersistentDataContainer().set(key, PersistentDataType.LONG, i);
}
public ItemMeta save(ItemMeta im, Integer i, String keystr) {
NamespacedKey key = new NamespacedKey(this.plugin, keystr);
im.getPersistentDataContainer().set(key, PersistentDataType.INTEGER, i);
@ -51,11 +55,35 @@ public class ScoreboardWrapper {
return def;
}
public int load(Player p, String keystr, Integer def) {
return load(p, keystr, def, true);
}
public int load(Player p, String keystr, Integer def, Boolean checkLowerThanOne) {
NamespacedKey key = new NamespacedKey(this.plugin, keystr);
PersistentDataContainer c = p.getPersistentDataContainer();
return load_internal_int(p, c, key, def, checkLowerThanOne);
}
public long loadLong(Player p, String keystr, Long def, Boolean checkLowerThanOne) {
NamespacedKey key = new NamespacedKey(this.plugin, keystr);
PersistentDataContainer c = p.getPersistentDataContainer();
return load_internal_long(p, c, key, def, checkLowerThanOne);
}
public long loadLong(Player p, String keystr, Long def) {
return loadLong(p, keystr, def, true);
}
private int load_internal_int(Player p, PersistentDataContainer c, NamespacedKey key, Integer def, Boolean checkLowerThanOne) {
if (c.has(key, PersistentDataType.INTEGER)) {
Integer i = c.get(key, PersistentDataType.INTEGER);
if (i < 1) {
if (i < 1 && checkLowerThanOne) {
return def;
}
return i;
}
return def;
}
private long load_internal_long(Player p, PersistentDataContainer c, NamespacedKey key, Long def, Boolean checkLowerThanOne) {
if (c.has(key, PersistentDataType.LONG)) {
Long i = c.get(key, PersistentDataType.LONG);
if (i < 1 && checkLowerThanOne) {
return def;
}
return i;
@ -72,6 +100,7 @@ public class ScoreboardWrapper {
p.setScoreboard(this.boards.get(p.getName()));
}
public double dieHearts(Player p, double dec) {
// Limbo.tpPlayer(p, this);
AttributeInstance access = p.getAttribute(Attribute.GENERIC_MAX_HEALTH);
Double health = access.getBaseValue();
Double neww = health - dec;
@ -82,7 +111,7 @@ public class ScoreboardWrapper {
access.setBaseValue(neww);
return neww;
}
public int die(Player p, int dec) {
public int die(Player p, int dec) { // life loss
Objective lives = this.boards.get(p.getName())
.getObjective("lives");
Score score = lives.getScore(p.getName());