This commit is contained in:
HuTao今天吃什么
2022-10-10 23:10:47 +08:00
parent 71fd64cea7
commit 4eaf1179a5
32 changed files with 240 additions and 64 deletions

View File

@@ -15,6 +15,7 @@ fc4deb51d88c3e1375ea88f9613f9a4d77ba35b2 assets/extrabotany/blockstates/floating
702fc6a7e5063e9e417e96756ed3a2d06389abf9 assets/extrabotany/blockstates/floating_omni_violet.json
8b9fd489aa8dbc73e12e654dc9283daf44225efa assets/extrabotany/blockstates/floating_reikar_orchid.json
a1be7243d90a320436ac01fbf38e85fb0fe07b5c assets/extrabotany/blockstates/floating_serenitian.json
4e70ffd08a766034c1a4ce4aa039c7c026a2074d assets/extrabotany/blockstates/floating_stonesia.json
9027328754e3415e083ed88f6233ee13b5d2c26e assets/extrabotany/blockstates/floating_sunshine_lily.json
066746c480a0f633ea3854d3038e3a7030f41491 assets/extrabotany/blockstates/floating_tinkle_flower.json
e9d047b6e3cb2b6c8c847ccba97a1d28509612d9 assets/extrabotany/blockstates/gemini_orchid.json
@@ -22,6 +23,7 @@ a11e55f651479912f38def68d408d3365bff4e6b assets/extrabotany/blockstates/moonligh
5a080eb436b6239c0d12ac342ebf275038e45769 assets/extrabotany/blockstates/omni_violet.json
71832b8c18734652952bc3152cacd3f314ca391f assets/extrabotany/blockstates/reikar_orchid.json
5b4b6c301ff57c7d4006e79654cac0e1e68cbe60 assets/extrabotany/blockstates/serenitian.json
143f7e76a2e6e0a5a5c403ca94288116a00b88fc assets/extrabotany/blockstates/stonesia.json
31853f21bb80a913ba27e5053a843459b3d7d37d assets/extrabotany/blockstates/sunshine_lily.json
98ef3075f38b46cec1ea7720d159ad1109096786 assets/extrabotany/blockstates/tinkle_flower.json
3fd855af1fb025327aaa65ad4267f5f5bbd1bee2 assets/extrabotany/lang/en_us.json
@@ -43,6 +45,7 @@ f1f02ee605d2be27d59b606e6dcbc3f414af4ce9 assets/extrabotany/models/block/floatin
057af000dbb9ab4c3bb5130af0eaa68621a11b6a assets/extrabotany/models/block/floating_omni_violet.json
14fe5ffac46a71909d7e847110af5b12c4d6e1fb assets/extrabotany/models/block/floating_reikar_orchid.json
cbe18059f2fd88244ab8e40e02ff7f356310eb58 assets/extrabotany/models/block/floating_serenitian.json
aef5e0b0e5d2486a24077afa87937612efcfff45 assets/extrabotany/models/block/floating_stonesia.json
a1eba4b8f0d964a4a9d035e3e2a352cd8eeed8a8 assets/extrabotany/models/block/floating_sunshine_lily.json
3e2bc6fee567de00252b62ae6c06d89a6fe02ef5 assets/extrabotany/models/block/floating_tinkle_flower.json
967e574d70c019c47dbf81222eec2509bb59061a assets/extrabotany/models/block/gemini_orchid.json
@@ -50,6 +53,7 @@ a1eba4b8f0d964a4a9d035e3e2a352cd8eeed8a8 assets/extrabotany/models/block/floatin
4288f9020b926e4f818fddb5cfdf7f0ba92f2cb0 assets/extrabotany/models/block/omni_violet.json
5a684062aa8ee11910e41e9d4e1b29e4752a9958 assets/extrabotany/models/block/reikar_orchid.json
d646020789da07a0ff51338c6028cdbc172c80ca assets/extrabotany/models/block/serenitian.json
6f8c8e5a30bfde90289dc6cf1c6fa2eb184c851c assets/extrabotany/models/block/stonesia.json
b5cd069aca1419bf8fd640c67346e12432b61ec3 assets/extrabotany/models/block/sunshine_lily.json
78602e7c59cb0adb6c0ec37cd3b1b623b6e75e07 assets/extrabotany/models/block/tinkle_flower.json
94b6180fdfc8fee753e95283aa508f46067cc707 assets/extrabotany/models/item/acquaint_fate.json
@@ -93,6 +97,7 @@ f1f02ee605d2be27d59b606e6dcbc3f414af4ce9 assets/extrabotany/models/item/floating
057af000dbb9ab4c3bb5130af0eaa68621a11b6a assets/extrabotany/models/item/floating_omni_violet.json
14fe5ffac46a71909d7e847110af5b12c4d6e1fb assets/extrabotany/models/item/floating_reikar_orchid.json
cbe18059f2fd88244ab8e40e02ff7f356310eb58 assets/extrabotany/models/item/floating_serenitian.json
aef5e0b0e5d2486a24077afa87937612efcfff45 assets/extrabotany/models/item/floating_stonesia.json
a1eba4b8f0d964a4a9d035e3e2a352cd8eeed8a8 assets/extrabotany/models/item/floating_sunshine_lily.json
3e2bc6fee567de00252b62ae6c06d89a6fe02ef5 assets/extrabotany/models/item/floating_tinkle_flower.json
a4b4f1519eeee6a397e1e2c65afdf9a292d248cd assets/extrabotany/models/item/forest_book.json
@@ -168,6 +173,7 @@ d51aa3c77d5e3cfdb9fb25602e9eb2305ba21fa5 assets/extrabotany/models/item/spirit_f
2262b2c2291121685d0276dae42f9b3988f40085 assets/extrabotany/models/item/spirit_fuel.json
4eebefafebc705b6def89fb591689c3450db823b assets/extrabotany/models/item/splash_grenade.json
b78c5e787b5d9ba2de8008f803415a44fb09b8f6 assets/extrabotany/models/item/stone_mask.json
36834ba0ed04325ab475c0ab2e7e13901dd0e5d1 assets/extrabotany/models/item/stonesia.json
edeaf1e82b57ddc4fa1d2a9cc699372872b01c0e assets/extrabotany/models/item/sun_ring.json
42d31289077873e81cca40936b1bb8f1dfc3f734 assets/extrabotany/models/item/sunshine_lily.json
6fa802ccdf32623fa2b3639511c065db395c24e3 assets/extrabotany/models/item/super_crown.json
@@ -189,7 +195,7 @@ f4838518bcfd60b744cb0e3e403ec06e104bb9ad assets/extrabotany/tinkering/materials/
95e5f6d6428d98364dfcd4d1e96e5bf5571a35bd assets/extrabotany/tinkering/materials/spirit_fuel.json
c9ff3b120bf0d1145a5f6e82846b8f449c734da9 data/botania/tags/blocks/functional_special_flowers.json
ddc834a139f949eccb001070727eabd4ff1ee8ce data/botania/tags/blocks/generating_special_flowers.json
e24955f0e3e0924ca0570a81ee2998680679b5ea data/botania/tags/blocks/special_floating_flowers.json
bbf91c6f12c1a38fde728f9416a673061758ddbc data/botania/tags/blocks/special_floating_flowers.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/botania/tags/items/floating_flowers.json
c9ff3b120bf0d1145a5f6e82846b8f449c734da9 data/botania/tags/items/functional_special_flowers.json
ddc834a139f949eccb001070727eabd4ff1ee8ce data/botania/tags/items/generating_special_flowers.json
@@ -216,7 +222,7 @@ fdd7219319bd75a5c113c12c6ca07dace05ce9a4 data/botania/tags/items/lens.json
5e4ee14735f7fd3237f544283308b0004b923e0e data/botania/tags/items/petals/yellow.json
9c618165c4ee510a737d9ee5a0e8a1d8699e4f81 data/botania/tags/items/rods.json
6574d25d30d63ccbce291b3a563ab57b3a10b3e6 data/botania/tags/items/runes.json
e24955f0e3e0924ca0570a81ee2998680679b5ea data/botania/tags/items/special_floating_flowers.json
bbf91c6f12c1a38fde728f9416a673061758ddbc data/botania/tags/items/special_floating_flowers.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/botania/tags/items/special_flowers.json
0bcd8009b859504f81d3490e4176ba911681a065 data/botania/tags/items/terra_pick_blacklist.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/curios/tags/items/belt.json
@@ -278,6 +284,7 @@ fc7fec4540c9a1e548369248b50f98843a3001cd data/extrabotany/loot_tables/blocks/flo
4bf8811e2645728501885f9498c8abdb7e199b63 data/extrabotany/loot_tables/blocks/floating_omni_violet.json
0bac25506817356b9400db7a7a5295257d57e72d data/extrabotany/loot_tables/blocks/floating_reikar_orchid.json
b17c8288e6931875d55a7f3f06c3bb95d4f41a36 data/extrabotany/loot_tables/blocks/floating_serenitian.json
1565fc084b17fd3f8b908622a9e938d6a9055216 data/extrabotany/loot_tables/blocks/floating_stonesia.json
8b2aada4986b4e7a7026575355b625e8ba43cfc4 data/extrabotany/loot_tables/blocks/floating_sunshine_lily.json
98ded861d9c63366f7b60b27d6185787092a5aec data/extrabotany/loot_tables/blocks/floating_tinkle_flower.json
75706a7872fef7b4cff04cbc4ed30f6fcb65721d data/extrabotany/loot_tables/blocks/gemini_orchid.json
@@ -288,6 +295,7 @@ e6b7f863b745184b30e321660b9238b07ca61634 data/extrabotany/loot_tables/blocks/moo
791abb7154991dd555eeefb64033b8ddc5e6f867 data/extrabotany/loot_tables/blocks/power_frame.json
fccfbadffe8a5dd8106c92d2780115646d230f53 data/extrabotany/loot_tables/blocks/reikar_orchid.json
39ee540530377de9f1da00180e9e63cb4574efb5 data/extrabotany/loot_tables/blocks/serenitian.json
fecb60968f90c2a51deb68942e80fd4651aed5b2 data/extrabotany/loot_tables/blocks/stonesia.json
8d03058337490d17a825760d24c44d3db5c80fba data/extrabotany/loot_tables/blocks/sunshine_lily.json
5f653c236425ba3efe35b505142a325301a8abd8 data/extrabotany/loot_tables/blocks/tinkle_flower.json
013c9c2c9a9fefca91736a1e1ebf245c0682f9c0 data/extrabotany/recipes/brew/allmighty.json
@@ -345,6 +353,7 @@ c7a38c3b7dfd0c83127fd131e5abc601058fdd25 data/extrabotany/recipes/runic_altar/ig
dbf40d12a66f31de36e06310e706fce4e0af36d5 data/extrabotany/recipes/runic_altar/powerglove.json
2895c3c1f03d0dbb8d0ccf2936ca9b0117985e42 data/extrabotany/recipes/runic_altar/shadowium1.json
ed07f4335d47b36c3f27e1117958956dc96978de data/extrabotany/recipes/runic_altar/shadowium2.json
a5ca3f30a26cb6ab32795c0e9e3bcea7efcc8d37 data/extrabotany/recipes/stonesia/test_coal.json
1463595a483f0bdcdcb1df667003e6fa9b5b6cb0 data/extrabotany/recipes/terra_plate/aerialite.json
270f1553c4941f8ff091f3b4eb41cdc69c493ee5 data/extrabotany/recipes/terra_plate/the_universe.json
5f2d825cb934058931ce02d86dc0320ad86e047b data/extrabotany/recipes/tools/materials/casting/photonium.json

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "extrabotany:block/floating_stonesia"
}
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "extrabotany:block/stonesia"
}
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/block",
"loader": "botania:floating_flower",
"flower": {
"parent": "extrabotany:block/stonesia"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "extrabotany:block/shapes/cross",
"textures": {
"cross": "extrabotany:block/stonesia"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/block",
"loader": "botania:floating_flower",
"flower": {
"parent": "extrabotany:block/stonesia"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "extrabotany:block/stonesia"
}
}

View File

@@ -10,6 +10,7 @@
"extrabotany:floating_omni_violet",
"extrabotany:floating_reikar_orchid",
"extrabotany:floating_serenitian",
"extrabotany:floating_stonesia",
"extrabotany:floating_sunshine_lily",
"extrabotany:floating_tinkle_flower"
]

