Update to 1.17.1

This commit is contained in:
Marcel Konrad
2021-07-26 00:49:42 +02:00
parent cd058e9582
commit ea35dcb6f3
134 changed files with 1711 additions and 1809 deletions

View File

@@ -17,8 +17,8 @@ import exopandora.worldhandler.builder.types.CoordinateInt;
import exopandora.worldhandler.builder.types.GreedyString;
import exopandora.worldhandler.builder.types.ItemResourceLocation;
import exopandora.worldhandler.builder.types.TargetSelector;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ResourceLocation;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -107,7 +107,7 @@ public abstract class CommandBuilder implements ICommandBuilderSyntax
this.set(index, resource, ArgumentType.BLOCK_RESOURCE_LOCATION);
}
protected void setNode(int index, CompoundNBT nbt)
protected void setNode(int index, CompoundTag nbt)
{
this.set(index, nbt, ArgumentType.NBT);
}
@@ -229,7 +229,7 @@ public abstract class CommandBuilder implements ICommandBuilderSyntax
}
@Nullable
protected CompoundNBT getNodeAsNBT(int index)
protected CompoundTag getNodeAsNBT(int index)
{
return this.get(index, ArgumentType.NBT);
}

View File

@@ -7,7 +7,7 @@ import javax.annotation.Nullable;
import exopandora.worldhandler.builder.component.IBuilderComponent;
import exopandora.worldhandler.util.NBTHelper;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -49,9 +49,9 @@ public abstract class CommandBuilderNBT extends CommandBuilder implements IComma
}
@Nullable
protected CompoundNBT buildNBT()
protected CompoundTag buildNBT()
{
CompoundNBT nbt = new CompoundNBT();
CompoundTag nbt = new CompoundTag();
for(IBuilderComponent component : this.TAG_TO_COMPONENT)
{

View File

@@ -1,6 +1,6 @@
package exopandora.worldhandler.builder;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.ChatFormatting;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -28,7 +28,7 @@ public class CommandString
}
else
{
this.command.append(" " + TextFormatting.RED + "[error]" + TextFormatting.RESET);
this.command.append(" " + ChatFormatting.RED + "[error]" + ChatFormatting.RESET);
}
}

View File

@@ -1,11 +1,11 @@
package exopandora.worldhandler.builder;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public interface ICommandBuilderNBT extends ICommandBuilder
{
void setNBT(CompoundNBT nbt);
void setNBT(CompoundTag nbt);
}

View File

@@ -2,7 +2,7 @@ package exopandora.worldhandler.builder;
import javax.annotation.Nullable;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.Tag;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -10,5 +10,5 @@ import net.minecraftforge.api.distmarker.OnlyIn;
public interface INBTWritable
{
@Nullable
INBT serialize();
Tag serialize();
}

View File

@@ -7,8 +7,8 @@ import java.util.Set;
import java.util.stream.Collectors;
import exopandora.worldhandler.builder.component.IBuilderComponent;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.ai.attributes.Attribute;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.registries.ForgeRegistries;

View File

