Skip to content

Commit

Permalink
Update Farmer's Respite compat
Browse files Browse the repository at this point in the history
  • Loading branch information
brnbrd committed Aug 15, 2024
1 parent f571f3e commit 2d1909c
Show file tree
Hide file tree
Showing 21 changed files with 316 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.20.1 2024-07-17T09:42:50.1869728 Languages: en_us
61f2488da9c2d0bd4c79826c201d0988e589ae21 assets/collectorsreap/lang/en_us.json
// 1.20.1 2024-08-08T16:31:48.7391044 Languages: en_us
3503d01507bf587c1ee9e665f3a36669221592a4 assets/collectorsreap/lang/en_us.json
2 changes: 2 additions & 0 deletions src/generated/resources/assets/collectorsreap/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"entity.collectorsreap.tiger_prawn": "Tiger Prawn",
"entity.collectorsreap.urchin": "Urchin",
"entity.collectorsreap.urchin_dart": "Urchin Dart",
"fluid_type.collectorsreap.lime_green_tea_type": "Lime Green Tea",
"fluid_type.collectorsreap.pomegranate_black_tea_type": "Pomegranate Black Tea",
"item.collectorsreap.adzuki_gummy": "Adzuki Gummy",
"item.collectorsreap.aloe_gummy": "Aloe Gummy",
"item.collectorsreap.apple_gummy": "Apple Gummy",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
package net.brdle.collectorsreap.common.fluid;

import net.brdle.collectorsreap.CollectorsReap;
import net.minecraft.world.level.material.FlowingFluid;
import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fluids.FluidType;
import net.minecraftforge.fluids.ForgeFlowingFluid;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

public class CRFluids {
public static final DeferredRegister<FluidType> FLUID_TYPES = DeferredRegister.create(ForgeRegistries.FLUID_TYPES.get(), CollectorsReap.MODID);

public static final DeferredRegister<Fluid> FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, CollectorsReap.MODID);
public static final DeferredRegister<FluidType> TYPES = DeferredRegister.create(ForgeRegistries.Keys.FLUID_TYPES, CollectorsReap.MODID);

public static final RegistryObject<FluidType> LIME_GREEN_TEA_TYPE = TYPES.register("lime_green_tea_type",
() -> new TeaFluidType(0xff95ac38));
public static final RegistryObject<FlowingFluid> LIME_GREEN_TEA = FLUIDS.register("lime_green_tea",
() -> new ForgeFlowingFluid.Source(CRFluids.LIME_GREEN_TEA_PROPERTIES));
public static final RegistryObject<FlowingFluid> FLOWING_LIME_GREEN_TEA = FLUIDS.register("flowing_lime_green_tea",
() -> new ForgeFlowingFluid.Flowing(CRFluids.LIME_GREEN_TEA_PROPERTIES));

public static final RegistryObject<FluidType> POMEGRANATE_BLACK_TEA_TYPE = TYPES.register("pomegranate_black_tea_type",
() -> new TeaFluidType(0xff900f2f));
public static final RegistryObject<FlowingFluid> POMEGRANATE_BLACK_TEA = FLUIDS.register("pomegranate_black_tea",
() -> new ForgeFlowingFluid.Source(CRFluids.POMEGRANATE_BLACK_TEA_PROPERTIES));
public static final RegistryObject<FlowingFluid> FLOWING_POMEGRANATE_BLACK_TEA = FLUIDS.register("flowing_pomegranate_black_tea",
() -> new ForgeFlowingFluid.Flowing(CRFluids.POMEGRANATE_BLACK_TEA_PROPERTIES));

public static final ForgeFlowingFluid.Properties LIME_GREEN_TEA_PROPERTIES = new ForgeFlowingFluid.Properties(LIME_GREEN_TEA_TYPE, LIME_GREEN_TEA, FLOWING_LIME_GREEN_TEA);
public static final ForgeFlowingFluid.Properties POMEGRANATE_BLACK_TEA_PROPERTIES = new ForgeFlowingFluid.Properties(POMEGRANATE_BLACK_TEA_TYPE, POMEGRANATE_BLACK_TEA, FLOWING_POMEGRANATE_BLACK_TEA);

