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.block.BlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.world.ClientWorld; import net.minecraft.client.world.ClientWorld;
import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ItemStack; 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.ITextComponent;
import net.minecraft.util.text.ITextProperties; import net.minecraft.util.text.ITextProperties;
import net.minecraft.util.text.StringTextComponent; 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 { public class GoggleOverlayRenderer {
private static final Map<Object, OutlineEntry> outlines = CreateClient.OUTLINER.getOutlines(); private static final Map<Object, OutlineEntry> outlines = CreateClient.OUTLINER.getOutlines();
@SubscribeEvent public static void renderOverlay(MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay,
public static void lookingAtBlocksThroughGogglesShowsTooltip(RenderGameOverlayEvent.Post event) { float partialTicks) {
MatrixStack ms = event.getMatrixStack();
if (event.getType() != ElementType.HOTBAR)
return;
RayTraceResult objectMouseOver = Minecraft.getInstance().objectMouseOver; RayTraceResult objectMouseOver = Minecraft.getInstance().objectMouseOver;
if (!(objectMouseOver instanceof BlockRayTraceResult)) if (!(objectMouseOver instanceof BlockRayTraceResult))
return; return;
@ -58,9 +50,8 @@ public class GoggleOverlayRenderer {
if (!entry.isAlive()) if (!entry.isAlive())
continue; continue;
Outline outline = entry.getOutline(); Outline outline = entry.getOutline();
if (outline instanceof ValueBox && !((ValueBox) outline).isPassive) { if (outline instanceof ValueBox && !((ValueBox) outline).isPassive)
return; return;
}
} }
BlockRayTraceResult result = (BlockRayTraceResult) objectMouseOver; BlockRayTraceResult result = (BlockRayTraceResult) objectMouseOver;

View file

@ -191,7 +191,6 @@ public class SchematicHandler {
return; return;
if (activeSchematicItem != null) if (activeSchematicItem != null)
this.overlay.renderOn(ms, activeHotbarSlot); this.overlay.renderOn(ms, activeHotbarSlot);
currentTool.getTool() currentTool.getTool()
.renderOverlay(ms, buffer); .renderOverlay(ms, buffer);
selectionScreen.renderPassive(ms, partialTicks); selectionScreen.renderPassive(ms, partialTicks);

View file

@ -14,11 +14,10 @@ public class SchematicHotbarSlotOverlay extends AbstractGui {
MainWindow mainWindow = Minecraft.getInstance().getWindow(); MainWindow mainWindow = Minecraft.getInstance().getWindow();
int x = mainWindow.getScaledWidth() / 2 - 88; int x = mainWindow.getScaledWidth() / 2 - 88;
int y = mainWindow.getScaledHeight() - 19; int y = mainWindow.getScaledHeight() - 19;
RenderSystem.enableAlphaTest();
RenderSystem.enableDepthTest(); RenderSystem.enableDepthTest();
RenderSystem.enableBlend(); matrixStack.push();
AllGuiTextures.SCHEMATIC_SLOT.draw(matrixStack, this, x + 20 * slot, y); 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.CouplingRenderer;
import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.CapabilityMinecartController; 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.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.goggles.IHaveGoggleInformation;
import com.simibubi.create.content.contraptions.relays.belt.item.BeltConnectorHandler; import com.simibubi.create.content.contraptions.relays.belt.item.BeltConnectorHandler;
import com.simibubi.create.content.curiosities.armor.CopperBacktankArmorLayer; import com.simibubi.create.content.curiosities.armor.CopperBacktankArmorLayer;
@ -228,6 +229,7 @@ public class ClientEvents {
CreateClient.SCHEMATIC_HANDLER.renderOverlay(ms, buffer, light, overlay, partialTicks); CreateClient.SCHEMATIC_HANDLER.renderOverlay(ms, buffer, light, overlay, partialTicks);
LinkedControllerClientHandler.renderOverlay(ms, buffer, light, overlay, partialTicks); LinkedControllerClientHandler.renderOverlay(ms, buffer, light, overlay, partialTicks);
BlueprintOverlayRenderer.renderOverlay(ms, buffer, light, overlay, partialTicks); BlueprintOverlayRenderer.renderOverlay(ms, buffer, light, overlay, partialTicks);
GoggleOverlayRenderer.renderOverlay(ms, buffer, light, overlay, partialTicks);
} }
@SubscribeEvent @SubscribeEvent

View file

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