GithubHelp home page GithubHelp logo

draylar / game-phases Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 4.0 177 KB

Game Stages, for Fabric! Bundled into a single package for your convenience.

Home Page: https://www.curseforge.com/minecraft/mc-mods/game-phases

License: MIT License

Java 100.00%
stages phases minecraft modpacks fabric modpack modding

game-phases's Introduction

Game Phases

Game Phases is a Fabric alternative to Game Stages by Darkhax. It supports the idea of separating the game into "phases," each of which unlocks new content. Each phase has a prerequisite, and until that phase is unlocked, all content inside it will be unusable.

Game Phases relies on KubeJS for configuration and setup. All Game Phase scripts are in server_scripts.

For more information on setting up Game Phases, visit the wiki page.


Dependencies

Due to Game Phases being a 'modpack-mod' (one that users would not normally install on their own), it does not include/JIJ dependencies with it. You will have to install these separately:

Compatibility

Game Phases has built-in compatibility with the following mods:


Creating Phases

Define a phase:

onEvent('gamephases.initialize', event => {
    event.phase('one');
});

Grant the phase to the user when they obtain stone:

{
  "parent": "minecraft:recipes/root",
  "rewards": {
    "phase": [
      "one"
    ]
  },
  "criteria": {
    "has_cobblestone": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "items": [
              "minecraft:cobblestone"
            ]
          }
        ]
      }
    }
  },
  "requirements": [
    [
      "has_cobblestone"
    ]
  ]
}

Grant a phase through the /phase command:

/phase grant Draylar one


Item Restrictions

Game Phases allows you to restrict access to items based on phases. As a general overview, each phase can blacklist specific items. If a player does not meet the requirements for any phase that blacklists a given item, they will not be able to use it.

General blacklist restrictions include:

  • Blocked out item tooltip
  • Unable to use (right-click) the item
  • Prevent item pickups
  • Cancel any recipes involving the item
  • Drop when equipped
  • Invisible in REI and creative inventory [NYI]

Gating items behind a phase:

onEvent('gamephases.initialize', event => {
    // Lock Iron Ingot & all entries under the mymod namespace under phase one
    event.phase('one');
        .item('minecraft:iron_ingot')
        .item('mymod:*');
});

Block Restrictions

Block Restrictions are similar to Item Restrictions. Illusion is used to restrict the visibility of hidden blocks, and additional tweaks are implemented to make the hidden block as non-visible as possible.

General blacklist restrictions include:

  • Full visibility change through Illusion
  • Altered break drops

Gating blocks behind a phase:

The following example hides Diamond Ore as stone.

onEvent('gamephases.initialize', event => {
    // Replace stone with Diamond Ore
    event.phase('one');
        .block('minecraft:diamond_ore', 'minecraft:stone');
});

Dimension Restrictions

You can prevent access to dimensions through dimension restrictions.

General dimension restrictions include:

  • Any teleport to this dimension will be cancelled.

Gating dimensions behind a phase:

onEvent('gamephases.initialize', event => {
    // Lock Nether Entry behind 'one'
    event.phase('one')
        .dimension('minecraft:the_nether');
});

Entity Restrictions

You can prevent mob spawns through entity restrictions. When a mob attempts to spawn naturally, it will check phase restrictions. If any phase restricts the mob and no nearby players have passed the phase, the spawn will fail.

By default, mob spawns check for players 128 blocks out from their position. By lowering this counter, you can prevent spawns near the player based on phase, while still allowing the mob to spawn further out, regardless of the current phase.

Gating entities behind a phase:

onEvent('gamephases.initialize', event => {
    // Prevent creepers from spawning around players that have not passed phase one
    event.phase('one')
        .entity('minecraft:creeper');
});

Other KubeJS utilities

Game Phases exposes several utility methods you can use with KubeJS to depend on phases. Here is an example script which prints an extra message to the player if they have the one game phase:

Note: phases are synced S2C, which allows for client-side KubeJS scripts that depend on phases.

