[factions-banking] Correct faction block GUI draw slot positions with new gui
Some checks are pending
build / build (21) (push) Waiting to run

This commit is contained in:
Jkibbels 2025-01-19 20:19:31 -05:00
parent c8e379e564
commit 7d5fbca603
3 changed files with 25 additions and 16 deletions

View File

@ -32,8 +32,15 @@ public class FactionBeacon extends AbstractNode {
private void ApplyEffects(ServerPlayerEntity player) { private void ApplyEffects(ServerPlayerEntity player) {
// player.setAbsorptionAmount(absorptionAmnt); // player.setAbsorptionAmount(absorptionAmnt);
StatusEffectInstance sei = new StatusEffectInstance(StatusEffects.REGENERATION, 1000, 1, true, true, true); StatusEffectInstance conduit = new StatusEffectInstance(StatusEffects.CONDUIT_POWER, 1, 0, true,true, true);
player.addStatusEffect(sei); StatusEffectInstance regen = new StatusEffectInstance(StatusEffects.REGENERATION, 1, 0, true, true, true);
StatusEffectInstance hero = new StatusEffectInstance(StatusEffects.HERO_OF_THE_VILLAGE, 1, 0, true, true, true);
StatusEffectInstance fire = new StatusEffectInstance(StatusEffects.FIRE_RESISTANCE, 1, 0, true, true, true);
player.addStatusEffect(conduit);
player.addStatusEffect(regen);
player.addStatusEffect(hero);
player.addStatusEffect(fire);
} }
@Override @Override
@ -43,7 +50,7 @@ public class FactionBeacon extends AbstractNode {
// Make sure player can fly while inside the border. We don't ever want to run this more than once! // Make sure player can fly while inside the border. We don't ever want to run this more than once!
// player.sendMessage(Text.of("Applying effects")); // player.sendMessage(Text.of("Applying effects"));
ApplyEffects((ServerPlayerEntity) player); ApplyEffects((ServerPlayerEntity) player);
return ActionResult.SUCCESS; return ActionResult.PASS;
}); });
} }

View File

@ -4,7 +4,6 @@ import java.util.HashMap;
import java.util.Map.Entry; import java.util.Map.Entry;
import jesse.keeblarcraft.ConfigMgr.ConfigManager; import jesse.keeblarcraft.ConfigMgr.ConfigManager;
import jesse.keeblarcraft.ChatStuff.ChatMsg;
import jesse.keeblarcraft.world.dimension.ModDimensions; import jesse.keeblarcraft.world.dimension.ModDimensions;
import net.minecraft.nbt.NbtElement; import net.minecraft.nbt.NbtElement;
import net.minecraft.nbt.NbtList; import net.minecraft.nbt.NbtList;

View File

@ -31,14 +31,15 @@ public class FactionBlockScreenHandler extends ScreenHandler {
this.blockEntity = (FactionBlockEntity) blockEntity; this.blockEntity = (FactionBlockEntity) blockEntity;
// Need a better way of storing these coordinates... // Need a better way of storing these coordinates...
this.addSlot(new Slot(inventory, 0, 20, 11)); // top row this.addSlot(new Slot(inventory, 0, -1, 2)); // top row
this.addSlot(new Slot(inventory, 1, 20, 39)); this.addSlot(new Slot(inventory, 2, 35, 2));
this.addSlot(new Slot(inventory, 2, 49, 11)); this.addSlot(new Slot(inventory, 4, 71, 2));
this.addSlot(new Slot(inventory, 3, 49, 39));
this.addSlot(new Slot(inventory, 4, 78, 11));
this.addSlot(new Slot(inventory, 5, 78, 39));
this.addSlot(new Slot(inventory, 6, 128, 26)); this.addSlot(new Slot(inventory, 1, 17, 36));
this.addSlot(new Slot(inventory, 3, 54, 36));
this.addSlot(new Slot(inventory, 5, 90, 36));
this.addSlot(new Slot(inventory, 6, 148, 20));
addPlayerInventory(playerInventory); addPlayerInventory(playerInventory);
addPlayerHotbar(playerInventory); addPlayerHotbar(playerInventory);
@ -82,12 +83,12 @@ public class FactionBlockScreenHandler extends ScreenHandler {
// From Kaupenjoe video // From Kaupenjoe video
private void addPlayerInventory(PlayerInventory playerInventory) { private void addPlayerInventory(PlayerInventory playerInventory) {
int spacing = -8;
for (int i = 0; i < 3; ++i) { // Rows for (int i = 0; i < 3; ++i) { // Rows
for (int l = 0; l < 9; ++l) { // Columns for (int l = 0; l < 9; ++l) { // Columns
// The fancy math (expanded from kaupen video for clarity for me for later) seems to just specify a few things
int index = l + i * 9 + 9; // l = col, i*9 = the row to be on (scaling by 9 bc slots are 1-(9*3) in amount), +9 = where on that row to be! int index = l + i * 9 + 9; // l = col, i*9 = the row to be on (scaling by 9 bc slots are 1-(9*3) in amount), +9 = where on that row to be!
int x = 8 + l * 18; // Texture draw position on image int x = l * 22 + spacing; // Texture draw position on image
int y = 84 + i * 18; // Texture draw position on image int y = 89 + i * 22; // Texture draw position on image
this.addSlot(new Slot(playerInventory, index, x, y)); this.addSlot(new Slot(playerInventory, index, x, y));
} }
} }
@ -95,10 +96,12 @@ public class FactionBlockScreenHandler extends ScreenHandler {
// From Kaupenjoe video // From Kaupenjoe video
private void addPlayerHotbar(PlayerInventory playerInventory) { private void addPlayerHotbar(PlayerInventory playerInventory) {
int spacing = -8;
for (int i = 0; i < 9; ++i) { for (int i = 0; i < 9; ++i) {
int index = i; // Index of hotbar (only 9 slots long in vanilla) int index = i; // Index of hotbar (only 9 slots long in vanilla)
int x = 8 + i * 18; // Texture draw position // int x = (8 + i * 18) + spacing; // Texture draw position
int y = 142; // Texture draw position int x = i * 22 + spacing; // Texture draw position
int y = 162; // Texture draw position
this.addSlot(new Slot(playerInventory, index, x, y)); this.addSlot(new Slot(playerInventory, index, x, y));
} }
} }