Skip to content

Commit

Permalink
Fixed additional potential spam.
Browse files Browse the repository at this point in the history
  • Loading branch information
Waterpicker committed Dec 6, 2024
1 parent a86eb5f commit 5d1b9c6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ fun ItemStack.getPokemon(): Pokemon? {
}




fun Pokemon.removeIfBelongs(player: Player): Boolean {
return belongsTo(player) && storeCoordinates.get()?.remove() == true
}
Expand All @@ -149,5 +151,4 @@ fun <T:Any> ItemStack.setLore(lore: List<T>?): ItemStack {
compoundtag.remove(ItemStack.TAG_LORE)
}
return this
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class DnaSplicer(properties: Properties): PokemonStoringItem(properties) {
var list = mutableListOf<Component>()
list.add(pokemon)
stack.setLore(list)
stack.setHoverName(super.getName(stack).copy() + getPokemonText(stack))

player.level().playSound(null, entity, SoundEvents.ENDERMAN_TELEPORT, SoundSource.MASTER, 1.0f, 1.0f)

Expand Down Expand Up @@ -92,10 +93,6 @@ class DnaSplicer(properties: Properties): PokemonStoringItem(properties) {
return false
}

override fun getName(stack: ItemStack): Component {
return super.getName(stack).copy().withStyle(ChatFormatting.GRAY) + getPokemonText(stack)
}

override fun getPokemonText(stack: ItemStack): Component {

var color = ChatFormatting.WHITE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ abstract class PokemonStoringItem(properties: Properties) : Item(properties), Po
item.shrink(1)
item.removePokemon()
item.setLore(mutableListOf<Component>())
item.setHoverName(null)
player.level().playSound(null, player, SoundEvents.ENDERMAN_TELEPORT, SoundSource.MASTER, 1.0f, 1.0f)
return InteractionResultHolder.sidedSuccess(item, false)
}
}
return super.use(level, player, usedHand)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class TimeCapsule(properties: Properties) : PokemonStoringItem(properties) {
var list = mutableListOf<Component>()
list.add(pokemon)
stack.setLore(list)
stack.setHoverName(super.getName(stack).copy() + getPokemonText(stack))

player.level().playSound(
null,
Expand All @@ -46,10 +47,6 @@ class TimeCapsule(properties: Properties) : PokemonStoringItem(properties) {
}
}

override fun getName(stack: ItemStack): Component {
return super.getName(stack).copy() + getPokemonText(stack)
}

override val isConsumed: Boolean
get() = false

Expand Down

0 comments on commit 5d1b9c6

Please sign in to comment.