Skip to content
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>me.lucasgithuber</groupId>
<artifactId>ElementManipulation</artifactId>
<version>1.0.2</version>
<version>MODIFIED</version>

<properties>
<maven.compiler.source>16</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import me.lucasgithuber.elementmanipulation.misc.MiscItems;
import me.lucasgithuber.elementmanipulation.utils.Categories;
import net.kyori.adventure.text.minimessage.MiniMessage;
import me.lucasgithuber.elementmanipulation.drugs.Drugs;
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
import net.kyori.adventure.text.minimessage.tag.standard.StandardTags;
import org.bstats.bukkit.Metrics;
Expand Down Expand Up @@ -37,7 +38,7 @@ public void enable() {
Materials.setup(this);
Machines.setup(this);
MiscItems.setup(this);
//Drugs.setup(this);
Drugs.setup(this);
/*PortalCorners.setup(this);*/
new Metrics(this, 13718);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package me.lucasgithuber.elementmanipulation.drugs;

import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent;
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable;
import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler;
import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem;
import me.lucasgithuber.elementmanipulation.ElementManipulation;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import javax.annotation.Nonnull;

public class Alcohol extends SimpleSlimefunItem<ItemUseHandler> implements NotPlaceable {
private final String durationsPath = "drugs.alcohol.effects-duration.";
private final String powersPath = "drugs.alcohol.effects-power.";
public Alcohol(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(itemGroup, item, recipeType, recipe);

}

@Override
public void preRegister() {
addItemHandler(onUse());
}

@Nonnull
@Override
public ItemUseHandler getItemHandler() {
return PlayerRightClickEvent::cancel;
}

@Nonnull
protected ItemUseHandler onUse() {
return e -> {
Player p = e.getPlayer();
ItemStack itemStack = p.getInventory().getItemInMainHand();
if (p.getGameMode() != GameMode.CREATIVE && itemStack.getAmount()>=1) {
itemStack.setAmount(itemStack.getAmount() - 1);
}
p.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, ElementManipulation.config().getInt(durationsPath + "nausea") * 20, 2, false, false, false));
p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, ElementManipulation.config().getInt(durationsPath + "regeneration") * 20, 0, false, false, false));

};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package me.lucasgithuber.elementmanipulation.drugs;

import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent;
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import io.github.thebusybiscuit.slimefun4.core.attributes.NotPlaceable;
import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler;
import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem;
import me.lucasgithuber.elementmanipulation.ElementManipulation;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import javax.annotation.Nonnull;

public class Anesthesic extends SimpleSlimefunItem<ItemUseHandler> implements NotPlaceable {
private final String durationsPath = "drugs.anesthesic.effects-duration.";
private final String powersPath = "drugs.anesthesic.effects-power.";
public Anesthesic(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(itemGroup, item, recipeType, recipe);

}

@Override
public void preRegister() {
addItemHandler(onUse());
}

@Nonnull
@Override
public ItemUseHandler getItemHandler() {
return PlayerRightClickEvent::cancel;
}

@Nonnull
protected ItemUseHandler onUse() {
return e -> {
Player p = e.getPlayer();
ItemStack itemStack = p.getInventory().getItemInMainHand();
if (p.getGameMode() != GameMode.CREATIVE && itemStack.getAmount()>=16) {
itemStack.setAmount(itemStack.getAmount() - 16);
}
p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, ElementManipulation.config().getInt(durationsPath + "damage-resistance") * 20, 250, false, false, false));
p.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, ElementManipulation.config().getInt(durationsPath + "fire-resistance") * 20, 250, false, false, false));
p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, ElementManipulation.config().getInt(durationsPath + "blindness") * 20, 1, false, false, false));
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
import me.lucasgithuber.elementmanipulation.ElementManipulation;
import me.lucasgithuber.elementmanipulation.machines.DrugsTable;
import me.lucasgithuber.elementmanipulation.utils.Categories;
import me.lucasgithuber.elementmanipulation.misc.MiscItems;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Material;
import org.bukkit.Color;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import static me.lucasgithuber.elementmanipulation.elements.Elements.*;

