mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-22 08:29:28 +00:00
1.19.4
still WIP
This commit is contained in:
@@ -140,23 +140,23 @@ index 7784d72ddd6db00c674e22759c00c430222c4b85..0f180d11774f6dec2667b3a3f6a63d11
|
||||
text("Relit ", BLUE), text(totalRelit),
|
||||
text(" chunks. Took ", BLUE), text(diff + "ms")
|
||||
diff --git a/src/main/java/net/minecraft/commands/arguments/TimeArgument.java b/src/main/java/net/minecraft/commands/arguments/TimeArgument.java
|
||||
index e3e80db89c18588322ffdaa0f9fd85e398cb1471..d947011b80ee14e7aaf74af3d9081fc78e8cb4c3 100644
|
||||
index b2f1d117abd3828140c1edf2baf314b34d2ccf40..d13bafdfa4175e193fa3e337f93e796dd346e678 100644
|
||||
--- a/src/main/java/net/minecraft/commands/arguments/TimeArgument.java
|
||||
+++ b/src/main/java/net/minecraft/commands/arguments/TimeArgument.java
|
||||
@@ -35,7 +35,7 @@ public class TimeArgument implements ArgumentType<Integer> {
|
||||
@@ -48,7 +48,7 @@ public class TimeArgument implements ArgumentType<Integer> {
|
||||
if (i == 0) {
|
||||
throw ERROR_INVALID_UNIT.create();
|
||||
} else {
|
||||
- int j = Math.round(f * (float)i);
|
||||
+ int j = carpetfixes.helpers.FastMath.round(f * (float)i); // Mirai
|
||||
if (j < 0) {
|
||||
throw ERROR_INVALID_TICK_COUNT.create(j);
|
||||
if (j < this.minimum) {
|
||||
throw ERROR_TICK_COUNT_TOO_LOW.create(j, this.minimum);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 1f3f414ede558f590a5e68256a60d9ca3c3edf32..4bd8a68ed3fb9ab8857ed53a78284c2b43dbaaec 100644
|
||||
index 8cd54a95609df0c5497c00d1a254c22d47e80a15..0447aaaa778e9e7f5ceb3d0f3c868a8289fcdc6f 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2838,7 +2838,7 @@ public abstract class MinecraftServer extends MinecraftServerBlockableEventLoop
|
||||
@@ -2861,7 +2861,7 @@ public abstract class MinecraftServer extends MinecraftServerBlockableEventLoop
|
||||
}
|
||||
|
||||
double overuseCount = (double)overuse/(double)MAX_CHUNK_EXEC_TIME;
|
||||
@@ -179,7 +179,7 @@ index 88f10d729aa1e0a01790521821d691a0ecd373a2..45b2aa542969798a5a3b73af78de21cc
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/util/Mth.java b/src/main/java/net/minecraft/util/Mth.java
|
||||
index 618f19d70a61062ed5989ec6cf0c036f2e047466..2963a5516575f656882d11547671201060b8ada0 100644
|
||||
index a378a2ddd96e76925fa3409282d9606a86c72334..8f6a109675d3ac160c8ee199400cedc20f529e2e 100644
|
||||
--- a/src/main/java/net/minecraft/util/Mth.java
|
||||
+++ b/src/main/java/net/minecraft/util/Mth.java
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.core.Vec3i;
|
||||
@@ -189,8 +189,8 @@ index 618f19d70a61062ed5989ec6cf0c036f2e047466..2963a5516575f656882d115476712010
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
|
||||
public class Mth {
|
||||
private static final int BIG_ENOUGH_INT = 1024;
|
||||
@@ -800,6 +801,7 @@ public class Mth {
|
||||
private static final long UUID_VERSION = 61440L;
|
||||
@@ -592,6 +593,7 @@ public class Mth {
|
||||
}
|
||||
|
||||
public static double length(double a, double b) {
|
||||
@@ -199,10 +199,10 @@ index 618f19d70a61062ed5989ec6cf0c036f2e047466..2963a5516575f656882d115476712010
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 87499e82e80a8b7d6d8ca6eeaa1819b74fcf1665..cb6f4a671dc258eab9e739d5a80952e3768acbbd 100644
|
||||
index a076e8b852a87b67602a21f07048da1570226a81..a947acfee2d45ba29e293b196250d52af874bcc6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1512,7 +1512,7 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -1501,7 +1501,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
if (this instanceof ServerPlayer) {
|
||||
CriteriaTriggers.ENTITY_HURT_PLAYER.trigger((ServerPlayer) this, source, f1, amount, flag);
|
||||
if (f2 > 0.0F && f2 < 3.4028235E37F) {
|
||||
@@ -211,7 +211,7 @@ index 87499e82e80a8b7d6d8ca6eeaa1819b74fcf1665..cb6f4a671dc258eab9e739d5a80952e3
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2102,9 +2102,9 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -2100,9 +2100,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
if (f3 > 0.0F && f3 < 3.4028235E37F) {
|
||||
if (this instanceof ServerPlayer) {
|
||||
@@ -223,7 +223,7 @@ index 87499e82e80a8b7d6d8ca6eeaa1819b74fcf1665..cb6f4a671dc258eab9e739d5a80952e3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2216,9 +2216,9 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -2214,9 +2214,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
float f3 = (float) -event.getDamage(DamageModifier.RESISTANCE);
|
||||
if (f3 > 0.0F && f3 < 3.4028235E37F) {
|
||||
if (this instanceof ServerPlayer) {
|
||||
@@ -235,20 +235,25 @@ index 87499e82e80a8b7d6d8ca6eeaa1819b74fcf1665..cb6f4a671dc258eab9e739d5a80952e3
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2250,10 +2250,10 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -2248,7 +2248,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
float f2 = absorptionModifier;
|
||||
|
||||
if (f2 > 0.0F && f2 < 3.4028235E37F && this instanceof net.minecraft.world.entity.player.Player) {
|
||||
- ((net.minecraft.world.entity.player.Player) this).awardStat(Stats.DAMAGE_ABSORBED, Math.round(f2 * 10.0F));
|
||||
+ ((net.minecraft.world.entity.player.Player) this).awardStat(Stats.DAMAGE_ABSORBED, carpetfixes.helpers.FastMath.round(f2 * 10.0F)); // Mirai
|
||||
}
|
||||
if (f2 > 0.0F && f2 < 3.4028235E37F && damagesource.getEntity() instanceof ServerPlayer) {
|
||||
- ((ServerPlayer) damagesource.getEntity()).awardStat(Stats.DAMAGE_DEALT_ABSORBED, Math.round(f2 * 10.0F));
|
||||
+ ((ServerPlayer) damagesource.getEntity()).awardStat(Stats.DAMAGE_DEALT_ABSORBED, carpetfixes.helpers.FastMath.round(f2 * 10.0F)); // Mirai
|
||||
if (f2 > 0.0F && f2 < 3.4028235E37F) {
|
||||
Entity entity = damagesource.getEntity();
|
||||
@@ -2256,7 +2256,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
if (entity instanceof ServerPlayer) {
|
||||
ServerPlayer entityplayer = (ServerPlayer) entity;
|
||||
|
||||
- entityplayer.awardStat(Stats.DAMAGE_DEALT_ABSORBED, Math.round(f2 * 10.0F));
|
||||
+ entityplayer.awardStat(Stats.DAMAGE_DEALT_ABSORBED, carpetfixes.helpers.FastMath.round(f2 * 10.0F)); // Mirai
|
||||
}
|
||||
}
|
||||
|
||||
if (f > 0 || !human) {
|
||||
@@ -2261,7 +2261,7 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -2265,7 +2265,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
// PAIL: Be sure to drag all this code from the EntityHuman subclass each update.
|
||||
((net.minecraft.world.entity.player.Player) this).causeFoodExhaustion(damagesource.getFoodExhaustion(), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.DAMAGED); // CraftBukkit - EntityExhaustionEvent
|
||||
if (f < 3.4028235E37F) {
|
||||
@@ -257,8 +262,8 @@ index 87499e82e80a8b7d6d8ca6eeaa1819b74fcf1665..cb6f4a671dc258eab9e739d5a80952e3
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -2285,7 +2285,7 @@ public abstract class LivingEntity extends Entity {
|
||||
CriteriaTriggers.ENTITY_HURT_PLAYER.trigger((ServerPlayer) this, damagesource, f, originalDamage, true);
|
||||
@@ -2287,7 +2287,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
CriteriaTriggers.ENTITY_HURT_PLAYER.trigger((ServerPlayer) this, damagesource, originalDamage, f, true); // Paper - fix taken/dealt param order
|
||||
f2 = (float) -event.getDamage(DamageModifier.BLOCKING);
|
||||
if (f2 > 0.0F && f2 < 3.4028235E37F) {
|
||||
- ((ServerPlayer) this).awardStat(Stats.DAMAGE_BLOCKED_BY_SHIELD, Math.round(originalDamage * 10.0F));
|
||||
@@ -266,7 +271,7 @@ index 87499e82e80a8b7d6d8ca6eeaa1819b74fcf1665..cb6f4a671dc258eab9e739d5a80952e3
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3088,13 +3088,13 @@ public abstract class LivingEntity extends Entity {
|
||||
@@ -3054,13 +3054,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
f2 = this.tickHeadTurn(f1, f2);
|
||||
|
||||
// Paper start - stop large pitch and yaw changes from crashing the server
|
||||
@@ -285,10 +290,10 @@ index 87499e82e80a8b7d6d8ca6eeaa1819b74fcf1665..cb6f4a671dc258eab9e739d5a80952e3
|
||||
|
||||
this.animStep += f2;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 8123f6dade5e64f6f8d9e567402636b8e297abe0..cd68fabce025a80eb2633192ae9493ff6bbf7817 100644
|
||||
index 7b0dbfaab5951aaf09c36bc5112d953585f0098a..8814e1320fa716184a7f8ae930717583184b5408 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1074,7 +1074,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1072,7 +1072,7 @@ public abstract class Player extends LivingEntity {
|
||||
float f2 = f1 - f;
|
||||
|
||||
if (f2 > 0.0F && f2 < 3.4028235E37F) {
|
||||
@@ -297,16 +302,16 @@ index 8123f6dade5e64f6f8d9e567402636b8e297abe0..cd68fabce025a80eb2633192ae9493ff
|
||||
}
|
||||
|
||||
if (f != 0.0F) {
|
||||
@@ -1084,7 +1084,7 @@ public abstract class Player extends LivingEntity {
|
||||
this.setHealth(this.getHealth() - f);
|
||||
@@ -1082,7 +1082,7 @@ public abstract class Player extends LivingEntity {
|
||||
this.getCombatTracker().recordDamage(damagesource, f3, f);
|
||||
this.setHealth(this.getHealth() - f);
|
||||
if (f < 3.4028235E37F) {
|
||||
- this.awardStat(Stats.DAMAGE_TAKEN, Math.round(f * 10.0F));
|
||||
+ this.awardStat(Stats.DAMAGE_TAKEN, carpetfixes.helpers.FastMath.round(f * 10.0F)); // Mirai
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1423,7 +1423,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1422,7 +1422,7 @@ public abstract class Player extends LivingEntity {
|
||||
if (target instanceof LivingEntity) {
|
||||
float f5 = f3 - ((LivingEntity) target).getHealth();
|
||||
|
||||
@@ -315,7 +320,7 @@ index 8123f6dade5e64f6f8d9e567402636b8e297abe0..cd68fabce025a80eb2633192ae9493ff
|
||||
if (j > 0) {
|
||||
// CraftBukkit start - Call a combust event when somebody hits with a fire enchanted item
|
||||
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), target.getBukkitEntity(), j * 4);
|
||||
@@ -1691,29 +1691,29 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1686,29 +1686,29 @@ public abstract class Player extends LivingEntity {
|
||||
int i;
|
||||
|
||||
if (this.isSwimming()) {
|
||||
@@ -350,7 +355,7 @@ index 8123f6dade5e64f6f8d9e567402636b8e297abe0..cd68fabce025a80eb2633192ae9493ff
|
||||
if (i > 0) {
|
||||
if (this.isSprinting()) {
|
||||
this.awardStat(Stats.SPRINT_ONE_CM, i);
|
||||
@@ -1727,10 +1727,10 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1722,10 +1722,10 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
}
|
||||
} else if (this.isFallFlying()) {
|
||||
@@ -363,7 +368,7 @@ index 8123f6dade5e64f6f8d9e567402636b8e297abe0..cd68fabce025a80eb2633192ae9493ff
|
||||
if (i > 25) {
|
||||
this.awardStat(Stats.FLY_ONE_CM, i);
|
||||
}
|
||||
@@ -1741,7 +1741,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1736,7 +1736,7 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
private void checkRidingStatistics(double dx, double dy, double dz) {
|
||||
if (this.isPassenger()) {
|
||||
@@ -372,7 +377,7 @@ index 8123f6dade5e64f6f8d9e567402636b8e297abe0..cd68fabce025a80eb2633192ae9493ff
|
||||
|
||||
if (i > 0) {
|
||||
Entity entity = this.getVehicle();
|
||||
@@ -1768,7 +1768,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1763,7 +1763,7 @@ public abstract class Player extends LivingEntity {
|
||||
return false;
|
||||
} else {
|
||||
if (fallDistance >= 2.0F) {
|
||||
@@ -382,10 +387,10 @@ index 8123f6dade5e64f6f8d9e567402636b8e297abe0..cd68fabce025a80eb2633192ae9493ff
|
||||
|
||||
return super.causeFallDamage(fallDistance, damageMultiplier, damageSource);
|
||||
diff --git a/src/main/java/net/minecraft/world/item/Item.java b/src/main/java/net/minecraft/world/item/Item.java
|
||||
index 253d3c1b83d1e8f5d1afbdb5fb7007196ed94436..ea9c536db845d94ae4333c1e8fa9469cf20a45b7 100644
|
||||
index dd2f6c67533cc3344a171fe3ae9b3704796d8c50..78e641cf4f5857712f60b168be803f311e7def10 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/Item.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/Item.java
|
||||
@@ -168,7 +168,7 @@ public class Item implements FeatureElement, ItemLike {
|
||||
@@ -169,7 +169,7 @@ public class Item implements FeatureElement, ItemLike {
|
||||
}
|
||||
|
||||
public int getBarWidth(ItemStack stack) {
|
||||
@@ -395,10 +400,10 @@ index 253d3c1b83d1e8f5d1afbdb5fb7007196ed94436..ea9c536db845d94ae4333c1e8fa9469c
|
||||
|
||||
public int getBarColor(ItemStack stack) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
|
||||
index 064783822333d11120daa28f3be5099e10510b72..48fa055b8130889c5fcce9d0e282ea12a4daf577 100644
|
||||
index ecf640b00007a386290f8dfe9935a8aa610079fd..8b199643eda44a6f020768af70e85175fbe2be5d 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
|
||||
@@ -346,7 +346,7 @@ public class EnchantmentHelper {
|
||||
@@ -350,7 +350,7 @@ public class EnchantmentHelper {
|
||||
} else {
|
||||
level += 1 + random.nextInt(i / 4 + 1) + random.nextInt(i / 4 + 1);
|
||||
float f = (random.nextFloat() + random.nextFloat() - 1.0F) * 0.15F;
|
||||
@@ -408,7 +413,7 @@ index 064783822333d11120daa28f3be5099e10510b72..48fa055b8130889c5fcce9d0e282ea12
|
||||
if (!list2.isEmpty()) {
|
||||
WeightedRandom.getRandomItem(random, list2).ifPresent(list::add);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/DaylightDetectorBlock.java b/src/main/java/net/minecraft/world/level/block/DaylightDetectorBlock.java
|
||||
index 16504b8be08064e61b013fa943f692816612cbd0..38f6759501dcc2a0adb9608a9f639c2411acf277 100644
|
||||
index 81376e725151f723dad8a7b5c1a4bd597e60294e..5a33c98d29e1a76e5239dab166514ab95779ddc6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/DaylightDetectorBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/DaylightDetectorBlock.java
|
||||
@@ -62,7 +62,7 @@ public class DaylightDetectorBlock extends BaseEntityBlock {
|
||||
@@ -419,7 +424,7 @@ index 16504b8be08064e61b013fa943f692816612cbd0..38f6759501dcc2a0adb9608a9f639c24
|
||||
+ i = carpetfixes.helpers.FastMath.round((float) i * Mth.cos(f)); // Mirai
|
||||
}
|
||||
|
||||
i = Mth.clamp(i, (int) 0, (int) 15);
|
||||
i = Mth.clamp(i, 0, 15);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/SurfaceSystem.java b/src/main/java/net/minecraft/world/level/levelgen/SurfaceSystem.java
|
||||
index 3152d995f87beca1e0243a7d594d352ec458b0ed..d4dbee946d292e0d01910cc4fd1c67cda8fd7dc8 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/SurfaceSystem.java
|
||||
@@ -487,7 +492,7 @@ index 731c7dd15f131dc124be6af8f342b122cb89491b..24a82111a5485da1e3903977d0519e9e
|
||||
return i;
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index b3604afdc3fcb515d0c56349552dc1eaeb733a5a..4260147ebc4f1e60ce510212c2829ed32f94b735 100644
|
||||
index 918631209956adae59b83dd28e7492290362311e..607b02f77c76760f607ce763ea2ea17e48323c0e 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -188,12 +188,18 @@ public class LeafConfig {
|
||||
|
||||
Reference in New Issue
Block a user