-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
99 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/net/anvian/record_days_survived/components/DayComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
src/main/java/net/anvian/record_days_survived/components/ModComponents.java
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
src/main/java/net/anvian/record_days_survived/components/RecordDayComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 14 additions & 7 deletions
21
src/main/java/net/anvian/record_days_survived/components/TicksPassedComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,38 @@ | ||
package net.anvian.record_days_survived.components; | ||
|
||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.nbt.NbtCompound; | ||
import net.minecraft.registry.RegistryWrapper; | ||
import org.ladysnake.cca.api.v3.component.Component; | ||
|
||
public class TicksPassedComponent implements Component { | ||
private long tickPassed; | ||
private final PlayerEntity player; | ||
private long ticksPassed; | ||
|
||
public TicksPassedComponent(PlayerEntity player) { | ||
this.player = player; | ||
this.ticksPassed = 1200; | ||
} | ||
|
||
@Override | ||
public void readFromNbt(NbtCompound tag, RegistryWrapper.WrapperLookup registryLookup) { | ||
tickPassed = tag.getLong("ticksPassed"); | ||
ticksPassed = tag.getLong("ticksPassed"); | ||
} | ||
|
||
@Override | ||
public void writeToNbt(NbtCompound tag, RegistryWrapper.WrapperLookup registryLookup) { | ||
tag.putLong("ticksPassed", tickPassed); | ||
tag.putLong("ticksPassed", ticksPassed); | ||
} | ||
|
||
public long getTicksPassed() { | ||
return tickPassed; | ||
return ticksPassed; | ||
} | ||
|
||
public void addTickPassed(long worldTime) { | ||
tickPassed = worldTime; | ||
ticksPassed = worldTime; | ||
} | ||
|
||
public void resetTickPassed(){ | ||
tickPassed = 1200; | ||
public void resetTickPassed() { | ||
ticksPassed = 1200; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters