Skip to content

Commit

Permalink
Update to 1.16.2-pre1
Browse files Browse the repository at this point in the history
Changes:
* Migrate yarn mappings
* Update to loom 0.4
* Update loader requirement to 0.9.0
* Update minimum minecraft version to 1.16.2-beta.1 (= pre1)
* Gui: Tooltip methods prefer Text now
  • Loading branch information
Sturmlilie committed Aug 3, 2020
1 parent 8e8c1b3 commit 9c6eb02
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath "net.fabricmc:fabric-loom:0.2.7-SNAPSHOT"
classpath "net.fabricmc:fabric-loom:0.4-SNAPSHOT"
}
}

Expand Down
8 changes: 4 additions & 4 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
minecraft.simpleversion=1.16-pre2
minecraft.version=com.mojang:minecraft:1.16-pre2
fabric.mappings=net.fabricmc:yarn:1.16-pre2+build.29:v2
fabric.loader=net.fabricmc:fabric-loader:0.8.7+build.201
minecraft.simpleversion=1.16.2-pre1
minecraft.version=com.mojang:minecraft:1.16.2-pre1
fabric.mappings=net.fabricmc:yarn:1.16.2-pre1+build.16
fabric.loader=net.fabricmc:fabric-loader:0.9.0+build.204
fabric.api=net.fabricmc.fabric-api:fabric-api:0.11.7+build.356-1.16

mod.name=TIS-3D
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/li/cil/tis3d/client/gui/CodeBookGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.text.LiteralText;
import net.minecraft.text.StringRenderable;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Hand;
import org.lwjgl.glfw.GLFW;
Expand Down Expand Up @@ -644,16 +644,16 @@ private void drawProgram(final MatrixStack matrices, final int mouseX, final int

// Part two of error handling, draw tooltip, *on top* of blinking cursor.
if (mouseX >= startX && mouseX <= endX && mouseY >= startY && mouseY <= startY + getTextRenderer().fontHeight) {
final List<StringRenderable> tooltip = new ArrayList<>();
final List<Text> tooltip = new ArrayList<>();
if (isErrorOnPreviousPage) {
tooltip.add(new TranslatableText(Constants.MESSAGE_ERROR_ON_PREVIOUS_PAGE));
} else if (isErrorOnNextPage) {
tooltip.add(new TranslatableText(Constants.MESSAGE_ERROR_ON_NEXT_PAGE));
}
final String translatedException = I18n.translate(exception.getMessage());
final List<String> lines = Arrays.asList(Constants.PATTERN_LINES.split(translatedException));
tooltip.addAll(lines.stream().map(StringRenderable::plain).collect(Collectors.toList()));
renderTooltip(matrices, tooltip, mouseX, mouseY);
tooltip.addAll(lines.stream().map(Text::of).collect(Collectors.toList()));
method_30901(matrices, tooltip, mouseX, mouseY);
GlStateManager.disableLighting();
}
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/li/cil/tis3d/client/gui/ManualGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import net.minecraft.client.util.Window;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.LiteralText;
import net.minecraft.text.StringRenderable;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
Expand Down Expand Up @@ -146,7 +145,7 @@ public void render(final MatrixStack matrices, final int mouseX, final int mouse
}

if (canScroll() && (isCoordinateOverScrollBar(mouseX - guiLeft, mouseY - guiTop) || isDragging)) {
renderTooltip(matrices, StringRenderable.plain(100 * offset() / maxOffset() + "%"), guiLeft + SCROLL_POS_X + SCROLL_WIDTH, scrollButton.y + scrollButton.getHeight() + 1);
renderTooltip(matrices, new LiteralText(100 * offset() / maxOffset() + "%"), guiLeft + SCROLL_POS_X + SCROLL_WIDTH, scrollButton.y + scrollButton.getHeight() + 1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ private HitResult checkEntityCollision(final World world, final Vec3d start, fin
EntityHitResult entityHit = null;
double bestSqrDistance = Double.POSITIVE_INFINITY;

final List<Entity> collisions = world.getEntities(this, getBoundingBox().stretch(getVelocity()), EntityPredicates.EXCEPT_SPECTATOR);
final List<Entity> collisions = world.getOtherEntities(this, getBoundingBox().stretch(getVelocity()), EntityPredicates.EXCEPT_SPECTATOR);
for (final Entity entity : collisions) {
if (entity.collides()) {
final Box entityBounds = entity.getBoundingBox();
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
]
},
"depends": {
"minecraft": ">=1.16-rc2",
"fabricloader": ">=0.4.1",
"minecraft": ">=1.16.2-beta.1",
"fabricloader": ">=0.9.0",
"fabric": ">=0.2.7"
},
"mixins": [
Expand Down

0 comments on commit 9c6eb02

Please sign in to comment.