Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8aa1154
Add Kotlin libraries
zavdav Jan 6, 2026
691b0db
Remove unused PoseidonStatisticsAgent
zavdav Jan 6, 2026
16987c0
Truncate kick reason to 100 characters
zavdav Jan 7, 2026
b618ed7
Revert "Add Kotlin libraries"
zavdav Jan 12, 2026
416e0a0
Don't auto-save worlds if auto-saving is disabled
zavdav Jan 23, 2026
7ee474f
fix double newlines being printed on newer java versions to console o…
svgaming234 Jan 24, 2026
fa3028e
Merge pull request #9 from BetaMC-Developers/fixNewerJavaDoubleNewline
zavdav Jan 24, 2026
00d44cb
Fix NPE in PlayerPortalEvent when allow-nether is disabled
zavdav Jan 24, 2026
87c5a4f
Backport plugin messaging
zavdav Feb 5, 2026
01ae0c3
Switch back to Configurate
zavdav Feb 8, 2026
6da1e77
Improve ProjectileHitEvent
zavdav Feb 9, 2026
9b5c59a
Fix packets potentially being discarded
zavdav Feb 14, 2026
3215e42
Add Server.isPrimaryThread()
zavdav Feb 18, 2026
13054fa
Abstract connection ticking
zavdav Feb 19, 2026
bd01fe6
Allow for certain packets to be handled asynchronously
zavdav Feb 19, 2026
f98dffa
Add throttling for chunk packets
zavdav Feb 26, 2026
6823b76
Handle packets between ticks as well
zavdav Feb 26, 2026
3347f94
Initial implementation of PersistentDataContainer API
zavdav Mar 1, 2026
63f0a53
Add documentation
zavdav Mar 1, 2026
ff00e87
Deprecate all usage of org.bukkit.metadata
zavdav Mar 1, 2026
db0faf9
Rename newPersistentDataContainer() and move it to Server
zavdav Mar 2, 2026
1e0ad4e
Fix incorrect block updates for doors
zavdav Apr 22, 2026
e57363f
Fix passive and aquatic mobs spawning infrequently
zavdav May 1, 2026
9aa02f3
Bump to 1.0.8
zavdav May 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.betamc</groupId>
<artifactId>tsunami</artifactId>
<version>1.0.7</version>
<version>1.0.8</version>
<packaging>jar</packaging>

<properties>
Expand All @@ -13,13 +13,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>
<repository>
<id>Alpine Cloud</id>
<url>https://lib.alpn.cloud/alpine-public/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
Expand Down Expand Up @@ -66,9 +59,9 @@
<version>1.7</version>
</dependency>
<dependency>
<groupId>dev.tomwmth.configlib</groupId>
<artifactId>configlib-yaml</artifactId>
<version>4.6.0</version>
<groupId>org.spongepowered</groupId>
<artifactId>configurate-yaml</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -108,12 +101,12 @@
</dependencies>

<build>
<defaultGoal>clean install</defaultGoal>
<defaultGoal>clean package</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -126,7 +119,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.5.0</version>
<configuration>
<archive>
<manifestEntries>
Expand Down Expand Up @@ -164,7 +157,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<version>3.6.1</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -182,6 +175,7 @@
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.SF</exclude>
</excludes>
</filter>
Expand All @@ -193,7 +187,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.15.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand Down

This file was deleted.

2 changes: 2 additions & 0 deletions src/main/java/net/minecraft/server/Chunk.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.minecraft.server;

import com.legacyminecraft.poseidon.PoseidonConfig;
import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer;

import java.util.*;

Expand All @@ -25,6 +26,7 @@ public class Chunk {
public boolean q;
public long r;
private final int[] chunkSections; // Tsunami
public final CraftPersistentDataContainer container = new CraftPersistentDataContainer(); // Tsunami

public Chunk(World world, int i, int j) {
this.tileEntities = new HashMap();
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/net/minecraft/server/ChunkLoader.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.minecraft.server;

import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer;

import java.io.*;
import java.util.Iterator;

Expand Down Expand Up @@ -155,6 +157,8 @@ public static void a(Chunk chunk, World world, NBTTagCompound nbttagcompound) {
}

nbttagcompound.a("TileEntities", (NBTBase) nbttaglist1);

nbttagcompound.a(CraftPersistentDataContainer.TAG_KEY, chunk.container.asCompound()); // Tsunami - PersistentDataContainer API
}

public static Chunk a(World world, NBTTagCompound nbttagcompound) {
Expand Down Expand Up @@ -210,6 +214,11 @@ public static Chunk a(World world, NBTTagCompound nbttagcompound) {
}
}

// Tsunami start - PersistentDataContainer API
CraftPersistentDataContainer container = new CraftPersistentDataContainer(nbttagcompound.k(CraftPersistentDataContainer.TAG_KEY));
container.copyTo(chunk.container, true);
// Tsunami end

return chunk;
}

