-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/remapped' into remapped
- Loading branch information
Showing
10 changed files
with
57 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 3 additions & 19 deletions
22
common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/items/HookGeary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,28 @@ | ||
package com.hibiscusmc.hmccosmetics.hooks.items; | ||
|
||
import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin; | ||
import com.hibiscusmc.hmccosmetics.hooks.Hook; | ||
import com.mineinabyss.geary.addons.GearyPhase; | ||
import com.mineinabyss.geary.modules.GearyModuleKt; | ||
import com.mineinabyss.geary.papermc.tracking.items.ItemTrackingKt; | ||
import com.mineinabyss.geary.prefabs.PrefabKey; | ||
import org.bukkit.Material; | ||
import org.bukkit.inventory.ItemStack; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* A hook that integrates the plugin {@link com.mineinabyss.geary.papermc.GearyPlugin Geary} to provide custom items | ||
*/ | ||
public class HookGeary extends Hook { | ||
private boolean enabled = false; | ||
|
||
public HookGeary() { | ||
super("geary"); | ||
setEnabledItemHook(true); | ||
} | ||
|
||
@Override | ||
public void load() { | ||
if (!enabled) GearyModuleKt.getGeary().getPipeline().intercept(GearyPhase.INIT_ENTITIES, () -> { | ||
enabled = true; | ||
HMCCosmeticsPlugin.setup(); | ||
return null; | ||
}); | ||
} | ||
|
||
/** | ||
* Gets a cosmetic {@link ItemStack} that is associated with the provided id from the plugin {@link com.mineinabyss.geary.papermc.GearyPlugin Geary} | ||
*/ | ||
@Override | ||
public ItemStack getItem(@NotNull String itemId) { | ||
if (enabled) { | ||
PrefabKey prefabKey = PrefabKey.Companion.ofOrNull(itemId); | ||
if (prefabKey == null) return null; | ||
return ItemTrackingKt.getGearyItems().createItem(prefabKey, null); | ||
} else return new ItemStack(Material.AIR); | ||
PrefabKey prefabKey = PrefabKey.Companion.ofOrNull(itemId); | ||
if (prefabKey == null) return null; | ||
return ItemTrackingKt.getGearyItems().createItem(prefabKey, null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -527,6 +527,7 @@ public enum HiddenReason { | |
POTION, | ||
ACTION, | ||
COMMAND, | ||
EMOTE | ||
EMOTE, | ||
GAMEMODE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters