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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,24 +1,29 @@
package com.simibubi.create.compat.jei.category; package com.simibubi.create.compat.jei.category;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import com.simibubi.create.Create; import com.simibubi.create.Create;
import com.simibubi.create.compat.jei.DoubleItemIcon; import com.simibubi.create.compat.jei.DoubleItemIcon;
import com.simibubi.create.compat.jei.EmptyBackground; import com.simibubi.create.compat.jei.EmptyBackground;
import com.simibubi.create.content.contraptions.processing.ProcessingOutput; import com.simibubi.create.content.contraptions.processing.ProcessingOutput;
import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; 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.gui.AllGuiTextures;
import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.Lang;
import mezz.jei.api.gui.drawable.IDrawable; 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.gui.ingredient.IGuiItemStackGroup;
import mezz.jei.api.recipe.category.IRecipeCategory; import mezz.jei.api.recipe.category.IRecipeCategory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.IItemProvider; import net.minecraft.util.IItemProvider;
import net.minecraft.util.ResourceLocation; 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.minecraft.util.text.TextFormatting;
import net.minecraftforge.fluids.FluidStack;
public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRecipeCategory<T> { public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRecipeCategory<T> {
@ -46,7 +51,8 @@ public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRec
@Override @Override
public String getTitle() { public String getTitle() {
return Lang.translate("recipe." + name).getUnformattedComponentText(); return Lang.translate("recipe." + name)
.getString();
} }
@Override @Override
@ -62,7 +68,9 @@ public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRec
List<ProcessingOutput> rollableResults = processingRecipe.getRollableResults(); List<ProcessingOutput> rollableResults = processingRecipe.getRollableResults();
if (rollableResults.size() <= index) if (rollableResults.size() <= index)
return jeiSlot; return jeiSlot;
if (processingRecipe.getRollableResults().get(index).getChance() == 1) if (processingRecipe.getRollableResults()
.get(index)
.getChance() == 1)
return jeiSlot; return jeiSlot;
return AllGuiTextures.JEI_CHANCE_SLOT; return AllGuiTextures.JEI_CHANCE_SLOT;
} }
@ -85,19 +93,28 @@ public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRec
return; return;
ProcessingOutput output = results.get(slotIndex - 1); ProcessingOutput output = results.get(slotIndex - 1);
if (output.getChance() != 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) { protected static void addFluidTooltip(IGuiFluidStackGroup fluidStacks, List<FluidIngredient> inputs,
itemStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> { List<FluidStack> outputs) {
if (!input) List<Integer> amounts = new ArrayList<>();
return; inputs.forEach(f -> amounts.add(f.getRequiredAmount()));
if (!catalystIndices.containsKey(slotIndex)) outputs.forEach(f -> amounts.add(f.getAmount()));
return;
Float chance = catalystIndices.get(slotIndex); fluidStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> {
tooltip.add(1, Lang.translate("recipe.processing.catalyst").formatted(TextFormatting.YELLOW)); int amount = amounts.get(slotIndex);
tooltip.add(2, Lang.translate("recipe.processing.chanceToReturn", (int) (chance.floatValue() * 100)).formatted(TextFormatting.GOLD)); 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.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.Rarity;
import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.ShapedRecipe; import net.minecraft.item.crafting.ShapedRecipe;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecipe> { public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecipe> {
@ -47,6 +47,8 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
matrixStack.scale(scale, scale, scale); matrixStack.scale(scale, scale, scale);
if (ingredient != null) { if (ingredient != null) {
RenderSystem.pushMatrix();
RenderSystem.multMatrix(matrixStack.peek().getModel());
RenderSystem.enableDepthTest(); RenderSystem.enableDepthTest();
RenderHelper.enable(); RenderHelper.enable();
Minecraft minecraft = Minecraft.getInstance(); Minecraft minecraft = Minecraft.getInstance();
@ -56,6 +58,7 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
itemRenderer.renderItemOverlayIntoGUI(font, ingredient, 0, 0, null); itemRenderer.renderItemOverlayIntoGUI(font, ingredient, 0, 0, null);
RenderSystem.disableBlend(); RenderSystem.disableBlend();
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
RenderSystem.popMatrix();
} }
matrixStack.pop(); matrixStack.pop();
@ -65,29 +68,14 @@ public class MechanicalCraftingCategory extends CreateRecipeCategory<ShapedRecip
public List<ITextComponent> getTooltip(ItemStack ingredient, ITooltipFlag tooltipFlag) { public List<ITextComponent> getTooltip(ItemStack ingredient, ITooltipFlag tooltipFlag) {
Minecraft minecraft = Minecraft.getInstance(); Minecraft minecraft = Minecraft.getInstance();
PlayerEntity player = minecraft.player; PlayerEntity player = minecraft.player;
List<ITextComponent> list;
try { try {
list = ingredient.getTooltip(player, tooltipFlag); return ingredient.getTooltip(player, tooltipFlag);
} catch (RuntimeException | LinkageError e) { } 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() { public PackingCategory() {
super("packing", doubleItemIcon(AllBlocks.MECHANICAL_PRESS.get(), AllBlocks.BASIN.get()), super("packing", doubleItemIcon(AllBlocks.MECHANICAL_PRESS.get(), AllBlocks.BASIN.get()),
emptyBackground(177, 70)); emptyBackground(177, 110));
} }
@Override @Override
@ -38,12 +38,12 @@ public class PackingCategory extends BasinCategory {
int rows = size == 4 ? 2 : 3; int rows = size == 4 ? 2 : 3;
while (i < size) { while (i < size) {
Ingredient ingredient = ingredients2.get(i); 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())); itemStacks.set(i, Arrays.asList(ingredient.getMatchingStacks()));
i++; i++;
} }
itemStacks.init(i, false, 141, 50); itemStacks.init(i, false, 141, 60);
itemStacks.set(i, recipe.getRecipeOutput()); itemStacks.set(i, recipe.getRecipeOutput());
} }
@ -57,13 +57,14 @@ public class PackingCategory extends BasinCategory {
int size = ingredients2.size(); int size = ingredients2.size();
int rows = size == 4 ? 2 : 3; int rows = size == 4 ? 2 : 3;
for (int i = 0; i < size; i++) 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, (rows == 2 ? 26 : 17) + (i % rows) * 19,
AllGuiTextures.JEI_SLOT.draw(matrixStack, 141, 50); 60 - (i / rows) * 19);
AllGuiTextures.JEI_DOWN_ARROW.draw(matrixStack, 136, 32); AllGuiTextures.JEI_SLOT.draw(matrixStack, 141, 60);
AllGuiTextures.JEI_SHADOW.draw(matrixStack, 81, 57); 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(); CompoundNBT tag = renderedSandpaper.getOrCreateTag();
tag.put("Polishing", matchingStacks[0].serializeNBT()); tag.put("Polishing", matchingStacks[0].serializeNBT());
tag.putBoolean("JEI", true); tag.putBoolean("JEI", true);
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer(); matrixStack.translate(0, 30, 0);
matrixStack.scale(2, 2, 2); matrixStack.scale(2, 2, 2);
matrixStack.translate(getBackground().getWidth() / 4 - 8, 1, 0); matrixStack.translate(getBackground().getWidth() / 4 - 8, 1, 0);
GuiGameElement.GuiItemRenderBuilder.renderItemIntoGUI(matrixStack, renderedSandpaper); GuiGameElement.of(renderedSandpaper).render(matrixStack);
matrixStack.pop(); matrixStack.pop();
} }

View File

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

View File

@ -19,7 +19,7 @@ public class AnimatedSaw extends AnimatedKinetics {
AllGuiTextures.JEI_SHADOW.draw(matrixStack, -16, 13); AllGuiTextures.JEI_SHADOW.draw(matrixStack, -16, 13);
matrixStack.translate(0, 0, 200); 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_X.getDegreesQuaternion(-22.5f));
matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(90-225f)); matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(90-225f));
int scale = 25; int scale = 25;

View File

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

View File

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

View File

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

View File

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

View File

@ -49,38 +49,6 @@ public class StockpileSwitchScreen extends AbstractSimiScreen {
setWindowSize(background.width + 50, background.height); setWindowSize(background.width + 50, background.height);
super.init(); super.init();
widgets.clear(); 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() cursor = LerpedFloat.linear()
.startWithValue(te.getLevelForDisplay()); .startWithValue(te.getLevelForDisplay());
@ -158,7 +126,7 @@ public class StockpileSwitchScreen extends AbstractSimiScreen {
matrixStack.push(); matrixStack.push();
GuiGameElement.of(renderedItem) GuiGameElement.of(renderedItem)
.at(guiLeft + STOCKSWITCH.width + 15, guiTop + 20) .at(guiLeft + STOCKSWITCH.width + 15, guiTop + 120)
.scale(5) .scale(5)
.render(matrixStack); .render(matrixStack);
matrixStack.pop(); matrixStack.pop();

View File

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

View File

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

View File

@ -152,10 +152,10 @@ public class SchematicEditScreen extends AbstractSimiScreen {
x + 93 - textRenderer.getStringWidth(handler.getCurrentSchematicName()) / 2, y + 3, 0xffffff); x + 93 - textRenderer.getStringWidth(handler.getCurrentSchematicName()) / 2, y + 3, 0xffffff);
matrixStack.push(); matrixStack.push();
matrixStack.translate(guiLeft + 200, guiTop + 80, 0); matrixStack.translate(guiLeft + 200, guiTop + 130, 0);
matrixStack.scale(3, 3, 3); matrixStack.scale(3, 3, 3);
GuiGameElement.GuiItemRenderBuilder.renderItemIntoGUI(matrixStack, new ItemStack(AllItems.SCHEMATIC.get())); GuiGameElement.of(AllItems.SCHEMATIC.asStack())
// itemRenderer.renderItemIntoGUI(new ItemStack(AllItems.SCHEMATIC.get()), 0, 0); .render(matrixStack);
matrixStack.pop(); 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, textRenderer.drawWithShadow(ms, title, guiLeft + (sWidth / 2) - (textRenderer.getWidth(title) / 2), guiTop + 3,
0xffffff); 0xffffff);
ms.push(); ms.push();
ms.translate(guiLeft + 22, guiTop + 23, 0); ms.translate(guiLeft + 22, guiTop + 39, 0);
GuiGameElement.GuiItemRenderBuilder.renderItemIntoGUI(ms, AllItems.SCHEMATIC.asStack()); GuiGameElement.of(AllItems.SCHEMATIC.asStack()).render(ms);
ms.pop(); ms.pop();
// itemRenderer.renderItemIntoGUI(AllItems.SCHEMATIC.asStack(), guiLeft + 22, guiTop + 23);
} }
@Override @Override

