Skip to content

Commit

Permalink
quentin452 fixes (#19)
Browse files Browse the repository at this point in the history
* Optimize worley algorythme + reduce tps lag caused by generation in nether

* Create fr_fr.lang

* BUMP VERSION

* apply plugin: maven-publish

fixes problems when using jitpack.io

* Increase performances during worldgen

- remove smooth chunks

-  reduce bottlenecks in plants/structures etc....

* remove makeBiomeArray multithreading

* fix crash when launching a world with this seed : 2465602432010453352

the issue was discovered in my modpack

crash report :

java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Cannot set property PropertyInteger{name=size, clazz=class java.lang.Integer, values=[0, 1, 2, 3]} to 6 on block betternether:orange_mushroom, it is not an allowed value
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at net.minecraft.util.Util.runTask(SourceFile:531)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1088)
    at net.minecraft.client.Minecraft.run(Minecraft.java:14614)
    at net.minecraft.client.main.Main.main(SourceFile:123)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at gg.essential.loader.stage2.relaunch.Relaunch.relaunch(Relaunch.java:124)
    at gg.essential.loader.stage2.EssentialLoader.doInitialize(EssentialLoader.java:367)
    at gg.essential.loader.stage2.EssentialLoaderBase.initialize(EssentialLoaderBase.java:761)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at gg.essential.loader.stage1.EssentialLoaderBase.initialize(EssentialLoaderBase.java:126)
    at gg.essential.loader.stage1.EssentialSetupTweaker.injectIntoClassLoader(EssentialSetupTweaker.java:59)
    at gg.essential.loader.stage0.EssentialSetupTweaker.injectIntoClassLoader(EssentialSetupTweaker.java:135)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:115)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.polymc.impl.OneSixLauncher.invokeMain(OneSixLauncher.java:104)
    at org.polymc.impl.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:176)
    at org.polymc.impl.OneSixLauncher.launch(OneSixLauncher.java:186)
    at org.polymc.EntryPoint.listen(EntryPoint.java:144)
    at org.polymc.EntryPoint.main(EntryPoint.java:74)
Caused by: java.lang.IllegalArgumentException: Cannot set property PropertyInteger{name=size, clazz=class java.lang.Integer, values=[0, 1, 2, 3]} to 6 on block betternether:orange_mushroom, it is not an allowed value
    at net.minecraft.block.state.BlockStateContainer$StateImplementation.withProperty(BlockStateContainer.java:227)
    at paulevs.betternether.blocks.BlockOrangeMushroom.getStateFromMeta(BlockOrangeMushroom.java:74)
    at net.minecraft.block.Block.getStateById(Block.java:2736)
    at net.minecraft.client.network.NetHandlerPlayClient.handleSpawnObject(NetHandlerPlayClient.java:437)
    at net.minecraft.network.play.server.SPacketSpawnObject.processPacket(SourceFile:124)
    at net.minecraft.network.play.server.SPacketSpawnObject.processPacket(SourceFile:13)
    at net.minecraft.network.PacketThreadUtil$1.redirect$zlk000$patcher$ignorePacketsFromClosedConnections(SourceFile:523)
    at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at net.minecraft.util.Util.runTask(SourceFile:529)
    ... 34 more

* fix #2

Fixed by changing entity name

* Make biomes more common + fix some small bugs

* Should fix #13 from official repo

#13

* fix missing translation  + fix #12 from official repo

#12

* Should fix #6 from official repo

#6

* should fix #4 from official repo

#4

* Some bug fix/hotfix/mistake fix

Fix Only 1 biome is generated around the world
readd smoothchunk , this function generate cities,,shoulrdn't be removed + optimize it
revert changes Make biomes more common
revert CityGenerator + BoundinBox + CityStructureManager changes to fix indexoutofbound

* Update build.gradle

* mini optimizations

* Quartz Stained Glass Pane names

* Update README.md

* Update README.md

* Bugfix + Enhancements

- MagmaFlower and BoneMushroom are now IGrowables (adds compat to RestrictedCrops mod)
- MagmaFlower now drops Magma Creams at the last growth stage

dupplicated :

michelegargiulo@0287cbb

* Fix compatibility with Restricted Crops

- Implemented Forge Hooks to check for proper CropGrow and SaplingGrow events

