issue/finish-factions-and-banking #2

Merged
jkibbels merged 11 commits from issue/finish-factions-and-banking into dev 2025-02-01 19:26:22 +00:00
3 changed files with 25 additions and 16 deletions
Showing only changes of commit 7d5fbca603 - Show all commits

View File

@ -32,8 +32,15 @@ public class FactionBeacon extends AbstractNode {
private void ApplyEffects(ServerPlayerEntity player) {
// player.setAbsorptionAmount(absorptionAmnt);
StatusEffectInstance sei = new StatusEffectInstance(StatusEffects.REGENERATION, 1000, 1, true, true, true);
player.addStatusEffect(sei);
StatusEffectInstance conduit = new StatusEffectInstance(StatusEffects.CONDUIT_POWER, 1, 0, true,true, true);
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);
Review

you should leave a commet saying TIER_I has no effects this could be confusing

you should leave a commet saying TIER_I has no effects this could be confusing
player.addStatusEffect(fire);
}
@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!
// player.sendMessage(Text.of("Applying effects"));
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 jesse.keeblarcraft.ConfigMgr.ConfigManager;
import jesse.keeblarcraft.ChatStuff.ChatMsg;
import jesse.keeblarcraft.world.dimension.ModDimensions;
import net.minecraft.nbt.NbtElement;
import net.minecraft.nbt.NbtList;

View File

@ -31,14 +31,15 @@ public class FactionBlockScreenHandler extends ScreenHandler {
this.blockEntity = (FactionBlockEntity) blockEntity;
// Need a better way of storing these coordinates...
this.addSlot(new Slot(inventory, 0, 20, 11)); // top row
this.addSlot(new Slot(inventory, 1, 20, 39));
this.addSlot(new Slot(inventory, 2, 49, 11));
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, 0, -1, 2)); // top row
this.addSlot(new Slot(inventory, 2, 35, 2));
this.addSlot(new Slot(inventory, 4, 71, 2));
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);
addPlayerHotbar(playerInventory);
@ -82,12 +83,12 @@ public class FactionBlockScreenHandler extends ScreenHandler {
// From Kaupenjoe video
private void addPlayerInventory(PlayerInventory playerInventory) {
int spacing = -8;
for (int i = 0; i < 3; ++i) { // Rows
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 x = 8 + l * 18; // Texture draw position on image
int y = 84 + i * 18; // Texture draw position on image
int x = l * 22 + spacing; // Texture draw position on image
int y = 89 + i * 22; // Texture draw position on image
this.addSlot(new Slot(playerInventory, index, x, y));
}
}
@ -95,10 +96,12 @@ public class FactionBlockScreenHandler extends ScreenHandler {
// From Kaupenjoe video
private void addPlayerHotbar(PlayerInventory playerInventory) {
int spacing = -8;
for (int i = 0; i < 9; ++i) {
int index = i; // Index of hotbar (only 9 slots long in vanilla)
int x = 8 + i * 18; // Texture draw position
int y = 142; // Texture draw position
// int x = (8 + i * 18) + spacing; // 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));
}
}