Skip to content

Commit

Permalink
[Port] Update to b1.4_01 (v2.5.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
CDAGaming committed Nov 26, 2024
1 parent f0e915e commit fef13e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import io.github.cdagaming.unicore.utils.FileUtils;
import io.github.cdagaming.unicore.utils.MappingUtils;
import io.github.cdagaming.unicore.utils.StringUtils;
import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.MobSpawnerBase;
import unilib.external.io.github.classgraph.ClassInfo;

import java.util.List;
Expand Down Expand Up @@ -91,7 +91,7 @@ public class BiomeUtils implements ExtendedModule {
/**
* The Player's Current Biome, if any
*/
private BiomeGenBase CURRENT_BIOME;
private MobSpawnerBase CURRENT_BIOME;

@Override
public void clearFieldData() {
Expand All @@ -114,7 +114,7 @@ public void clearAttributes() {

@Override
public void updateData() {
final BiomeGenBase newBiome = CraftPresence.world.getWorldChunkManager().func_4073_a((int) CraftPresence.player.posX, (int) CraftPresence.player.posZ);
final MobSpawnerBase newBiome = CraftPresence.world.getWorldChunkManager().func_4073_a((int) CraftPresence.player.posX, (int) CraftPresence.player.posZ);
final String newBiomeName = newBiome.biomeName;

final String newBiomeIdentifier = StringUtils.getOrDefault(newBiomeName, MappingUtils.getClassName(newBiome));
Expand Down Expand Up @@ -183,17 +183,17 @@ public void updatePresence() {
*
* @return The detected Biome Types found
*/
private List<BiomeGenBase> getBiomeTypes() {
List<BiomeGenBase> biomeTypes = StringUtils.newArrayList();
private List<MobSpawnerBase> getBiomeTypes() {
List<MobSpawnerBase> biomeTypes = StringUtils.newArrayList();

if (biomeTypes.isEmpty()) {
// Fallback: Use Manual Class Lookup
for (ClassInfo classInfo : FileUtils.getClassNamesMatchingSuperType(BiomeGenBase.class).values()) {
for (ClassInfo classInfo : FileUtils.getClassNamesMatchingSuperType(MobSpawnerBase.class).values()) {
if (classInfo != null) {
try {
Class<?> classObj = FileUtils.loadClass(classInfo.getName());
if (classObj != null) {
BiomeGenBase biomeObj = (BiomeGenBase) classObj.getDeclaredConstructor().newInstance();
MobSpawnerBase biomeObj = (MobSpawnerBase) classObj.getDeclaredConstructor().newInstance();
if (!biomeTypes.contains(biomeObj)) {
biomeTypes.add(biomeObj);
}
Expand All @@ -210,7 +210,7 @@ private List<BiomeGenBase> getBiomeTypes() {

@Override
public void getInternalData() {
for (BiomeGenBase biome : getBiomeTypes()) {
for (MobSpawnerBase biome : getBiomeTypes()) {
if (biome != null) {
String biomeName = StringUtils.getOrDefault(biome.biomeName, MappingUtils.getClassName(biome));
String name = StringUtils.formatIdentifier(biomeName, true, !CraftPresence.CONFIG.advancedSettings.formatWords);
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ enabled_platforms=fabric,modloader
isLegacy=true
isJarMod=true
# Mapping Info
mc_mappings=3.1-b1.5_01
mc_mappings=3.0-b1.4_01
mc_mappings_type=mcp
mc_version=b1.5_01
mc_protocol=11
mc_version=b1.4_01
mc_protocol=10
display_version=
# Fabric Info
fabric_loader_version=0.16.9
fabric_api_version=
fabric_game_version_range=*
fabric_loader_version_range=>=0.13.0
# Forge Info
forge_version=b1.5_01+build.4
forge_version=b1.4_01
fml_version_range=
forge_game_version_range=b1.5_01
forge_game_version_range=b1.4_01
forge_loader_version_range=
# Deployment Info
versionId=2.5.2
Expand Down

0 comments on commit fef13e9

Please sign in to comment.