Compare commits
3 commits
1e3bb77a2d
...
7a55ee92bd
Author | SHA1 | Date | |
---|---|---|---|
7a55ee92bd | |||
475059df8f | |||
1fe805e9a6 |
5 changed files with 70 additions and 17 deletions
|
@ -1,6 +0,0 @@
|
|||
- [ ] make interactive script update quilt automatically?
|
||||
- [ ] cleanup the script to not be so redundant (specifically the domain/namespace shit)
|
||||
- [ ] add option to install optional mods to run config (Mod Menu, and other dev-helpful mods)
|
||||
- [ ] scrub the README.md to be inline with a default description of the mod
|
||||
- [ ] interactively ask user for new repo and add correct commits for changes?
|
||||
- [ ] optional modmenu quilt.mod.json configuration setup?
|
|
@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx1G
|
|||
org.gradle.parallel = true
|
||||
|
||||
# Mod Properties
|
||||
version = 0.1.0
|
||||
version = 0.2.0
|
||||
maven_group = observer.nelle
|
||||
archives_base_name = edible_blocks
|
||||
|
||||
|
|
|
@ -12,3 +12,6 @@ pluginManagement {
|
|||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
include 'src:main:kotlin'
|
||||
findProject(':src:main:kotlin')?.name = 'kotlin'
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package observer.nelle.edible_blocks.mixin;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import net.minecraft.entity.effect.StatusEffects;
|
||||
import net.minecraft.item.FoodComponent;
|
||||
import net.minecraft.item.FoodComponents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
@ -9,19 +13,71 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
|
||||
|
||||
|
||||
@Mixin(Items.class)
|
||||
public abstract class ItemsMixin {
|
||||
|
||||
@ModifyArg(
|
||||
method = "register(Lnet/minecraft/block/Block;)Lnet/minecraft/item/Item;",
|
||||
at = @At(value="INVOKE",target = "Lnet/minecraft/item/BlockItem;<init>(Lnet/minecraft/block/Block;Lnet/minecraft/item/Item$Settings;)V")
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/item/BlockItem;<init>(Lnet/minecraft/block/Block;Lnet/minecraft/item/Item$Settings;)V")
|
||||
)
|
||||
private static Item.Settings ModifySettings (Block block, Item.Settings settings) {
|
||||
private static Item.Settings ModifySettings(Block block, Item.Settings settings) {
|
||||
/* TODO: Make pumpkin give player a carved pumpkin
|
||||
if (block == Blocks.PUMPKIN) {
|
||||
return settings.food(new FoodComponent.Builder()
|
||||
.hunger(6)
|
||||
.saturationModifier(0.9F)
|
||||
.build());
|
||||
}*/
|
||||
if (block == Blocks.MELON) {
|
||||
return settings.food(new FoodComponent.Builder()
|
||||
.hunger(6)
|
||||
.saturationModifier(0.9F)
|
||||
.build());
|
||||
}
|
||||
if (block == Blocks.HONEY_BLOCK) {
|
||||
return settings.food(new FoodComponent.Builder()
|
||||
.hunger(9)
|
||||
.saturationModifier(0.3F)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 5, 1 / 2), 0.7f)
|
||||
.build());
|
||||
}
|
||||
if (block == Blocks.HONEYCOMB_BLOCK) {
|
||||
return settings.food(new FoodComponent.Builder()
|
||||
.hunger(9)
|
||||
.saturationModifier(0.3F)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 5, 1 / 2), 0.7f)
|
||||
.build());
|
||||
}
|
||||
if (block == Blocks.BEEHIVE) {
|
||||
return settings.food(new FoodComponent.Builder()
|
||||
.hunger(9)
|
||||
.saturationModifier(0.3F)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.INSTANT_DAMAGE, 1, 1 / 2), 1f)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 5, 1 / 2), 0.7f)
|
||||
.build());
|
||||
}
|
||||
if (block == Blocks.BEE_NEST) {
|
||||
return settings.food(new FoodComponent.Builder()
|
||||
.hunger(9)
|
||||
.saturationModifier(0.3F)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.INSTANT_DAMAGE, 1, 1 / 2), 1f)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 5, 1 / 2), 0.4f)
|
||||
.build());
|
||||
}
|
||||
if (block == Blocks.CACTUS) {
|
||||
return settings.food(new FoodComponent.Builder()
|
||||
.hunger(9)
|
||||
.saturationModifier(0.3F)
|
||||
.statusEffect(new StatusEffectInstance(StatusEffects.INSTANT_DAMAGE, 1, 1 / 3), 1f)
|
||||
.build());
|
||||
}
|
||||
else {
|
||||
return settings.food(
|
||||
new FoodComponent.Builder()
|
||||
.snack()
|
||||
.hunger(1)
|
||||
.alwaysEdible()
|
||||
.build());
|
||||
.snack()
|
||||
.hunger(1)
|
||||
.alwaysEdible()
|
||||
.build());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,15 +24,15 @@
|
|||
"depends": [
|
||||
{
|
||||
"id": "quilt_loader",
|
||||
"versions": ">=0.26.3"
|
||||
"versions": { "all": [">=0.26.3"] }
|
||||
},
|
||||
{
|
||||
"id": "quilted_fabric_api",
|
||||
"versions": ">=7.0.1"
|
||||
"versions": { "all": [">=7.0.1"] }
|
||||
},
|
||||
{
|
||||
"id": "minecraft",
|
||||
"versions": "1.20-1.21.1"
|
||||
"versions": { "all": [">=1.20", "<1.21.1"] }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue