Cleanup modcompat code, initial build setup for JEI support.

This commit is contained in:
modmuss50 2022-06-24 00:12:30 +01:00
parent 497c0134a6
commit abcac85d0e
30 changed files with 91 additions and 208 deletions

View file

@ -1,50 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2020 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.client.compat.dashloader;
import net.oskarstrom.dashloader.DashRegistry;
import net.oskarstrom.dashloader.api.annotation.DashConstructor;
import net.oskarstrom.dashloader.api.annotation.DashObject;
import net.oskarstrom.dashloader.api.enums.ConstructorMode;
import net.oskarstrom.dashloader.model.DashModel;
import techreborn.client.render.DynamicBucketBakedModel;
@DashObject(DynamicBucketBakedModel.class)
public class DashDynamicBucketBakedModel implements DashModel {
@DashConstructor(ConstructorMode.EMPTY)
public DashDynamicBucketBakedModel() {
}
@Override
public DynamicBucketBakedModel toUndash(DashRegistry registry) {
return new DynamicBucketBakedModel();
}
@Override
public int getStage() {
return 0;
}
}

View file

@ -1,50 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2020 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.client.compat.dashloader;
import net.oskarstrom.dashloader.DashRegistry;
import net.oskarstrom.dashloader.api.annotation.DashConstructor;
import net.oskarstrom.dashloader.api.annotation.DashObject;
import net.oskarstrom.dashloader.api.enums.ConstructorMode;
import net.oskarstrom.dashloader.model.DashModel;
import techreborn.client.render.DynamicCellBakedModel;
@DashObject(DynamicCellBakedModel.class)
public class DashDynamicCellBakedModel implements DashModel {
@DashConstructor(ConstructorMode.EMPTY)
public DashDynamicCellBakedModel() {
}
@Override
public DynamicCellBakedModel toUndash(DashRegistry registry) {
return new DynamicCellBakedModel();
}
@Override
public int getStage() {
return 0;
}
}

View file

@ -0,0 +1,5 @@
package techreborn.client.compat.jei;
public class TechRebornJEI {
// Hello o/
}

View file

@ -40,7 +40,6 @@ import reborncore.common.config.Configuration;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.Torus;
import techreborn.blockentity.GuiType;
import techreborn.compat.trinkets.Trinkets;
import techreborn.config.TechRebornConfig;
import techreborn.events.ApplyArmorToDamageHandler;
import techreborn.events.OreDepthSyncHandler;
@ -64,8 +63,6 @@ public class TechReborn implements ModInitializer {
new Identifier("techreborn", "item_group"),
() -> new ItemStack(TRContent.NUKE));
public static Predicate<PlayerEntity> elytraPredicate = playerEntity -> false;
@Override
public void onInitialize() {
INSTANCE = this;
@ -110,10 +107,6 @@ public class TechReborn implements ModInitializer {
ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.put(TRContent.Dusts.SAW.asItem(), 0.3F);
ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.put(TRContent.SmallDusts.SAW.asItem(), 0.1F);
if (FabricLoader.getInstance().isModLoaded("trinkets")) {
elytraPredicate = Trinkets.isElytraEquipped();
}
TechRebornTemplates.init();
LOGGER.info("TechReborn setup done!");

View file

@ -1,40 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2020 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.compat.trinkets;
import dev.emi.trinkets.api.TrinketsApi;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import java.util.function.Predicate;
public class Trinkets {
public static Predicate<PlayerEntity> isElytraEquipped() {
return playerEntity -> TrinketsApi.getTrinketComponent(playerEntity)
.map(component -> component.isEquipped(Items.ELYTRA))
.orElse(false);
}
}

View file

@ -97,7 +97,7 @@ public class QuantumSuitItem extends TRArmourItem implements ArmorBlockEntityTic
break;
case CHEST:
if (enableFlight){
if (getStoredEnergy(stack) > flyCost && !TechReborn.elytraPredicate.test(playerEntity)) {
if (getStoredEnergy(stack) > flyCost) {
playerEntity.getAbilities().allowFlying = true;
if (playerEntity.getAbilities().flying) {
tryUseEnergy(stack, flyCost);

View file

@ -30,7 +30,7 @@
]
},
"depends": {
"fabricloader": ">=0.14.6",
"fabricloader": ">=0.14.8",
"fabric": ">=0.55.1",
"reborncore": "*",
"team_reborn_energy": ">=2.2.0",