Merge branch 'mc1.16/dev' of https://github.com/Creators-of-Create/Create.git into mc1.16/dev

This commit is contained in:
PepperBell 2021-06-16 12:21:02 -07:00
commit 645086e45f
5 changed files with 11 additions and 19 deletions

View File

@ -22,6 +22,7 @@ import com.simibubi.create.foundation.utility.outliner.Outliner.OutlineEntry;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ItemStack;
@ -33,24 +34,15 @@ import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.ITextProperties;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
@EventBusSubscriber(value = Dist.CLIENT)
public class GoggleOverlayRenderer {
private static final Map<Object, OutlineEntry> outlines = CreateClient.OUTLINER.getOutlines();
@SubscribeEvent
public static void lookingAtBlocksThroughGogglesShowsTooltip(RenderGameOverlayEvent.Post event) {
MatrixStack ms = event.getMatrixStack();
if (event.getType() != ElementType.HOTBAR)
return;
public static void renderOverlay(MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay,
float partialTicks) {
RayTraceResult objectMouseOver = Minecraft.getInstance().objectMouseOver;
if (!(objectMouseOver instanceof BlockRayTraceResult))
return;
@ -58,9 +50,8 @@ public class GoggleOverlayRenderer {
if (!entry.isAlive())
continue;
Outline outline = entry.getOutline();
if (outline instanceof ValueBox && !((ValueBox) outline).isPassive) {
if (outline instanceof ValueBox && !((ValueBox) outline).isPassive)
return;
}
}
BlockRayTraceResult result = (BlockRayTraceResult) objectMouseOver;

View File

@ -191,12 +191,11 @@ public class SchematicHandler {
return;
if (activeSchematicItem != null)
this.overlay.renderOn(ms, activeHotbarSlot);
currentTool.getTool()
.renderOverlay(ms, buffer);
selectionScreen.renderPassive(ms, partialTicks);
}
public void onMouseInput(int button, boolean pressed) {
if (!active)
return;

View File

@ -14,11 +14,10 @@ public class SchematicHotbarSlotOverlay extends AbstractGui {
MainWindow mainWindow = Minecraft.getInstance().getWindow();
int x = mainWindow.getScaledWidth() / 2 - 88;
int y = mainWindow.getScaledHeight() - 19;
RenderSystem.enableAlphaTest();
RenderSystem.enableDepthTest();
RenderSystem.enableBlend();
matrixStack.push();
AllGuiTextures.SCHEMATIC_SLOT.draw(matrixStack, this, x + 20 * slot, y);
RenderSystem.disableAlphaTest();
matrixStack.pop();
}
}

View File

@ -21,6 +21,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.tra
import com.simibubi.create.content.contraptions.components.structureMovement.train.CouplingRenderer;
import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.CapabilityMinecartController;
import com.simibubi.create.content.contraptions.components.turntable.TurntableHandler;
import com.simibubi.create.content.contraptions.goggles.GoggleOverlayRenderer;
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
import com.simibubi.create.content.contraptions.relays.belt.item.BeltConnectorHandler;
import com.simibubi.create.content.curiosities.armor.CopperBacktankArmorLayer;
@ -228,6 +229,7 @@ public class ClientEvents {
CreateClient.SCHEMATIC_HANDLER.renderOverlay(ms, buffer, light, overlay, partialTicks);
LinkedControllerClientHandler.renderOverlay(ms, buffer, light, overlay, partialTicks);
BlueprintOverlayRenderer.renderOverlay(ms, buffer, light, overlay, partialTicks);
GoggleOverlayRenderer.renderOverlay(ms, buffer, light, overlay, partialTicks);
}
@SubscribeEvent

View File

@ -136,6 +136,7 @@ public class ToolSelectionScreen extends Screen {
matrixStack.pop();
}
RenderSystem.enableBlend();
matrixStack.pop();
}