onEvent('player.chat', event => {
    var hasOne = event.player.hasPhase('one');
    
    // If the player has unlocked the 'one' rank, print an extra message.
    if(hasOne) {
        event.player.tell('You are powerful.')
    }
});

License

Game Phases is available under MIT.

game-phases's People

Contributors

draylar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

game-phases's Issues

[1.17.1] item mod namespace locking not working!

Hello, can someon confirm that locking an entire mod does not work?
Here is the KubeJS Script (/kubejs/server_scripts/phases.js):

console.log("Loading up our custom Game Phases script!");

onEvent('gamephases.initialize', event => {
    event.phase('one')
        .item('arcanus:*')
});
onEvent('player.chat', event => {
    var hasOne = event.player.hasPhase('one');
    if(hasOne) {
        event.player.tell('You are in phase one.')
    }
});

I can not find any errors in the log.
Is there an config to enable debugging logging?

[1.18.2] FabricDimensionsMixin cause error: Mixin transformation of net.fabricmc.fabric.api.dimension.v1.FabricDimensions failed

I have several crashes becaus of compatibilility issies with Game Phases!
E.g. Eden Ring Mod, use portal:

---- Minecraft Crash Report ----
// There are four lights!

Time: 7/21/22, 11:12 AM
Description: Ticking block entity

java.lang.RuntimeException: Mixin transformation of net.fabricmc.fabric.api.dimension.v1.FabricDimensions failed
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:419)
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323)
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218)
	at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:145)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at paulevs.edenring.blocks.entities.EdenPortalBlockEntity.lambda$serverTick$0(EdenPortalBlockEntity.java:123)
	at java.base/java.util.ArrayList.forEach(Unknown Source)
	at paulevs.edenring.blocks.entities.EdenPortalBlockEntity.serverTick(EdenPortalBlockEntity.java:114)
	at net.minecraft.class_2818$class_5563.method_31703(class_2818.java:659)
	at net.minecraft.class_2818$class_5564.method_31703(class_2818.java:713)
	at net.minecraft.class_1937.method_18471(class_1937.java:475)
	at net.minecraft.class_3218.method_18765(class_3218.java:368)
	at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:907)
	at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:851)
	at net.minecraft.class_1132.method_3748(class_1132.java:97)
	at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:697)
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:273)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:392)
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234)
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202)
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:414)
	... 17 more
Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure: Callback method beforeTeleport(Lnet/minecraft/class_1297;Lnet/minecraft/class_3218;Lnet/minecraft/class_5454;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable;)V in game-phases.mixins.json:dimension.FabricDimensionsMixin from mod game-phases failed injection check, (0/1) succeeded. Scanned 1 target(s). Using refmap game-phases-refmap.json
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.postInject(InjectionInfo.java:468)
	at org.spongepowered.asm.mixin.transformer.MixinTargetContext.applyInjections(MixinTargetContext.java:1385)
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyInjections(MixinApplicatorStandard.java:1052)
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:400)
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:325)
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:421)
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:403)
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363)
	... 20 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Server thread
Stacktrace:
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:419)
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323)
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218)
	at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:145)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at paulevs.edenring.blocks.entities.EdenPortalBlockEntity.lambda$serverTick$0(EdenPortalBlockEntity.java:123)
	at java.base/java.util.ArrayList.forEach(Unknown Source)
	at paulevs.edenring.blocks.entities.EdenPortalBlockEntity.serverTick(EdenPortalBlockEntity.java:114)
	at net.minecraft.class_2818$class_5563.method_31703(class_2818.java:659)
	at net.minecraft.class_2818$class_5564.method_31703(class_2818.java:713)
	at net.minecraft.class_1937.method_18471(class_1937.java:475)
	at net.minecraft.class_3218.method_18765(class_3218.java:368)

