Skip to content

Commit

Permalink
Merge pull request #372 from paulevsGitch/1.18
Browse files Browse the repository at this point in the history
1.18
  • Loading branch information
paulevsGitch authored Dec 30, 2021
2 parents f6657f9 + 5bd0fc4 commit 417350d
Show file tree
Hide file tree
Showing 184 changed files with 3,647 additions and 2,634 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ output/
*.getBlock("log")
Convert.class
ModelPart.class
libs/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

# Better End

Better End Mod for Fabric, MC 1.17.1
Better End Mod for Fabric, MC 1.18

Importing:

* Clone repo
* Edit gradle.properties if necessary
* Run command line in folder: gradlew genSources eclipse (or Another-IDE-Name)
* Run command line in folder: gradlew genSources idea (or eclipse)
* Import project to IDE

Building:
Expand Down
18 changes: 13 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ buildscript {
plugins {
id 'idea'
id 'eclipse'
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
version = project.mod_version
Expand All @@ -25,15 +25,23 @@ repositories {
maven { url 'https://maven.blamejared.com' }
maven { url "https://maven.shedaniel.me/" }
maven { url 'https://jitpack.io' }
maven { url 'https://maven.terraformersmc.com/releases' }
flatDir {
dirs 'libs'
}
}

loom {
accessWidenerPath = file("src/main/resources/betterend.accesswidener")
}

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings minecraft.officialMojangMappings()
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

useApi "vazkii.patchouli:Patchouli:1.17-${project.patchouli_version}"
// useApi "vazkii.patchouli:Patchouli:1.17-${project.patchouli_version}"
println "Using local BCLib: ${local_bclib}"
if (local_bclib){
implementation( project(path:":BCLib", configuration: 'dev') )
Expand Down
18 changes: 11 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx2G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.17.1
yarn_mappings=6
loader_version=0.12.4
minecraft_version=1.18.1
fabric_version = 0.44.0+1.18
loader_version=0.12.12

#Loom
loom_version=0.10-SNAPSHOT

# Mod Properties
mod_version=0.12.5
mod_version=1.0.0
maven_group=ru.betterend
archives_base_name=better-end

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api

patchouli_version = 55-FABRIC-SNAPSHOT
fabric_version = 0.42.1+1.17
bclib_version = 0.5.4
rei_version = 6.0.264-alpha
bclib_version = 1.2.0
rei_version = 7.0.343
canvas_version = 1.0.+
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ pluginManagement {
// #### Custom Settings ####

//Change the next line to disable local BCLib loading
def allowLocalLibUse = false
def allowLocalLibUse = true

//When true, the local BCLib is also used in commandline builds
def allowLocalLibInConsoleMode = false
def allowLocalLibInConsoleMode = true

//The path were to look for the local BCLib
def BCLibPath = '../BCLib'
Expand Down
20 changes: 14 additions & 6 deletions src/main/java/ru/betterend/BetterEnd.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biomes;
import ru.bclib.api.WorldDataAPI;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.util.Logger;
import ru.betterend.api.BetterEndPlugin;
import ru.betterend.config.Configs;
Expand All @@ -28,13 +30,12 @@
import ru.betterend.util.LootTableUtil;
import ru.betterend.world.generator.GeneratorOptions;
import ru.betterend.world.generator.TerrainGenerator;
import ru.betterend.world.surface.SurfaceBuilders;

public class BetterEnd implements ModInitializer {
public static final String MOD_ID = "betterend";
public static final Logger LOGGER = new Logger(MOD_ID);
public static final boolean RUNS_FALL_FLYING_LIB = FabricLoader.getInstance().getModContainer("fallflyinglib").isPresent();

@Override
public void onInitialize() {
WorldDataAPI.registerModCache(MOD_ID);
Expand All @@ -43,7 +44,6 @@ public void onInitialize() {
EndBlockEntities.register();
EndFeatures.register();
EndEntities.register();
SurfaceBuilders.register();
EndBiomes.register();
EndTags.register();
EndEnchantments.register();
Expand All @@ -61,14 +61,22 @@ public void onInitialize() {
FabricLoader.getInstance().getEntrypoints("betterend", BetterEndPlugin.class).forEach(BetterEndPlugin::register);
Integrations.init();
Configs.saveConfigs();

if (GeneratorOptions.useNewGenerator()) {
ru.bclib.world.generator.GeneratorOptions.setFarEndBiomes(GeneratorOptions.getIslandDistBlock() > 250000L);
ru.bclib.world.generator.GeneratorOptions.setFarEndBiomes(GeneratorOptions.getIslandDistBlock());
ru.bclib.world.generator.GeneratorOptions.setEndLandFunction((pos) -> TerrainGenerator.isLand(pos.x, pos.y));
}

BiomeAPI.registerEndBiomeModification((biomeID, biome) -> {
if (!biomeID.equals(Biomes.THE_VOID.location())) {
EndStructures.addBiomeStructures(biomeID, biome);
EndFeatures.addBiomeFeatures(biomeID, biome);
}
});

}

public static ResourceLocation makeID(String path) {
return new ResourceLocation(MOD_ID, path);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,13 @@
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.Feature;
import ru.betterend.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures;

public class DragonTreeSaplingBlock extends PottableFeatureSapling {
public DragonTreeSaplingBlock() {
super();
}

@Override
@SuppressWarnings("deprecation")
protected Feature<?> getFeature() {
return EndFeatures.DRAGON_TREE.getFeature();
super((state)->EndFeatures.DRAGON_TREE.getFeature());
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ru/betterend/blocks/EndLotusStemBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public BlockState mirror(BlockState state, Mirror mirror) {
@SuppressWarnings("deprecation")
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
if (state.getValue(WATERLOGGED)) {
world.getLiquidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
}
return state;
}
Expand Down
20 changes: 8 additions & 12 deletions src/main/java/ru/betterend/blocks/EndPedestal.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package ru.betterend.blocks;

import com.google.common.collect.Maps;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import ru.betterend.BetterEnd;
import ru.betterend.blocks.basis.PedestalBlock;

import java.util.HashMap;
import java.util.Map;

public class EndPedestal extends PedestalBlock {
Expand All @@ -19,16 +19,12 @@ public EndPedestal(Block parent) {
protected Map<String, String> createTexturesMap() {
ResourceLocation blockId = Registry.BLOCK.getKey(parent);
String name = blockId.getPath();
return new HashMap<String, String>() {
private static final long serialVersionUID = 1L;

{
put("%mod%", BetterEnd.MOD_ID);
put("%top%", name + "_polished");
put("%base%", name + "_polished");
put("%pillar%", name + "_pillar_side");
put("%bottom%", name + "_polished");
}
};
Map<String, String> textures = Maps.newHashMap();
textures.put("%mod%", BetterEnd.MOD_ID);
textures.put("%top%", name + "_polished");
textures.put("%base%", name + "_polished");
textures.put("%pillar%", name + "_pillar_side");
textures.put("%bottom%", name + "_polished");
return textures;
}
}
9 changes: 3 additions & 6 deletions src/main/java/ru/betterend/blocks/HelixTreeSaplingBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.Feature;
import ru.betterend.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures;

public class HelixTreeSaplingBlock extends PottableFeatureSapling {
@Override
@SuppressWarnings("deprecation")
protected Feature<?> getFeature() {
return EndFeatures.HELIX_TREE.getFeature();
public HelixTreeSaplingBlock() {
super((state)->EndFeatures.HELIX_TREE.getFeature());
}

@Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
return world.getBlockState(pos.below()).is(EndBlocks.AMBER_MOSS);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public BlockState updateShape(BlockState state, Direction facing, BlockState nei
return Blocks.WATER.defaultBlockState();
}
else if (state.getValue(WATERLOGGED) && facing == Direction.UP && neighborState.is(Blocks.WATER)) {
world.getBlockTicks().scheduleTick(pos, this, 20);
world.scheduleTick(pos, this, 20);
}
return state;
}
Expand Down Expand Up @@ -118,7 +118,7 @@ public void tick(BlockState state, ServerLevel world, BlockPos pos, Random rando
BlockPos up = pos.above();
if (world.getBlockState(up).is(Blocks.WATER)) {
BlocksHelper.setWithoutUpdate(world, up, EndBlocks.VENT_BUBBLE_COLUMN);
world.getBlockTicks().scheduleTick(up, EndBlocks.VENT_BUBBLE_COLUMN, 5);
world.scheduleTick(up, EndBlocks.VENT_BUBBLE_COLUMN, 5);
}
}

Expand Down
9 changes: 1 addition & 8 deletions src/main/java/ru/betterend/blocks/LacugroveSaplingBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,13 @@
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.Feature;
import ru.betterend.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures;

public class LacugroveSaplingBlock extends PottableFeatureSapling {
public LacugroveSaplingBlock() {
super();
}

@Override
@SuppressWarnings("deprecation")
protected Feature<?> getFeature() {
return EndFeatures.LACUGROVE.getFeature();
super((state)->EndFeatures.LACUGROVE.getFeature());
}

@Override
Expand Down
11 changes: 2 additions & 9 deletions src/main/java/ru/betterend/blocks/LucerniaSaplingBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,15 @@
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.Feature;
import ru.betterend.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures;

public class LucerniaSaplingBlock extends PottableFeatureSapling {
public LucerniaSaplingBlock() {
super();
super((state)->EndFeatures.LUCERNIA.getFeature());
}

@Override
@SuppressWarnings("deprecation")
protected Feature<?> getFeature() {
return EndFeatures.LUCERNIA.getFeature();
}


@Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
return world.getBlockState(pos.below()).is(EndBlocks.RUTISCUS);
Expand Down
17 changes: 13 additions & 4 deletions src/main/java/ru/betterend/blocks/LumecornSeedBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,34 @@
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures;

import java.util.Optional;
import java.util.Random;

public class LumecornSeedBlock extends EndPlantWithAgeBlock {

@Override
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
EndFeatures.LUMECORN.getFeature().place(new FeaturePlaceContext<>(world, null, random, pos, null));
((Feature<NoneFeatureConfiguration>) (EndFeatures.LUMECORN.getFeature())).place(new FeaturePlaceContext<>(
Optional.empty(),
world,
null,
random,
pos,
(NoneFeatureConfiguration) null));
}

@Override
protected boolean isTerrain(BlockState state) {
return state.is(EndBlocks.END_MOSS);
}

@Override
public BlockBehaviour.OffsetType getOffsetType() {
return BlockBehaviour.OffsetType.NONE;
Expand Down
Loading

0 comments on commit 417350d

Please sign in to comment.