Remap CraftBukkit to Mojang+Yarn Mappings

By: Initial Source <noreply+automated@papermc.io>
This commit is contained in:
CraftBukkit/Spigot
2024-12-11 22:26:55 +01:00
parent a265d64138
commit 30e4583dbe
1780 changed files with 44628 additions and 41274 deletions

View File

@@ -0,0 +1,46 @@
--- a/net/minecraft/world/entity/ambient/Bat.java
+++ b/net/minecraft/world/entity/ambient/Bat.java
@@ -29,6 +29,9 @@
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.phys.Vec3;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end
public class Bat extends AmbientCreature {
@@ -144,13 +147,13 @@
this.yHeadRot = (float) this.random.nextInt(360);
}
- if (world.getNearestPlayer(Bat.BAT_RESTING_TARGETING, this) != null) {
+ if (world.getNearestPlayer(Bat.BAT_RESTING_TARGETING, this) != null && CraftEventFactory.handleBatToggleSleepEvent(this, true)) { // CraftBukkit - Call BatToggleSleepEvent
this.setResting(false);
if (!flag) {
world.levelEvent((Player) null, 1025, blockposition, 0);
}
}
- } else {
+ } else if (CraftEventFactory.handleBatToggleSleepEvent(this, true)) { // CraftBukkit - Call BatToggleSleepEvent
this.setResting(false);
if (!flag) {
world.levelEvent((Player) null, 1025, blockposition, 0);
@@ -177,7 +180,7 @@
this.zza = 0.5F;
this.setYRot(this.getYRot() + f1);
- if (this.random.nextInt(100) == 0 && world.getBlockState(blockposition1).isRedstoneConductor(world, blockposition1)) {
+ if (this.random.nextInt(100) == 0 && world.getBlockState(blockposition1).isRedstoneConductor(world, blockposition1) && CraftEventFactory.handleBatToggleSleepEvent(this, false)) { // CraftBukkit - Call BatToggleSleepEvent
this.setResting(true);
}
}
@@ -202,7 +205,7 @@
if (this.isInvulnerableTo(world, source)) {
return false;
} else {
- if (this.isResting()) {
+ if (this.isResting() && CraftEventFactory.handleBatToggleSleepEvent(this, true)) { // CraftBukkit - Call BatToggleSleepEvent
this.setResting(false);
}

View File

@@ -1,47 +0,0 @@
--- a/net/minecraft/world/entity/ambient/EntityBat.java
+++ b/net/minecraft/world/entity/ambient/EntityBat.java
@@ -30,6 +30,10 @@
import net.minecraft.world.level.levelgen.HeightMap;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+// CraftBukkit end
+
public class EntityBat extends EntityAmbient {
public static final float FLAP_LENGTH_SECONDS = 0.5F;
@@ -144,13 +148,13 @@
this.yHeadRot = (float) this.random.nextInt(360);
}
- if (worldserver.getNearestPlayer(EntityBat.BAT_RESTING_TARGETING, this) != null) {
+ if (worldserver.getNearestPlayer(EntityBat.BAT_RESTING_TARGETING, this) != null && CraftEventFactory.handleBatToggleSleepEvent(this, true)) { // CraftBukkit - Call BatToggleSleepEvent
this.setResting(false);
if (!flag) {
worldserver.levelEvent((EntityHuman) null, 1025, blockposition, 0);
}
}
- } else {
+ } else if (CraftEventFactory.handleBatToggleSleepEvent(this, true)) { // CraftBukkit - Call BatToggleSleepEvent
this.setResting(false);
if (!flag) {
worldserver.levelEvent((EntityHuman) null, 1025, blockposition, 0);
@@ -177,7 +181,7 @@
this.zza = 0.5F;
this.setYRot(this.getYRot() + f1);
- if (this.random.nextInt(100) == 0 && worldserver.getBlockState(blockposition1).isRedstoneConductor(worldserver, blockposition1)) {
+ if (this.random.nextInt(100) == 0 && worldserver.getBlockState(blockposition1).isRedstoneConductor(worldserver, blockposition1) && CraftEventFactory.handleBatToggleSleepEvent(this, false)) { // CraftBukkit - Call BatToggleSleepEvent
this.setResting(true);
}
}
@@ -202,7 +206,7 @@
if (this.isInvulnerableTo(worldserver, damagesource)) {
return false;
} else {
- if (this.isResting()) {
+ if (this.isResting() && CraftEventFactory.handleBatToggleSleepEvent(this, true)) { // CraftBukkit - Call BatToggleSleepEvent
this.setResting(false);
}