Skip to content

Commit

Permalink
[Change] 1.18.2 Port
Browse files Browse the repository at this point in the history
  • Loading branch information
CDAGaming committed Mar 13, 2022
1 parent 75f5dc2 commit 6c6a031
Show file tree
Hide file tree
Showing 65 changed files with 778 additions and 465 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Fixes
# Changes

- Resolved an incompatibility with Spectrum
- Optimized Image file sizes
- Ported to 1.18.2

# Advisory: 1.17 -> 1.18 World Migration

Expand Down
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
buildscript {
dependencies {
classpath "de.guntram.mcmod:crowdin-translate:${project.crowdin_translate_version}"
classpath "com.github.CDAGaming.CrowdinTranslate:crowdin-translate:${project.crowdin_translate_version}"
}
repositories {
maven {
name = 'CrowdinTranslate source'
url = "https://minecraft.guntram.de/maven/"
}
maven {
url = "https://jitpack.io"
}
}
}

Expand Down Expand Up @@ -90,11 +93,11 @@ dependencies {
// Libraries
modImplementation(include("com.jamieswhiteshirt:reach-entity-attributes:${project.entity_attributes_version}"))

modImplementation(include("de.guntram.mcmod:crowdin-translate:${project.crowdin_translate_version}"))
modImplementation(include("com.github.CDAGaming.CrowdinTranslate:crowdin-translate:${project.crowdin_translate_version}"))

modImplementation(include("io.github.onyxstudios.Cardinal-Components-API:cardinal-components-base:${project.cardinal_version}"))
modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cardinal_version}"))

modImplementation(include("io.github.onyxstudios.Cardinal-Components-API:cardinal-components-entity:${project.cardinal_version}"))
modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cardinal_version}"))

