Skip to content

Commit

Permalink
Updated all dependencies, reenabled terrestria compat. Fixes #26
Browse files Browse the repository at this point in the history
  • Loading branch information
DaFuqs committed Oct 17, 2021
1 parent 3945776 commit c2bbcaf
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 32 deletions.
10 changes: 4 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ group = project.maven_group

repositories {
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/" }
maven { url "https://maven.kotlindiscord.com/repository/terraformers/" }
maven {
url = "http://maven.kyrptonaught.dev"
allowInsecureProtocol = true
Expand All @@ -24,21 +24,19 @@ dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
//modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}

modApi("com.terraformersmc:modmenu:${project["modmenu_version"]}")
modApi("com.terraformersmc:modmenu:${project.modmenu_version}")

// customportalapi
modImplementation "net.kyrptonaught:customportalapi:$project.custom_portal_api_version" // https://github.com/kyrptonaught/customportalapi
include "net.kyrptonaught:customportalapi:$project.custom_portal_api_version" // https://github.com/kyrptonaught/customportalapi

// terrestria, traverse
//modImplementation "com.terraformersmc.terraform-api:terraform-wood-api-v1:$project.terraform_wood_api_version"
//modImplementation "com.terraformersmc.terraform-api:terraform-tree-api-v1:$project.terraform_tree_api_version"
modImplementation "com.terraformersmc.terraform-api:terraform-wood-api-v1:$project.terraform_wood_api_version"
modImplementation "com.terraformersmc.terraform-api:terraform-tree-api-v1:$project.terraform_tree_api_version"
}

processResources {
Expand Down
17 changes: 8 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
org.gradle.jvmargs = -Xmx2G

# Fabric Properties
minecraft_version=1.17
yarn_mappings=1.17+build.13
loader_version=0.11.6
minecraft_version=1.17.1
yarn_mappings=1.17.1+build.61
loader_version=0.12.2

# Mod Properties
mod_version = 1.1.1-1.17.0
mod_version = 1.3.0-1.17.1
maven_group = de.dafuqs.starrysky
archives_base_name = starryskies

# Dependencies
fabric_version=0.36.0+1.17
# https://shedaniel.gitbook.io/cloth-config/setup-cloth-config/cloth-config-fabric
cloth_config_version=5.0.34
cloth_config_version=5.0.38
modmenu_version=2.0.2

terraform_tree_api_version=1.0.3
terraform_wood_api_version=1.0.2
custom_portal_api_version=0.0.1-beta37-1.17
terraform_tree_api_version=1.0.5
terraform_wood_api_version=1.0.5
custom_portal_api_version=0.0.1-beta45-1.17
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.PortalUtil;
import net.minecraft.world.BlockLocating;
import net.minecraft.world.TeleportTarget;
import net.minecraft.world.World;
import net.minecraft.world.border.WorldBorder;
Expand Down Expand Up @@ -108,7 +108,8 @@ public static TeleportTarget handleGetTeleportTarget(Entity thisEntity, ServerWo
Vec3d vec3d2;
if (blockState.contains(Properties.HORIZONTAL_AXIS)) {
axis2 = blockState.get(Properties.HORIZONTAL_AXIS);
PortalUtil.Rectangle rectangle = PortalUtil.getLargestRectangle(lastNetherPortalPosition, axis2, 21, Direction.Axis.Y, 21, (blockPos) -> {
net.minecraft.world.
BlockLocating.Rectangle rectangle = BlockLocating.getLargestRectangle(lastNetherPortalPosition, axis2, 21, Direction.Axis.Y, 21, (blockPos) -> {
return thisEntity.getEntityWorld().getBlockState(blockPos) == blockState;
});
vec3d2 = AreaHelper.entityPosInPortal(rectangle, axis2, thisEntity.getPos(), thisEntity.getDimensions(thisEntity.getPose()));
Expand All @@ -126,7 +127,7 @@ public static TeleportTarget handleGetTeleportTarget(Entity thisEntity, ServerWo
// no portal exists => generate one, if player
} else if(thisEntity instanceof ServerPlayerEntity) {
Direction.Axis axis = thisEntity.world.getBlockState(((EntityAccessor) thisEntity).getLastNetherPortalPosition()).getOrEmpty(NetherPortalBlock.AXIS).orElse(Direction.Axis.X);
Optional<PortalUtil.Rectangle> optional2 = destination.getPortalForcer().createPortal(blockPos3, axis);
Optional<BlockLocating.Rectangle> optional2 = destination.getPortalForcer().createPortal(blockPos3, axis);
if (optional2.isEmpty()) {
StarrySkyCommon.log(ERROR, "Unable to create a portal, likely target out of world border");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import de.dafuqs.starrysky.StarrySkyCommon;
import de.dafuqs.starrysky.dimension.biome.StarrySkyBiomeProvider;
import net.kyrptonaught.customportalapi.CustomPortalApiRegistry;
import net.kyrptonaught.customportalapi.util.PortalLink;
import net.minecraft.block.Block;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
Expand Down Expand Up @@ -32,7 +33,8 @@ public static void setupOverworldPortal() {
if(StarrySkyCommon.STARRY_SKY_CONFIG.portalToStarrySky) {
StarrySkyCommon.log(INFO, "Registering portal between the Overworld and Starry Sky...");
Block portalFrameBlock = Registry.BLOCK.get(new Identifier(StarrySkyCommon.STARRY_SKY_CONFIG.starrySkyPortalFrameBlock.toLowerCase()));
CustomPortalApiRegistry.addPortal(portalFrameBlock, STARRY_SKY_DIMENSION_ID, 11983869); // light, greyish blue
PortalLink starryPortalLink = new PortalLink(Registry.BLOCK.getId(portalFrameBlock), STARRY_SKY_DIMENSION_ID, 11983869); // light, greyish blue
CustomPortalApiRegistry.addPortal(portalFrameBlock, starryPortalLink);
} else {
StarrySkyCommon.log(INFO, "Portal between Overworld and Starry Sky is disabled in the config. Will not be registered.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void setup(SpheroidLoader spheroidLoader) {
SpheroidListVanillaNether.LAVA_STONE_MAGMA.addDecorator(GEYSER_DECORATOR, 0.25F);

// RAINBOW QUARTZ GLASS
ArrayList<BlockState> QUARTZ_GLASSES = new ArrayList<BlockState>() {{
ArrayList<BlockState> QUARTZ_GLASSES = new ArrayList<>() {{
add(getDefaultBlockState(MOD_ID, "quartz_glass_white"));
add(getDefaultBlockState(MOD_ID, "quartz_glass_light_gray"));
add(getDefaultBlockState(MOD_ID, "quartz_glass_gray"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
package de.dafuqs.starrysky.dimension.spheroid.lists;

import com.terraformersmc.terraform.leaves.block.ExtendedLeavesBlock;
import com.terraformersmc.terraform.wood.block.SmallLogBlock;
import de.dafuqs.starrysky.StarrySkyCommon;
import de.dafuqs.starrysky.dimension.SpheroidDistributionType;
import de.dafuqs.starrysky.dimension.SpheroidLoader;
import de.dafuqs.starrysky.dimension.decorators.SingleBlockDecorator;
import de.dafuqs.starrysky.dimension.spheroid.types.LiquidSpheroidType;
import de.dafuqs.starrysky.dimension.spheroid.types.ModularSpheroidType;
import de.dafuqs.starrysky.dimension.spheroid.types.ShellSpheroidType;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.LeavesBlock;

import static de.dafuqs.starrysky.dimension.SpheroidLoader.SpheroidDimensionType.OVERWORLD;
import static de.dafuqs.starrysky.dimension.spheroid.lists.SpheroidListVanilla.SpheroidDecorators.FERNS_DECORATOR;
import static org.apache.logging.log4j.Level.INFO;

public class SpheroidListTerrestria extends SpheroidList {
Expand All @@ -19,7 +31,7 @@ public static void setup(SpheroidLoader spheroidLoader) {
StarrySkyCommon.log(INFO, "Terrestria integration is currently disabled in 1.17...");

// TREES
/*BlockState terrestria_redwood_leaves = getDefaultBlockState(MOD_ID,"redwood_leaves").with(ExtendedLeavesBlock.DISTANCE, 1);
BlockState terrestria_redwood_leaves = getDefaultBlockState(MOD_ID,"redwood_leaves").with(ExtendedLeavesBlock.DISTANCE, 1);
BlockState terrestria_redwood_log = getDefaultBlockState(MOD_ID,"redwood_log");
BlockState terrestria_hemlock_leaves = getDefaultBlockState(MOD_ID,"hemlock_leaves").with(ExtendedLeavesBlock.DISTANCE, 1);
BlockState terrestria_hemlock_log = getDefaultBlockState(MOD_ID,"hemlock_log");
Expand Down Expand Up @@ -60,14 +72,14 @@ public static void setup(SpheroidLoader spheroidLoader) {
BlockState terrestria_aloe_vera = getDefaultBlockState(MOD_ID,"aloe_vera");
BlockState terrestria_dead_grass = getDefaultBlockState(MOD_ID,"dead_grass");

PlantDecorator terrestria_saguaro_cactus_decorator = new PlantDecorator(terrestria_saguaro_cactus, 0.1F); // TODO on top of sand
PlantDecorator terrestria_cattail_decorator = new PlantDecorator(terrestria_cattail, 0.1F); // TODO single block, in water
PlantDecorator terrestria_indian_paintbrush_decorator = new PlantDecorator(terrestria_indian_paintbrush, 0.1F);
PlantDecorator terrestria_monsteras_decorator = new PlantDecorator(terrestria_monsteras, 0.1F);
PlantDecorator terrestria_tiny_cactus_decorator = new PlantDecorator(terrestria_tiny_cactus, 0.04F);
PlantDecorator terrestria_agave_decorator = new PlantDecorator(terrestria_agave, 0.03F);
PlantDecorator terrestria_aloe_vera_decorator = new PlantDecorator(terrestria_aloe_vera, 0.02F);
PlantDecorator terrestria_dead_grass_decorator = new PlantDecorator(terrestria_dead_grass, 0.1F);
//SingleBlockDecorator terrestria_saguaro_cactus_decorator = new SingleBlockDecorator(terrestria_saguaro_cactus, 0.1F); // TODO on top of sand
//SingleBlockDecorator terrestria_cattail_decorator = new SingleBlockDecorator(terrestria_cattail, 0.1F); // TODO single block, in water
SingleBlockDecorator terrestria_indian_paintbrush_decorator = new SingleBlockDecorator(terrestria_indian_paintbrush, 0.1F);
SingleBlockDecorator terrestria_monsteras_decorator = new SingleBlockDecorator(terrestria_monsteras, 0.1F);
SingleBlockDecorator terrestria_tiny_cactus_decorator = new SingleBlockDecorator(terrestria_tiny_cactus, 0.04F);
SingleBlockDecorator terrestria_agave_decorator = new SingleBlockDecorator(terrestria_agave, 0.03F);
SingleBlockDecorator terrestria_aloe_vera_decorator = new SingleBlockDecorator(terrestria_aloe_vera, 0.02F);
SingleBlockDecorator terrestria_dead_grass_decorator = new SingleBlockDecorator(terrestria_dead_grass, 0.1F);

// WOOD
spheroidLoader.registerSpheroidType(OVERWORLD, SpheroidDistributionType.WOOD, 1.0F, new ShellSpheroidType(null, 7, 16, terrestria_redwood_log, terrestria_redwood_leaves, 2, 3));
Expand Down Expand Up @@ -101,7 +113,7 @@ public static void setup(SpheroidLoader spheroidLoader) {
// Add common blocks to maps
SpheroidList.MAP_STONES.put(terrestria_basalt, 0.4F);
SpheroidList.MAP_DUNGEON_STONES.put(terrestria_mossy_basalt_cobblestone, 1.0F);
SpheroidList.MAP_DUNGEON_STONES.put(terrestria_basalt_cobblestone, 0.5F);*/
SpheroidList.MAP_DUNGEON_STONES.put(terrestria_basalt_cobblestone, 0.5F);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@ public static void setup(SpheroidLoader spheroidLoader) {
spheroidLoader.registerSpheroidType(OVERWORLD, SpheroidDistributionType.WOOD, 0.7F, new ShellSpheroidType(null, 6, 12, Blocks.OAK_LOG.getDefaultState(), traverse_brown_autumnal_leaves, 2, 3));
spheroidLoader.registerSpheroidType(OVERWORLD, SpheroidDistributionType.WOOD, 0.7F, new ShellSpheroidType(null, 6, 12, Blocks.DARK_OAK_LOG.getDefaultState(), traverse_red_autumnal_leaves, 2, 3));
spheroidLoader.registerSpheroidType(OVERWORLD, SpheroidDistributionType.WOOD, 0.7F, new ShellSpheroidType(null, 6, 12, Blocks.BIRCH_LOG.getDefaultState(), traverse_yellow_autumnal_leaves, 2, 3));

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private void placeBrewingStand(WorldAccess worldAccess, BlockPos blockPos) {
ItemStack healingPotionStack = new ItemStack(Items.POTION, 1);
NbtCompound potionTag = new NbtCompound();
potionTag.putString("Potion", new Identifier("strong_healing").toString());
healingPotionStack.setTag(potionTag);
healingPotionStack.setNbt(potionTag);

if (blockEntity instanceof BrewingStandBlockEntity) {
((BrewingStandBlockEntity) blockEntity).setStack(0, healingPotionStack.copy());
Expand Down

0 comments on commit c2bbcaf

Please sign in to comment.