Port Changes to 1.16, Fix server launch

This commit is contained in:
simibubi 2020-10-12 22:16:06 +02:00
parent cbeb5dc649
commit 442d89e09e
32 changed files with 74 additions and 47 deletions

View file

@ -1,5 +1,5 @@
{
"parent": "item/generated",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "create:item/cinder_flour"
}

View file

@ -36,7 +36,6 @@ import mezz.jei.api.IModPlugin;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.ingredients.IIngredientType;
import mezz.jei.api.registration.IGuiHandlerRegistration;
import mezz.jei.api.registration.IModIngredientRegistration;
import mezz.jei.api.registration.IRecipeCatalystRegistration;
import mezz.jei.api.registration.IRecipeCategoryRegistration;
import mezz.jei.api.registration.IRecipeRegistration;

View file

@ -4,10 +4,9 @@ import java.util.function.Supplier;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import com.simibubi.create.foundation.gui.GuiGameElement;
import mezz.jei.api.gui.drawable.IDrawable;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.item.ItemStack;

View file

@ -4,9 +4,9 @@ import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import com.mojang.blaze3d.matrix.MatrixStack;
import org.apache.commons.lang3.mutable.MutableInt;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.content.contraptions.processing.BasinRecipe;
import com.simibubi.create.content.contraptions.processing.HeatCondition;
import com.simibubi.create.foundation.fluid.FluidIngredient;

View file

@ -8,8 +8,8 @@ import com.simibubi.create.AllItems;
import com.simibubi.create.content.contraptions.processing.ProcessingOutput;
import com.simibubi.create.content.curiosities.tools.SandPaperPolishingRecipe;
import com.simibubi.create.foundation.gui.AllGuiTextures;
import com.simibubi.create.foundation.gui.GuiGameElement;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;

View file

