Skip to content

Commit

Permalink
Finished for Addon Jam, I think
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooy1 committed May 31, 2021
1 parent 6c660d0 commit a14f1b0
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 40 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
This addon is my entry to the 2021 addon jam.

It adds magical tools, weapons, potions, and other items which are created through alchemy in the Blood Altar.

Requires Java 11, preferably 16.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<dependency>
<groupId>io.github.mooy1</groupId>
<artifactId>InfinityLib</artifactId>
<version>ca92323</version>
<version>8083a3b</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,49 +235,50 @@ null, new ItemStack(Material.STICK), null
}).register(plugin);

new BloodAltar(category, BLOOD_ALTAR, RecipeType.MAGIC_WORKBENCH, new ItemStack[] {
null, Items.BLOOD, null,
Items.BLOOD, new ItemStack(Material.ENCHANTING_TABLE), Items.BLOOD,
null, Items.BLOOD, null
null, BLOOD, null,
BLOOD, new ItemStack(Material.ENCHANTING_TABLE), BLOOD,
null, BLOOD, null
}).register(plugin);

new BloodHopper(category, BLOOD_HOPPER, BloodAltar.TYPE, new ItemStack[] {
new ItemStack(Material.HOPPER),
new SlimefunItemStack(Items.BLOOD, 16)
new SlimefunItemStack(BLOOD, 16),
new ItemStack(Material.HOPPER)
}, 15).register(plugin);

new BloodWolfRune(category, BLOOD_WOLF_RUNE, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 16),
new ItemStack(Material.BONE, 16),
new ItemStack(Material.BEEF, 16),
new SlimefunItemStack(BLOOD, 16)
new ItemStack(Material.BEEF, 16)
}).register(plugin);

new SlimefunItem(category, BLOOD_GEM, BloodAltar.TYPE, new ItemStack[] {
new ItemStack(Material.DIAMOND, 64),
new SlimefunItemStack(BLOOD, 64)
new SlimefunItemStack(BLOOD, 64),
new ItemStack(Material.DIAMOND, 64)
}).register(plugin);

new BloodHopper(category, INFUSED_BLOOD_HOPPER, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 16),
BLOOD_HOPPER,
Items.BLOOD_GEM
BLOOD_GEM
}, 100).register(plugin);

new InfusedVampireBlade(category, INFUSED_VAMPIRE_BLADE, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 64),
SlimefunItems.BLADE_OF_VAMPIRES,
new ItemStack(Material.NETHERITE_INGOT, 4),
new SlimefunItemStack(BLOOD_GEM, 4),
new SlimefunItemStack(BLOOD, 64)
new SlimefunItemStack(BLOOD_GEM, 4)
}).register(plugin);

new BloodTotem(category, BLOOD_TOTEM, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 64),
new ItemStack(Material.TOTEM_OF_UNDYING),
new SlimefunItemStack(BLOOD_GEM, 4),
new SlimefunItemStack(GOLDEN_WHEAT, 32),
new SlimefunItemStack(BLOOD, 64)
new SlimefunItemStack(GOLDEN_WHEAT, 32)
}).register(plugin);

new SlimefunSeed(category, GOLDEN_SEEDS, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 16),
new ItemStack(Material.WHEAT_SEEDS, 16),
new SlimefunItemStack(Items.BLOOD, 16),
new ItemStack(Material.GOLD_INGOT, 16)
}, GOLDEN_WHEAT).register(plugin);

Expand All @@ -286,68 +287,69 @@ Items.BLOOD, new ItemStack(Material.ENCHANTING_TABLE), Items.BLOOD,
}, GOLDEN_SEEDS).register(plugin);

new HarvestScythe(category, HARVEST_SCYTHE, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 16),
new SlimefunItemStack(GOLDEN_WHEAT, 32),
new ItemStack(Material.DIAMOND_HOE),
BLOOD_GEM
}).register(plugin);

new SlimefunItem(category, ENCHANTED_BLOOD_APPLE, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 32),
new SlimefunItemStack(GOLDEN_WHEAT, 32),
new ItemStack(Material.APPLE, 32),
new SlimefunItemStack(BLOOD, 32)
new ItemStack(Material.APPLE, 32)
}).register(plugin);

new SlimefunItem(category, GOLDEN_POTION, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 8),
new ItemStack(Material.HONEY_BOTTLE, 8),
new ItemStack(Material.GOLDEN_APPLE, 4),
new SlimefunItemStack(GOLDEN_WHEAT, 8),
new SlimefunItemStack(BLOOD, 8),
new SlimefunItemStack(GOLDEN_WHEAT, 8)
}).register(plugin);

new SlimefunShroom(category, BLOOD_SHROOM, BloodAltar.TYPE, new ItemStack[] {
new ItemStack(Material.RED_MUSHROOM, 32),
new SlimefunItemStack(BLOOD, 32)
new SlimefunItemStack(BLOOD, 32),
new ItemStack(Material.RED_MUSHROOM, 32)
}, new PotionEffect(PotionEffectType.REGENERATION, 400, 0),
Particle.CRIMSON_SPORE).register(plugin);

