Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
This commit is contained in:
@@ -17,30 +17,30 @@ public class CraftAdvancement implements org.bukkit.advancement.Advancement {
|
||||
}
|
||||
|
||||
public AdvancementHolder getHandle() {
|
||||
return handle;
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamespacedKey getKey() {
|
||||
return CraftNamespacedKey.fromMinecraft(handle.id());
|
||||
return CraftNamespacedKey.fromMinecraft(this.handle.id());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getCriteria() {
|
||||
return Collections.unmodifiableCollection(handle.value().criteria().keySet());
|
||||
return Collections.unmodifiableCollection(this.handle.value().criteria().keySet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdvancementRequirements getRequirements() {
|
||||
return new CraftAdvancementRequirements(handle.value().requirements());
|
||||
return new CraftAdvancementRequirements(this.handle.value().requirements());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdvancementDisplay getDisplay() {
|
||||
if (handle.value().display().isEmpty()) {
|
||||
if (this.handle.value().display().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new CraftAdvancementDisplay(handle.value().display().get());
|
||||
return new CraftAdvancementDisplay(this.handle.value().display().get());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.bukkit.craftbukkit.advancement;
|
||||
|
||||
import net.minecraft.advancements.AdvancementDisplay;
|
||||
import net.minecraft.advancements.DisplayInfo;
|
||||
import org.bukkit.advancement.AdvancementDisplayType;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||
@@ -8,58 +8,58 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class CraftAdvancementDisplay implements org.bukkit.advancement.AdvancementDisplay {
|
||||
|
||||
private final AdvancementDisplay handle;
|
||||
private final DisplayInfo handle;
|
||||
|
||||
public CraftAdvancementDisplay(AdvancementDisplay handle) {
|
||||
public CraftAdvancementDisplay(DisplayInfo handle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public AdvancementDisplay getHandle() {
|
||||
return handle;
|
||||
public DisplayInfo getHandle() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return CraftChatMessage.fromComponent(handle.getTitle());
|
||||
return CraftChatMessage.fromComponent(this.handle.getTitle());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return CraftChatMessage.fromComponent(handle.getDescription());
|
||||
return CraftChatMessage.fromComponent(this.handle.getDescription());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getIcon() {
|
||||
return CraftItemStack.asBukkitCopy(handle.getIcon());
|
||||
return CraftItemStack.asBukkitCopy(this.handle.getIcon());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldShowToast() {
|
||||
return handle.shouldShowToast();
|
||||
return this.handle.shouldShowToast();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAnnounceChat() {
|
||||
return handle.shouldAnnounceChat();
|
||||
return this.handle.shouldAnnounceChat();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHidden() {
|
||||
return handle.isHidden();
|
||||
return this.handle.isHidden();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getX() {
|
||||
return handle.getX();
|
||||
return this.handle.getX();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getY() {
|
||||
return handle.getY();
|
||||
return this.handle.getY();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdvancementDisplayType getType() {
|
||||
return AdvancementDisplayType.values()[handle.getType().ordinal()];
|
||||
return AdvancementDisplayType.values()[this.handle.getType().ordinal()];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,17 +5,17 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import net.minecraft.advancements.CriterionProgress;
|
||||
import net.minecraft.server.AdvancementDataPlayer;
|
||||
import net.minecraft.server.PlayerAdvancements;
|
||||
import org.bukkit.advancement.Advancement;
|
||||
import org.bukkit.advancement.AdvancementProgress;
|
||||
|
||||
public class CraftAdvancementProgress implements AdvancementProgress {
|
||||
|
||||
private final CraftAdvancement advancement;
|
||||
private final AdvancementDataPlayer playerData;
|
||||
private final PlayerAdvancements playerData;
|
||||
private final net.minecraft.advancements.AdvancementProgress handle;
|
||||
|
||||
public CraftAdvancementProgress(CraftAdvancement advancement, AdvancementDataPlayer player, net.minecraft.advancements.AdvancementProgress handle) {
|
||||
public CraftAdvancementProgress(CraftAdvancement advancement, PlayerAdvancements player, net.minecraft.advancements.AdvancementProgress handle) {
|
||||
this.advancement = advancement;
|
||||
this.playerData = player;
|
||||
this.handle = handle;
|
||||
@@ -23,37 +23,37 @@ public class CraftAdvancementProgress implements AdvancementProgress {
|
||||
|
||||
@Override
|
||||
public Advancement getAdvancement() {
|
||||
return advancement;
|
||||
return this.advancement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDone() {
|
||||
return handle.isDone();
|
||||
return this.handle.isDone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean awardCriteria(String criteria) {
|
||||
return playerData.award(advancement.getHandle(), criteria);
|
||||
return this.playerData.award(this.advancement.getHandle(), criteria);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean revokeCriteria(String criteria) {
|
||||
return playerData.revoke(advancement.getHandle(), criteria);
|
||||
return this.playerData.revoke(this.advancement.getHandle(), criteria);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getDateAwarded(String criteria) {
|
||||
CriterionProgress criterion = handle.getCriterion(criteria);
|
||||
CriterionProgress criterion = this.handle.getCriterion(criteria);
|
||||
return (criterion == null) ? null : Date.from(criterion.getObtained());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getRemainingCriteria() {
|
||||
return Collections.unmodifiableCollection(Lists.newArrayList(handle.getRemainingCriteria()));
|
||||
return Collections.unmodifiableCollection(Lists.newArrayList(this.handle.getRemainingCriteria()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getAwardedCriteria() {
|
||||
return Collections.unmodifiableCollection(Lists.newArrayList(handle.getCompletedCriteria()));
|
||||
return Collections.unmodifiableCollection(Lists.newArrayList(this.handle.getCompletedCriteria()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ public class CraftAdvancementRequirement implements AdvancementRequirement {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<String> getRequiredCriteria() {
|
||||
return Collections.unmodifiableList(requirements);
|
||||
return Collections.unmodifiableList(this.requirements);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStrict() {
|
||||
return requirements.size() == 1;
|
||||
return this.requirements.size() == 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ public class CraftAdvancementRequirements implements org.bukkit.advancement.Adva
|
||||
@NotNull
|
||||
@Override
|
||||
public List<AdvancementRequirement> getRequirements() {
|
||||
return requirements.requirements().stream().map((requirement) -> (AdvancementRequirement) new CraftAdvancementRequirement(requirement)).toList();
|
||||
return this.requirements.requirements().stream().map((requirement) -> (AdvancementRequirement) new CraftAdvancementRequirement(requirement)).toList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user