Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ported to Create 0.5.1e + Fixes #24

Open
wants to merge 4 commits into
base: 1.20
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ apply plugin: 'maven-publish'
apply plugin: 'org.spongepowered.mixin'
apply from: 'https://raw.githubusercontent.com/SizableShrimp/Forge-Class-Remapper/main/classremapper.gradle'

boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false');
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false')

ext.buildnumber = 0
project.buildnumber = System.getenv('BUILD_NUMBER') != null ? System.getenv('BUILD_NUMBER') : "custom"
Expand All @@ -35,7 +35,7 @@ archivesBaseName = 'balancedflight'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

minecraft {
mappings channel: 'parchment', version: "${parchment_version}"
mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

runs {
Expand Down Expand Up @@ -128,20 +128,16 @@ dependencies {
testCompileOnly 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'

compileOnly fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}")
implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}")

runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}")
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}:api")
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${curios_minecraft_version}:api")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${curios_minecraft_version}")

implementation fg.deobf("curse.maven:create-328085:4625534")
implementation fg.deobf("curse.maven:geckolib-388172:4407241")
implementation fg.deobf("com.jozufozu.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}")
implementation fg.deobf("curse.maven:geckolib-388172:4573048")
runtimeOnly fg.deobf("curse.maven:jei-238222:4609866")

// test mods
//runtimeOnly fg.deobf("curse.maven:rubidium-574856:4568727")
//runtimeOnly fg.deobf("curse.maven:oculus-581495:4578731")
runtimeOnly fg.deobf("curse.maven:jei-238222:4615177")
//runtimeOnly fg.deobf("curse.maven:itemzoom-261725:3903160")
implementation fg.deobf("com.simibubi.create:create-${create_minecraft_version}:${create_version}:slim") { transitive = false }
implementation fg.deobf("com.jozufozu.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}")

annotationProcessor 'org.spongepowered:mixin:0.8.3:processor'
}
Expand Down
31 changes: 17 additions & 14 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@
org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false

# mod version info
mod_version = 2.0.2
minecraft_version = 1.19.2
forge_version = 43.2.14
parchment_version = 2022.08.14-1.19.2

flywheel_minecraft_version = 1.19.2
flywheel_version = 0.6.9-18

# build dependency versions
github_project = viceversagames/BalancedFlight
mod_version = 2.1.0
forgegradle_version = 6.+
mixingradle_version = 0.7-SNAPSHOT
shadow_version = 7.0.0+
cursegradle_version = 1.4.0

# dependency versions
registrate_version = MC1.19.3-1.1.10
curios_version = 1.19.2-5.1.4.1
minecraft_version = 1.20.1
forge_version = 47.1.47
parchment_version = 2023.06.26
registrate_version = MC1.20-1.3.3

# mods
create_minecraft_version = 1.20.1
jei_minecraft_version = 1.20.1
curios_minecraft_version = 1.20.1
flywheel_minecraft_version = 1.20.1

create_version = 0.5.1.e-22
flywheel_version = 0.6.10-7
jei_version = 15.2.0.22
curios_version = 5.3.1