public static void create(IEventBus bus) {
FLUIDS.register(bus);
TYPES.register(bus);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package net.brdle.collectorsreap.common.fluid;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions;
import net.minecraftforge.common.SoundActions;
import net.minecraftforge.fluids.FluidType;
import java.util.function.Consumer;

public class TeaFluidType extends FluidType {
private final int tint;

public TeaFluidType(int tint) {
super(Properties.create()
.sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL)
.sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY)
);
this.tint = tint;
}

@Override
public void initializeClient(Consumer<IClientFluidTypeExtensions> consumer) {
consumer.accept(new IClientFluidTypeExtensions() {
@Override
public int getTintColor() {
return tint;
}

@Override
public ResourceLocation getStillTexture() {
return new ResourceLocation("block/water_still");
}

@Override
public ResourceLocation getFlowingTexture() {
return new ResourceLocation("block/water_flow");
}
});
}
}
10 changes: 10 additions & 0 deletions src/main/java/net/brdle/collectorsreap/compat/JEIPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
import mezz.jei.api.IModPlugin;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.forge.ForgeTypes;
import mezz.jei.api.registration.IRecipeRegistration;
import net.brdle.collectorsreap.CollectorsReap;
import net.brdle.collectorsreap.Util;
import net.brdle.collectorsreap.common.config.CRConfig;
import net.brdle.collectorsreap.common.fluid.CRFluids;
import net.brdle.collectorsreap.common.item.CRItems;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.ModList;
import org.jetbrains.annotations.NotNull;
import javax.annotation.ParametersAreNonnullByDefault;
Expand All @@ -35,6 +38,13 @@ public void registerRecipes(IRecipeRegistration registration) {
}
registration.addItemStackInfo(Util.gs(CRItems.PORTOBELLO), Component.translatable("desc." + CollectorsReap.MODID + "." + Util.name(CRItems.PORTOBELLO)));

if (!ModList.get().isLoaded("farmersrespite")) {
registration.getIngredientManager().removeIngredientsAtRuntime(ForgeTypes.FLUID_STACK, List.of(
new FluidStack(CRFluids.LIME_GREEN_TEA.get(), 1000),
new FluidStack(CRFluids.POMEGRANATE_BLACK_TEA.get(), 1000)
));
}

