remove applied patches
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
--- a/net/minecraft/world/entity/animal/frog/ShootTongue.java
|
||||
+++ b/net/minecraft/world/entity/animal/frog/ShootTongue.java
|
||||
@@ -19,6 +19,9 @@
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.level.pathfinder.Path;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
+// CraftBukkit end
|
||||
|
||||
public class ShootTongue extends Behavior<Frog> {
|
||||
|
||||
@@ -64,7 +67,7 @@
|
||||
|
||||
BehaviorUtils.lookAtEntity(frog, entityliving);
|
||||
frog.setTongueTarget(entityliving);
|
||||
- frog.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new WalkTarget(entityliving.position(), 2.0F, 0)));
|
||||
+ frog.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (new WalkTarget(entityliving.position(), 2.0F, 0))); // CraftBukkit - decompile error
|
||||
this.calculatePathCounter = 10;
|
||||
this.state = ShootTongue.State.MOVE_TO_TARGET;
|
||||
}
|
||||
@@ -85,7 +88,7 @@
|
||||
if (entity.isAlive()) {
|
||||
frog.doHurtTarget(world, entity);
|
||||
if (!entity.isAlive()) {
|
||||
- entity.remove(Entity.RemovalReason.KILLED);
|
||||
+ entity.remove(Entity.RemovalReason.KILLED, EntityRemoveEvent.Cause.DEATH); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,7 +109,7 @@
|
||||
this.eatAnimationTimer = 0;
|
||||
this.state = ShootTongue.State.CATCH_ANIMATION;
|
||||
} else if (this.calculatePathCounter <= 0) {
|
||||
- frog.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new WalkTarget(entityliving.position(), 2.0F, 0)));
|
||||
+ frog.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (new WalkTarget(entityliving.position(), 2.0F, 0))); // CraftBukkit - decompile error
|
||||
this.calculatePathCounter = 10;
|
||||
} else {
|
||||
--this.calculatePathCounter;
|
||||
@@ -1,87 +0,0 @@
|
||||
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
@@ -50,6 +50,7 @@
|
||||
public int age;
|
||||
protected static final ImmutableList<SensorType<? extends Sensor<? super Tadpole>>> SENSOR_TYPES = ImmutableList.of(SensorType.NEAREST_LIVING_ENTITIES, SensorType.NEAREST_PLAYERS, SensorType.HURT_BY, SensorType.FROG_TEMPTATIONS);
|
||||
protected static final ImmutableList<MemoryModuleType<?>> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.LOOK_TARGET, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.NEAREST_VISIBLE_ADULT, MemoryModuleType.TEMPTATION_COOLDOWN_TICKS, MemoryModuleType.IS_TEMPTED, MemoryModuleType.TEMPTING_PLAYER, MemoryModuleType.BREED_TARGET, MemoryModuleType.IS_PANICKING);
|
||||
+ public boolean ageLocked; // Paper
|
||||
|
||||
public Tadpole(EntityType<? extends AbstractFish> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -74,7 +75,7 @@
|
||||
|
||||
@Override
|
||||
public Brain<Tadpole> getBrain() {
|
||||
- return super.getBrain();
|
||||
+ return (Brain<Tadpole>) super.getBrain(); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,7 +103,7 @@
|
||||
@Override
|
||||
public void aiStep() {
|
||||
super.aiStep();
|
||||
- if (!this.level().isClientSide) {
|
||||
+ if (!this.level().isClientSide && !this.ageLocked) { // Paper
|
||||
this.setAge(this.age + 1);
|
||||
}
|
||||
|
||||
@@ -112,12 +113,14 @@
|
||||
public void addAdditionalSaveData(CompoundTag nbt) {
|
||||
super.addAdditionalSaveData(nbt);
|
||||
nbt.putInt("Age", this.age);
|
||||
+ nbt.putBoolean("AgeLocked", this.ageLocked); // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag nbt) {
|
||||
super.readAdditionalSaveData(nbt);
|
||||
this.setAge(nbt.getInt("Age"));
|
||||
+ this.ageLocked = nbt.getBoolean("AgeLocked"); // Paper
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -169,6 +172,7 @@
|
||||
Bucketable.saveDefaultDataToBucketTag(this, stack);
|
||||
CustomData.update(DataComponents.BUCKET_ENTITY_DATA, stack, (nbttagcompound) -> {
|
||||
nbttagcompound.putInt("Age", this.getAge());
|
||||
+ nbttagcompound.putBoolean("AgeLocked", this.ageLocked); // Paper
|
||||
});
|
||||
}
|
||||
|
||||
@@ -179,6 +183,7 @@
|
||||
this.setAge(nbt.getInt("Age"));
|
||||
}
|
||||
|
||||
+ this.ageLocked = nbt.getBoolean("AgeLocked"); // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -210,6 +215,7 @@
|
||||
}
|
||||
|
||||
private void ageUp(int seconds) {
|
||||
+ if (this.ageLocked) return; // Paper
|
||||
this.setAge(this.age + seconds * 20);
|
||||
}
|
||||
|
||||
@@ -225,12 +231,17 @@
|
||||
Level world = this.level();
|
||||
|
||||
if (world instanceof ServerLevel worldserver) {
|
||||
- this.convertTo(EntityType.FROG, ConversionParams.single(this, false, false), (frog) -> {
|
||||
+ Frog converted = this.convertTo(EntityType.FROG, ConversionParams.single(this, false, false), (frog) -> { // CraftBukkit
|
||||
frog.finalizeSpawn(worldserver, this.level().getCurrentDifficultyAt(frog.blockPosition()), EntitySpawnReason.CONVERSION, (SpawnGroupData) null);
|
||||
frog.setPersistenceRequired();
|
||||
frog.fudgePositionAfterSizeChange(this.getDimensions(this.getPose()));
|
||||
this.playSound(SoundEvents.TADPOLE_GROW_UP, 0.15F, 1.0F);
|
||||
- });
|
||||
+ // CraftBukkit start
|
||||
+ }, org.bukkit.event.entity.EntityTransformEvent.TransformReason.METAMORPHOSIS, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.METAMORPHOSIS);
|
||||
+ if (converted == null) {
|
||||
+ this.setAge(0); // Sets the age to 0 for avoid a loop if the event is canceled
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user