View File

@@ -10,6 +10,7 @@
"extrabotany:floating_omni_violet",
"extrabotany:floating_reikar_orchid",
"extrabotany:floating_serenitian",
"extrabotany:floating_stonesia",
"extrabotany:floating_sunshine_lily",
"extrabotany:floating_tinkle_flower"
]

View File

@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "extrabotany:floating_stonesia"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "extrabotany:stonesia"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@@ -36,6 +36,8 @@ public interface IStonesiaRecipe extends Recipe<Container>
int getTime();
int getMana();
@Override
default RecipeType<?> getType() {
return Registry.RECIPE_TYPE.getOptional(TYPE_ID).get();

View File

@@ -25,9 +25,11 @@ import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import org.jetbrains.annotations.Nullable;
import vazkii.botania.common.item.lens.ItemLens;
import java.util.ArrayList;
@@ -43,7 +45,14 @@ public class ModItems
private static final Item.Properties ITEM_PROPERTIES = new Item.Properties().tab(ExtraBotany.ITEM_GROUP);
public static final RegistryObject<Item> SPIRIT_FUEL = register(LibItemNames.SPIRIT_FUEL, new Item.Properties().food(NormalFoods.SPIRITFUEL_PROP).tab(ExtraBotany.ITEM_GROUP));
public static final RegistryObject<Item> SPIRIT_FUEL = register(LibItemNames.SPIRIT_FUEL, () -> new Item(new Item.Properties().food(NormalFoods.SPIRITFUEL_PROP).tab(ExtraBotany.ITEM_GROUP))
{
@Override
public int getBurnTime(ItemStack itemStack, @Nullable RecipeType<?> recipeType)
{
return 16 * 200;
}
});
public static final RegistryObject<Item> NIGHTMARE_FUEL = register(LibItemNames.NIGHTMARE_FUEL, () -> new NightmareFuel(new Item.Properties().food(NormalFoods.NIGHTMAREFUEL_PROP).tab(ExtraBotany.ITEM_GROUP)));
public static final RegistryObject<Item> SPIRIT_FRAG = register(LibItemNames.SPIRIT_FRAG);
public static final RegistryObject<Item> SHADOW_INGOT = register(LibItemNames.SHADOW_INGOT);
@@ -185,17 +194,9 @@ public class ModItems
public static final RegistryObject<Item> FAILNAUGHT = register(LibItemNames.FAILNAUGHT, () -> new Failnaught(stackTo1()));
public static final RegistryObject<Item> JUDAH_OATH = register(LibItemNames.JUDAH_OATH, () -> new JudahOath(stackTo1()));
//TODO: delete it!
public static void registerRecipeSerializers(BiConsumer<RecipeSerializer<?>, ResourceLocation> r)
{
r.accept(CocktailRecipe.SERIALIZER, new ResourceLocation(ExtraBotany.MODID, "cocktail_upgrade"));
r.accept(LenPotionRecipe.SERIALIZER, new ResourceLocation(ExtraBotany.MODID, "len_potion_bind"));
r.accept(GrenadeRecipe.SERIALIZER, new ResourceLocation(ExtraBotany.MODID, "grenade_bind"));
r.accept(DupeRuneRecipe.SERIALIZER, new ResourceLocation(ExtraBotany.MODID, "rune_dupe"));
r.accept(GoldClothRecipe.SERIALIZER, new ResourceLocation(ExtraBotany.MODID, "gold_cloth_unbind"));
r.accept(PrimoGemRecipe.SERIALIZER, new ResourceLocation(ExtraBotany.MODID, "primo_gem_buy_fate"));
r.accept(ToolsMultiUpgradeRecipe.SERIALIZER, new ResourceLocation(ExtraBotany.MODID, "tools_multi_upgrade"));
r.accept(BaublesMultiUpgradeRecipe.SERIALIZER, new ResourceLocation(ExtraBotany.MODID, "baubles_multi_upgrade"));
r.accept(BaublesMultiRemoveRecipe.SERIALIZER, new ResourceLocation(ExtraBotany.MODID, "baubles_multi_remove"));
//just place it here lol
registerRewardBag();
}

View File

@@ -42,7 +42,7 @@ public class ConfigHandler
{
builder.push("common");
doCompat = builder.comment("Whether to compact other mod, like TConstruct. Default is true")
doCompat = builder.comment("Whether to compact other mod, like TConstruct. Default is false(WIP)")
.define("doCompat",false);
//TODO:为什么要禁用缴械捏noob
disableDisarm = builder

View File

@@ -49,6 +49,8 @@ public class ModSubtiles
public static final Block edelweissFloating = new BlockFloatingSpecialFlower(FLOATING_PROPS, () -> ModSubtiles.EDELWEISS);
public static final Block tinkleflower = new BlockSpecialFlower(MobEffects.DIG_SPEED, 10, FLOWER_PROPS, () -> ModSubtiles.TINKLEFLOWER);
public static final Block tinkleflowerFloating = new BlockFloatingSpecialFlower(FLOATING_PROPS, () -> ModSubtiles.TINKLEFLOWER);
public static final Block stonesia = new BlockSpecialFlower(MobEffects.DAMAGE_RESISTANCE, 10, FLOWER_PROPS, () -> ModSubtiles.STONESIA);
public static final Block stonesiaFloating = new BlockFloatingSpecialFlower(FLOATING_PROPS, () -> ModSubtiles.STONESIA);
//functional
public static final Block serenitian = new BlockSpecialFlower(MobEffects.ABSORPTION, 48, FLOWER_PROPS, () -> ModSubtiles.SERENITIAN);
public static final Block serenitianFloating = new BlockFloatingSpecialFlower(FLOATING_PROPS, () -> ModSubtiles.SERENITIAN);
@@ -65,6 +67,7 @@ public class ModSubtiles
public static final BlockEntityType<SubTileBloodyEnchantress> BLOODYENCHANTRESS = IXplatAbstractions.INSTANCE.createBlockEntityType(SubTileBloodyEnchantress::new, bloodyenchantress, bloodyenchantressFloating);
public static final BlockEntityType<SubTileEdelweiss> EDELWEISS = IXplatAbstractions.INSTANCE.createBlockEntityType(SubTileEdelweiss::new, edelweiss, edelweissFloating);
public static final BlockEntityType<SubTileTinkle> TINKLEFLOWER = IXplatAbstractions.INSTANCE.createBlockEntityType(SubTileTinkle::new, tinkleflower, tinkleflowerFloating);
public static final BlockEntityType<SubTileStonesia> STONESIA = IXplatAbstractions.INSTANCE.createBlockEntityType(SubTileStonesia::new, stonesia, stonesiaFloating);
public static final BlockEntityType<SubTileSerenitian> SERENITIAN = IXplatAbstractions.INSTANCE.createBlockEntityType(SubTileSerenitian::new, serenitian, serenitianFloating);
@@ -89,6 +92,8 @@ public class ModSubtiles
public static final Item edelweissFloating_item = new ItemBlockSpecialFlower(edelweissFloating, props);
public static final Item tinkleflower_item = new ItemBlockSpecialFlower(tinkleflower, props);
public static final Item tinkleflowerFloating_item = new ItemBlockSpecialFlower(tinkleflowerFloating, props);
public static final Item stonesia_item = new ItemBlockSpecialFlower(stonesia, props);
public static final Item stonesiaFloating_item = new ItemBlockSpecialFlower(stonesiaFloating, props);
//functional items
public static final Item serenitian_item = new ItemBlockSpecialFlower(serenitian, props);
public static final Item serenitianFloating_item = new ItemBlockSpecialFlower(serenitianFloating, props);
@@ -106,6 +111,7 @@ public class ModSubtiles
registerFlowerAndFloating(bloodyenchantress, bloodyenchantressFloating, LibBlockNames.BLOODY_ENCHANTRESS, r);
registerFlowerAndFloating(edelweiss, edelweissFloating, LibBlockNames.EDELWEISS, r);
registerFlowerAndFloating(tinkleflower, tinkleflowerFloating, LibBlockNames.TINKLE_FLOWER, r);
registerFlowerAndFloating(stonesia, stonesiaFloating, LibBlockNames.STONESIA, r);
registerFlowerAndFloating(serenitian, serenitianFloating, LibBlockNames.SERENITIAN, r);
@@ -139,6 +145,8 @@ public class ModSubtiles
r.accept(edelweissFloating_item, getId(edelweissFloating));
r.accept(tinkleflower_item, getId(tinkleflower));
r.accept(tinkleflowerFloating_item, getId(tinkleflowerFloating));
r.accept(stonesia_item, getId(stonesia));
r.accept(stonesiaFloating_item, getId(stonesiaFloating));
//functional
r.accept(serenitian_item, getId(serenitian));
r.accept(serenitianFloating_item, getId(serenitianFloating));
@@ -149,7 +157,8 @@ public class ModSubtiles
public static void registerWandHudCaps(ModTiles.BECapConsumer<IWandHUD> consumer)
{
consumer.accept(be -> new TileEntityGeneratingFlower.GeneratingWandHud<>((TileEntityGeneratingFlower) be),
SUNSHINELILY, MOONLIGHTLILY, OMNIVIOLET, GEMINIORCHID, BELLFLOWER, REIKARORCHID, BLOODYENCHANTRESS, EDELWEISS, TINKLEFLOWER);
SUNSHINELILY, MOONLIGHTLILY, OMNIVIOLET, GEMINIORCHID, BELLFLOWER, REIKARORCHID, BLOODYENCHANTRESS, EDELWEISS, TINKLEFLOWER,
STONESIA);
consumer.accept(be -> new TileEntityFunctionalFlower.FunctionalWandHud<>((TileEntityFunctionalFlower) be),
SERENITIAN, ANNOYINGFLOWER);
}
@@ -165,6 +174,7 @@ public class ModSubtiles
r.accept(BLOODYENCHANTRESS, getBEId(bloodyenchantress));
r.accept(EDELWEISS, getBEId(edelweiss));
r.accept(TINKLEFLOWER, getBEId(tinkleflower));
r.accept(STONESIA, getBEId(stonesia));
//functional
r.accept(SERENITIAN, getBEId(serenitian));
r.accept(ANNOYINGFLOWER, getBEId(annoying));

View File

@@ -1,23 +1,22 @@
package chick.extrabotany.common.blocks.subtile.generating;
import chick.extrabotany.common.blocks.ModSubtiles;
import chick.extrabotany.common.crafting.ModRecipeTypes;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import org.jetbrains.annotations.Nullable;
import chick.extrabotany.api.craft.IStonesiaRecipe;
import vazkii.botania.api.subtile.RadiusDescriptor;
import vazkii.botania.api.subtile.TileEntityGeneratingFlower;
import vazkii.botania.client.fx.WispParticleData;
import vazkii.botania.common.handler.ModSounds;
import vazkii.botania.common.helper.DelayHelper;
import vazkii.botania.common.proxy.IProxy;
import vazkii.botania.common.crafting.StateIngredientHelper;
import chick.extrabotany.common.handler.StonesiaManager;
import java.util.Arrays;
import java.util.Collections;
@@ -26,24 +25,22 @@ import java.util.List;
//TODO: to be test
public class SubTileStonesia extends TileEntityGeneratingFlower
{
private static final String TAG_BURN_TIME = "burnTime";
private static final String TAG_COOLDOWN = "cooldown";
private static final int START_BURN_EVENT = 0;
private static final BlockPos[] OFFSETS = {new BlockPos(0, 0, 1), new BlockPos(0, 0, -1), new BlockPos(1, 0, 0), new BlockPos(-1, 0, 0), new BlockPos(-1, 0, 1), new BlockPos(-1, 0, -1), new BlockPos(1, 0, 1), new BlockPos(1, 0, -1)};
private static final int Range = 1;
private int burnTime, cooldown;
public SubTileStonesia(BlockEntityType<?> type, BlockPos pos, BlockState state)
public SubTileStonesia( BlockPos pos, BlockState state)
{
super(type, pos, state);
super(ModSubtiles.STONESIA, pos, state);
}
@Override
public void tickFlower()
{
super.tickFlower();
/*
var pos = getEffectivePos();
var x = pos.getX();
var y = pos.getY();
@@ -63,25 +60,24 @@ public class SubTileStonesia extends TileEntityGeneratingFlower
for (BlockPos offset : offsets)
{
pos = getEffectivePos().offset(offset);
var block = level.getBlockState(pos).getBlock();
//TODO:OUTPUT
/*
int output = RecipeStonesia.getOutput(new ItemStack(block));
if (output != 0)
BlockState state = level.getBlockState(pos);
var recipe = getRecipe(state);
if (recipe != null)
{
if (cooldown == 0)
{
burnTime += (output);
level.setBlockAndUpdate(pos, Blocks.AIR.defaultBlockState());
burnTime += recipe.getTime();
level.setBlockAndUpdate(pos, recipe.getOutputState());
cooldown = 40;
}
addMana(recipe.getMana());
sync();
level.playSound(null, getEffectivePos(), SoundEvents.GENERIC_DRINK, SoundSource.BLOCKS, 0.01F, 0.5F + (float) Math.random() * 0.5F);
break;
}
*/
}
}
} else
@@ -93,9 +89,22 @@ public class SubTileStonesia extends TileEntityGeneratingFlower
burnTime--;
}
// emitParticle(ParticleTypes.FLAME, 0.4 + Math.random() * 0.2, 0.7, 0.4 + Math.random() * 0.2, 0.0D, 0.0D, 0.0D);
*/
}
private RecipeType<? extends IStonesiaRecipe> getRecipeType()
{
return ModRecipeTypes.STONESIA_TYPE;
}
@Nullable
private IStonesiaRecipe getRecipe(BlockState state)
{
return StonesiaManager.getFor(getLevel().getRecipeManager(), getRecipeType())
.get(StateIngredientHelper.of(state.getBlock()));
}
@Override
public boolean triggerEvent(int event, int param)
{
@@ -117,7 +126,7 @@ public class SubTileStonesia extends TileEntityGeneratingFlower
@Override
public int getMaxMana()
{
return 800;
return 10000;
}
@Override

View File

@@ -0,0 +1,44 @@
package chick.extrabotany.common.crafting;
import chick.extrabotany.api.craft.IStonesiaRecipe;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.RecipeType;
import java.util.function.BiConsumer;
import static chick.extrabotany.ExtraBotany.prefixRl;
public class ModRecipeTypes
{
public static final RecipeType<IStonesiaRecipe> STONESIA_TYPE = new ModRecipeType<>();
public static void registerRecipeTypes(BiConsumer<RecipeSerializer<?>, ResourceLocation> r)
{
r.accept(CocktailRecipe.SERIALIZER, prefixRl("cocktail_upgrade"));
r.accept(LenPotionRecipe.SERIALIZER, prefixRl("len_potion_bind"));
r.accept(GrenadeRecipe.SERIALIZER, prefixRl("grenade_bind"));
r.accept(DupeRuneRecipe.SERIALIZER, prefixRl("rune_dupe"));
r.accept(GoldClothRecipe.SERIALIZER, prefixRl("gold_cloth_unbind"));
r.accept(PrimoGemRecipe.SERIALIZER, prefixRl("primo_gem_buy_fate"));
r.accept(ToolsMultiUpgradeRecipe.SERIALIZER, prefixRl("tools_multi_upgrade"));
r.accept(BaublesMultiUpgradeRecipe.SERIALIZER, prefixRl("baubles_multi_upgrade"));
r.accept(BaublesMultiRemoveRecipe.SERIALIZER, prefixRl("baubles_multi_remove"));
Registry.register(Registry.RECIPE_TYPE, prefixRl(StonesiaRecipe.TYPE_ID), STONESIA_TYPE);
r.accept(StonesiaRecipe.SERIALIZER, prefixRl(StonesiaRecipe.TYPE_ID));
}
private static class ModRecipeType<T extends Recipe<?>> implements RecipeType<T>
{
@Override
public String toString()
{
return Registry.RECIPE_TYPE.getKey(this).toString();
}
}
}

View File

@@ -10,15 +10,12 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.GsonHelper;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.SimpleRecipeSerializer;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import vazkii.botania.api.recipe.StateIngredient;
import vazkii.botania.api.subtile.TileEntitySpecialFlower;
import vazkii.botania.common.crafting.ModRecipeTypes;
import chick.extrabotany.common.crafting.StonesiaRecipe;
import vazkii.botania.common.crafting.RecipeSerializerBase;
import vazkii.botania.common.crafting.StateIngredientHelper;
@@ -27,12 +24,14 @@ import javax.annotation.Nullable;
public class StonesiaRecipe implements IStonesiaRecipe
{
public static final String TYPE_ID = "stonesia";
public static final int DEFAULT_TIME = 150;
private final ResourceLocation id;
private final StateIngredient input;
private final BlockState outputState;
private final int time;
private final int mana;
private final CommandFunction.CacheableFunction function;
/**
@@ -45,13 +44,14 @@ public class StonesiaRecipe implements IStonesiaRecipe
* @param function An mcfunction to run at the converted block after finish. If you don't want one, pass
* CommandFunction.CacheableFunction.NONE
*/
public StonesiaRecipe(ResourceLocation id, StateIngredient input, BlockState state, int time, CommandFunction.CacheableFunction function)
public StonesiaRecipe(ResourceLocation id, StateIngredient input, BlockState state, int time, int mana, CommandFunction.CacheableFunction function)
{
Preconditions.checkArgument(time >= 0, "Time must be nonnegative");
this.id = id;
this.input = input;
this.outputState = state;
this.time = time;
this.mana = mana;
this.function = function;
}
@@ -101,6 +101,12 @@ public class StonesiaRecipe implements IStonesiaRecipe
return time;
}
@Override
public int getMana()
{
return mana;
}
@Override
public ResourceLocation getId()
{
@@ -110,10 +116,10 @@ public class StonesiaRecipe implements IStonesiaRecipe
@Override
public RecipeSerializer<?> getSerializer()
{
return STONESIA_SERIALIZER;
return SERIALIZER;
}
public static final RecipeSerializer<?> STONESIA_SERIALIZER = new Serializer();
public static final RecipeSerializer<?> SERIALIZER = new Serializer();
public static class Serializer extends RecipeSerializerBase<StonesiaRecipe>
{
@@ -124,10 +130,11 @@ public class StonesiaRecipe implements IStonesiaRecipe
StateIngredient input = StateIngredientHelper.deserialize(GsonHelper.getAsJsonObject(object, "input"));
BlockState output = StateIngredientHelper.readBlockState(GsonHelper.getAsJsonObject(object, "output"));
int time = GsonHelper.getAsInt(object, "time", DEFAULT_TIME);
int mana = GsonHelper.getAsInt(object, "mana", 114514);
var functionIdString = GsonHelper.getAsString(object, "success_function", null);
var functionId = functionIdString == null ? null : new ResourceLocation(functionIdString);
var function = functionId == null ? CommandFunction.CacheableFunction.NONE : new CommandFunction.CacheableFunction(functionId);
return new StonesiaRecipe(id, input, output, time, function);
return new StonesiaRecipe(id, input, output, time, mana, function);
}
@Override
@@ -136,6 +143,7 @@ public class StonesiaRecipe implements IStonesiaRecipe
recipe.input.write(buf);
buf.writeVarInt(Block.getId(recipe.outputState));
buf.writeVarInt(recipe.time);
buf.writeVarInt(recipe.mana);
}
@Nullable
@@ -145,7 +153,8 @@ public class StonesiaRecipe implements IStonesiaRecipe
StateIngredient input = StateIngredientHelper.read(buf);
BlockState output = Block.stateById(buf.readVarInt());
int time = buf.readVarInt();
return new StonesiaRecipe(id, input, output, time, CommandFunction.CacheableFunction.NONE);
int mana = buf.readVarInt();
return new StonesiaRecipe(id, input, output, time, mana, CommandFunction.CacheableFunction.NONE);
}
}
}

