Migrate Carpet Mixin names to mojang mappings
This commit is contained in:
1 parent
2c3871b90e
commit
a547677597
154 files changed
+422
-501
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(Level.class)
|
||||
public class Level_scarpetPlopMixin
|
||||
{
|
||||
|
||||
@Redirect(method = "getHeight", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "net/minecraft/world/level/chunk/LevelChunk.getHeight(Lnet/minecraft/world/level/levelgen/Heightmap$Types;II)I"
|
||||
))
|
||||
private int fixSampleHeightmap(LevelChunk chunk, Heightmap.Types type, int x, int z)
|
||||
{
|
||||
if (CarpetSettings.skipGenerationChecks.get())
|
||||
{
|
||||
Heightmap.Types newType = type;
|
||||
if (type == Heightmap.Types.OCEAN_FLOOR_WG) newType = Heightmap.Types.OCEAN_FLOOR;
|
||||
else if (type == Heightmap.Types.WORLD_SURFACE_WG) newType = Heightmap.Types.WORLD_SURFACE;
|
||||
return chunk.getHeight(newType, x, z);
|
||||
}
|
||||
return chunk.getHeight(type, x, z);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user