Add issue template and contributing info

This commit is contained in:
Aria 2023-03-05 16:23:15 -07:00
parent 4437104c19
commit 5fa2cb2f46
7 changed files with 74 additions and 31 deletions

View file

@ -1,15 +1,9 @@
package dev.zontreck.otemod.chat;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.UUID;
import dev.zontreck.libzontreck.chat.ChatColor;
import dev.zontreck.libzontreck.chat.HoverTip;
import dev.zontreck.libzontreck.events.ProfileLoadedEvent;
import dev.zontreck.libzontreck.events.ProfileUnloadedEvent;
import dev.zontreck.libzontreck.events.ProfileUnloadingEvent;
import dev.zontreck.libzontreck.profiles.Profile;
import dev.zontreck.libzontreck.profiles.UserProfileNotYetExistsException;
import dev.zontreck.libzontreck.util.ChatHelpers;
@ -18,10 +12,8 @@ import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.configs.OTEServerConfig;
import dev.zontreck.otemod.configs.PlayerFlyCache;
import dev.zontreck.otemod.enchantments.ModEnchantments;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.Style;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.player.Abilities;
@ -63,16 +55,15 @@ public class ChatServerOverride {
if(!OTEServerConfig.USE_CUSTOM_JOINLEAVE.get()) return;
ChatHelpers.broadcast(new TextComponent(ChatColor.doColors("!Dark_Gray![!Dark_Green!+!Dark_Gray!] !Bold!!Dark_Aqua!"+prof.nickname)), ev.server);
ChatHelpers.broadcast(new TextComponent(ChatColor.doColors("!Dark_Gray![!Dark_Green!+!Dark_Gray!] !Bold!!Dark_Aqua!"+prof.nickname)), ev.level.getServer());
}
@SubscribeEvent
public void onLeave(final ProfileUnloadedEvent ev)
public void onLeave(final ProfileUnloadingEvent ev)
{
// Get player profile, send disconnect alert, then commit profile and remove it from memory
Profile px=ev.oldProfile;
// TODO: Create a some extra entries in ProfileUnloadedEvent
Profile px=ev.profile;
if(px==null)return;
@ -80,10 +71,10 @@ public class ChatServerOverride {
if(!OTEServerConfig.USE_CUSTOM_JOINLEAVE.get()) return;
// Send the alert
ChatServerOverride.broadcast(new TextComponent(ChatColor.DARK_GRAY + "[" + ChatColor.DARK_RED + "-" + ChatColor.DARK_GRAY + "] "+ChatColor.BOLD + ChatColor.DARK_AQUA + px.nickname), ev.getEntity().getServer());
ChatHelpers.broadcast(new TextComponent(ChatColor.DARK_GRAY + "[" + ChatColor.DARK_RED + "-" + ChatColor.DARK_GRAY + "] "+ChatColor.BOLD + ChatColor.DARK_AQUA + px.nickname), px.player.server);
px.flying=sp.getAbilities().flying;
px.commit();
px.flying=px.player.getAbilities().flying;
ev.setCanceled(true);
}
@SubscribeEvent

View file

@ -27,11 +27,8 @@ import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraftforge.common.ForgeSpawnEggItem;
import net.minecraftforge.event.LootTableLoadEvent;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.world.BiomeLoadingEvent;
@ -84,12 +81,21 @@ public class EventHandler {
if(killedentity instanceof Player)
{
Profile profile;
try {
profile = Profile.get_profile_of(killedentity.getStringUUID());
} catch (UserProfileNotYetExistsException e) {
e.printStackTrace();
return;
}
profile.deaths++;
profile.commit();
if(!OTEServerConfig.ENABLE_PLAYER_HEAD_DROPS.get())
{
return;
}
int looting=0;
ServerPlayer killedPlayer = (ServerPlayer)ent;
//ServerPlayer killedPlayer = (ServerPlayer)ent;
if(ent instanceof Player){
ServerPlayer pla = (ServerPlayer)ent;
looting = ItemUtils.getEnchantmentLevel(Enchantments.MOB_LOOTING, pla.getMainHandItem());
@ -105,12 +111,6 @@ public class EventHandler {
double num = rng.nextDouble(0,100000);
if(num <= base_chance)
{
Profile profile=null;
try {
profile = Profile.get_profile_of(killedPlayer.getStringUUID());
} catch (UserProfileNotYetExistsException e) {
e.printStackTrace();
}
ItemStack head = HeadUtilities.get(killedentity.getName().getContents()).setHoverName(ChatHelpers.macro(profile.nickname+"'s Head"));
LoreContainer lore = new LoreContainer(head);

View file

@ -1,13 +1,16 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"###",
"###"
"##E",
"##E",
"EEE"
],
"key": {
"#": {
"item": "otemod:vault_steel_ingot"
},
"E": {
"tag": "forge:ingots/eternium"
}
},
"result": {