Skip to content

Commit

Permalink
Merge pull request #65 from valoeghese/assetpacks
Browse files Browse the repository at this point in the history
Also Not Asset Packs
  • Loading branch information
valoeghese authored Jan 21, 2022
2 parents 0509cb5 + 14a75b0 commit 4c06151
Show file tree
Hide file tree
Showing 73 changed files with 1,247 additions and 230 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (org.gradle.internal.os.OperatingSystem.current() == org.gradle.internal.os.O
}

group 'tk.valoeghese'
version '0.2.5'
version '0.3.0'

switch (org.gradle.internal.os.OperatingSystem.current()) {
case org.gradle.internal.os.OperatingSystem.LINUX:
Expand Down
13 changes: 10 additions & 3 deletions src/main/java/tk/valoeghese/fc0/Game2fc.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import tk.valoeghese.fc0.world.chunk.ChunkLoadStatus;
import tk.valoeghese.fc0.world.TileAccess;
import tk.valoeghese.fc0.world.player.Player;
import tk.valoeghese.fc0.world.sound.SoundEffect;

import javax.annotation.Nullable;
import java.util.*;

import static org.joml.Math.PI;
Expand All @@ -23,7 +25,7 @@ protected Game2fc() {
private final Queue<Chunk> toUpdateLighting = new LinkedList<>();

private static final float SKY_LIGHTING_CHANGE_RATE = 10.5f;
private static final float SKY_ROTATION_RATE = (float) (9216 * PI * 4); // 4pi n
protected static final float SKY_ROTATION_RATE = (float) (9216 * PI * 4); // 4pi n

/**
* @return the sky angle between 0.0f and (float)2pi.
Expand Down Expand Up @@ -66,7 +68,7 @@ protected void updateNextLighting() {

for (Chunk chunk : c) {
if (chunk.status != ChunkLoadStatus.UNLOADED) {
chunk.refreshLighting();
chunk.refreshLightingMesh();
}
}
}
Expand All @@ -93,7 +95,7 @@ public void runLater(Runnable task) {
}
}

public void needsLightingUpdate(Chunk c) {
public void needsMeshLightingUpdate(Chunk c) {
synchronized (this.toUpdateLighting) {
if (!this.toUpdateLighting.contains(c)) {
this.toUpdateLighting.add(c);
Expand All @@ -106,7 +108,12 @@ protected void tick() {
++this.time;
}

public SoundEffect createSoundEffect(String name, String... resources) {
return new SoundEffect(name);
}

public abstract boolean isMainThread();
public abstract void playSound(@Nullable Player toExcept, SoundEffect effect, double x, double y, double z, float volume);

public static Game2fc getInstance() {
return instance;
Expand Down
Loading

0 comments on commit 4c06151

Please sign in to comment.