View File

@@ -24,7 +24,7 @@ import static chick.extrabotany.ExtraBotany.prefixRl;
public class StonesiaManager implements ResourceManagerReloadListener
{
private static final Map<RecipeType<? extends IStonesiaRecipe>, ListMultimap<StateIngredient, ? extends IStonesiaRecipe>> DATA = new HashMap<>();
private static final Map<RecipeType<? extends IStonesiaRecipe>, Map<StateIngredient, ? extends IStonesiaRecipe>> DATA = new HashMap<>();
public static void registerListener()
{
@@ -37,11 +37,11 @@ public class StonesiaManager implements ResourceManagerReloadListener
DATA.clear();
}
public static ListMultimap<StateIngredient, ? extends IStonesiaRecipe> getFor(RecipeManager manager, RecipeType<? extends IStonesiaRecipe> type)
public static Map<StateIngredient, ? extends IStonesiaRecipe> getFor(RecipeManager manager, RecipeType<? extends IStonesiaRecipe> type)
{
return DATA.computeIfAbsent(type, t ->
{
ListMultimap<StateIngredient, IStonesiaRecipe> map = ArrayListMultimap.create();
Map<StateIngredient, IStonesiaRecipe> map = new HashMap<>();
for (var recipe : manager.getAllRecipesFor(t))
{
map.put(recipe.getInput(), recipe);

View File

@@ -12,9 +12,9 @@ import org.jetbrains.annotations.Nullable;
public class NightmareFuel extends Item
{
public NightmareFuel(Properties p_41383_)
public NightmareFuel(Properties prop)
{
super(p_41383_);
super(prop);
}
@Override
@@ -30,6 +30,6 @@ public class NightmareFuel extends Item
@Override
public int getBurnTime(ItemStack itemStack, @Nullable RecipeType<?> recipeType)
{
return 1000;
return 200 * 10;
}
}

View File

@@ -22,6 +22,7 @@ public class LibBlockNames
public static String BLOODY_ENCHANTRESS = "bloody_enchantress";
public static String EDELWEISS = "edelweiss";
public static String TINKLE_FLOWER = "tinkle_flower";
public static String STONESIA = "stonesia";
public static String SERENITIAN = "serenitian";

View File

@@ -34,6 +34,8 @@ public class ManaShortArrow extends Item
int ticks = Math.round(player.getAttackStrengthScale(0) * 20);
shootArrow(player, null, ticks, 0.52D, 1);
player.awardStat(Stats.ITEM_USED.get(this));
stack.shrink(1);
//TODO: check it
return InteractionResultHolder.consume(stack);
}

View File

@@ -57,6 +57,8 @@ public class DataGenerators
generator.addProvider(new ModRunicAltarRecipes(generator));
generator.addProvider(new ModPetalRecipes(generator));
generator.addProvider(new ModTerraRecipes(generator));
generator.addProvider(new StonesiaRecipes(generator));
}
}
}

View File

@@ -107,6 +107,7 @@ public class EN_USLanguageProvider extends LanguageProvider
add(ModItems.POTATO_CHIP.get(), "Potato Chip");
add(ModItems.SUN_RING.get(), "Ring of Sacred Sun");
add(ModItems.MOON_PENDANT.get(), "Heart of Corrupted Moon");
add(ModItems.PURE_DAISY_PENDANT.get(), "Pure Daisy Pendant");
add(ModItems.NATURE_ORB.get(), "Nature Orb");
add("extrabotany.nature_orb", "Natural Breath: %s / %s");
add("extrabotany.nature_orb_effect1", "Blessing of Mana");

View File

@@ -108,6 +108,7 @@ public class ZH_CNLanguageProvider extends LanguageProvider
add(ModItems.POTATO_CHIP.get(), "薯片");
add(ModItems.SUN_RING.get(), "圣阳尊戒");
add(ModItems.MOON_PENDANT.get(), "蚀月之心");
add(ModItems.PURE_DAISY_PENDANT.get(), "白雏菊项链");
add(ModItems.NATURE_ORB.get(), "自然蕴息宝珠");
add("extrabotany.nature_orb", "自然之息: %s / %s");
add("extrabotany.nature_orb_effect1", "魔力的加护");

View File

@@ -8,8 +8,8 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.NotNull;
import vazkii.botania.api.recipe.StateIngredient;
import vazkii.botania.common.crafting.ModRecipeTypes;
import vazkii.botania.common.crafting.StateIngredientHelper;
import vazkii.botania.data.recipes.BotaniaRecipeProvider;
@@ -17,11 +17,10 @@ import javax.annotation.Nullable;
import java.util.function.Consumer;
import static chick.extrabotany.ExtraBotany.prefixRl;
import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;
public class StonesiaRecipes extends BotaniaRecipeProvider
{
protected StonesiaRecipes(DataGenerator generator)
public StonesiaRecipes(DataGenerator generator)
{
super(generator);
}
@@ -33,7 +32,7 @@ public class StonesiaRecipes extends BotaniaRecipeProvider
}
@Override
public String getName()
public @NotNull String getName()
{
return "Extrabotany Stonesia Recipes";
}
@@ -99,15 +98,15 @@ public class StonesiaRecipes extends BotaniaRecipeProvider
}
@Override
public ResourceLocation getId()
public @NotNull ResourceLocation getId()
{
return id;
}
@Override
public RecipeSerializer<?> getType()
public @NotNull RecipeSerializer<?> getType()
{
return StonesiaRecipe.STONESIA_SERIALIZER;
return StonesiaRecipe.SERIALIZER;
}
@Nullable

