Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightenom committed Sep 22, 2024
1 parent 6b45a2c commit a065a4f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ javaVersion=21
useJavaToolChains=true

#The currently running forge.
forgeVersion=21.1.4
forgeVersion=21.1.31

fml_range=[4,)
forge_range=[21.0.143,)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.neoforged.neoforge.common.ModConfigSpec.RestartType;
import net.neoforged.neoforge.common.util.LogicalSidedProvider;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down
28 changes: 18 additions & 10 deletions src/main/java/com/ldtteam/common/fakelevel/FakeLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,15 @@ public FakeLevel(final SOURCE levelSource,
final boolean overrideBeLevel)
{
// we have to pass null in ctor, so realLevel can be used
super(new FakeLevelData(realLevel.getLevelData(),
lightProvider), null, realLevel.registryAccess(), realLevel.dimensionTypeRegistration(), null, true, false, 0, 0);
super(new FakeLevelData(realLevel.getLevelData(), lightProvider),
realLevel.dimension(),
realLevel.registryAccess(),
realLevel.dimensionTypeRegistration(),
realLevel.getProfilerSupplier(),
true,
false,
0,
0);
this.levelSource = levelSource;
this.lightProvider = lightProvider;
this.realLevel = realLevel;
Expand Down Expand Up @@ -214,53 +221,54 @@ public void setEntities(final Collection<? extends Entity> entities)
// ========================================
// ======= CTOR REAL LEVEL REDIRECTS ======
// ========================================
// Note: must have null check because super ctor

@Override
public ResourceKey<Level> dimension()
{
return realLevel().dimension();
return realLevel() != null ? realLevel().dimension() : super.dimension();
}

@Override
public RegistryAccess registryAccess()
{
return realLevel().registryAccess();
return realLevel() != null ? realLevel().registryAccess() : super.registryAccess();
}

@Override
public DamageSources damageSources()
{
return realLevel().damageSources();
return realLevel() != null ? realLevel().damageSources() : super.damageSources();
}

@Override
public ProfilerFiller getProfiler()
{
return realLevel().getProfiler();
return realLevel() != null ? realLevel().getProfiler() : super.getProfiler();
}

@Override
public Supplier<ProfilerFiller> getProfilerSupplier()
{
return realLevel().getProfilerSupplier();
return realLevel() != null ? realLevel().getProfilerSupplier() : super.getProfilerSupplier();
}

@Override
public DimensionType dimensionType()
{
return realLevel().dimensionType();
return realLevel() != null ? realLevel().dimensionType() : super.dimensionType();
}

@Override
public Holder<DimensionType> dimensionTypeRegistration()
{
return realLevel().dimensionTypeRegistration();
return realLevel() != null ? realLevel().dimensionTypeRegistration() : super.dimensionTypeRegistration();
}

@Override
public WorldBorder getWorldBorder()
{
return realLevel().getWorldBorder();
return realLevel() != null ? realLevel().getWorldBorder() : super.getWorldBorder();
}

// ========================================
Expand Down

0 comments on commit a065a4f

Please sign in to comment.