Update forgegradle and minecraftforge

Switch to official mappings
This commit is contained in:
Marcel Konrad
2021-03-25 23:14:35 +01:00
parent 27b614280b
commit 7498440cd8
72 changed files with 530 additions and 553 deletions

View File

@@ -16,7 +16,7 @@ import net.minecraftforge.registries.ForgeRegistries;
@OnlyIn(Dist.CLIENT)
public abstract class ComponentAttribute implements IBuilderComponent
{
public static final List<Attribute> ATTRIBUTES = ForgeRegistries.ATTRIBUTES.getValues().stream().filter(attribute -> !attribute.getAttributeName().equals(I18n.format(attribute.getAttributeName()))).collect(Collectors.toList());
public static final List<Attribute> ATTRIBUTES = ForgeRegistries.ATTRIBUTES.getValues().stream().filter(attribute -> !attribute.getDescriptionId().equals(I18n.get(attribute.getDescriptionId()))).collect(Collectors.toList());
protected Map<Attribute, Double> attributes = new HashMap<Attribute, Double>();

View File

@@ -31,7 +31,7 @@ public class ComponentAttributeItem extends ComponentAttribute
attribute.putString("AttributeName", id);
attribute.putDouble("Amount", entry.getValue() / 100);
attribute.putInt("Operation", 1); // 0 = additive, 1 = percentage
attribute.putUniqueId("UUID", UUID.nameUUIDFromBytes(id.getBytes()));
attribute.putUUID("UUID", UUID.nameUUIDFromBytes(id.getBytes()));
attributes.add(attribute);
}

View File

@@ -399,7 +399,7 @@ public class EntityNBT implements IBuilderComponent
{
try
{
this.nbt = JsonToNBT.getTagFromJson("{" + nbt + "}");
this.nbt = JsonToNBT.parseTag("{" + nbt + "}");
}
catch(CommandSyntaxException e)
{

View File

@@ -24,7 +24,7 @@ public class BuilderDifficulty extends CommandBuilder
{
if(difficulty != null)
{
this.setNode(0, difficulty.getTranslationKey());
this.setNode(0, difficulty.getKey());
}
}

View File

@@ -423,7 +423,7 @@ public abstract class BuilderEntity extends CommandBuilderNBT
for(EntityType<?> type : ForgeRegistries.ENTITIES.getValues())
{
if(type.isSummonable() && entityName.equalsIgnoreCase(I18n.format(type.getTranslationKey())))
if(type.canSummon() && entityName.equalsIgnoreCase(I18n.get(type.getDescriptionId())))
{
return type.getRegistryName();
}

View File

@@ -27,12 +27,12 @@ public class BuilderNoteEditor extends BuilderSetBlock
{
this(note);
this.setPosition(pos);
this.setState(BlockStateProperties.NOTE_BLOCK_INSTRUMENT, NoteBlockInstrument.byState(Minecraft.getInstance().world.getBlockState(pos.down())));
this.setState(BlockStateProperties.NOTEBLOCK_INSTRUMENT, NoteBlockInstrument.byState(Minecraft.getInstance().level.getBlockState(pos.below())));
}
public void setNote(int note)
{
this.setState(BlockStateProperties.NOTE_0_24, note);
this.setState(BlockStateProperties.NOTE, note);
}
public BuilderNoteEditor build(int note)

View File

@@ -72,7 +72,7 @@ public enum ArgumentType
{
try
{
return JsonToNBT.getTagFromJson(value);
return JsonToNBT.parseTag(value);
}
catch(CommandSyntaxException e)
{

View File

@@ -52,7 +52,7 @@ public class BlockResourceLocation extends ItemResourceLocation
if(resource != null && ForgeRegistries.BLOCKS.containsKey(resource))
{
return ForgeRegistries.BLOCKS.getValue(resource).getDefaultState();
return ForgeRegistries.BLOCKS.getValue(resource).defaultBlockState();
}
return null;
@@ -75,7 +75,7 @@ public class BlockResourceLocation extends ItemResourceLocation
{
if(this.state != null && this.state.hasProperty(property))
{
this.state = this.state.with(property, value);
this.state = this.state.setValue(property, value);
}
}

View File

@@ -63,7 +63,7 @@ public class ItemResourceLocation
{
try
{
nbt = JsonToNBT.getTagFromJson(input.substring(start, input.lastIndexOf("}") + 1));
nbt = JsonToNBT.parseTag(input.substring(start, input.lastIndexOf("}") + 1));
}
catch(CommandSyntaxException e)
{