Skip to content

Commit

Permalink
feat: 1.20.6
Browse files Browse the repository at this point in the history
Took 3 hours 2 minutes
  • Loading branch information
Swofty-Developments committed Jun 9, 2024
1 parent 2294d7a commit 76ae9a0
Show file tree
Hide file tree
Showing 106 changed files with 475 additions and 576 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .idea/material_theme_project_new.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion commons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ java {
dependencies {
implementation(project(":packer"))
implementation(project(":service.protocol"))
implementation("com.github.Minestom:Minestom:19bb74e942") {
implementation("com.github.Minestom:Minestom:b3aa996e1d") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public enum MinecraftVersion {
MINECRAFT_1_19_4(762, new String[]{"1.19.4"}),
MINECRAFT_1_20(763, new String[]{"1.20", "1.20.1"}),
MINECRAFT_1_20_2(764, new String[]{"1.20.2"}),
MINECRAFT_1_20_3(765, new String[]{"1.20.3", "1.20.4"});
MINECRAFT_1_20_3(765, new String[]{"1.20.3", "1.20.4"}),
MINECRAFT_1_20_5(766, new String[]{"1.20.5", "1.20.6"}),
;

private final int protocol;
private final String[] versions;
Expand Down
2 changes: 1 addition & 1 deletion loader/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies {
implementation(project(":proxy.api"))
implementation(project(":spark"))
implementation("org.slf4j:slf4j-api:2.0.13")
implementation("com.github.Minestom:Minestom:19bb74e942") {
implementation("com.github.Minestom:Minestom:b3aa996e1d") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
implementation("dev.hollowcube:polar:1.7.2")
Expand Down
2 changes: 1 addition & 1 deletion proxy.api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
implementation(project(":commons"))
implementation(project(":service.protocol"))
implementation("com.github.Swofty-Developments:AtlasRedisAPI:1.1.2")
implementation("com.github.Minestom:Minestom:19bb74e942") {
implementation("com.github.Minestom:Minestom:b3aa996e1d") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
implementation("net.kyori:adventure-api:4.17.0")
Expand Down
2 changes: 1 addition & 1 deletion spark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repositories {
}

dependencies {
implementation("com.github.Minestom:Minestom:19bb74e942") {
implementation("com.github.Minestom:Minestom:b3aa996e1d") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
implementation(files("dependencies/spark-1.10.1.10-minestom.jar"))
Expand Down
4 changes: 2 additions & 2 deletions type.generic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ dependencies {
implementation(project(":service.protocol"))
implementation(project(":packer"))
implementation(project(":proxy.api"))
implementation("com.github.Minestom:Minestom:19bb74e942") {
implementation("com.github.Minestom:Minestom:b3aa996e1d") {
exclude(group = "org.jboss.shrinkwrap.resolver", module = "shrinkwrap-resolver-depchain")
}
implementation("dev.hollowcube:polar:1.7.2")
implementation("dev.hollowcube:polar:1.9.5")
}

tasks.withType<JavaCompile> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import net.minestom.server.adventure.audience.Audiences;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.event.server.ServerTickMonitorEvent;
import net.minestom.server.instance.AnvilLoader;
import net.minestom.server.instance.InstanceContainer;
import net.minestom.server.instance.InstanceManager;
import net.minestom.server.instance.anvil.AnvilLoader;
import net.minestom.server.instance.block.Block;
import net.minestom.server.monitoring.BenchmarkManager;
import net.minestom.server.monitoring.TickMonitor;
Expand Down Expand Up @@ -226,7 +226,7 @@ public void initialize(MinecraftServer server) {
*/
SkyBlockRegion.cacheRegions();
SkyBlockMiningConfiguration.startRepeater(MinecraftServer.getSchedulerManager());
MinecraftServer.getDimensionTypeManager().addDimension(
MinecraftServer.getDimensionTypeRegistry().register(
DimensionType.builder(NamespaceID.from("skyblock:island"))
.ambientLight(2)
.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;
import net.minestom.server.item.ItemComponent;
import net.swofty.types.generic.data.mongodb.CoopDatabase;
import net.swofty.types.generic.item.SkyBlockItem;
import net.swofty.types.generic.item.updater.NonPlayerItemUpdater;
Expand Down Expand Up @@ -55,11 +56,11 @@ public List<String> getLore(SkyBlockPlayer player) {
List<String> toReturn = new ArrayList<>();

if (player == null) {
new NonPlayerItemUpdater(item).getUpdatedItem().build().getLore().forEach(loreEntry -> {
new NonPlayerItemUpdater(item).getUpdatedItem().build().get(ItemComponent.LORE).forEach(loreEntry -> {
toReturn.add(StringUtility.getTextFromComponent(loreEntry));
});
} else {
PlayerItemUpdater.playerUpdate(player, item.getItemStack()).build().getLore().forEach(loreEntry -> {
PlayerItemUpdater.playerUpdate(player, item.getItemStack()).build().get(ItemComponent.LORE).forEach(loreEntry -> {
toReturn.add(StringUtility.getTextFromComponent(loreEntry));
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.swofty.types.generic.collection;

import net.minestom.server.item.ItemComponent;
import net.minestom.server.item.ItemStack;
import net.minestom.server.item.Material;
import net.swofty.types.generic.gui.inventory.ItemStackCreator;
Expand Down Expand Up @@ -88,7 +89,7 @@ public UnlockType type() {
public ItemStack.Builder getDisplay(SkyBlockPlayer player) {
ItemStack.Builder updatedItem = new NonPlayerItemUpdater(getRecipes().getFirst().getResult()).getUpdatedItem();
ArrayList<String> lore = new ArrayList<>(
updatedItem.build().getLore().stream().map(StringUtility::getTextFromComponent).toList()
updatedItem.build().get(ItemComponent.LORE).stream().map(StringUtility::getTextFromComponent).toList()
);
lore.add(" ");
int others = getRecipes().size() - 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void run(MinestomCommand command) {
SkyBlockPlayer player = (SkyBlockPlayer) sender;
SkyBlockItem item = new SkyBlockItem(player.getInventory().getItemInHand(Player.Hand.MAIN));

ItemAttribute attribute = (ItemAttribute) item.getAttribute(key);
ItemAttribute attribute = item.getAttribute(key);
attribute.setValue(attribute.loadFromString(value));

player.getInventory().setItemInHand(Player.Hand.MAIN, item.getItemStack());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.swofty.types.generic.command.commands;

import net.minestom.server.item.ItemComponent;
import net.swofty.types.generic.command.CommandParameters;
import net.swofty.types.generic.command.SkyBlockCommand;
import net.swofty.types.generic.item.SkyBlockItem;
Expand Down Expand Up @@ -28,7 +29,9 @@ public void run(MinestomCommand command) {
ItemAttributeHandler itemAttributeHandler = item.getAttributeHandler();
try {
itemAttributeHandler.setMithrilInfused(true);
player.sendMessage("§aMithril Infusion applied to " + player.getInventory().getItemInMainHand().getDisplayName().toString() + ".");
player.sendMessage("§aMithril Infusion applied to " + player.getInventory().getItemInMainHand().get(
ItemComponent.CUSTOM_NAME
).toString() + ".");
} catch (IllegalArgumentException e) {
player.sendMessage("§c" + e.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import net.minestom.server.entity.PlayerSkin;
import net.minestom.server.entity.metadata.other.ArmorStandMeta;
import net.minestom.server.instance.Instance;
import net.minestom.server.item.ItemComponent;
import net.minestom.server.item.ItemStack;
import net.minestom.server.item.Material;
import net.minestom.server.item.component.HeadProfile;
import net.swofty.types.generic.user.fairysouls.FairySoul;
import net.swofty.types.generic.utility.ExtraItemTags;

import java.util.UUID;

Expand All @@ -27,10 +28,9 @@ public EntityFairySoul(FairySoul parent) {
meta.setHasNoGravity(true);
meta.setNotifyAboutChanges(false);

setHelmet(ItemStack.builder(Material.PLAYER_HEAD).meta(iMeta -> {
iMeta.damage(3);
iMeta.set(ExtraItemTags.SKULL_OWNER, new ExtraItemTags.SkullOwner(UUID.randomUUID(), null, new PlayerSkin(SKULL_TEXTURES, null)));
}).build());
setHelmet(ItemStack.builder(Material.PLAYER_HEAD)
.set(ItemComponent.PROFILE, new HeadProfile(new PlayerSkin(SKULL_TEXTURES, null)))
.build());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import net.minestom.server.entity.EntityType;
import net.minestom.server.entity.LivingEntity;
import net.minestom.server.entity.metadata.other.ArmorStandMeta;
import net.minestom.server.item.ItemComponent;
import net.minestom.server.item.ItemStack;
import net.minestom.server.item.Material;
import net.minestom.server.item.metadata.LeatherArmorMeta;
import net.minestom.server.item.component.DyedItemColor;
import net.swofty.types.generic.gui.inventory.ItemStackCreator;
import net.swofty.types.generic.item.SkyBlockItem;
import net.swofty.types.generic.item.impl.MinionSkinItem;
Expand Down Expand Up @@ -68,18 +69,12 @@ public void updateMinionDisplay(IslandMinionData.IslandMinion updatedMinion) {
setChestplate(skinItem.getChestplate());
} else {
setHelmet(ItemStackCreator.getStackHead(minionTier.texture()).build());
setBoots(ItemStack.builder(Material.LEATHER_BOOTS).meta(bootMeta -> {
LeatherArmorMeta.Builder leatherMeta = new LeatherArmorMeta.Builder(bootMeta.tagHandler());
leatherMeta.color(minion.getBootColour());
}).build());
setLeggings(ItemStack.builder(Material.LEATHER_LEGGINGS).meta(leggingsMeta -> {
LeatherArmorMeta.Builder leatherMeta = new LeatherArmorMeta.Builder(leggingsMeta.tagHandler());
leatherMeta.color(minion.getLeggingsColour());
}).build());
setChestplate(ItemStack.builder(Material.LEATHER_CHESTPLATE).meta(chestplateMeta -> {
LeatherArmorMeta.Builder leatherMeta = new LeatherArmorMeta.Builder(chestplateMeta.tagHandler());
leatherMeta.color(minion.getChestplateColour());
}).build());
setBoots(ItemStack.builder(Material.LEATHER_BOOTS).set(ItemComponent.DYED_COLOR,
new DyedItemColor(minion.getBootColour(), false)).build());
setLeggings(ItemStack.builder(Material.LEATHER_LEGGINGS).set(ItemComponent.DYED_COLOR,
new DyedItemColor(minion.getLeggingsColour(), false)).build());
setChestplate(ItemStack.builder(Material.LEATHER_CHESTPLATE).set(ItemComponent.DYED_COLOR,
new DyedItemColor(minion.getChestplateColour(), false)).build());
}

setItemInMainHand(ItemStack.builder(minionTier.heldItem()).build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minestom.server.entity.LivingEntity;
import net.minestom.server.entity.metadata.other.ArmorStandMeta;
import net.minestom.server.network.packet.server.play.ParticlePacket;
import net.minestom.server.particle.Particle;
import net.minestom.server.timer.Task;
import net.minestom.server.timer.TaskSchedule;
import net.swofty.types.generic.SkyBlockGenericLoader;
Expand All @@ -21,7 +22,7 @@
public class PetEntityImpl extends LivingEntity {
private final String url;
private final SkyBlockPlayer player;
private final int particle;
private final Particle particle;
private Task upAndDownTask;
private Task moveTowardsPlayer;
@Getter
Expand Down Expand Up @@ -87,8 +88,7 @@ public void spawn() {
0.1f,
0.1f,
0f,
3,
null
3
));
});
}, TaskSchedule.tick(5), TaskSchedule.tick(3));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void spawn() {
teleport(getPosition().add(0, yLevel, 0));
SkyBlockGenericLoader.getLoadedPlayers().forEach(player -> {
player.sendPacket(new ParticlePacket(
Particle.HAPPY_VILLAGER.id(),
Particle.HAPPY_VILLAGER,
false,
getPosition().x(),
getPosition().y(),
Expand All @@ -90,8 +90,7 @@ public void spawn() {
0.1f,
0.1f,
0f,
3,
null
3
));
});
}, TaskSchedule.tick(15), TaskSchedule.tick(3));
Expand Down Expand Up @@ -138,7 +137,7 @@ public void spawn() {

SkyBlockGenericLoader.getLoadedPlayers().forEach(player -> {
player.sendPacket(new ParticlePacket(
38,
Particle.CLOUD,
false,
pos.x(),
pos.y(),
Expand All @@ -147,8 +146,7 @@ public void spawn() {
0.1f,
0.1f,
0f,
3,
null
3
));
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import net.kyori.adventure.key.Key;
import net.kyori.adventure.sound.Sound;
import net.kyori.adventure.text.Component;
import net.minestom.server.attribute.Attribute;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.entity.Entity;
import net.minestom.server.entity.EntityCreature;
import net.minestom.server.entity.EntityType;
import net.minestom.server.entity.ai.GoalSelector;
import net.minestom.server.entity.ai.TargetSelector;
import net.minestom.server.entity.attribute.Attribute;
import net.minestom.server.entity.damage.Damage;
import net.minestom.server.instance.Instance;
import net.minestom.server.timer.Scheduler;
Expand Down Expand Up @@ -52,8 +52,8 @@ public SkyBlockMob(EntityType entityType) {
super(entityType);

this.setCustomNameVisible(true);
this.getAttribute(Attribute.MAX_HEALTH).setBaseValue(getBaseStatistics().getOverall(ItemStatistic.HEALTH).floatValue());
this.getAttribute(Attribute.MOVEMENT_SPEED).setBaseValue((float) ((getBaseStatistics().getOverall(ItemStatistic.SPEED).floatValue() / 1000) * 2.5));
this.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(getBaseStatistics().getOverall(ItemStatistic.HEALTH).floatValue());
this.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue((float) ((getBaseStatistics().getOverall(ItemStatistic.SPEED).floatValue() / 1000) * 2.5));
this.setHealth(getBaseStatistics().getOverall(ItemStatistic.HEALTH).floatValue());

this.setCustomName(Component.text(
Expand Down Expand Up @@ -111,7 +111,7 @@ public boolean damage(@NotNull Damage damage) {
"§8[§7Lv" + getLevel() + "§8] §c" + getDisplayName()
+ " §a" + Math.round(getHealth())
+ "§f/§a"
+ Math.round(this.getAttributeValue(Attribute.MAX_HEALTH))
+ Math.round(this.getAttributeValue(Attribute.GENERIC_MAX_HEALTH))
));

return toReturn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ public class NPCEntityImpl extends Entity {
private final String[] holograms;

public NPCEntityImpl(@NotNull String bottomDisplay, @Nullable String skinTexture, @Nullable String skinSignature, @NotNull String[] holograms) {
super(EntityType.PLAYER);
super(EntityType.PLAYER, UUID.randomUUID());
this.username = bottomDisplay;

this.skinTexture = skinTexture;
this.skinSignature = skinSignature;
this.uuid = UUID.randomUUID();
this.holograms = holograms;

if (holograms == null) {
Expand All @@ -53,13 +52,13 @@ public void updateNewViewer(@NotNull Player player) {
player.sendPackets(
new PlayerInfoUpdatePacket(PlayerInfoUpdatePacket.Action.ADD_PLAYER,
new PlayerInfoUpdatePacket.Entry(
uuid,
getUuid(),
username,
properties,
false,
0,
GameMode.CREATIVE,
Component.text("§8[NPC] " + this.uuid.toString().substring(0, 8)),
Component.text("§8[NPC] " + getUuid().toString().substring(0, 8)),
null)),
new SpawnEntityPacket(this.getEntityId(), this.getUuid(), EntityType.PLAYER.id(),
getPosition(),
Expand All @@ -76,7 +75,7 @@ public void updateNewViewer(@NotNull Player player) {
packetsSent.add(player);
MinecraftServer.getSchedulerManager().scheduleTask(() -> {
if (packetsSent.contains(player)) {
player.sendPacket(new PlayerInfoRemovePacket(uuid));
player.sendPacket(new PlayerInfoRemovePacket(getUuid()));
}
}, TaskSchedule.tick(2), TaskSchedule.stop());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.swofty.types.generic.event.actions.custom.collection;

import net.kyori.adventure.text.Component;
import net.minestom.server.item.ItemComponent;
import net.minestom.server.item.ItemStack;
import net.swofty.types.generic.collection.CollectionCategories;
import net.swofty.types.generic.collection.CollectionCategory;
Expand Down Expand Up @@ -73,7 +74,7 @@ public void run(CollectionUpdateEvent event) {
ItemStack.Builder item = ((CollectionCategory.UnlockRecipe) unlock).getRecipe().getResult().getItemStackBuilder();
item = new NonPlayerItemUpdater(item).getUpdatedItem();

player.sendMessage(" §7" + StringUtility.getTextFromComponent(item.build().getMeta().getDisplayName()) + " §7Recipes");
player.sendMessage(" §7" + StringUtility.getTextFromComponent(item.build().get(ItemComponent.CUSTOM_NAME)) + " §7Recipes");
}
case XP -> {
player.sendMessage(" §8+§b" + ((CollectionCategory.UnlockXP) unlock).xp() + " SkyBlock XP");
Expand Down
Loading

0 comments on commit 76ae9a0

Please sign in to comment.