// Lime
String limeTranslationKey = "desc." + CollectorsReap.MODID + "." + Util.name(CRItems.LIME);
List<ItemStack> limeStack = List.of(Util.gs(CRItems.LIME), Util.gs(CRItems.LIME_SLICE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ private void addEntities() {
}

private void addText() {
add("fluid_type." + CollectorsReap.MODID + ".lime_green_tea_type", "Lime Green Tea");
add("fluid_type." + CollectorsReap.MODID + ".pomegranate_black_tea_type", "Pomegranate Black Tea");
add("tooltip.requires_modid", "Requires modid:");
add("desc." + CollectorsReap.MODID + "." + Util.name(CRItems.PORTOBELLO), "Portobellos can be rarely found in meadows.");
add("desc." + CollectorsReap.MODID + "." + Util.name(CRItems.LIME), "Limes can be found as a wild bush in flower forests.");
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/brdle/collectorsreap/proxy/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.brdle.collectorsreap.common.block.CRBlocks;
import net.brdle.collectorsreap.common.effect.CREffects;
import net.brdle.collectorsreap.common.entity.CREntities;
import net.brdle.collectorsreap.common.fluid.CRFluids;
import net.brdle.collectorsreap.common.item.CRItems;
import net.brdle.collectorsreap.common.loot.CRLootItemConditions;
import net.brdle.collectorsreap.common.loot.CRLootModifiers;
Expand All @@ -23,6 +24,7 @@ public void start() {
modBus.register(new ModEvents());
modBus.register(new Generators());
CRBlocks.create(modBus);
CRFluids.create(modBus);
CRItems.create(modBus);
CREntities.create(modBus);
CRParticleTypes.create(modBus);
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/collectorsreap/lang/es_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"entity.collectorsreap.tiger_prawn": "Langostino Tigre",
"entity.collectorsreap.urchin": "Erizo de mar",
"entity.collectorsreap.urchin_dart": "Urchin Dart",
"fluid_type.collectorsreap.lime_green_tea_type": "Té verde con lima",
"fluid_type.collectorsreap.pomegranate_black_tea_type": "Té negro con granada",
"item.collectorsreap.adzuki_gummy": "Gominola de azukis",
"item.collectorsreap.aloe_gummy": "Gominola de áloe",
"item.collectorsreap.apple_gummy": "Gominola de manzana",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/collectorsreap/lang/es_mx.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"entity.collectorsreap.tiger_prawn": "Langostino Tigre",
"entity.collectorsreap.urchin": "Erizo de mar",
"entity.collectorsreap.urchin_dart": "Urchin Dart",
"fluid_type.collectorsreap.lime_green_tea_type": "Té verde con lima",
"fluid_type.collectorsreap.pomegranate_black_tea_type": "Té negro con granada",
"item.collectorsreap.adzuki_gummy": "Gomita de azukis",
"item.collectorsreap.aloe_gummy": "Gomita de áloe",
"item.collectorsreap.apple_gummy": "Gomita de manzana",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/collectorsreap/lang/ja_jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"entity.collectorsreap.tiger_prawn": "Tiger Prawn",
"entity.collectorsreap.urchin": "Urchin",
"entity.collectorsreap.urchin_dart": "Urchin Dart",
"fluid_type.collectorsreap.lime_green_tea_type": "Lime Green Tea",
"fluid_type.collectorsreap.pomegranate_black_tea_type": "Pomegranate Black Tea",
"item.collectorsreap.adzuki_gummy": "Adzuki Gummy",
"item.collectorsreap.aloe_gummy": "Aloe Gummy",
"item.collectorsreap.apple_gummy": "Apple Gummy",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/collectorsreap/lang/ko_kr.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"entity.collectorsreap.tiger_prawn": "Tiger Prawn",
"entity.collectorsreap.urchin": "Urchin",
"entity.collectorsreap.urchin_dart": "Urchin Dart",
"fluid_type.collectorsreap.lime_green_tea_type": "Lime Green Tea",
"fluid_type.collectorsreap.pomegranate_black_tea_type": "Pomegranate Black Tea",
"item.collectorsreap.adzuki_gummy": "Adzuki Gummy",
"item.collectorsreap.aloe_gummy": "Aloe Gummy",
"item.collectorsreap.apple_gummy": "Apple Gummy",
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/assets/collectorsreap/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
"entity.collectorsreap.platinum_bass": "Platinum Bass",
"entity.collectorsreap.tiger_prawn": "Tiger Prawn",
"entity.collectorsreap.urchin": "Urchin",
"entity.collectorsreap.urchin_dart": "Urchin Dart",
"fluid_type.collectorsreap.lime_green_tea_type": "Лаймовый зеленый чай",
"fluid_type.collectorsreap.pomegranate_black_tea_type": "Гранатовый черный чай",
"item.collectorsreap.adzuki_gummy": "Желе из адзуки",
"item.collectorsreap.aloe_gummy": "Желе из алоэ",
"item.collectorsreap.apple_gummy": "Желе из яблока",
Expand Down Expand Up @@ -186,6 +189,5 @@
"item.collectorsreap.vanilla_gummy": "Желе из ванили",
"item.collectorsreap.yellow_tea_gummy": "Желе из желтого чая",
"item.collectorsreap.yucca_gummy": "Желе из юкки",
"tooltip.requires_modid": "Необходима модификация:",
"entity.collectorsreap.urchin_dart": "Urchin Dart"
"tooltip.requires_modid": "Необходима модификация:"
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/collectorsreap/lang/uk_ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"entity.collectorsreap.tiger_prawn": "Tiger Prawn",
"entity.collectorsreap.urchin": "Urchin",
"entity.collectorsreap.urchin_dart": "Urchin Dart",
"fluid_type.collectorsreap.lime_green_tea_type": "Лаймовий зелений чай",
"fluid_type.collectorsreap.pomegranate_black_tea_type": "Гранатовий чорний чай",
"item.collectorsreap.adzuki_gummy": "Квасолева желейка",
"item.collectorsreap.aloe_gummy": "Желейка з алое",
"item.collectorsreap.apple_gummy": "Яблучна желейка",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/collectorsreap/lang/vi_vn.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"entity.collectorsreap.tiger_prawn": "Tôm Sú",
"entity.collectorsreap.urchin": "Nhím biển",
"entity.collectorsreap.urchin_dart": "Urchin Dart",
"fluid_type.collectorsreap.lime_green_tea_type": "Chanh trà xanh",
"fluid_type.collectorsreap.pomegranate_black_tea_type": "Trà Lựu Đen",
"item.collectorsreap.adzuki_gummy": "Kẹo Đậu Đỏ",
"item.collectorsreap.aloe_gummy": "Kẹo Nha đam",
"item.collectorsreap.apple_gummy": "Kẹo Táo",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/collectorsreap/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"entity.collectorsreap.tiger_prawn": "黑虎虾",
"entity.collectorsreap.urchin": "海胆",
"entity.collectorsreap.urchin_dart": "Urchin Dart",
"fluid_type.collectorsreap.lime_green_tea_type": "青柠绿茶",
"fluid_type.collectorsreap.pomegranate_black_tea_type": "石榴红茶",
"item.collectorsreap.adzuki_gummy": "红豆软糖",
"item.collectorsreap.aloe_gummy": "芦荟软糖",
"item.collectorsreap.apple_gummy": "苹果软糖",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"type": "collectorsreap:enabled",
"value": "lime_green_tea"
},
{
"type": "forge:mod_loaded",
"modid": "farmersrespite"
},
{
"type": "forge:not",
"value": {
"type": "forge:tag_empty",
"tag": "forge:tea_leaves/green"
}
},
{
"type": "forge:mod_loaded",
"modid": "farmersrespite"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"type": "collectorsreap:enabled",
"value": "pomegranate_black_tea"
},
{
"type": "forge:mod_loaded",
"modid": "farmersrespite"
},
{
"type": "forge:not",
"value": {
"type": "forge:tag_empty",
"tag": "forge:tea_leaves/black"
}
},
{
"type": "forge:mod_loaded",
"modid": "farmersrespite"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"type": "forge:conditional",
"recipes": [
{
"conditions": [
{
"type": "forge:and",
"values": [
{
"type": "collectorsreap:enabled",
"value": "lime_green_tea"
},
{
"type": "forge:not",
"value": {
"type": "forge:tag_empty",
"tag": "forge:tea_leaves/green"
}
},
{
"type": "forge:mod_loaded",
"modid": "farmersrespite"
},
{
"type": "forge:mod_loaded",
"modid": "create"
}
]
}
],
"recipe": {
"type": "create:emptying",
"ingredients": [
{
"item": "collectorsreap:lime_green_tea"
}
],
"results": [
{
"item": "minecraft:glass_bottle"
},
{
"amount": 250,
"fluid": "collectorsreap:lime_green_tea"
}
]
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"type": "forge:conditional",
"recipes": [
{
"conditions": [
{
"type": "forge:and",
"values": [
{
"type": "collectorsreap:enabled",
"value": "pomegranate_black_tea"
},
{
"type": "forge:not",
"value": {
"type": "forge:tag_empty",
"tag": "forge:tea_leaves/black"
}
},
{
"type": "forge:mod_loaded",
"modid": "farmersrespite"
},
{
"type": "forge:mod_loaded",
"modid": "create"
}
]
}
],
"recipe": {
"type": "create:emptying",
"ingredients": [
{
"item": "collectorsreap:pomegranate_black_tea"
}
],
"results": [
{
"item": "minecraft:glass_bottle"
},
{
"amount": 250,
"fluid": "collectorsreap:pomegranate_black_tea"
}
]
}
}
]
}
Loading

0 comments on commit 2d1909c

Please sign in to comment.