-- Block entity being ticked --
Details:
	Name: edenring:eden_portal // paulevs.edenring.blocks.entities.EdenPortalBlockEntity
	Block: Block{edenring:portal_center}
	Block location: World: (-10,80,4), Section: (at 6,0,4 in -1,5,0; chunk contains blocks -16,-64,0 to -1,319,15), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,-64,0 to -1,319,511)
	Block: Block{edenring:portal_center}
	Block location: World: (-10,80,4), Section: (at 6,0,4 in -1,5,0; chunk contains blocks -16,-64,0 to -1,319,15), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,-64,0 to -1,319,511)
Stacktrace:
	at net.minecraft.class_2818$class_5563.method_31703(class_2818.java:659)
	at net.minecraft.class_2818$class_5564.method_31703(class_2818.java:713)
	at net.minecraft.class_1937.method_18471(class_1937.java:475)
	at net.minecraft.class_3218.method_18765(class_3218.java:368)
	at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:907)
	at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:851)
	at net.minecraft.class_1132.method_3748(class_1132.java:97)
	at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:697)
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:273)
	at java.base/java.lang.Thread.run(Unknown Source)

-- Affected level --
Details:
	All players: 1 total; [class_3222['MSandro'/262, l='ServerLevel[1]', x=-9.89, y=80.00, z=5.69]]
	Chunk stats: 2809
	Level dimension: minecraft:overworld
	Level spawn location: World: (0,74,0), Section: (at 0,10,0 in 0,4,0; chunk contains blocks 0,-64,0 to 15,319,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,-64,0 to 511,319,511)
	Level time: 13016 game time, 13016 day time
	Level name: 1
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
	Level weather: Rain time: 103677 (now: false), thunder time: 124358 (now: false)
	Known server brands: fabric
	Level was modded: true
	Level storage version: 0x04ABD - Anvil
Stacktrace:
	at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:907)
	at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:851)
	at net.minecraft.class_1132.method_3748(class_1132.java:97)
	at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:697)
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:273)
	at java.base/java.lang.Thread.run(Unknown Source)

