Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
019e13c
cleansing potion research (pylon#963)
SchnTgaiSpock Apr 20, 2026
7844b69
remove multiblock component (pylon#932)
SchnTgaiSpock Apr 20, 2026
173ccf7
talisman trigger sounds (pylon#942)
SchnTgaiSpock Apr 21, 2026
271fea2
cold iron bloom damage (pylon#943)
SchnTgaiSpock Apr 21, 2026
b6e9e22
hydraulic cannon feedback (pylon#949)
SchnTgaiSpock Apr 21, 2026
861a5bf
block -> item particles (pylon#945)
SchnTgaiSpock Apr 21, 2026
61dc9dd
make hammer use hammered item particles (pylon#946)
SchnTgaiSpock Apr 21, 2026
f999c20
add tank casing req to lore (pylon#750)
SchnTgaiSpock Apr 21, 2026
09461b6
fix javadoc
SchnTgaiSpock Apr 21, 2026
1e0f3d9
fix item particle speed
SchnTgaiSpock Apr 21, 2026
5555d97
rename particledata
SchnTgaiSpock Apr 21, 2026
6ae9c12
fix when item removed
SchnTgaiSpock Apr 21, 2026
0b9ce09
recoil and no ammo sound
SchnTgaiSpock Apr 21, 2026
0784dcd
attribute damage to player
SchnTgaiSpock Apr 21, 2026
a37dc17
fix hammer fr this time
SchnTgaiSpock Apr 21, 2026
c089613
fix talismans
SchnTgaiSpock Apr 21, 2026
f734414
restrict to fully grown crops
SchnTgaiSpock Apr 21, 2026
3db6f28
simplify particle item check
SchnTgaiSpock May 5, 2026
a43d55f
Merge remote-tracking branch 'origin/master' into task/misc-2
SchnTgaiSpock May 10, 2026
9075a0e
Merge remote-tracking branch 'origin/master' into task/misc-2
SchnTgaiSpock May 18, 2026
9725a18
remove research
SchnTgaiSpock May 18, 2026
872b43e
hydraulic cannon updates
SchnTgaiSpock May 18, 2026
f5ae88c
update tin proj check
SchnTgaiSpock May 18, 2026
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
5 changes: 5 additions & 0 deletions src/main/java/io/github/pylonmc/pylon/PylonConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

import io.github.pylonmc.rebar.config.Config;
import io.github.pylonmc.rebar.config.adapter.ConfigAdapter;
import io.github.pylonmc.rebar.util.RandomizedSound;


public final class PylonConfig {

private static final Config config = new Config(Pylon.getInstance(), "config.yml");
public static final double RUNE_CHECK_RANGE = config.getOrThrow("rune-check-range", ConfigAdapter.DOUBLE);
public static final long DEFAULT_TALISMAN_TICK_INTERVAL = config.getOrThrow("default-talisman-tick-interval", ConfigAdapter.LONG);
public static final RandomizedSound BARTERING_TALISMAN_TRIGGER_SOUND = config.getOrThrow("talismans.bartering-trigger-sound", ConfigAdapter.RANDOMIZED_SOUND);
public static final RandomizedSound ENCHANTING_TALISMAN_TRIGGER_SOUND = config.getOrThrow("talismans.enchanting-trigger-sound", ConfigAdapter.RANDOMIZED_SOUND);
public static final RandomizedSound FARMING_TALISMAN_TRIGGER_SOUND = config.getOrThrow("talismans.farming-trigger-sound", ConfigAdapter.RANDOMIZED_SOUND);
public static final RandomizedSound HUNTING_TALISMAN_TRIGGER_SOUND = config.getOrThrow("talismans.hunting-trigger-sound", ConfigAdapter.RANDOMIZED_SOUND);
Comment thread
Seggan marked this conversation as resolved.

private PylonConfig() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.github.pylonmc.rebar.util.gui.unit.UnitFormat;
import io.github.pylonmc.rebar.util.position.ChunkPosition;
import io.github.pylonmc.rebar.waila.WailaDisplay;
import io.papermc.paper.datacomponent.DataComponentTypes;
import io.papermc.paper.event.block.BlockBreakBlockEvent;
import io.papermc.paper.event.block.BlockPreDispenseEvent;
import net.kyori.adventure.text.Component;
Expand Down Expand Up @@ -179,10 +178,11 @@ public void tick() {
.count(0)
.extra(0.05)
.spawn();
new ParticleBuilder(Particle.BLOCK)
new ParticleBuilder(Particle.ITEM)
.count(5)
.extra(0.05)
.location(getBlock().getLocation().toCenterLocation().add(0, 0.6, 0))
.data(drilling.getBlockData())
.data(new ItemStack(drilling.getType()))
.spawn();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,11 @@ public void tick() {
.count(0)
.extra(0.05)
.spawn();
new ParticleBuilder(Particle.BLOCK)
new ParticleBuilder(Particle.ITEM)
.count(5)
.extra(0.05)
.location(getBlock().getLocation().toCenterLocation().add(0, 0.75, 0))
.data(getHeldEntityOrThrow(ItemDisplay.class, "item").getItemStack().getType().createBlockData())
.data(getHeldEntityOrThrow(ItemDisplay.class, "item").getItemStack())
.spawn();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,4 @@ public void onBreak(@NotNull List<@NotNull ItemStack> drops, @NotNull BlockBreak
public @NotNull Map<String, VirtualInventory> getVirtualInventories() {
return Map.of("hammer", hammerInventory);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ public void tick() {
.count(0)
.extra(0.05)
.spawn();
new ParticleBuilder(Particle.BLOCK)
new ParticleBuilder(Particle.ITEM)
.count(5)
.extra(0.05)
.location(getBlock().getLocation().toCenterLocation().add(0, 0.75, 0))
.data(getCurrentRecipe().particleData())
.data(getCurrentRecipe().particleItem())
.spawn();
progressRecipe(tickInterval);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.github.pylonmc.rebar.util.gui.unit.UnitFormat;
import io.github.pylonmc.rebar.util.position.ChunkPosition;
import io.github.pylonmc.rebar.waila.WailaDisplay;
import io.papermc.paper.datacomponent.DataComponentTypes;
import io.papermc.paper.event.block.BlockBreakBlockEvent;
import net.kyori.adventure.text.format.TextColor;
import org.bukkit.Material;
Expand Down Expand Up @@ -167,10 +166,11 @@ public void tick() {

progressProcess(tickInterval);
Block drilling = getBlock().getRelative(getFacing());
new ParticleBuilder(Particle.BLOCK)
new ParticleBuilder(Particle.ITEM)
.count(5)
.extra(0.05)
.location(getBlock().getLocation().toCenterLocation().add(0, 0.6, 0))
.data(drilling.getBlockData())
.data(new ItemStack(drilling.getType()))
.spawn();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,11 @@ public void tick() {
}

if (isProcessingRecipe()) {
new ParticleBuilder(Particle.BLOCK)
new ParticleBuilder(Particle.ITEM)
.count(5)
.extra(0.05)
.location(getBlock().getLocation().toCenterLocation().add(0, 0.75, 0))
.data(getCurrentRecipe().particleData())
.data(getCurrentRecipe().particleItem())
.spawn();
removeFluid(PylonFluids.HYDRAULIC_FLUID, hydraulicFluidToConsume);
addFluid(PylonFluids.DIRTY_HYDRAULIC_FLUID, hydraulicFluidToConsume);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,11 @@ public void tick() {
}

if (isProcessingRecipe()) {
new ParticleBuilder(Particle.BLOCK)
new ParticleBuilder(Particle.ITEM)
.count(5)
.extra(0.05)
.location(getBlock().getLocation().toCenterLocation().add(0, 0.75, 0))
.data(getCurrentRecipe().particleData())
.data(getCurrentRecipe().particleItem())
.spawn();
removeFluid(PylonFluids.HYDRAULIC_FLUID, hydraulicFluidToConsume);
addFluid(PylonFluids.DIRTY_HYDRAULIC_FLUID, hydraulicFluidToConsume);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.jetbrains.annotations.Nullable;
import org.joml.Matrix4f;

import java.time.Duration;
import java.util.List;

public abstract class CoreDrill extends RebarBlock implements
Expand Down Expand Up @@ -145,9 +144,10 @@ private void doRotationAnimation() {

PylonUtils.animate(getDrillDisplay(), rotationDuration / 4, getDrillDisplayMatrix(rotation));
if (spawnBlockParticles) {
new ParticleBuilder(Particle.BLOCK)
new ParticleBuilder(Particle.ITEM)
.count(5)
.data(getBlock().getRelative(BlockFace.DOWN, 3).getBlockData())
.extra(0.05)
.data(new ItemStack(getBlock().getRelative(BlockFace.DOWN, 3).getType()))
.location(getBlock()
.getRelative(BlockFace.DOWN, 2)
.getLocation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ public long getBaseTickInterval() {

@Override
public void onTick(@NotNull Player player) {
if (player.getInventory().getItemInMainHand().isSimilar(PylonItems.TONGS) ||
player.getInventory().getItemInOffHand().isSimilar(PylonItems.TONGS)) {
if (getTemperature() == 0
|| player.getInventory().getItemInMainHand().isSimilar(PylonItems.TONGS)
|| player.getInventory().getItemInOffHand().isSimilar(PylonItems.TONGS)) {
return;
}
player.damage(UNPROTECTED_DAMAGE, DamageSource.builder(DamageType.HOT_FLOOR).build());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.pylonmc.pylon.content.talismans;

import io.github.pylonmc.pylon.PylonConfig;
import io.github.pylonmc.pylon.util.PylonUtils;
import io.github.pylonmc.rebar.config.adapter.ConfigAdapter;
import io.github.pylonmc.rebar.i18n.RebarArgument;
Expand Down Expand Up @@ -68,6 +69,8 @@ public void onBarter(PiglinBarterEvent event) {
Item item = event.getEntity().getWorld().dropItem(event.getEntity().getLocation(), event.getInput().clone());
if (!new EntityDropItemEvent(event.getEntity(), item).callEvent()) {
item.remove();
} else {
item.getWorld().playSound(PylonConfig.BARTERING_TALISMAN_TRIGGER_SOUND.create(), item);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.pylonmc.pylon.content.talismans;

import io.github.pylonmc.pylon.PylonConfig;
import io.github.pylonmc.pylon.util.PylonUtils;
import io.github.pylonmc.rebar.config.adapter.ConfigAdapter;
import io.github.pylonmc.rebar.i18n.RebarArgument;
Expand Down Expand Up @@ -107,6 +108,7 @@ public void onEnchant(EnchantItemEvent event) {
return;
}
UUID itemId = UUID.fromString(itemIdStr);
Player player = event.getEnchanter();
for (Enchantment enchant : event.getEnchantsToAdd().keySet()) {
// regenerate the seed used to set the offers and check the rng again
Random randGen = new Random(etableView.getEnchantmentSeed()
Expand All @@ -119,6 +121,7 @@ public void onEnchant(EnchantItemEvent event) {
}
// if the offer level was increased, then also increase the applied enchant
event.getEnchantsToAdd().replace(enchant, Math.min(event.getEnchantsToAdd().get(enchant) + 1, enchant.getMaxLevel()));
player.playSound(PylonConfig.ENCHANTING_TALISMAN_TRIGGER_SOUND.create(), player);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static class XPTalismanListener implements Listener {
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerGainXP(PlayerPickupExperienceEvent event){
Float xpMultiplier = event.getPlayer().getPersistentDataContainer().get(XP_MULTIPLIER_KEY, PersistentDataType.FLOAT);
if(xpMultiplier == null){
if (xpMultiplier == null){
return;
}
event.getExperienceOrb().setExperience(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package io.github.pylonmc.pylon.content.talismans;

import io.github.pylonmc.pylon.PylonConfig;
import io.github.pylonmc.pylon.util.PylonUtils;
import io.github.pylonmc.rebar.config.adapter.ConfigAdapter;
import io.github.pylonmc.rebar.i18n.RebarArgument;
import io.github.pylonmc.rebar.util.gui.unit.UnitFormat;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
import org.bukkit.Tag;
import org.bukkit.block.BlockState;
import org.bukkit.block.data.Ageable;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand Down Expand Up @@ -53,18 +57,22 @@ public void removeEffect(@NotNull Player player) {
public static class FarmingTalismanListener implements Listener {
@EventHandler
public void onBlockBreak(BlockDropItemEvent event) {
if (!event.getPlayer().getPersistentDataContainer().has(FARMING_TALISMAN_CHANCE_KEY)) {
BlockState block = event.getBlockState();
Location loc = block.getLocation();
if (!Tag.CROPS.isTagged(block.getType())
|| !event.getPlayer().getPersistentDataContainer().has(FARMING_TALISMAN_CHANCE_KEY)
|| !(block.getBlockData() instanceof Ageable ageable)
|| ageable.getAge() != ageable.getMaximumAge())
{
return;
}
List<Item> additionalDrops = new ArrayList<>();
for (Item drop : event.getItems()) {
if (!Tag.CROPS.isTagged(drop.getItemStack().getType())) {
continue;
}
if (ThreadLocalRandom.current().nextFloat() > event.getPlayer().getPersistentDataContainer().get(FARMING_TALISMAN_CHANCE_KEY, PersistentDataType.FLOAT)) {
continue;
}
additionalDrops.add(drop.getWorld().dropItem(drop.getLocation(), drop.getItemStack().clone()));
loc.getWorld().playSound(PylonConfig.FARMING_TALISMAN_TRIGGER_SOUND.create(), loc.getX(), loc.getY(), loc.getZ());
}
event.getItems().addAll(additionalDrops);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.github.pylonmc.pylon.content.talismans;

import io.github.pylonmc.pylon.PylonConfig;
import io.github.pylonmc.pylon.util.PylonUtils;
import io.github.pylonmc.rebar.config.adapter.ConfigAdapter;
import io.github.pylonmc.rebar.i18n.RebarArgument;
import io.github.pylonmc.rebar.util.gui.unit.UnitFormat;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -65,6 +67,7 @@ public void onEntityDeath(EntityDeathEvent event) {
if (event.getEntity().getType() == EntityType.PLAYER) {
return;
}
Location source = event.getEntity().getLocation();
@SuppressWarnings("DataFlowIssue")
double chanceForExtraItem = player.getPersistentDataContainer().get(HUNTING_TALISMAN_BONUS_KEY, PersistentDataType.DOUBLE);
for (ItemStack drop : event.getDrops()) {
Expand All @@ -75,6 +78,7 @@ public void onEntityDeath(EntityDeathEvent event) {
continue;
}
drop.setAmount(drop.getAmount() + 1);
source.getWorld().playSound(PylonConfig.HUNTING_TALISMAN_TRIGGER_SOUND.create(), source.getX(), source.getY(), source.getZ());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,4 @@ private static MiningLevel getMiningLevel(@NotNull NamespacedKey key) {
PylonKeys.DIAMOND_HAMMER, MiningLevel.DIAMOND
).get(key);
}
}
}
Loading
Loading