mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-27 17:28:34 +01:00
Compare commits
23 commits
97c7a96958
...
e125e80e8c
Author | SHA1 | Date | |
---|---|---|---|
|
e125e80e8c | ||
|
9f0a9926ac | ||
|
a85c67955c | ||
|
f9df9226bf | ||
|
edccaec7df | ||
|
3f49a259a1 | ||
|
7e0e86744c | ||
|
7658fdaa4f | ||
|
654465b39e | ||
|
d704c4a4ba | ||
|
79c8bcfbd9 | ||
|
0c8b52a76f | ||
|
822913f047 | ||
|
ccadf11e57 | ||
|
85725a0f85 | ||
|
c585fc993b | ||
|
96992eb8cd | ||
|
971fdd652f | ||
|
2f50f5ecfc | ||
|
bf4be2296a | ||
|
ca3f84efae | ||
|
06de7536df | ||
|
abbc1ae90c |
66 changed files with 1031 additions and 393 deletions
|
@ -84,6 +84,11 @@ dependencies {
|
|||
|
||||
runtimeOnly "mezz.jei:jei-${game_version}-neoforge:${jei_version}"
|
||||
|
||||
compileOnly "vazkii.patchouli:Patchouli:${patchouli_version}"
|
||||
runtimeOnly "vazkii.patchouli:Patchouli:${patchouli_version}"
|
||||
compileOnly "xyz.brassgoggledcoders:PatchouliProvider:${patchouli_provider_version}"
|
||||
runtimeOnly "xyz.brassgoggledcoders:PatchouliProvider:${patchouli_provider_version}"
|
||||
|
||||
runtimeOnly "curse.maven:the-one-probe-245211:5084077"
|
||||
runtimeOnly "curse.maven:mekanism-268560:5155329"
|
||||
}
|
||||
|
|
|
@ -15,3 +15,5 @@ neogradle.subsystems.parchment.mappingsVersion=2024.02.25
|
|||
|
||||
# Other mods
|
||||
jei_version=17.3.0.49
|
||||
patchouli_version=1.20.4-85-NEOFORGE-SNAPSHOT
|
||||
patchouli_provider_version=1.20.4-1.0.10-Snapshot.6
|
||||
|
|
2
port.MD
2
port.MD
|
@ -35,7 +35,7 @@
|
|||
- [ ] Add off-hand slots to energizer and enervator
|
||||
- [ ] Change the recipe of casings (the lava factory ones) to give only 4, and rename them to "Lava Factory Casing"
|
||||
- [x] Make coal generator create half as much CF, we don't want this to be a main power source for people( Flanks: already dropped to 20fe/t)
|
||||
- [ ] Make black quartz drop the items directly, unless silk-touched
|
||||
- [x] Make black quartz drop the items directly, unless silk-touched
|
||||
- [ ] Make storage crates work as follows, recipes unchanged:
|
||||
- [ ] Lowest tier can hold 8192 of a single item
|
||||
- [ ] Mid-tier can hold 16384 of two items
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// 1.20.4 2024-03-04T22:51:31.6064301 Block States: actuallyadditions
|
||||
// 1.20.4 2024-03-05T23:27:48.3961458 Block States: actuallyadditions
|
||||
23a6aa86c3f14e6a61fc8b17b65063f1995c8592 assets/actuallyadditions/blockstates/atomic_reconstructor.json
|
||||
88f479927d1abdf16e24a0950ccffa86b5af8b3f assets/actuallyadditions/blockstates/battery_box.json
|
||||
6ada5cb9e03ed162433bfc048712b6fc3937b420 assets/actuallyadditions/blockstates/bio_reactor.json
|
||||
5c96fc287e63f5bdd31864bdab698ce34817fd9d assets/actuallyadditions/blockstates/black_quartz_block.json
|
||||
f88640ab3aa81ae4a027948d94386c83dd488d3f assets/actuallyadditions/blockstates/black_quartz_brick_block.json
|
||||
76275adac938c575565d4aeb21b9994a7f561f88 assets/actuallyadditions/blockstates/black_quartz_brick_slab.json
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 1.20.4 2024-03-04T22:51:31.5994305 Loot Tables
|
||||
// 1.20.4 2024-03-05T17:10:52.5254064 Loot Tables
|
||||
f6655bb234dbcf1041fe8ad95c976ddddda2b02a data/actuallyadditions/loot_tables/blocks/atomic_reconstructor.json
|
||||
e15c868b26b669c30365bfb93e7d9274e07df16d data/actuallyadditions/loot_tables/blocks/battery_box.json
|
||||
745d64af3b0203a138f9eca7de21ed4988b35c95 data/actuallyadditions/loot_tables/blocks/bio_reactor.json
|
||||
|
@ -7,7 +7,7 @@ e15c868b26b669c30365bfb93e7d9274e07df16d data/actuallyadditions/loot_tables/bloc
|
|||
7ccaec2a308c46c91faaddf6c529e867a39a7b48 data/actuallyadditions/loot_tables/blocks/black_quartz_brick_slab.json
|
||||
1281fecab9def4da2bb659354623b91704f8663e data/actuallyadditions/loot_tables/blocks/black_quartz_brick_stair.json
|
||||
7d6c3fd126003b42e84c2159cf07b8c78ff1f729 data/actuallyadditions/loot_tables/blocks/black_quartz_brick_wall.json
|
||||
88e3daf6fc127c809adab583ebfc292dd6fd8142 data/actuallyadditions/loot_tables/blocks/black_quartz_ore.json
|
||||
fd391c2319606c9e6971f2dcda5eafd22ac12a82 data/actuallyadditions/loot_tables/blocks/black_quartz_ore.json
|
||||
ad0d7ffd625d3bec74e52e1384c67120649c1108 data/actuallyadditions/loot_tables/blocks/black_quartz_pillar_block.json
|
||||
c49b30e8d893f67866d0a47cf8682502468e9864 data/actuallyadditions/loot_tables/blocks/black_quartz_pillar_slab.json
|
||||
32fc64201d29c1a319808ac3bcef4fbab1ad2632 data/actuallyadditions/loot_tables/blocks/black_quartz_pillar_stair.json
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// 1.20.4 2024-03-04T22:51:31.610431 Item Models: actuallyadditions
|
||||
// 1.20.4 2024-03-05T23:33:24.583284 Item Models: actuallyadditions
|
||||
1966de13838437bc6035f3649976a44797cf5144 assets/actuallyadditions/models/item/advanced_coil.json
|
||||
24594fc68e66011dc2d7b79b92c94b387e710318 assets/actuallyadditions/models/item/advanced_leaf_blower.json
|
||||
ba2d814e269cdef72e1045f200b3c20ed6961517 assets/actuallyadditions/models/item/atomic_reconstructor.json
|
||||
|
@ -20,6 +20,7 @@ a41a81204caeddaaeaba35a5d1087361d7df5eae assets/actuallyadditions/models/item/bl
|
|||
c8974657e959db31495382cf6a86a3367df5d8c9 assets/actuallyadditions/models/item/black_quartz_slab.json
|
||||
74aaa894cd68cf64f8ad5aac0e7c0b26cdb0a021 assets/actuallyadditions/models/item/black_quartz_stair.json
|
||||
7e8476e561bd4854b54ce79cb798fd9b2915efb4 assets/actuallyadditions/models/item/black_quartz_wall.json
|
||||
a921bf283b5864b283ffff0737d8c3c89487dd08 assets/actuallyadditions/models/item/booklet.json
|
||||
8f1232a569a12d54b1053fae05dc85d23b28ed42 assets/actuallyadditions/models/item/breaker.json
|
||||
d376ad8923f1f63c1ed4429288b479cfbb235d44 assets/actuallyadditions/models/item/canola.json
|
||||
fa77f5b54168ff7c11c5ce9fbe342eb7298a9ec8 assets/actuallyadditions/models/item/canola_oil_bucket.json
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// 1.20.4 2024-03-06T00:00:49.130919 Patchouli Book Provider
|
||||
25f9d206f1f0397918f65634d57f658516f3c952 assets/actuallyadditions/patchouli_books/booklet/en_us/categories/getting_started.json
|
||||
88df6be8c958d5e89673e9eefcf73315d50bda9f assets/actuallyadditions/patchouli_books/booklet/en_us/entries/guide.json
|
||||
49e2d21f416f97f2e952ceb8e003e8497e926e03 assets/actuallyadditions/patchouli_books/booklet/en_us/entries/intro.json
|
||||
78d1f1a0d393feaf903c84d11ac2749d17779217 assets/actuallyadditions/patchouli_books/booklet/en_us/entries/tutorial.json
|
||||
10146f4dd5bab35ef00a724fab1f3762e5f7c2b9 data/actuallyadditions/patchouli_books/booklet/book.json
|
|
@ -0,0 +1,10 @@
|
|||
// 1.20.4 2024-03-05T21:12:08.3849935 Coffee Ingredient Recipes
|
||||
68a4a8ca4b24d8cc042c0a384069196f708a4dd9 data/actuallyadditions/recipes/coffee_ingredient/blaze_powder.json
|
||||
f18e6b3fee9f1610c0366feabc0dd3ffe2455224 data/actuallyadditions/recipes/coffee_ingredient/fermented_spider_eye.json
|
||||
5402f0078e820175f117c4c3b63907f29daa6209 data/actuallyadditions/recipes/coffee_ingredient/ghast_tear.json
|
||||
58f7831e3e547732cb9b0605334d21f45730b566 data/actuallyadditions/recipes/coffee_ingredient/golden_carrot.json
|
||||
708f899155df8a114e30f15e7e5940f75fb2a9e9 data/actuallyadditions/recipes/coffee_ingredient/magma_cream.json
|
||||
113a26d8cd82641cf612e39e4bf026f769e4597b data/actuallyadditions/recipes/coffee_ingredient/milk_bucket.json
|
||||
60fa6da54a062d5bbd2f25c09f00f833ea8ff2bf data/actuallyadditions/recipes/coffee_ingredient/milk_tagged.json
|
||||
228b27e7fb0ea183b8c34561ceb6b7b6a48fc0fe data/actuallyadditions/recipes/coffee_ingredient/pufferfish.json
|
||||
1f74a319b1677a66f1fc83ccc6c284dc51db88ef data/actuallyadditions/recipes/coffee_ingredient/sugar.json
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"variants": {
|
||||
"facing=east": {
|
||||
"model": "actuallyadditions:block/bio_reactor",
|
||||
"y": 90
|
||||
},
|
||||
"facing=north": {
|
||||
"model": "actuallyadditions:block/bio_reactor"
|
||||
},
|
||||
"facing=south": {
|
||||
"model": "actuallyadditions:block/bio_reactor",
|
||||
"y": 180
|
||||
},
|
||||
"facing=west": {
|
||||
"model": "actuallyadditions:block/bio_reactor",
|
||||
"y": 270
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "actuallyadditions:item/booklet"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"description": "",
|
||||
"icon": "actuallyadditions:booklet",
|
||||
"name": "booklet.actuallyadditions.indexEntry.getting_started"
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"category": "actuallyadditions:getting_started",
|
||||
"icon": "actuallyadditions:textures/item/youtube.png",
|
||||
"name": "booklet.actuallyadditions.chapter.video_guide",
|
||||
"pages": [
|
||||
{
|
||||
"type": "patchouli:link",
|
||||
"link_text": "booklet.actuallyadditions.chapter.video_guide.booty.button",
|
||||
"text": "booklet.actuallyadditions.chapter.video_guide.booty.text.1",
|
||||
"url": "https://www.youtube.com/watch?v=fhjz0Ew56pM"
|
||||
},
|
||||
{
|
||||
"type": "patchouli:text",
|
||||
"text": "booklet.actuallyadditions.chapter.video_guide.booty.text.2"
|
||||
},
|
||||
{
|
||||
"type": "patchouli:link",
|
||||
"link_text": "booklet.actuallyadditions.chapter.video_guide.booty.button",
|
||||
"text": "booklet.actuallyadditions.chapter.video_guide.dire.text.1",
|
||||
"url": "https://www.youtube.com/playlist?list=PLJeFZ64pT89MrTRZYzD_rtHFajPVlt6cF"
|
||||
},
|
||||
{
|
||||
"type": "patchouli:text",
|
||||
"text": "booklet.actuallyadditions.chapter.video_guide.dire.text.2"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"category": "actuallyadditions:getting_started",
|
||||
"icon": "actuallyadditions:booklet",
|
||||
"name": "booklet.actuallyadditions.chapter.intro",
|
||||
"pages": [
|
||||
{
|
||||
"type": "patchouli:text",
|
||||
"text": "booklet.actuallyadditions.chapter.intro.text.1"
|
||||
},
|
||||
{
|
||||
"type": "patchouli:text",
|
||||
"text": "booklet.actuallyadditions.chapter.intro.text.2"
|
||||
},
|
||||
{
|
||||
"type": "patchouli:text",
|
||||
"text": "booklet.actuallyadditions.chapter.intro.text.3"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"category": "actuallyadditions:getting_started",
|
||||
"icon": "actuallyadditions:booklet",
|
||||
"name": "booklet.actuallyadditions.chapter.book_tutorial",
|
||||
"pages": [
|
||||
{
|
||||
"type": "patchouli:text",
|
||||
"text": "booklet.actuallyadditions.chapter.book_tutorial.text.1"
|
||||
},
|
||||
{
|
||||
"type": "patchouli:text",
|
||||
"text": "booklet.actuallyadditions.chapter.book_tutorial.text.2"
|
||||
},
|
||||
{
|
||||
"type": "patchouli:text",
|
||||
"text": "booklet.actuallyadditions.chapter.book_tutorial.text.3"
|
||||
},
|
||||
{
|
||||
"type": "patchouli:crafting",
|
||||
"recipe": "actuallyadditions:booklet",
|
||||
"text": "booklet.actuallyadditions.shapeless_recipe",
|
||||
"title": ""
|
||||
}
|
||||
]
|
||||
}
|
|
@ -3,15 +3,44 @@
|
|||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:alternatives",
|
||||
"children": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:match_tool",
|
||||
"predicate": {
|
||||
"enchantments": [
|
||||
{
|
||||
"enchantment": "minecraft:silk_touch",
|
||||
"levels": {
|
||||
"min": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": "actuallyadditions:black_quartz_ore"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"functions": [
|
||||
{
|
||||
"enchantment": "minecraft:fortune",
|
||||
"formula": "minecraft:ore_drops",
|
||||
"function": "minecraft:apply_bonus"
|
||||
},
|
||||
{
|
||||
"function": "minecraft:explosion_decay"
|
||||
}
|
||||
],
|
||||
"name": "actuallyadditions:black_quartz"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"book_texture": "actuallyadditions:textures/gui/booklet/booklet.png",
|
||||
"creative_tab": "actuallyadditions.tab",
|
||||
"custom_book_item": "actuallyadditions:booklet",
|
||||
"dont_generate_book": true,
|
||||
"i18n": true,
|
||||
"landing_text": "<i>To be perfectly honest, I never actually realized how much content Actually Additions has before.<r><n> - Ellpeck",
|
||||
"macros": {
|
||||
"<i>": "$(o)",
|
||||
"<imp>": "$(2)",
|
||||
"<item>": "$(9)",
|
||||
"<n>": "$(br)",
|
||||
"<r>": "$()",
|
||||
"<tifisgrin>": "$(4)$(n)"
|
||||
},
|
||||
"name": "booklet.actuallyadditions.item.actuallyadditions.booklet",
|
||||
"show_progress": false,
|
||||
"use_blocky_font": false,
|
||||
"use_resource_pack": true,
|
||||
"version": "153"
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"type": "actuallyadditions:coffee_ingredient",
|
||||
"effects": [
|
||||
{
|
||||
"amplifier": 0,
|
||||
"duration": 15,
|
||||
"effect": "minecraft:strength"
|
||||
}
|
||||
],
|
||||
"ingredient": {
|
||||
"item": "minecraft:blaze_powder"
|
||||
},
|
||||
"maxAmplifier": 4
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"type": "actuallyadditions:coffee_ingredient",
|
||||
"effects": [
|
||||
{
|
||||
"amplifier": 0,
|
||||
"duration": 25,
|
||||
"effect": "minecraft:invisibility"
|
||||
}
|
||||
],
|
||||
"ingredient": {
|
||||
"item": "minecraft:fermented_spider_eye"
|
||||
},
|
||||
"maxAmplifier": 2
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"type": "actuallyadditions:coffee_ingredient",
|
||||
"effects": [
|
||||
{
|
||||
"amplifier": 0,
|
||||
"duration": 5,
|
||||
"effect": "minecraft:regeneration"
|
||||
}
|
||||
],
|
||||
"ingredient": {
|
||||
"item": "minecraft:ghast_tear"
|
||||
},
|
||||
"maxAmplifier": 3
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"type": "actuallyadditions:coffee_ingredient",
|
||||
"effects": [
|
||||
{
|
||||
"amplifier": 0,
|
||||
"duration": 30,
|
||||
"effect": "minecraft:night_vision"
|
||||
}
|
||||
],
|
||||
"ingredient": {
|
||||
"item": "minecraft:golden_carrot"
|
||||
},
|
||||
"maxAmplifier": 2
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"type": "actuallyadditions:coffee_ingredient",
|
||||
"effects": [
|
||||
{
|
||||
"amplifier": 0,
|
||||
"duration": 20,
|
||||
"effect": "minecraft:fire_resistance"
|
||||
}
|
||||
],
|
||||
"ingredient": {
|
||||
"item": "minecraft:magma_cream"
|
||||
},
|
||||
"maxAmplifier": 2
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"type": "actuallyadditions:coffee_ingredient",
|
||||
"extraText": "jei.actuallyadditions.coffee.extra.milk",
|
||||
"ingredient": {
|
||||
"item": "minecraft:milk_bucket"
|
||||
},
|
||||
"maxAmplifier": 0
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"neoforge:conditions": [
|
||||
{
|
||||
"type": "neoforge:not",
|
||||
"value": {
|
||||
"type": "neoforge:tag_empty",
|
||||
"tag": "forge:milk"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "actuallyadditions:coffee_ingredient",
|
||||
"extraText": "jei.actuallyadditions.coffee.extra.milk",
|
||||
"ingredient": {
|
||||
"tag": "forge:milk"
|
||||
},
|
||||
"maxAmplifier": 0
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"type": "actuallyadditions:coffee_ingredient",
|
||||
"effects": [
|
||||
{
|
||||
"amplifier": 0,
|
||||
"duration": 10,
|
||||
"effect": "minecraft:water_breathing"
|
||||
}
|
||||
],
|
||||
"ingredient": {
|
||||
"item": "minecraft:pufferfish"
|
||||
},
|
||||
"maxAmplifier": 2
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"type": "actuallyadditions:coffee_ingredient",
|
||||
"effects": [
|
||||
{
|
||||
"amplifier": 0,
|
||||
"duration": 30,
|
||||
"effect": "minecraft:speed"
|
||||
}
|
||||
],
|
||||
"ingredient": {
|
||||
"item": "minecraft:sugar"
|
||||
},
|
||||
"maxAmplifier": 4
|
||||
}
|
|
@ -21,6 +21,7 @@ import de.ellpeck.actuallyadditions.api.lens.LensConversion;
|
|||
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.WeightedOre;
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.ColorChangeRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.CrushingRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.EmpowererRecipe;
|
||||
|
@ -66,7 +67,7 @@ public final class ActuallyAdditionsAPI {
|
|||
* Farmer behaviors are sorted when first accessed, this will not be done until after loading, but do not add behaviors at runtime.
|
||||
*/
|
||||
public static final List<IFarmerBehavior> FARMER_BEHAVIORS = new ArrayList<>();
|
||||
public static final List<CoffeeIngredient> COFFEE_MACHINE_INGREDIENTS = new ArrayList<>();
|
||||
public static final List<RecipeHolder<CoffeeIngredientRecipe>> COFFEE_MACHINE_INGREDIENTS = new ArrayList<>();
|
||||
// public static final List<CompostRecipe> COMPOST_RECIPES = new ArrayList<>();
|
||||
public static final List<IBookletEntry> BOOKLET_ENTRIES = new ArrayList<>();
|
||||
//This is added to automatically, you don't need to add anything to this list
|
||||
|
@ -241,7 +242,7 @@ public final class ActuallyAdditionsAPI {
|
|||
* @param ingredient The ingredient to add
|
||||
*/
|
||||
public static void addCoffeeMachineIngredient(CoffeeIngredient ingredient) {
|
||||
COFFEE_MACHINE_INGREDIENTS.add(ingredient);
|
||||
// COFFEE_MACHINE_INGREDIENTS.add(ingredient);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package de.ellpeck.actuallyadditions.api.internal;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -25,8 +26,11 @@ import java.util.List;
|
|||
*/
|
||||
public interface IMethodHandler {
|
||||
|
||||
@Deprecated
|
||||
boolean addEffectToStack(ItemStack stack, CoffeeIngredient ingredient);
|
||||
|
||||
boolean addRecipeEffectToStack(ItemStack stack, CoffeeIngredientRecipe ingredient);
|
||||
|
||||
MobEffectInstance getSameEffectFromStack(ItemStack stack, MobEffectInstance effect);
|
||||
|
||||
void addEffectProperties(ItemStack stack, MobEffectInstance effect, boolean addDur, boolean addAmp);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package de.ellpeck.actuallyadditions.data;
|
||||
|
||||
import de.ellpeck.actuallyadditions.data.patchouli.PachouliGenerator;
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.gen.ActuallyBiomeModifiers;
|
||||
import de.ellpeck.actuallyadditions.mod.gen.ActuallyConfiguredFeatures;
|
||||
|
@ -57,9 +58,12 @@ public class ActuallyAdditionsData {
|
|||
generator.addProvider(true, new FuelRecipeGenerator(packOutput));
|
||||
generator.addProvider(true, new MiscMachineRecipeGenerator(packOutput));
|
||||
generator.addProvider(true, new MiningLensGenerator(packOutput));
|
||||
generator.addProvider(true, new CoffeeIngredientGenerator(packOutput));
|
||||
|
||||
generator.addProvider(true, new SoundsGenerator(packOutput, helper));
|
||||
|
||||
generator.addProvider(true, new PachouliGenerator(packOutput));
|
||||
|
||||
generator.addProvider(event.includeServer(), new DatapackBuiltinEntriesProvider(
|
||||
packOutput, patchedProvider, Set.of(ActuallyAdditions.MODID)));
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class BlockStateGenerator extends BlockStateProvider {
|
|||
|
||||
// Horizontal Directional Blocks
|
||||
horizontallyDirectionalBlock(ActuallyBlocks.FARMER);
|
||||
//horizontallyDirectionalBlock(ActuallyBlocks.BIOREACTOR);
|
||||
horizontallyDirectionalBlock(ActuallyBlocks.BIOREACTOR);
|
||||
horizontallyDirectionalBlock(ActuallyBlocks.VERTICAL_DIGGER);
|
||||
horizontallyDirectionalBlock(ActuallyBlocks.LEAF_GENERATOR);
|
||||
horizontallyDirectionalBlock(ActuallyBlocks.COFFEE_MACHINE);
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
package de.ellpeck.actuallyadditions.data;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe;
|
||||
import net.minecraft.core.NonNullList;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.data.recipes.RecipeOutput;
|
||||
import net.minecraft.data.recipes.RecipeProvider;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.neoforged.neoforge.common.conditions.NotCondition;
|
||||
import net.neoforged.neoforge.common.conditions.TagEmptyCondition;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CoffeeIngredientGenerator extends RecipeProvider {
|
||||
public CoffeeIngredientGenerator(PackOutput packOutput) {
|
||||
super(packOutput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Coffee Ingredient " + super.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildRecipes(@Nonnull RecipeOutput recipeOutput) {
|
||||
buildIngredient(recipeOutput, Items.MILK_BUCKET, 0, "jei." + ActuallyAdditions.MODID + ".coffee.extra.milk");
|
||||
|
||||
//Pam's puts milk in a tag, so we'll use that
|
||||
TagKey<Item> milkTag = ItemTags.create(new ResourceLocation("forge", "milk"));
|
||||
RecipeOutput tagOutput = recipeOutput.withConditions(new NotCondition(new TagEmptyCondition(milkTag.location())));
|
||||
buildIngredient(tagOutput, new ResourceLocation(ActuallyAdditions.MODID, "coffee_ingredient/milk_tagged"),
|
||||
Ingredient.of(milkTag), 0, "jei." + ActuallyAdditions.MODID + ".coffee.extra.milk");
|
||||
|
||||
buildIngredient(recipeOutput, Items.SUGAR, 4, new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 30, 0));
|
||||
buildIngredient(recipeOutput, Items.MAGMA_CREAM, 2, new MobEffectInstance(MobEffects.FIRE_RESISTANCE, 20, 0));
|
||||
buildIngredient(recipeOutput, Items.PUFFERFISH, 2, new MobEffectInstance(MobEffects.WATER_BREATHING, 10, 0));
|
||||
buildIngredient(recipeOutput, Items.GOLDEN_CARROT, 2, new MobEffectInstance(MobEffects.NIGHT_VISION, 30, 0));
|
||||
buildIngredient(recipeOutput, Items.GHAST_TEAR, 3, new MobEffectInstance(MobEffects.REGENERATION, 5, 0));
|
||||
buildIngredient(recipeOutput, Items.BLAZE_POWDER, 4, new MobEffectInstance(MobEffects.DAMAGE_BOOST, 15, 0));
|
||||
buildIngredient(recipeOutput, Items.FERMENTED_SPIDER_EYE, 2, new MobEffectInstance(MobEffects.INVISIBILITY, 25, 0));
|
||||
}
|
||||
|
||||
private void buildIngredient(RecipeOutput recipeOutput, ItemLike ingredient, int maxAmplifier, MobEffectInstance... effects) {
|
||||
buildIngredient(recipeOutput, ingredient, maxAmplifier, "", effects);
|
||||
}
|
||||
|
||||
private void buildIngredient(RecipeOutput recipeOutput, ItemLike ingredient, int maxAmplifier, String extraText, MobEffectInstance... effects) {
|
||||
ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "coffee_ingredient/" + getItemName(ingredient));
|
||||
NonNullList<CoffeeIngredientRecipe.EffectInstance> instances = NonNullList.create();
|
||||
for (MobEffectInstance effect : effects) {
|
||||
instances.add(new CoffeeIngredientRecipe.EffectInstance(effect));
|
||||
}
|
||||
CoffeeIngredientRecipe recipe = new CoffeeIngredientRecipe(Ingredient.of(ingredient), instances, maxAmplifier, extraText);
|
||||
recipeOutput.accept(id, recipe, null);
|
||||
}
|
||||
|
||||
private void buildIngredient(RecipeOutput recipeOutput, ResourceLocation id, Ingredient ingredient, int maxAmplifier, MobEffectInstance... effects) {
|
||||
buildIngredient(recipeOutput, id, ingredient, maxAmplifier, "", effects);
|
||||
}
|
||||
|
||||
private void buildIngredient(RecipeOutput recipeOutput, ResourceLocation id, Ingredient ingredient, int maxAmplifier, String extraText, MobEffectInstance... effects) {
|
||||
NonNullList<CoffeeIngredientRecipe.EffectInstance> instances = NonNullList.create();
|
||||
for (MobEffectInstance effect : effects) {
|
||||
instances.add(new CoffeeIngredientRecipe.EffectInstance(effect));
|
||||
}
|
||||
CoffeeIngredientRecipe recipe = new CoffeeIngredientRecipe(ingredient, instances, maxAmplifier, extraText);
|
||||
recipeOutput.accept(id, recipe, null);
|
||||
}
|
||||
}
|
|
@ -29,7 +29,7 @@ public class ItemModelGenerator extends ItemModelProvider {
|
|||
@Override
|
||||
protected void registerModels() {
|
||||
// Items
|
||||
//simpleItem(ActuallyItems.BOOKLET); // will require complex I think
|
||||
simpleItem(ActuallyItems.ITEM_BOOKLET); // will require complex I think
|
||||
|
||||
// All items?
|
||||
ActuallyItems.SIMPLE_ITEMS.forEach(this::simpleItem);
|
||||
|
|
|
@ -13,17 +13,21 @@ import net.minecraft.resources.ResourceLocation;
|
|||
import net.minecraft.world.flag.FeatureFlags;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.CropBlock;
|
||||
import net.minecraft.world.level.storage.loot.LootPool;
|
||||
import net.minecraft.world.level.storage.loot.LootTable;
|
||||
import net.minecraft.world.level.storage.loot.ValidationContext;
|
||||
import net.minecraft.world.level.storage.loot.entries.LootItem;
|
||||
import net.minecraft.world.level.storage.loot.functions.ApplyBonusCount;
|
||||
import net.minecraft.world.level.storage.loot.functions.CopyNbtFunction;
|
||||
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
||||
import net.minecraft.world.level.storage.loot.predicates.LootItemBlockStatePropertyCondition;
|
||||
import net.minecraft.world.level.storage.loot.providers.nbt.ContextNbtProvider;
|
||||
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
|
||||
import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator;
|
||||
import net.neoforged.neoforge.registries.DeferredHolder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
@ -189,6 +193,7 @@ public class LootTableGenerator extends LootTableProvider {
|
|||
|
||||
//TODO temp
|
||||
dropSelf(ActuallyBlocks.BLACK_QUARTZ_ORE.get());
|
||||
add(ActuallyBlocks.BLACK_QUARTZ_ORE.get(), createOreDrop(ActuallyBlocks.BLACK_QUARTZ_ORE.getBlock(), ActuallyItems.BLACK_QUARTZ.get()));
|
||||
|
||||
//this.add(ActuallyBlocks.BLACK_QUARTZ_ORE.get(), ore -> droppingItemWithFortune(ore, ActuallyItems.BLACK_QUARTZ.get()));
|
||||
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
package de.ellpeck.actuallyadditions.data.patchouli;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import xyz.brassgoggledcoders.patchouliprovider.BookBuilder;
|
||||
import xyz.brassgoggledcoders.patchouliprovider.CategoryBuilder;
|
||||
import xyz.brassgoggledcoders.patchouliprovider.PatchouliBookProvider;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class PachouliGenerator extends PatchouliBookProvider {
|
||||
|
||||
public PachouliGenerator(PackOutput output) {
|
||||
super(output, ActuallyAdditions.MODID, "en_us");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addBooks(Consumer<BookBuilder> consumer) {
|
||||
final ItemStack bookStack = ActuallyItems.ITEM_BOOKLET.get().getDefaultInstance();
|
||||
|
||||
BookBuilder bookBuilder = createBookBuilder("booklet",
|
||||
prefix("item.actuallyadditions.booklet"), "<i>To be perfectly honest, I never actually realized how much content Actually Additions has before.<r><n> - Ellpeck")
|
||||
.setVersion("153")
|
||||
.setCreativeTab("actuallyadditions.tab")
|
||||
.setCustomBookItem(bookStack)
|
||||
.setBookTexture("actuallyadditions:textures/gui/booklet/booklet.png")
|
||||
.setShowProgress(false)
|
||||
.setUseBlockyFont(false)
|
||||
.setI18n(true)
|
||||
.setDontGenerateBook(true)
|
||||
.addMacro("<imp>", "$(2)")
|
||||
.addMacro("<item>", "$(9)")
|
||||
.addMacro("<r>", "$()")
|
||||
.addMacro("<n>", "$(br)")
|
||||
.addMacro("<i>", "$(o)")
|
||||
.addMacro("<tifisgrin>", "$(4)$(n)")
|
||||
.setUseResourcePack(true);
|
||||
|
||||
|
||||
//Getting Started
|
||||
CategoryBuilder gettingStarted = bookBuilder.addCategory("getting_started", prefix("indexEntry.getting_started"),
|
||||
"", bookStack);
|
||||
|
||||
gettingStarted.addEntry("tutorial", prefix("chapter.book_tutorial"), bookStack)
|
||||
.addTextPage(prefix("chapter.book_tutorial.text.1")).build()
|
||||
.addTextPage(prefix("chapter.book_tutorial.text.2")).build()
|
||||
.addTextPage(prefix("chapter.book_tutorial.text.3")).build()
|
||||
|
||||
.addCraftingPage(new ResourceLocation(ActuallyAdditions.MODID, "booklet")).setTitle("").setText("booklet.actuallyadditions.shapeless_recipe").build();
|
||||
gettingStarted.addEntry("guide", prefix("chapter.video_guide"), "actuallyadditions:textures/item/youtube.png")
|
||||
.addLinkPage("https://www.youtube.com/watch?v=fhjz0Ew56pM", prefix("chapter.video_guide.booty.button"))
|
||||
.setText(prefix("chapter.video_guide.booty.text.1")).build()
|
||||
.addTextPage(prefix("chapter.video_guide.booty.text.2")).build()
|
||||
.addLinkPage("https://www.youtube.com/playlist?list=PLJeFZ64pT89MrTRZYzD_rtHFajPVlt6cF", prefix("chapter.video_guide.booty.button"))
|
||||
.setText(prefix("chapter.video_guide.dire.text.1")).build()
|
||||
.addTextPage(prefix("chapter.video_guide.dire.text.2")).build();
|
||||
|
||||
gettingStarted.addEntry("intro", prefix("chapter.intro"), bookStack)
|
||||
.addTextPage(prefix("chapter.intro.text.1")).build()
|
||||
.addTextPage(prefix("chapter.intro.text.2")).build()
|
||||
.addTextPage(prefix("chapter.intro.text.3")).build();
|
||||
|
||||
//End of Getting Started
|
||||
|
||||
|
||||
//Finish book
|
||||
bookBuilder.build(consumer);
|
||||
}
|
||||
|
||||
private String prefix(String name) {
|
||||
return "booklet.actuallyadditions." + name;
|
||||
}
|
||||
}
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.blocks;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.DirectionalBlock;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
|
@ -25,7 +25,7 @@ import net.minecraft.world.phys.BlockHitResult;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BlockBioReactor extends BlockContainerBase {
|
||||
public class BlockBioReactor extends DirectionalBlock.Container {
|
||||
|
||||
public BlockBioReactor() {
|
||||
super(ActuallyBlocks.defaultPickProps(2.0F, 10.0F));
|
||||
|
|
|
@ -12,14 +12,18 @@ package de.ellpeck.actuallyadditions.mod.blocks;
|
|||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.base.DirectionalBlock;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPoweredFurnace;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
@ -34,6 +38,7 @@ import net.minecraft.world.phys.shapes.CollisionContext;
|
|||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import static net.minecraft.world.level.block.state.properties.BlockStateProperties.HORIZONTAL_FACING;
|
||||
import static net.minecraft.world.level.block.state.properties.BlockStateProperties.LIT;
|
||||
|
@ -86,20 +91,11 @@ public class BlockPoweredFurnace extends DirectionalBlock.Container {
|
|||
builder.add(LIT).add(HORIZONTAL_FACING);
|
||||
}
|
||||
|
||||
// TODO: [port] add back
|
||||
|
||||
// public static class TheItemBlock extends ItemBlockBase {
|
||||
//
|
||||
// public TheItemBlock(Block block) {
|
||||
// super(block);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void addInformation(ItemStack stack, World playerIn, List<String> tooltip, ITooltipFlag advanced) {
|
||||
// tooltip.add(TextFormatting.ITALIC + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".previouslyDoubleFurnace"));
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void appendHoverText(ItemStack stack, @Nullable BlockGetter level, List<Component> tooltip, TooltipFlag advanced) {
|
||||
super.appendHoverText(stack, level, tooltip, advanced);
|
||||
tooltip.add(Component.translatable("tooltip.actuallyadditions.previouslyDoubleFurnace").withStyle(ChatFormatting.ITALIC));
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
|
||||
|
|
|
@ -30,6 +30,7 @@ public class ActuallyRecipes {
|
|||
public static final Supplier<RecipeSerializer<?>> FERMENTING_RECIPE = SERIALIZERS.register(FermentingRecipe.NAME, FermentingRecipe.Serializer::new);
|
||||
public static final Supplier<RecipeSerializer<?>> COLOR_CHANGE_RECIPE = SERIALIZERS.register(ColorChangeRecipe.NAME, ColorChangeRecipe.Serializer::new);
|
||||
public static final Supplier<RecipeSerializer<?>> MINING_LENS_RECIPE = SERIALIZERS.register(MiningLensRecipe.NAME, MiningLensRecipe.Serializer::new);
|
||||
public static final Supplier<RecipeSerializer<?>> COFFEE_INGREDIENT_RECIPE = SERIALIZERS.register(CoffeeIngredientRecipe.NAME, CoffeeIngredientRecipe.Serializer::new);
|
||||
|
||||
|
||||
|
||||
|
@ -45,6 +46,7 @@ public class ActuallyRecipes {
|
|||
public static final Supplier<RecipeType<FermentingRecipe>> FERMENTING = RECIPE_TYPES.register("fermenting", () -> new RecipeType<>() {});
|
||||
public static final Supplier<RecipeType<ColorChangeRecipe>> COLOR_CHANGE = RECIPE_TYPES.register("color_change", () -> new RecipeType<>() {});
|
||||
public static final Supplier<RecipeType<MiningLensRecipe>> MINING_LENS = RECIPE_TYPES.register("mining_lens", () -> new RecipeType<>() {});
|
||||
public static final Supplier<RecipeType<CoffeeIngredientRecipe>> COFFEE_INGREDIENT = RECIPE_TYPES.register("coffee_ingredient", () -> new RecipeType<>() {});
|
||||
}
|
||||
public static class Ingredients {
|
||||
public static final DeferredRegister<IngredientType<?>> INGREDIENTS = DeferredRegister.create(NeoForgeRegistries.Keys.INGREDIENT_TYPES, ActuallyAdditions.MODID);
|
||||
|
|
|
@ -0,0 +1,200 @@
|
|||
package de.ellpeck.actuallyadditions.mod.crafting;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import com.mojang.serialization.DataResult;
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
||||
import net.minecraft.core.NonNullList;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.effect.MobEffect;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import net.minecraft.world.item.crafting.RecipeHolder;
|
||||
import net.minecraft.world.item.crafting.RecipeSerializer;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class CoffeeIngredientRecipe implements Recipe<Container> {
|
||||
public static final String NAME = "coffee_ingredient";
|
||||
|
||||
protected final Ingredient ingredient;
|
||||
protected final NonNullList<EffectInstance> instances; //Just a record used to populate the effects list
|
||||
protected final List<MobEffectInstance> effects;
|
||||
protected final int maxAmplifier;
|
||||
protected final String extraText;
|
||||
|
||||
public CoffeeIngredientRecipe(Ingredient ingredient, NonNullList<EffectInstance> effectInstances, int maxAmplifier, String extraText) {
|
||||
this.ingredient = ingredient;
|
||||
this.maxAmplifier = maxAmplifier;
|
||||
|
||||
this.instances = effectInstances;
|
||||
List<MobEffectInstance> instances = new ArrayList<>();
|
||||
for (EffectInstance instance : effectInstances) {
|
||||
MobEffect effect = BuiltInRegistries.MOB_EFFECT.get(instance.effect());
|
||||
if (effect == null) break;
|
||||
instances.add(new MobEffectInstance(effect, instance.duration, instance.amplifier));
|
||||
}
|
||||
this.effects = instances;
|
||||
this.extraText = extraText;
|
||||
}
|
||||
|
||||
public Ingredient getIngredient() {
|
||||
return ingredient;
|
||||
}
|
||||
|
||||
public List<MobEffectInstance> getEffects() {
|
||||
return effects;
|
||||
}
|
||||
|
||||
public int getMaxAmplifier() {
|
||||
return maxAmplifier;
|
||||
}
|
||||
|
||||
public String getExtraText() {
|
||||
return extraText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Container container, Level level) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean matches(ItemStack itemStack) {
|
||||
return ingredient.test(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack assemble(Container container, RegistryAccess registryAccess) {
|
||||
return getResultItem(registryAccess);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraftInDimensions(int pWidth, int pHeight) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResultItem(RegistryAccess registryAccess) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpecial() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecipeSerializer<?> getSerializer() {
|
||||
return ActuallyRecipes.COFFEE_INGREDIENT_RECIPE.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecipeType<?> getType() {
|
||||
return ActuallyRecipes.Types.COFFEE_INGREDIENT.get();
|
||||
}
|
||||
|
||||
public boolean effect(ItemStack stack) {
|
||||
return ActuallyAdditionsAPI.methodHandler.addRecipeEffectToStack(stack, this);
|
||||
}
|
||||
|
||||
public static Optional<RecipeHolder<CoffeeIngredientRecipe>> getIngredientForStack(ItemStack ingredient) {
|
||||
return ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS.stream().filter(recipe -> recipe.value().matches(ingredient)).findFirst();
|
||||
}
|
||||
|
||||
public record EffectInstance(ResourceLocation effect, int duration, int amplifier) { //Simplified record for the effect instance
|
||||
public static final EffectInstance EMPTY = new EffectInstance(new ResourceLocation("darkness"), 0, 0);
|
||||
public static final Codec<EffectInstance> CODEC = RecordCodecBuilder.create(
|
||||
instance -> instance.group(
|
||||
ResourceLocation.CODEC.fieldOf("effect").forGetter(effect -> effect.effect),
|
||||
Codec.INT.fieldOf("duration").forGetter(effect -> effect.duration),
|
||||
Codec.INT.fieldOf("amplifier").forGetter(effect -> effect.amplifier)
|
||||
)
|
||||
.apply(instance, EffectInstance::new)
|
||||
);
|
||||
|
||||
public EffectInstance(MobEffectInstance effect) {
|
||||
this(BuiltInRegistries.MOB_EFFECT.getKey(effect.getEffect()), effect.getDuration(), effect.getAmplifier());
|
||||
}
|
||||
|
||||
public static EffectInstance fromNetwork(FriendlyByteBuf pBuffer) {
|
||||
ResourceLocation effect = pBuffer.readResourceLocation();
|
||||
int duration = pBuffer.readVarInt();
|
||||
int amplifier = pBuffer.readVarInt();
|
||||
return new EffectInstance(effect, duration, amplifier);
|
||||
}
|
||||
|
||||
public void toNetwork(FriendlyByteBuf pBuffer) {
|
||||
pBuffer.writeResourceLocation(effect);
|
||||
pBuffer.writeVarInt(duration);
|
||||
pBuffer.writeVarInt(amplifier);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Serializer implements RecipeSerializer<CoffeeIngredientRecipe> {
|
||||
private static final Codec<CoffeeIngredientRecipe> CODEC = RecordCodecBuilder.create(
|
||||
instance -> instance.group(
|
||||
Ingredient.CODEC_NONEMPTY.fieldOf("ingredient").forGetter(recipe -> recipe.ingredient),
|
||||
EffectInstance.CODEC
|
||||
.listOf()
|
||||
.optionalFieldOf("effects", new ArrayList<>())
|
||||
.flatXmap(
|
||||
list -> {
|
||||
for (EffectInstance effect : list) {
|
||||
if (!BuiltInRegistries.MOB_EFFECT.containsKey(effect.effect)) {
|
||||
return DataResult.error(() -> "Unknown effect: %s".formatted(effect.effect));
|
||||
}
|
||||
}
|
||||
return DataResult.success(NonNullList.of(EffectInstance.EMPTY, list.toArray(EffectInstance[]::new)));
|
||||
},
|
||||
DataResult::success
|
||||
)
|
||||
.forGetter(recipe -> recipe.instances),
|
||||
Codec.INT.fieldOf("maxAmplifier").forGetter(recipe -> recipe.maxAmplifier),
|
||||
Codec.STRING.optionalFieldOf("extraText", "").forGetter(recipe -> recipe.extraText)
|
||||
)
|
||||
.apply(instance, CoffeeIngredientRecipe::new)
|
||||
);
|
||||
|
||||
@Override
|
||||
public Codec<CoffeeIngredientRecipe> codec() {
|
||||
return CODEC;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CoffeeIngredientRecipe fromNetwork(@Nonnull FriendlyByteBuf pBuffer) {
|
||||
Ingredient ingredient = Ingredient.fromNetwork(pBuffer);
|
||||
int i = pBuffer.readVarInt();
|
||||
NonNullList<EffectInstance> list = NonNullList.withSize(i, EffectInstance.EMPTY);
|
||||
for (int j = 0; j < list.size(); ++j) {
|
||||
list.set(j, EffectInstance.fromNetwork(pBuffer));
|
||||
}
|
||||
int maxAmplifier = pBuffer.readInt();
|
||||
String extraText = pBuffer.readUtf(32767);
|
||||
return new CoffeeIngredientRecipe(ingredient, list, maxAmplifier, extraText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toNetwork(@Nonnull FriendlyByteBuf pBuffer, CoffeeIngredientRecipe pRecipe) {
|
||||
pRecipe.ingredient.toNetwork(pBuffer);
|
||||
pBuffer.writeVarInt(pRecipe.instances.size());
|
||||
for (EffectInstance effect : pRecipe.instances) {
|
||||
effect.toNetwork(pBuffer);
|
||||
}
|
||||
pBuffer.writeInt(pRecipe.maxAmplifier);
|
||||
pBuffer.writeUtf(pRecipe.extraText);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@ import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
|||
import de.ellpeck.actuallyadditions.mod.items.DrillItem;
|
||||
import de.ellpeck.actuallyadditions.mod.items.Sack;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
|
||||
import de.ellpeck.actuallyadditions.mod.sack.SackManager;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.FilterSettings;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
|
||||
|
@ -72,10 +73,14 @@ public class CommonEvents {
|
|||
boolean changed = false;
|
||||
|
||||
boolean isVoid = ((Sack) invStack.getItem()).isVoid;
|
||||
ItemStackHandlerAA inv = new ItemStackHandlerAA(28); //TODO whats going on here
|
||||
DrillItem.loadSlotsFromNBT(inv, invStack);
|
||||
var optHandler = SackManager.get().getHandler(invStack);
|
||||
|
||||
FilterSettings filter = new FilterSettings(4, false, false, false);
|
||||
if (optHandler.isEmpty())
|
||||
continue;
|
||||
|
||||
ItemStackHandlerAA inv = optHandler.get();
|
||||
|
||||
FilterSettings filter = new FilterSettings(4, false, false);
|
||||
filter.readFromNBT(invStack.getOrCreateTag(), "Filter");
|
||||
if (filter.check(stack)) {
|
||||
if (isVoid) {
|
||||
|
|
|
@ -85,7 +85,7 @@ public class ContainerCoffeeMachine extends AbstractContainerMenu {
|
|||
if (!this.moveItemStackTo(newStack, TileEntityCoffeeMachine.SLOT_INPUT, TileEntityCoffeeMachine.SLOT_INPUT + 1, false)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
} else if (ItemCoffee.getIngredientFromStack(newStack) != null) {
|
||||
} else if (ItemCoffee.getIngredientRecipeFromStack(newStack) != null) {
|
||||
if (!this.moveItemStackTo(newStack, 3, 11, false)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.util.UUID;
|
|||
|
||||
public class SackContainer extends AbstractContainerMenu implements IButtonReactor {
|
||||
|
||||
public final FilterSettings filter = new FilterSettings(4, false, false, false);
|
||||
public final FilterSettings filter = new FilterSettings(4, false,false);
|
||||
private final ItemStackHandlerAA bagInventory;
|
||||
private final Inventory inventory;
|
||||
public boolean autoInsert;
|
||||
|
@ -141,10 +141,8 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
|
|||
if (id == 0) {
|
||||
this.filter.isWhitelist = data == 1;
|
||||
} else if (id == 1) {
|
||||
this.filter.respectNBT = data == 1;
|
||||
} else if (id == 2) {
|
||||
this.autoInsert = data == 1;
|
||||
} else if (id == 3) {
|
||||
} else if (id == 2) {
|
||||
this.filter.respectMod = data == 1;
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +195,7 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
|
|||
}
|
||||
|
||||
@Override
|
||||
public void clicked(int slotId, int dragType, ClickType clickTypeIn, Player player) {
|
||||
public void clicked(int slotId, int dragType, @Nonnull ClickType clickTypeIn, @Nonnull Player player) {
|
||||
if (SlotFilter.checkFilter(this, slotId, player)) {
|
||||
return; //TODO: Check if this is correct, used to return ItemStack.EMPTY
|
||||
} else if (clickTypeIn == ClickType.SWAP && dragType == this.inventory.selected) {
|
||||
|
@ -208,10 +206,9 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
|
|||
}
|
||||
|
||||
@Override
|
||||
public void removed(Player player) {
|
||||
public void removed(@Nonnull Player player) {
|
||||
ItemStack stack = this.inventory.getSelected();
|
||||
if (!stack.isEmpty() && stack.getItem() instanceof Sack) {
|
||||
//DrillItem.writeSlotsToNBT(this.bagInventory, this.inventory.getSelected());
|
||||
CompoundTag compound = stack.getOrCreateTag();
|
||||
this.filter.writeToNBT(compound, "Filter");
|
||||
compound.putBoolean("AutoInsert", this.autoInsert);
|
||||
|
@ -220,7 +217,7 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean stillValid(Player player) {
|
||||
public boolean stillValid(@Nonnull Player player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -229,7 +226,7 @@ public class SackContainer extends AbstractContainerMenu implements IButtonReact
|
|||
if (buttonID == 0) {
|
||||
this.autoInsert = !this.autoInsert;
|
||||
} else {
|
||||
//this.filter.onButtonPressed(buttonID); //TODO
|
||||
this.filter.onButtonPressed(buttonID - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import javax.annotation.Nonnull;
|
|||
|
||||
public class Buttons {
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Deprecated(forRemoval = true) //Vanilla's Button class can render small just fine and even allows text scrolling
|
||||
public static class SmallerButton extends Button {
|
||||
|
||||
public final ResourceLocation resLoc = AssetUtil.getGuiLocation("gui_inputter");
|
||||
|
@ -53,7 +54,7 @@ public class Buttons {
|
|||
color = 16777120;
|
||||
}
|
||||
|
||||
guiGraphics.drawCenteredString(Minecraft.getInstance().font, this.getMessage().getString(), this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, color);
|
||||
guiGraphics.drawCenteredString(Minecraft.getInstance().font, this.getMessage(), this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, this.getMessage().getStyle().getColor().getValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,51 +11,60 @@
|
|||
package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.FilterSettings;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.AbstractButton;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.components.Renderable;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.neoforge.network.PacketDistributor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class FilterSettingsGui {
|
||||
|
||||
private final FilterSettings theSettings;
|
||||
|
||||
public Buttons.SmallerButton whitelistButton;
|
||||
public Buttons.SmallerButton nbtButton;
|
||||
public Buttons.SmallerButton modButton;
|
||||
public Button whitelistButton;
|
||||
public Button modButton;
|
||||
|
||||
public FilterSettingsGui(FilterSettings settings, int x, int y, List<Renderable> buttonList) {
|
||||
public FilterSettingsGui(FilterSettings settings, int x, int y, Consumer<AbstractButton> buttonConsumer, int idOffset) {
|
||||
this.theSettings = settings;
|
||||
|
||||
this.whitelistButton = new Buttons.SmallerButton( x, y, Component.literal("WH"), true, Button::onPress); //TODO these need translation keys
|
||||
buttonList.add(this.whitelistButton);
|
||||
this.whitelistButton = Button.builder(Component.literal("WH"), $ -> buttonClicked(idOffset))
|
||||
.bounds(x, y, 16, 12).build();
|
||||
buttonConsumer.accept(this.whitelistButton);
|
||||
y += 14;
|
||||
this.nbtButton = new Buttons.SmallerButton( x, y, Component.literal("NB"), true, Button::onPress);//TODO also button actions
|
||||
buttonList.add(this.nbtButton);
|
||||
y += 14;
|
||||
this.modButton = new Buttons.SmallerButton( x, y, Component.literal("MO"), true, Button::onPress);
|
||||
buttonList.add(this.modButton);
|
||||
this.modButton = Button.builder(Component.literal("MO"), $ -> buttonClicked(idOffset + 1))
|
||||
.bounds(x, y, 16, 12).build();
|
||||
buttonConsumer.accept(this.modButton);
|
||||
|
||||
this.tick();
|
||||
}
|
||||
|
||||
public void buttonClicked(int id) {
|
||||
CompoundTag data = new CompoundTag();
|
||||
data.putInt("ButtonID", id);
|
||||
data.putInt("PlayerID", Minecraft.getInstance().player.getId());
|
||||
data.putString("WorldID", Minecraft.getInstance().level.dimension().location().toString());
|
||||
PacketDistributor.SERVER.noArg().send(new PacketClientToServer(data, PacketHandler.GUI_BUTTON_TO_CONTAINER_HANDLER));
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
this.whitelistButton.setMessage(Component.literal("WH").withStyle(this.theSettings.isWhitelist
|
||||
? ChatFormatting.DARK_GREEN
|
||||
: ChatFormatting.RED));
|
||||
this.whitelistButton.setMessage(Component.literal("NB").withStyle(this.theSettings.respectNBT
|
||||
? ChatFormatting.DARK_GREEN
|
||||
: ChatFormatting.RED));
|
||||
this.whitelistButton.setMessage(Component.literal("MO").withStyle(this.theSettings.respectMod
|
||||
this.modButton.setMessage(Component.literal("MO").withStyle(this.theSettings.respectMod
|
||||
? ChatFormatting.DARK_GREEN
|
||||
: ChatFormatting.RED));
|
||||
}
|
||||
|
@ -68,10 +77,6 @@ public class FilterSettingsGui {
|
|||
? Component.translatable("info." + ActuallyAdditions.MODID + ".gui.whitelist")
|
||||
: Component.translatable("info." + ActuallyAdditions.MODID + ".gui.blacklist")).withStyle(ChatFormatting.BOLD));
|
||||
list.add(Component.translatable("info." + ActuallyAdditions.MODID + ".gui.whitelistInfo"));
|
||||
} else if (this.nbtButton.isMouseOver(mouseX, mouseY)) {
|
||||
list.add((this.theSettings.respectNBT
|
||||
? Component.translatable("info." + ActuallyAdditions.MODID + ".gui.respectNBT")
|
||||
: Component.translatable("info." + ActuallyAdditions.MODID + ".gui.ignoreNBT")).withStyle(ChatFormatting.BOLD));
|
||||
} else if (this.modButton.isMouseOver(mouseX, mouseY)) {
|
||||
list.add((this.theSettings.respectMod
|
||||
? Component.translatable("info." + ActuallyAdditions.MODID + ".gui.respectMod")
|
||||
|
|
|
@ -37,7 +37,7 @@ public class GuiFilter extends AAScreen<ContainerFilter> {
|
|||
|
||||
@Override
|
||||
public void renderLabels(@Nonnull GuiGraphics guiGraphics, int x, int y) {
|
||||
AssetUtil.displayNameString(guiGraphics, this.font, this.imageWidth, -10, I18n.get("container." + ActuallyAdditions.MODID + ".filter.name"));
|
||||
AssetUtil.displayNameString(guiGraphics, this.font, this.imageWidth, -10, I18n.get("container." + ActuallyAdditions.MODID + ".filter"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -12,14 +12,24 @@ package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
|||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.SackContainer;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer;
|
||||
import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.components.Tooltip;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.neoforged.neoforge.network.PacketDistributor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class SackGui extends AAScreen<SackContainer> {
|
||||
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_bag");
|
||||
|
@ -42,31 +52,34 @@ public class SackGui extends AAScreen<SackContainer> {
|
|||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.filter = new FilterSettingsGui(this.container.filter, this.leftPos + 138, this.topPos + 10, this.renderables);
|
||||
//
|
||||
// this.buttonAutoInsert = new Button(0, this.leftPos - 21, this.topPos + 8, 20, 20, (this.container.autoInsert
|
||||
// ? TextFormatting.DARK_GREEN
|
||||
// : TextFormatting.RED) + "I");
|
||||
//this.addButton(this.buttonAutoInsert);
|
||||
this.filter = new FilterSettingsGui(this.container.filter, this.leftPos + 138, this.topPos + 10, this::addRenderableWidget, 1);
|
||||
|
||||
this.buttonAutoInsert = Button.builder(
|
||||
Component.literal("I")
|
||||
.withStyle(this.container.autoInsert? ChatFormatting.DARK_GREEN : ChatFormatting.RED),
|
||||
(button) -> {
|
||||
this.container.autoInsert = !this.container.autoInsert;
|
||||
this.buttonAutoInsert.setMessage(Component.literal(this.container.autoInsert? "I" : "O")
|
||||
.withStyle(this.container.autoInsert? ChatFormatting.DARK_GREEN : ChatFormatting.RED));
|
||||
this.buttonClicked(0);
|
||||
}).pos(leftPos - 21, topPos + 8).size(20, 20)
|
||||
.build();
|
||||
|
||||
this.addRenderableWidget(this.buttonAutoInsert);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// protected void actionPerformed(Button button) throws IOException {
|
||||
// CompoundNBT data = new CompoundNBT();
|
||||
// data.putInt("ButtonID", button.id);
|
||||
// data.putInt("PlayerID", Minecraft.getInstance().player.getId());
|
||||
// data.putInt("WorldID", Minecraft.getInstance().level.provider.getDimension());
|
||||
// PacketDistributor.SERVER.noArg().send(new PacketClientToServer(data, PacketHandler.GUI_BUTTON_TO_CONTAINER_HANDLER));
|
||||
// }
|
||||
public void buttonClicked(int id) {
|
||||
CompoundTag data = new CompoundTag();
|
||||
data.putInt("ButtonID", id);
|
||||
data.putInt("PlayerID", Minecraft.getInstance().player.getId());
|
||||
data.putString("WorldID", Minecraft.getInstance().level.dimension().location().toString());
|
||||
PacketDistributor.SERVER.noArg().send(new PacketClientToServer(data, PacketHandler.GUI_BUTTON_TO_CONTAINER_HANDLER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void containerTick() {
|
||||
super.containerTick();
|
||||
this.filter.tick();
|
||||
|
||||
//this.buttonAutoInsert.displayString = (this.container.autoInsert
|
||||
// ? TextFormatting.DARK_GREEN
|
||||
// : TextFormatting.RED) + "I";
|
||||
}
|
||||
|
||||
/* @Override
|
||||
|
@ -81,15 +94,15 @@ public class SackGui extends AAScreen<SackContainer> {
|
|||
super.render(guiGraphics, mouseX, mouseY, partialTicks);
|
||||
this.filter.drawHover(guiGraphics, mouseX, mouseY);
|
||||
|
||||
/* if (this.buttonAutoInsert.isMouseOver()) {
|
||||
List<String> text = new ArrayList<>();
|
||||
text.add(TextFormatting.BOLD + "Auto-Insert " + (this.container.autoInsert
|
||||
if (this.buttonAutoInsert.isMouseOver(mouseX, mouseY)) {
|
||||
List<Component> text = new ArrayList<>();
|
||||
text.add(Component.literal("Auto-Insert " + (this.container.autoInsert
|
||||
? "On"
|
||||
: "Off"));
|
||||
text.addAll(this.font.listFormattedStringToWidth("Turn this on to make items that get picked up automatically go into the bag.", 200));
|
||||
text.addAll(this.font.listFormattedStringToWidth(TextFormatting.GRAY + "" + TextFormatting.ITALIC + "Note that this WON'T work when you are holding the bag in your hand.", 200));
|
||||
this.renderToolTip(stack, text, mouseX, mouseY, this.getMinecraft().font);
|
||||
}*/
|
||||
: "Off")).withStyle(ChatFormatting.BOLD));
|
||||
text.add(Component.literal("Turn this on to make items that get picked up automatically go into the bag.")); //TODO how to word wrap these to 200?
|
||||
text.add(Component.literal("Note that this WON'T work when you are holding the bag in your hand.").withStyle(ChatFormatting.GRAY).withStyle(ChatFormatting.ITALIC)); //TODO this too
|
||||
guiGraphics.renderTooltip(font, text, Optional.empty(), mouseX, mouseY); //TODO i have no idea what im doing here...
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,7 +33,7 @@ public class SlotFilter extends SlotItemHandlerUnconditioned {
|
|||
if (slotId >= 0 && slotId < container.slots.size()) {
|
||||
Slot slot = container.getSlot(slotId);
|
||||
if (slot instanceof SlotFilter) {
|
||||
((SlotFilter) slot).slotClick(player);
|
||||
((SlotFilter) slot).slotClick(player, container.getCarried());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ public class SlotFilter extends SlotItemHandlerUnconditioned {
|
|||
return !stack.isEmpty() && stack.getItem() instanceof ItemFilter;
|
||||
}
|
||||
|
||||
private void slotClick(Player player) {
|
||||
ItemStack heldStack = player.getInventory().getSelected();
|
||||
private void slotClick(Player player, ItemStack cursorItem) {
|
||||
ItemStack heldStack = cursorItem;
|
||||
ItemStack stackInSlot = this.getItem();
|
||||
|
||||
if (StackUtil.isValid(stackInSlot) && !StackUtil.isValid(heldStack)) {
|
||||
|
|
|
@ -39,7 +39,7 @@ public final class ActuallyItems {
|
|||
|
||||
// MISC ITEMS
|
||||
public static final DeferredItem<ItemBase> CANOLA = ITEMS.register("canola", () -> new ItemBase());
|
||||
public static final DeferredItem<ItemBase> COFFEE_CUP = ITEMS.register("coffee_cup", () -> new ItemBase());
|
||||
public static final DeferredItem<ItemCoffee> COFFEE_CUP = ITEMS.register("coffee_cup", () -> new ItemCoffee());
|
||||
public static final DeferredItem<ItemBase> PAPER_CONE = ITEMS.register("paper_cone", () -> new ItemBase());
|
||||
public static final DeferredItem<ItemBase> DOUGH = ITEMS.register("dough", () -> new ItemBase());
|
||||
public static final DeferredItem<ItemBase> RING = ITEMS.register("ring", () -> new ItemBase());
|
||||
|
|
|
@ -76,6 +76,8 @@ public class ItemBooklet extends ItemBase implements IHudDisplay {
|
|||
if (advancement != null && !advancements.getOrStartProgress(advancement).isDone()) {
|
||||
advancements.award(advancement, "right_click");
|
||||
}
|
||||
} else {
|
||||
vazkii.patchouli.api.PatchouliAPI.get().openBookGUI(new ResourceLocation(ActuallyAdditions.MODID, "booklet"));
|
||||
}
|
||||
// player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.BOOK.ordinal(), world, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
//
|
||||
|
@ -89,11 +91,11 @@ public class ItemBooklet extends ItemBase implements IHudDisplay {
|
|||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void appendHoverText(ItemStack stack, @Nullable Level playerIn, List<Component> tooltip, TooltipFlag advanced) {
|
||||
tooltip.add(Component.translatable("tooltip." + ActuallyAdditions.MODID + "." + this.getDescription().getString() + ".desc"));
|
||||
tooltip.add(Component.translatable("tooltip." + ActuallyAdditions.MODID + ".item_booklet.desc").withStyle(ChatFormatting.GRAY));
|
||||
|
||||
// TODO: this is bad
|
||||
for (int i = 1; i <= 4; i++) {
|
||||
tooltip.add(Component.translatable("tooltip." + ActuallyAdditions.MODID + "." + this.getDescription().getString() + ".sub." + i).withStyle(i == 4
|
||||
tooltip.add(Component.translatable("tooltip." + ActuallyAdditions.MODID + ".item_booklet.sub." + i).withStyle(i == 4
|
||||
? ChatFormatting.GOLD
|
||||
: ChatFormatting.RESET).withStyle(i == 4
|
||||
? ChatFormatting.ITALIC
|
||||
|
|
|
@ -13,110 +13,104 @@ package de.ellpeck.actuallyadditions.mod.items;
|
|||
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.items.base.ItemFoodBase;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.resources.language.I18n;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.util.StringUtil;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.food.FoodProperties;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.item.UseAnim;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.crafting.RecipeHolder;
|
||||
import net.minecraft.world.item.enchantment.Enchantment;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
import net.neoforged.fml.ModList;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemCoffee extends ItemFoodBase {
|
||||
public class ItemCoffee extends ItemBase {
|
||||
private static final FoodProperties FOOD = new FoodProperties.Builder().nutrition(8).saturationMod(5.0F).alwaysEat().build();
|
||||
|
||||
public ItemCoffee() {
|
||||
super(8, 5.0F, false); //, name);
|
||||
//this.setMaxDamage(3);
|
||||
//this.setAlwaysEdible();
|
||||
//this.setMaxStackSize(1);
|
||||
//this.setNoRepair();
|
||||
super(ActuallyItems.defaultProps().food(FOOD).durability(3));
|
||||
}
|
||||
|
||||
public static void initIngredients() {
|
||||
ActuallyAdditionsAPI.addCoffeeMachineIngredient(new MilkIngredient(Ingredient.of(Items.MILK_BUCKET)));
|
||||
//Pam's Soy Milk (For Jemx because he's lactose intolerant. YER HAPPY NAO!?)
|
||||
if (ModList.get().isLoaded("harvestcraft")) {
|
||||
Item item = ItemUtil.getItemFromName("harvestcraft:soymilkitem");
|
||||
if (item != null) {
|
||||
ActuallyAdditionsAPI.addCoffeeMachineIngredient(new MilkIngredient(Ingredient.of(item)));
|
||||
}
|
||||
}
|
||||
|
||||
//ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.SUGAR), 4, new PotionEffect(MobEffects.SPEED, 30, 0)));
|
||||
//ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.MAGMA_CREAM), 2, new PotionEffect(MobEffects.FIRE_RESISTANCE, 20, 0)));
|
||||
//ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(new ItemStack(Items.FISH, 1, 3)), 2, new PotionEffect(MobEffects.WATER_BREATHING, 10, 0)));
|
||||
//ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.GOLDEN_CARROT), 2, new PotionEffect(MobEffects.NIGHT_VISION, 30, 0)));
|
||||
//ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.GHAST_TEAR), 3, new PotionEffect(MobEffects.REGENERATION, 5, 0)));
|
||||
//ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.BLAZE_POWDER), 4, new PotionEffect(MobEffects.STRENGTH, 15, 0)));
|
||||
//ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.FERMENTED_SPIDER_EYE), 2, new PotionEffect(MobEffects.INVISIBILITY, 25, 0)));
|
||||
// ActuallyAdditionsAPI.addCoffeeMachineIngredient(new MilkIngredient(Ingredient.of(Items.MILK_BUCKET)));
|
||||
// //Pam's Soy Milk (For Jemx because he's lactose intolerant. YER HAPPY NAO!?)
|
||||
// if (ModList.get().isLoaded("harvestcraft")) {
|
||||
// Item item = ItemUtil.getItemFromName("harvestcraft:soymilkitem");
|
||||
// if (item != null) {
|
||||
// ActuallyAdditionsAPI.addCoffeeMachineIngredient(new MilkIngredient(Ingredient.of(item)));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.SUGAR), 4, new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 30, 0)));
|
||||
// ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.MAGMA_CREAM), 2, new MobEffectInstance(MobEffects.FIRE_RESISTANCE, 20, 0)));
|
||||
// ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.PUFFERFISH), 2, new MobEffectInstance(MobEffects.WATER_BREATHING, 10, 0)));
|
||||
// ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.GOLDEN_CARROT), 2, new MobEffectInstance(MobEffects.NIGHT_VISION, 30, 0)));
|
||||
// ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.GHAST_TEAR), 3, new MobEffectInstance(MobEffects.REGENERATION, 5, 0)));
|
||||
// ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.BLAZE_POWDER), 4, new MobEffectInstance(MobEffects.DAMAGE_BOOST, 15, 0)));
|
||||
// ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(Ingredient.of(Items.FERMENTED_SPIDER_EYE), 2, new MobEffectInstance(MobEffects.INVISIBILITY, 25, 0)));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static CoffeeIngredient getIngredientFromStack(ItemStack stack) {
|
||||
for (CoffeeIngredient ingredient : ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS) {
|
||||
if (ingredient.getInput().test(stack)) {
|
||||
return ingredient;
|
||||
public static RecipeHolder<CoffeeIngredientRecipe> getIngredientRecipeFromStack(ItemStack stack) {
|
||||
for (RecipeHolder<CoffeeIngredientRecipe> recipeHolder : ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS) {
|
||||
if (recipeHolder.value().getIngredient().test(stack)) {
|
||||
return recipeHolder;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void applyPotionEffectsFromStack(ItemStack stack, LivingEntity player) {/*
|
||||
PotionEffect[] effects = ActuallyAdditionsAPI.methodHandler.getEffectsFromStack(stack);
|
||||
public static void applyPotionEffectsFromStack(ItemStack stack, LivingEntity player) {
|
||||
MobEffectInstance[] effects = ActuallyAdditionsAPI.methodHandler.getEffectsFromStack(stack);
|
||||
if (effects != null && effects.length > 0) {
|
||||
for (PotionEffect effect : effects) {
|
||||
player.addPotionEffect(new PotionEffect(effect.getPotion(), effect.getDuration() * 20, effect.getAmplifier()));
|
||||
for (MobEffectInstance effect : effects) {
|
||||
player.addEffect(new MobEffectInstance(effect.getEffect(), effect.getDuration() * 20, effect.getAmplifier()));
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//@Override
|
||||
public ItemStack onItemUseFinish(ItemStack stack, Level world, LivingEntity player) {
|
||||
@Override
|
||||
public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity livingEntity) {
|
||||
ItemStack theStack = stack.copy();
|
||||
super.finishUsingItem(stack, world, player);
|
||||
applyPotionEffectsFromStack(stack, player);
|
||||
//theStack.setItemDamage(theStack.getItemDamage() + 1);
|
||||
//if (theStack.getMaxDamage() - theStack.getItemDamage() < 0) {
|
||||
// return new ItemStack(ActuallyItems.COFFEE_CUP.get());
|
||||
//} else {
|
||||
// return theStack;
|
||||
//}
|
||||
return ItemStack.EMPTY;
|
||||
super.finishUsingItem(stack, level, livingEntity);
|
||||
applyPotionEffectsFromStack(stack, livingEntity);
|
||||
theStack.setDamageValue(theStack.getDamageValue() + 1);
|
||||
if (theStack.getMaxDamage() - theStack.getDamageValue() < 0) {
|
||||
return new ItemStack(ActuallyItems.COFFEE_CUP.get());
|
||||
} else {
|
||||
return theStack;
|
||||
}
|
||||
}
|
||||
|
||||
//@Override
|
||||
//public EnumAction getItemUseAction(ItemStack stack) {
|
||||
// return EnumAction.DRINK;
|
||||
//}
|
||||
|
||||
// @Nullable
|
||||
// @Override
|
||||
// public CompoundTag getShareTag(ItemStack stack) {
|
||||
// return super.getShareTag(stack);
|
||||
// }
|
||||
@Override
|
||||
public UseAnim getUseAnimation(ItemStack pStack) {
|
||||
return UseAnim.DRINK;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void appendHoverText(ItemStack stack, @Nullable Level playerIn, List<Component> tooltip, TooltipFlag advanced) {
|
||||
//PotionEffect[] effects = ActuallyAdditionsAPI.methodHandler.getEffectsFromStack(stack);
|
||||
//if (effects != null) {
|
||||
// for (PotionEffect effect : effects) {
|
||||
// tooltip.add(StringUtil.localize(effect.getEffectName()) + " " + (effect.getAmplifier() + 1) + ", " + StringUtils.formatTickDuration(effect.getDuration() * 20));
|
||||
// }
|
||||
//} else {
|
||||
// tooltip.add(StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".coffeeCup.noEffect"));
|
||||
//}
|
||||
MobEffectInstance[] effects = ActuallyAdditionsAPI.methodHandler.getEffectsFromStack(stack);
|
||||
if (effects != null) {
|
||||
for (MobEffectInstance effect : effects) {
|
||||
tooltip.add(Component.translatable(effect.getDescriptionId())
|
||||
.append(" " + (effect.getAmplifier() + 1) + ", " + StringUtil.formatTickDuration(effect.getDuration(), 20))
|
||||
.withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
} else {
|
||||
tooltip.add(Component.translatable("tooltip." + ActuallyAdditions.MODID + ".coffeeCup.noEffect").withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -157,7 +151,7 @@ public class ItemCoffee extends ItemFoodBase {
|
|||
|
||||
@Override
|
||||
public String getExtraText() {
|
||||
return I18n.get("container.nei." + ActuallyAdditions.MODID + ".coffee.extra.milk");
|
||||
return I18n.get("jei." + ActuallyAdditions.MODID + ".coffee.extra.milk");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,10 +13,15 @@ package de.ellpeck.actuallyadditions.mod.jei;
|
|||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.ActuallyRecipes;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.EmpowererRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.FermentingRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.LaserRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineCategory;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.empowerer.EmpowererRecipeCategory;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.fermenting.FermentingCategory;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.laser.LaserRecipeCategory;
|
||||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.JeiPlugin;
|
||||
import mezz.jei.api.constants.RecipeTypes;
|
||||
|
@ -42,6 +47,7 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
|
|||
public static final RecipeType<FermentingRecipe> FERMENTING = RecipeType.create(ActuallyAdditions.MODID, "fermenting", FermentingRecipe.class);
|
||||
public static final RecipeType<LaserRecipe> LASER = RecipeType.create(ActuallyAdditions.MODID, "laser", LaserRecipe.class);
|
||||
public static final RecipeType<EmpowererRecipe> EMPOWERER = RecipeType.create(ActuallyAdditions.MODID, "empowerer", EmpowererRecipe.class);
|
||||
public static final RecipeType<CoffeeIngredientRecipe> COFFEE_MACHINE = RecipeType.create(ActuallyAdditions.MODID, "coffee_machine", CoffeeIngredientRecipe.class);
|
||||
|
||||
@Override
|
||||
public void registerCategories(IRecipeCategoryRegistration registry) {
|
||||
|
@ -50,21 +56,20 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
|
|||
registry.addRecipeCategories(new FermentingCategory(helpers.getGuiHelper()));
|
||||
registry.addRecipeCategories(new LaserRecipeCategory(helpers.getGuiHelper()));
|
||||
registry.addRecipeCategories(new EmpowererRecipeCategory(helpers.getGuiHelper()));
|
||||
|
||||
//registry.addRecipeCategories(new CoffeeMachineRecipeCategory(helpers.getGuiHelper()), new CompostRecipeCategory(helpers.getGuiHelper()), new CrusherRecipeCategory(helpers.getGuiHelper()), new ReconstructorRecipeCategory(helpers.getGuiHelper()), new EmpowererRecipeCategory(helpers.getGuiHelper()), new BookletRecipeCategory(helpers.getGuiHelper()));
|
||||
registry.addRecipeCategories(new CoffeeMachineCategory(helpers.getGuiHelper()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) {
|
||||
registry.addRecipeCatalyst(new ItemStack(ActuallyItems.CRAFTER_ON_A_STICK.get()), RecipeTypes.CRAFTING);
|
||||
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.POWERED_FURNACE.getItem()), RecipeTypes.SMELTING);
|
||||
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.FERMENTING_BARREL.getItem()), FERMENTING);
|
||||
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.getItem()), LASER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.EMPOWERER.getItem()), EMPOWERER);
|
||||
registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.COFFEE_MACHINE.getItem()), COFFEE_MACHINE);
|
||||
|
||||
// registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockFurnaceDouble.get()), VanillaRecipeCategoryUid.SMELTING);
|
||||
// registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockGrinder.get()), CrusherRecipeCategory.NAME);
|
||||
// registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockGrinderDouble.get()), CrusherRecipeCategory.NAME);
|
||||
// registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockCoffeeMachine.get()), CoffeeMachineRecipeCategory.NAME);
|
||||
// registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockAtomicReconstructor.get()), ReconstructorRecipeCategory.NAME);
|
||||
// registry.addRecipeCatalyst(new ItemStack(ActuallyBlocks.blockEmpowerer.get()), EmpowererRecipeCategory.NAME);
|
||||
// registry.addRecipeCatalyst(new ItemStack(ActuallyItems.itemBooklet.get()), BookletRecipeCategory.NAME);
|
||||
|
@ -78,10 +83,8 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
|
|||
registry.addRecipes(FERMENTING, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.FERMENTING.get()).stream().map(RecipeHolder::value).toList());
|
||||
registry.addRecipes(LASER, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.LASER.get()).stream().map(RecipeHolder::value).toList());
|
||||
registry.addRecipes(EMPOWERER, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.EMPOWERING.get()).stream().map(RecipeHolder::value).toList());
|
||||
|
||||
|
||||
registry.addRecipes(COFFEE_MACHINE, level.getRecipeManager().getAllRecipesFor(ActuallyRecipes.Types.COFFEE_INGREDIENT.get()).stream().map(RecipeHolder::value).toList());
|
||||
//registry.addRecipes(ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA, BookletRecipeCategory.NAME);
|
||||
//registry.addRecipes(ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS, CoffeeMachineRecipeCategory.NAME);
|
||||
//registry.addRecipes(ActuallyAdditionsAPI.CRUSHER_RECIPES, CrusherRecipeCategory.NAME);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
package de.ellpeck.actuallyadditions.mod.jei.coffee;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
||||
import de.ellpeck.actuallyadditions.api.ActuallyTags;
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.JEIActuallyAdditionsPlugin;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
|
||||
import mezz.jei.api.gui.drawable.IDrawable;
|
||||
import mezz.jei.api.gui.drawable.IDrawableStatic;
|
||||
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
|
||||
import mezz.jei.api.helpers.IGuiHelper;
|
||||
import mezz.jei.api.recipe.IFocusGroup;
|
||||
import mezz.jei.api.recipe.RecipeIngredientRole;
|
||||
import mezz.jei.api.recipe.RecipeType;
|
||||
import mezz.jei.api.recipe.category.IRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.resources.language.I18n;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
|
||||
public class CoffeeMachineCategory implements IRecipeCategory<CoffeeIngredientRecipe> {
|
||||
private final IDrawableStatic background;
|
||||
|
||||
public CoffeeMachineCategory(IGuiHelper helper) {
|
||||
this.background = helper.drawableBuilder(AssetUtil.getGuiLocation("gui_nei_coffee_machine"), 0, 0, 126, 92).setTextureSize(256,256).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecipeType<CoffeeIngredientRecipe> getRecipeType() {
|
||||
return JEIActuallyAdditionsPlugin.COFFEE_MACHINE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component getTitle() {
|
||||
return Component.translatable("container.actuallyadditions.coffeeMachine");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayoutBuilder builder, CoffeeIngredientRecipe recipe, IFocusGroup focuses) {
|
||||
builder.addSlot(RecipeIngredientRole.INPUT, 2, 39).addIngredients(Ingredient.of(ActuallyTags.Items.COFFEE_BEANS));
|
||||
builder.addSlot(RecipeIngredientRole.INPUT, 90, 21).addIngredients(recipe.getIngredient());
|
||||
builder.addSlot(RecipeIngredientRole.INPUT, 45, 39).addItemStack(new ItemStack(ActuallyItems.EMPTY_CUP.get()));
|
||||
|
||||
ItemStack output = new ItemStack(ActuallyItems.COFFEE_CUP.get());
|
||||
ActuallyAdditionsAPI.methodHandler.addRecipeEffectToStack(output, recipe);
|
||||
builder.addSlot(RecipeIngredientRole.OUTPUT, 45, 70).addItemStack(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(CoffeeIngredientRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) {
|
||||
IRecipeCategory.super.draw(recipe, recipeSlotsView, guiGraphics, mouseX, mouseY);
|
||||
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (!Strings.isNullOrEmpty(recipe.getExtraText())) {
|
||||
guiGraphics.drawString(mc.font, Component.translatable("jei." + ActuallyAdditions.MODID + ".coffee.special").append( ":"), 2, 4, 4210752, false);
|
||||
guiGraphics.drawString(mc.font, I18n.get(recipe.getExtraText()), 2, 16, 4210752, false);
|
||||
}
|
||||
|
||||
if (recipe.getMaxAmplifier() > 0) {
|
||||
guiGraphics.drawString(mc.font, Component.translatable("jei." + ActuallyAdditions.MODID + ".coffee.maxAmount").append(": " + recipe.getMaxAmplifier()), 2, 28, 4210752, false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
///*
|
||||
// * This file ("CoffeeMachineRecipeCategory.java") is part of the Actually Additions mod for Minecraft.
|
||||
// * It is created and owned by Ellpeck and distributed
|
||||
// * under the Actually Additions License to be found at
|
||||
// * http://ellpeck.de/actaddlicense
|
||||
// * View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
// *
|
||||
// * © 2015-2017 Ellpeck
|
||||
// */
|
||||
//
|
||||
//package de.ellpeck.actuallyadditions.mod.jei.coffee;
|
||||
//
|
||||
//import java.util.Arrays;
|
||||
//
|
||||
//import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
//import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine;
|
||||
//import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
//import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
//import mezz.jei.api.IGuiHelper;
|
||||
//import mezz.jei.api.gui.IDrawable;
|
||||
//import mezz.jei.api.gui.IRecipeLayout;
|
||||
//import mezz.jei.api.ingredients.IIngredients;
|
||||
//import mezz.jei.api.recipe.IRecipeCategory;
|
||||
//
|
||||
//public class CoffeeMachineRecipeCategory implements IRecipeCategory<CoffeeMachineRecipeWrapper> {
|
||||
//
|
||||
// public static final String NAME = "actuallyadditions.coffee";
|
||||
//
|
||||
// private final IDrawable background;
|
||||
//
|
||||
// public CoffeeMachineRecipeCategory(IGuiHelper helper) {
|
||||
// this.background = helper.createDrawable(AssetUtil.getGuiLocation("gui_nei_coffee_machine"), 0, 0, 126, 92);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getUid() {
|
||||
// return NAME;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getTitle() {
|
||||
// return StringUtil.localize("container.nei." + NAME + ".name");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getModName() {
|
||||
// return ActuallyAdditions.NAME;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public IDrawable getBackground() {
|
||||
// return this.background;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setRecipe(IRecipeLayout recipeLayout, CoffeeMachineRecipeWrapper wrapper, IIngredients ingredients) {
|
||||
// recipeLayout.getItemStacks().init(0, true, 89, 20);
|
||||
// recipeLayout.getItemStacks().set(0, Arrays.asList(wrapper.ingredient.getInput().getMatchingStacks()));
|
||||
//
|
||||
// recipeLayout.getItemStacks().init(1, true, 44, 38);
|
||||
// recipeLayout.getItemStacks().set(1, wrapper.cup);
|
||||
//
|
||||
// recipeLayout.getItemStacks().init(2, true, 1, 38);
|
||||
// recipeLayout.getItemStacks().set(2, Arrays.asList(TileEntityCoffeeMachine.COFFEE.getMatchingStacks()));
|
||||
//
|
||||
// recipeLayout.getItemStacks().init(3, false, 44, 69);
|
||||
// recipeLayout.getItemStacks().set(3, wrapper.theOutput);
|
||||
// }
|
||||
//}
|
|
@ -1,88 +0,0 @@
|
|||
///*
|
||||
// * This file ("CoffeeMachineRecipeWrapper.java") is part of the Actually Additions mod for Minecraft.
|
||||
// * It is created and owned by Ellpeck and distributed
|
||||
// * under the Actually Additions License to be found at
|
||||
// * http://ellpeck.de/actaddlicense
|
||||
// * View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
// *
|
||||
// * © 2015-2017 Ellpeck
|
||||
// */
|
||||
//
|
||||
//package de.ellpeck.actuallyadditions.mod.jei.coffee;
|
||||
//
|
||||
//import com.google.common.base.Strings;
|
||||
//import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
||||
//import de.ellpeck.actuallyadditions.api.booklet.IBookletPage;
|
||||
//import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
|
||||
//import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
//import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
//import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils;
|
||||
//import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
//import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton;
|
||||
//import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine;
|
||||
//import de.ellpeck.actuallyadditions.mod.util.StringUtil;
|
||||
//import mezz.jei.api.ingredients.IIngredients;
|
||||
//import mezz.jei.api.ingredients.VanillaTypes;
|
||||
//import net.minecraft.client.Minecraft;
|
||||
//import net.minecraft.item.ItemStack;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.List;
|
||||
//
|
||||
//public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton {
|
||||
//
|
||||
// public final CoffeeIngredient ingredient;
|
||||
// public final ItemStack theOutput;
|
||||
// public final ItemStack cup = new ItemStack(ActuallyItems.itemCoffeeCup.get());
|
||||
//
|
||||
// public CoffeeMachineRecipeWrapper(CoffeeIngredient ingredient) {
|
||||
// this.ingredient = ingredient;
|
||||
//
|
||||
// this.theOutput = new ItemStack(ActuallyItems.itemCoffee);
|
||||
// ActuallyAdditionsAPI.methodHandler.addEffectToStack(this.theOutput, this.ingredient);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void getIngredients(IIngredients ingredients) {
|
||||
// List<ItemStack> list = new ArrayList<>();
|
||||
// for (ItemStack s : this.ingredient.getInput().getMatchingStacks()) {
|
||||
// list.add(s);
|
||||
// }
|
||||
// list.add(this.cup);
|
||||
// for (ItemStack s : TileEntityCoffeeMachine.COFFEE.getMatchingStacks()) {
|
||||
// list.add(s);
|
||||
// }
|
||||
// ingredients.setInputs(VanillaTypes.ITEM, list);
|
||||
//
|
||||
// ingredients.setOutput(VanillaTypes.ITEM, this.theOutput);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
// if (!Strings.isNullOrEmpty(this.ingredient.getExtraText())) {
|
||||
// minecraft.fontRenderer.drawString(StringUtil.localize("container.nei." + ActuallyAdditions.MODID + ".coffee.special") + ":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
// minecraft.fontRenderer.drawString(this.ingredient.getExtraText(), 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
// }
|
||||
//
|
||||
// if (this.ingredient.getMaxAmplifier() > 0) {
|
||||
// minecraft.fontRenderer.drawString(StringUtil.localize("container.nei." + ActuallyAdditions.MODID + ".coffee.maxAmount") + ": " + this.ingredient.getMaxAmplifier(), 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false);
|
||||
// }
|
||||
//
|
||||
// super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getButtonX() {
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getButtonY() {
|
||||
// return 68;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public IBookletPage getPage() {
|
||||
// return BookletUtils.findFirstPageForStack(new ItemStack(ActuallyBlocks.blockCoffeeMachine));
|
||||
// }
|
||||
//}
|
|
@ -8,10 +8,11 @@
|
|||
* © 2015-2017 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.jei;
|
||||
package de.ellpeck.actuallyadditions.mod.jei.empowerer;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.EmpowererRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.JEIActuallyAdditionsPlugin;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
|
||||
import mezz.jei.api.gui.drawable.IDrawable;
|
|
@ -1,7 +1,8 @@
|
|||
package de.ellpeck.actuallyadditions.mod.jei;
|
||||
package de.ellpeck.actuallyadditions.mod.jei.fermenting;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.FermentingRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.JEIActuallyAdditionsPlugin;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
|
||||
import mezz.jei.api.gui.drawable.IDrawable;
|
|
@ -8,10 +8,11 @@
|
|||
* © 2015-2017 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.jei;
|
||||
package de.ellpeck.actuallyadditions.mod.jei.laser;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.LaserRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.JEIActuallyAdditionsPlugin;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
|
||||
import mezz.jei.api.gui.drawable.IDrawable;
|
|
@ -15,6 +15,7 @@ import de.ellpeck.actuallyadditions.api.internal.IMethodHandler;
|
|||
import de.ellpeck.actuallyadditions.api.lens.Lens;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.BlockLaserRelay;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.LaserRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||
|
@ -62,6 +63,29 @@ public class MethodHandler implements IMethodHandler {
|
|||
return worked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addRecipeEffectToStack(ItemStack stack, CoffeeIngredientRecipe ingredient) {
|
||||
boolean worked = false;
|
||||
if (ingredient != null) {
|
||||
List<MobEffectInstance> effects = ingredient.getEffects();
|
||||
if (!effects.isEmpty()) {
|
||||
for (MobEffectInstance effect : effects) {
|
||||
MobEffectInstance effectHas = this.getSameEffectFromStack(stack, effect);
|
||||
if (effectHas != null) {
|
||||
if (effectHas.getAmplifier() < ingredient.getMaxAmplifier() - 1) {
|
||||
this.addEffectProperties(stack, effect, false, true);
|
||||
worked = true;
|
||||
}
|
||||
} else {
|
||||
this.addEffectToStack(stack, effect);
|
||||
worked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return worked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MobEffectInstance getSameEffectFromStack(ItemStack stack, MobEffectInstance effect) {
|
||||
MobEffectInstance[] effectsStack = this.getEffectsFromStack(stack);
|
||||
|
|
|
@ -106,10 +106,10 @@ public final class PacketHandler {
|
|||
Player player = context.player().get();
|
||||
Level level = player.getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(compound.getString("WorldID"))));
|
||||
Entity entity = level.getEntity(compound.getInt("PlayerID"));
|
||||
if (entity instanceof Player) {
|
||||
AbstractContainerMenu container = ((Player) entity).containerMenu;
|
||||
if (container instanceof IButtonReactor) {
|
||||
((IButtonReactor) container).onButtonPressed(compound.getInt("ButtonID"), (Player) entity);
|
||||
if (entity instanceof Player p) {
|
||||
AbstractContainerMenu container = p.containerMenu;
|
||||
if (container instanceof IButtonReactor reactor) {
|
||||
reactor.onButtonPressed(compound.getInt("ButtonID"), (Player) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ public final class PacketHandler {
|
|||
@OnlyIn(Dist.CLIENT)
|
||||
public void handleData(CompoundTag compound, PlayPayloadContext context) {
|
||||
CompoundTag dataTag = compound.getCompound("Data");
|
||||
Player player = context.player().get(); //ActuallyAdditions.PROXY.getCurrentPlayer();
|
||||
Player player = context.player().orElse(null); //ActuallyAdditions.PROXY.getCurrentPlayer();
|
||||
|
||||
if (player != null) {
|
||||
PlayerData.getDataFromPlayer(player).readFromNBT(dataTag, false);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package de.ellpeck.actuallyadditions.mod.sack;
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -70,6 +71,16 @@ public class SackManager extends SavedData {
|
|||
return Optional.empty();
|
||||
}
|
||||
|
||||
public Optional<ItemStackHandlerAA> getHandler(ItemStack stack) {
|
||||
if (stack.getOrCreateTag().contains("UUID")) {
|
||||
UUID uuid = stack.getTag().getUUID("UUID");
|
||||
if (data.containsKey(uuid))
|
||||
return Optional.of(data.get(uuid).getSpecialHandler());
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
public static SackManager load(CompoundTag nbt) {
|
||||
if (nbt.contains("Sacks")) {
|
||||
ListTag list = nbt.getList("Sacks", CompoundTag.TAG_COMPOUND);
|
||||
|
|
|
@ -22,19 +22,16 @@ import net.minecraft.world.item.ItemStack;
|
|||
public class FilterSettings {
|
||||
public final ItemStackHandlerAA filterInventory;
|
||||
public boolean isWhitelist;
|
||||
public boolean respectNBT;
|
||||
public boolean respectMod;
|
||||
private boolean lastWhitelist;
|
||||
private boolean lastRespectNBT;
|
||||
private boolean lastRespectMod;
|
||||
|
||||
public enum Buttons {
|
||||
WHITELIST,
|
||||
NBT,
|
||||
MOD
|
||||
}
|
||||
|
||||
public FilterSettings(int slots, boolean defaultWhitelist, boolean defaultRespectNBT, boolean defaultRespectMod) {
|
||||
public FilterSettings(int slots, boolean defaultWhitelist, boolean defaultRespectMod) {
|
||||
this.filterInventory = new ItemStackHandlerAA(slots) {
|
||||
@Override
|
||||
protected void onContentsChanged(int slot) {
|
||||
|
@ -44,13 +41,12 @@ public class FilterSettings {
|
|||
};
|
||||
|
||||
this.isWhitelist = defaultWhitelist;
|
||||
this.respectNBT = defaultRespectNBT;
|
||||
this.respectMod = defaultRespectMod;
|
||||
}
|
||||
|
||||
public void onContentsChanged() {}
|
||||
|
||||
public static boolean check(ItemStack stack, ItemStackHandlerAA filter, boolean whitelist, boolean nbt, boolean mod) {
|
||||
public static boolean check(ItemStack stack, ItemStackHandlerAA filter, boolean whitelist, boolean mod) {
|
||||
if (!stack.isEmpty()) {
|
||||
for (int i = 0; i < filter.getSlots(); i++) {
|
||||
ItemStack slot = filter.getStackInSlot(i);
|
||||
|
@ -61,11 +57,11 @@ public class FilterSettings {
|
|||
DrillItem.loadSlotsFromNBT(inv, slot);
|
||||
for (int k = 0; k < inv.getSlots(); k++) {
|
||||
ItemStack filterSlot = inv.getStackInSlot(k);
|
||||
if (!filterSlot.isEmpty() && areEqualEnough(filterSlot, stack, nbt, mod)) {
|
||||
if (!filterSlot.isEmpty() && areEqualEnough(filterSlot, stack, mod)) {
|
||||
return whitelist;
|
||||
}
|
||||
}
|
||||
} else if (areEqualEnough(slot, stack, nbt, mod)) {
|
||||
} else if (areEqualEnough(slot, stack, mod)) {
|
||||
return whitelist;
|
||||
}
|
||||
}
|
||||
|
@ -74,24 +70,19 @@ public class FilterSettings {
|
|||
return !whitelist;
|
||||
}
|
||||
|
||||
private static boolean areEqualEnough(ItemStack first, ItemStack second, boolean nbt, boolean mod) {
|
||||
private static boolean areEqualEnough(ItemStack first, ItemStack second, boolean mod) {
|
||||
Item firstItem = first.getItem();
|
||||
Item secondItem = second.getItem();
|
||||
if (mod && BuiltInRegistries.ITEM.getKey(firstItem).getNamespace().equals(BuiltInRegistries.ITEM.getKey(secondItem).getNamespace())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (firstItem != secondItem) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !nbt || ItemStack.isSameItemSameTags(first, second);
|
||||
return firstItem == secondItem;
|
||||
}
|
||||
|
||||
public void writeToNBT(CompoundTag tag, String name) {
|
||||
CompoundTag compound = new CompoundTag();
|
||||
compound.putBoolean("Whitelist", this.isWhitelist);
|
||||
compound.putBoolean("NBT", this.respectNBT);
|
||||
compound.putBoolean("Mod", this.respectMod);
|
||||
compound.put("Items", filterInventory.serializeNBT());
|
||||
tag.put(name, compound);
|
||||
|
@ -100,37 +91,29 @@ public class FilterSettings {
|
|||
public void readFromNBT(CompoundTag tag, String name) {
|
||||
CompoundTag compound = tag.getCompound(name);
|
||||
this.isWhitelist = compound.getBoolean("Whitelist");
|
||||
this.respectNBT = compound.getBoolean("NBT");
|
||||
this.respectMod = compound.getBoolean("Mod");
|
||||
this.filterInventory.deserializeNBT(compound.getCompound("Items"));
|
||||
}
|
||||
|
||||
public boolean needsUpdateSend() {
|
||||
return this.lastWhitelist != this.isWhitelist || this.lastRespectNBT != this.respectNBT || this.lastRespectMod != this.respectMod;
|
||||
return this.lastWhitelist != this.isWhitelist || this.lastRespectMod != this.respectMod;
|
||||
}
|
||||
|
||||
public void updateLasts() {
|
||||
this.lastWhitelist = this.isWhitelist;
|
||||
this.lastRespectNBT = this.respectNBT;
|
||||
this.lastRespectMod = this.respectMod;
|
||||
}
|
||||
|
||||
public void onButtonPressed(int id) {
|
||||
if (id == Buttons.WHITELIST.ordinal()) {
|
||||
this.isWhitelist = !this.isWhitelist;
|
||||
} else if (id == Buttons.NBT.ordinal()) {
|
||||
this.respectNBT = !this.respectNBT;
|
||||
} else if (id == Buttons.MOD.ordinal()) {
|
||||
this.respectMod = !this.respectMod;
|
||||
|
||||
if (this.respectMod) {
|
||||
this.respectNBT = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean check(ItemStack stack) {
|
||||
return !this.needsCheck() || check(stack, this.filterInventory, this.isWhitelist, this.respectNBT, this.respectMod);
|
||||
return !this.needsCheck() || check(stack, this.filterInventory, this.isWhitelist, this.respectMod);
|
||||
}
|
||||
|
||||
public boolean needsCheck() {
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
package de.ellpeck.actuallyadditions.mod.tile;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.ActuallyTags;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
|
||||
import de.ellpeck.actuallyadditions.mod.AASounds;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoffeeMachine;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ItemCoffee;
|
||||
|
@ -31,6 +31,7 @@ import net.minecraft.world.entity.player.Inventory;
|
|||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.RecipeHolder;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
@ -158,12 +159,12 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
|||
|
||||
@Override
|
||||
public IAcceptor getAcceptor() {
|
||||
return (slot, stack, automation) -> !automation || slot >= 3 && ItemCoffee.getIngredientFromStack(stack) != null || slot == SLOT_COFFEE_BEANS && stack.is(ActuallyTags.Items.COFFEE_BEANS) || slot == SLOT_INPUT && stack.getItem() == ActuallyItems.COFFEE_CUP.get();
|
||||
return (slot, stack, automation) -> !automation || slot >= 3 && ItemCoffee.getIngredientRecipeFromStack(stack) != null || slot == SLOT_COFFEE_BEANS && stack.is(ActuallyTags.Items.COFFEE_BEANS) || slot == SLOT_INPUT && stack.getItem() == ActuallyItems.COFFEE_CUP.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRemover getRemover() {
|
||||
return (slot, automation) -> !automation || slot == SLOT_OUTPUT || slot >= 3 && slot < this.inv.getSlots() && ItemCoffee.getIngredientFromStack(this.inv.getStackInSlot(slot)) == null;
|
||||
return (slot, automation) -> !automation || slot == SLOT_OUTPUT || slot >= 3 && slot < this.inv.getSlots() && ItemCoffee.getIngredientRecipeFromStack(this.inv.getStackInSlot(slot)) == null;
|
||||
}
|
||||
|
||||
public void storeCoffee() {
|
||||
|
@ -195,9 +196,9 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
|||
ItemStack output = new ItemStack(ActuallyItems.COFFEE_BEANS.get());
|
||||
for (int i = 3; i < this.inv.getSlots(); i++) {
|
||||
if (StackUtil.isValid(this.inv.getStackInSlot(i))) {
|
||||
CoffeeIngredient ingredient = ItemCoffee.getIngredientFromStack(this.inv.getStackInSlot(i));
|
||||
if (ingredient != null) {
|
||||
if (ingredient.effect(output)) {
|
||||
RecipeHolder<CoffeeIngredientRecipe> recipeHolder = ItemCoffee.getIngredientRecipeFromStack(this.inv.getStackInSlot(i));
|
||||
if (recipeHolder != null) {
|
||||
if (recipeHolder.value().effect(output)) {
|
||||
this.inv.setStackInSlot(i, StackUtil.shrinkForContainer(this.inv.getStackInSlot(i), 1));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@ import java.util.Optional;
|
|||
|
||||
public class TileEntityLaserRelayItemAdvanced extends TileEntityLaserRelayItem implements IButtonReactor, MenuProvider {
|
||||
|
||||
public FilterSettings leftFilter = new FilterSettings(12, true, false, false);
|
||||
public FilterSettings rightFilter = new FilterSettings(12, true, false, false);
|
||||
public FilterSettings leftFilter = new FilterSettings(12, true, false);
|
||||
public FilterSettings rightFilter = new FilterSettings(12, true, false);
|
||||
|
||||
public TileEntityLaserRelayItemAdvanced(BlockPos pos, BlockState state) {
|
||||
super(ActuallyBlocks.LASER_RELAY_ITEM_ADVANCED.getTileEntityType(), pos, state);
|
||||
|
@ -118,7 +118,7 @@ public class TileEntityLaserRelayItemAdvanced extends TileEntityLaserRelayItem i
|
|||
ItemStack copy = stack.copy();
|
||||
copy.setCount(1);
|
||||
|
||||
if (!FilterSettings.check(copy, usedSettings.filterInventory, true, usedSettings.respectNBT, usedSettings.respectMod)) {
|
||||
if (!FilterSettings.check(copy, usedSettings.filterInventory, true, usedSettings.respectMod)) {
|
||||
for (int k = 0; k < usedSettings.filterInventory.getSlots(); k++) {
|
||||
ItemStack slot = usedSettings.filterInventory.getStackInSlot(k);
|
||||
if (!slot.isEmpty()) {
|
||||
|
|
|
@ -38,7 +38,7 @@ import java.util.List;
|
|||
public class TileEntityRangedCollector extends TileEntityInventoryBase implements IButtonReactor, MenuProvider {
|
||||
|
||||
public static final int RANGE = 6;
|
||||
public FilterSettings filter = new FilterSettings(12, true, false, false);
|
||||
public FilterSettings filter = new FilterSettings(12, true, false);
|
||||
|
||||
public TileEntityRangedCollector(BlockPos pos, BlockState state) {
|
||||
super(ActuallyBlocks.RANGED_COLLECTOR.getTileEntityType(), pos, state, 6);
|
||||
|
|
|
@ -44,5 +44,8 @@ public class ResourceReloader implements ResourceManagerReloadListener {
|
|||
|
||||
ActuallyAdditionsAPI.CRUSHER_RECIPES.clear();
|
||||
ActuallyAdditionsAPI.CRUSHER_RECIPES.addAll(recipeManager.getAllRecipesFor(ActuallyRecipes.Types.CRUSHING.get()));
|
||||
|
||||
ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS.clear();
|
||||
ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS.addAll(recipeManager.getAllRecipesFor(ActuallyRecipes.Types.COFFEE_INGREDIENT.get()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -648,16 +648,16 @@
|
|||
"achievement.actuallyadditions.completeTrials": "A Botanist's Dream",
|
||||
"achievement.actuallyadditions.completeTrials.desc": "Complete all Trials in the Manual",
|
||||
"_comment": "Booklet Recipe Names",
|
||||
"booklet.actuallyadditions.shapelessRecipe": "Shapeless Recipe",
|
||||
"booklet.actuallyadditions.shapedRecipe": "Shaped Recipe",
|
||||
"booklet.actuallyadditions.shapelessOreRecipe": "Shapeless OreDict Recipe",
|
||||
"booklet.actuallyadditions.shapedOreRecipe": "Shaped OreDict Recipe",
|
||||
"booklet.actuallyadditions.empowererRecipe": "Empowerer Recipe",
|
||||
"booklet.actuallyadditions.crusherRecipe": "Crusher Recipe",
|
||||
"booklet.actuallyadditions.furnaceRecipe": "Furnace Recipe",
|
||||
"booklet.actuallyadditions.reconstructorRecipe": "Atomic Reconstructor Recipe",
|
||||
"booklet.actuallyadditions.shapeless_recipe": "Shapeless Recipe",
|
||||
"booklet.actuallyadditions.shaped_recipe": "Shaped Recipe",
|
||||
"booklet.actuallyadditions.shapeless_ore_recipe": "Shapeless OreDict Recipe",
|
||||
"booklet.actuallyadditions.shapedore_recipe": "Shaped OreDict Recipe",
|
||||
"booklet.actuallyadditions.empowerer_recipe": "Empowerer Recipe",
|
||||
"booklet.actuallyadditions.crusher_recipe": "Crusher Recipe",
|
||||
"booklet.actuallyadditions.furnace_recipe": "Furnace Recipe",
|
||||
"booklet.actuallyadditions.reconstructor_recipe": "Atomic Reconstructor Recipe",
|
||||
"_comment": "Booklet Entries",
|
||||
"booklet.actuallyadditions.indexEntry.gettingStarted": "Getting Started",
|
||||
"booklet.actuallyadditions.indexEntry.getting_started": "Getting Started",
|
||||
"booklet.actuallyadditions.indexEntry.misc": "Miscellaneous",
|
||||
"booklet.actuallyadditions.indexEntry.crossover": "Mod Crossover",
|
||||
"booklet.actuallyadditions.indexEntry.functionalNoRF": "Blocks that don't use CF",
|
||||
|
@ -847,10 +847,10 @@
|
|||
"booklet.actuallyadditions.chapter.crystals.text.3": "It should be noted that any recipes listed without information about Lenses <imp>don't use one<r>. <n><i>I thought that was obvious.",
|
||||
"booklet.actuallyadditions.chapter.crystals.text.5": "When you have crafted a couple of items, you might want to find a way to <imp>automate this<r>. <n>There is a very simple way to do accomplish this: <n>Place the <item>Atomic Reconstructor<r> down facing into a <item>Precision Dropper<r> (to find it, look it up in the <imp>All Items<r> Entry!). <n>Next, place a <item>Ranged Collector<r> in the area that has the converted items set as a whitelist. <n>Now you can just chuck your raw materials into the Dropper to convert them!",
|
||||
"booklet.actuallyadditions.chapter.crystals.text.6": "<n><n><n><i>Molecular Transformilator",
|
||||
"booklet.actuallyadditions.chapter.bookTutorial": "Intro to the Manual",
|
||||
"booklet.actuallyadditions.chapter.bookTutorial.text.1": "The <item>Actually Additions Manual<r>, the book you are looking at right now, contains a variety of <imp>useful information about all of the items<r>. <n>Once you get the hang of it, it is very easy to navigate. Here is a quick rundown: <n><n>While you are in a <item>chapter<r>, like this one, you can use the <imp>white buttons at the bottom<r> to turn the page back or forwards. This can also be done by <imp>using the scroll wheel<r>. <n>Chapters, however, aren't the only thing that this book consists of.",
|
||||
"booklet.actuallyadditions.chapter.bookTutorial.text.2": "Were you to <imp>go back<r> a level via the <imp>buttom on the top left<r> or via <imp>right-clicking<r>, you would find yourself inside an <item>entry<r>. Entries contain all chapters that are related to <imp>a specific topic<r>. Here, you can also <imp>turn pages<r> and click the items on the page. <n><n>Were you to <imp>go back another level<r> (again, via the button on the top left or right-clicking), you would find yourself on the <item>main page<r> of the manual. <n><n><i>Turn the page now via the button on the bottom right.",
|
||||
"booklet.actuallyadditions.chapter.bookTutorial.text.3": "On the <item>main page<r>, you can see (and click on!) a list of <imp>all of the entries<r>. <n><n>The <item>bookmarks<r> are placed at the <imp>bottom of the booklet<r>. While you are <imp>in a chapter<r>, you can <imp>bookmark<r> the page you are currently on <imp>for later viewing<r>. <n><n>The booklet also has <imp>a lot of other functions<r>, though. Look around in the GUI to explore them all! <n><n><i>Now press the back button on the top left or right-click to leave this chapter.",
|
||||
"booklet.actuallyadditions.chapter.book_tutorial": "Intro to the Manual",
|
||||
"booklet.actuallyadditions.chapter.book_tutorial.text.1": "The <item>Actually Additions Manual<r>, the book you are looking at right now, contains a variety of <imp>useful information about all of the items<r>. <n>Once you get the hang of it, it is very easy to navigate. Here is a quick rundown: <n><n>While you are in a <item>chapter<r>, like this one, you can use the <imp>white buttons at the bottom<r> to turn the page back or forwards. This can also be done by <imp>using the scroll wheel<r>. <n>Chapters, however, aren't the only thing that this book consists of.",
|
||||
"booklet.actuallyadditions.chapter.book_tutorial.text.2": "Were you to <imp>go back<r> a level via the <imp>buttom on the top left<r> or via <imp>right-clicking<r>, you would find yourself inside an <item>entry<r>. Entries contain all chapters that are related to <imp>a specific topic<r>. Here, you can also <imp>turn pages<r> and click the items on the page. <n><n>Were you to <imp>go back another level<r> (again, via the button on the top left or right-clicking), you would find yourself on the <item>main page<r> of the manual. <n><n><i>Turn the page now via the button on the bottom right.",
|
||||
"booklet.actuallyadditions.chapter.book_tutorial.text.3": "On the <item>main page<r>, you can see (and click on!) a list of <imp>all of the entries<r>. <n><n>The <item>bookmarks<r> are placed at the <imp>bottom of the booklet<r>. While you are <imp>in a chapter<r>, you can <imp>bookmark<r> the page you are currently on <imp>for later viewing<r>. <n><n>The booklet also has <imp>a lot of other functions<r>, though. Look around in the GUI to explore them all! <n><n><i>Now press the back button on the top left or right-click to leave this chapter.",
|
||||
"booklet.actuallyadditions.chapter.reconstructorLenses": "Intro to Lenses",
|
||||
"booklet.actuallyadditions.chapter.reconstructorLenses.text.1": "The <item>Atomic Reconstructor<r>, by default, can only convert some blocks. <n>This can be changed, however, with <item>Lenses<r>. They can be attached to the Reconstructor via <imp>right-clicking<r> with them in hand. To remove them, right-click with an empty hand. <n>They all use a different amount of power and will only activate <imp>once they have it<r>. <n><item>Lenses<r> have lots of different features and uses, as you can see in <imp>this chapter<r>. <n>However, there are also some <imp>other useful recipes<r> too.",
|
||||
"booklet.actuallyadditions.chapter.additionalRecipes": "Additional Recipes",
|
||||
|
@ -908,11 +908,13 @@
|
|||
"booklet.actuallyadditions.chapter.displayStand.text.2": "The <item>Leaf Blower<r> and <item>Advanced Leaf Blower<r> can be placed onto the display stand, resulting in the grass and leaves around it to be blown away. <n><n><item>Potion Rings<r> can be placed onto the display stand. The normal version will give the specified potion effect to <imp>only one<r> living entity in a small area, while the advanced version will <imp>give a potion effect to all living entities<r> in a <imp>big area<r> while using up a significant amount of <imp>CF<r>.",
|
||||
"booklet.actuallyadditions.chapter.itemFilter": "Item Filter",
|
||||
"booklet.actuallyadditions.chapter.itemFilter.text.1": "The <item>Item Filter<r> can be used in <item>Advanced Item Laser Relays<r>, <item>ESDs<r> and <item>Ranged Collectors<r> to <imp>enlargen the size of their whitelist<r>. This can be done by right-clicking with the filter in hand and placing items to be filtered inside of it. The filter can then be placed into any whitelist slot in the desired machine. <n>For more information on this, <imp>hover over the whitelist buttons in the GUIs of whitelistable machines<r>!",
|
||||
"booklet.actuallyadditions.chapter.videoGuide": "A Video Guide",
|
||||
"booklet.actuallyadditions.chapter.videoGuide.text.1": "If you want to have a <imp>visual introduction<r> to see what <item>Actually Additions<r> has to offer, you can watch this really awesome video by a friend of mine, <item>Booty Toast<r> (yes, weird name, I know). <n>His video covers most of the main stuff the mod has to offer, however it is <imp>a bit outdated<r> and doesn't cover everything. It's still a <imp>great introduction to the mod<r> though.",
|
||||
"booklet.actuallyadditions.chapter.videoGuide.button.1": "BootyToast's Video",
|
||||
"booklet.actuallyadditions.chapter.videoGuide.text.2": "There is also the second option, a <imp>playlist<r> consisting of a <imp>spotlight<r> by <item>Direwolf20<r>. It is a bit more recent than the other video, however, it is <imp>substantially longer<r> and provides a more detailed overview. So you have the choice: The quicker introduction on the left or the longer, more in-depth introduction down below.",
|
||||
"booklet.actuallyadditions.chapter.videoGuide.button.2": "Direwolf's Playlist",
|
||||
"booklet.actuallyadditions.chapter.video_guide": "A Video Guide",
|
||||
"booklet.actuallyadditions.chapter.video_guide.booty.text.1": "If you want to have a <imp>visual introduction<r> to see what <item>Actually Additions<r> has to offer, you can watch this really awesome video by a friend of mine, <item>Booty Toast<r> (yes, weird name, I know).",
|
||||
"booklet.actuallyadditions.chapter.video_guide.booty.text.2": "<n>His video covers most of the main stuff the mod has to offer, however it is <imp>a bit outdated<r> and doesn't cover everything. It's still a <imp>great introduction to the mod<r> though.",
|
||||
"booklet.actuallyadditions.chapter.video_guide.booty.button": "BootyToast's Video",
|
||||
"booklet.actuallyadditions.chapter.video_guide.dire.text.1": "There is also the second option, a <imp>playlist<r> consisting of a <imp>spotlight<r> by <item>Direwolf20<r>. It is a bit more recent than the other video, however, it is <imp>substantially longer<r> and provides a more detailed overview. So you have the choice: The quicker introduction",
|
||||
"booklet.actuallyadditions.chapter.video_guide.dire.text.2": "on the left or the longer, more in-depth introduction down below.",
|
||||
"booklet.actuallyadditions.chapter.video_guide.dire.button": "Direwolf's Playlist",
|
||||
"booklet.actuallyadditions.chapter.shockSuppressor": "Shock Absorber",
|
||||
"booklet.actuallyadditions.chapter.shockSuppressor.text.1": "The <item>Shock Absorber<r> is a block that, when supplied with <imp>CF<r>, it will protect an area of <imp>up to <range> blocks around it<r> from any type of <imp>Explosion<r>, be it ghasts, TNT or creepers. <n>Every block that is protected will result in a loss of <imp><rf> CF<r>.",
|
||||
"booklet.actuallyadditions.chapter.shockSuppressor.text.2": "<i>Credit where credit is due: <r><n><n>Or something like that. <n>Anyways, this thing was thought up and suggested to me by <imp>praetoras<r>. Thanks for that brilliant idea! <n><n><i>What's a fourth wall..?",
|
||||
|
@ -978,5 +980,9 @@
|
|||
"booklet.actuallyadditions.chapter.crystalClusters.text.1": "<item>Crystal Clusters<r> are blocks that generate naturally inside of <imp>Lush Caves<r>. <n>When broken, they <imp>drop<r> one or more <item>Crystal Shards<r> that can be crafted together to create <item>Crystals<r>. <n><item>Crystal Clusters<r> emit a bit of light, making them perfect for <imp>decoration<r>. To harvest them in their block form, <imp>Silk Touch<r> can be used.",
|
||||
"booklet.actuallyadditions.chapter.trialsIntro": "Intro to Trials",
|
||||
"booklet.actuallyadditions.chapter.trialsIntro.text.1": "<item>Trials<r> are a set of fun and interesting <imp>challenges<r> that you can use to <imp>get inspiration<r> on what to build next. <n>Once you <imp>complete<r> a <item>Trial<r>, you can <imp>press the button<r> in the bottom right to mark the trial as completed, turning its name in the list green. <n>Since there is <imp>no way to check<r> if a trial is actually completed, <item>Trials<r> are meant as <imp>personal goals<r>. <n><n>To <imp>visit<r> the <item>Trials<r> page, you can click the <imp>bookmark<r> in the <imp>top right<r> corner of the manual GUI.",
|
||||
"booklet.actuallyadditions.chapter.trialsIntro.text.2": "Note that <item>Trials<r> are designed in a way that they should be completed with the concepts of <imp>Minecraft<r> and <imp>Actually Additions<r> alone."
|
||||
"booklet.actuallyadditions.chapter.trialsIntro.text.2": "Note that <item>Trials<r> are designed in a way that they should be completed with the concepts of <imp>Minecraft<r> and <imp>Actually Additions<r> alone.",
|
||||
"_comment": "JEI",
|
||||
"jei.actuallyadditions.coffee.special": "Special Feature",
|
||||
"jei.actuallyadditions.coffee.maxAmount": "Max Amount",
|
||||
"jei.actuallyadditions.coffee.extra.milk": "+01:00, -1 Level"
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
After Width: | Height: | Size: 355 B |
Loading…
Reference in a new issue