Merge branch 'master' into 1.16

This commit is contained in:
gnembon committed 2020-07-27 04:43:09 -03:00
commit b4581ca0c8
1 file changed
+20 -1
@@ -150,7 +150,7 @@ public class ShapesRenderer
RenderedShape<?> existing = shapes.computeIfAbsent(dim, d -> new Long2ObjectOpenHashMap<>()).get(key);
if (existing != null)
{ // promoting previous shape
existing.expiryTick = rshape.expiryTick;
existing.promoteWith(rshape);
}
else
{
@@ -204,6 +204,11 @@ public class ShapesRenderer
{
return false;
}
public void promoteWith(RenderedShape<?> rshape)
{
expiryTick = rshape.expiryTick;
}
}
public static class RenderedText extends RenderedShape<ShapeDispatcher.DisplayedText>
@@ -293,6 +298,20 @@ public class ShapesRenderer
{
return true;
}
@Override
public void promoteWith(RenderedShape<?> rshape)
{
super.promoteWith(rshape);
try
{
this.shape.value = ((ShapeDispatcher.Text) rshape.shape).value;
}
catch (ClassCastException ignored)
{
CarpetSettings.LOG.error("shape "+rshape.shape.getClass()+" cannot cast to a Label");
}
}
}
public static class RenderedBox extends RenderedShape<ShapeDispatcher.Box>