dupplicated :

michelegargiulo@77a9890

---------

Co-authored-by: jbredwards <[email protected]>
Co-authored-by: H <[email protected]>
  • Loading branch information
3 people authored Aug 4, 2024
1 parent c483115 commit a1565c6
Show file tree
Hide file tree
Showing 50 changed files with 1,465 additions and 886 deletions.
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
# BetterNether: RotN Edition
Tracker for BetterNether mod
# BetterNether Continuation

BetterNether Continuation is a commissioned fork of the BetterNether -Rotn edition which is a fork of Better nether for 1.12.2. We plan to continue supporting version 1.12.2 for some time.

More changes will follow in the future. Please make suggestions in our Discord server and make bug reports on our GitHub! Thank you!


# Links to descriptions of my projects.

[*Github*](https://github.com/quentin452/BetterNether-Continuation)

[*Curseforge*](https://legacy.curseforge.com/minecraft/mc-mods/better-nether-continuation)

# Changes from Rotn Edition

Contain changes from Better Nether Rotn Edition:

-Performance improvements (Worldgen noise optimization)

-Configurable city structures

-Configuration fixes and tweaks

-Add sounds to the firefly

-Crash fixes and other bug fixes

# Changes maked in the fork

Changes listed here : https://github.com/quentin452/BetterNether-Continuation/wiki

# Discord

Add me on discord :imacatfr

Discord server : https://discord.gg/ZnmHKJzKkZ
35 changes: 30 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url = "https://maven.minecraftforge.net" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.

apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'maven-publish'

version = "1.12.2-0.1.9.4"
version = "1.12.2-0.2.0.2"
group = "paulevs.betternether" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "BetterNetherRotN"

Expand All @@ -30,7 +30,7 @@ minecraft {
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20171003"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
makeObfSourceJar = false
}

repositories {
Expand Down Expand Up @@ -62,3 +62,28 @@ processResources {
exclude 'mcmod.info'
}
}

task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}

task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier = 'sources'
}

artifacts {
archives deobfJar
archives sourcesJar
}

publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact deobfJar
artifact sourcesJar
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,54 @@
import paulevs.betternether.blocks.BlockNetherCactus;
import paulevs.betternether.blocks.BlocksRegister;

