Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
MythicCraft
MythicCosmetics
Commits
2cba71f2
Commit
2cba71f2
authored
3 years ago
by
Ashijin
Browse files
Options
Download
Email Patches
Plain Diff
Fixed MM errors
parent
0ba1a60e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
75 deletions
+7
-75
plugin/src/main/java/io/lumine/cosmetics/logging/MCLogger.java
...n/src/main/java/io/lumine/cosmetics/logging/MCLogger.java
+2
-71
plugin/src/main/java/io/lumine/cosmetics/players/Profile.java
...in/src/main/java/io/lumine/cosmetics/players/Profile.java
+5
-4
No files found.
plugin/src/main/java/io/lumine/cosmetics/logging/MCLogger.java
View file @
2cba71f2
...
@@ -8,19 +8,6 @@ import org.bukkit.Bukkit;
...
@@ -8,19 +8,6 @@ import org.bukkit.Bukkit;
import
io.lumine.cosmetics.MCCosmeticsPlugin
;
import
io.lumine.cosmetics.MCCosmeticsPlugin
;
import
io.lumine.utils.logging.ConsoleColor
;
import
io.lumine.utils.logging.ConsoleColor
;
import
io.lumine.xikage.mythicmobs.MythicMobs
;
import
io.lumine.xikage.mythicmobs.adapters.bukkit.BukkitEntityType
;
import
io.lumine.xikage.mythicmobs.drops.Drop
;
import
io.lumine.xikage.mythicmobs.drops.DropTable
;
import
io.lumine.xikage.mythicmobs.io.ConfigManager
;
import
io.lumine.xikage.mythicmobs.io.MythicConfig
;
import
io.lumine.xikage.mythicmobs.io.MythicLineConfig
;
import
io.lumine.xikage.mythicmobs.items.MythicItem
;
import
io.lumine.xikage.mythicmobs.mobs.MythicMob
;
import
io.lumine.xikage.mythicmobs.skills.SkillCondition
;
import
io.lumine.xikage.mythicmobs.skills.SkillMechanic
;
import
io.lumine.xikage.mythicmobs.skills.SkillTargeter
;
import
io.lumine.xikage.mythicmobs.spawning.random.RandomSpawner
;
public
class
MCLogger
{
public
class
MCLogger
{
...
@@ -55,71 +42,15 @@ public class MCLogger {
...
@@ -55,71 +42,15 @@ public class MCLogger {
public
static
void
error
(
String
message
,
Throwable
ex
)
{
public
static
void
error
(
String
message
,
Throwable
ex
)
{
log
(
Level
.
SEVERE
,
message
+
ConsoleColor
.
RESET
);
log
(
Level
.
SEVERE
,
message
+
ConsoleColor
.
RESET
);
log
(
Level
.
SEVERE
,
" "
+
ex
.
getMessage
()
+
" ("
+
ex
.
getClass
().
getName
()
+
")"
);
log
(
Level
.
SEVERE
,
" "
+
ex
.
getMessage
()
+
" ("
+
ex
.
getClass
().
getName
()
+
")"
);
if
(
ConfigManager
.
debugLevel
>
0
)
{
ex
.
printStackTrace
();
}
if
(
ConfigManager
.
errorLogging
==
true
)
{
ex
.
printStackTrace
();
PrintWriter
writer
=
null
;
try
{
File
folder
=
new
File
(
getPlugin
().
getDataFolder
(),
"Error Logs"
);
if
(!
folder
.
exists
())
folder
.
mkdir
();
writer
=
new
PrintWriter
(
new
File
(
folder
,
System
.
currentTimeMillis
()
+
".txt"
));
Throwable
t
=
ex
;
while
(
t
!=
null
)
{
t
.
printStackTrace
(
writer
);
writer
.
println
();
t
=
t
.
getCause
();
}
error
(
"This error has been saved in the Error Logs folder. Please report it on the MythicCraft forums or discord."
);
writer
.
println
(
"MCCosmetics version: "
+
getPlugin
().
getDescription
().
getVersion
());
writer
.
println
(
"Bukkit version: "
+
Bukkit
.
getServer
().
getVersion
());
}
catch
(
Exception
x
)
{
error
(
"ERROR HANDLING EXCEPTION"
);
x
.
printStackTrace
();
ex
.
printStackTrace
();
}
finally
{
if
(
writer
!=
null
)
writer
.
close
();
}
}
else
{
ex
.
printStackTrace
();
}
}
}
public
static
void
error
(
String
message
,
Throwable
ex
,
Object
...
params
)
{
public
static
void
error
(
String
message
,
Throwable
ex
,
Object
...
params
)
{
log
(
Level
.
SEVERE
,
message
+
ConsoleColor
.
RESET
,
params
);
log
(
Level
.
SEVERE
,
message
+
ConsoleColor
.
RESET
,
params
);
log
(
Level
.
SEVERE
,
" "
+
ex
.
getMessage
()
+
" ("
+
ex
.
getClass
().
getName
()
+
")"
);
log
(
Level
.
SEVERE
,
" "
+
ex
.
getMessage
()
+
" ("
+
ex
.
getClass
().
getName
()
+
")"
);
if
(
ConfigManager
.
debugLevel
>
0
)
{
ex
.
printStackTrace
();
}
if
(
ConfigManager
.
errorLogging
==
true
)
{
ex
.
printStackTrace
();
PrintWriter
writer
=
null
;
try
{
File
folder
=
new
File
(
getPlugin
().
getDataFolder
(),
"Error Logs"
);
if
(!
folder
.
exists
())
folder
.
mkdir
();
writer
=
new
PrintWriter
(
new
File
(
folder
,
System
.
currentTimeMillis
()
+
".txt"
));
Throwable
t
=
ex
;
while
(
t
!=
null
)
{
t
.
printStackTrace
(
writer
);
writer
.
println
();
t
=
t
.
getCause
();
}
error
(
"This error has been saved in the Error Logs folder. Please report it on the MythicCraft forums or discord."
);
writer
.
println
(
"MCCosmetics version: "
+
MythicMobs
.
inst
().
getDescription
().
getVersion
());
writer
.
println
(
"Bukkit version: "
+
Bukkit
.
getServer
().
getVersion
());
}
catch
(
Exception
x
)
{
error
(
"ERROR HANDLING EXCEPTION"
);
x
.
printStackTrace
();
ex
.
printStackTrace
();
}
finally
{
if
(
writer
!=
null
)
writer
.
close
();
}
}
else
{
ex
.
printStackTrace
();
}
}
}
private
MCLogger
()
{
private
MCLogger
()
{
...
...
This diff is collapsed.
Click to expand it.
plugin/src/main/java/io/lumine/cosmetics/players/Profile.java
View file @
2cba71f2
...
@@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
...
@@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
io.lumine.cosmetics.api.cosmetics.Cosmetic
;
import
io.lumine.cosmetics.api.cosmetics.Cosmetic
;
import
io.lumine.cosmetics.api.players.CosmeticInventory
;
import
io.lumine.cosmetics.api.players.CosmeticProfile
;
import
io.lumine.cosmetics.api.players.CosmeticProfile
;
import
lombok.Getter
;
import
lombok.Getter
;
...
@@ -19,7 +20,7 @@ public class Profile implements CosmeticProfile,io.lumine.utils.storage.players.
...
@@ -19,7 +20,7 @@ public class Profile implements CosmeticProfile,io.lumine.utils.storage.players.
@Getter
private
String
name
;
@Getter
private
String
name
;
@Getter
private
long
timestamp
=
System
.
currentTimeMillis
();
@Getter
private
long
timestamp
=
System
.
currentTimeMillis
();
@Getter
private
EquippedCosmetics
cosmeticInventory
;
@Getter
private
CosmeticInventory
cosmeticInventory
;
@Getter
private
transient
Player
player
;
@Getter
private
transient
Player
player
;
...
@@ -32,17 +33,17 @@ public class Profile implements CosmeticProfile,io.lumine.utils.storage.players.
...
@@ -32,17 +33,17 @@ public class Profile implements CosmeticProfile,io.lumine.utils.storage.players.
public
void
initialize
(
final
Player
player
)
{
public
void
initialize
(
final
Player
player
)
{
this
.
player
=
player
;
this
.
player
=
player
;
this
.
equippedCosmetics
=
new
EquippedCosmetics
(
this
);
//
this.equippedCosmetics = new EquippedCosmetics(this);
}
}
@Override
@Override
public
boolean
has
(
Cosmetic
cosmetic
)
{
public
boolean
has
(
Cosmetic
cosmetic
)
{
return
unlockedCosmetics
.
getOrDefault
(
cosmetic
.
getType
(),
Collections
.
emptyList
()).
contains
(
cosmetic
.
getKey
());
return
true
;
//return
unlockedCosmetics.getOrDefault(cosmetic.getType(), Collections.emptyList()).contains(cosmetic.getKey());
}
}
@Override
@Override
public
void
equip
(
Cosmetic
cosmetic
)
{
public
void
equip
(
Cosmetic
cosmetic
)
{
if
(
this
)
//
if(this)
}
}
@Override
@Override
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment