Merge branch 'master' into 1.17
This commit is contained in:
commit
cd6827767a
10 files changed
+42
-38
No files matched your search
+1
-1
@@ -10,7 +10,7 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
fabric_version=0.33.0+1.17
|
fabric_version=0.33.0+1.17
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.4.32
|
mod_version = 1.4.33
|
||||||
maven_group = carpet
|
maven_group = carpet
|
||||||
archives_base_name = fabric-carpet
|
archives_base_name = fabric-carpet
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import static carpet.settings.RuleCategory.CLIENT;
|
|||||||
@SuppressWarnings("CanBeFinal")
|
@SuppressWarnings("CanBeFinal")
|
||||||
public class CarpetSettings
|
public class CarpetSettings
|
||||||
{
|
{
|
||||||
public static final String carpetVersion = "1.4.32+v210414";
|
public static final String carpetVersion = "1.4.33+v210421";
|
||||||
public static final Logger LOG = LogManager.getLogger("carpet");
|
public static final Logger LOG = LogManager.getLogger("carpet");
|
||||||
public static boolean skipGenerationChecks = false;
|
public static boolean skipGenerationChecks = false;
|
||||||
public static boolean impendingFillSkipUpdates = false;
|
public static boolean impendingFillSkipUpdates = false;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class HUDController
|
|||||||
* Adds listener to be called when HUD is updated for logging information
|
* Adds listener to be called when HUD is updated for logging information
|
||||||
* @param listener - a method to be called when new HUD inforation are collected
|
* @param listener - a method to be called when new HUD inforation are collected
|
||||||
*/
|
*/
|
||||||
public void register(Consumer<MinecraftServer> listener)
|
public static void register(Consumer<MinecraftServer> listener)
|
||||||
{
|
{
|
||||||
HUDListeners.add(listener);
|
HUDListeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package carpet.mixins;
|
||||||
|
|
||||||
|
|
||||||
|
import carpet.CarpetSettings;
|
||||||
|
import net.minecraft.entity.boss.WitherEntity;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
@Mixin(WitherEntity.class)
|
||||||
|
public class WitherEntity_extremeMixin
|
||||||
|
{
|
||||||
|
@Redirect(method = "method_6878", at = @At(value = "INVOKE", target = "Ljava/util/Random;nextFloat()F"))
|
||||||
|
private float nextFloatAmplfied(Random random)
|
||||||
|
{
|
||||||
|
if (CarpetSettings.extremeBehaviours) return random.nextFloat()/100;
|
||||||
|
return random.nextFloat();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -528,7 +528,7 @@ public class Auxiliary {
|
|||||||
targets = playerTargets;
|
targets = playerTargets;
|
||||||
res = lv.get(1).evalValue(c);
|
res = lv.get(1).evalValue(c);
|
||||||
}
|
}
|
||||||
Text message = (res instanceof FormattedTextValue)?((FormattedTextValue) res).getText():new LiteralText(res.getString());
|
Text message = FormattedTextValue.getTextByValue(res);
|
||||||
if (targets == null)
|
if (targets == null)
|
||||||
{
|
{
|
||||||
s.sendFeedback(message, false);
|
s.sendFeedback(message, false);
|
||||||
@@ -595,17 +595,9 @@ public class Auxiliary {
|
|||||||
if (lv.size() > 2)
|
if (lv.size() > 2)
|
||||||
{
|
{
|
||||||
pVal = lv.get(2).evalValue(c);
|
pVal = lv.get(2).evalValue(c);
|
||||||
if (pVal instanceof FormattedTextValue)
|
title = FormattedTextValue.getTextByValue(pVal);
|
||||||
{
|
|
||||||
title = ((FormattedTextValue) pVal).getText();
|
|
||||||
soundsTrue = !title.asString().isEmpty();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
title = new LiteralText(pVal.getString());
|
|
||||||
soundsTrue = pVal.getBoolean();
|
soundsTrue = pVal.getBoolean();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else title = null; // Will never happen, just to make lambda happy
|
else title = null; // Will never happen, just to make lambda happy
|
||||||
if (packetGetter == null)
|
if (packetGetter == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ public class Scoreboards {
|
|||||||
return (_c, _t) -> StringValue.of(objective.getCriterion().getName());
|
return (_c, _t) -> StringValue.of(objective.getCriterion().getName());
|
||||||
case "display_name":
|
case "display_name":
|
||||||
if(modify) {
|
if(modify) {
|
||||||
Text text = (setValue instanceof FormattedTextValue)?((FormattedTextValue) setValue).getText():new LiteralText(setValue.getString());
|
Text text = FormattedTextValue.getTextByValue(setValue);
|
||||||
objective.setDisplayName(text);
|
objective.setDisplayName(text);
|
||||||
return LazyValue.TRUE;
|
return LazyValue.TRUE;
|
||||||
}
|
}
|
||||||
@@ -408,11 +408,7 @@ public class Scoreboards {
|
|||||||
|
|
||||||
Text displayName;
|
Text displayName;
|
||||||
|
|
||||||
if(settingVal instanceof FormattedTextValue) {
|
displayName = FormattedTextValue.getTextByValue(settingVal);
|
||||||
displayName = ((FormattedTextValue) settingVal).getText();
|
|
||||||
} else {
|
|
||||||
displayName = new LiteralText(settingVal.getString());
|
|
||||||
}
|
|
||||||
|
|
||||||
team.setDisplayName(displayName);
|
team.setDisplayName(displayName);
|
||||||
|
|
||||||
@@ -451,11 +447,7 @@ public class Scoreboards {
|
|||||||
|
|
||||||
Text prefix;
|
Text prefix;
|
||||||
|
|
||||||
if(settingVal instanceof FormattedTextValue) {
|
prefix = FormattedTextValue.getTextByValue(settingVal);
|
||||||
prefix = ((FormattedTextValue) settingVal).getText();
|
|
||||||
} else {
|
|
||||||
prefix = new LiteralText(settingVal.getString());
|
|
||||||
}
|
|
||||||
|
|
||||||
team.setPrefix(prefix);
|
team.setPrefix(prefix);
|
||||||
break;
|
break;
|
||||||
@@ -481,11 +473,7 @@ public class Scoreboards {
|
|||||||
|
|
||||||
Text suffix;
|
Text suffix;
|
||||||
|
|
||||||
if(settingVal instanceof FormattedTextValue) {
|
suffix = FormattedTextValue.getTextByValue(settingVal);
|
||||||
suffix = ((FormattedTextValue) settingVal).getText();
|
|
||||||
} else {
|
|
||||||
suffix = new LiteralText(settingVal.getString());
|
|
||||||
}
|
|
||||||
|
|
||||||
team.setSuffix(suffix);
|
team.setSuffix(suffix);
|
||||||
break;
|
break;
|
||||||
@@ -547,11 +535,7 @@ public class Scoreboards {
|
|||||||
case "name":
|
case "name":
|
||||||
if(propertyValue == null) return (_c, _t) -> new FormattedTextValue(bossBar.getName());
|
if(propertyValue == null) return (_c, _t) -> new FormattedTextValue(bossBar.getName());
|
||||||
|
|
||||||
if(propertyValue instanceof FormattedTextValue) {
|
bossBar.setName(FormattedTextValue.getTextByValue(propertyValue));
|
||||||
bossBar.setName(((FormattedTextValue) propertyValue).getText());
|
|
||||||
} else {
|
|
||||||
bossBar.setName(new LiteralText(propertyValue.getString()));
|
|
||||||
}
|
|
||||||
return LazyValue.TRUE;
|
return LazyValue.TRUE;
|
||||||
case "add_player":
|
case "add_player":
|
||||||
if(propertyValue == null) throw new InternalExpressionException("Bossbar property " + property + " can't be queried, add a third parameter");
|
if(propertyValue == null) throw new InternalExpressionException("Bossbar property " + property + " can't be queried, add a third parameter");
|
||||||
|
|||||||
@@ -1122,7 +1122,7 @@ public class EntityValue extends Value
|
|||||||
v = ((ListValue) v).getItems().get(0);
|
v = ((ListValue) v).getItems().get(0);
|
||||||
}
|
}
|
||||||
e.setCustomNameVisible(showName);
|
e.setCustomNameVisible(showName);
|
||||||
e.setCustomName(new LiteralText(v.getString()));
|
e.setCustomName(FormattedTextValue.getTextByValue(v));
|
||||||
});
|
});
|
||||||
|
|
||||||
put("persistence", (e, v) ->
|
put("persistence", (e, v) ->
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class FormattedTextValue extends StringValue
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getBoolean() {
|
public boolean getBoolean() {
|
||||||
return text.getSiblings().size() > 0;
|
return !text.asString().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -96,4 +96,8 @@ public class FormattedTextValue extends StringValue
|
|||||||
return new FormattedTextValue(Text.Serializer.fromJson(serialized));
|
return new FormattedTextValue(Text.Serializer.fromJson(serialized));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Text getTextByValue(Value value) {
|
||||||
|
return (value instanceof FormattedTextValue) ? ((FormattedTextValue) value).getText() : new LiteralText(value.getString());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -571,13 +571,14 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
|
|||||||
@Override
|
@Override
|
||||||
public Value get(Value value)
|
public Value get(Value value)
|
||||||
{
|
{
|
||||||
NbtPathArgumentType.NbtPath path = cachePath(value.getString());
|
String valString = value.getString();
|
||||||
|
NbtPathArgumentType.NbtPath path = cachePath(valString);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<NbtElement> tags = path.get(getTag());
|
List<NbtElement> tags = path.get(getTag());
|
||||||
if (tags.size()==0)
|
if (tags.size()==0)
|
||||||
return Value.NULL;
|
return Value.NULL;
|
||||||
if (tags.size()==1)
|
if (tags.size()==1 && !valString.endsWith("[]"))
|
||||||
return NBTSerializableValue.decodeTag(tags.get(0));
|
return NBTSerializableValue.decodeTag(tags.get(0));
|
||||||
return ListValue.wrap(tags.stream().map(NBTSerializableValue::decodeTag).collect(Collectors.toList()));
|
return ListValue.wrap(tags.stream().map(NBTSerializableValue::decodeTag).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,7 @@
|
|||||||
"MobEntity_extremeMixin",
|
"MobEntity_extremeMixin",
|
||||||
"ProjectileEntity_extremeMixin",
|
"ProjectileEntity_extremeMixin",
|
||||||
"Projectile_extremeMixin",
|
"Projectile_extremeMixin",
|
||||||
|
"WitherEntity_extremeMixin",
|
||||||
|
|
||||||
"ArmorStandEntity_scarpetMarkerMixin",
|
"ArmorStandEntity_scarpetMarkerMixin",
|
||||||
"Entity_scarpetEventsMixin",
|
"Entity_scarpetEventsMixin",
|
||||||
|
|||||||
Reference in new issue
Block a user