-- System Details --
Details:
	Minecraft Version: 1.18.2
	Minecraft Version ID: 1.18.2
	Operating System: Linux (amd64) version 5.16.20-2-MANJARO
	Java Version: 17.0.1, Eclipse Adoptium
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), Eclipse Adoptium
	Memory: 1810961120 bytes (1727 MiB) / 3355443200 bytes (3200 MiB) up to 8589934592 bytes (8192 MiB)
	CPUs: 16
	Processor Vendor: AuthenticAMD
	Processor Name: AMD Ryzen 7 2700X Eight-Core Processor
	Identifier: AuthenticAMD Family 23 Model 8 Stepping 2
	Microarchitecture: unknown
	Frequency (GHz): -0.00
	Number of physical packages: 1
	Number of physical CPUs: 8
	Number of logical CPUs: 16
	Graphics card #0 name: unknown
	Graphics card #0 vendor: unknown
	Graphics card #0 VRAM (MB): 0.00
	Graphics card #0 deviceId: unknown
	Graphics card #0 versionInfo: unknown
	Virtual memory max (MB): 32273.95
	Virtual memory used (MB): 19587.00
	Swap memory total (MB): 8192.00
	Swap memory used (MB): 31.57
	JVM Flags: 3 total; -Xmx8192m -Xms8192m -Xms256m
	Fabric Mods: 
		adorn: Adorn 3.5.0+1.18.2
		ae2: Applied Energistics 2 11.1.4
			noindium: No Indium? 1.0.2+1.18.2
				omega-config: OmegaConfig 1.2.3-1.18.1
		architectury: Architectury 4.5.76
		attributefix: AttributeFix 14.0.2
		badpackets: Bad Packets 0.1.2
		balm-fabric: Balm 3.1.0+0
		bclib: BCLib 1.4.7
		betterdungeons: YUNG's Better Dungeons 1.18.2-Fabric-2.1.0
		betterend: Better End 1.1.1
		bettermineshafts: YUNG's Better Mineshafts 1.18.2-Fabric-2.2
		betternether: Better Nether 6.1.2
		betterstrongholds: YUNG's Better Strongholds 1.18.2-Fabric-2.1.1
		celib: Celib 1.0.0
		cloth-config: Cloth Config v6 6.2.62
			cloth-basic-math: cloth-basic-math 0.6.1
		create: Create mc1.18.2_v0.4.1+637
			com_electronwill_night-config_core: core 3.6.3
			com_electronwill_night-config_toml: toml 3.6.3
			com_google_code_findbugs_jsr305: jsr305 3.0.2
			fake-player-api: Fake Player API 0.3.0
			flywheel: Flywheel 1.18-0.7.0.26
			forge_tags: Forge Tags 2.1
			forgeconfigapiport: Forge Config API Port 3.2.0
			milk: Milk Lib 0.3.2
				dripstone_fluid_lib: Dripstone Fluid Lib 1.2.0
			reach-entity-attributes: Reach Entity Attributes 2.1.1
			registrate-fabric: Registrate for Fabric MC1.18.2-1.0.3
		edenring: EdenRing 0.5.2
		fabric: Fabric API 0.57.0+1.18.2
			fabric-api-base: Fabric API Base 0.4.4+d7c144a860
			fabric-api-lookup-api-v1: Fabric API Lookup API (v1) 1.6.2+2373a54560
			fabric-biome-api-v1: Fabric Biome API (v1) 8.0.6+651bcc5960
			fabric-blockrenderlayer-v1: Fabric BlockRenderLayer Registration (v1) 1.1.12+3ac43d9560
			fabric-command-api-v1: Fabric Command API (v1) 1.1.9+d7c144a860
			fabric-commands-v0: Fabric Commands (v0) 0.2.8+b4f4f6cd60
			fabric-containers-v0: Fabric Containers (v0) 0.1.22+d7c144a860
			fabric-content-registries-v0: Fabric Content Registries (v0) 3.1.1+c85f2e3860
			fabric-convention-tags-v1: Fabric Convention Tags 1.0.1+474e4f7960
			fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.2.1+ee261a3e60
			fabric-data-generation-api-v1: Fabric Data Generation API (v1) 3.0.0+9fcb91d260
			fabric-dimensions-v1: Fabric Dimensions API (v1) 2.1.20+489d6f8260
			fabric-entity-events-v1: Fabric Entity Events (v1) 1.4.8+d7c144a860
			fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.4.19+d7c144a860
			fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.18+d7c144a860
			fabric-game-rule-api-v1: Fabric Game Rule API (v1) 1.0.13+d7c144a860
			fabric-item-api-v1: Fabric Item API (v1) 1.5.1+6c4e5d0960
			fabric-item-groups-v0: Fabric Item Groups (v0) 0.3.14+91896a4960
			fabric-key-binding-api-v1: Fabric Key Binding API (v1) 1.0.12+54e5b2ec60
			fabric-keybindings-v0: Fabric Key Bindings (v0) 0.2.10+b4f4f6cd60
			fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 2.1.0+cc71601c60
			fabric-loot-api-v2: Fabric Loot API (v2) 1.1.0+1997ad1260
			fabric-loot-tables-v1: Fabric Loot Tables (v1) 1.1.2+e747827960
			fabric-mining-level-api-v1: Fabric Mining Level API (v1) 2.1.4+cc71601c60
			fabric-models-v0: Fabric Models (v0) 0.3.6+d7c144a860
			fabric-networking-api-v1: Fabric Networking API (v1) 1.0.22+e6b169eb60
			fabric-networking-v0: Fabric Networking (v0) 0.3.9+b4f4f6cd60
			fabric-object-builder-api-v1: Fabric Object Builder API (v1) 2.1.3+032c981d60
			fabric-particles-v1: Fabric Particles (v1) 0.2.12+526dc1ac60
			fabric-registry-sync-v0: Fabric Registry Sync (v0) 0.9.9+0d9ab37260
			fabric-renderer-api-v1: Fabric Renderer API (v1) 0.4.13+d882b91560
			fabric-renderer-indigo: Fabric Renderer - Indigo 0.5.2+d005b03a60
			fabric-renderer-registries-v1: Fabric Renderer Registries (v1) 3.2.11+b4f4f6cd60
			fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.3.7+d7c144a860
			fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 2.0.2+54e5b2ec60
			fabric-rendering-v0: Fabric Rendering (v0) 1.1.13+b4f4f6cd60
			fabric-rendering-v1: Fabric Rendering (v1) 1.10.7+54e5b2ec60
			fabric-resource-conditions-api-v1: Fabric Resource Conditions API (v1) 2.0.3+91b7aa6660
			fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.5.2+446e059560
			fabric-screen-api-v1: Fabric Screen API (v1) 1.0.10+d882b91560
			fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.2.1+1f6558e860
			fabric-textures-v0: Fabric Textures (v0) 1.0.12+3ac43d9560
			fabric-transfer-api-v1: Fabric Transfer API (v1) 1.6.3+f4563ac860
			fabric-transitive-access-wideners-v1: Fabric Transitive Access Wideners (v1) 1.1.0+e747827960
		fabric-language-kotlin: Fabric Language Kotlin 1.8.2+kotlin.1.7.10
			org_jetbrains_kotlin_kotlin-reflect: kotlin-reflect 1.7.10
			org_jetbrains_kotlin_kotlin-stdlib: kotlin-stdlib 1.7.10
			org_jetbrains_kotlin_kotlin-stdlib-jdk7: kotlin-stdlib-jdk7 1.7.10
			org_jetbrains_kotlin_kotlin-stdlib-jdk8: kotlin-stdlib-jdk8 1.7.10
			org_jetbrains_kotlinx_atomicfu-jvm: atomicfu-jvm 0.18.2
			org_jetbrains_kotlinx_kotlinx-coroutines-core-jvm: kotlinx-coroutines-core-jvm 1.6.4
			org_jetbrains_kotlinx_kotlinx-coroutines-jdk8: kotlinx-coroutines-jdk8 1.6.4
			org_jetbrains_kotlinx_kotlinx-datetime-jvm: kotlinx-datetime-jvm 0.4.0
			org_jetbrains_kotlinx_kotlinx-serialization-cbor-jvm: kotlinx-serialization-cbor-jvm 1.3.3
			org_jetbrains_kotlinx_kotlinx-serialization-core-jvm: kotlinx-serialization-core-jvm 1.3.3
			org_jetbrains_kotlinx_kotlinx-serialization-json-jvm: kotlinx-serialization-json-jvm 1.3.3
		fabricloader: Fabric Loader 0.14.8
		ferritecore: FerriteCore 4.2.1
		fiblib: FibLib 1.3.1+1.18.2
		game-phases: Game Phases 1.2.2-1.18.1
		indium: Indium 1.0.6+mc1.18.2
		iris: Iris 1.2.5
			org_anarres_jcpp: jcpp 1.4.14
		java: OpenJDK 64-Bit Server VM 17
		kleeslabs: KleeSlabs 11.1.1
		kubejs: KubeJS 1802.5.4-build.521
		lazydfu: LazyDFU 0.1.2
		lithium: Lithium 0.7.10
		minecraft: Minecraft 1.18.2
		modmenu: Mod Menu 3.2.3
		phosphor: Phosphor 0.8.1
		plantinajar: Plant In A Jar 2.3.1
			libgui: LibGui 5.4.2+1.18.2
				jankson: Jankson 4.0.0+j1.2.0
					blue_endless_jankson: jankson 1.2.1
				libninepatch: LibNinePatch 1.1.0
			org_objenesis_objenesis: objenesis 3.2
		reborncore: Reborn Core 5.2.0
		refabslab: Refabricated Slabs 0.7.1
			cardinal-components-base: Cardinal Components API (base) 5.0.0-beta.1
			cardinal-components-chunk: Cardinal Components API (chunks) 5.0.0-beta.1
		respro: Resource Provider Library 0.2.0
		rhino: Rhino 1802.1.14-build.200
		roughlyenoughitems: Roughly Enough Items 8.3.510
		sodium: Sodium 0.4.1+build.15
			org_joml_joml: joml 1.10.2
		techreborn: Tech Reborn 5.2.0
			team_reborn_energy: Energy 2.2.0
		twilightforest: The Twilight Forest 4.1.251
			cardinal-components-entity: Cardinal Components API (entities) 4.1.4
			here-be-no-dragons: Here be no Dragons! 1.0.0
			javax_annotation_javax_annotation-api: javax.annotation-api 1.3.2
			mm: Manningham Mills 2.3
			porting_lib: Porting Lib 1.1.342-beta+1.18.2-dev.dd61cdc
				com_github_llamalad7_mixinextras: MixinExtras 0.0.10
				serialization_hooks: Serialization Hooks 0.2.0+1.18.f5d4aa6
		wthit: wthit 4.11.0
		yungsapi: YUNG's API 1.18.2-Fabric-2.0.8
	Loaded Shaderpack: (off)
	Flywheel Backend: GL33 Instanced Arrays
	Server Running: true
	Player Count: 1 / 8; [class_3222['MSandro'/262, l='ServerLevel[1]', x=-9.89, y=80.00, z=5.69]]
	Data Packs: vanilla, Fabric Mods
	World Generation: Stable
	Type: Integrated Server (map_client.txt)
	Is Modded: Definitely; Client brand changed to 'fabric'; Server brand changed to 'fabric'

