-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Added more Options to Paper #4068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: BuildTools <unconfigured@null.spigotmc.org> | ||
| Date: Thu, 6 Aug 2020 23:56:05 +0800 | ||
| Subject: [PATCH] Add-Operator-API | ||
|
|
||
|
|
||
| diff --git a/src/main/java/org/bukkit/permissions/ServerOperator.java b/src/main/java/org/bukkit/permissions/ServerOperator.java | ||
| index 26ed24307b0c84e8946cf9f276012ea6d5219b9d..d177cb021c91909b429a2e037a244bfb0807f6f2 100644 | ||
| --- a/src/main/java/org/bukkit/permissions/ServerOperator.java | ||
| +++ b/src/main/java/org/bukkit/permissions/ServerOperator.java | ||
| @@ -21,4 +21,18 @@ public interface ServerOperator { | ||
| * @param value New operator value | ||
| */ | ||
| public void setOp(boolean value); | ||
| + | ||
| + /** | ||
| + * Checks if this object is a server operator | ||
| + * | ||
| + * @return int OP Level of the Object | ||
| + */ | ||
| + public int getOPLevel(); | ||
| + | ||
| + /** | ||
| + * Sets the OP Level of this object | ||
| + * | ||
| + * @param value OP Level to set Object to | ||
| + */ | ||
| + public void setOPLevel(int level); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: BuildTools <unconfigured@null.spigotmc.org> | ||
| Date: Fri, 7 Aug 2020 00:36:08 +0800 | ||
| Subject: [PATCH] Fix-Operator-API-Bug | ||
|
|
||
|
|
||
| diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java | ||
| index ca1893e9fb41baae0d103f1a925e33f3dfa273be..3f260270cb08afb5df277cf710574a4d93912078 100644 | ||
| --- a/src/main/java/org/bukkit/command/MessageCommandSender.java | ||
| +++ b/src/main/java/org/bukkit/command/MessageCommandSender.java | ||
| @@ -35,6 +35,16 @@ public interface MessageCommandSender extends CommandSender { | ||
| throw new NotImplementedException(); | ||
| } | ||
|
|
||
| + @Override | ||
| + default int getOPLevel() { | ||
| + throw new NotImplementedException(); | ||
| + } | ||
| + | ||
| + @Override | ||
| + default void setOPLevel(int level) { | ||
| + throw new NotImplementedException(); | ||
| + } | ||
| + | ||
| @Override | ||
| default boolean isOp() { | ||
| throw new NotImplementedException(); | ||
| diff --git a/src/main/java/org/bukkit/permissions/PermissibleBase.java b/src/main/java/org/bukkit/permissions/PermissibleBase.java | ||
| index c94e4cdb5785d5dfcb704c4adabda0b19a20ec7d..deee817ae89c09b4c89503d08e0ecfcaa517eec7 100644 | ||
| --- a/src/main/java/org/bukkit/permissions/PermissibleBase.java | ||
| +++ b/src/main/java/org/bukkit/permissions/PermissibleBase.java | ||
| @@ -31,6 +31,7 @@ public class PermissibleBase implements Permissible { | ||
| recalculatePermissions(); | ||
| } | ||
|
|
||
| + | ||
| @Override | ||
| public boolean isOp() { | ||
| if (opable == null) { | ||
| @@ -270,4 +271,15 @@ public class PermissibleBase implements Permissible { | ||
| attachment.remove(); | ||
| } | ||
| } | ||
| + | ||
| + @Override | ||
| + public int getOPLevel() { | ||
| + if(opable == null) throw new UnsupportedOperationException("Cannot get OP Level as no ServerOperator is set"); | ||
| + return opable.getOPLevel(); | ||
| + } | ||
| + | ||
| + @Override | ||
| + public void setOPLevel(int level) { | ||
| + if(opable != null) opable.setOPLevel(level); | ||
| + } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: BuildTools <unconfigured@null.spigotmc.org> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong author |
||
| Date: Thu, 6 Aug 2020 23:31:29 +0800 | ||
| Subject: [PATCH] Updated-Paper-Config | ||
|
|
||
|
|
||
| diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java | ||
| index e471e764935e2a89560de56959a782b02e5e8fe1..19cfef1a1ea771f065ef373ae54d2a3501e34e7a 100644 | ||
| --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java | ||
| +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java | ||
| @@ -72,6 +72,15 @@ public class PaperWorldConfig { | ||
| return config.getString("world-settings." + worldName + "." + path, config.getString("world-settings.default." + path)); | ||
| } | ||
|
|
||
| + public boolean removeWitchConversion; | ||
| + public boolean disableAttackCooldown; | ||
| + private void advancedSurvivalSettings() { | ||
| + removeWitchConversion = getBoolean("villagers-immune-to-lightning", true); | ||
| + disableAttackCooldown = getBoolean("disable-attack-cooldown", true); | ||
| + log("Villagers immune to Lightning: " + removeWitchConversion); | ||
| + log("Attack Cooldown disabled: " + disableAttackCooldown); | ||
| + } | ||
| + | ||
| public int cactusMaxHeight; | ||
| public int reedMaxHeight; | ||
| private void blockGrowthHeight() { | ||
| @@ -578,14 +587,12 @@ public class PaperWorldConfig { | ||
| generateFlatBedrock = getBoolean("generator-settings.flat-bedrock", false); | ||
| } | ||
|
|
||
| - public boolean disablePillagerPatrols = false; | ||
| public double patrolSpawnChance = 0.2; | ||
| public boolean patrolPerPlayerDelay = false; | ||
| public int patrolDelay = 12000; | ||
| public boolean patrolPerPlayerStart = false; | ||
| public int patrolStartDay = 5; | ||
| private void pillagerSettings() { | ||
| - disablePillagerPatrols = getBoolean("game-mechanics.disable-pillager-patrols", disablePillagerPatrols); | ||
| patrolSpawnChance = getDouble("game-mechanics.pillager-patrols.spawn-chance", patrolSpawnChance); | ||
| patrolPerPlayerDelay = getBoolean("game-mechanics.pillager-patrols.spawn-delay.per-player", patrolPerPlayerDelay); | ||
| patrolDelay = getInt("game-mechanics.pillager-patrols.spawn-delay.ticks", patrolDelay); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: BuildTools <unconfigured@null.spigotmc.org> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong author |
||
| Date: Thu, 6 Aug 2020 23:32:55 +0800 | ||
| Subject: [PATCH] Removed-redundant-Patrol-Option-and-Fixed-Patrol-Spawning | ||
|
|
||
|
|
||
| diff --git a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java | ||
| index 776e54ff472a67f535dfb409e753325a1105bcce..c0c94b5bfffba092010bae66a99685943bedd47d 100644 | ||
| --- a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java | ||
| +++ b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java | ||
| @@ -10,10 +10,8 @@ public class MobSpawnerPatrol implements MobSpawner { | ||
|
|
||
| @Override | ||
| public int a(WorldServer worldserver, boolean flag, boolean flag1) { | ||
| - if (worldserver.paperConfig.disablePillagerPatrols || worldserver.paperConfig.patrolSpawnChance == 0) return 0; // Paper | ||
| - if (!flag) { | ||
| - return 0; | ||
| - } else if (!worldserver.getGameRules().getBoolean(GameRules.DO_PATROL_SPAWNING)) { | ||
| + if (worldserver.paperConfig.patrolSpawnChance == 0) return 0; // Paper | ||
| + if (!worldserver.getGameRules().getBoolean(GameRules.DO_PATROL_SPAWNING)) { | ||
| return 0; | ||
| } else { | ||
| Random random = worldserver.random; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: BuildTools <unconfigured@null.spigotmc.org> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong author |
||
| Date: Thu, 6 Aug 2020 23:34:02 +0800 | ||
| Subject: [PATCH] Trader-Spawning-now-depends-on-specific-gamerule | ||
|
|
||
|
|
||
| diff --git a/src/main/java/net/minecraft/server/MobSpawnerTrader.java b/src/main/java/net/minecraft/server/MobSpawnerTrader.java | ||
| index 736b794f8268858e2e63a3aafef328b443386989..757b02f644e50c0e3467984eda274ca4c71b778c 100644 | ||
| --- a/src/main/java/net/minecraft/server/MobSpawnerTrader.java | ||
| +++ b/src/main/java/net/minecraft/server/MobSpawnerTrader.java | ||
| @@ -41,11 +41,7 @@ public class MobSpawnerTrader implements MobSpawner { | ||
| return 0; | ||
| } else { | ||
| this.d = 24000; | ||
| - if (!worldserver.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING)) { | ||
| - return 0; | ||
| - } else { | ||
| int i = this.e; | ||
| - | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to remove this line (keep minimal diff as it is only possible0 |
||
| this.e = MathHelper.clamp(this.e + 25, 25, 75); | ||
| this.b.h(this.e); | ||
| if (this.a.nextInt(100) > i) { | ||
| @@ -56,7 +52,6 @@ public class MobSpawnerTrader implements MobSpawner { | ||
| } else { | ||
| return 0; | ||
| } | ||
| - } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: BuildTools <unconfigured@null.spigotmc.org> | ||
| Date: Thu, 6 Aug 2020 23:35:46 +0800 | ||
| Subject: [PATCH] Added-Option-to-disable-Villager-Witch-Conversion | ||
|
|
||
|
|
||
| diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java | ||
| index bf019043a9338aca8d91da809f1d5520531386e7..683304a2381de1fdb22205023c0d41c83c617f8d 100644 | ||
| --- a/src/main/java/net/minecraft/server/EntityVillager.java | ||
| +++ b/src/main/java/net/minecraft/server/EntityVillager.java | ||
| @@ -722,6 +722,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation | ||
|
|
||
| @Override | ||
| public void onLightningStrike(EntityLightning entitylightning) { | ||
| + if(this.world.paperConfig.removeWitchConversion) { | ||
| + super.onLightningStrike(entitylightning); | ||
| + return; | ||
| + } | ||
| if (this.world.getDifficulty() != EnumDifficulty.PEACEFUL) { | ||
| EntityVillager.LOGGER.info("Villager {} was struck by lightning {}.", this, entitylightning); | ||
| EntityWitch entitywitch = (EntityWitch) EntityTypes.WITCH.a(this.world); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: BuildTools <unconfigured@null.spigotmc.org> | ||
| Date: Thu, 6 Aug 2020 23:39:25 +0800 | ||
| Subject: [PATCH] Added-Option-to-disable-Attack-Cooldown | ||
|
|
||
|
|
||
| diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java | ||
| index e5a81f831813209d224ffedbc03f6d8243721a25..4f43cea652d26173f00909ec6444aa46a14d9724 100644 | ||
| --- a/src/main/java/net/minecraft/server/EntityPlayer.java | ||
| +++ b/src/main/java/net/minecraft/server/EntityPlayer.java | ||
| @@ -122,6 +122,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { | ||
| double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks | ||
|
|
||
| boolean needsChunkCenterUpdate; // Paper - no-tick view distance | ||
| + private AttributeModifier disableCooldown = new AttributeModifier("DisableCooldown", 7200, AttributeModifier.Operation.ADDITION); | ||
|
|
||
| public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) { | ||
| super(worldserver, worldserver.getSpawn(), gameprofile); | ||
| @@ -548,6 +549,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { | ||
| this.a(IScoreboardCriteria.XP, MathHelper.f((float) this.lastExpTotalScored)); | ||
| } | ||
|
|
||
| + if(this.world.paperConfig.disableAttackCooldown && !this.getAttributeInstance(GenericAttributes.ATTACK_SPEED).getModifiers().contains(disableCooldown)) { | ||
| + this.getAttributeInstance(GenericAttributes.ATTACK_SPEED).addModifier(disableCooldown); | ||
| + } | ||
| + | ||
| // CraftBukkit start - Force max health updates | ||
| if (this.maxHealthCache != this.getMaxHealth()) { | ||
| this.getBukkitEntity().updateScaledHealth(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong author