Merge remote-tracking branch 'origin/mc1.16/dev' into mc1.16/dev

This commit is contained in:
grimmauld 2020-10-14 16:37:27 +02:00
commit 277e4ea9d1
34 changed files with 189 additions and 3406 deletions

File diff suppressed because it is too large Load diff

View file

@ -548,7 +548,7 @@
"create.recipe.pressing": "Pressing",
"create.recipe.mixing": "Mixing",
"create.recipe.packing": "Compacting",
"create.recipe.mechanical_sawing": "Sawing",
"create.recipe.sawing": "Sawing",
"create.recipe.mechanical_crafting": "Mechanical Crafting",
"create.recipe.block_cutting": "Block Cutting",
"create.recipe.blockzapper_upgrade": "Handheld Blockzapper",
@ -571,6 +571,8 @@
"create.generic.unit.rpm": "RPM",
"create.generic.unit.stress": "su",
"create.generic.unit.degrees": "°",
"create.generic.unit.bucket": "1 Bucket",
"create.generic.unit.millibuckets": "%1$smB",
"create.action.scroll": "Scroll",
"create.action.confirm": "Confirm",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 859",
"_": "Missing Localizations: 861",
"_": "->------------------------] Game Elements [------------------------<-",
@ -549,7 +549,7 @@
"create.recipe.pressing": "Mechanische Presse",
"create.recipe.mixing": "UNLOCALIZED: Mixing",
"create.recipe.packing": "UNLOCALIZED: Compacting",
"create.recipe.mechanical_sawing": "UNLOCALIZED: Sawing",
"create.recipe.sawing": "UNLOCALIZED: Sawing",
"create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting",
"create.recipe.block_cutting": "UNLOCALIZED: Block Cutting",
"create.recipe.blockzapper_upgrade": "Blockpistole",
@ -572,6 +572,8 @@
"create.generic.unit.rpm": "UNLOCALIZED: RPM",
"create.generic.unit.stress": "UNLOCALIZED: su",
"create.generic.unit.degrees": "UNLOCALIZED: °",
"create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket",
"create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB",
"create.action.scroll": "Wechseln",
"create.action.confirm": "Bestätigen",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 483",
"_": "Missing Localizations: 486",
"_": "->------------------------] Game Elements [------------------------<-",
@ -549,7 +549,7 @@
"create.recipe.pressing": "Pressage",
"create.recipe.mixing": "Mixage",
"create.recipe.packing": "Compactage",
"create.recipe.mechanical_sawing": "Sciage",
"create.recipe.sawing": "UNLOCALIZED: Sawing",
"create.recipe.mechanical_crafting": "Fabrication mécanique",
"create.recipe.block_cutting": "Coupe de bloc",
"create.recipe.blockzapper_upgrade": "Blockzappeur portable",
@ -572,6 +572,8 @@
"create.generic.unit.rpm": "tr/min",
"create.generic.unit.stress": "us",
"create.generic.unit.degrees": "°",
"create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket",
"create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB",
"create.action.scroll": "Faire défiler",
"create.action.confirm": "Confirmer",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 467",
"_": "Missing Localizations: 470",
"_": "->------------------------] Game Elements [------------------------<-",
@ -549,7 +549,7 @@
"create.recipe.pressing": "Pressatura",
"create.recipe.mixing": "Mescolamento",
"create.recipe.packing": "Compattazione",
"create.recipe.mechanical_sawing": "Segagione",
"create.recipe.sawing": "UNLOCALIZED: Sawing",
"create.recipe.mechanical_crafting": "Creazione Meccanico",
"create.recipe.block_cutting": "Taglio Blocco",
"create.recipe.blockzapper_upgrade": "UNLOCALIZED: Handheld Blockzapper",
@ -572,6 +572,8 @@
"create.generic.unit.rpm": "RPM",
"create.generic.unit.stress": "su",
"create.generic.unit.degrees": "°",
"create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket",
"create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB",
"create.action.scroll": "Scorri",
"create.action.confirm": "Conferma",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 462",
"_": "Missing Localizations: 465",
"_": "->------------------------] Game Elements [------------------------<-",
@ -549,7 +549,7 @@
"create.recipe.pressing": "押しつぶし",
"create.recipe.mixing": "混合",
"create.recipe.packing": "圧縮",
"create.recipe.mechanical_sawing": "製材",
"create.recipe.sawing": "UNLOCALIZED: Sawing",
"create.recipe.mechanical_crafting": "メカニカルクラフト",
"create.recipe.block_cutting": "ブロックカット",
"create.recipe.blockzapper_upgrade": "携帯型ブロックザッパー",
@ -572,6 +572,8 @@
"create.generic.unit.rpm": "RPM",
"create.generic.unit.stress": "su",
"create.generic.unit.degrees": "°",
"create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket",
"create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB",
"create.action.scroll": "スクロール",
"create.action.confirm": "確認",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 467",
"_": "Missing Localizations: 470",
"_": "->------------------------] Game Elements [------------------------<-",
@ -549,7 +549,7 @@
"create.recipe.pressing": "압착",
"create.recipe.mixing": "혼합",
"create.recipe.packing": "압축",
"create.recipe.mechanical_sawing": "제재",
"create.recipe.sawing": "UNLOCALIZED: Sawing",
"create.recipe.mechanical_crafting": "기계 조합",
"create.recipe.block_cutting": "블럭 절단",
"create.recipe.blockzapper_upgrade": "UNLOCALIZED: Handheld Blockzapper",
@ -572,6 +572,8 @@
"create.generic.unit.rpm": "RPM",
"create.generic.unit.stress": "su",
"create.generic.unit.degrees": "°",
"create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket",
"create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB",
"create.action.scroll": "스크롤하세요",
"create.action.confirm": "확인",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 797",
"_": "Missing Localizations: 800",
"_": "->------------------------] Game Elements [------------------------<-",
@ -549,7 +549,7 @@
"create.recipe.pressing": "Persen",
"create.recipe.mixing": "Mengen",
"create.recipe.packing": "Compressen",
"create.recipe.mechanical_sawing": "Zagen",
"create.recipe.sawing": "UNLOCALIZED: Sawing",
"create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting",
"create.recipe.block_cutting": "Blok Zagen",
"create.recipe.blockzapper_upgrade": "Blokzapper",
@ -572,6 +572,8 @@
"create.generic.unit.rpm": "UNLOCALIZED: RPM",
"create.generic.unit.stress": "UNLOCALIZED: su",
"create.generic.unit.degrees": "UNLOCALIZED: °",
"create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket",
"create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB",
"create.action.scroll": "Scroll",
"create.action.confirm": "Bevestigen",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 866",
"_": "Missing Localizations: 868",
"_": "->------------------------] Game Elements [------------------------<-",
@ -549,7 +549,7 @@
"create.recipe.pressing": "Prensa Mecânica",
"create.recipe.mixing": "UNLOCALIZED: Mixing",
"create.recipe.packing": "UNLOCALIZED: Compacting",
"create.recipe.mechanical_sawing": "UNLOCALIZED: Sawing",
"create.recipe.sawing": "UNLOCALIZED: Sawing",
"create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting",
"create.recipe.block_cutting": "UNLOCALIZED: Block Cutting",
"create.recipe.blockzapper_upgrade": "Blockzapper Portátil",
@ -572,6 +572,8 @@
"create.generic.unit.rpm": "UNLOCALIZED: RPM",
"create.generic.unit.stress": "UNLOCALIZED: su",
"create.generic.unit.degrees": "UNLOCALIZED: °",
"create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket",
"create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB",
"create.action.scroll": "Rolar",
"create.action.confirm": "Confirmar",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 860",
"_": "Missing Localizations: 862",
"_": "->------------------------] Game Elements [------------------------<-",
@ -549,7 +549,7 @@
"create.recipe.pressing": "Механический пресс",
"create.recipe.mixing": "UNLOCALIZED: Mixing",
"create.recipe.packing": "UNLOCALIZED: Compacting",
"create.recipe.mechanical_sawing": "UNLOCALIZED: Sawing",
"create.recipe.sawing": "UNLOCALIZED: Sawing",
"create.recipe.mechanical_crafting": "UNLOCALIZED: Mechanical Crafting",
"create.recipe.block_cutting": "UNLOCALIZED: Block Cutting",
"create.recipe.blockzapper_upgrade": "Портативный размещатель блоков",
@ -572,6 +572,8 @@
"create.generic.unit.rpm": "UNLOCALIZED: RPM",
"create.generic.unit.stress": "UNLOCALIZED: su",
"create.generic.unit.degrees": "UNLOCALIZED: °",
"create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket",
"create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB",
"create.action.scroll": "КолМыши",
"create.action.confirm": "Подтвердить",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 147",
"_": "Missing Localizations: 150",
"_": "->------------------------] Game Elements [------------------------<-",
@ -549,7 +549,7 @@
"create.recipe.pressing": "金属压片",
"create.recipe.mixing": "混合搅拌",
"create.recipe.packing": "压块塑形",
"create.recipe.mechanical_sawing": "木材切割",
"create.recipe.sawing": "UNLOCALIZED: Sawing",
"create.recipe.mechanical_crafting": "自动合成",
"create.recipe.block_cutting": "方块切割",
"create.recipe.blockzapper_upgrade": "UNLOCALIZED: Handheld Blockzapper",
@ -572,6 +572,8 @@
"create.generic.unit.rpm": "RPM",
"create.generic.unit.stress": "su",
"create.generic.unit.degrees": "°",
"create.generic.unit.bucket": "UNLOCALIZED: 1 Bucket",
"create.generic.unit.millibuckets": "UNLOCALIZED: %1$smB",
"create.action.scroll": "滚轮",
"create.action.confirm": "确认",

View file

@ -45,9 +45,8 @@ public enum AllKeys {
return keybind.isKeyDown();
}
// TODO this should return ITextComponent
public String getBoundKey() {
return keybind.getBoundKeyLocalizedText().getUnformattedComponentText().toUpperCase();
return keybind.getBoundKeyLocalizedText().getString().toUpperCase();
}
public int getBoundCode() {

View file

@ -46,16 +46,14 @@ public class DoubleItemIcon implements IDrawable {
matrixStack.translate(xOffset, yOffset, 0);
matrixStack.push();
matrixStack.translate(1, 1, 0);
GuiGameElement.GuiItemRenderBuilder.renderItemIntoGUI(matrixStack, primaryStack);
// Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(primaryStack, 0, 0);
matrixStack.translate(1, 17, 0);
GuiGameElement.of(primaryStack).render(matrixStack);
matrixStack.pop();
matrixStack.push();
matrixStack.translate(10, 10, 100);
matrixStack.translate(10, 19, 100);
matrixStack.scale(.5f, .5f, .5f);
GuiGameElement.GuiItemRenderBuilder.renderItemIntoGUI(matrixStack, secondaryStack);
// Minecraft.getInstance().getItemRenderer().renderItemIntoGUI(secondaryStack, 0, 0);
GuiGameElement.of(secondaryStack).render(matrixStack);
matrixStack.pop();
matrixStack.pop();

View file

@ -6,6 +6,7 @@ import java.util.stream.Collectors;
import org.apache.commons.lang3.mutable.MutableInt;
import com.google.common.collect.ImmutableList;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.content.contraptions.processing.BasinRecipe;
import com.simibubi.create.content.contraptions.processing.HeatCondition;
@ -109,6 +110,8 @@ public class BasinCategory extends CreateRecipeCategory<BasinRecipe> {
fluidStacks.init(j, false, 142, 51 + yOffset);
fluidStacks.set(j, fluidOutput);
}
addFluidTooltip(fluidStacks, fluidIngredients, ImmutableList.of(fluidOutput));
}
@Override
@ -119,6 +122,7 @@ public class BasinCategory extends CreateRecipeCategory<BasinRecipe> {
int xOffset = size < 3 ? (3 - size) * 19 / 2 : 0;
HeatCondition requiredHeat = recipe.getRequiredHeat();
int yOffset = requiredHeat != HeatCondition.NONE ? 30 : 10;
for (int i = 0; i < size; i++)
AllGuiTextures.JEI_SLOT.draw(matrixStack, 16 + xOffset + (i % 3) * 19, 50 - (i / 3) * 19 + yOffset);
@ -126,5 +130,5 @@ public class BasinCategory extends CreateRecipeCategory<BasinRecipe> {
AllGuiTextures.JEI_DOWN_ARROW.draw(matrixStack, 136, 32 + yOffset);
AllGuiTextures.JEI_SHADOW.draw(matrixStack, 81, 57 + yOffset);
}
}

View file

@ -1,24 +1,29 @@
package com.simibubi.create.compat.jei.category;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.simibubi.create.Create;
import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.content.contraptions.processing.ProcessingOutput;
import com.simibubi.create.content.contraptions.processing.ProcessingRecipe;
import com.simibubi.create.foundation.fluid.FluidIngredient;
import com.simibubi.create.foundation.gui.AllGuiTextures;
import com.simibubi.create.foundation.utility.Lang;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.ingredient.IGuiFluidStackGroup;
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
import mezz.jei.api.recipe.category.IRecipeCategory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fluids.FluidStack;
public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRecipeCategory<T> {
@ -46,7 +51,8 @@ public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRec
@Override
public String getTitle() {
return Lang.translate("recipe." + name).getUnformattedComponentText();
return Lang.translate("recipe." + name)
.getString();
}
@Override
@ -62,7 +68,9 @@ public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRec
List<ProcessingOutput> rollableResults = processingRecipe.getRollableResults();
if (rollableResults.size() <= index)
return jeiSlot;
if (processingRecipe.getRollableResults().get(index).getChance() == 1)
if (processingRecipe.getRollableResults()
.get(index)
.getChance() == 1)
return jeiSlot;
return AllGuiTextures.JEI_CHANCE_SLOT;
}
@ -85,19 +93,28 @@ public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRec
return;
ProcessingOutput output = results.get(slotIndex - 1);
if (output.getChance() != 1)
tooltip.add(1, Lang.translate("recipe.processing.chance", (int) (output.getChance() * 100)).formatted(TextFormatting.GOLD));
tooltip.add(1, Lang.translate("recipe.processing.chance", (int) (output.getChance() * 100))
.formatted(TextFormatting.GOLD));
});
}
protected static void addCatalystTooltip(IGuiItemStackGroup itemStacks, Map<Integer, Float> catalystIndices) {
itemStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> {
if (!input)
return;
if (!catalystIndices.containsKey(slotIndex))
return;
Float chance = catalystIndices.get(slotIndex);
tooltip.add(1, Lang.translate("recipe.processing.catalyst").formatted(TextFormatting.YELLOW));
tooltip.add(2, Lang.translate("recipe.processing.chanceToReturn", (int) (chance.floatValue() * 100)).formatted(TextFormatting.GOLD));
protected static void addFluidTooltip(IGuiFluidStackGroup fluidStacks, List<FluidIngredient> inputs,
List<FluidStack> outputs) {
List<Integer> amounts = new ArrayList<>();
inputs.forEach(f -> amounts.add(f.getRequiredAmount()));
outputs.forEach(f -> amounts.add(f.getAmount()));
fluidStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> {
int amount = amounts.get(slotIndex);
ITextComponent text = ((amount == 1000 ? Lang.translate("generic.unit.bucket")
: Lang.translate("generic.unit.millibuckets", amount))).formatted(TextFormatting.GOLD);
if (tooltip.isEmpty())
tooltip.add(0, text);
else {
List<ITextComponent> siblings = tooltip.get(0).getSiblings();
siblings.add(new StringTextComponent(" "));
siblings.add(text);
}
});
}

View file

@ -22,12 +22,12 @@ import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Rarity;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.ShapedRecipe;
import net.minecraft.util.NonNullList;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecipe> {
@ -47,6 +47,8 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
matrixStack.scale(scale, scale, scale);
if (ingredient != null) {
RenderSystem.pushMatrix();
RenderSystem.multMatrix(matrixStack.peek().getModel());
RenderSystem.enableDepthTest();
RenderHelper.enable();
Minecraft minecraft = Minecraft.getInstance();
@ -56,6 +58,7 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
itemRenderer.renderItemOverlayIntoGUI(font, ingredient, 0, 0, null);
RenderSystem.disableBlend();
RenderHelper.disableStandardItemLighting();
RenderSystem.popMatrix();
}
matrixStack.pop();
@ -65,29 +68,14 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
public List<ITextComponent> getTooltip(ItemStack ingredient, ITooltipFlag tooltipFlag) {
Minecraft minecraft = Minecraft.getInstance();
PlayerEntity player = minecraft.player;
List<ITextComponent> list;
try {
list = ingredient.getTooltip(player, tooltipFlag);
return ingredient.getTooltip(player, tooltipFlag);
} catch (RuntimeException | LinkageError e) {
return new ArrayList<>();
List<ITextComponent> list = new ArrayList<>();
TranslationTextComponent crash = new TranslationTextComponent("jei.tooltip.error.crash");
list.add(crash.formatted(TextFormatting.RED));
return list;
}
Rarity rarity;
try {
rarity = ingredient.getRarity();
} catch (RuntimeException | LinkageError e) {
rarity = Rarity.COMMON;
}
for (int k = 0; k < list.size(); ++k) {
if (k == 0) {
list.set(k, list.get(k).copy().formatted(rarity.color));
} else {
list.set(k, list.get(k).copy().formatted(TextFormatting.GRAY));
}
}
return list;
}
}

View file

@ -20,7 +20,7 @@ public class PackingCategory extends BasinCategory {
public PackingCategory() {
super("packing", doubleItemIcon(AllBlocks.MECHANICAL_PRESS.get(), AllBlocks.BASIN.get()),
emptyBackground(177, 70));
emptyBackground(177, 110));
}
@Override
@ -29,7 +29,7 @@ public class PackingCategory extends BasinCategory {
super.setRecipe(recipeLayout, recipe, ingredients);
return;
}
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
int i = 0;
@ -38,12 +38,12 @@ public class PackingCategory extends BasinCategory {
int rows = size == 4 ? 2 : 3;
while (i < size) {
Ingredient ingredient = ingredients2.get(i);
itemStacks.init(i, true, (rows == 2 ? 26 : 17) + (i % rows) * 19, 50 - (i / rows) * 19);
itemStacks.init(i, true, (rows == 2 ? 26 : 17) + (i % rows) * 19, 60 - (i / rows) * 19);
itemStacks.set(i, Arrays.asList(ingredient.getMatchingStacks()));
i++;
}
itemStacks.init(i, false, 141, 50);
itemStacks.init(i, false, 141, 60);
itemStacks.set(i, recipe.getRecipeOutput());
}
@ -51,19 +51,20 @@ public class PackingCategory extends BasinCategory {
public void draw(BasinRecipe recipe, MatrixStack matrixStack, double mouseX, double mouseY) {
if (!recipe.convertedRecipe) {
super.draw(recipe, matrixStack, mouseX, mouseY);
} else {
NonNullList<Ingredient> ingredients2 = recipe.getIngredients();
int size = ingredients2.size();
int rows = size == 4 ? 2 : 3;
for (int i = 0; i < size; i++)
AllGuiTextures.JEI_SLOT.draw(matrixStack, (rows == 2 ? 26 : 17) + (i % rows) * 19, 50 - (i / rows) * 19);
AllGuiTextures.JEI_SLOT.draw(matrixStack, 141, 50);
AllGuiTextures.JEI_DOWN_ARROW.draw(matrixStack, 136, 32);
AllGuiTextures.JEI_SHADOW.draw(matrixStack, 81, 57);
for (int i = 0; i < size; i++)
AllGuiTextures.JEI_SLOT.draw(matrixStack, (rows == 2 ? 26 : 17) + (i % rows) * 19,
60 - (i / rows) * 19);
AllGuiTextures.JEI_SLOT.draw(matrixStack, 141, 60);
AllGuiTextures.JEI_DOWN_ARROW.draw(matrixStack, 136, 42);
AllGuiTextures.JEI_SHADOW.draw(matrixStack, 81, 67);
}
press.draw(matrixStack, getBackground().getWidth() / 2 + 6, 30);
press.draw(matrixStack, getBackground().getWidth() / 2 + 6, 40);
}
}

View file

@ -71,10 +71,10 @@ public class PolishingCategory extends CreateRecipeCategory<SandPaperPolishingRe
CompoundNBT tag = renderedSandpaper.getOrCreateTag();
tag.put("Polishing", matchingStacks[0].serializeNBT());
tag.putBoolean("JEI", true);
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
matrixStack.translate(0, 30, 0);
matrixStack.scale(2, 2, 2);
matrixStack.translate(getBackground().getWidth() / 4 - 8, 1, 0);
GuiGameElement.GuiItemRenderBuilder.renderItemIntoGUI(matrixStack, renderedSandpaper);
GuiGameElement.of(renderedSandpaper).render(matrixStack);
matrixStack.pop();
}