# github information
github_project = viceversagames/BalancedFlight

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"balancedflight.ponder.flight_anchor.header": "ǝɔɹoℲ ןɐuoıʇɐʇoᴚ ɥʇıʍ ʇɥbıןɟ pǝɹǝʍoԀ",
"balancedflight.ponder.flight_anchor.text_1": "˙ǝʇɐɹǝdo oʇ ɹǝʍod ɟo ʇunoɯɐ ǝsuǝɯɯı uɐ sǝɹınbǝɹ ɹoɥɔuɐ ʇɥbıןɟ ǝɥ⟘",
"balancedflight.ponder.flight_anchor.text_2": "˙ɹoɥɔuɐ ǝɥʇ punoɹɐ ʞɔoןq ǝuo ʎןɟ oʇ ǝןqɐ ǝq ןןıʍ noʎ 'WԀᴚ ɥɔɐǝ ɹoℲ",
"balancedflight.ponder.flight_anchor.text_3": "˙ɐǝɹɐ ǝɔɐɟɹns ɹǝɥbıɥ ɥɔnɯ ɐ ɹǝʌoɔ spǝǝds ɹǝɥbıH",
"balancedflight.ponder.tag.flight_anchor": "ɹoɥɔuⱯ ʇɥbıןℲ",
"balancedflight.ponder.tag.flight_anchor.description": "ǝɔɹoℲ ןɐuoıʇɐʇoᴚ ɥʇıʍ ʇɥbıןɟ pǝɹǝʍoԀ",
"block.balancedflight.flight_anchor": "ɹoɥɔuⱯ ʇɥbıןℲ",
"curios.identifier.flight_ring": "buıᴚ ʇɥbıןℲ",
"item.balancedflight.ascended_flight_ring": "buıᴚ ʇɥbıןℲ pǝpuǝɔsⱯ",
"itemGroup.balancedflight": "ʇɥbıןℲ pǝɔuɐןɐᗺ :ǝʇɐǝɹƆ",
"itemGroup.balancedflight.base": "ʇɥbıןℲ pǝɔuɐןɐᗺ :ǝʇɐǝɹƆ",
"tooltip.balancedflight.ascended_flight_ring": "˙ǝɹǝɥʍʎuɐ ʇɥbıןɟ sʍoןןɐ ʇı 'ʇǝʎ puɐ 'buıɹ uǝpןob ǝsuǝp ʎןqıpǝɹɔuı uⱯ",
"tooltip.balancedflight.flight_anchor": "˙pןɹoʍɹǝʌo ǝɥʇ uı sʞɹoʍ ʎןuO ˙snıpɐɹ ʞɔoןq ϛᄅ ɐ uı ʇɥbıןɟ sʍoןןⱯ"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"balancedflight.ponder.flight_anchor.header": "Powered flight with Rotational Force",
"balancedflight.ponder.flight_anchor.text_1": "The flight anchor requires an immense amount of power to operate.",
"balancedflight.ponder.flight_anchor.text_2": "For each RPM, you will be able to fly one block around the anchor.",
"balancedflight.ponder.flight_anchor.text_3": "Higher speeds cover a much higher surface area.",
"balancedflight.ponder.tag.flight_anchor": "Flight Anchor",
"balancedflight.ponder.tag.flight_anchor.description": "Powered flight with Rotational Force",
"block.balancedflight.flight_anchor": "Flight Anchor",
"curios.identifier.flight_ring": "Flight Ring",
"item.balancedflight.ascended_flight_ring": "Ascended Flight Ring",
"itemGroup.balancedflight": "Create: Balanced Flight",
"itemGroup.balancedflight.base": "Create: Balanced Flight",
"tooltip.balancedflight.ascended_flight_ring": "An incredibly dense golden ring, and yet, it allows flight anywhere.",
"tooltip.balancedflight.flight_anchor": "Allows flight in a 25 block radius. Only works in the overworld."
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
],
"rolls": 1.0
}
]
],
"random_sequence": "balancedflight:blocks/flight_anchor"
}
15 changes: 10 additions & 5 deletions src/main/java/com/vice/balancedflight/AllBlocks.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package com.vice.balancedflight;

import com.tterrag.registrate.util.entry.RegistryEntry;
import com.simibubi.create.AllCreativeModeTabs;
import com.tterrag.registrate.util.entry.BlockEntry;
import com.vice.balancedflight.content.flightAnchor.FlightAnchorBlock;
import net.minecraft.world.level.block.Block;

