Skip to content

Commit

Permalink
Merge pull request #78 from Dragon-Seeker/1.18.2-backport
Browse files Browse the repository at this point in the history
[1.18.2] Final Backport of latest API Changes
  • Loading branch information
Dragon-Seeker committed Nov 1, 2022
2 parents 007089e + ce83f9e commit 6a7adb9
Show file tree
Hide file tree
Showing 88 changed files with 2,473 additions and 374 deletions.
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//file:noinspection GradlePackageVersionRange
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
id 'io.github.juuxel.loom-quiltflower-mini' version '1.2.1'
id 'io.github.juuxel.loom-quiltflower' version '1.7.1'
}

version = "${project.mod_version}+${project.minecraft_base_version}"
Expand Down Expand Up @@ -42,13 +43,13 @@ dependencies {
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}"
modLocalRuntime "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"

modLocalRuntime "dev.architectury:architectury-fabric:4.10.86"

modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"

modImplementation "io.wispforest:owo-lib:${project.owo_version}"
include "io.wispforest:owo-sentinel:${project.owo_version}"

modCompileOnly ("maven.modrinth:lithium:${project.lithium_version}")

modImplementation 'com.ptsmods:devlogin:1.2.1'
}

Expand Down
21 changes: 9 additions & 12 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://wispforest.io/versions
minecraft_base_version=1.18
# check these on https://fabricmc.net/develop
minecraft_base_version=1.18.2
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.1
loader_version=0.13.3
yarn_mappings=1.18.2+build.4
loader_version=0.14.10
# Mod Properties
mod_version=2.0.13
mod_version=2.0.16
maven_group=wraith
archives_base_name=wraith-alloy-forgery

# Dependencies
fabric_version=0.47.8+1.18.2
fabric_version=0.59.1+1.18.2

# https://maven.shedaniel.me/me/shedaniel/RoughlyEnoughItems-fabric/
rei_version=8.0.438
rei_version=8.3.561

# https://www.curseforge.com/minecraft/mc-mods/modmenu/files
modmenu_version=3.0.1
modmenu_version=3.1.1

# https://maven.wispforest.io/io/wispforest/owo-lib
owo_version=0.7.2+1.18

# https://modrinth.com/mod/lithium
lithium_version=mc1.18.2-0.7.9
owo_version=0.7.2-no-cme+1.18
4 changes: 0 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ pluginManagement {
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
maven {
name = 'Cotton'
url = 'https://server.bbkr.space/artifactory/libs-release/'
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,8 @@ public int getLavaProgress() {
public boolean canUse(PlayerEntity player) {
return this.controllerInventory.canPlayerUse(player);
}

public Inventory getControllerInventory(){
return this.controllerInventory;
}
}
25 changes: 18 additions & 7 deletions src/main/java/wraith/alloyforgery/AlloyForgery.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import io.wispforest.owo.particles.ClientParticles;
import io.wispforest.owo.particles.systems.ParticleSystem;
import io.wispforest.owo.particles.systems.ParticleSystemController;
import io.wispforest.owo.util.OwoFreezer;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage;
import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage;
import net.fabricmc.fabric.api.transfer.v1.item.ItemStorage;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.resource.ResourceType;
Expand All @@ -18,6 +20,7 @@
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.registry.Registry;
import wraith.alloyforgery.block.ForgeControllerBlockEntity;
import wraith.alloyforgery.data.AlloyForgeryGlobalRemaindersLoader;
import wraith.alloyforgery.forges.ForgeRegistry;
import wraith.alloyforgery.forges.FuelDataLoader;
import wraith.alloyforgery.recipe.AlloyForgeRecipe;
Expand All @@ -29,7 +32,7 @@ public class AlloyForgery implements ModInitializer {

public static final OwoItemGroup ALLOY_FORGERY_GROUP = new AlloyForgeryItemGroup(id("alloy_forgery"));

public static BlockEntityType<ForgeControllerBlockEntity> FORGE_CONTROLLER_BLOCK_ENTITY;
public static BlockEntityType<ForgeControllerBlockEntity> FORGE_CONTROLLER_BLOCK_ENTITY = ForgeControllerBlockEntity.Type.INSTANCE;
public static ScreenHandlerType<AlloyForgeScreenHandler> ALLOY_FORGE_SCREEN_HANDLER_TYPE;

private static final ParticleSystemController CONTROLLER = new ParticleSystemController(id("particles"));
Expand All @@ -46,23 +49,31 @@ public class AlloyForgery implements ModInitializer {
facing.getOffsetX() * 0.65);
});

@Override
@SuppressWarnings("UnstableApiUsage")
@Override
public void onInitialize() {
ALLOY_FORGE_SCREEN_HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(id("alloy_forge"), AlloyForgeScreenHandler::new);
ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(new AlloyForgeryGlobalRemaindersLoader());

ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(FuelDataLoader.INSTANCE);
ALLOY_FORGE_SCREEN_HANDLER_TYPE = Registry.register(Registry.SCREEN_HANDLER, id("alloy_forge"), new ScreenHandlerType<>(AlloyForgeScreenHandler::new));

ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(FuelDataLoader.INSTANCE);
ModDataLoader.load(ForgeRegistry.Loader.INSTANCE);
FORGE_CONTROLLER_BLOCK_ENTITY = ForgeControllerBlockEntity.Type.INSTANCE;

Registry.register(Registry.BLOCK_ENTITY_TYPE, id("forge_controller"), FORGE_CONTROLLER_BLOCK_ENTITY);
FluidStorage.SIDED.registerSelf(FORGE_CONTROLLER_BLOCK_ENTITY);

Registry.register(Registry.RECIPE_TYPE, AlloyForgeRecipe.Type.ID, AlloyForgeRecipe.Type.INSTANCE);
Registry.register(Registry.RECIPE_SERIALIZER, AlloyForgeRecipe.Type.ID, AlloyForgeRecipeSerializer.INSTANCE);

ALLOY_FORGERY_GROUP.initialize();

ItemStorage.SIDED.registerFallback((world, pos, state, blockEntity, context) -> {
if (context == Direction.DOWN && world.getBlockEntity(pos.up()) instanceof ForgeControllerBlockEntity froge)
return InventoryStorage.of(froge, Direction.DOWN);

return null;
});

OwoFreezer.registerFreezeCallback(() -> FluidStorage.SIDED.registerSelf(AlloyForgery.FORGE_CONTROLLER_BLOCK_ENTITY));
}

public static Identifier id(String path) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.DirectionProperty;
import net.minecraft.state.property.Properties;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Formatting;
Expand Down Expand Up @@ -58,6 +59,7 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt
controller.addFuel(fuelDefinition.fuel());
} else {
if (!controller.verifyMultiblock()) {

player.sendMessage(new TranslatableText("message.alloy_forgery.invalid_multiblock").formatted(Formatting.GRAY), true);
return ActionResult.SUCCESS;
}
Expand Down
Loading

0 comments on commit 6a7adb9

Please sign in to comment.