View file

@ -4,6 +4,7 @@ import com.mojang.blaze3d.matrix.MatrixStack;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.gui.AllGuiTextures;
import com.simibubi.create.foundation.gui.GuiGameElement;
import com.simibubi.create.foundation.utility.MatrixStacker;
public class AnimatedCrafter extends AnimatedKinetics {
@ -12,21 +13,22 @@ public class AnimatedCrafter extends AnimatedKinetics {
matrixStack.push();
matrixStack.translate(xOffset, yOffset, 0);
AllGuiTextures.JEI_SHADOW.draw(matrixStack, -16, 13);
matrixStack.translate(3, 16, 0);
// RenderSystem.rotatef(-12.5f, 1, 0, 0);
// RenderSystem.rotatef(-22.5f, 0, 1, 0);
MatrixStacker.of(matrixStack)
.rotateX(-12.5f)
.rotateY(-22.5f);
int scale = 22;
GuiGameElement.of(cogwheel())
.rotateBlock(90, 0, getCurrentAngle())
.scale(scale)
.render(matrixStack);
.rotateBlock(90, 0, getCurrentAngle())
.scale(scale)
.render(matrixStack);
GuiGameElement.of(AllBlocks.MECHANICAL_CRAFTER.getDefaultState())
.rotateBlock(0, 180, 0)
.scale(scale)
.render(matrixStack);
.rotateBlock(0, 180, 0)
.scale(scale)
.render(matrixStack);
matrixStack.pop();
}

View file

@ -19,7 +19,7 @@ public class AnimatedSaw extends AnimatedKinetics {
AllGuiTextures.JEI_SHADOW.draw(matrixStack, -16, 13);
matrixStack.translate(0, 0, 200);
matrixStack.translate(-6, 19, 0);
matrixStack.translate(29, 17, 0);
matrixStack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(-22.5f));
matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(90-225f));
int scale = 25;