new SlimefunItem(category, VAMPIRIC_REGENERATION_POTION, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 32),
new ItemStack(Material.GLASS_BOTTLE),
new SlimefunItemStack(BLOOD_SHROOM, 8),
new ItemStack(Material.GHAST_TEAR, 8),
new SlimefunItemStack(BLOOD, 32),
new ItemStack(Material.GHAST_TEAR, 8)
}).register(plugin);

new SlimefunItem(category, VAMPIRIC_STRENGTH_POTION, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 32),
new ItemStack(Material.GLASS_BOTTLE),
new SlimefunItemStack(BLOOD_SHROOM, 8),
new ItemStack(Material.BLAZE_ROD, 8),
new ItemStack(Material.NETHERITE_SCRAP, 1),
new SlimefunItemStack(BLOOD, 32),
new ItemStack(Material.NETHERITE_SCRAP, 1)
}).register(plugin);

new SlimefunItem(category, VAMPIRIC_SPEED_POTION, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 8),
new ItemStack(Material.GLASS_BOTTLE),
new ItemStack(Material.SUGAR, 16),
new ItemStack(Material.GLOWSTONE_DUST, 16),
new SlimefunItemStack(SlimefunItems.MAGIC_SUGAR, 16),
new SlimefunItemStack(BLOOD, 8),
new SlimefunItemStack(SlimefunItems.MAGIC_SUGAR, 16)
}).register(plugin);

new SlimefunShroom(category, DEATH_SHROOM, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 32),
new ItemStack(Material.BROWN_MUSHROOM, 32),
new ItemStack(Material.BONE, 32),
new ItemStack(Material.WITHER_ROSE, 8),
new SlimefunItemStack(BLOOD, 32)
new ItemStack(Material.WITHER_ROSE, 8)
}, new PotionEffect(PotionEffectType.WITHER, 400, 2),
Particle.WARPED_SPORE).register(plugin);

new SlimefunItem(category, DEATH_POTION, BloodAltar.TYPE, new ItemStack[] {
new SlimefunItemStack(BLOOD, 16),
new ItemStack(Material.GLASS_BOTTLE),
new ItemStack(Material.GUNPOWDER, 8),
new ItemStack(Material.SPIDER_EYE, 4),
new ItemStack(Material.WITHER_ROSE, 4),
new SlimefunItemStack(DEATH_SHROOM, 4),
new SlimefunItemStack(BLOOD, 16)
new SlimefunItemStack(DEATH_SHROOM, 4)
}).register(plugin);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ private void tick(@Nonnull Block b) {
private void onMushroomSpread(@Nonnull BlockSpreadEvent e) {
// Store this item on spread mushrooms
if (BlockStorage.check(e.getSource(), getId())) {

BlockStorage.store(e.getBlock(), getId());
}
System.out.println("SOURCE: " + e.getSource().getType().name() + " ID: " + BlockStorage.checkID(e.getSource()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.inventory.ItemStack;

Expand Down Expand Up @@ -43,7 +44,7 @@ public void run() {
// Done
World world = this.location.getWorld();
if (world != null) {
// TODO sound
world.playSound(this.location, Sound.ITEM_TOTEM_USE, 1, 1);
world.spawnParticle(Particle.REVERSE_PORTAL, this.location, 50);
world.dropItemNaturally(this.location, this.output.getOutput().clone());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -61,8 +63,9 @@ private BlockUseHandler getUseHandler() {
* Finds a recipe from items on the ground and starts the process
*/
private void findRecipe(@Nonnull Location l, @Nonnull Player p) {
World w = p.getWorld();

Collection<Entity> items = p.getWorld().getNearbyEntities(l, 2, 2, 2, e -> e instanceof Item);
Collection<Entity> items = w.getNearbyEntities(l, 2, 2, 2, e -> e instanceof Item);
if (items.size() == 0) {
p.sendMessage(ChatColor.RED + "Drop items near the alter!");
return;
Expand All @@ -81,8 +84,9 @@ private void findRecipe(@Nonnull Location l, @Nonnull Player p) {
}

output.consumeInput();
// TODO sound
p.getWorld().spawnParticle(Particle.PORTAL, l, 50);

w.playSound(l, Sound.BLOCK_END_PORTAL_SPAWN, 1, 1);
w.spawnParticle(Particle.PORTAL, l, 50);

// Start processing the recipe
BloodAlchemy.inst().runSync(new AltarProcess(this, output, l));
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: ${project.version}
api-version: 1.16

commands:
addontemplate:
bloodalchemy:
description: Do /bloodalchemy help for a list of commands
usage: /bloodalchemy <subcommand>
aliases: [bh]
aliases: [ba]

0 comments on commit a14f1b0

Please sign in to comment.