// Most important of the libraries :smug:
modImplementation(include("com.github.devs-immortal:Incubus-Core:${project.incubus_version}"))
Expand Down
26 changes: 13 additions & 13 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
org.gradle.jvmargs=-Xmx2G
max_errors=400
# Mod Properties
mod_version=1.6.5.3+1.18.1
mod_version=1.6.6+1.18.2
maven_group=com.aether
archives_base_name=paradise-lost
# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.18.1
mappings_version=1.18.1+build.22
loader_version=0.12.12
minecraft_version=1.18.2
mappings_version=1.18.2+build.1
loader_version=0.13.3
# Dependencies
# suppress inspection "UnusedProperty"
fabric_api_version=0.46.4+1.18
incubus_version=1.6.6-1.18.1
customportalapi_version=0.0.1-beta49-1.18
cardinal_version=4.0.1
trinkets_version=3.1.0
crowdin_translate_version=1.3+1.17
fabric_api_version=0.47.8+1.18.2
incubus_version=1.6.6-1.18.2
customportalapi_version=0.0.1-beta50-1.18
cardinal_version=4.1.3
trinkets_version=3.3.0
crowdin_translate_version=1.18.2
entity_attributes_version=2.1.1
modmenu_version=3.0.1
rei_version=7.2.409
moretags_version=2.0.2
modmenu_version=3.1.0
rei_version=8.0.442
moretags_version=3.0.0
recipeconfidence_version=1.0.2
customshaderlib_version=1.0.0
6 changes: 3 additions & 3 deletions src/main/java/net/id/aether/Aether.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
import net.id.aether.world.feature.AetherFeatures;
import net.id.aether.world.gen.carver.AetherCarvers;
import net.minecraft.util.Identifier;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Docs for Paradise Lost are sometimes written long after
Expand All @@ -61,7 +61,7 @@
*/
public class Aether implements ModInitializer, ClientModInitializer {
public static final String MOD_ID = "the_aether";
public static final Logger LOG = LogManager.getLogger(MOD_ID);
public static final Logger LOG = LoggerFactory.getLogger(MOD_ID);

/**
* Creates a new {@link Identifier} based on the passed location.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/id/aether/api/ConditionAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ConditionAPI {
public static List<Condition> getValidConditions(EntityType<?> type) {
return AetherRegistries.CONDITION_REGISTRY
.stream()
.filter(condition -> !condition.exempt.contains(type))
.filter(condition -> !type.isIn(condition.exempt))
.collect(Collectors.toList());
}

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/net/id/aether/api/FloatingBlockHelper.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.id.aether.api;

import net.gudenau.minecraft.moretags.MoreBlockTags;
import net.gudenau.minecraft.moretags.MoreTags;
import net.id.aether.entities.block.FloatingBlockEntity;
import net.id.aether.entities.util.FloatingBlockStructure;
Expand Down Expand Up @@ -339,7 +340,7 @@ private static boolean continueTree(World world, BlockPos pos, StructureBuilder
return false;
}
// sides and bottom (sticky blocks)
if (state.isIn(MoreTags.STICKY_BLOCKS)) {
if (state.isIn(MoreBlockTags.STICKY_BLOCKS)) {
// checks each of the sides
for (var newPos : new BlockPos[]{
pos.north(),
Expand All @@ -362,12 +363,12 @@ private static boolean continueTree(World world, BlockPos pos, StructureBuilder
}

private static boolean isAdjacentBlockStuck(BlockState state, BlockState adjacentState) {
if (state.isIn(MoreTags.HONEY_BLOCKS) && adjacentState.isIn(MoreTags.SLIME_BLOCKS)) {
if (state.isIn(MoreBlockTags.HONEY_BLOCKS) && adjacentState.isIn(MoreBlockTags.SLIME_BLOCKS)) {
return false;
} else if (state.isIn(MoreTags.SLIME_BLOCKS) && adjacentState.isIn(MoreTags.HONEY_BLOCKS)) {
} else if (state.isIn(MoreBlockTags.SLIME_BLOCKS) && adjacentState.isIn(MoreBlockTags.HONEY_BLOCKS)) {
return false;
} else {
return state.isIn(MoreTags.STICKY_BLOCKS) || adjacentState.isIn(MoreTags.STICKY_BLOCKS);
return state.isIn(MoreBlockTags.STICKY_BLOCKS) || adjacentState.isIn(MoreBlockTags.STICKY_BLOCKS);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void handleUse(PlayerEntity player, Hand hand, ItemStack handStack) {
ItemStack stored = inventory.get(0);
inventory.set(0, handStack);
player.setStackInHand(hand, stored);
hatchTicks = (int) (12000 / world.getBiome(pos).getTemperature());
hatchTicks = (int) (12000 / world.getBiome(pos).value().getTemperature());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.block.Fertilizable;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.ConfiguredFeature;
Expand Down Expand Up @@ -36,7 +37,7 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat
BlockPos blockPos = pos.up();
BlockState blockState = AetherBlocks.AETHER_GRASS.getDefaultState();
block0: for (int i = 0; i < 128; ++i) {
PlacedFeature placedFeature;
RegistryEntry<PlacedFeature> placedFeature;
BlockPos blockPos2 = blockPos;

for (int j = 0; j < i / 16; ++j) {
Expand All @@ -56,13 +57,13 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat

if (!blockState2.isAir()) continue;
if (random.nextInt(8) == 0) {
List<ConfiguredFeature<?, ?>> list = world.getBiome(blockPos2).getGenerationSettings().getFlowerFeatures();
List<ConfiguredFeature<?, ?>> list = world.getBiome(blockPos2).value().getGenerationSettings().getFlowerFeatures();
if (list.isEmpty()) continue;
placedFeature = ((RandomPatchFeatureConfig)list.get(0).getConfig()).feature().get();
placedFeature = ((RandomPatchFeatureConfig)list.get(0).config()).feature();
} else {
placedFeature = AetherVegetationPlacedFeatures.AETHER_GRASS_BONEMEAL;
}
placedFeature.generateUnregistered(world, world.getChunkManager().getChunkGenerator(), random, blockPos2);
placedFeature.value().generateUnregistered(world, world.getChunkManager().getChunkGenerator(), random, blockPos2);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.server.world.ServerWorld;
import net.minecraft.tag.BlockTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
Expand All @@ -19,7 +20,7 @@ public class AetherMushroomBlock extends MushroomPlantBlock {

private final HangType type;

public AetherMushroomBlock(Settings settings, Supplier<ConfiguredFeature<?, ?>> feature, HangType type) {
public AetherMushroomBlock(Settings settings, Supplier<RegistryEntry<? extends ConfiguredFeature<?, ?>>> feature, HangType type) {
super(settings, feature);
this.type = type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.block.Fertilizable;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.PlacedFeature;
Expand Down Expand Up @@ -34,7 +35,7 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat
BlockState blockState = AetherBlocks.FLUTEGRASS.getDefaultState();

block0: for (int i = 0; i < 128; ++i) {
PlacedFeature placedFeature;
RegistryEntry<PlacedFeature> placedFeature;
BlockPos blockPos2 = blockPos;

for (int j = 0; j < i / 16; ++j) {
Expand All @@ -54,7 +55,7 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat

if (!blockState2.isAir()) continue;
placedFeature = AetherVegetationPlacedFeatures.FLUTEGRASS_BONEMEAL;
placedFeature.generateUnregistered(world, world.getChunkManager().getChunkGenerator(), random, blockPos2);
placedFeature.value().generateUnregistered(world, world.getChunkManager().getChunkGenerator(), random, blockPos2);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.tag.BlockTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.world.BlockView;
import net.minecraft.world.WorldView;
import net.minecraft.world.gen.feature.ConfiguredFeature;
Expand All @@ -20,7 +21,7 @@ public class AetherWallMushroomBlock extends AetherMushroomBlock {

public static final DirectionProperty FACING = Properties.HORIZONTAL_FACING;

public AetherWallMushroomBlock(Settings settings, Supplier<ConfiguredFeature<?, ?>> feature) {
public AetherWallMushroomBlock(Settings settings, Supplier<RegistryEntry<? extends ConfiguredFeature<?, ?>>> feature) {
super(settings, feature, AetherMushroomBlock.HangType.WALL);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.block.TallPlantBlock;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.tag.Tag;
import net.minecraft.tag.TagKey;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;
Expand All @@ -16,14 +17,14 @@

public class AetherBrushBlock extends FernBlock {

private final Tag<Block> validFloors;
private final TagKey<Block> validFloors;
private final boolean override;

public AetherBrushBlock(Settings settings) {
this(settings, AetherBlockTags.GENERIC_VALID_GROUND, false);
}

public AetherBrushBlock(Settings settings, Tag<Block> validFloors, boolean override) {
public AetherBrushBlock(Settings settings, TagKey<Block> validFloors, boolean override) {
super(settings);
this.validFloors = validFloors;
this.override = override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@
import net.minecraft.block.BlockState;
import net.minecraft.block.TallPlantBlock;
import net.minecraft.tag.Tag;
import net.minecraft.tag.TagKey;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;

public class AetherTallBrushBlock extends TallPlantBlock {

private final Tag<Block> validFloors;
private final TagKey<Block> validFloors;
private final boolean override;

public AetherTallBrushBlock(Settings settings) {
this(settings, AetherBlockTags.GENERIC_VALID_GROUND, false);
}

public AetherTallBrushBlock(Settings settings, Tag<Block> validFloors, boolean override) {
public AetherTallBrushBlock(Settings settings, TagKey<Block> validFloors, boolean override) {
super(settings);
this.validFloors = validFloors;
this.override = override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.tag.BlockTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
Expand All @@ -26,7 +27,7 @@ public class CinnabarRoseBlock extends AetherMushroomBlock {

public static final BooleanProperty BLOOMING = BooleanProperty.of("blooming");

public CinnabarRoseBlock(Settings settings, Supplier<ConfiguredFeature<?, ?>> feature) {
public CinnabarRoseBlock(Settings settings, Supplier<RegistryEntry<? extends ConfiguredFeature<?, ?>>> feature) {
super(settings, feature, HangType.FLOOR);
setDefaultState(getDefaultState().with(BLOOMING, false));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.tag.Tag;
import net.minecraft.tag.TagKey;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.shape.VoxelShape;
Expand All @@ -24,7 +25,7 @@ public GroundcoverBlock(Settings settings, double slowdown) {
this.slowdown = slowdown;
}

public GroundcoverBlock(Settings settings, Tag<Block> validFloors, boolean override, double slowdown) {
public GroundcoverBlock(Settings settings, TagKey<Block> validFloors, boolean override, double slowdown) {
super(settings, validFloors, override);
this.slowdown = slowdown;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ public void tryFall(World world, BlockPos pos, BlockState state) {
if (state.getPistonBehavior().equals(PistonBehavior.BLOCK) || state.getBlock().getHardness() == -1F){
return;
}
FallingBlockEntity fallingBlockEntity = new FallingBlockEntity(world, (double)pos.getX() + 0.5D, (double)pos.getY(), (double)pos.getZ() + 0.5D, state);
world.spawnEntity(fallingBlockEntity);
FallingBlockEntity fallingBlockEntity = FallingBlockEntity.spawnFromBlock(world, pos, state);
this.configureFallingBlockEntity(fallingBlockEntity);

BlockPos.iterateOutwards(pos, 1, 0, 1).forEach(checkPos -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat
BlockPos.streamOutwards(pos, 3, 1, 3)
.filter(world::isAir)
.filter(temp -> {
var floor = world.getBlockState(temp).getBlock();
return floor instanceof LichenBlock || AetherBlockTags.LICHEN_SPREADABLES.contains(floor);
var floor = world.getBlockState(temp);
return floor.getBlock() instanceof LichenBlock || floor.isIn(AetherBlockTags.LICHEN_SPREADABLES);
})
.filter(temp -> random.nextInt(60) == 0)
.forEach(spreadPoint -> world.setBlockState(spreadPoint, getDefaultState()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.state.property.DirectionProperty;
import net.minecraft.state.property.Properties;
import net.minecraft.tag.Tag;
import net.minecraft.tag.TagKey;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
import net.minecraft.world.WorldView;
Expand All @@ -16,9 +17,9 @@
public class WallClingingPlantBlock extends PlantBlock {

public static final DirectionProperty FACING = Properties.HORIZONTAL_FACING;
private final @Nullable Tag<Block> clingableBlocks;
private final @Nullable TagKey<Block> clingableBlocks;

public WallClingingPlantBlock(Settings settings, @Nullable Tag<Block> clingableBlocks) {
public WallClingingPlantBlock(Settings settings, @Nullable TagKey<Block> clingableBlocks) {
super(settings);
this.clingableBlocks = clingableBlocks;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public LeafPileBlock(Settings settings) {
@Override
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
if (canFallThrough(world.getBlockState(pos.down()))) {
FallingBlockEntity fallingBlockEntity = new FallingBlockEntity(world, (double) pos.getX() + 0.5D, pos.getY(), (double) pos.getZ() + 0.5D, state);
world.spawnEntity(fallingBlockEntity);
FallingBlockEntity fallingBlockEntity = FallingBlockEntity.spawnFromBlock(world, pos, state);
this.configureFallingBlockEntity(fallingBlockEntity);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/id/aether/component/MoaGenes.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static MoaGenes get(@NotNull MoaEntity moa) {
public void initMoa(@NotNull MoaEntity moa) {
World world = moa.world;
Random random = moa.getRandom();
race = MoaAPI.getMoaForBiome(world.getBiomeKey(moa.getBlockPos()).get(), random);
race = MoaAPI.getMoaForBiome(world.getBiome(moa.getBlockPos()).getKey().get(), random);
affinity = race.defaultAffinity();

for (MoaAttributes attribute : MoaAttributes.values()) {
Expand Down
Loading

0 comments on commit 6c6a031

Please sign in to comment.