View File

@@ -2,12 +2,14 @@ package chick.extrabotany.forge;
import chick.extrabotany.ExtraBotany;
import chick.extrabotany.common.*;
import chick.extrabotany.common.base.ConfigHandler;
import chick.extrabotany.common.baubles.relic.CoreGod;
import chick.extrabotany.common.blocks.ModSubtiles;
import chick.extrabotany.common.blocks.ModTiles;
import chick.extrabotany.common.blocks.tile.TileDimensionCatalyst;
import chick.extrabotany.common.blocks.tile.TilePowerFrame;
import chick.extrabotany.common.brews.ModBrews;
import chick.extrabotany.common.crafting.ModRecipeTypes;
import chick.extrabotany.common.handler.StonesiaManager;
import chick.extrabotany.common.optional.EXBOTCompat;
import chick.extrabotany.common.optional.tconstruct.TConCompat;
@@ -76,7 +78,8 @@ public class ForgeCommonInitializer
//potions and brews
ModBrews.registerBrews();
if (ModList.get().isLoaded(EXBOTCompat.TCON_ID))
//DO COMPAT?
if (ModList.get().isLoaded(EXBOTCompat.TCON_ID) && ConfigHandler.COMMON.doCompat.get())
{
TConCompat.FLUIDS.register(bus);
TConCompat.MODIFIERS.register(bus);
@@ -96,6 +99,7 @@ public class ForgeCommonInitializer
bus.addListener((EntityAttributeCreationEvent e) -> ModEntities.registerAttributes((type, builder) -> e.put(type, builder.build())));
//recipe
bind(ForgeRegistries.RECIPE_SERIALIZERS, ModItems::registerRecipeSerializers);
bind(ForgeRegistries.RECIPE_SERIALIZERS, ModRecipeTypes::registerRecipeTypes);
//sounds
bind(ForgeRegistries.SOUND_EVENTS, ModSounds::init);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -1,6 +1,6 @@
{
"name": "extrabotany.entry.elf_king_ring",
"category": "extrabotany:extrabotany",
"category": "botania:baubles",
"icon": "extrabotany:elf_king_ring",
"entry_color": "4169E1",
"advancement": "botania:main/elf_lexicon_pickup",

View File

@@ -1,6 +1,6 @@
{
"name": "extrabotany.entry.nature_orb",
"category": "extrabotany:extrabotany",
"category": "botania:baubles",
"icon": "extrabotany:nature_orb",
"entry_color": "aa00",
"advancement": "extrabotany:main/nightmarefuel_eat_lexicon",

View File

@@ -1,8 +1,8 @@
{
"name": "extrabotany.entry.potato_chip",
"category": "extrabotany:extrabotany",
"category": "botania:baubles",
"icon": "extrabotany:potato_chip",
"advancement": "botania:main/runic_altar_pickup",
"advancement": "botania:main/gaia_guardian_kill",
"pages": [
{
"type": "text",

View File

@@ -1,7 +1,7 @@
{
"name": "extrabotany.entry.powerglove",
"category": "botania:baubles",
"icon": "extrabotany:powerglove",
"icon": "extrabotany:power_glove",
"entry_color": "4169E1",
"advancement": "botania:main/runic_altar_pickup",
"pages": [