@@ -5,10 +5,10 @@ import java.util.UUID;
import javax.annotation.Nullable;
import net.minecraft.entity.ai.attributes.Attribute;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.Tag;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -17,15 +17,15 @@ public class ComponentAttributeItem extends ComponentAttribute
{
@Override
@Nullable
public INBT serialize()
public Tag serialize()
{
ListNBT attributes = new ListNBT();
ListTag attributes = new ListTag();
for(Entry<Attribute, Double> entry : this.attributes.entrySet())
{
if(entry.getValue() != 0)
{
CompoundNBT attribute = new CompoundNBT();
CompoundTag attribute = new CompoundTag();
String id = entry.getKey().getRegistryName().toString();
attribute.putString("AttributeName", id);

View File

@@ -4,10 +4,10 @@ import java.util.Map.Entry;
import javax.annotation.Nullable;
import net.minecraft.entity.ai.attributes.Attribute;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.Tag;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -16,15 +16,15 @@ public class ComponentAttributeMob extends ComponentAttribute
{
@Override
@Nullable
public INBT serialize()
public Tag serialize()
{
ListNBT attributes = new ListNBT();
ListTag attributes = new ListTag();
for(Entry<Attribute, Double> entry : this.attributes.entrySet())
{
if(entry.getValue() != 0)
{
CompoundNBT attribute = new CompoundNBT();
CompoundTag attribute = new CompoundTag();
String id = entry.getKey().getRegistryName().toString();
attribute.putString("Name", id);

View File

@@ -1,17 +1,17 @@
package exopandora.worldhandler.builder.component.impl;
import exopandora.worldhandler.builder.component.IBuilderComponent;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.Tag;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class ComponentCustom implements IBuilderComponent
{
private INBT nbt;
private Tag nbt;
private String tag;
public void setNBT(INBT nbt)
public void setNBT(Tag nbt)
{
this.nbt = nbt;
}
@@ -21,7 +21,7 @@ public class ComponentCustom implements IBuilderComponent
this.tag = tag;
}
public void set(String tag, INBT nbt)
public void set(String tag, Tag nbt)
{
this.setTag(tag);
this.setNBT(nbt);
@@ -33,7 +33,7 @@ public class ComponentCustom implements IBuilderComponent
}
@Override
public INBT serialize()
public Tag serialize()
{
return this.nbt;
}

View File

@@ -1,38 +1,38 @@
package exopandora.worldhandler.builder.component.impl;
import exopandora.worldhandler.builder.component.IBuilderComponent;
import exopandora.worldhandler.util.MutableStringTextComponent;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.nbt.StringNBT;
import net.minecraft.util.text.ITextComponent;
import exopandora.worldhandler.util.MutableTextComponent;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.StringTag;
import net.minecraft.nbt.Tag;
import net.minecraft.network.chat.Component;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class ComponentDisplay implements IBuilderComponent
{
private MutableStringTextComponent name = new MutableStringTextComponent();
private ITextComponent[] lore = new ITextComponent[2];
private MutableTextComponent name = new MutableTextComponent();
private Component[] lore = new Component[2];
@Override
public INBT serialize()
public Tag serialize()
{
CompoundNBT display = new CompoundNBT();
CompoundTag display = new CompoundTag();
if(this.name.getText() != null && !this.name.getText().isEmpty())
{
display.putString("Name", ITextComponent.Serializer.toJson(this.name));
display.putString("Name", Component.Serializer.toJson(this.name));
}
ListNBT lore = new ListNBT();
ListTag lore = new ListTag();
for(int x = 0; x < this.lore.length; x++)
{
if(this.lore[x] != null && !this.lore[x].getString().isEmpty())
{
lore.add(StringNBT.valueOf(ITextComponent.Serializer.toJson(this.lore[x])));
lore.add(StringTag.valueOf(Component.Serializer.toJson(this.lore[x])));
}
}
@@ -49,42 +49,42 @@ public class ComponentDisplay implements IBuilderComponent
return null;
}
public void setName(MutableStringTextComponent name)
public void setName(MutableTextComponent name)
{
this.name = name;
}
public MutableStringTextComponent getName()
public MutableTextComponent getName()
{
return this.name;
}
public void setLore(ITextComponent[] lore)
public void setLore(Component[] lore)
{
this.lore = lore;
}
public ITextComponent[] getLore()
public Component[] getLore()
{
return this.lore;
}
public void setLore1(ITextComponent lore)
public void setLore1(Component lore)
{
this.lore[0] = lore;
}
public ITextComponent getLore1()
public Component getLore1()
{
return this.lore[0];
}
public void setLore2(ITextComponent lore)
public void setLore2(Component lore)
{
this.lore[1] = lore;
}
public ITextComponent getLore2()
public Component getLore2()
{
return this.lore[1];
}

View File

@@ -8,10 +8,10 @@ import java.util.Set;
import javax.annotation.Nullable;
import exopandora.worldhandler.builder.component.IBuilderComponent;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.Tag;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.registries.ForgeRegistries;
@@ -23,15 +23,15 @@ public class ComponentEnchantment implements IBuilderComponent
@Override
@Nullable
public INBT serialize()
public Tag serialize()
{
ListNBT enchantments = new ListNBT();
ListTag enchantments = new ListTag();
for(Entry<Enchantment, Short> entry : this.enchantments.entrySet())
{
if(entry.getValue() > 0)
{
CompoundNBT enchantment = new CompoundNBT();
CompoundTag enchantment = new CompoundTag();
enchantment.putString("id", ForgeRegistries.ENCHANTMENTS.getKey(entry.getKey()).toString());
enchantment.putShort("lvl", entry.getValue());

View File

@@ -8,32 +8,32 @@ import java.util.Set;
import javax.annotation.Nullable;
import exopandora.worldhandler.builder.component.IBuilderComponent;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.potion.Effect;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.Tag;
import net.minecraft.world.effect.MobEffect;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public abstract class ComponentPotion implements IBuilderComponent
{
protected final Map<Effect, EffectNBT> potions = new HashMap<Effect, EffectNBT>();
protected final Map<MobEffect, EffectNBT> potions = new HashMap<MobEffect, EffectNBT>();
@Override
@Nullable
public INBT serialize()
public Tag serialize()
{
ListNBT list = new ListNBT();
ListTag list = new ListTag();
for(Entry<Effect, EffectNBT> entry : this.potions.entrySet())
for(Entry<MobEffect, EffectNBT> entry : this.potions.entrySet())
{
EffectNBT effect = entry.getValue();
if(effect.getAmplifier() > 0)
{
CompoundNBT compound = effect.serialize();
compound.putByte("Id", (byte) Effect.getId(entry.getKey()));
CompoundTag compound = effect.serialize();
compound.putByte("Id", (byte) MobEffect.getId(entry.getKey()));
list.add(compound);
}
}
@@ -46,72 +46,72 @@ public abstract class ComponentPotion implements IBuilderComponent
return list;
}
public void setAmplifier(Effect potion, byte amplifier)
public void setAmplifier(MobEffect potion, byte amplifier)
{
this.getMetadata(potion).setAmplifier(amplifier);
}
public byte getAmplifier(Effect potion)
public byte getAmplifier(MobEffect potion)
{
return this.getMetadata(potion).getAmplifier();
}
public void setSeconds(Effect potion, int seconds)
public void setSeconds(MobEffect potion, int seconds)
{
this.getMetadata(potion).setSeconds(seconds);
}
public int getSeconds(Effect potion)
public int getSeconds(MobEffect potion)
{
return this.getMetadata(potion).getSeconds();
}
public void setMinutes(Effect potion, int minutes)
public void setMinutes(MobEffect potion, int minutes)
{
this.getMetadata(potion).setMinutes(minutes);
}
public int getMinutes(Effect potion)
public int getMinutes(MobEffect potion)
{
return this.getMetadata(potion).getMinutes();
}
public void setHours(Effect potion, int hours)
public void setHours(MobEffect potion, int hours)
{
this.getMetadata(potion).setHours(hours);
}
public int getHours(Effect potion)
public int getHours(MobEffect potion)
{
return this.getMetadata(potion).getHours();
}
public void setShowParticles(Effect potion, boolean showParticles)
public void setShowParticles(MobEffect potion, boolean showParticles)
{
this.getMetadata(potion).setShowParticles(showParticles);
}
public boolean getShowParticles(Effect potion)
public boolean getShowParticles(MobEffect potion)
{
return this.getMetadata(potion).getShowParticles();
}
public void setAmbient(Effect potion, boolean ambient)
public void setAmbient(MobEffect potion, boolean ambient)
{
this.getMetadata(potion).setAmbient(ambient);
}
public boolean getAmbient(Effect potion)
public boolean getAmbient(MobEffect potion)
{
return this.getMetadata(potion).getAmbient();
}
private EffectNBT getMetadata(Effect potion)
private EffectNBT getMetadata(MobEffect potion)
{
return this.potions.get(this.validate(potion));
}
private Effect validate(Effect potion)
private MobEffect validate(MobEffect potion)
{
if(!this.potions.containsKey(potion))
{
@@ -121,12 +121,12 @@ public abstract class ComponentPotion implements IBuilderComponent
return potion;
}
public Set<Effect> getEffects()
public Set<MobEffect> getMobEffects()
{
return this.potions.keySet();
}
public void remove(Effect potion)
public void remove(MobEffect potion)
{
this.potions.remove(potion);
}

View File

@@ -7,35 +7,35 @@ import javax.annotation.Nullable;
import exopandora.worldhandler.WorldHandler;
import exopandora.worldhandler.builder.component.IBuilderComponent;
import net.minecraft.nbt.ByteArrayNBT;
import net.minecraft.nbt.ByteNBT;
import net.minecraft.nbt.DoubleNBT;
import net.minecraft.nbt.FloatNBT;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.IntArrayNBT;
import net.minecraft.nbt.IntNBT;
import net.minecraft.nbt.LongArrayNBT;
import net.minecraft.nbt.LongNBT;
import net.minecraft.nbt.ShortNBT;
import net.minecraft.nbt.StringNBT;
import net.minecraft.nbt.ByteArrayTag;
import net.minecraft.nbt.ByteTag;
import net.minecraft.nbt.DoubleTag;
import net.minecraft.nbt.FloatTag;
import net.minecraft.nbt.IntArrayTag;
import net.minecraft.nbt.IntTag;
import net.minecraft.nbt.LongArrayTag;
import net.minecraft.nbt.LongTag;
import net.minecraft.nbt.ShortTag;
import net.minecraft.nbt.StringTag;
import net.minecraft.nbt.Tag;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class ComponentTag<T> implements IBuilderComponent
{
private final Function<T, INBT> serializer;
private final Function<T, Tag> serializer;
private final String tag;
private T value;
public ComponentTag(String tag, T value, Function<T, INBT> serializer)
public ComponentTag(String tag, T value, Function<T, Tag> serializer)
{
this.tag = tag;
this.value = value;
this.serializer = serializer;
}
public ComponentTag(String tag, Function<T, INBT> serializer)
public ComponentTag(String tag, Function<T, Tag> serializer)
{
this(tag, null, serializer);
}
@@ -63,7 +63,7 @@ public class ComponentTag<T> implements IBuilderComponent
@Override
@Nullable
public INBT serialize()
public Tag serialize()
{
if(this.value != null)
{
@@ -80,9 +80,9 @@ public class ComponentTag<T> implements IBuilderComponent
return null;
}
return StringNBT.valueOf(string);
return StringTag.valueOf(string);
}
else if(this.value instanceof INBT)
else if(this.value instanceof Tag)
{
if(this.value instanceof Collection<?>)
{
@@ -94,43 +94,43 @@ public class ComponentTag<T> implements IBuilderComponent
}
}
return (INBT) this.value;
return (Tag) this.value;
}
else if(this.value instanceof Integer)
{
return IntNBT.valueOf((Integer) this.value);
return IntTag.valueOf((Integer) this.value);
}
else if(this.value instanceof Byte)
{
return ByteNBT.valueOf((Byte) this.value);
return ByteTag.valueOf((Byte) this.value);
}
else if(this.value instanceof Float)
{
return FloatNBT.valueOf((Float) this.value);
return FloatTag.valueOf((Float) this.value);
}
else if(this.value instanceof Double)
{
return DoubleNBT.valueOf((Double) this.value);
return DoubleTag.valueOf((Double) this.value);
}
else if(this.value instanceof Long)
{
return LongNBT.valueOf((Long) this.value);
return LongTag.valueOf((Long) this.value);
}
else if(this.value instanceof Short)
{
return ShortNBT.valueOf((Short) this.value);
return ShortTag.valueOf((Short) this.value);
}
else if(this.value instanceof Byte[])
{
return new ByteArrayNBT((byte[]) this.value);
return new ByteArrayTag((byte[]) this.value);
}
else if(this.value instanceof Integer[])
{
return new IntArrayNBT((int[]) this.value);
return new IntArrayTag((int[]) this.value);
}
else if(this.value instanceof Long[])
{
return new LongArrayNBT((long[]) this.value);
return new LongArrayTag((long[]) this.value);
}
else
{

View File

@@ -1,7 +1,7 @@
package exopandora.worldhandler.builder.component.impl;
import exopandora.worldhandler.builder.INBTWritable;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.CompoundTag;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -101,9 +101,9 @@ public class EffectNBT implements INBTWritable
}
@Override
public CompoundNBT serialize()
public CompoundTag serialize()
{
CompoundNBT compound = new CompoundNBT();
CompoundTag compound = new CompoundTag();
int ticks = this.toTicks();
compound.putByte("Amplifier", (byte) (this.amplifier - 1));

View File

@@ -11,22 +11,22 @@ import javax.annotation.Nullable;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import exopandora.worldhandler.builder.component.IBuilderComponent;
import exopandora.worldhandler.util.MutableStringTextComponent;
import exopandora.worldhandler.util.MutableTextComponent;
import exopandora.worldhandler.util.NBTHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.ai.attributes.Attribute;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.nbt.ByteNBT;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.INBT;
import net.minecraft.nbt.IntNBT;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.StringNBT;
import net.minecraft.potion.Effect;
import net.minecraft.util.ResourceLocation;
import net.minecraft.nbt.ByteTag;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.IntTag;
import net.minecraft.nbt.StringTag;
import net.minecraft.nbt.Tag;
import net.minecraft.nbt.TagParser;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -41,12 +41,12 @@ public class EntityNBT implements IBuilderComponent
private BlockState blockState;
private ComponentCustom entity = new ComponentCustom();
private ComponentAttributeMob attribute = new ComponentAttributeMob();
private MutableStringTextComponent customName = new MutableStringTextComponent();
private MutableTextComponent customName = new MutableTextComponent();
private List<EntityNBT> passengers = new ArrayList<EntityNBT>();
private ResourceLocation[] armorItems = {Items.AIR.getRegistryName(), Items.AIR.getRegistryName(), Items.AIR.getRegistryName(), Items.AIR.getRegistryName()};
private ResourceLocation[] handItems = {Items.AIR.getRegistryName(), Items.AIR.getRegistryName()};
private ComponentPotionMob potion = new ComponentPotionMob();
private CompoundNBT nbt;
private CompoundTag nbt;
public EntityNBT()
{
@@ -94,7 +94,7 @@ public class EntityNBT implements IBuilderComponent
}
@Nullable
public MutableStringTextComponent getCustomName()
public MutableTextComponent getCustomName()
{
return this.customName;
}
@@ -270,69 +270,69 @@ public class EntityNBT implements IBuilderComponent
this.motion[2] = z;
}
public void setAmplifier(Effect potion, byte amplifier)
public void setAmplifier(MobEffect potion, byte amplifier)
{
this.potion.setAmplifier(potion, amplifier);
}
public void setSeconds(Effect potion, int seconds)
public void setSeconds(MobEffect potion, int seconds)
{
this.potion.setSeconds(potion, seconds);
}
public void setMinutes(Effect potion, int minutes)
public void setMinutes(MobEffect potion, int minutes)
{
this.potion.setMinutes(potion, minutes);
}
public void setHours(Effect potion, int hours)
public void setHours(MobEffect potion, int hours)
{
this.potion.setHours(potion, hours);
}
public void setShowParticles(Effect potion, boolean showParticles)
public void setShowParticles(MobEffect potion, boolean showParticles)
{
this.potion.setShowParticles(potion, showParticles);
}
public void setAmbient(Effect potion, boolean ambient)
public void setAmbient(MobEffect potion, boolean ambient)
{
this.potion.setAmbient(potion, ambient);
}
public byte getAmplifier(Effect potion)
public byte getAmplifier(MobEffect potion)
{
return this.potion.getAmplifier(potion);
}
public int getSeconds(Effect potion)
public int getSeconds(MobEffect potion)
{
return this.potion.getSeconds(potion);
}
public int getMinutes(Effect potion)
public int getMinutes(MobEffect potion)
{
return this.potion.getMinutes(potion);
}
public int getHours(Effect potion)
public int getHours(MobEffect potion)
{
return this.potion.getHours(potion);
}
public boolean getShowParticles(Effect potion)
public boolean getShowParticles(MobEffect potion)
{
return this.potion.getShowParticles(potion);
}
public boolean getAmbient(Effect potion)
public boolean getAmbient(MobEffect potion)
{
return this.potion.getAmbient(potion);
}
public Set<Effect> getEffects()
public Set<MobEffect> getEffects()
{
return this.potion.getEffects();
return this.potion.getMobEffects();
}
public void setBlockState(BlockState blockState)
@@ -355,7 +355,7 @@ public class EntityNBT implements IBuilderComponent
return this.time;
}
public void setCustomComponent(String tag, INBT nbt)
public void setCustomComponent(String tag, Tag nbt)
{
this.entity.set(tag, nbt);
}
@@ -385,12 +385,12 @@ public class EntityNBT implements IBuilderComponent
return this.command;
}
public void setNBT(CompoundNBT nbt)
public void setNBT(CompoundTag nbt)
{
this.nbt = nbt;
}
public CompoundNBT getNBT()
public CompoundTag getNBT()
{
return this.nbt;
}
@@ -399,7 +399,7 @@ public class EntityNBT implements IBuilderComponent
{
try
{
this.nbt = JsonToNBT.parseTag("{" + nbt + "}");
this.nbt = TagParser.parseTag("{" + nbt + "}");
}
catch(CommandSyntaxException e)
{
@@ -408,23 +408,23 @@ public class EntityNBT implements IBuilderComponent
}
@Override
public CompoundNBT serialize()
public CompoundTag serialize()
{
CompoundNBT nbt = new CompoundNBT();
CompoundTag nbt = new CompoundTag();
if(this.time != null)
{
NBTHelper.append(nbt, "Time", IntNBT.valueOf(this.time));
NBTHelper.append(nbt, "Time", IntTag.valueOf(this.time));
}
if(this.command != null)
{
NBTHelper.append(nbt, "Command", StringNBT.valueOf(this.command));
NBTHelper.append(nbt, "Command", StringTag.valueOf(this.command));
}
if(this.isBaby)
{
NBTHelper.append(nbt, "IsBaby", ByteNBT.valueOf(true));
NBTHelper.append(nbt, "IsBaby", ByteTag.valueOf(true));
}
NBTHelper.append(nbt, "id", NBTHelper.serialize(this.id));

View File

@@ -6,7 +6,7 @@ import exopandora.worldhandler.builder.CommandBuilder;
import exopandora.worldhandler.builder.CommandSyntax;
import exopandora.worldhandler.builder.types.ArgumentType;
import exopandora.worldhandler.util.EnumHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

View File

@@ -2,7 +2,7 @@ package exopandora.worldhandler.builder.impl;
import exopandora.worldhandler.builder.CommandBuilderNBT;
import exopandora.worldhandler.builder.types.CoordinateInt;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.BlockPos;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

View File

@@ -4,9 +4,9 @@ import javax.annotation.Nonnull;
import exopandora.worldhandler.builder.CommandBuilder;
import exopandora.worldhandler.builder.CommandSyntax;
import exopandora.worldhandler.builder.types.TargetSelector;
import exopandora.worldhandler.builder.types.ArgumentType;
import net.minecraft.util.ResourceLocation;
import exopandora.worldhandler.builder.types.TargetSelector;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

View File

@@ -4,11 +4,11 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import exopandora.worldhandler.builder.CommandSyntax;
import exopandora.worldhandler.builder.types.Coordinate.EnumType;
import exopandora.worldhandler.util.EnumHelper;
import exopandora.worldhandler.builder.types.CoordinateInt;
import exopandora.worldhandler.builder.types.ArgumentType;
import net.minecraft.util.math.BlockPos;
import exopandora.worldhandler.builder.types.Coordinate.EnumType;
import exopandora.worldhandler.builder.types.CoordinateInt;
import exopandora.worldhandler.util.EnumHelper;
import net.minecraft.core.BlockPos;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

View File

@@ -5,11 +5,11 @@ import java.util.Set;
import exopandora.worldhandler.builder.component.impl.ComponentAttributeItem;
import exopandora.worldhandler.builder.component.impl.ComponentDisplay;
import exopandora.worldhandler.builder.component.impl.ComponentEnchantment;
import exopandora.worldhandler.util.MutableStringTextComponent;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.ai.attributes.Attribute;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import exopandora.worldhandler.util.MutableTextComponent;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -68,32 +68,32 @@ public class BuilderCustomItem extends BuilderGive
return this.attribute.getAttributes();
}
public void setName(MutableStringTextComponent name)
public void setName(MutableTextComponent name)
{
this.display.setName(name);
}
public MutableStringTextComponent getName()
public MutableTextComponent getName()
{
return this.display.getName();
}
public void setLore1(ITextComponent lore)
public void setLore1(Component lore)
{
this.display.setLore1(lore);
}
public ITextComponent getLore1()
public Component getLore1()
{
return this.display.getLore1();
}
public void setLore2(ITextComponent lore)
public void setLore2(Component lore)
{
this.display.setLore2(lore);
}
public ITextComponent getLore2()
public Component getLore2()
{
return this.display.getLore2();
}

View File

@@ -8,9 +8,9 @@ import exopandora.worldhandler.builder.types.ArgumentType;
import exopandora.worldhandler.builder.types.CoordinateInt;
import exopandora.worldhandler.builder.types.TargetSelector;
import exopandora.worldhandler.util.EnumHelper;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -24,7 +24,7 @@ public class BuilderData extends BuilderBlockPos
super(2);
}
public BuilderData(EnumMode mode, ResourceLocation entity, CompoundNBT nbt)
public BuilderData(EnumMode mode, ResourceLocation entity, CompoundTag nbt)
{
this();
this.setMode(mode);
@@ -32,7 +32,7 @@ public class BuilderData extends BuilderBlockPos
this.setNBT(nbt);
}
public BuilderData(EnumMode mode, BlockPos pos, CompoundNBT nbt)
public BuilderData(EnumMode mode, BlockPos pos, CompoundTag nbt)
{
this();
this.setMode(mode);
@@ -130,7 +130,7 @@ public class BuilderData extends BuilderBlockPos
}
@Override
public void setNBT(CompoundNBT nbt)
public void setNBT(CompoundTag nbt)
{
if(this.getMode() == null || !this.getMode().equals(EnumMode.MERGE))
{
@@ -156,7 +156,7 @@ public class BuilderData extends BuilderBlockPos
}
@Nullable
public CompoundNBT getNBT()
public CompoundTag getNBT()
{
if(this.getMode() != null && this.getMode().equals(EnumMode.MERGE))
{

View File

@@ -5,7 +5,7 @@ import javax.annotation.Nonnull;
import exopandora.worldhandler.builder.CommandBuilder;
import exopandora.worldhandler.builder.types.CoordinateInt;
import exopandora.worldhandler.util.BlockHelper;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.BlockPos;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

View File

@@ -5,8 +5,8 @@ import javax.annotation.Nullable;
import exopandora.worldhandler.builder.CommandBuilder;
import exopandora.worldhandler.builder.CommandSyntax;
import exopandora.worldhandler.builder.types.ArgumentType;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.util.ResourceLocation;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

View File

@@ -10,22 +10,22 @@ import org.apache.commons.lang3.StringUtils;
import exopandora.worldhandler.builder.CommandBuilderNBT;
import exopandora.worldhandler.builder.component.impl.EntityNBT;
import exopandora.worldhandler.util.MutableStringTextComponent;
import exopandora.worldhandler.util.MutableTextComponent;
import exopandora.worldhandler.util.ResourceHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.ai.attributes.Attribute;
import net.minecraft.entity.merchant.villager.VillagerProfession;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.nbt.ByteNBT;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.IntNBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.potion.Effect;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.nbt.ByteTag;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.IntTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.entity.npc.VillagerProfession;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.registries.ForgeRegistries;
@@ -87,7 +87,7 @@ public abstract class BuilderEntity extends CommandBuilderNBT
}
@Nullable
public MutableStringTextComponent getCustomName()
public MutableTextComponent getCustomName()
{
return this.nbt.getCustomName();
}
@@ -228,67 +228,67 @@ public abstract class BuilderEntity extends CommandBuilderNBT
this.nbt.setMotionZ(z);
}
public void setAmplifier(Effect potion, byte amplifier)
public void setAmplifier(MobEffect potion, byte amplifier)
{
this.nbt.setAmplifier(potion, amplifier);
}
public void setSeconds(Effect potion, int seconds)
public void setSeconds(MobEffect potion, int seconds)
{
this.nbt.setSeconds(potion, seconds);
}
public void setMinutes(Effect potion, int minutes)
public void setMinutes(MobEffect potion, int minutes)
{
this.nbt.setMinutes(potion, minutes);
}
public void setHours(Effect potion, int hours)
public void setHours(MobEffect potion, int hours)
{
this.nbt.setHours(potion, hours);
}
public void setShowParticles(Effect potion, boolean showParticles)
public void setShowParticles(MobEffect potion, boolean showParticles)
{
this.nbt.setShowParticles(potion, showParticles);
}
public void setAmbient(Effect potion, boolean ambient)
public void setAmbient(MobEffect potion, boolean ambient)
{
this.nbt.setAmbient(potion, ambient);
}
public byte getAmplifier(Effect potion)
public byte getAmplifier(MobEffect potion)
{
return this.nbt.getAmplifier(potion);
}
public int getSeconds(Effect potion)
public int getSeconds(MobEffect potion)
{
return this.nbt.getSeconds(potion);
}
public int getMinutes(Effect potion)
public int getMinutes(MobEffect potion)
{
return this.nbt.getMinutes(potion);
}
public int getHours(Effect potion)
public int getHours(MobEffect potion)
{
return this.nbt.getHours(potion);
}
public boolean getShowParticles(Effect potion)
public boolean getShowParticles(MobEffect potion)
{
return this.nbt.getShowParticles(potion);
}
public boolean getAmbient(Effect potion)
public boolean getAmbient(MobEffect potion)
{
return this.nbt.getAmbient(potion);
}
public Set<Effect> getEffects()
public Set<MobEffect> getMobEffects()
{
return this.nbt.getEffects();
}
@@ -328,18 +328,18 @@ public abstract class BuilderEntity extends CommandBuilderNBT
this.nbt.setNBT(nbt);
}
public void setEntityNBT(CompoundNBT nbt)
public void setEntityNBT(CompoundTag nbt)
{
this.nbt.setNBT(nbt);
}
public CompoundNBT getEntityNBT()
public CompoundTag getEntityNBT()
{
return this.nbt.getNBT();
}
@Override
protected CompoundNBT buildNBT()
protected CompoundTag buildNBT()
{
return this.nbt.serialize();
}
@@ -352,7 +352,7 @@ public abstract class BuilderEntity extends CommandBuilderNBT
{
if(entity.equals(EntityType.CAT.getRegistryName()))
{
this.nbt.setCustomComponent("CatType", IntNBT.valueOf(new Random().nextInt(11)));
this.nbt.setCustomComponent("CatType", IntTag.valueOf(new Random().nextInt(11)));
}
else if(entity.equals(EntityType.VILLAGER.getRegistryName()))
{
@@ -360,7 +360,7 @@ public abstract class BuilderEntity extends CommandBuilderNBT
{
if(StringUtils.equalsIgnoreCase(name, profession.toString()))
{
CompoundNBT villagerData = new CompoundNBT();
CompoundTag villagerData = new CompoundTag();
villagerData.putString("profession", profession.getRegistryName().toString());
this.nbt.setCustomComponent("VillagerData", villagerData);
@@ -372,14 +372,14 @@ public abstract class BuilderEntity extends CommandBuilderNBT
{
if(StringUtils.containsIgnoreCase(name, "Baby"))
{
this.nbt.setCustomComponent("IsBaby", ByteNBT.valueOf((byte) 1));
this.nbt.setCustomComponent("IsBaby", ByteTag.valueOf((byte) 1));
}
}
else if(entity.equals(EntityType.CHICKEN.getRegistryName()))
{
if(StringUtils.containsIgnoreCase(name, "Jockey") && !this.nbt.hasPassengers())
{
ListNBT list = new ListNBT();
ListTag list = new ListTag();
EntityNBT zombie = new EntityNBT(EntityType.ZOMBIE.getRegistryName());
zombie.setIsBaby(true);
@@ -391,7 +391,7 @@ public abstract class BuilderEntity extends CommandBuilderNBT
{
if(StringUtils.containsIgnoreCase(name, "Jockey") && !this.nbt.hasPassengers())
{
ListNBT list = new ListNBT();
ListTag list = new ListTag();
EntityNBT skeleton = new EntityNBT(EntityType.SKELETON.getRegistryName());
skeleton.setHandItem(0, Items.BOW);

View File

@@ -3,12 +3,12 @@ package exopandora.worldhandler.builder.impl;
import javax.annotation.Nullable;
import exopandora.worldhandler.builder.CommandSyntax;
import exopandora.worldhandler.builder.types.ArgumentType;
import exopandora.worldhandler.builder.types.BlockResourceLocation;
import exopandora.worldhandler.builder.types.CoordinateInt;
import exopandora.worldhandler.util.BlockHelper;
import exopandora.worldhandler.util.EnumHelper;
import exopandora.worldhandler.builder.types.ArgumentType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.BlockPos;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

View File

@@ -4,11 +4,11 @@ import javax.annotation.Nullable;
import exopandora.worldhandler.builder.CommandBuilderNBT;
import exopandora.worldhandler.builder.CommandSyntax;
import exopandora.worldhandler.builder.types.ArgumentType;
import exopandora.worldhandler.builder.types.ItemResourceLocation;
import exopandora.worldhandler.util.ResourceHelper;
import exopandora.worldhandler.builder.types.ArgumentType;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ResourceLocation;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.registries.ForgeRegistries;
@@ -69,14 +69,14 @@ public class BuilderGive extends CommandBuilderNBT
}
@Override
public void setNBT(CompoundNBT nbt)
public void setNBT(CompoundTag nbt)
{
this.itemResourceLocation.setNBT(nbt);
this.setNode(1, this.itemResourceLocation);
}
@Nullable
public CompoundNBT getNBT()
public CompoundTag getNBT()
{
ItemResourceLocation item = this.getItem();

View File

@@ -1,10 +1,10 @@
package exopandora.worldhandler.builder.impl;
import net.minecraft.block.Blocks;
import net.minecraft.client.Minecraft;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.state.properties.NoteBlockInstrument;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

View File

@@ -6,8 +6,8 @@ import exopandora.worldhandler.builder.CommandBuilder;
import exopandora.worldhandler.builder.CommandSyntax;
import exopandora.worldhandler.builder.component.impl.EffectNBT;
import exopandora.worldhandler.builder.types.ArgumentType;
import net.minecraft.potion.Effect;
import net.minecraft.util.ResourceLocation;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.effect.MobEffect;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.registries.ForgeRegistries;
@@ -33,7 +33,7 @@ public class BuilderPotionEffect extends CommandBuilder
{
this.setMode(mode);
this.setPlayer(player);
this.setEffect(effect);
this.setMobEffect(effect);
this.setDuration(duration);
this.setAmplifier(amplifier);
this.setHideParticles(hideParticles);
@@ -58,18 +58,18 @@ public class BuilderPotionEffect extends CommandBuilder
return this.getNodeAsString(1);
}
public void setEffect(Effect effect)
public void setMobEffect(MobEffect effect)
{
this.setEffect(effect.getRegistryName());
this.setMobEffect(effect.getRegistryName());
}
public void setEffect(ResourceLocation effect)
public void setMobEffect(ResourceLocation effect)
{
this.setNode(2, effect);
}
@Nullable
public Effect getEffectAsPotion()
public MobEffect getMobEffectAsPotion()
{
ResourceLocation location = this.getNodeAsResourceLocation(2);
@@ -82,7 +82,7 @@ public class BuilderPotionEffect extends CommandBuilder
}
@Nullable
public ResourceLocation getEffect()
public ResourceLocation getMobEffect()
{
return this.getNodeAsResourceLocation(2);
}
@@ -152,12 +152,12 @@ public class BuilderPotionEffect extends CommandBuilder
public BuilderGeneric buildGive()
{
return new BuilderGeneric(this.getCommandName(), EnumMode.GIVE.toString(), this.getPlayer(), this.getEffect().toString(), String.valueOf(this.getDuration()), String.valueOf(this.getAmplifier()), String.valueOf(this.getHideParticles()));
return new BuilderGeneric(this.getCommandName(), EnumMode.GIVE.toString(), this.getPlayer(), this.getMobEffect().toString(), String.valueOf(this.getDuration()), String.valueOf(this.getAmplifier()), String.valueOf(this.getHideParticles()));
}
public BuilderGeneric buildRemove()
{
return new BuilderGeneric(this.getCommandName(), EnumMode.CLEAR.toString(), this.getPlayer(), this.getEffect().toString());
return new BuilderGeneric(this.getCommandName(), EnumMode.CLEAR.toString(), this.getPlayer(), this.getMobEffect().toString());
}
public BuilderGeneric buildClear()

View File

@@ -3,9 +3,9 @@ package exopandora.worldhandler.builder.impl;
import java.util.Set;
import exopandora.worldhandler.builder.component.impl.ComponentPotionItem;
import net.minecraft.item.Item;
import net.minecraft.potion.Effect;
import net.minecraft.util.ResourceLocation;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.item.Item;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -25,69 +25,69 @@ public class BuilderPotionItem extends BuilderGive
this.potion = this.registerNBTComponent(potion);
}
public void setAmplifier(Effect potion, byte amplifier)
public void setAmplifier(MobEffect potion, byte amplifier)
{
this.potion.setAmplifier(potion, amplifier);
}
public void setSeconds(Effect potion, int seconds)
public void setSeconds(MobEffect potion, int seconds)
{
this.potion.setSeconds(potion, seconds);
}
public void setMinutes(Effect potion, int minutes)
public void setMinutes(MobEffect potion, int minutes)
{
this.potion.setMinutes(potion, minutes);
}
public void setHours(Effect potion, int hours)
public void setHours(MobEffect potion, int hours)
{
this.potion.setHours(potion, hours);
}
public void setShowParticles(Effect potion, boolean showParticles)
public void setShowParticles(MobEffect potion, boolean showParticles)
{
this.potion.setShowParticles(potion, showParticles);
}
public void setAmbient(Effect potion, boolean ambient)
public void setAmbient(MobEffect potion, boolean ambient)
{
this.potion.setAmbient(potion, ambient);
}
public byte getAmplifier(Effect potion)
public byte getAmplifier(MobEffect potion)
{
return this.potion.getAmplifier(potion);
}
public int getSeconds(Effect potion)
public int getSeconds(MobEffect potion)
{
return this.potion.getSeconds(potion);
}
public int getMinutes(Effect potion)
public int getMinutes(MobEffect potion)
{
return this.potion.getMinutes(potion);
}
public int getHours(Effect potion)
public int getHours(MobEffect potion)
{
return this.potion.getHours(potion);
}
public boolean getShowParticles(Effect potion)
public boolean getShowParticles(MobEffect potion)
{
return this.potion.getShowParticles(potion);
}
public boolean getAmbient(Effect potion)
public boolean getAmbient(MobEffect potion)
{
return this.potion.getAmbient(potion);
}
public Set<Effect> getEffects()
public Set<MobEffect> getMobEffects()
{
return this.potion.getEffects();
return this.potion.getMobEffects();
}
public BuilderPotionItem build(Item item)

View File

@@ -6,8 +6,8 @@ import exopandora.worldhandler.builder.CommandBuilder;
import exopandora.worldhandler.builder.CommandSyntax;
import exopandora.worldhandler.builder.types.ArgumentType;
import exopandora.worldhandler.util.EnumHelper;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -48,7 +48,7 @@ public class BuilderRecipe extends CommandBuilder
return this.getNodeAsString(1);
}
public void setRecipe(IRecipe<?> recipe)
public void setRecipe(Recipe<?> recipe)
{
this.setRecipe(recipe.getId());
}

View File

@@ -2,8 +2,6 @@ package exopandora.worldhandler.builder.impl;
import javax.annotation.Nullable;
import org.apache.commons.lang3.RegExUtils;
import exopandora.worldhandler.builder.CommandSyntax;
import exopandora.worldhandler.builder.types.ArgumentType;
import exopandora.worldhandler.util.EnumHelper;

View File

@@ -4,10 +4,10 @@ import exopandora.worldhandler.builder.CommandSyntax;
import exopandora.worldhandler.builder.types.ArgumentType;
import exopandora.worldhandler.builder.types.BlockResourceLocation;
import exopandora.worldhandler.builder.types.CoordinateInt;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.state.Property;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -56,7 +56,7 @@ public class BuilderSetBlock extends BuilderBlockPos
this.setNode(4, mode.toString());
}
public void setBlockNBT(CompoundNBT nbt)
public void setBlockNBT(CompoundTag nbt)
{
this.blockResourceLocation.setNBT(nbt);
this.setBlock(this.blockResourceLocation);
@@ -68,7 +68,7 @@ public class BuilderSetBlock extends BuilderBlockPos
}
@Override
public void setNBT(CompoundNBT nbt)
public void setNBT(CompoundTag nbt)
{
}

View File

@@ -3,7 +3,7 @@ package exopandora.worldhandler.builder.impl;
import javax.annotation.Nullable;
import exopandora.worldhandler.builder.component.impl.ComponentTag;
import exopandora.worldhandler.util.MutableStringTextComponent;
import exopandora.worldhandler.util.MutableTextComponent;
import exopandora.worldhandler.util.SignText;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -38,7 +38,7 @@ public class BuilderSignEditor extends BuilderData
}
@Nullable
public MutableStringTextComponent getColoredString(int line)
public MutableTextComponent getColoredString(int line)
{
if(this.checkBounds(line))
{

View File

@@ -4,8 +4,8 @@ import exopandora.worldhandler.builder.CommandSyntax;
import exopandora.worldhandler.builder.types.ArgumentType;
import exopandora.worldhandler.builder.types.Coordinate.EnumType;
import exopandora.worldhandler.builder.types.CoordinateDouble;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ResourceLocation;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -60,7 +60,7 @@ public class BuilderSummon extends BuilderEntity
}
@Override
public void setNBT(CompoundNBT nbt)
public void setNBT(CompoundTag nbt)
{
this.setNode(4, nbt);
}

View File

@@ -12,8 +12,8 @@ import exopandora.worldhandler.builder.types.CoordinateInt;
import exopandora.worldhandler.builder.types.GreedyString;
import exopandora.worldhandler.builder.types.ItemResourceLocation;
import exopandora.worldhandler.builder.types.TargetSelector;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ResourceLocation;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -76,7 +76,7 @@ public class BuilderUsercontent extends CommandBuilder
this.setNode(index, type.<Long>parseOfDefault(object, ((Double) argument.getDefault()).longValue()));
break;
case NBT:
this.setNode(index, type.<CompoundNBT>parseOfDefault(object, type.parse((String) argument.getDefault())));
this.setNode(index, type.<CompoundTag>parseOfDefault(object, type.parse((String) argument.getDefault())));
break;
case RESOURCE_LOCATION:
this.setNode(index, type.<ResourceLocation>parseOfDefault(object, type.parse((String) argument.getDefault())));

View File

@@ -6,9 +6,9 @@ import javax.annotation.Nullable;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.util.ResourceLocation;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.TagParser;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -66,13 +66,13 @@ public enum ArgumentType
}
@Nullable
public static CompoundNBT parseCompoundNBT(String value)
public static CompoundTag parseCompoundNBT(String value)
{
if(value != null)
{
try
{
return JsonToNBT.parseTag(value);
return TagParser.parseTag(value);
}
catch(CommandSyntaxException e)
{

View File

@@ -5,11 +5,11 @@ import javax.annotation.Nullable;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.block.BlockState;
import net.minecraft.command.arguments.BlockStateParser;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.state.Property;
import net.minecraft.util.ResourceLocation;
import net.minecraft.commands.arguments.blocks.BlockStateParser;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.registries.ForgeRegistries;
@@ -29,7 +29,7 @@ public class BlockResourceLocation extends ItemResourceLocation
this(resource, null, null);
}
public BlockResourceLocation(ResourceLocation resource, BlockState state, CompoundNBT nbt)
public BlockResourceLocation(ResourceLocation resource, BlockState state, CompoundTag nbt)
{
super(resource, nbt);
this.state = this.findState(state, resource);

View File

@@ -4,9 +4,9 @@ import javax.annotation.Nullable;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.util.ResourceLocation;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.TagParser;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -14,7 +14,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
public class ItemResourceLocation
{
protected ResourceLocation resource;
protected CompoundNBT nbt;
protected CompoundTag nbt;
public ItemResourceLocation()
{
@@ -26,7 +26,7 @@ public class ItemResourceLocation
this(resource, null);
}
public ItemResourceLocation(ResourceLocation resource, CompoundNBT nbt)
public ItemResourceLocation(ResourceLocation resource, CompoundTag nbt)
{
this.resource = resource;
this.nbt = nbt;
@@ -42,12 +42,12 @@ public class ItemResourceLocation
this.resource = resource;
}
public CompoundNBT getNBT()
public CompoundTag getNBT()
{
return this.nbt;
}
public void setNBT(CompoundNBT nbt)
public void setNBT(CompoundTag nbt)
{
this.nbt = nbt;
}
@@ -57,13 +57,13 @@ public class ItemResourceLocation
{
int start = input.indexOf("{");
ResourceLocation resource = new ResourceLocation(input.substring(0, start));
CompoundNBT nbt = null;
CompoundTag nbt = null;
if(start > 0)
{
try
{
nbt = JsonToNBT.parseTag(input.substring(start, input.lastIndexOf("}") + 1));
nbt = TagParser.parseTag(input.substring(start, input.lastIndexOf("}") + 1));
}
catch(CommandSyntaxException e)
{