@ -2,6 +2,8 @@ package com.simibubi.create.compat.jei.category;
import java.util.Arrays;
import javax.annotation.Nullable;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks;
@ -17,8 +19,6 @@ import mezz.jei.api.ingredients.IIngredients;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.math.vector.Vector3f;
import javax.annotation.Nullable;
public abstract class ProcessingViaFanCategory<T extends IRecipe<?>> extends CreateRecipeCategory<T> {
public ProcessingViaFanCategory(String name, IDrawable icon) {

View file

@ -71,8 +71,8 @@ public abstract class GeneratingKineticTileEntity extends KineticTileEntity {
// FIXME add colours back
// String stressString = spacing + "%s" + Lang.translate("generic.unit.stress").getUnformattedComponentText() + " %s";
// tooltip.add(ITextComponent.of(String.format(stressString, IHaveGoggleInformation.format(stressBase), Lang.translate("gui.goggles.base_value").getUnformattedComponentText())));
// tooltip.add(ITextComponent.of(String.format(stressString, IHaveGoggleInformation.format(stressTotal), Lang.translate("gui.goggles.at_current_speed").getUnformattedComponentText())));
// tooltip.add(new StringTextComponent(String.format(stressString, IHaveGoggleInformation.format(stressBase), Lang.translate("gui.goggles.base_value").getUnformattedComponentText())));
// tooltip.add(new StringTextComponent(String.format(stressString, IHaveGoggleInformation.format(stressTotal), Lang.translate("gui.goggles.at_current_speed").getUnformattedComponentText())));
tooltip.add(componentSpacing.copy().append(new StringTextComponent(IHaveGoggleInformation.format(stressBase))
.append(Lang.translate("generic.unit.stress")).append(" ").formatted(TextFormatting.AQUA)).append(Lang.translate("gui.goggles.base_value").formatted(TextFormatting.DARK_GRAY)));
tooltip.add(componentSpacing.copy().append(new StringTextComponent(IHaveGoggleInformation.format(stressTotal))

View file

@ -1,7 +1,6 @@
package com.simibubi.create.content.contraptions.components.actors.dispenser;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.DispenserBlock;
import net.minecraft.entity.item.ItemEntity;

View file

@ -10,7 +10,6 @@ import com.simibubi.create.foundation.advancement.AllTriggers;
import com.simibubi.create.foundation.advancement.ITriggerable;
import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.item.SmartInventory;
import com.simibubi.create.foundation.utility.BlockHelper;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
@ -26,7 +25,6 @@ import net.minecraft.util.Direction.Axis;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraftforge.fluids.FluidStack;
public class MechanicalMixerTileEntity extends BasinOperatingTileEntity {

View file

@ -34,7 +34,6 @@ import net.minecraft.block.material.PushReaction;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.item.BoatEntity;
import net.minecraft.entity.item.HangingEntity;
import net.minecraft.entity.item.minecart.AbstractMinecartEntity;
import net.minecraft.entity.item.minecart.FurnaceMinecartEntity;

View file

@ -8,8 +8,6 @@ import java.util.UUID;
import javax.annotation.Nullable;
import com.simibubi.create.foundation.utility.NBTHelper;
import net.minecraft.util.math.vector.Vector3d;
import org.apache.commons.lang3.mutable.MutableBoolean;
import com.simibubi.create.Create;
@ -18,12 +16,14 @@ import com.simibubi.create.content.contraptions.components.structureMovement.tra
import com.simibubi.create.foundation.networking.AllPackets;
import com.simibubi.create.foundation.utility.Couple;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.NBTHelper;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.minecart.AbstractMinecartEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.common.util.INBTSerializable;

View file

@ -23,7 +23,7 @@ public class GoggleConfigScreen extends AbstractSimiScreen {
private final List<ITextComponent> tooltip;
public GoggleConfigScreen() {
ITextComponent componentSpacing = ITextComponent.of(" ");
ITextComponent componentSpacing = new StringTextComponent(" ");
tooltip = new ArrayList<>();
tooltip.add(componentSpacing.copy().append(Lang.translate("gui.config.overlay1")));
tooltip.add(componentSpacing.copy().append(Lang.translate("gui.config.overlay2").formatted(TextFormatting.GRAY)));

View file

@ -4,6 +4,7 @@ import java.text.DecimalFormat;
import java.util.List;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
/*
* Implement this Interface in the TileEntity class that wants to add info to the screen
@ -12,7 +13,7 @@ public interface IHaveGoggleInformation {
DecimalFormat decimalFormat = new DecimalFormat("#.##");
String spacing = " ";
ITextComponent componentSpacing = ITextComponent.of(spacing);
ITextComponent componentSpacing = new StringTextComponent(spacing);
/**
* this method will be called when looking at a TileEntity that implemented this interface

View file

@ -9,7 +9,7 @@ import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.ProjectileImpactEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
@ -35,7 +35,7 @@ public class BlazeBurnerHandler {
event.setCanceled(true);
event.getThrowable()
.setMotion(Vec3d.ZERO);
.setMotion(Vector3d.ZERO);
event.getThrowable()
.remove();

View file

@ -6,6 +6,7 @@ import java.util.List;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
public enum InstructionSpeedModifiers {
@ -23,7 +24,7 @@ public enum InstructionSpeedModifiers {
value = modifier;
}
private InstructionSpeedModifiers(int modifier, String label) {
this.label = ITextComponent.of(label);
this.label = new StringTextComponent(label);
translationKey = "gui.sequenced_gearshift.speed." + Lang.asId(name());
value = modifier;
}

View file

@ -19,6 +19,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.ListNBT;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
public class SequencedGearshiftScreen extends AbstractSimiScreen {
@ -142,7 +143,7 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
if (def.hasValueParameter) {
String text = def.formatValue(instruction.value);
int stringWidth = textRenderer.getStringWidth(text);
label(matrixStack, 90 + (12 - stringWidth / 2), yOffset - 3, ITextComponent.of(text));
label(matrixStack, 90 + (12 - stringWidth / 2), yOffset - 3, new StringTextComponent(text));
}
if (def.hasSpeedParameter)
label(matrixStack, 127, yOffset - 3, instruction.speedModifier.label);

View file

@ -71,7 +71,7 @@ public class StressGaugeTileEntity extends GaugeTileEntity {
if (getTheoreticalSpeed() == 0)
tooltip.add(new StringTextComponent(ItemDescription.makeProgressBar(3, -1)).append(Lang.translate("gui.stressometer.no_rotation")).formatted(TextFormatting.DARK_GRAY));
// tooltip.add(ITextComponent.of(TextFormatting.DARK_GRAY + ItemDescription.makeProgressBar(3, -1)
// tooltip.add(new StringTextComponent(TextFormatting.DARK_GRAY + ItemDescription.makeProgressBar(3, -1)
// + Lang.translate("gui.stressometer.no_rotation")));
else {
tooltip.add(componentSpacing.copy().append(StressImpact.getFormattedStressText(stressFraction)));

View file

@ -15,7 +15,6 @@ import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.util.math.vector.Vector3f;
public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {

View file

@ -3,18 +3,18 @@ package com.simibubi.create.content.logistics.block.redstone;
import java.util.List;
import java.util.Optional;
import com.simibubi.create.foundation.item.TooltipHelper;
import net.minecraft.block.BlockState;
import javax.annotation.Nullable;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.simibubi.create.foundation.item.TooltipHelper;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.utility.Couple;
import com.simibubi.create.foundation.utility.Pair;
import net.minecraft.block.BlockState;
import net.minecraft.command.CommandSource;
import net.minecraft.command.ICommandSource;
import net.minecraft.entity.Entity;

View file

@ -58,7 +58,7 @@ public class StockpileSwitchScreen extends AbstractSimiScreen {
offBelow = new ScrollInput(guiLeft + 113, guiTop + 69, 33, 14).withRange(0, 96)
.titled(lowerLimit)
.calling(state -> {
offBelowLabel.text = ITextComponent.of(state + "%");
offBelowLabel.text = new StringTextComponent(state + "%");
lastModification = 0;
if (onAbove.getState() - 4 <= state) {
onAbove.setState(state + 5);
@ -72,7 +72,7 @@ public class StockpileSwitchScreen extends AbstractSimiScreen {
onAbove = new ScrollInput(guiLeft + 113, guiTop + 52, 33, 14).withRange(5, 101)
.titled(upperLimit)
.calling(state -> {
onAboveLabel.text = ITextComponent.of(state + "%");
onAboveLabel.text = new StringTextComponent(state + "%");
lastModification = 0;
if (offBelow.getState() + 4 >= state) {
offBelow.setState(state - 5);

View file

@ -74,7 +74,7 @@ public class FilterItem extends Item implements INamedContainerProvider {
List<ITextComponent> makeSummary = makeSummary(stack);
if (makeSummary.isEmpty())
return;
ItemDescription.add(tooltip, ITextComponent.of(" "));
ItemDescription.add(tooltip, new StringTextComponent(" "));
ItemDescription.add(tooltip, makeSummary);
}
}

View file

@ -137,7 +137,7 @@ public class ClientSchematicLoader {
if (Files.isDirectory(path))
return;
availableSchematics.add(ITextComponent.of(path.getFileName().toString()));
availableSchematics.add(new StringTextComponent(path.getFileName().toString()));
});
} catch (NoSuchFileException e) {
// No Schematics created yet

View file

@ -149,7 +149,7 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen<SchematicT
if (schematicsLabel != null) {
schematicsLabel.colored(0xCCDDFF);
schematicsLabel.text = ITextComponent.of(container.getTileEntity().uploadingSchematic);
schematicsLabel.text = new StringTextComponent(container.getTileEntity().uploadingSchematic);
}
if (schematicsArea != null)
schematicsArea.visible = false;

View file

@ -1,5 +1,7 @@
package com.simibubi.create.content.schematics.block;
import static net.minecraft.util.text.TextFormatting.BLUE;
import static net.minecraft.util.text.TextFormatting.DARK_PURPLE;
import static net.minecraft.util.text.TextFormatting.GRAY;
import java.util.ArrayList;
@ -23,6 +25,7 @@ import com.simibubi.create.foundation.item.ItemDescription.Palette;
import com.simibubi.create.foundation.item.TooltipHelper;
import com.simibubi.create.foundation.networking.AllPackets;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.widget.Widget;
import net.minecraft.client.renderer.Rectangle2d;
@ -32,8 +35,6 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import static net.minecraft.util.text.TextFormatting.*;
public class SchematicannonScreen extends AbstractSimiContainerScreen<SchematicannonContainer> {
private static final AllGuiTextures BG_BOTTOM = AllGuiTextures.SCHEMATICANNON_BOTTOM;

View file

@ -1,6 +1,5 @@
package com.simibubi.create.content.schematics.client;
import com.simibubi.create.foundation.gui.GuiGameElement;
import org.lwjgl.glfw.GLFW;
import com.mojang.blaze3d.matrix.MatrixStack;
@ -9,6 +8,7 @@ import com.simibubi.create.CreateClient;
import com.simibubi.create.foundation.gui.AbstractSimiScreen;
import com.simibubi.create.foundation.gui.AllGuiTextures;
import com.simibubi.create.foundation.gui.AllIcons;
import com.simibubi.create.foundation.gui.GuiGameElement;
import com.simibubi.create.foundation.gui.widgets.IconButton;
import com.simibubi.create.foundation.utility.Lang;

View file

@ -21,7 +21,13 @@ import net.minecraft.block.Blocks;
import net.minecraft.block.FireBlock;
import net.minecraft.block.FlowingFluidBlock;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.Atlases;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.RenderTypeLookup;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.AtlasTexture;

View file

@ -19,7 +19,7 @@ public class Label extends AbstractSimiWidget {
public Label(int x, int y, ITextComponent text) {
super(x, y, Minecraft.getInstance().fontRenderer.getWidth(text), 10);
font = Minecraft.getInstance().fontRenderer;
this.text = ITextComponent.of("Label");
this.text = new StringTextComponent("Label");
color = 0xFFFFFF;
hasShadow = false;
suffix = "";

View file

@ -9,6 +9,7 @@ import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.util.text.IFormattableTextComponent;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
public class ScrollInput extends AbstractSimiWidget {
@ -131,7 +132,7 @@ public class ScrollInput extends AbstractSimiWidget {
}
protected void writeToLabel() {
displayLabel.text = ITextComponent.of(String.valueOf(state));
displayLabel.text = new StringTextComponent(String.valueOf(state));
}
protected void updateTooltip() {

View file

@ -1,7 +1,22 @@
package com.simibubi.create.foundation.item;
import static com.simibubi.create.foundation.item.TooltipHelper.*;
import static net.minecraft.util.text.TextFormatting.*;
import static com.simibubi.create.foundation.item.TooltipHelper.cutStringTextComponent;
import static com.simibubi.create.foundation.item.TooltipHelper.cutTextComponent;
import static net.minecraft.util.text.TextFormatting.AQUA;
import static net.minecraft.util.text.TextFormatting.BLUE;
import static net.minecraft.util.text.TextFormatting.DARK_GRAY;
import static net.minecraft.util.text.TextFormatting.DARK_GREEN;
import static net.minecraft.util.text.TextFormatting.DARK_PURPLE;
import static net.minecraft.util.text.TextFormatting.DARK_RED;
import static net.minecraft.util.text.TextFormatting.GOLD;
import static net.minecraft.util.text.TextFormatting.GRAY;
import static net.minecraft.util.text.TextFormatting.GREEN;
import static net.minecraft.util.text.TextFormatting.ITALIC;
import static net.minecraft.util.text.TextFormatting.LIGHT_PURPLE;
import static net.minecraft.util.text.TextFormatting.RED;
import static net.minecraft.util.text.TextFormatting.STRIKETHROUGH;
import static net.minecraft.util.text.TextFormatting.WHITE;
import static net.minecraft.util.text.TextFormatting.YELLOW;
import java.util.ArrayList;
import java.util.Arrays;

View file

@ -2,7 +2,10 @@ package com.simibubi.create.foundation.item;
import static net.minecraft.util.text.TextFormatting.DARK_GRAY;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import com.mojang.bridge.game.Language;
@ -23,7 +26,12 @@ import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.TieredItem;
import net.minecraft.util.text.*;
import net.minecraft.util.text.IFormattableTextComponent;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TextProcessing;
public class TooltipHelper {
@ -84,7 +92,7 @@ public class TooltipHelper {
}
public static List<ITextComponent> cutStringTextComponent(String c, TextFormatting defaultColor, TextFormatting highlightColor) {
return cutTextComponent(ITextComponent.of(c), defaultColor, highlightColor, 0);
return cutTextComponent(new StringTextComponent(c), defaultColor, highlightColor, 0);
}
public static List<ITextComponent> cutTextComponent(ITextComponent c, TextFormatting defaultColor, TextFormatting highlightColor) {
@ -93,7 +101,7 @@ public class TooltipHelper {
public static List<ITextComponent> cutStringTextComponent(String c, TextFormatting defaultColor, TextFormatting highlightColor,
int indent) {
return cutTextComponent(ITextComponent.of(c), defaultColor, highlightColor, indent);
return cutTextComponent(new StringTextComponent(c), defaultColor, highlightColor, indent);
}
public static List<ITextComponent> cutTextComponent(ITextComponent c, TextFormatting defaultColor, TextFormatting highlightColor,
@ -194,7 +202,7 @@ public class TooltipHelper {
// Summary
if (I18n.hasKey(summaryKey))
tooltip = tooltip.withSummary(ITextComponent.of(I18n.format(summaryKey)));
tooltip = tooltip.withSummary(new StringTextComponent(I18n.format(summaryKey)));
// Requirements
if (stack.getItem() instanceof BlockItem) {

View file

@ -136,7 +136,7 @@ public class ValueBox extends ChasingAABBOutline {
public void renderContents(MatrixStack ms, IRenderTypeBuffer buffer) {
super.renderContents(ms, buffer);
FontRenderer font = Minecraft.getInstance().fontRenderer;
ITextComponent countString = ITextComponent.of(count == 0 ? "*" : count + "");
ITextComponent countString = new StringTextComponent(count == 0 ? "*" : count + "");
ms.translate(17.5f, -5f, 7f);
boolean isFilter = stack.getItem() instanceof FilterItem;

View file

@ -5,6 +5,8 @@ import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.FloatNBT;
@ -12,8 +14,6 @@ import net.minecraft.nbt.INBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.util.math.AxisAlignedBB;
import javax.annotation.Nonnull;
public class NBTHelper {
public static void putMarker(CompoundNBT nbt, String marker) {