Locked but not hidden on REI

Items/block locks are working great but are not hiding in REI. So I guess I have 2 questions:

Does gamephases need to be installed clientside?
With clientside installed would REI hide the items correctly?

Having trouble getting advancement phase granting to work.

I managed to add a phase that I can grant and revoke using commands, however I can't seem to get them grantable in survival.
I've been following the wiki instruction but they don't seem to be working.

The files seem to be in the right spot (I have them at kubejs\data\crafting\advancements\phases\phase_steel.age.json), although I cannot grant it using the criteria set in the json file, which I've also copied from the wiki.

Any idea as to which this is the case?

KubeJS code:

onEvent('gamephases.initialize', event => {
    event.phase('steel_age')
		.item('furnacemk2:furnacemk2')
		.item('furnacemk2:experience_core')
		.item('furnacemk2:insulation_core')
		.item('furnacemk2:thermal_core')
		.item('furnacemk2:crystal_gem_item')
		.item('steel:steel_ingot')
		.item('steel:steel_block')
		.item('steel:steel_nugget');
})

onEvent('player.chat', event => {
    var hasSteelAge = event.player.hasPhase('steel_age');
    if(hasOne) {
        event.player.tell('You are powerful.')
    }
});

phase_steel_age.json

{
  "parent": "gamephases:phases/root",
  "rewards": {
    "phases": [
      "steel_age"
    ]
  },
  "criteria": {
    "has_steel_compound": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "items": [
              "ngp_utilities:steel_compound"
            ]
          }
        ]
      }
    }
  },
  "requirements": [
    [
      "has_steel_compound"
    ]
  ]
}

