Rework forge to new a1.7 structure. Minecraft runs and it builds. But crash on loading into world due to... weirdness

This commit is contained in:
TomTheFurry
2022-07-25 19:44:11 +08:00
parent 973be40324
commit ff2763df9e
3 changed files with 15 additions and 5 deletions
@@ -50,7 +50,7 @@ public class BatchGenerator implements IChunkGenerator
public AbstractBatchGenerationEnvionmentWrapper generationGroup;
public ILevel targetLodLevel;
public static final int generationGroupSize = 4;
public static int previousThreadCount = Config.Client.Advanced.Threading.numberOfWorldGenerationThreads.get()<1 ? 1 : (int) Math.ceil(Config.Client.Advanced.Threading.numberOfWorldGenerationThreads.get());
public static int previousThreadCount = Config.Client.Advanced.Threading.getWorldGenerationThreadPoolSize();
private static final Logger LOGGER = DhLoggerBuilder.getLogger(MethodHandles.lookup().lookupClass().getSimpleName());
// private int estimatedSampleNeeded = 128;
@@ -669,7 +669,7 @@ public class Config
public static class Threading
{
public static ConfigEntry<Double> numberOfWorldGenerationThreads = new ConfigEntry.Builder<Double>()
public static final ConfigEntry<Double> numberOfWorldGenerationThreads = new ConfigEntry.Builder<Double>()
.setMinDefaultMax(0.1,
(double) Math.min(Runtime.getRuntime().availableProcessors()/2, 4),
(double) Runtime.getRuntime().availableProcessors())
@@ -692,8 +692,17 @@ public class Config
/** Returns the number of threads that can be used to generate terrain */
public static int getWorldGenerationThreadPoolSize()
{
return numberOfWorldGenerationThreads.get() < 1 ?
1 : (int) Math.ceil(numberOfWorldGenerationThreads.get());
Double objValue = numberOfWorldGenerationThreads.get();
double value = objValue;
//double value = numberOfWorldGenerationThreads.get();
if (value < 1.0)
{
return 1;
}
else
{
return (int) value;
}
}
/** Returns how often world generator threads should run as a number between 0.0 and 1.0 */
public static double getWorldGenerationPartialRunTime()
@@ -60,5 +60,6 @@ public class ModAccessorInjector extends DependencyInjector<IModAccessor>
super.bind(interfaceClass, modAccessor);
LOGGER.info("Registered mod compatibility accessor for: [" + modAccessor.getModName() + "].");
}
}