Expand All @@ -24,6 +28,20 @@ public class Drugs {
ChatColor.WHITE +"Makes you feel good"

);
public static final SlimefunItemStack ALCOHOL = new SlimefunItemStack(
"EM_ALCOHOL",
Color.WHITE,
new PotionEffect(PotionEffectType.NIGHT_VISION, 2, 0),
ChatColor.of("#FFD78A") + "Alcohol",
ChatColor.of("#FFD78A") + "Makes you drunk",
ChatColor.of("#FFD78A") + "Makes emotional pain go away"
);
public static final SlimefunItemStack ANESTHESIC = new SlimefunItemStack(
"EM_ANESTHESIC",
Material.END_ROD,
"&8anesthesic",
"&8Makes you feel nothing"
);
public static void setup(ElementManipulation em){
new Caffeine(Categories.DRUGS_CHEAT, CAFFEINE, DrugsTable.TYPE, new ItemStack[]{
null,null,null,OXYGEN,null,null,
Expand All @@ -41,5 +59,21 @@ public static void setup(ElementManipulation em){
null,null,null,CARBON,null,null,
null,null,null,HYDROGEN,NITROGEN,HYDROGEN
}).register(em);
new Alcohol(Categories.DRUGS_CHEAT, ALCOHOL, DrugsTable.TYPE, new ItemStack[]{
new ItemStack(Material.GLASS_BOTTLE),HYDROGEN,HYDROGEN,null,null,null,
HYDROGEN,CARBON,CARBON,OXYGEN,HYDROGEN,null,
null,HYDROGEN,HYDROGEN,null,null,null,
null,HYDROGEN,HYDROGEN,null,null,null,
HYDROGEN,CARBON,CARBON,OXYGEN,HYDROGEN,null,
null,HYDROGEN,HYDROGEN,null,null,null,
}).register(em);
new Anesthesic(Categories.DRUGS_CHEAT, ANESTHESIC, DrugsTable.TYPE, new ItemStack[]{
MiscItems.SYRINGE,CARBON,NITROGEN,NITROGEN,CARBON,HYDROGEN,
HYDROGEN,CARBON,NITROGEN,NITROGEN,CARBON,HYDROGEN,
HYDROGEN,CARBON,NITROGEN,NITROGEN,CARBON,HYDROGEN,
HYDROGEN,CARBON,NITROGEN,NITROGEN,CARBON,HYDROGEN,
HYDROGEN,CARBON,NITROGEN,NITROGEN,CARBON,HYDROGEN,
HYDROGEN,CARBON,NITROGEN,NITROGEN,CARBON,HYDROGEN,
}).register(em);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public void registerDefaultRecipes() {
new CustomItemStack(Elements.SODIUM, 8),
new CustomItemStack(Elements.CALCIUM, 8),
new CustomItemStack(Elements.SILICON, 4),
new CustomItemStack(Elements.SULFUR, 4),
});
registerRecipe(4, new ItemStack[] {new ItemStack(Material.EMERALD, 64)},
new ItemStack[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.github.thebusybiscuit.slimefun4.utils.LoreBuilder;
import me.lucasgithuber.elementmanipulation.ElementManipulation;
import me.lucasgithuber.elementmanipulation.utils.Categories;
import me.lucasgithuber.elementmanipulation.misc.MiscItems;
import net.kyori.adventure.platform.bukkit.BukkitComponentSerializer;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
Expand Down Expand Up @@ -84,11 +85,11 @@ SlimefunItems.REINFORCED_PLATE,new ItemStack(Material.GLASS),SlimefunItems.REINF
SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.GLASS), SlimefunItems.REINFORCED_PLATE,
SlimefunItems.REINFORCED_PLATE, SlimefunItems.LARGE_CAPACITOR, SlimefunItems.REINFORCED_PLATE
}).setProcessingSpeed(1).setCapacity(64).setEnergyConsumption(16);
/*new DrugsTable(Categories.MACHINES, DRUGS_TABLE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[]{
new DrugsTable(Categories.MACHINES, DRUGS_TABLE, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[]{
new ItemStack(Material.NETHER_STAR), MiscItems.CLEAR_GLASS_3,new ItemStack(Material.NETHER_STAR),
SlimefunItems.REINFORCED_PLATE,SlimefunItems.CRAFTING_MOTOR,SlimefunItems.REINFORCED_PLATE,
new ItemStack(Material.BLACK_CONCRETE),SlimefunItems.LARGE_CAPACITOR,new ItemStack(Material.BLACK_CONCRETE),
}, 4096).register(em);*/
}, 4096).register(em);
/*new PortalTable(Categories.MACHINES, PORTAL_TABLE, new ItemStack[] {
* null , null , null,
null, new ItemStack(Material.DARK_OAK_FENCE), null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package me.lucasgithuber.elementmanipulation.misc;

import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.UnplaceableBlock;
import me.lucasgithuber.elementmanipulation.ElementManipulation;
import me.lucasgithuber.elementmanipulation.utils.Categories;
import me.lucasgithuber.elementmanipulation.items.Materials;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;

import static me.lucasgithuber.elementmanipulation.elements.Elements.*;

public class MiscItems {
public static final SlimefunItemStack CLEAR_GLASS_1 = new SlimefunItemStack(
Expand All @@ -31,6 +36,18 @@ public class MiscItems {
"&fThis glass is so clear that it seems",
"&fThere's nothing in your way"
);
public static final SlimefunItemStack SYRINGE = new SlimefunItemStack(
"EM_SYRINGE",
Material.END_ROD,
"&fSyringe",
"&fUsed to put anesthesics"
);
public static final SlimefunItemStack RUBBER_PISTON = new SlimefunItemStack(
"EM_RUBBER_PISTON",
Material.BLACK_DYE,
"&7Rubber piston",
"&7Component of syringes"
);
public static void setup(ElementManipulation em){
new UnplaceableBlock(Categories.MISCELLANEOUS, CLEAR_GLASS_1, RecipeType.SMELTERY, new ItemStack[]{
new ItemStack(Material.GLASS_PANE), null, null,
Expand All @@ -47,5 +64,16 @@ public static void setup(ElementManipulation em){
null, null, null,
null, null, null
}).register(em);
new SlimefunItem(Categories.MISCELLANEOUS, RUBBER_PISTON, RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[]{
SULFUR,SULFUR,SULFUR,
SULFUR,CARBON,SULFUR,
SULFUR,SULFUR,SULFUR,
}).register(em);
new UnplaceableBlock(Categories.MISCELLANEOUS, SYRINGE, RecipeType.SMELTERY, new ItemStack[]{
SlimefunItems.PLASTIC_SHEET, null, SlimefunItems.PLASTIC_SHEET,
SlimefunItems.PLASTIC_SHEET, null, SlimefunItems.PLASTIC_SHEET,
SlimefunItems.PLASTIC_SHEET, RUBBER_PISTON, SlimefunItems.PLASTIC_SHEET
}).register(em);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public class Categories {

public static void setup(ElementManipulation em){
JUNCTION_CATEGORY.register(em);
/*DRUGS_CATEGORY.register(em);*/
DRUGS_CATEGORY.register(em);
MAIN.register(em);
JUNCTION_CHEAT.register(em);
/*DRUGS_CHEAT.register(em);*/
DRUGS_CHEAT.register(em);
}

}