Skip to content

Commit

Permalink
1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
valoeghese committed Apr 30, 2021
1 parent fc63d53 commit 371e390
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ org.gradle.jvmargs=-Xmx1G
loader_version=5ce86c8

# Mod Properties
mod_version = 1.0.5
mod_version = 1.0.6
maven_group = io.github.minecraftcursedlegacy
archives_base_name = cursed-legacy-api
2 changes: 1 addition & 1 deletion legacy-terrain-v1/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
archivesBaseName = 'legacy-terrain-v1'
version = getSubprojectVersion(project, '1.0.5')
version = getSubprojectVersion(project, '1.0.6')

moduleDependencies(project, 'legacy-api-base')
dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public boolean isValidSpawnPos(int x, int z) {
}

/**
* @return the minimum y value at which the player can spawn naturally.
* @return the minimum y value of the block on which the player can spawn naturally.
* @since 1.0.5
*/
public int getMinSpawnY() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@
package io.github.minecraftcursedlegacy.mixin.terrain;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import io.github.minecraftcursedlegacy.api.terrain.ChunkGenerator;
import io.github.minecraftcursedlegacy.impl.terrain.InternalLevelSourceAccess;
Expand All @@ -45,4 +48,14 @@ public int alterMinY(int original) {

return original;
}

@Inject(at = @At("RETURN"), method = "computeSpawnPosition")
private void recomputeSpawnY(CallbackInfo info) {
Level self = (Level) (Object) this;
LevelSource cg = ((InternalLevelSourceAccess) self.dimension).getInternalLevelSource();

This comment has been minimized.

Copy link
@Chocohead

Chocohead Apr 30, 2021

Collaborator

Why not shadow dimension?


if (cg instanceof ChunkGenerator) {
self.getProperties().setSpawnY(((ChunkGenerator) cg).getMinSpawnY() + 1);
}
}
}

0 comments on commit 371e390

Please sign in to comment.