mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 07:27:15 +01:00
Merge remote-tracking branch 'origin/mc1.16/dev' into mc1.16/dev
This commit is contained in:
commit
0c5fb3de3e
5 changed files with 20 additions and 17 deletions
|
@ -36,7 +36,7 @@ public class HarvesterRenderer extends SafeTileEntityRenderer<HarvesterTileEntit
|
|||
BlockState blockState = te.getBlockState();
|
||||
SuperByteBuffer superBuffer = PartialBufferer.get(AllBlockPartials.HARVESTER_BLADE, blockState);
|
||||
transform(te.getWorld(), blockState.get(HarvesterBlock.HORIZONTAL_FACING), superBuffer,
|
||||
te.manuallyAnimatedSpeed);
|
||||
te.getAnimatedSpeed());
|
||||
superBuffer.light(light)
|
||||
.renderInto(ms, buffer.getBuffer(RenderType.getCutoutMipped()));
|
||||
}
|
||||
|
|
|
@ -3,15 +3,27 @@ package com.simibubi.create.content.contraptions.components.actors;
|
|||
import com.simibubi.create.foundation.tileEntity.SyncedTileEntity;
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
|
||||
public class HarvesterTileEntity extends SyncedTileEntity {
|
||||
|
||||
private static final AxisAlignedBB RENDER_BOX = new AxisAlignedBB(0, 0, 0, 1, 1, 1);
|
||||
|
||||
// For simulations such as Ponder
|
||||
private float manuallyAnimatedSpeed;
|
||||
|
||||
public HarvesterTileEntity(TileEntityType<? extends HarvesterTileEntity> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
// For simulations such as Ponder
|
||||
float manuallyAnimatedSpeed;
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return RENDER_BOX.offset(pos);
|
||||
}
|
||||
|
||||
public float getAnimatedSpeed() {
|
||||
return manuallyAnimatedSpeed;
|
||||
}
|
||||
|
||||
public void setAnimatedSpeed(float speed) {
|
||||
manuallyAnimatedSpeed = speed;
|
||||
|
|
|
@ -26,7 +26,7 @@ public interface IDisplayAssemblyExceptions {
|
|||
|
||||
tooltip.add(IHaveGoggleInformation.componentSpacing.copy().append(Lang.translate("gui.assembly.exception").formatted(TextFormatting.GOLD)));
|
||||
|
||||
String text = TooltipHelper.getUnformattedDeepText(e.component);
|
||||
String text = e.component.getString();
|
||||
Arrays.stream(text.split("\n"))
|
||||
.forEach(l -> TooltipHelper.cutStringTextComponent(l, GRAY, WHITE)
|
||||
.forEach(c -> tooltip.add(IHaveGoggleInformation.componentSpacing.copy().append(c))));
|
||||
|
@ -35,4 +35,5 @@ public interface IDisplayAssemblyExceptions {
|
|||
}
|
||||
|
||||
AssemblyException getLastAssemblyException();
|
||||
|
||||
}
|
||||
|
|
|
@ -212,10 +212,8 @@ public class ItemDescription {
|
|||
boolean hasControls = !linesOnCtrl.isEmpty();
|
||||
|
||||
if (hasDescription || hasControls) {
|
||||
String[] holdDesc = TooltipHelper.getUnformattedDeepText(Lang.translate("tooltip.holdForDescription", "$"))
|
||||
.split("\\$");
|
||||
String[] holdCtrl = TooltipHelper.getUnformattedDeepText(Lang.translate("tooltip.holdForControls", "$"))
|
||||
.split("\\$");
|
||||
String[] holdDesc = Lang.translate("tooltip.holdForDescription", "$").getString().split("\\$");
|
||||
String[] holdCtrl = Lang.translate("tooltip.holdForControls", "$").getString().split("\\$");
|
||||
IFormattableTextComponent keyShift = Lang.translate("tooltip.keyShift");
|
||||
IFormattableTextComponent keyCtrl = Lang.translate("tooltip.keyCtrl");
|
||||
for (List<ITextComponent> list : Arrays.asList(lines, linesOnShift, linesOnCtrl)) {
|
||||
|
|
|
@ -124,7 +124,7 @@ public class TooltipHelper {
|
|||
|
||||
public static List<ITextComponent> cutTextComponent(ITextComponent c, TextFormatting defaultColor,
|
||||
TextFormatting highlightColor, int indent) {
|
||||
String s = getUnformattedDeepText(c);
|
||||
String s = c.getString();
|
||||
|
||||
// Apply markup
|
||||
String markedUp = s;// .replaceAll("_([^_]+)_", highlightColor + "$1" + defaultColor);
|
||||
|
@ -330,12 +330,4 @@ public class TooltipHelper {
|
|||
// return l.get();
|
||||
// }
|
||||
|
||||
public static String getUnformattedDeepText(ITextComponent component) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
b.append(component.getString());
|
||||
component.getSiblings()
|
||||
.forEach(c -> b.append(getUnformattedDeepText(c)));
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue