mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
commit
7fe97e6813
@ -98,6 +98,7 @@ public final class SlimefunItems {
|
||||
|
||||
/* Food */
|
||||
public static final ItemStack FORTUNE_COOKIE = new CustomItem(Material.COOKIE, "&6Fortune Cookie", "", "&a&oTells you stuff about your Future :o");
|
||||
public static final ItemStack DIET_COOKIE = new CustomItem(Material.COOKIE, "&6Diet Cookie", "", "&aA very &olightweight &r&acookie.");
|
||||
public static final ItemStack BEEF_JERKY = new CustomItem(Material.COOKED_BEEF, "&6Beef Jerky", "", "&a&oSaturating");
|
||||
public static final ItemStack MAGIC_SUGAR = new CustomItem(Material.SUGAR, "&6Magic Sugar", "", "&a&oFeel the Power of Hermes!");
|
||||
public static final ItemStack MONSTER_JERKY = new CustomItem(Material.ROTTEN_FLESH, "&6Monster Jerky", "", "&a&oNo longer hungry");
|
||||
|
@ -241,5 +241,6 @@ public final class ResearchSetup {
|
||||
Slimefun.registerResearch(new Research(241, "Thinned-down Conductivity", 15), SlimefunItems.COPPER_WIRE);
|
||||
Slimefun.registerResearch(new Research(242, "Radiant Backpack", 25), SlimefunItems.RADIANT_BACKPACK);
|
||||
Slimefun.registerResearch(new Research(243, "A Dry Day", 15), SlimefunItems.AUTO_DRIER);
|
||||
Slimefun.registerResearch(new Research(244, "Diet Cookie", 3), SlimefunItems.DIET_COOKIE);
|
||||
}
|
||||
}
|
||||
|
@ -197,6 +197,29 @@ public final class SlimefunSetup {
|
||||
new ItemStack[] {new ItemStack(Material.COOKIE), new ItemStack(Material.PAPER), null, null, null, null, null, null, null})
|
||||
.register(true);
|
||||
|
||||
new SlimefunItem(Categories.FOOD, SlimefunItems.DIET_COOKIE, "DIET_COOKIE", RecipeType.MAGIC_WORKBENCH,
|
||||
new ItemStack[] {new ItemStack(Material.COOKIE), SlimefunItems.ELYTRA_SCALE, null, null, null, null, null, null, null})
|
||||
.register(true, new ItemInteractionHandler() {
|
||||
@Override
|
||||
public boolean onRightClick(ItemUseEvent e, Player p, ItemStack item) {
|
||||
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.DIET_COOKIE, true)) {
|
||||
e.setCancelled(true);
|
||||
|
||||
int amount = item.getAmount();
|
||||
if (amount <= 1) item.setType(Material.AIR);
|
||||
item.setAmount(amount - 1);
|
||||
|
||||
p.sendMessage(ChatColor.YELLOW + "You feel so light...");
|
||||
p.playSound(p.getLocation(), Sound.ENTITY_GENERIC_EAT, 1, 1);
|
||||
|
||||
if (p.hasPotionEffect(PotionEffectType.LEVITATION)) p.removePotionEffect(PotionEffectType.LEVITATION);
|
||||
p.addPotionEffect(PotionEffectType.LEVITATION.createEffect(60, 1));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
new SlimefunItem(Categories.MACHINES_1, SlimefunItems.OUTPUT_CHEST, "OUTPUT_CHEST", RecipeType.ENHANCED_CRAFTING_TABLE,
|
||||
new ItemStack[] {SlimefunItems.LEAD_INGOT, new ItemStack(Material.HOPPER), SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, new ItemStack(Material.CHEST), SlimefunItems.LEAD_INGOT, null, SlimefunItems.LEAD_INGOT, null})
|
||||
.register(true);
|
||||
|
Loading…
Reference in New Issue
Block a user