Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion src/main/java/io/github/pylonmc/pylon/Pylon.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public void onEnable() {

new ShimmerMagnet.Ticker().runTaskTimer(this, 0, 10);

pm.registerEvents(new HungerTalisman.JoinListener(), this);
pm.registerEvents(new FarmingTalisman.FarmingTalismanListener(), this);
pm.registerEvents(new BarteringTalisman.BarteringTalismanListener(), this);
pm.registerEvents(new BreedingTalisman.BreedingTalismanListener(), this);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/github/pylonmc/pylon/PylonBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public static void initialize() {
RebarBlock.register(PylonKeys.LAVA_DRAINER, Material.DISPENSER, FluidDrainer.class);
RebarBlock.register(PylonKeys.FLUID_VOIDER_1, Material.STRUCTURE_VOID, FluidVoider.class);
RebarBlock.register(PylonKeys.FLUID_VOIDER_2, Material.STRUCTURE_VOID, FluidVoider.class);
RebarBlock.register(PylonKeys.FLUID_VOIDER_3, Material.STRUCTURE_VOID, FluidVoider.class);
RebarBlock.register(PylonKeys.CREATIVE_FLUID_VOIDER, Material.STRUCTURE_VOID, FluidVoider.class);
RebarBlock.register(PylonKeys.CREATIVE_FLUID_SOURCE, Material.PINK_CONCRETE, CreativeFluidSource.class);
RebarBlock.register(PylonKeys.REFRACTORY_MIX, Material.SMOOTH_RED_SANDSTONE, RefractoryMix.class);
Expand Down Expand Up @@ -114,7 +113,7 @@ public static void initialize() {
RebarBlock.register(PylonKeys.HYDRAULIC_HAMMER_HEAD, Material.STONE_BRICKS, HydraulicHammerHead.class);
RebarBlock.register(PylonKeys.HYDRAULIC_PIPE_BENDER, Material.WAXED_CHISELED_COPPER, HydraulicPipeBender.class);
RebarBlock.register(PylonKeys.HYDRAULIC_TABLE_SAW, Material.WAXED_CUT_COPPER, HydraulicTableSaw.class);
RebarBlock.register(PylonKeys.SOLAR_LENS, Material.GLASS_PANE, RebarBlock.class);
RebarBlock.register(PylonKeys.SOLAR_LENS, Material.GLASS_PANE, SolarLens.class);
RebarBlock.register(PylonKeys.PURIFICATION_TOWER_GLASS, Material.LIGHT_GRAY_STAINED_GLASS, RebarBlock.class);
RebarBlock.register(PylonKeys.PURIFICATION_TOWER_CAP, Material.QUARTZ_SLAB, RebarBlock.class);
RebarBlock.register(PylonKeys.SOLAR_PURIFICATION_TOWER_1, Material.WAXED_COPPER_BLOCK, SolarPurificationTower.class);
Expand Down
57 changes: 0 additions & 57 deletions src/main/java/io/github/pylonmc/pylon/PylonItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -1388,42 +1388,6 @@ private PylonItems() {
PylonPages.TALISMANS.addItem(HEALTH_TALISMAN_PALLADIUM);
}

public static final ItemStack HUNGER_TALISMAN_SIMPLE = ItemStackBuilder.rebar(Material.CLAY_BALL, PylonKeys.HUNGER_TALISMAN_SIMPLE)
.set(DataComponentTypes.MAX_STACK_SIZE, 1)
.set(DataComponentTypes.ITEM_MODEL, Objects.requireNonNull(Material.GOLDEN_APPLE.getDefaultData(DataComponentTypes.ITEM_MODEL)))
.build();
static {
RebarItem.register(HungerTalisman.class, HUNGER_TALISMAN_SIMPLE);
PylonPages.TALISMANS.addItem(HUNGER_TALISMAN_SIMPLE);
}

public static final ItemStack HUNGER_TALISMAN_ADVANCED = ItemStackBuilder.rebar(Material.CLAY_BALL, PylonKeys.HUNGER_TALISMAN_ADVANCED)
.set(DataComponentTypes.MAX_STACK_SIZE, 1)
.set(DataComponentTypes.ITEM_MODEL, Objects.requireNonNull(Material.GOLDEN_APPLE.getDefaultData(DataComponentTypes.ITEM_MODEL)))
.build();
static {
RebarItem.register(HungerTalisman.class, HUNGER_TALISMAN_ADVANCED);
PylonPages.TALISMANS.addItem(HUNGER_TALISMAN_ADVANCED);
}

public static final ItemStack HUNGER_TALISMAN_ULTIMATE = ItemStackBuilder.rebar(Material.CLAY_BALL, PylonKeys.HUNGER_TALISMAN_ULTIMATE)
.set(DataComponentTypes.MAX_STACK_SIZE, 1)
.set(DataComponentTypes.ITEM_MODEL, Objects.requireNonNull(Material.GOLDEN_APPLE.getDefaultData(DataComponentTypes.ITEM_MODEL)))
.build();
static {
RebarItem.register(HungerTalisman.class, HUNGER_TALISMAN_ULTIMATE);
PylonPages.TALISMANS.addItem(HUNGER_TALISMAN_ULTIMATE);
}

public static final ItemStack HUNGER_TALISMAN_PALLADIUM = ItemStackBuilder.rebar(Material.CLAY_BALL, PylonKeys.HUNGER_TALISMAN_PALLADIUM)
.set(DataComponentTypes.MAX_STACK_SIZE, 1)
.set(DataComponentTypes.ITEM_MODEL, Objects.requireNonNull(Material.GOLDEN_APPLE.getDefaultData(DataComponentTypes.ITEM_MODEL)))
.build();
static {
RebarItem.register(HungerTalisman.class, HUNGER_TALISMAN_PALLADIUM);
PylonPages.TALISMANS.addItem(HUNGER_TALISMAN_PALLADIUM);
}

public static final ItemStack FARMING_TALISMAN_SIMPLE = ItemStackBuilder.rebar(Material.BOWL, PylonKeys.FARMING_TALISMAN_SIMPLE)
.set(DataComponentTypes.MAX_STACK_SIZE, 1)
.build();
Expand Down Expand Up @@ -1810,9 +1774,6 @@ private PylonItems() {

public static final ItemStack PALLADIUM_HELMET = ItemStackBuilder.rebarHelmet(Material.DIAMOND_HELMET, PylonKeys.PALLADIUM_HELMET, true)
.set(DataComponentTypes.MAX_DAMAGE, Settings.get(PylonKeys.PALLADIUM_HELMET).getOrThrow("durability", ConfigAdapter.INTEGER))
.set(DataComponentTypes.ENCHANTMENTS, ItemEnchantments.itemEnchantments()
.add(Enchantment.PROTECTION, Settings.get(PylonKeys.PALLADIUM_HELMET).getOrThrow("prot-level", ConfigAdapter.INTEGER))
.build())
.addAttributeModifier(Attribute.MOVEMENT_SPEED, new AttributeModifier(
pylonKey("palladium_helmet_speed"),
Settings.get(PylonKeys.PALLADIUM_BOOTS).getOrThrow("speed-percentage-increase", ConfigAdapter.DOUBLE),
Expand All @@ -1826,9 +1787,6 @@ private PylonItems() {
}

public static final ItemStack PALLADIUM_CHESTPLATE = ItemStackBuilder.rebarChestplate(Material.DIAMOND_CHESTPLATE, PylonKeys.PALLADIUM_CHESTPLATE, true)
.set(DataComponentTypes.ENCHANTMENTS, ItemEnchantments.itemEnchantments()
.add(Enchantment.PROTECTION, Settings.get(PylonKeys.PALLADIUM_CHESTPLATE).getOrThrow("prot-level", ConfigAdapter.INTEGER))
.build())
.addAttributeModifier(Attribute.MOVEMENT_SPEED, new AttributeModifier(
pylonKey("palladium_chestplate_speed"),
Settings.get(PylonKeys.PALLADIUM_BOOTS).getOrThrow("speed-percentage-increase", ConfigAdapter.DOUBLE),
Expand All @@ -1842,9 +1800,6 @@ private PylonItems() {
}

public static final ItemStack PALLADIUM_LEGGINGS = ItemStackBuilder.rebarLeggings(Material.DIAMOND_LEGGINGS, PylonKeys.PALLADIUM_LEGGINGS, true)
.set(DataComponentTypes.ENCHANTMENTS, ItemEnchantments.itemEnchantments()
.add(Enchantment.PROTECTION, Settings.get(PylonKeys.PALLADIUM_LEGGINGS).getOrThrow("prot-level", ConfigAdapter.INTEGER))
.build())
.addAttributeModifier(Attribute.MOVEMENT_SPEED, new AttributeModifier(
pylonKey("palladium_leggings_speed"),
Settings.get(PylonKeys.PALLADIUM_BOOTS).getOrThrow("speed-percentage-increase", ConfigAdapter.DOUBLE),
Expand All @@ -1858,10 +1813,6 @@ private PylonItems() {
}

public static final ItemStack PALLADIUM_BOOTS = ItemStackBuilder.rebarBoots(Material.DIAMOND_BOOTS, PylonKeys.PALLADIUM_BOOTS, true)
.set(DataComponentTypes.ENCHANTMENTS, ItemEnchantments.itemEnchantments()
.add(Enchantment.PROTECTION, Settings.get(PylonKeys.PALLADIUM_BOOTS).getOrThrow("prot-level", ConfigAdapter.INTEGER))
.add(Enchantment.FROST_WALKER, Settings.get(PylonKeys.PALLADIUM_BOOTS).getOrThrow("frost-walker-level", ConfigAdapter.INTEGER))
.build())
.addAttributeModifier(Attribute.MOVEMENT_SPEED, new AttributeModifier(
pylonKey("palladium_boots_speed"),
Settings.get(PylonKeys.PALLADIUM_BOOTS).getOrThrow("speed-percentage-increase", ConfigAdapter.DOUBLE),
Expand Down Expand Up @@ -2624,14 +2575,6 @@ private PylonItems() {
PylonPages.FLUID_MACHINES.addItem(FLUID_VOIDER_2);
}

public static final ItemStack FLUID_VOIDER_3 = ItemStackBuilder.rebar(Material.STRUCTURE_VOID, PylonKeys.FLUID_VOIDER_3)
.set(DataComponentTypes.ITEM_MODEL, Material.BLACK_TERRACOTTA.getKey())
.build();
static {
RebarItem.register(FluidVoider.Item.class, FLUID_VOIDER_3, PylonKeys.FLUID_VOIDER_3);
PylonPages.FLUID_MACHINES.addItem(FLUID_VOIDER_3);
}

//</editor-fold>

//<editor-fold desc="Machines - Hydraulic Machines" defaultstate=collapsed>
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/io/github/pylonmc/pylon/PylonKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ public class PylonKeys {

public static final NamespacedKey FLUID_VOIDER_1 = pylonKey("fluid_voider_1");
public static final NamespacedKey FLUID_VOIDER_2 = pylonKey("fluid_voider_2");
public static final NamespacedKey FLUID_VOIDER_3 = pylonKey("fluid_voider_3");

public static final NamespacedKey CREATIVE_FLUID_VOIDER = pylonKey("creative_fluid_voider");
public static final NamespacedKey CREATIVE_FLUID_SOURCE = pylonKey("creative_fluid_source");
Expand Down Expand Up @@ -360,11 +359,6 @@ public class PylonKeys {
public static final NamespacedKey HEALTH_TALISMAN_ULTIMATE = pylonKey("health_talisman_ultimate");
public static final NamespacedKey HEALTH_TALISMAN_PALLADIUM = pylonKey("health_talisman_palladium");

public static final NamespacedKey HUNGER_TALISMAN_SIMPLE = pylonKey("hunger_talisman_simple");
public static final NamespacedKey HUNGER_TALISMAN_ADVANCED = pylonKey("hunger_talisman_advanced");
public static final NamespacedKey HUNGER_TALISMAN_ULTIMATE = pylonKey("hunger_talisman_ultimate");
public static final NamespacedKey HUNGER_TALISMAN_PALLADIUM = pylonKey("hunger_talisman_palladium");

public static final NamespacedKey FARMING_TALISMAN_SIMPLE = pylonKey("farming_talisman_simple");
public static final NamespacedKey FARMING_TALISMAN_ADVANCED = pylonKey("farming_talisman_advanced");
public static final NamespacedKey FARMING_TALISMAN_ULTIMATE = pylonKey("farming_talisman_ultimate");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.pylonmc.pylon.content.components;

import io.github.pylonmc.rebar.block.RebarBlock;
import io.github.pylonmc.rebar.block.base.RebarDirectionalBlock;
import io.github.pylonmc.rebar.block.base.RebarGuiBlock;
import io.github.pylonmc.rebar.block.base.RebarLogisticBlock;
import io.github.pylonmc.rebar.block.base.RebarVirtualInventoryBlock;
Expand All @@ -16,12 +17,17 @@
import java.util.Map;


public class ItemInputHatch extends RebarBlock implements RebarGuiBlock, RebarLogisticBlock, RebarVirtualInventoryBlock {
public class ItemInputHatch extends RebarBlock implements
RebarGuiBlock,
RebarDirectionalBlock,
RebarLogisticBlock,
RebarVirtualInventoryBlock {

public final VirtualInventory inventory = new VirtualInventory(1);

public ItemInputHatch(@NotNull Block block, @NotNull BlockCreateContext context) {
super(block, context);
setFacing(context.getFacing());
}

public ItemInputHatch(@NotNull Block block, @NotNull PersistentDataContainer pdc) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.pylonmc.pylon.content.components;

import io.github.pylonmc.rebar.block.RebarBlock;
import io.github.pylonmc.rebar.block.base.RebarDirectionalBlock;
import io.github.pylonmc.rebar.block.base.RebarGuiBlock;
import io.github.pylonmc.rebar.block.base.RebarLogisticBlock;
import io.github.pylonmc.rebar.block.base.RebarVirtualInventoryBlock;
Expand All @@ -16,12 +17,17 @@
import java.util.Map;


public class ItemOutputHatch extends RebarBlock implements RebarGuiBlock, RebarLogisticBlock, RebarVirtualInventoryBlock {
public class ItemOutputHatch extends RebarBlock implements
RebarGuiBlock,
RebarDirectionalBlock,
RebarLogisticBlock,
RebarVirtualInventoryBlock {

public final VirtualInventory inventory = new VirtualInventory(1);

public ItemOutputHatch(@NotNull Block block, @NotNull BlockCreateContext context) {
super(block, context);
setFacing(context.getFacing());
}

public ItemOutputHatch(@NotNull Block block, @NotNull PersistentDataContainer pdc) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package io.github.pylonmc.pylon.content.components;

import io.github.pylonmc.rebar.block.RebarBlock;
import io.github.pylonmc.rebar.block.base.RebarMultiblock;
import io.github.pylonmc.rebar.block.context.BlockCreateContext;
import io.github.pylonmc.rebar.util.RebarUtils;
import io.github.pylonmc.rebar.util.position.BlockPosition;
import io.github.pylonmc.rebar.util.position.ChunkPosition;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.persistence.PersistentDataContainer;
import org.jetbrains.annotations.NotNull;

import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;


public class SolarLens extends RebarBlock implements RebarMultiblock {

private final Set<BlockPosition> adjacentBlocks = new HashSet<>();

public SolarLens(@NotNull Block block, @NotNull PersistentDataContainer pdc) {
super(block, pdc);
}

public SolarLens(@NotNull Block block, @NotNull BlockCreateContext context) {
super(block, context);
}

{
for (BlockFace face : RebarUtils.IMMEDIATE_FACES) {
adjacentBlocks.add(new BlockPosition(getBlock()).getRelative(face));
}
}

@Override
public @NotNull Set<@NotNull ChunkPosition> getChunksOccupied() {
return adjacentBlocks.stream()
.map(BlockPosition::getChunk)
.collect(Collectors.toSet());
}

@Override
public boolean checkFormed() {
return true;
}

@Override
public boolean isPartOfMultiblock(@NotNull Block otherBlock) {
return adjacentBlocks.contains(new BlockPosition(otherBlock));
}

@Override
public void onMultiblockRefreshed() {
refreshBlockTextureItem();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public class DieselTableSaw extends RebarBlock implements
.addCustomModelDataString(getKey() + ":side2");
public ItemStackBuilder chimneyStack = ItemStackBuilder.of(Material.CYAN_TERRACOTTA)
.addCustomModelDataString(getKey() + ":chimney");
public final ItemStackBuilder sawItem = ItemStackBuilder.of(Material.IRON_BARS)
.addCustomModelDataString(getKey() + ":saw");

private final VirtualInventory inputInventory = new VirtualInventory(1);
private final VirtualInventory outputInventory = new VirtualInventory(1);
Expand Down Expand Up @@ -120,10 +122,9 @@ public DieselTableSaw(@NotNull Block block, @NotNull BlockCreateContext context)
.scale(0.3))
.build(block.getLocation().toCenterLocation().add(0, 0.65, 0))
);
addEntity("saw", new BlockDisplayBuilder()
.blockData(Material.IRON_BARS.createBlockData("[east=true,west=true]"))
addEntity("saw", new ItemDisplayBuilder()
.itemStack(sawItem)
.transformation(new TransformBuilder()
.rotate(0, RebarUtils.faceToYaw(getFacing()), 0)
.scale(0.6, 0.4, 0.4))
.build(block.getLocation().toCenterLocation().add(0, 0.7, 0))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class FluidStrainer extends RebarBlock implements
public final double buffer = getSettings().getOrThrow("buffer", ConfigAdapter.DOUBLE);
public @Nullable RebarFluid fluidType;
public double fluidAmount;
private final VirtualInventory inventory = new VirtualInventory(9 * 3);
private final VirtualInventory inventory = new VirtualInventory(5);

public static class Item extends RebarItem {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ public boolean tryStartRecipe(@NotNull GrindstoneRecipe nextRecipe) {
return false;
}

ItemStack particleItem = input.clone();

itemDisplay.setItemStack(input.subtract(nextRecipe.input().getAmount()));

startRecipe(nextRecipe, nextRecipe.timeTicks());
Expand All @@ -198,11 +200,12 @@ public boolean tryStartRecipe(@NotNull GrindstoneRecipe nextRecipe) {
}

PylonUtils.animate(getStoneDisplay(), CYCLE_DURATION_TICKS / 4, getStoneDisplayMatrix(translation, rotation));
new ParticleBuilder(Particle.BLOCK)
.data(nextRecipe.particleBlockData())
.count(10)
.location(getBlock().getLocation().toCenterLocation())
.spawn();
new ParticleBuilder(Particle.ITEM)
.data(particleItem)
.count(20)
.extra(0.1)
.location(getBlock().getLocation().toCenterLocation())
.spawn();

progressRecipe(CYCLE_DURATION_TICKS / 4);
}, (long) ((i + j/4.0) * CYCLE_DURATION_TICKS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ public void onInteract(@NotNull PlayerInteractEvent event, @NotNull EventPriorit
return;
}

tryDoRecipe();
if (priority == EventPriority.MONITOR) {
tryDoRecipe();
}
}

public boolean tryDoRecipe() {
Expand Down Expand Up @@ -160,6 +162,13 @@ public boolean tryDoRecipe() {
return true;
}

new ParticleBuilder(Particle.SMOKE)
.count(50)
.extra(0)
.offset(0.1, 0, 0.1)
.location(getBlock().getLocation().toCenterLocation().add(0, 0.4, 0))
.spawn();

return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@
import io.github.pylonmc.rebar.entity.display.ItemDisplayBuilder;
import io.github.pylonmc.rebar.entity.display.transform.TransformBuilder;
import io.github.pylonmc.rebar.event.api.annotation.MultiHandler;
import io.github.pylonmc.rebar.i18n.RebarArgument;
import io.github.pylonmc.rebar.waila.WailaDisplay;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.block.Block;
import org.bukkit.entity.ItemDisplay;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
Expand All @@ -30,6 +35,7 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.persistence.PersistentDataContainer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.joml.Vector3i;

import java.util.*;
Expand Down Expand Up @@ -229,4 +235,19 @@ public void cancelRecipe() {
.location(getBlock().getLocation().toCenterLocation())
.spawn();
}

@Override
public @Nullable WailaDisplay getWaila(@NotNull Player player) {
return new WailaDisplay(getDefaultWailaTranslationKey().arguments(
RebarArgument.of("progress", getCurrentRecipe() == null
? Component.empty()
: Component.translatable("pylon.item.shimmer_altar.progress")
.arguments(RebarArgument.of("progress", PylonUtils.createProgressBar(
1.0 - (getRecipeTicksRemaining() / 20.0) / getCurrentRecipe().timeSeconds(),
20,
TextColor.color(255, 255, 255)
)))
)
));
}
}
Loading
Loading