Expand Down
8 changes: 7 additions & 1 deletion src/main/java/net/minecraft/server/ConsoleLogFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ public String format(LogRecord logrecord) {
String message = ANSI_PATTERN.matcher(formattedMessage).replaceAll("");
stringbuilder.append(message);
// Tsunami end
stringbuilder.append('\n');

// Tsunami start - fix double newlines on newer Java versions
if (stringbuilder.charAt(stringbuilder.length() - 1) != '\n') {
stringbuilder.append('\n');
}
// Tsunami end

Throwable throwable = logrecord.getThrown();

if (throwable != null) {
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/net/minecraft/server/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.metadata.NBTMetadataConvert;
import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Vehicle;
import org.bukkit.event.entity.EntityCombustEvent;
Expand Down Expand Up @@ -101,6 +102,7 @@ public synchronized void setSeed(long seed) {
public boolean bK;
public boolean airBorne;
public UUID uniqueId = UUID.randomUUID(); // CraftBukkit
public final CraftPersistentDataContainer container = new CraftPersistentDataContainer(); // Tsunami
public final Map<String, MetadataValue> metadataStore = new HashMap<>(); // Tsunami

public Entity(World world) {
Expand Down Expand Up @@ -928,6 +930,7 @@ public void d(NBTTagCompound nbttagcompound) {
nbttagcompound.setLong("UUIDMost", this.uniqueId.getMostSignificantBits());
// CraftBukkit end
this.b(nbttagcompound);
nbttagcompound.a(CraftPersistentDataContainer.TAG_KEY, this.container.asCompound()); // Tsunami - PersistentDataContainer API
nbttagcompound.a("CustomMetadata", NBTMetadataConvert.metadataToCompound(metadataStore)); // Tsunami
}

Expand Down Expand Up @@ -1015,6 +1018,11 @@ public void e(NBTTagCompound nbttagcompound) {
}
// CraftBukkit end

// Tsunami - PersistentDataContainer API
CraftPersistentDataContainer container = new CraftPersistentDataContainer(nbttagcompound.k(CraftPersistentDataContainer.TAG_KEY));
container.copyTo(this.container, true);
// Tsunami end

// Tsunami start
NBTTagCompound metadata = nbttagcompound.k("CustomMetadata");
this.metadataStore.putAll(NBTMetadataConvert.compoundToMetadata(metadata));
Expand Down
85 changes: 48 additions & 37 deletions src/main/java/net/minecraft/server/EntityArrow.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.minecraft.server;

import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.block.CraftBlock;
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
import org.bukkit.entity.Projectile;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
Expand Down Expand Up @@ -161,48 +163,57 @@ public void m_() {
float f2;

if (movingobjectposition != null) {
// CraftBukkit start
ProjectileHitEvent phe = new ProjectileHitEvent((Projectile) this.getBukkitEntity());
this.world.getServer().getPluginManager().callEvent(phe);
// CraftBukkit end
if (movingobjectposition.entity != null) {
// CraftBukkit start
boolean stick;
if (entity instanceof EntityLiving) {
org.bukkit.Server server = this.world.getServer();

// TODO decide if we should create DamageCause.ARROW, DamageCause.PROJECTILE
// or leave as DamageCause.ENTITY_ATTACK
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
Projectile projectile = (Projectile) this.getBukkitEntity();
// TODO deal with arrows being fired from a non-entity

EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(projectile, damagee, EntityDamageEvent.DamageCause.PROJECTILE, 4);
server.getPluginManager().callEvent(event);
this.shooter = (projectile.getShooter() == null) ? null : ((CraftLivingEntity) projectile.getShooter()).getHandle();

if (event.isCancelled()) {
stick = !projectile.doesBounce();
// Tsunami start - improve ProjectileHitEvent
ProjectileHitEvent phe = new ProjectileHitEvent((Projectile) this.getBukkitEntity(), movingobjectposition.entity.getBukkitEntity());
this.world.getServer().getPluginManager().callEvent(phe);
if (!phe.isCancelled()) {
// Tsunami end

// CraftBukkit start
boolean stick;
if (entity instanceof EntityLiving) {
org.bukkit.Server server = this.world.getServer();

// TODO decide if we should create DamageCause.ARROW, DamageCause.PROJECTILE
// or leave as DamageCause.ENTITY_ATTACK
org.bukkit.entity.Entity damagee = movingobjectposition.entity.getBukkitEntity();
Projectile projectile = (Projectile) this.getBukkitEntity();
// TODO deal with arrows being fired from a non-entity

EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(projectile, damagee, EntityDamageEvent.DamageCause.PROJECTILE, 4);
server.getPluginManager().callEvent(event);
this.shooter = (projectile.getShooter() == null) ? null : ((CraftLivingEntity) projectile.getShooter()).getHandle();

if (event.isCancelled()) {
stick = !projectile.doesBounce();
} else {
// this function returns if the arrow should stick in or not, i.e. !bounce
stick = movingobjectposition.entity.damageEntity(this, event.getDamage());
}
} else {
// this function returns if the arrow should stick in or not, i.e. !bounce
stick = movingobjectposition.entity.damageEntity(this, event.getDamage());
stick = movingobjectposition.entity.damageEntity(this.shooter, 4);
}
if (stick) {
// CraftBukkit end
this.world.makeSound(this, "random.drr", 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
this.die();
} else {
this.motX *= -0.10000000149011612D;
this.motY *= -0.10000000149011612D;
this.motZ *= -0.10000000149011612D;
this.yaw += 180.0F;
this.lastYaw += 180.0F;
this.k = 0;
}
} else {
stick = movingobjectposition.entity.damageEntity(this.shooter, 4);
}
if (stick) {
// CraftBukkit end
this.world.makeSound(this, "random.drr", 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
this.die();
} else {
this.motX *= -0.10000000149011612D;
this.motY *= -0.10000000149011612D;
this.motZ *= -0.10000000149011612D;
this.yaw += 180.0F;
this.lastYaw += 180.0F;
this.k = 0;
}
} else {
// Tsunami start - improve ProjectileHitEvent
org.bukkit.block.Block block = this.world.getWorld().getBlockAt(movingobjectposition.b, movingobjectposition.c, movingobjectposition.d);
BlockFace face = CraftBlock.notchToBlockFace(movingobjectposition.face);
ProjectileHitEvent phe = new ProjectileHitEvent((Projectile) this.getBukkitEntity(), block, face);
this.world.getServer().getPluginManager().callEvent(phe);
// Tsunami end
this.d = movingobjectposition.b;
this.e = movingobjectposition.c;
this.f = movingobjectposition.d;
Expand Down
Loading