View file

@ -60,6 +60,7 @@ public class OpenEndedPipe {
return;
if (waterlog) {
world.setBlockState(outputPos, state.with(BlockStateProperties.WATERLOGGED, false), 3);
world.getPendingFluidTicks().scheduleTick(outputPos, Fluids.WATER, 1);
return;
}
world.setBlockState(outputPos, fluidState.getBlockState()
@ -80,6 +81,7 @@ public class OpenEndedPipe {
if (providedFluid.getFluid() != Fluids.WATER)
return;
world.setBlockState(outputPos, state.with(BlockStateProperties.WATERLOGGED, true), 3);
world.getPendingFluidTicks().scheduleTick(outputPos, Fluids.WATER, 1);
return;
}
world.setBlockState(outputPos, providedFluid.getDefaultState()

View file

@ -149,11 +149,11 @@ public class SequencedGearshiftScreen extends AbstractSimiScreen {
label(matrixStack, 127, yOffset - 3, instruction.speedModifier.label);
}
textRenderer.drawWithShadow(matrixStack, title, guiLeft - 3 + (background.width - textRenderer.getWidth(title)) / 2, guiTop + 10,
hFontColor);
textRenderer.drawWithShadow(matrixStack, title, guiLeft - 3 + (background.width - textRenderer.getWidth(title)) / 2, guiTop + 3,
0xffffff);
GuiGameElement.of(renderedItem)
.at(guiLeft + background.width + 20, guiTop + 50)
.at(guiLeft + background.width + 10, guiTop + 180)
.scale(5)
.render(matrixStack);
}

View file

@ -123,7 +123,7 @@ public class SymmetryWandScreen extends AbstractSimiScreen {
renderBlock(matrixStack);
GuiGameElement.of(wand)
.at(guiLeft + 170, guiTop + 200)
.at(guiLeft + 190, guiTop + 420)
.scale(4)
.rotate(-70, 20, 20)
.render(matrixStack);
@ -131,10 +131,9 @@ public class SymmetryWandScreen extends AbstractSimiScreen {
protected void renderBlock(MatrixStack ms) {
ms.push();
ms.translate(guiLeft + 18, guiTop + 11, 20);
ms.translate(guiLeft + 25.5f, guiTop + 21, 20);
ms.translate(guiLeft + 26f, guiTop + 37, 20);
ms.scale(16, 16, 16);
ms.multiply(new Vector3f(.3f, 1f, 0f).getDegreesQuaternion(-22.5f));
ms.scale(16, -16, 16);
currentElement.applyModelTransform(ms);
// RenderSystem.multMatrix(ms.peek().getModel());
GuiGameElement.of(currentElement.getModel())

View file

@ -97,7 +97,7 @@ public class AdjustableCrateScreen extends AbstractSimiContainerScreen<Adjustabl
}
GuiGameElement.of(renderedItem)
.at(guiLeft + ADJUSTABLE_CRATE.width + 110, guiTop + 40)
.at(guiLeft + ADJUSTABLE_CRATE.width + 110, guiTop + 120)
.scale(5)
.render(matrixStack);
}

View file

@ -49,38 +49,6 @@ public class StockpileSwitchScreen extends AbstractSimiScreen {
setWindowSize(background.width + 50, background.height);
super.init();
widgets.clear();
/*
<<<<<<< HEAD
cursorPos = te.currentLevel == -1 ? 0 : te.currentLevel;
offBelowLabel = new Label(guiLeft + 116, guiTop + 72, "").colored(0xD3CBBE)
.withShadow();
offBelow = new ScrollInput(guiLeft + 113, guiTop + 69, 33, 14).withRange(0, 96)
.titled(lowerLimit)
.calling(state -> {
offBelowLabel.text = new StringTextComponent(state + "%");
lastModification = 0;
if (onAbove.getState() - 4 <= state) {
onAbove.setState(state + 5);
onAbove.onChanged();
}
})
.setState((int) (te.offWhenBelow * 100));
onAboveLabel = new Label(guiLeft + 116, guiTop + 55, "").colored(0xD3CBBE)
.withShadow();
onAbove = new ScrollInput(guiLeft + 113, guiTop + 52, 33, 14).withRange(5, 101)
.titled(upperLimit)
.calling(state -> {
onAboveLabel.text = new StringTextComponent(state + "%");
lastModification = 0;
if (offBelow.getState() + 4 >= state) {
offBelow.setState(state - 5);
offBelow.onChanged();
}
})
.setState((int) (te.onWhenAbove * 100));
=======*/
cursor = LerpedFloat.linear()
.startWithValue(te.getLevelForDisplay());
@ -158,7 +126,7 @@ public class StockpileSwitchScreen extends AbstractSimiScreen {
matrixStack.push();
GuiGameElement.of(renderedItem)
.at(guiLeft + STOCKSWITCH.width + 15, guiTop + 20)
.at(guiLeft + STOCKSWITCH.width + 15, guiTop + 120)
.scale(5)
.render(matrixStack);
matrixStack.pop();

View file

@ -43,8 +43,10 @@ public abstract class AbstractFilterScreen<F extends AbstractFilterContainer> ex
super.init();
widgets.clear();
resetButton = new IconButton(guiLeft + background.width - 62, guiTop + background.height - 24, AllIcons.I_TRASH);
confirmButton = new IconButton(guiLeft + background.width - 33, guiTop + background.height - 24, AllIcons.I_CONFIRM);
resetButton =
new IconButton(guiLeft + background.width - 62, guiTop + background.height - 24, AllIcons.I_TRASH);
confirmButton =
new IconButton(guiLeft + background.width - 33, guiTop + background.height - 24, AllIcons.I_CONFIRM);
widgets.add(resetButton);
widgets.add(confirmButton);
@ -63,9 +65,9 @@ public abstract class AbstractFilterScreen<F extends AbstractFilterContainer> ex
textRenderer.draw(ms, I18n.format(container.filterItem.getTranslationKey()), x + 15, y + 3, 0xdedede);
GuiGameElement.of(container.filterItem)
.at(guiLeft + background.width, guiTop +background.height -60)
.scale(5)
.render(ms);
.at(guiLeft + background.width, guiTop + background.height + 25)
.scale(5)
.render(ms);
}
@ -75,7 +77,8 @@ public abstract class AbstractFilterScreen<F extends AbstractFilterContainer> ex
super.tick();
handleIndicators();
if (!container.player.getHeldItemMainhand().equals(container.filterItem, false))
if (!container.player.getHeldItemMainhand()
.equals(container.filterItem, false))
client.player.closeScreen();
}
@ -96,9 +99,12 @@ public abstract class AbstractFilterScreen<F extends AbstractFilterContainer> ex
List<IconButton> tooltipButtons = getTooltipButtons();
for (IconButton button : tooltipButtons) {
if (!button.getToolTip().isEmpty()) {
button.setToolTip(button.getToolTip().get(0));
button.getToolTip().add(TooltipHelper.holdShift(Palette.Yellow, hasShiftDown()));
if (!button.getToolTip()
.isEmpty()) {
button.setToolTip(button.getToolTip()
.get(0));
button.getToolTip()
.add(TooltipHelper.holdShift(Palette.Yellow, hasShiftDown()));
}
}
@ -144,8 +150,7 @@ public abstract class AbstractFilterScreen<F extends AbstractFilterContainer> ex
return mouseClicked;
}
protected void contentsCleared() {
}
protected void contentsCleared() {}
protected void sendOptionUpdate(Option option) {
AllPackets.channel.sendToServer(new FilterScreenPacket(option));

View file

@ -116,7 +116,7 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen<SchematicT
textRenderer.drawWithShadow(matrixStack, noSchematics, mainLeft + 54, mainTop + 26, 0xd3d3d3);
GuiGameElement.of(renderedItem)
.at(mainLeft + 217, mainTop + 48)
.at(mainLeft + 217, mainTop + 98)
.scale(3)
.render(matrixStack);

View file

@ -261,7 +261,7 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
renderBlueprintHighlight(matrixStack);
GuiGameElement.of(renderedItem)
.at(guiLeft + 230, guiTop + 110)
.at(guiLeft + 230, guiTop + 190)
.scale(5)
.render(matrixStack);

View file

@ -152,10 +152,10 @@ public class SchematicEditScreen extends AbstractSimiScreen {
x + 93 - textRenderer.getStringWidth(handler.getCurrentSchematicName()) / 2, y + 3, 0xffffff);
matrixStack.push();
matrixStack.translate(guiLeft + 200, guiTop + 80, 0);
matrixStack.translate(guiLeft + 200, guiTop + 130, 0);
matrixStack.scale(3, 3, 3);
GuiGameElement.GuiItemRenderBuilder.renderItemIntoGUI(matrixStack, new ItemStack(AllItems.SCHEMATIC.get()));
// itemRenderer.renderItemIntoGUI(new ItemStack(AllItems.SCHEMATIC.get()), 0, 0);
GuiGameElement.of(AllItems.SCHEMATIC.asStack())
.render(matrixStack);
matrixStack.pop();
}

View file

@ -66,10 +66,9 @@ public class SchematicPromptScreen extends AbstractSimiScreen {
textRenderer.drawWithShadow(ms, title, guiLeft + (sWidth / 2) - (textRenderer.getWidth(title) / 2), guiTop + 3,
0xffffff);
ms.push();
ms.translate(guiLeft + 22, guiTop + 23, 0);
GuiGameElement.GuiItemRenderBuilder.renderItemIntoGUI(ms, AllItems.SCHEMATIC.asStack());
ms.translate(guiLeft + 22, guiTop + 39, 0);
GuiGameElement.of(AllItems.SCHEMATIC.asStack()).render(ms);
ms.pop();
// itemRenderer.renderItemIntoGUI(AllItems.SCHEMATIC.asStack(), guiLeft + 22, guiTop + 23);
}
@Override

View file

@ -187,7 +187,7 @@ public class GuiGameElement {
BlockRendererDispatcher blockRenderer = mc.getBlockRendererDispatcher();
IRenderTypeBuffer.Impl buffer = mc.getBufferBuilders()
.getEntityVertexConsumers();
RenderType renderType = blockState.getBlock() == Blocks.AIR ? Atlases.getEntityTranslucentCull() // FIXME .getEntityTranslucent()
RenderType renderType = blockState.getBlock() == Blocks.AIR ? Atlases.getEntityTranslucentCull()
: RenderTypeLookup.getEntityBlockLayer(blockState, true);
IVertexBuilder vb = buffer.getBuffer(renderType);
@ -246,12 +246,12 @@ public class GuiGameElement {
ClientWorld world = Minecraft.getInstance().world;
if (renderWorld == null || renderWorld.getWrappedWorld() != world)
renderWorld = new FluidRenderWorld(world);
for (Direction d : Iterate.directions) {
vb = buffer.getBuffer(type);
if (d.getAxisDirection() == AxisDirection.POSITIVE)
continue;
ms.push();
ms.translate(.5, .5, .5);
ms.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(AngleHelper.horizontalAngle(d)));
@ -261,7 +261,7 @@ public class GuiGameElement {
buffer.draw(type);
ms.pop();
}
RenderHelper.enable();
ms.pop();
break;
@ -292,36 +292,40 @@ public class GuiGameElement {
@Override
public void render(MatrixStack matrixStack) {
prepareMatrix(matrixStack);
// matrixStack.translate(0, 80, 0);
transformMatrix(matrixStack);
matrixStack.scale(1, -1, 1);
matrixStack.translate(0, 0, -75);
renderItemIntoGUI(matrixStack, stack);
cleanUpMatrix(matrixStack);
}
public static void renderItemIntoGUI(MatrixStack matrixStack, ItemStack stack) {
ItemRenderer renderer = Minecraft.getInstance().getItemRenderer();
ItemRenderer renderer = Minecraft.getInstance()
.getItemRenderer();
IBakedModel bakedModel = renderer.getItemModelWithOverrides(stack, null, null);
matrixStack.push();
renderer.textureManager.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
renderer.textureManager.getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE).setBlurMipmapDirect(false, false);
renderer.textureManager.getTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE)
.setBlurMipmapDirect(false, false);
RenderSystem.enableRescaleNormal();
RenderSystem.enableAlphaTest();
RenderSystem.defaultAlphaFunc();
RenderSystem.enableBlend();
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA,
GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
matrixStack.translate((float)0, (float)0, 100.0F + renderer.zLevel);
matrixStack.translate((float) 0, (float) 0, 100.0F + renderer.zLevel);
matrixStack.translate(8.0F, 8.0F, 0.0F);
matrixStack.scale(1.0F, -1.0F, 1.0F);
matrixStack.scale(16.0F, 16.0F, 16.0F);
IRenderTypeBuffer.Impl irendertypebuffer$impl = Minecraft.getInstance().getBufferBuilders().getEntityVertexConsumers();
IRenderTypeBuffer.Impl irendertypebuffer$impl = Minecraft.getInstance()
.getBufferBuilders()
.getEntityVertexConsumers();
boolean flag = !bakedModel.isSideLit();
if (flag) {
RenderHelper.disableGuiDepthLighting();
}
renderer.renderItem(stack, ItemCameraTransforms.TransformType.GUI, false, matrixStack, irendertypebuffer$impl, 15728880, OverlayTexture.DEFAULT_UV, bakedModel);
renderer.renderItem(stack, ItemCameraTransforms.TransformType.GUI, false, matrixStack,
irendertypebuffer$impl, 15728880, OverlayTexture.DEFAULT_UV, bakedModel);
irendertypebuffer$impl.draw();
RenderSystem.enableDepthTest();
if (flag) {
@ -330,6 +334,7 @@ public class GuiGameElement {
RenderSystem.disableAlphaTest();
RenderSystem.disableRescaleNormal();
RenderSystem.enableCull();
matrixStack.pop();
}

View file

@ -17,7 +17,8 @@ import net.minecraft.util.text.StringTextComponent;
public class ToolSelectionScreen extends Screen {
public final String scrollToCycle = Lang.translate("gui.toolmenu.cycle").getUnformattedComponentText();
public final String scrollToCycle = Lang.translate("gui.toolmenu.cycle")
.getString();
public final String holdToFocus = "gui.toolmenu.focusKey";
protected List<Tools> tools;
@ -63,7 +64,6 @@ public class ToolSelectionScreen extends Screen {
if (!initialized)
init(mc, mainWindow.getScaledWidth(), mainWindow.getScaledHeight());
int x = (mainWindow.getScaledWidth() - w) / 2 + 15;
int y = mainWindow.getScaledHeight() - h - 75;
@ -74,11 +74,14 @@ public class ToolSelectionScreen extends Screen {
RenderSystem.enableBlend();
RenderSystem.color4f(1, 1, 1, focused ? 7 / 8f : 1 / 2f);
Minecraft.getInstance().getTextureManager().bindTexture(gray.location);
Minecraft.getInstance()
.getTextureManager()
.bindTexture(gray.location);
drawTexture(matrixStack, x - 15, y, gray.startX, gray.startY, w, h, gray.width, gray.height);
float toolTipAlpha = yOffset / 10;
List<ITextComponent> toolTip = tools.get(selection).getDescription();
List<ITextComponent> toolTip = tools.get(selection)
.getDescription();
int stringAlphaComponent = ((int) (toolTipAlpha * 0xFF)) << 24;
if (toolTipAlpha > 0.25f) {
@ -99,10 +102,11 @@ public class ToolSelectionScreen extends Screen {
RenderSystem.color4f(1, 1, 1, 1);
if (tools.size() > 1) {
String keyName = AllKeys.TOOL_MENU.getBoundKey();
int width = client.getWindow().getScaledWidth();
int width = client.getWindow()
.getScaledWidth();
if (!focused)
drawCenteredString(matrixStack, client.fontRenderer, Lang.translate(holdToFocus, keyName).getUnformattedComponentText(), width / 2, y - 10,
0xCCDDFF);
drawCenteredText(matrixStack, client.fontRenderer, Lang.translate(holdToFocus, keyName), width / 2,
y - 10, 0xCCDDFF);
else
drawCenteredString(matrixStack, client.fontRenderer, scrollToCycle, width / 2, y - 10, 0xCCDDFF);
} else {
@ -115,14 +119,19 @@ public class ToolSelectionScreen extends Screen {
float alpha = focused ? 1 : .2f;
if (i == selection) {
matrixStack.translate(0, -10, 0);
drawCenteredString(matrixStack, client.fontRenderer, tools.get(i).getDisplayName().getUnformattedComponentText(), x + i * 50 + 24, y + 28,
0xCCDDFF);
drawCenteredString(matrixStack, client.fontRenderer, tools.get(i)
.getDisplayName()
.getString(), x + i * 50 + 24, y + 28, 0xCCDDFF);
alpha = 1;
}
RenderSystem.color4f(0, 0, 0, alpha);
tools.get(i).getIcon().draw(matrixStack, this, x + i * 50 + 16, y + 12);
tools.get(i)
.getIcon()
.draw(matrixStack, this, x + i * 50 + 16, y + 12);
RenderSystem.color4f(1, 1, 1, alpha);
tools.get(i).getIcon().draw(matrixStack, this, x + i * 50 + 16, y + 11);
tools.get(i)
.getIcon()
.draw(matrixStack, this, x + i * 50 + 16, y + 11);
matrixStack.pop();
}

View file

@ -71,13 +71,6 @@ public class OxidizingBlock extends Block {
}
}
@Override
public float getPlayerRelativeBlockHardness(BlockState blockState, PlayerEntity player, IBlockReader worldIn,
BlockPos pos) {
return super.getPlayerRelativeBlockHardness(blockState, player, worldIn, pos)
- 0.2f * blockState.get(OXIDIZATION);
}
@Override
public ActionResultType onUse(BlockState state, World world, BlockPos pos,
PlayerEntity player, Hand hand, BlockRayTraceResult blockRayTraceResult) {

View file

@ -23,7 +23,7 @@
"create.recipe.pressing": "Pressing",
"create.recipe.mixing": "Mixing",
"create.recipe.packing": "Compacting",
"create.recipe.mechanical_sawing": "Sawing",
"create.recipe.sawing": "Sawing",
"create.recipe.mechanical_crafting": "Mechanical Crafting",
"create.recipe.block_cutting": "Block Cutting",
"create.recipe.blockzapper_upgrade": "Handheld Blockzapper",
@ -46,6 +46,8 @@
"create.generic.unit.rpm": "RPM",
"create.generic.unit.stress": "su",
"create.generic.unit.degrees": "\u00B0",
"create.generic.unit.bucket": "1 Bucket",
"create.generic.unit.millibuckets": "%1$smB",
"create.action.scroll": "Scroll",
"create.action.confirm": "Confirm",