9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-29 03:39:07 +00:00

Start updating to 1.21.5

This commit is contained in:
Samsuik
2025-03-30 13:40:09 +01:00
parent 1316e8819b
commit 0ecadc00f6
95 changed files with 328 additions and 360 deletions

View File

@@ -10,7 +10,7 @@ import org.jspecify.annotations.NullMarked;
import java.util.Optional;
@NullMarked
public record EntityState(Vec3 position, Vec3 momentum, AABB bb, Vec3 stuckSpeed, Optional<BlockPos> supportingPos, boolean onGround, float fallDistance) {
public record EntityState(Vec3 position, Vec3 momentum, AABB bb, Vec3 stuckSpeed, Optional<BlockPos> supportingPos, boolean onGround, double fallDistance) {
public static EntityState of(Entity entity) {
return new EntityState(
entity.position(), entity.getDeltaMovement(), entity.getBoundingBox(),

View File

@@ -15,7 +15,7 @@ import net.minecraft.world.level.Level;
import org.jspecify.annotations.NullMarked;
@NullMarked
public final class BlockableSwordItem extends SwordItem {
public final class BlockableSwordItem extends Item {
private static final Consumable BLOCKING_ANIMATION = Consumable.builder()
.consumeSeconds(720000)
.animation(ItemUseAnimation.BLOCK)
@@ -23,8 +23,8 @@ public final class BlockableSwordItem extends SwordItem {
.hasConsumeParticles(false)
.build();
public BlockableSwordItem(ToolMaterial material, float attackDamage, float attackSpeed, Properties properties) {
super(material, attackDamage, attackSpeed, properties);
public BlockableSwordItem(Properties properties) {
super(properties);
}
@Override

View File

@@ -44,16 +44,11 @@ public final class PlayerVisibilitySettings implements VisibilitySettings {
}
public void loadData(@NonNull CompoundTag tag) {
if (!tag.contains(SETTINGS_COMPOUND_TAG, CompoundTag.TAG_COMPOUND)) {
return;
}
CompoundTag settingsTag = tag.getCompound(SETTINGS_COMPOUND_TAG);
CompoundTag settingsTag = tag.getCompoundOrEmpty(SETTINGS_COMPOUND_TAG);
for (VisibilityType type : VisibilityTypes.types()) {
if (settingsTag.contains(type.key(), CompoundTag.TAG_STRING)) {
VisibilityState state = VisibilityState.valueOf(settingsTag.getString(type.key()));
this.visibilityStates.put(type, state);
}
String typeKey = type.key();
String stateName = settingsTag.getStringOr(typeKey, type.getDefault().name());
this.set(type, VisibilityState.valueOf(stateName));
}
}

View File

@@ -26,7 +26,8 @@ public final class TickInformationCollector {
int entities = 0;
for (ServerLevel level : levels) {
chunks += level.chunkSource.getFullChunksCount();
entities += level.entityTickList.entities.size();
// todo 1.21.5 update
//entities += level.entityTickList.entities.size();
}
double averageTick = this.tickSamples.longStream()