Skip to content

Commit

Permalink
Allow rice to actually drop :D (#10058)
Browse files Browse the repository at this point in the history
Allow rice to actually drop from sugarcane
Remove spurious duplicated check for dead bush/chickpea
  • Loading branch information
Raycoms committed Jul 27, 2024
1 parent 5706ef4 commit d4d3e2f
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/main/java/com/minecolonies/core/event/EventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import com.minecolonies.api.blocks.AbstractBlockHut;
import com.minecolonies.api.blocks.ModBlocks;
import com.minecolonies.api.blocks.interfaces.IRSComponentBlock;
import com.minecolonies.api.colony.*;
import com.minecolonies.api.colony.ICitizenData;
import com.minecolonies.api.colony.IColony;
import com.minecolonies.api.colony.IColonyManager;
import com.minecolonies.api.colony.IVisitorData;
import com.minecolonies.api.colony.buildings.IBuilding;
import com.minecolonies.api.colony.buildings.IGuardBuilding;
import com.minecolonies.api.colony.interactionhandling.ChatPriority;
Expand All @@ -12,7 +15,6 @@
import com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickRateStateMachine;
import com.minecolonies.api.entity.citizen.AbstractEntityCitizen;
import com.minecolonies.api.entity.other.AbstractFastMinecoloniesEntity;
import com.minecolonies.api.items.ModItems;
import com.minecolonies.api.items.ModTags;
import com.minecolonies.api.loot.EntityInBiomeTag;
import com.minecolonies.api.util.*;
Expand Down Expand Up @@ -48,7 +50,6 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.biome.Biomes;
import net.minecraft.world.level.block.BedBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
Expand Down Expand Up @@ -132,7 +133,7 @@ public static void onEntityAdded(@NotNull final EntityJoinLevelEvent event)
@SubscribeEvent
public static void onLootTableLoad(@NotNull final LootTableLoadEvent event)
{
if (event.getName().toString().equals("minecraft:blocks/fern"))
if (event.getName().equals(Blocks.FERN.getLootTable()))
{
event.getTable().addPool(LootPool.lootPool()
.add(LootItem.lootTableItem(ModBlocks.blockCabbage)
Expand All @@ -144,21 +145,21 @@ public static void onLootTableLoad(@NotNull final LootTableLoadEvent event)
.when(EntityInBiomeTag.of(ModTags.humidBiomes))
.when(LootItemRandomChanceCondition.randomChance(0.01f))).build());
}
else if (event.getName().toString().equals("minecraft:blocks/sugarcane"))
else if (event.getName().equals(Blocks.SUGAR_CANE.getLootTable()))
{
event.getTable().addPool(LootPool.lootPool()
.add(LootItem.lootTableItem(ModBlocks.blockRice)
.when(EntityInBiomeTag.of(ModTags.humidBiomes))
.when(LootItemRandomChanceCondition.randomChance(0.01f))).build());
}
else if (event.getName().toString().equals("minecraft:blocks/dead_bush"))
else if (event.getName().equals(Blocks.DEAD_BUSH.getLootTable()))
{
event.getTable().addPool(LootPool.lootPool()
.add(LootItem.lootTableItem(ModBlocks.blockChickpea)
.when(EntityInBiomeTag.of(ModTags.dryBiomes))
.when(LootItemRandomChanceCondition.randomChance(0.01f))).build());
}
else if (event.getName().toString().equals("minecraft:blocks/grass"))
else if (event.getName().equals(Blocks.GRASS.getLootTable()))
{
event.getTable().addPool(LootPool.lootPool()
.add(LootItem.lootTableItem(ModBlocks.blockGarlic)
Expand Down Expand Up @@ -188,14 +189,7 @@ else if (event.getName().toString().equals("minecraft:blocks/grass"))
.when(EntityInBiomeTag.of(ModTags.temperateBiomes))
.when(LootItemRandomChanceCondition.randomChance(0.01f))).build());
}
else if (event.getName().toString().equals("minecraft:blocks/dead_bush"))
{
event.getTable().addPool(LootPool.lootPool()
.add(LootItem.lootTableItem(ModBlocks.blockChickpea)
.when(EntityInBiomeTag.of(ModTags.dryBiomes))
.when(LootItemRandomChanceCondition.randomChance(0.01f))).build());
}
else if (event.getName().toString().equals("minecraft:chests/simple_dungeon"))
else if (event.getName().equals(BuiltInLootTables.SIMPLE_DUNGEON))
{
event.getTable().addPool(LootPool.lootPool()
.add(LootItem.lootTableItem(ModBlocks.blockGarlic)
Expand Down

0 comments on commit d4d3e2f

Please # to comment.