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
7 changed files with 73 additions and 8 deletions
Showing only changes of commit 415983edca - Show all commits

View File

@ -1,19 +1,26 @@
package jesse.keeblarcraft;
import jesse.keeblarcraft.Entities.EntityRegistration;
import jesse.keeblarcraft.GuiMgr.Entities.ShopKeeperRenderer;
import jesse.keeblarcraft.gui.ClientHandlers;
// import jesse.keeblarcraft.gui.ScreenManager;
// import jesse.keeblarcraft.gui.widgets.TreeWidget;
import jesse.keeblarcraft.Shortcuts.ShortcutManager;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.render.entity.model.EntityModelLayer;
import net.minecraft.util.Identifier;
public class KeeblarcraftClient implements ClientModInitializer {
public static final EntityModelLayer SHOP_KEEPER_LAYER = new EntityModelLayer(new Identifier("textures/entity/villager/villager.png"), "VILLAGE_ENTITY_MODEL_LAYER");
@Override
public void onInitializeClient() {
ShortcutManager.RegisterKeybinds();
ClientHandlers.RegisterHandlers();
// EntityRendererRegistry.INSTANCE.register(EntityRegistration.SHOP_KEEPER_ENTITY_TYPE, (context) -> {
// return new ShopKeeperRenderer(context);
// });
// ScreenManager.GetInstance();
// ScreenManager.AddWidget(TreeWidget.class, 10);
}

View File

@ -138,6 +138,7 @@ public final class BankManager {
/// @param[in] player Player object to change default accounts of
///
/// @param[in] The new default account global account identifier
/////////////////////////////////////////////////////////////////////////////
public void ChangeDefaultPlayerAccount(ServerPlayerEntity player, String newDefaultAccount) {
Integer routingNumber = AccountNumberGenerator.GetRoutingNumberFromId(newDefaultAccount);
if (banks.containsKey(routingNumber)) {

View File

@ -31,7 +31,5 @@ public class ChatFormatting {
case RED -> colorStr + "4";
case GREEN -> colorStr + "2";
};
// If this code is reachable, then someone has not properly handled the above switch-case
}
}
jkibbels marked this conversation as resolved
Review

no code here and also maybe use a default case: if your worried about it

no code here and also maybe use a default case: if your worried about it

View File

@ -0,0 +1,22 @@
package jesse.keeblarcraft.Entities;
import jesse.keeblarcraft.Keeblarcraft;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
public class EntityRegistration {
public static final EntityType<ShopKeeper> SHOP_KEEPER_ENTITY_TYPE = Registry.register(
Registries.ENTITY_TYPE,
Identifier.of(Keeblarcraft.MOD_ID, "shop_keeper"),
EntityType.Builder.create(ShopKeeper::new, SpawnGroup.MISC).setDimensions(1.0f, 1.0f).build("shop_keeper")
);
public static void RegisterEntities() {
Keeblarcraft.LOGGER.info("Registering custom entities...");
FabricDefaultAttributeRegistry.register(SHOP_KEEPER_ENTITY_TYPE, ShopKeeper.createMobAttributes());
}
}

View File

@ -0,0 +1,30 @@
package jesse.keeblarcraft.Entities;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.passive.MerchantEntity;
import net.minecraft.entity.passive.PassiveEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.village.TradeOffer;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
public class ShopKeeper extends MerchantEntity {
public ShopKeeper(EntityType<? extends MerchantEntity> entityType, World world) {
super(entityType, world);
}
@Override
protected void afterUsing(TradeOffer offer) {
}
@Override
protected void fillRecipes() {
}
@Override
public @Nullable PassiveEntity createChild(ServerWorld world, PassiveEntity entity) {
return null;
}
}

View File

@ -0,0 +1,10 @@
package jesse.keeblarcraft.GuiMgr.Entities;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.render.entity.VillagerEntityRenderer;
public class ShopKeeperRenderer extends VillagerEntityRenderer {
public ShopKeeperRenderer(EntityRendererFactory.Context context) {
super(context);
}
}

View File

@ -7,8 +7,6 @@
*
*/
// color colour
package jesse.keeblarcraft;
import net.fabricmc.api.ModInitializer;
@ -18,7 +16,6 @@ import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
import net.kyrptonaught.customportalapi.api.CustomPortalBuilder;
import net.minecraft.block.Blocks;
import net.minecraft.entity.mob.HostileEntity;
import net.minecraft.item.Items;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;