Skip to content

Commit

Permalink
Update timetracking
Browse files Browse the repository at this point in the history
  • Loading branch information
abextm authored and Adam- committed Mar 21, 2024
1 parent 0f09d7c commit 9b9dd80
Show file tree
Hide file tree
Showing 12 changed files with 253 additions and 413 deletions.
1 change: 0 additions & 1 deletion src/modules/timetracking/BirdHouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export class BirdHouse_$WRAPPER {
}
}
BirdHouse['__class'] = 'timetracking.BirdHouse'
BirdHouse['__interfaces'] = ['java.lang.Comparable', 'java.io.Serializable']
BirdHouse['_$wrappers'] = {
0: new BirdHouse_$WRAPPER(0, 'NORMAL', 'Bird House', ItemID.BIRD_HOUSE),
1: new BirdHouse_$WRAPPER(1, 'OAK', 'Oak Bird House', ItemID.OAK_BIRD_HOUSE),
Expand Down
6 changes: 1 addition & 5 deletions src/modules/timetracking/BirdHouseSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class BirdHouseSpace_$WRAPPER {
this.__name = null
}
if (this.varp === undefined) {
this.varp = null
this.varp = 0
}
this.__name = name
this.varp = varp
Expand All @@ -39,10 +39,6 @@ export class BirdHouseSpace_$WRAPPER {
}
}
BirdHouseSpace['__class'] = 'timetracking.BirdHouseSpace'
BirdHouseSpace['__interfaces'] = [
'java.lang.Comparable',
'java.io.Serializable'
]
BirdHouseSpace['_$wrappers'] = {
0: new BirdHouseSpace_$WRAPPER(
0,
Expand Down
4 changes: 0 additions & 4 deletions src/modules/timetracking/BirdHouseState.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ export class BirdHouseState_$WRAPPER {
}
}
BirdHouseState['__class'] = 'timetracking.BirdHouseState'
BirdHouseState['__interfaces'] = [
'java.lang.Comparable',
'java.io.Serializable'
]
BirdHouseState['_$wrappers'] = {
0: new BirdHouseState_$WRAPPER(0, 'SEEDED'),
1: new BirdHouseState_$WRAPPER(1, 'BUILT'),
Expand Down
5 changes: 1 addition & 4 deletions src/modules/timetracking/BirdHouseTracker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-nocheck
/* eslint-disable */
import { VarPlayer } from './VarPlayer'
export class BirdHouseTracker {
loadFromConfig(getConfiguration) {
const birdHouseData = new Map()
Expand Down Expand Up @@ -31,9 +30,7 @@ export class BirdHouseTracker {
const key =
TimeTrackingConfig.BIRD_HOUSE +
'.' +
VarPlayer['_$wrappers'][
BirdHouseSpace['_$wrappers'][space].getVarp()
].getId()
BirdHouseSpace['_$wrappers'][space].getVarp()
const storedValue = (target =>
typeof target === 'function'
? target(TimeTrackingConfig.CONFIG_GROUP, key)
Expand Down
2 changes: 1 addition & 1 deletion src/modules/timetracking/FarmingPatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class FarmingPatch {
this.name = null
}
if (this.varbit === undefined) {
this.varbit = null
this.varbit = 0
}
if (this.implementation === undefined) {
this.implementation = null
Expand Down
4 changes: 2 additions & 2 deletions src/modules/timetracking/FarmingRegion.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-nocheck
/* eslint-disable */
export class FarmingRegion {
constructor(name, regionID, ...patches) {
constructor(name, regionID, definite, ...patches) {
if (this.name === undefined) {
this.name = null
}
Expand All @@ -19,7 +19,7 @@ export class FarmingRegion {
this.patches = patches
this.varbits = (s => {
let a = []
while (s-- > 0) a.push(null)
while (s-- > 0) a.push(0)
return a
})(patches.length)
for (let i = 0; i < patches.length; i++) {
Expand Down
6 changes: 1 addition & 5 deletions src/modules/timetracking/FarmingTracker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-nocheck
/* eslint-disable */
import { Varbits } from './Varbits'
export class FarmingTracker {
predictPatch(patch, getConfiguration) {
const unixNow = (n => (n < 0 ? Math.ceil(n) : Math.floor(n)))(
Expand All @@ -24,10 +23,7 @@ export class FarmingTracker {
TimeTrackingConfig.CONFIG_GROUP,
TimeTrackingConfig.BOTANIST
))(getConfiguration)
const key =
patch.getRegion().getRegionID() +
'.' +
Varbits['_$wrappers'][patch.getVarbit()].getId()
const key = patch.getRegion().getRegionID() + '.' + patch.getVarbit()
const storedValue = (target =>
typeof target === 'function'
? target(TimeTrackingConfig.CONFIG_GROUP, key)
Expand Down

0 comments on commit 9b9dd80

Please sign in to comment.