Skip to content
This repository has been archived by the owner on Oct 16, 2022. It is now read-only.

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederoxDev committed Aug 31, 2022
1 parent 3ac389c commit 19d2cc3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
9 changes: 9 additions & 0 deletions BP/functions/blocks.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
give @s cosmos:thruster 4
give @s cosmos:rocket_plating 8
give @s cosmos:rocket_controller 1
give @s minecraft:glass 9
give @s scaffolding 10

give @s cosmos:base_controller 1
give @s cosmos:oxygen_charger 1
give @s cosmos:oxygen_tank 3
4 changes: 3 additions & 1 deletion BP/scripts/Oxygen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ world.events.tick.subscribe(e => {
}

player.onScreenDisplay.setActionBar("No Oxygen!")
player.runCommand("damage @s 2")
try {
player.runCommand("damage @s 2")
} catch { }
}
})
19 changes: 8 additions & 11 deletions BP/scripts/Rocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const K384 = new Planet("K384", 5000, 50)
const planets = [Earth, K384]

const transitionHeight = 100
const speedHeight = 70

world.events.dataDrivenEntityTriggerEvent.subscribe(async (e) => {
if (e.id != "cosmos:on_rider_detected") return;
Expand Down Expand Up @@ -117,8 +116,14 @@ world.events.dataDrivenEntityTriggerEvent.subscribe(async (e) => {
lastTimestamp = new Date().getTime()
frameIndex++

player.runCommand("ride @s summon_ride cosmos:rocket")
player.runCommand("gamemode survival")
try {
player.runCommand("ride @s summon_ride cosmos:rocket")
player.runCommand("gamemode survival")
} catch (e) {
frameIndex = 6
Debug.log("Failed to summon rocket, it is likely chunks are still loading. Retrying")
continue
}
continue
}

Expand All @@ -134,14 +139,6 @@ world.events.dataDrivenEntityTriggerEvent.subscribe(async (e) => {
}))[0];

rocket.setVelocity(new Vector(0, -3, 0))
continue
}

if (frameIndex == 8 && rocket.location.y < speedHeight) {
lastTimestamp = new Date().getTime()
frameIndex++

rocket.setVelocity(new Vector(0, -1, 0))
playing = false
continue
}
Expand Down
2 changes: 1 addition & 1 deletion BP/scripts/Utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ world.events.beforeChat.subscribe(e => {
const item = inventory.getItem(i)
if (item == null || item.id != "cosmos:oxygen_tank") continue

item.setLore([`Oxygen: 15 / 15`])
item.setLore([`Oxygen: 120 / 120`])
inventory.setItem(i, item)
}
}
Expand Down
2 changes: 2 additions & 0 deletions RP/texts/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ pack.description=A space addon!
block.tips:base_controller=§6[TIP] Interact with Base Controller to show the bounds of the base
block.tips.oxygen_charger=§6[TIP] Interact with this block holding an Oxygen Tank to fill it with oxygen

action.hint.exit.cosmos:rocket=Exit Rocket

tile.cosmos:rocket_controller.name=Rocket Controller
tile.cosmos:thruster.name=Rocket Thruster
tile.cosmos:rocket_plating.name=Rocket Plating
Expand Down

0 comments on commit 19d2cc3

Please sign in to comment.