Advancements Notes

I read through your instructions and after A LOT of trial and error, I got it working. My biggest roadblock was with the advancements...

Here are a couple of notes:

  1. It would be nice for your instructions to expand a little bit on the advancements. If people are not familiar with datapacks and how to make them, it can be a little daunting.
  2. An example of how to use KubeJS/data folder to put the advancements would be nice
  3. The other thing is parent MUST BE Minecraft:recipes/root. I tried to use a custom one like lcmp:earlygame/root and it did not work.

Potential issue:
When I revoked a phase, it did not reset the advancement. I was unable to get the phase again because the game thinks I already made the advancement.
I had to delete my UUID from the stats and advancements folder under my world folder.

Example mod

I really appreciate the existing readme but I request a small example mod which shows at least one simple game stage to have a more easy start building a game staged modpack :)

On second world load or /reload game freeze forever

Log on freeze:
https://mclo.gs/0e6yPvA
kQ0QRhZ.txt
KubeJS can't fetch recipes on second load.
If I disable game phases mod, that world start to load

Forge - 40.2.17
Minecraft - 1.18.2
Launcher - Prism Launcher (5.1)

Mod list:
• Architectury (4.11.93)
• Cloth Config v4 API (6.5.102)
• Game Phases (1.5.2)
• Illusion (1.0.2)
• KubeJS 1802.5.5-build.569
• Rhino (1802.2.1-build.255)
•
RoughlyEnoughItems (8.3.681)

