Skip to content

Commit

Permalink
fix: fix the bug caused by incorrect initial value of runtime id coun…
Browse files Browse the repository at this point in the history
…ter. The initial value should be 1 instead of 0.
  • Loading branch information
smartcmd committed Feb 1, 2025
1 parent 4c82a13 commit 69759d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Unless otherwise specified, any version comparison below is the comparison of se
- Fixed the bug that unusable enchantment types may be shown in enchantment table.
- Fixed the bug that `/give` command will stack item that cannot be stacked like sword.
- Fixed the bug that damage that smaller than 1 will never kill an entity even if the entity has only 1 health.
- Fixed the bug caused by incorrect initial value of runtime id counter. The initial value should be 1 instead of 0.

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public class EntityBaseComponentImpl implements EntityBaseComponent {
public static final Identifier IDENTIFIER = new Identifier("minecraft:entity_base_component");

protected static final int DEFAULT_DEAD_TIMER = 20;
protected static final AtomicLong RUNTIME_ID_COUNTER = new AtomicLong(0);
// NOTICE: the runtime id is counted from 1 not 0
protected static final AtomicLong RUNTIME_ID_COUNTER = new AtomicLong(1);

protected static final String TAG_IDENTIFIER = "identifier";
protected static final String TAG_ON_GROUND = "OnGround";
Expand Down

0 comments on commit 69759d9

Please sign in to comment.