Skip to content

Commit

Permalink
Update to 1.21.1 and gradle to 8.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
md5sha256 committed Dec 20, 2024
1 parent 26d88ee commit 2a70a71
Show file tree
Hide file tree
Showing 24 changed files with 96 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected AbstractDrugComponent(@NotNull ItemFactory itemFactory,
this.itemFactory = Objects.requireNonNull(itemFactory);
this.name = Objects.requireNonNull(name);
this.key = key;
this.item = new ItemStack(material);
this.item = ItemStack.of(material);
this.meta = meta();
this.item.setItemMeta(this.meta);
}
Expand Down
11 changes: 6 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ plugins {
group = "io.github.md5sha256"
version = "0.0.1-SNAPSHOT"

java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
val javaVersion = 21;

java.toolchain.languageVersion.set(JavaLanguageVersion.of(javaVersion))

subprojects {

Expand All @@ -21,7 +23,7 @@ subprojects {
plugin<EclipsePlugin>()
}

java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
java.toolchain.languageVersion.set(JavaLanguageVersion.of(javaVersion))

repositories {
mavenCentral()
Expand All @@ -35,16 +37,15 @@ subprojects {
}
maven {
name = "paper-repo"
url = uri("https://papermc.io/repo/repository/maven-public/")
url = uri("https://repo.papermc.io/repository/maven-public/")
}
}

tasks {

withType(JavaCompile::class) {
options.release.set(17)
options.release.set(javaVersion)
options.encoding = Charsets.UTF_8.name()
options.isFork = true
options.isDeprecation = true
}

Expand Down
18 changes: 9 additions & 9 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
id("com.github.johnrengelman.shadow") version "7.1.2"
id("com.gradleup.shadow") version "9.0.0-beta4"
}

var relocationBase = "com.github.md5sha256.addictiveexperience.shaded"
Expand Down Expand Up @@ -87,14 +87,14 @@ tasks {
archiveClassifier.set("")

dependencies {
exclude(dependency(libs.gson.orNull))
exclude(dependency(libs.guava.orNull))
exclude(dependency(libs.errorproneAnnotation.orNull))
exclude(dependency(libs.adventureApi.orNull))
exclude(dependency(libs.adventureKey.orNull))
exclude(dependency(libs.adventureBom.orNull))
exclude(dependency(libs.examinationApi.orNull))
exclude(dependency(libs.examinationString.orNull))
exclude(dependency(libs.gson.orNull!!))
exclude(dependency(libs.guava.orNull!!))
exclude(dependency(libs.errorproneAnnotation.orNull!!))
exclude(dependency(libs.adventureApi.orNull!!))
exclude(dependency(libs.adventureKey.orNull!!))
exclude(dependency(libs.adventureBom.orNull!!))
exclude(dependency(libs.examinationApi.orNull!!))
exclude(dependency(libs.examinationString.orNull!!))
}

relocate("com.github.md5sha256.spigotutils", "${relocationBase}.spigotutils")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public MushroomPsilocybin(@NotNull ItemFactory itemFactory,
.toBuilder()
.slurEffect(null)
.potionEffects(
new PotionEffect(PotionEffectType.CONFUSION, 100, 2),
new PotionEffect(PotionEffectType.NAUSEA, 100, 2),
new PotionEffect(PotionEffectType.SPEED, 500, 5)
)
.overdoseThreshold(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public final class DrugCocaine extends AbstractDrug implements ISynthetic {
.slurEffect(null)
.potionEffects(
new PotionEffect(PotionEffectType.SPEED, 400, 2),
new PotionEffect(PotionEffectType.JUMP, 300, 2)
new PotionEffect(PotionEffectType.JUMP_BOOST, 300, 2)
)
.build();
drugRegistry.registerComponent(this, plantCocaine, leafCocaine);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public final class DrugEcstasy extends AbstractDrug {
.overdoseThreshold(70)
.potionEffects(
new PotionEffect(PotionEffectType.SPEED, 500, 2),
new PotionEffect(PotionEffectType.JUMP, 1000, 5)
new PotionEffect(PotionEffectType.JUMP_BOOST, 1000, 5)
)
.build();
drugRegistry.registerComponent(this, barkSafrole, safrole, seedSafrole, mcl, mercury);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public final class Mercury extends AbstractDrugComponent {

protected final @NotNull ItemMeta meta() {
final ItemMeta meta = this.itemFactory.getItemMeta(Material.GUNPOWDER);
meta.addEnchant(Enchantment.DURABILITY, 1, true);
meta.addEnchant(Enchantment.UNBREAKING, 1, true);
AdventureUtils.setDisplayName(meta, Component.text("mercury", NamedTextColor.GOLD));
List<Component> lore = Arrays.asList(
Component.text("Highly toxic element, which is", NamedTextColor.WHITE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private Recipe createRecipe(@NotNull Plugin plugin) {

protected final @NotNull ItemMeta meta() {
final ItemMeta meta = this.itemFactory.getItemMeta(Material.GLASS_BOTTLE);
meta.addEnchant(Enchantment.DURABILITY, 1, true);
meta.addEnchant(Enchantment.UNBREAKING, 1, true);
final Component displayName = Component.text("Methylamine Chloride", NamedTextColor.GOLD);
AdventureUtils.setDisplayName(meta, displayName);
final List<Component> lore = Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public final class DrugFentanyl extends AbstractDrug implements ISynthetic {
.overdoseThreshold(50)
.slurEffect(null)
.potionEffects(
new PotionEffect(PotionEffectType.CONFUSION, 200, 3)
new PotionEffect(PotionEffectType.NAUSEA, 200, 3)
)
.customEffects(effectRandomDeath)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public final class DrugHeroin extends AbstractDrug implements ISynthetic {
.slurEffect(null)
.overdoseThreshold(40)
.potionEffects(
new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 100, 2),
new PotionEffect(PotionEffectType.STRENGTH, 100, 2),
new PotionEffect(PotionEffectType.BLINDNESS, 60, 2)
)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public final class DrugLSD extends AbstractDrug implements ISynthetic {
.potionEffects(
new PotionEffect(PotionEffectType.SPEED, 1000, 5),
new PotionEffect(PotionEffectType.BLINDNESS, 500, 4),
new PotionEffect(PotionEffectType.CONFUSION, 300, 5)
new PotionEffect(PotionEffectType.NAUSEA, 300, 5)
)
.build();
drugRegistry.registerComponent(
Expand Down Expand Up @@ -91,7 +91,7 @@ private Recipe createRecipe(@NotNull Plugin plugin,

protected final @NotNull ItemMeta meta() {
final ItemMeta meta = this.itemFactory.getItemMeta(Material.PAPER);
meta.addEnchant(Enchantment.DURABILITY, 1, true);
meta.addEnchant(Enchantment.UNBREAKING, 1, true);
AdventureUtils.setDisplayName(meta, Component.text("LSD", NamedTextColor.AQUA));
final List<Component> lore = Arrays.asList(
Component.text("Lysergic acid diethylamide, also known", NamedTextColor.WHITE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private Recipe createRecipe(@NotNull Plugin plugin, @NotNull SeedMorningGlory gl
@Override
protected final @NotNull ItemMeta meta() {
final ItemMeta meta = this.itemFactory.getItemMeta(Material.WATER_BUCKET);
meta.addEnchant(Enchantment.DURABILITY, 1, true);
meta.addEnchant(Enchantment.UNBREAKING, 1, true);
final Component displayName = Component.text("Lysergic Acid", NamedTextColor.AQUA);
AdventureUtils.setDisplayName(meta, displayName);
final List<Component> lore = Collections.singletonList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public final class DrugMethamphetamine extends AbstractDrug implements ISyntheti
.overdoseThreshold(60)
.potionEffects(
new PotionEffect(PotionEffectType.POISON, 300, 2),
new PotionEffect(PotionEffectType.FAST_DIGGING, 200, 2)
new PotionEffect(PotionEffectType.HASTE, 200, 2)
)
.build();
drugRegistry.registerComponent(hcl, phosphorus, iodine, ephedrine, plantEphedrine);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public final class FormSyringe extends AbstractDrugForm implements IDrugForm {

@Override
public @NotNull Optional<@NotNull ItemStack> asItem() {
final ItemStack itemStack = new ItemStack(this.material);
final ItemStack itemStack = ItemStack.of(this.material);
asMeta().ifPresent(itemStack::setItemMeta);
return Optional.of(itemStack);
}

@Override
public @NotNull ItemStack asItem(@NotNull IDrug drug) {
final ItemStack item = new ItemStack(this.material);
final ItemStack item = ItemStack.of(this.material);
item.setItemMeta(asMeta(drug));
return item;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class BluntLit extends AbstractDrugForm implements FormBlunt {

@Override
public @NotNull ItemStack asItem(@NotNull final IDrug drug) {
final ItemStack itemStack = new ItemStack(Material.TORCH);
final ItemStack itemStack = ItemStack.of(Material.TORCH);
itemStack.setItemMeta(asMeta(drug));
return itemStack;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public final class BluntUnlit extends AbstractDrugForm implements FormBlunt {
@NotNull DrugMarijuana marijuana) {
super(itemFactory, Utils.internalKey("blunt_unlit"), "Blunt_Unlit");
this.metaEmptyContents = metaEmpty();
this.itemEmptyContents = new ItemStack(Material.STICK);
this.itemEmptyContents = ItemStack.of(Material.STICK);
this.itemEmptyContents.setItemMeta(this.metaEmptyContents);
registerRecipes(plugin, marijuana);
}
Expand Down Expand Up @@ -106,7 +106,7 @@ private void registerRecipes(@NotNull Plugin plugin, @NotNull DrugMarijuana mari

@Override
public @NotNull ItemStack asItem(@NotNull final IDrug drug) {
final ItemStack itemStack = new ItemStack(Material.STICK);
final ItemStack itemStack = ItemStack.of(Material.STICK);
itemStack.setItemMeta(asMeta(drug));
return itemStack;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ public void setup() {
}

private GuiElement elementPanes(char c) {
final ItemStack itemStack = new ItemStack(Material.LIGHT_BLUE_STAINED_GLASS_PANE);
final ItemStack itemStack = ItemStack.of(Material.LIGHT_BLUE_STAINED_GLASS_PANE);
final ItemMeta meta = itemStack.getItemMeta();
AdventureUtils.setDisplayName(meta, Component.empty());
itemStack.setItemMeta(meta);
return new StaticGuiElement(c, itemStack);
}

private GuiElement elementExit(char c) {
final ItemStack itemStack = new ItemStack(Material.BARRIER);
final ItemStack itemStack = ItemStack.of(Material.BARRIER);
final Component displayName = Component.text("Exit", NamedTextColor.RED);
return new StaticGuiElement(c,
itemStack,
Expand All @@ -103,7 +103,7 @@ private GuiElement elementExit(char c) {
}

private GuiElement elementNext(char c) {
final ItemStack itemStack = new ItemStack(Material.PAPER);
final ItemStack itemStack = ItemStack.of(Material.PAPER);
final Component displayName = Component.text("Next Page", NamedTextColor.DARK_AQUA);
return new GuiPageElement(c,
itemStack,
Expand All @@ -112,7 +112,7 @@ private GuiElement elementNext(char c) {
}

private GuiElement elementPrevious(char c) {
final ItemStack itemStack = new ItemStack(Material.PAPER);
final ItemStack itemStack = ItemStack.of(Material.PAPER);
final Component displayName = Component.text("Previous Page", NamedTextColor.DARK_AQUA);
return new GuiPageElement(c,
itemStack,
Expand All @@ -131,7 +131,7 @@ private GuiElement elementDrugs(char c) {
private GuiElement elementDrug(IDrugComponent component) {
final char c = 'a';
final ItemStack drugAsItem = component.asItem();
final ItemStack button = new ItemStack(drugAsItem.getType());
final ItemStack button = ItemStack.of(drugAsItem.getType());
final ItemMeta meta = button.getItemMeta();
final Component displayName = AdventureUtils.getDisplayName(meta);
final Component buttonDisplayName = Component
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: AddictiveExperience
version: "@version@"
main: io.github.md5sha256.addictiveexperience.AddictiveExperiencePlugin
api-version: 1.18
api-version: 1.21
depend:
- vault
- Vault
softdepend:
- essentials
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testItemDataSerialization() {
drugRegistry.registerComponent(drug);
final DrugItemDataFactory itemDataFactory = new SimpleDrugItemDataFactory(plugin, drugRegistry);

final ItemStack original = new ItemStack(Material.STRING);
final ItemStack original = ItemStack.of(Material.STRING);
final ItemStack drugEncoded = original.clone();
itemDataFactory.data(drugEncoded, DrugItemData.of(drug, form));
final Optional<IDrugComponent> optionalComponent = itemDataFactory.parseComponent(drugEncoded);
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
# Platform
minecraft = "1.19.2-R0.1-SNAPSHOT"
minecraft = "1.21.1-R0.1-SNAPSHOT"
findbugs = "3.0.2"
gson = "2.8.0"
adventure = "4.10.1"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 2a70a71

Please sign in to comment.