Skip to content

Commit

Permalink
add deprecations related to events
Browse files Browse the repository at this point in the history
also minor cleanings
  • Loading branch information
mcmonkey4eva committed Jul 20, 2020
1 parent a8d56cb commit 00d8963
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
Expand Up @@ -211,21 +211,17 @@ public boolean matchesArgumentType(Class<? extends ObjectTag> dClass) {

// Check if this argument matches any of multiple ObjectTag types
public boolean matchesArgumentTypes(Class<? extends ObjectTag>... dClasses) {

for (Class<? extends ObjectTag> c : dClasses) {
if (matchesArgumentType(c)) {
return true;
}
}

return false;
}

// Check if this argument matches a ListTag of a certain ObjectTag
public boolean matchesArgumentList(Class<? extends ObjectTag> dClass) {

ListTag list = getList();

return list.isEmpty() || list.containsObjectsFrom(dClass);
}

Expand Down
Expand Up @@ -337,17 +337,12 @@ public ListTag addObjects(List<ObjectTag> ObjectTags) {
return this;
}

// Returns if the list contains objects from the specified dClass
// by using the matches() method.
public boolean containsObjectsFrom(Class<? extends ObjectTag> dClass) {

// Iterate through elements until one matches() the dClass
for (ObjectTag testable : objectForms) {
if (CoreUtilities.canPossiblyBeType(testable, dClass)) {
return true;
}
}

return false;
}

Expand Down
Expand Up @@ -63,10 +63,10 @@ private static AttributeComponent[] separate_attributes(String attributes) {
if (chr == '[') {
braced++;
}
else if (x == attrInp.length - 1) {
if (x == attrInp.length - 1) {
x2 = x + 1;
}
else if (chr == ']') {
if (chr == ']') {
if (braced > 0) {
braced--;
}
Expand Down
Expand Up @@ -177,6 +177,10 @@ public class Deprecations {
public static Warning furnaceTimeTags = new SlowWarning("The furnace_burn_time, cook time, and cook total time tag/mechs have been replaced by _duration instead of _time equivalents (using DurationTag now).");
public static Warning playerTimePlayedTags = new SlowWarning("The tags player.first_played, last_played, ban_expiration, and ban_created have been replaced by tags of the same name with '_time' added to the end (using TimeTag now).");

// In Bukkit impl, added 2020/07/19.
public static Warning airLevelEventDuration = new SlowWarning("The 'entity changes air level' event uses 'air_duration' context now instead of the old tick count number.");
public static Warning damageEventTypeMap = new SlowWarning("The 'entity damaged' context 'damage_[TYPE]' is deprecated in favor of 'damage_type_map', which is operated as a MapTag.");

// ==================== FUTURE deprecations ====================

// In Bukkit impl, Relevant as of 2019/09/25, deprecate officially by 2021.
Expand Down

0 comments on commit 00d8963

Please sign in to comment.