dublicat quests

image
image
and
image
I would just remove "the kitchen" completely, we already have a whole "nutrition" for that

[1.17.1] crash

[17:23:50] [main/WARN]: Error loading class: dev/hephaestus/fiblib/api/BlockFibRegistry (java.lang.ClassNotFoundException: dev/hephaestus/fiblib/api/BlockFibRegistry)
[17:23:50] [main/ERROR]: Minecraft has crashed!
net.fabricmc.loader.impl.FormattedException: java.lang.BootstrapMethodError: java.lang.RuntimeException: Mixin transformation of net.minecraft.class_2248 failed
...

grant and revoke issues

with latest fiblib, I am having no problems making a script to lockdown something behind a phase.

for example, to test the mod itself, I just added a phase and did an excerpt from your tutorial. in this case I chose iron ingot item.

it behaved as I assumed.. locking down iron ingots and anything that requires one. even in creative.. nice.

however when in creative, I attempt to grant myself a phase.. no feedback.. plus I continue to be locked out of the phase.

perhaps, one cannot do this for themselves? you lock it down that much? if so.. bravo.

I have not tested with say something like an npc in taterzens.. which is my final intent, as npc's can run as op level in taterzens.

[1.17.1] end portal restriction not working?

onEvent('gamephases.initialize', event => {
    event.phase('end')
        .dimension('minecraft:the_end');
});

am I doing something wrong?
I wouldn't care if a player fell through the portal and ended up in the lava. But I would like to lock the portal until the player has found all the Ender Eyes from the mod "End Remastered".

Re-implement cursor stack blocking in 1.17.1

// @Shadow private ItemStack cursorStack;
//
// @Inject(
// method = "setCursorStack",
// at = @At("HEAD"), cancellable = true)
// private void dropCursorStack(ItemStack stack, CallbackInfo ci) {
// Item item = stack.getItem();
//
// // Check all registered Phases.
// // If a phase blacklists the given item and the player does not have it unlocked, stop the interaction.
// boolean allowed = GamePhasesEventJS.getPhases().values().stream().filter(phase -> phase.restricts(item)).allMatch(phase -> phase.hasUnlocked(player));
// if(!allowed) {
// player.dropStack(stack);
// this.cursorStack = ItemStack.EMPTY;
// ci.cancel();
// }
// }

REI Integration error causes reloads to break

I'm using newly? released forge version of the mod and upon loading into a world, an error (marked as fatal by minecraft's game output console) appears. It's the same in both log files (noreload, line: 1719; reload, line: 1721). This error seems to change nothing until you reload the server. For a while it seems like the reload is going on (probably as seen in logs) but the KubeJS green loading message doesn't appear. It looks like the reload got stuck somewhere, you can't break some blocks, can't pick up items, upon quiting to main menu the saving world message stays on seemingly indefinetly (waited around 10 minutes each time, then I just killed javaw task). I'm pretty sure the issue is only caused by this mod because I tested with turning this mod off and it worked. I provided two log files because I killed the minecraft task after reloading and quitting, so some info might have been lost there.
noreload_latest.log
reload_latest.log

Event hasPhase doesn't appear to work

[10:16:23] [REI-ReloadPlugins/ERROR]: Error occurred while handling event 'rei.hide.items': TypeError: Cannot call method "hasPhase" of undefined (client_scripts:script.js#11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.