public class AllBlocks
{
public static final RegistryEntry<? extends Block> FLIGHT_ANCHOR = FlightAnchorBlock.REGISTRY_ENTRY;
public class AllBlocks {
static {
BalancedFlight.registrate().setCreativeTab(AllCreativeModeTabs.BASE_CREATIVE_TAB);
}

public static void init() { }
public static final BlockEntry<? extends Block> FLIGHT_ANCHOR = FlightAnchorBlock.REGISTRY_ENTRY;

public static void init() {
}
}
43 changes: 43 additions & 0 deletions src/main/java/com/vice/balancedflight/AllCreativeTabs.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.vice.balancedflight;

import com.simibubi.create.AllCreativeModeTabs;
import com.simibubi.create.Create;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;

import java.util.Iterator;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public class AllCreativeTabs
{
private static final DeferredRegister<CreativeModeTab> TAB_REGISTER =
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, BalancedFlight.MODID);

public static final RegistryObject<CreativeModeTab> CREATIVE_TAB = TAB_REGISTER.register("base",
() -> CreativeModeTab.builder()
.title(Component.translatable("itemGroup.balancedflight.base"))
.withTabsBefore(CreativeModeTabs.SPAWN_EGGS)
.icon(AllBlocks.FLIGHT_ANCHOR::asStack)
.displayItems(((pParameters, pOutput) -> {
for (var item : BalancedFlight.registrate().getAll(Registries.ITEM))
pOutput.accept(new ItemStack(item.get()));

for (var block : BalancedFlight.registrate().getAll(Registries.BLOCK))
pOutput.accept(new ItemStack(block.get()));
}))
.build());

public static void register(IEventBus modEventBus) {
TAB_REGISTER.register(modEventBus);
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/vice/balancedflight/AllGeckoRenderers.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import com.vice.balancedflight.content.flightAnchor.entity.FlightAnchorEntity;
import com.vice.balancedflight.content.flightAnchor.FlightAnchorItem;
import com.vice.balancedflight.foundation.render.ConfiguredAnimatedGeoModel;
import com.vice.balancedflight.foundation.render.ConfiguredGeoModel;
import com.vice.balancedflight.foundation.render.KineticGeckoRenderInfo;
import com.vice.balancedflight.content.flightAnchor.render.*;

public class AllGeckoRenderers
{
public static KineticGeckoRenderInfo<FlightAnchorEntity, ?> FlightAnchorGeckoRenderer =
new KineticGeckoRenderInfo<FlightAnchorEntity, FlightAnchorItem>(
new ConfiguredAnimatedGeoModel("flight_anchor"),
new ConfiguredGeoModel("flight_anchor"),
new FlightAnchorSafeRenderer(),
AllBlocks.FLIGHT_ANCHOR.get().defaultBlockState(),
new FlightAnchorBeamRenderer());
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/vice/balancedflight/AllItems.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package com.vice.balancedflight;

import com.simibubi.create.AllCreativeModeTabs;
import com.tterrag.registrate.util.entry.ItemEntry;
import com.tterrag.registrate.util.entry.RegistryEntry;
import com.vice.balancedflight.content.angelRing.FlightRing;
import net.minecraft.world.item.Item;

public class AllItems
{
public static final RegistryEntry<? extends Item> ASCENDED_FLIGHT_RING = FlightRing.ASCENDED;
static { BalancedFlight.registrate().setCreativeTab(AllCreativeModeTabs.BASE_CREATIVE_TAB); }

public static final ItemEntry<? extends Item> ASCENDED_FLIGHT_RING = FlightRing.ASCENDED;

public static void init() {}
}
30 changes: 30 additions & 0 deletions src/main/java/com/vice/balancedflight/AllPonderScenes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.vice.balancedflight;

import com.simibubi.create.foundation.ponder.PonderRegistrationHelper;
import com.simibubi.create.foundation.ponder.PonderRegistry;
import com.simibubi.create.foundation.ponder.PonderTag;
import com.vice.balancedflight.content.flightAnchor.FlightAnchorPonderScene;
import net.minecraft.resources.ResourceLocation;

public class AllPonderScenes
{
static final PonderRegistrationHelper HELPER = new PonderRegistrationHelper(BalancedFlight.MODID);

public static final PonderTag FLIGHT_ANCHOR_TAG = create("flight_anchor")
.item(AllBlocks.FLIGHT_ANCHOR.get())
.defaultLang("Flight Anchor", "Powered flight with Rotational Force")
.addToIndex();

public static void register() {

HELPER.forComponents(AllBlocks.FLIGHT_ANCHOR)
.addStoryBoard("flight_anchor", FlightAnchorPonderScene::ponderScene, FLIGHT_ANCHOR_TAG);

PonderRegistry.TAGS.forTag(FLIGHT_ANCHOR_TAG)
.add(AllBlocks.FLIGHT_ANCHOR);
}

private static PonderTag create(String id) {
return new PonderTag(new ResourceLocation(BalancedFlight.MODID, id));
}
}
31 changes: 22 additions & 9 deletions src/main/java/com/vice/balancedflight/BalancedFlight.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
package com.vice.balancedflight;

import com.simibubi.create.AllCreativeModeTabs;
import com.simibubi.create.Create;
import com.simibubi.create.CreateClient;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.item.ItemDescription;
import com.simibubi.create.foundation.item.KineticStats;
import com.simibubi.create.foundation.item.TooltipHelper;
import com.simibubi.create.foundation.item.TooltipModifier;
import com.simibubi.create.foundation.ponder.PonderLocalization;
import com.simibubi.create.infrastructure.ponder.AllPonderTags;
import com.simibubi.create.infrastructure.ponder.PonderIndex;
import com.tterrag.registrate.providers.ProviderType;
import com.vice.balancedflight.foundation.config.BalancedFlightConfig;
import com.vice.balancedflight.foundation.data.recipe.BalancedFlightRecipeGen;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.data.event.GatherDataEvent;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
Expand All @@ -31,15 +42,10 @@ public static CreateRegistrate registrate() {
return CREATE_REGISTRATE;
}

public static final CreativeModeTab CREATIVE_TAB = new CreativeModeTab(BalancedFlight.MODID) {
public @NotNull ItemStack makeIcon() {
return new ItemStack(AllBlocks.FLIGHT_ANCHOR.get());
}
};

public BalancedFlight() {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
//REGISTRATE.registerEventListeners(modEventBus);
IEventBus forgeEventBus = MinecraftForge.EVENT_BUS;

CREATE_REGISTRATE.registerEventListeners(modEventBus);

BalancedFlightConfig.init();
Expand All @@ -49,20 +55,27 @@ public BalancedFlight() {
AllBlockEntities.init();
AllItems.init();
AllLangMessages.init();
AllCreativeTabs.register(modEventBus);

modEventBus.addListener(EventPriority.LOWEST, BalancedFlight::gatherData);

DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> BalancedFlightClient.onCtorClient(modEventBus, forgeEventBus));
}

public static void gatherData(GatherDataEvent event) {
CREATE_REGISTRATE.addDataGenerator(ProviderType.LANG, prov -> {
prov.add(CREATIVE_TAB, "Create: Balanced Flight");
prov.add(AllCreativeTabs.CREATIVE_TAB.get(), "Create: Balanced Flight");
prov.add("curios.identifier.flight_ring", "Flight Ring");
});

DataGenerator gen = event.getGenerator();
PackOutput output = gen.getPackOutput();
if (event.includeServer()) {
gen.addProvider(true, new BalancedFlightRecipeGen(gen));
gen.addProvider(true, new BalancedFlightRecipeGen(output));
}

AllPonderScenes.register();
PonderLocalization.provideRegistrateLang(CREATE_REGISTRATE);
}

static {
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/vice/balancedflight/BalancedFlightClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.vice.balancedflight;

import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

public class BalancedFlightClient
{
public static void onCtorClient(IEventBus modEventBus, IEventBus forgeEventBus) {
modEventBus.addListener(BalancedFlightClient::clientInit);
}

public static void clientInit(FMLClientSetupEvent event) {
AllPonderScenes.register();
}
}
Loading