View File

@ -187,7 +187,7 @@ public class GuiGameElement {
BlockRendererDispatcher blockRenderer = mc.getBlockRendererDispatcher(); BlockRendererDispatcher blockRenderer = mc.getBlockRendererDispatcher();
IRenderTypeBuffer.Impl buffer = mc.getBufferBuilders() IRenderTypeBuffer.Impl buffer = mc.getBufferBuilders()
.getEntityVertexConsumers(); .getEntityVertexConsumers();
RenderType renderType = blockState.getBlock() == Blocks.AIR ? Atlases.getEntityTranslucentCull() // FIXME .getEntityTranslucent() RenderType renderType = blockState.getBlock() == Blocks.AIR ? Atlases.getEntityTranslucentCull()
: RenderTypeLookup.getEntityBlockLayer(blockState, true); : RenderTypeLookup.getEntityBlockLayer(blockState, true);
IVertexBuilder vb = buffer.getBuffer(renderType); IVertexBuilder vb = buffer.getBuffer(renderType);
@ -292,36 +292,40 @@ public class GuiGameElement {
@Override @Override
public void render(MatrixStack matrixStack) { public void render(MatrixStack matrixStack) {
prepareMatrix(matrixStack); prepareMatrix(matrixStack);
// matrixStack.translate(0, 80, 0);
transformMatrix(matrixStack); transformMatrix(matrixStack);
matrixStack.scale(1, -1, 1);
matrixStack.translate(0, 0, -75);
renderItemIntoGUI(matrixStack, stack); renderItemIntoGUI(matrixStack, stack);
cleanUpMatrix(matrixStack); cleanUpMatrix(matrixStack);
} }
public static void renderItemIntoGUI(MatrixStack matrixStack, ItemStack stack) { 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); IBakedModel bakedModel = renderer.getItemModelWithOverrides(stack, null, null);
matrixStack.push(); matrixStack.push();
renderer.textureManager.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE); 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.enableRescaleNormal();
RenderSystem.enableAlphaTest(); RenderSystem.enableAlphaTest();
RenderSystem.defaultAlphaFunc(); RenderSystem.defaultAlphaFunc();
RenderSystem.enableBlend(); 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); 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.translate(8.0F, 8.0F, 0.0F);
matrixStack.scale(1.0F, -1.0F, 1.0F);
matrixStack.scale(16.0F, 16.0F, 16.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(); boolean flag = !bakedModel.isSideLit();
if (flag) { if (flag) {
RenderHelper.disableGuiDepthLighting(); 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(); irendertypebuffer$impl.draw();
RenderSystem.enableDepthTest(); RenderSystem.enableDepthTest();
if (flag) { if (flag) {
@ -330,6 +334,7 @@ public class GuiGameElement {
RenderSystem.disableAlphaTest(); RenderSystem.disableAlphaTest();
RenderSystem.disableRescaleNormal(); RenderSystem.disableRescaleNormal();
RenderSystem.enableCull();
matrixStack.pop(); matrixStack.pop();
} }

View File

@ -17,7 +17,8 @@ import net.minecraft.util.text.StringTextComponent;
public class ToolSelectionScreen extends Screen { 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"; public final String holdToFocus = "gui.toolmenu.focusKey";
protected List<Tools> tools; protected List<Tools> tools;
@ -63,7 +64,6 @@ public class ToolSelectionScreen extends Screen {
if (!initialized) if (!initialized)
init(mc, mainWindow.getScaledWidth(), mainWindow.getScaledHeight()); init(mc, mainWindow.getScaledWidth(), mainWindow.getScaledHeight());
int x = (mainWindow.getScaledWidth() - w) / 2 + 15; int x = (mainWindow.getScaledWidth() - w) / 2 + 15;
int y = mainWindow.getScaledHeight() - h - 75; int y = mainWindow.getScaledHeight() - h - 75;
@ -74,11 +74,14 @@ public class ToolSelectionScreen extends Screen {
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.color4f(1, 1, 1, focused ? 7 / 8f : 1 / 2f); 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); drawTexture(matrixStack, x - 15, y, gray.startX, gray.startY, w, h, gray.width, gray.height);
float toolTipAlpha = yOffset / 10; float toolTipAlpha = yOffset / 10;
List<ITextComponent> toolTip = tools.get(selection).getDescription(); List<ITextComponent> toolTip = tools.get(selection)
.getDescription();
int stringAlphaComponent = ((int) (toolTipAlpha * 0xFF)) << 24; int stringAlphaComponent = ((int) (toolTipAlpha * 0xFF)) << 24;
if (toolTipAlpha > 0.25f) { if (toolTipAlpha > 0.25f) {
@ -99,10 +102,11 @@ public class ToolSelectionScreen extends Screen {
RenderSystem.color4f(1, 1, 1, 1); RenderSystem.color4f(1, 1, 1, 1);
if (tools.size() > 1) { if (tools.size() > 1) {
String keyName = AllKeys.TOOL_MENU.getBoundKey(); String keyName = AllKeys.TOOL_MENU.getBoundKey();
int width = client.getWindow().getScaledWidth(); int width = client.getWindow()
.getScaledWidth();
if (!focused) if (!focused)
drawCenteredString(matrixStack, client.fontRenderer, Lang.translate(holdToFocus, keyName).getUnformattedComponentText(), width / 2, y - 10, drawCenteredText(matrixStack, client.fontRenderer, Lang.translate(holdToFocus, keyName), width / 2,
0xCCDDFF); y - 10, 0xCCDDFF);
else else
drawCenteredString(matrixStack, client.fontRenderer, scrollToCycle, width / 2, y - 10, 0xCCDDFF); drawCenteredString(matrixStack, client.fontRenderer, scrollToCycle, width / 2, y - 10, 0xCCDDFF);
} else { } else {
@ -115,14 +119,19 @@ public class ToolSelectionScreen extends Screen {
float alpha = focused ? 1 : .2f; float alpha = focused ? 1 : .2f;
if (i == selection) { if (i == selection) {
matrixStack.translate(0, -10, 0); matrixStack.translate(0, -10, 0);
drawCenteredString(matrixStack, client.fontRenderer, tools.get(i).getDisplayName().getUnformattedComponentText(), x + i * 50 + 24, y + 28, drawCenteredString(matrixStack, client.fontRenderer, tools.get(i)
0xCCDDFF); .getDisplayName()
.getString(), x + i * 50 + 24, y + 28, 0xCCDDFF);
alpha = 1; alpha = 1;
} }
RenderSystem.color4f(0, 0, 0, alpha); 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); 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(); 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 @Override
public ActionResultType onUse(BlockState state, World world, BlockPos pos, public ActionResultType onUse(BlockState state, World world, BlockPos pos,
PlayerEntity player, Hand hand, BlockRayTraceResult blockRayTraceResult) { PlayerEntity player, Hand hand, BlockRayTraceResult blockRayTraceResult) {

View File

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