Skip to content

Commit

Permalink
full port
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyfaria committed Jun 14, 2022
1 parent 507519b commit 062abb0
Show file tree
Hide file tree
Showing 36 changed files with 165 additions and 159 deletions.
28 changes: 17 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ buildscript {
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}

repositories {
mavenLocal()
maven {
name 'LDTTeam - Modding'
url 'https://ldtteam.jfrog.io/ldtteam/modding/'
Expand All @@ -22,7 +23,7 @@ repositories {
url "https://www.cursemaven.com"
}
maven {
url "http://harleyoconnor.com/maven"
url "https://harleyoconnor.com/maven"
}
flatDir {
dirs("libs")
Expand All @@ -33,6 +34,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply from: 'https://raw.githubusercontent.com/SizableShrimp/Forge-Class-Remapper/main/classremapper.gradle'

ext.configFile = file "gradle.properties"
configFile.withReader {
Expand All @@ -45,7 +47,7 @@ version = "${config.mc_version}-${config.mod_version}"
group = config.package_group
archivesBaseName = config.mod_name

java.toolchain.languageVersion = JavaLanguageVersion.of(8)
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

minecraft {
mappings channel: 'official', version: config.mc_version
Expand Down Expand Up @@ -106,27 +108,31 @@ dependencies {
minecraft "net.minecraftforge:forge:${config.mc_version}-${config.forge_version}"

// Compile Hwyla API, but don't include in runtime.
compileOnly fg.deobf("mcp.mobius.waila:Hwyla:${config.hwyla_version}:api")
// compileOnly fg.deobf("mcp.mobius.waila:Hwyla:${config.hwyla_version}:api")
// At runtime, use the full Hwyla mod.
runtimeOnly fg.deobf("mcp.mobius.waila:Hwyla:${config.hwyla_version}")
// runtimeOnly fg.deobf("mcp.mobius.waila:Hwyla:${config.hwyla_version}")

// Compile JEI API, but don't include in runtime.
compileOnly fg.deobf("mezz.jei:jei-1.16.5:${config.jei_version}:api")
compileOnly fg.deobf("mezz.jei:jei-1.18.2:${config.jei_version}:api")
// At runtime, use the full JEI mod.
runtimeOnly fg.deobf("mezz.jei:jei-1.16.5:${config.jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-1.18.2:${config.jei_version}")

// Compile Dynamic Trees, of course.
implementation fg.deobf("com.ferreusveritas.dynamictrees:DynamicTrees-${config.mc_version}:${config.dynamic_trees_version}")
//implementation fg.deobf("blank:DynamicTrees-1.16.5:0.10.0-Beta17")
// Compile Dynamic Trees Plus
runtimeOnly fg.deobf("com.ferreusveritas.dynamictreesplus:DynamicTreesPlus-${config.mc_version}:${config.dynamic_trees_plus_version}")
// runtimeOnly fg.deobf("com.ferreusveritas.dynamictreesplus:DynamicTreesPlus-${config.mc_version}:${config.dynamic_trees_plus_version}")
implementation fg.deobf("curse.maven:dynamictrees-252818:3815249")

implementation fg.deobf("curse.maven:biomes-o-plenty-220318:3544153")
implementation fg.deobf("curse.maven:biomes-o-plenty-220318:3759236")
runtimeOnly(fg.deobf("curse.maven:terrablender-563928:3816497"))

runtimeOnly fg.deobf("curse.maven:cc-tweaked-282001:3236650")
runtimeOnly fg.deobf("curse.maven:cc-tweaked-282001:3825460")

// At runtime, use suggestion provider fix mod.
runtimeOnly fg.deobf("com.harleyoconnor.suggestionproviderfix:SuggestionProviderFix:${config.mc_version}-${config.suggestion_provider_fix_version}")
// runtimeOnly fg.deobf("com.harleyoconnor.suggestionproviderfix:SuggestionProviderFix:${config.mc_version}-${config.suggestion_provider_fix_version}")
runtimeOnly(fg.deobf("curse.maven:suggestionproviderfix-469647:3623382"))

}

jar {
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
mod_name=DynamicTreesBOP
mod_version=2.0.8
mod_version=3.0.0-ALPHA1
package_group=therealeststu.dtbop

mc_version=1.16.5
forge_version=36.2.22
mc_version=1.18.2
forge_version=40.1.51

dynamic_trees_version=0.10.0-Beta27-Pre5
dynamic_trees_plus_version=0.1.0-Beta11
dynamic_trees_version=0.11.0-Alpha2
dynamic_trees_plus_version=0.1.0-Alpha1
hwyla_version=1.10.11-B78_1.16.2
jei_version=7.7.1.139
jei_version=9.5.5.174
suggestion_provider_fix_version=1.0.0

org.gradle.jvmargs=-Xmx3G
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
14 changes: 7 additions & 7 deletions src/main/java/therealeststu/dtbop/DTBOPRegistries.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import com.ferreusveritas.dynamictrees.systems.genfeatures.BeeNestGenFeature;
import com.ferreusveritas.dynamictrees.systems.genfeatures.GenFeature;
import com.ferreusveritas.dynamictrees.trees.Species;
import net.minecraft.block.Block;
import net.minecraft.util.RegistryKey;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
Expand Down Expand Up @@ -100,8 +100,8 @@ public static void onBlocksRegistry(final RegistryEvent.Register<Block> event) {
if (rainbow_birch.isValid()){
rainbow_birch.addGenFeature(new BeeNestGenFeature(new ResourceLocation("dynamictrees","bee_nest"))
.with(BeeNestGenFeature.WORLD_GEN_CHANCE_FUNCTION, (world,pos)->{
RegistryKey<Biome> biomeKey = RegistryKey.create(Registry.BIOME_REGISTRY, Objects.requireNonNull(world.getUncachedNoiseBiome(pos.getX() >> 2, pos.getY() >> 2, pos.getZ() >> 2).getRegistryName()));
if (biomeKey == BOPBiomes.rainbow_hills)
ResourceKey<Biome> biomeKey = ResourceKey.create(Registry.BIOME_REGISTRY, Objects.requireNonNull(world.getUncachedNoiseBiome(pos.getX() >> 2, pos.getY() >> 2, pos.getZ() >> 2).value().getRegistryName()));
if (biomeKey == BOPBiomes.RAINBOW_HILLS)
return 0.02;
else return BiomeDictionary.hasType(biomeKey, BiomeDictionary.Type.FOREST) ? 0.0005 : 0.0;
}));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/therealeststu/dtbop/DynamicTreesBOP.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.GatherDataEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.forge.event.lifecycle.GatherDataEvent;

// The value here should match an entry in the META-INF/mods.toml file
@Mod(DynamicTreesBOP.MOD_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import com.ferreusveritas.dynamictrees.api.registry.TypedRegistry;
import com.ferreusveritas.dynamictrees.blocks.leaves.DynamicLeavesBlock;
import com.ferreusveritas.dynamictrees.blocks.leaves.LeavesProperties;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.entity.Entity;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.core.BlockPos;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.util.ForgeSoundType;

import javax.annotation.Nullable;
Expand All @@ -29,19 +29,20 @@ protected String getBlockRegistryNameSuffix() {
}

@Override
protected DynamicLeavesBlock createDynamicLeaves(AbstractBlock.Properties properties) {
protected DynamicLeavesBlock createDynamicLeaves(BlockBehaviour.Properties properties) {
return new DynamicLeavesBlock(this, properties){


@Override
public void fallOn(World world, BlockPos pos, Entity entity, float fallDistance) {}
public void fallOn(Level world,BlockState blockState, BlockPos pos, Entity entity, float fallDistance) {}

@Override
public void entityInside(BlockState state, World world, BlockPos pos, Entity entity) {
entity.makeStuckInBlock(state, new Vector3d(0.25D, 0.05F, 0.25D));
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
entity.makeStuckInBlock(state, new Vec3(0.25D, 0.05F, 0.25D));
}

@Override
public SoundType getSoundType(BlockState state, IWorldReader world, BlockPos pos, @Nullable Entity entity) {
public SoundType getSoundType(BlockState state, LevelReader world, BlockPos pos, @Nullable Entity entity) {
return new ForgeSoundType(1.0F, 1.0F, ()->SoundEvents.VINE_STEP, ()->SoundEvents.VINE_STEP, ()->SoundEvents.VINE_STEP, ()->SoundEvents.GRASS_HIT, ()->SoundEvents.VINE_STEP);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/therealeststu/dtbop/cells/DTBOPCellKits.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.ferreusveritas.dynamictrees.api.registry.Registry;
import com.ferreusveritas.dynamictrees.cells.*;
import com.ferreusveritas.dynamictrees.util.SimpleVoxmap;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.core.Direction;
import net.minecraft.resources.ResourceLocation;
import therealeststu.dtbop.DynamicTreesBOP;
import therealeststu.dtbop.cells.cell.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package therealeststu.dtbop.cells;

import com.ferreusveritas.dynamictrees.util.SimpleVoxmap;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.BlockPos;

public class DTBOPLeafClusters {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package therealeststu.dtbop.cells.cell;

import com.ferreusveritas.dynamictrees.api.cells.Cell;
import net.minecraft.util.Direction;
import net.minecraft.core.Direction;

public class EucalyptusTopBranchCell implements Cell {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package therealeststu.dtbop.cells.cell;

import com.ferreusveritas.dynamictrees.api.cells.Cell;
import net.minecraft.util.Direction;
import net.minecraft.core.Direction;

public class MahoganyBranchCell implements Cell {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package therealeststu.dtbop.cells.cell;

import com.ferreusveritas.dynamictrees.api.cells.Cell;
import net.minecraft.util.Direction;
import net.minecraft.core.Direction;

public class PoplarBranchCell implements Cell {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package therealeststu.dtbop.cells.cell;

import com.ferreusveritas.dynamictrees.api.cells.Cell;
import net.minecraft.util.Direction;
import net.minecraft.core.Direction;

public class PoplarTopBranchCell implements Cell {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package therealeststu.dtbop.cells.cell;

import com.ferreusveritas.dynamictrees.api.cells.Cell;
import net.minecraft.util.Direction;
import net.minecraft.core.Direction;

public class SparseBranchCell implements Cell {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.ferreusveritas.dynamictrees.api.registry.Registry;
import com.ferreusveritas.dynamictrees.systems.dropcreators.DropCreator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.resources.ResourceLocation;
import therealeststu.dtbop.DynamicTreesBOP;

public class DTBOPDropCreators {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import com.ferreusveritas.dynamictrees.systems.dropcreators.DropCreator;
import com.ferreusveritas.dynamictrees.systems.dropcreators.DropCreatorConfiguration;
import com.ferreusveritas.dynamictrees.systems.dropcreators.context.DropContext;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.resources.ResourceLocation;

public class StringDropCreator extends DropCreator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
import com.ferreusveritas.dynamictrees.trees.Species;
import com.ferreusveritas.dynamictrees.util.BlockBounds;
import com.ferreusveritas.dynamictrees.util.SafeChunkBounds;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.LeavesBlock;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.Level;

import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -59,7 +59,7 @@ protected boolean postGrow(GenFeatureConfiguration configuration, PostGrowContex
return false;
}

final World world = context.world();
final Level world = context.world();
final BlockPos rootPos = context.pos();
final Species species = context.species();

Expand All @@ -75,7 +75,7 @@ protected boolean postGrow(GenFeatureConfiguration configuration, PostGrowContex
return setAltLeaves(configuration, world, bounds, SafeChunkBounds.ANY, species);
}

private boolean setAltLeaves(GenFeatureConfiguration configuration, IWorld world, BlockBounds leafPositions,
private boolean setAltLeaves(GenFeatureConfiguration configuration, LevelAccessor world, BlockBounds leafPositions,
SafeChunkBounds safeBounds, Species species) {
boolean worldGen = safeBounds != SafeChunkBounds.ANY;

Expand Down Expand Up @@ -110,7 +110,7 @@ private boolean setAltLeaves(GenFeatureConfiguration configuration, IWorld world
}
}

private BlockState getSwapBlockState(GenFeatureConfiguration configuration, IWorld world, Species species,
private BlockState getSwapBlockState(GenFeatureConfiguration configuration, LevelAccessor world, Species species,
BlockState state, boolean worldgen) {
DynamicLeavesBlock originalLeaves = species.getLeavesBlock().orElse(null);
Block alt = configuration.get(ALT_LEAVES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.ferreusveritas.dynamictrees.api.registry.Registry;
import com.ferreusveritas.dynamictrees.systems.genfeatures.GenFeature;
import net.minecraft.util.ResourceLocation;
import net.minecraft.resources.ResourceLocation;
import therealeststu.dtbop.DynamicTreesBOP;

public class DTBOPGenFeatures {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import com.ferreusveritas.dynamictrees.systems.genfeatures.context.PostGenerationContext;
import com.ferreusveritas.dynamictrees.systems.genfeatures.context.PostGrowContext;
import com.ferreusveritas.dynamictrees.trees.Species;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld;
import net.minecraft.core.Direction;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelAccessor;

public class ExtraBottomFlareGenFeature extends GenFeature {

Expand Down Expand Up @@ -56,7 +56,7 @@ protected boolean postGenerate(GenFeatureConfiguration configuration, PostGenera
* @param world The world
* @param rootPos The position of the rooty dirt block of the tree
*/
public void flareBottom(GenFeatureConfiguration configuredGenFeature, IWorld world, BlockPos rootPos, Species species) {
public void flareBottom(GenFeatureConfiguration configuredGenFeature, LevelAccessor world, BlockPos rootPos, Species species) {
species.getFamily().getBranch().ifPresent(branch -> {
int radius4 = TreeHelper.getRadius(world, rootPos.above(4));
if (radius4 > configuredGenFeature.get(SECONDARY_MIN_RADIUS)) {
Expand Down
Loading

0 comments on commit 062abb0

Please sign in to comment.