Skip to content

Commit

Permalink
fix: Zero is valid id
Browse files Browse the repository at this point in the history
  • Loading branch information
aromaa authored and gabizou committed May 31, 2024
1 parent 847c811 commit cb40847
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ public Optional<PaletteReference<T, R>> get(int id) {
@Override
public OptionalInt get(T type) {
final var id = this.proxy.getId((NT) type);
if (id <= 0) {
return OptionalInt.empty();
if (id >= 0) {
return OptionalInt.of(id);
}
return OptionalInt.of(id);
return OptionalInt.empty();
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import net.minecraft.world.level.LevelHeightAccessor;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.world.level.chunk.ChunkStatus;
import net.minecraft.world.level.chunk.LevelChunkSection;
import net.minecraft.world.level.chunk.status.ChunkStatus;
import net.minecraft.world.level.levelgen.Heightmap;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.block.BlockType;
Expand Down

0 comments on commit cb40847

Please sign in to comment.