diff --git a/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java b/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java index 17d77a61d..b8cf14afe 100644 --- a/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java +++ b/src/main/java/vazkii/botania/common/block/BlockFelPumpkin.java @@ -22,6 +22,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; @@ -42,7 +43,7 @@ import javax.annotation.Nonnull; @Mod.EventBusSubscriber(modid = LibMisc.MOD_ID) public class BlockFelPumpkin extends BlockMod implements ILexiconable { - + private static final ResourceLocation LOOT_TABLE = new ResourceLocation(LibMisc.MOD_ID, "fel_blaze"); private static final String TAG_FEL_SPAWNED = "Botania-FelSpawned"; public BlockFelPumpkin() { @@ -79,7 +80,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable { world.setBlockState(pos.down(2), Blocks.AIR.getDefaultState(), 2); EntityBlaze blaze = new EntityBlaze(world); blaze.setLocationAndAngles(pos.getX() + 0.5D, pos.getY() - 1.95D, pos.getZ() + 0.5D, 0.0F, 0.0F); - blaze.getEntityData().setBoolean(TAG_FEL_SPAWNED, true); + blaze.deathLootTable = LOOT_TABLE; blaze.onInitialSpawn(world.getDifficultyForLocation(pos), null); world.spawnEntity(blaze); world.notifyNeighborsOfStateChange(pos, Blocks.AIR, false); @@ -93,6 +94,7 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable { world.setBlockState(pos, state.withProperty(BotaniaStateProps.CARDINALS, placer.getHorizontalFacing().getOpposite())); } + // Legacy support @SubscribeEvent public static void onDrops(LivingDropsEvent event) { if(event.getEntityLiving() instanceof EntityBlaze && event.getEntityLiving().getEntityData().getBoolean(TAG_FEL_SPAWNED)) diff --git a/src/main/resources/META-INF/botania_at.cfg b/src/main/resources/META-INF/botania_at.cfg index 32ea3d6de..72de64e55 100644 --- a/src/main/resources/META-INF/botania_at.cfg +++ b/src/main/resources/META-INF/botania_at.cfg @@ -49,3 +49,5 @@ public net.minecraft.item.ItemTool field_77862_b # toolMaterial public net.minecraft.client.multiplayer.ClientAdvancementManager field_192803_d # advancementToProgress public net.minecraft.item.EnumDyeColor field_193351_w # colorValue + +public net.minecraft.entity.EntityLiving field_184659_bA # deathLootTable \ No newline at end of file diff --git a/src/main/resources/assets/botania/loot_tables/fel_blaze.json b/src/main/resources/assets/botania/loot_tables/fel_blaze.json new file mode 100644 index 000000000..b204e9224 --- /dev/null +++ b/src/main/resources/assets/botania/loot_tables/fel_blaze.json @@ -0,0 +1,28 @@ +{ + "pools": [{ + "name": "main", + "rolls": 1, + "entries": [ + { + "type": "item", + "entryName": "normal_death_powder", + "name": "minecraft:blaze_powder", + "functions": [ + { "function": "set_count", "count": 6 } + ] + }, + { + "type": "item", + "entryName": "player_kill_powder", + "name": "minecraft:blaze_powder", + "conditions": [ + { "condition": "killed_by_player" } + ], + "functions": [ + { "function": "set_count", "count": 10 }, + { "function": "looting_enchant", "count": { "min": 0, "max": 6 }} + ] + } + ] + }] +} \ No newline at end of file