Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #31 #33 #34

Open
wants to merge 2 commits into
base: 1.20.1-refabricated
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class CDObjects {


public static final Block FRUITING_AVOCADO_LEAVES = register("fruiting_avocado_leaves",
new FruitingLeaves(BlockBehaviour.Properties.copy(Blocks.JUNGLE_LEAVES)), settings(), false);
new FruitingLeaves(BlockBehaviour.Properties.copy(Blocks.JUNGLE_LEAVES)), settings(), true);

public static final Block WILD_CUCUMBERS = register("wild_cucumbers", new WildCropBlock(MobEffects.DAMAGE_BOOST, 6, FabricBlockSettings.copyOf(Blocks.TALL_GRASS)), settings(), true);
public static final Block WILD_CORN = register("wild_corn", new WildCropBlock(MobEffects.DAMAGE_BOOST, 6, FabricBlockSettings.copyOf(Blocks.TALL_GRASS)), settings(), true);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package dev.sterner.culturaldelights.mixin;

import dev.sterner.culturaldelights.common.registry.CDObjects;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.monster.Monster;
import net.minecraft.world.entity.monster.Zombie;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;


@Mixin(Zombie.class)
public abstract class ZombieEntityMixin extends Monster {

protected ZombieEntityMixin(EntityType<? extends Monster> entityType, Level level) {
super(entityType, level);
}

@Inject(method = "wantsToPickUp", at = @At("RETURN"),cancellable = true)
public void wantsToPickUpInjected(ItemStack itemStack, CallbackInfoReturnable<Boolean> cir) {
if (itemStack.is(CDObjects.GLOW_SQUID)) {
cir.setReturnValue(false);
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/culturaldelights/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"block.culturaldelights.avocado_log": "Avocado Log",
"block.culturaldelights.avocado_wood": "Avocado Wood",
"block.culturaldelights.avocado_leaves": "Avocado Leaves",
"block.culturaldelights.fruiting_avocado_leaves": "Fruiting Avocado Leaves",
"block.culturaldelights.avocado_leaf_carpet": "Avocado Leaf Carpet",
"block.culturaldelights.avocado_sapling": "Avocado Sapling",
"block.culturaldelights.avocado_pit": "Avocado Pit",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/culturaldelights/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"block.culturaldelights.avocado_log": "牛油果树原木",
"block.culturaldelights.avocado_wood": "牛油果树木",
"block.culturaldelights.avocado_leaves": "牛油果树叶",
"block.culturaldelights.fruiting_avocado_leaves": "结果的牛油果树叶",
"block.culturaldelights.avocado_leaf_carpet": "牛油果树叶地毯",
"block.culturaldelights.avocado_sapling": "牛油果树苗",
"block.culturaldelights.avocado_pit": "牛油果核",
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/culturaldelights.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"compatibilityLevel": "JAVA_17",
"mixins": [
"SimpleBlockStateProviderAccessor",
"TreeDecoratorTypeInvoker"
"TreeDecoratorTypeInvoker",
"ZombieEntityMixin"
],
"client": [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": [
"minecraft:shears"
]
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
],
"name": "culturaldelights:fruiting_avocado_leaves"
},
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:survives_explosion"
},
{
"chances": [
0.05,
0.0625,
0.083333336,
0.1
],
"condition": "minecraft:table_bonus",
"enchantment": "minecraft:fortune"
}
],
"name": "culturaldelights:avocado_sapling"
}
]
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": [
"minecraft:shears"
]
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"conditions": [
{
"chances": [
0.02,
0.022222223,
0.025,
0.033333335,
0.1
],
"condition": "minecraft:table_bonus",
"enchantment": "minecraft:fortune"
}
],
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 2.0,
"min": 1.0
},
"function": "minecraft:set_count"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "minecraft:stick"
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": [
"minecraft:shears"
]
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:survives_explosion"
},
{
"chances": [
0.005,
0.0055555557,
0.00625,
0.008333334,
0.025
],
"condition": "minecraft:table_bonus",
"enchantment": "minecraft:fortune"
}
],
"name": "culturaldelights:avocado"
}
],
"rolls": 1.0
}
],
"random_sequence": "culturaldelights:blocks/fruiting_avocado_leaves"
}
3 changes: 2 additions & 1 deletion src/main/resources/data/minecraft/tags/blocks/leaves.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"replace": false,
"values": [
"culturaldelights:avocado_leaves"
"culturaldelights:avocado_leaves",
"culturaldelights:fruiting_avocado_leaves"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"replace": false,
"values": [
"culturaldelights:avocado_leaves"
"culturaldelights:avocado_leaves",
"culturaldelights:fruiting_avocado_leaves"
]
}
3 changes: 2 additions & 1 deletion src/main/resources/data/minecraft/tags/items/leaves.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"replace": false,
"values": [
"culturaldelights:avocado_leaves"
"culturaldelights:avocado_leaves",
"culturaldelights:fruiting_avocado_leaves"
]
}