public class NetherBiomeGravelDesert extends NetherBiome
{
public NetherBiomeGravelDesert(String name)
{
public class NetherBiomeGravelDesert extends NetherBiome {
public NetherBiomeGravelDesert(String name) {
super(name);
}

@Override
public void genSurfColumn(World world, BlockPos pos, Random random)
{
for (int i = 1; i < 1 + random.nextInt(3); i++)
{
BlockPos p2 = pos.down(i);
if (p2.getY() > -1 && world.getBlockState(p2).getBlock() == Blocks.NETHERRACK)
if (world.getBlockState(p2.down()).getBlock() == Blocks.AIR)
world.setBlockState(p2, Blocks.NETHERRACK.getDefaultState());
else
world.setBlockState(p2, Blocks.GRAVEL.getDefaultState());
public void genSurfColumn(World world, BlockPos pos, Random random) {
// Only generate gravel sparingly (20% of the time)
if (random.nextFloat() < 0.2f) {
int clusterSize = random.nextInt(5) + 5;
for (int i = 0; i < clusterSize; i++) {
// Only generate the gravel after a certain Y height (Y > 25)
if (pos.getY() > 25) {
BlockPos p2 = pos.down(i);
if (p2.getY() > -1 && world.getBlockState(p2).getBlock() == Blocks.NETHERRACK) {
if (world.getBlockState(p2.down()).getBlock() == Blocks.AIR) {
world.setBlockState(p2, Blocks.NETHERRACK.getDefaultState());
} else {
// Generate gravel in clusters
world.setBlockState(p2, Blocks.GRAVEL.getDefaultState());
}
}
}
}
}
if (world.getBlockState(pos).getBlock() == Blocks.NETHERRACK)
world.setBlockState(pos, Blocks.GRAVEL.getDefaultState());
}

@Override
public void genFloorObjects(World world, BlockPos pos, Random random)
{
if (random.nextFloat() <= plantDensity && world.getBlockState(pos).getBlock() == Blocks.GRAVEL && ((random.nextInt(16) == 0 || getFeatureNoise(pos) > 0.3)))
{
if (BlocksRegister.BLOCK_NETHER_CACTUS != Blocks.AIR && random.nextInt(8) == 0)
{
public void genFloorObjects(World world, BlockPos pos, Random random) {
if (random.nextFloat() <= plantDensity && world.getBlockState(pos).getBlock() == Blocks.GRAVEL && ((random.nextInt(16) == 0 || getFeatureNoise(pos) > 0.3))) {
if (BlocksRegister.BLOCK_NETHER_CACTUS != Blocks.AIR && random.nextInt(8) == 0) {
int h = 1 + random.nextInt(3);
for (int i = 1; i < h; i++)
if (world.getBlockState(pos.up(i)).getBlock() != Blocks.AIR)
{
for (int i = 1; i < h; i++) {
if (world.getBlockState(pos.up(i)).getBlock() != Blocks.AIR) {
h = i;
break;
}
for (int i = 1; i < h; i++)
}
for (int i = 1; i < h; i++) {
world.setBlockState(pos.up(i), BlocksRegister.BLOCK_NETHER_CACTUS.getDefaultState().withProperty(BlockNetherCactus.SHAPE, BlockNetherCactus.EnumShape.SIDE));
}
world.setBlockState(pos.up(h), BlocksRegister.BLOCK_NETHER_CACTUS.getDefaultState());
}
else if (random.nextInt(7) == 0)
{
if (BlocksRegister.BLOCK_BARREL_CACTUS != Blocks.AIR && random.nextBoolean())
} else if (random.nextInt(7) == 0) {
if (BlocksRegister.BLOCK_BARREL_CACTUS != Blocks.AIR && random.nextBoolean()) {
world.setBlockState(pos.up(), BlocksRegister.BLOCK_BARREL_CACTUS.getDefaultState());
else if (BlocksRegister.BLOCK_AGAVE != Blocks.AIR)
} else if (BlocksRegister.BLOCK_AGAVE != Blocks.AIR) {
world.setBlockState(pos.up(), BlocksRegister.BLOCK_AGAVE.getDefaultState());
}
}
}
}
Expand Down
80 changes: 36 additions & 44 deletions src/main/java/paulevs/betternether/biomes/NetherBoneReef.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package paulevs.betternether.biomes;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import net.minecraft.block.Block;
Expand All @@ -14,65 +16,55 @@
import paulevs.betternether.config.ConfigLoader;
import paulevs.betternether.structures.StructureNBT;

public class NetherBoneReef extends NetherGrasslands
{
private static StructureNBT[] bones = new StructureNBT[]{
new StructureNBT("bone_01"),
new StructureNBT("bone_02"),
new StructureNBT("bone_03")
};

public NetherBoneReef(String name)
{
public class NetherBoneReef extends NetherGrasslands {
private static final List<StructureNBT> bones = new ArrayList<>();

static {
bones.add(new StructureNBT("bone_01"));
bones.add(new StructureNBT("bone_02"));
bones.add(new StructureNBT("bone_03"));
}

public NetherBoneReef(String name) {
super(name);
}

public boolean isSub() {
return true;
}

public int getDefaultWeight() {
return 125;
}

@Override
public void genFloorObjects(World chunk, BlockPos pos, Random random)
{
Block ground = chunk.getBlockState(pos).getBlock();
if (random.nextFloat() <= plantDensity)
{
if (ConfigLoader.isGenTerrain(ground) || ground == Blocks.SOUL_SAND)
{
if (random.nextInt(20) == 0)
bones[random.nextInt(bones.length)].generateCentered(
chunk,
pos.down(random.nextInt(4)),
random
);
else if (BlocksRegister.BLOCK_NETHER_GRASS != Blocks.AIR && random.nextInt(4) != 0 && ConfigLoader.isTerrain(ground))
chunk.setBlockState(pos.up(), BlocksRegister.BLOCK_NETHER_GRASS.getDefaultState());
public void genFloorObjects(World world, BlockPos pos, Random random) {
Block ground = world.getBlockState(pos).getBlock();
if (random.nextFloat() <= plantDensity) {
if (ConfigLoader.isGenTerrain(ground) || ground == Blocks.SOUL_SAND) {
if (random.nextInt(20) == 0) {
StructureNBT structure = bones.get(random.nextInt(bones.size()));
structure.generateCentered(world, pos.down(random.nextInt(4)), random);
} else if (BlocksRegister.BLOCK_NETHER_GRASS != Blocks.AIR && random.nextInt(4) != 0 && ConfigLoader.isTerrain(ground)) {
world.setBlockState(pos.up(), BlocksRegister.BLOCK_NETHER_GRASS.getDefaultState());
}
} else if (ground instanceof BlockBone || ground instanceof BNBlockBone) {
if (BlocksRegister.BLOCK_BONE_MUSHROOM != Blocks.AIR && random.nextBoolean()) {
int age = random.nextInt(3);
world.setBlockState(pos.up(), BlocksRegister.BLOCK_BONE_MUSHROOM.getDefaultState().withProperty(BlockBoneMushroom.AGE, age));
}
}
else if (ground instanceof BlockBone || ground instanceof BNBlockBone)
if (BlocksRegister.BLOCK_BONE_MUSHROOM != Blocks.AIR && random.nextBoolean())
chunk.setBlockState(pos.up(), BlocksRegister
.BLOCK_BONE_MUSHROOM
.getDefaultState()
.withProperty(BlockBoneMushroom.AGE, random.nextInt(3)));
}
}

@Override
public void genWallObjects(World world, BlockPos origin, BlockPos pos, Random random)
{
public void genWallObjects(World world, BlockPos origin, BlockPos pos, Random random) {
if (random.nextFloat() <= plantDensity && BlocksRegister.BLOCK_BONE_MUSHROOM != Blocks.AIR && random.nextBoolean() &&
(world.getBlockState(origin).getBlock() == Blocks.BONE_BLOCK || world.getBlockState(origin).getBlock() == BlocksRegister.BLOCK_BONE))
{
(world.getBlockState(origin).getBlock() == Blocks.BONE_BLOCK || world.getBlockState(origin).getBlock() == BlocksRegister.BLOCK_BONE)) {
BlockPos dir = pos.subtract(origin);
EnumFacing facing = EnumFacing.getFacingFromVector(dir.getX(), dir.getY(), dir.getZ());
world.setBlockState(pos, BlocksRegister
.BLOCK_BONE_MUSHROOM
.getDefaultState()
.withProperty(BlockBoneMushroom.FACING, facing)
.withProperty(BlockBoneMushroom.AGE, random.nextInt(3)));
int age = random.nextInt(3);
world.setBlockState(pos, BlocksRegister.BLOCK_BONE_MUSHROOM.getDefaultState().withProperty(BlockBoneMushroom.FACING, facing).withProperty(BlockBoneMushroom.AGE, age));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public NetherMushroomForestEdge(String name)
public boolean isEdge() {
return true;
}

@Override
public void genFloorObjects(World world, BlockPos pos, Random random)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public NetherWartForestEdge(String name)
public boolean isEdge() {
return true;
}

@Override
public void genFloorObjects(World world, BlockPos pos, Random random)
{
Expand Down
21 changes: 12 additions & 9 deletions src/main/java/paulevs/betternether/blocks/BlockBlackAppleSeed.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import paulevs.betternether.BetterNether;
Expand Down Expand Up @@ -59,16 +60,18 @@ public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state)
}

@Override
public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random)
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random random)
{
if (!worldIn.isRemote)
{
super.updateTick(worldIn, pos, state, random);
if (!canPlaceBlockAt(worldIn, pos))
worldIn.destroyBlock(pos, true);
else if (random.nextInt(16) == 0 && canGrow(worldIn, pos, state, false))
grow(worldIn, random, pos, state);
}
if (worldIn.isRemote) return;

super.updateTick(worldIn, pos, state, random);
if (!canPlaceBlockAt(worldIn, pos))
worldIn.destroyBlock(pos, true);
else if (canGrow(worldIn, pos, state, false) && ForgeHooks.onCropsGrowPre(worldIn, pos, state, random.nextInt(16) == 0))
{
grow(worldIn, random, pos, state);
ForgeHooks.onCropsGrowPost(worldIn, pos, state, worldIn.getBlockState(pos));
}
}

@Override
Expand Down
Loading

0 comments on commit a1565c6

Please sign in to comment.