From c1302ec9db1b2484e024d165b307036cfd76342f Mon Sep 17 00:00:00 2001 From: TheBigEye Date: Sun, 15 Jan 2023 23:55:43 -0300 Subject: [PATCH 1/5] Fix lighting rendering Lanterns, specifically the gold one, have a larger light radius than the radius the game is able to render once the source object is off screen rendering --- src/main/java/minicraft/level/Level.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/minicraft/level/Level.java b/src/main/java/minicraft/level/Level.java index 3a624e0e5..270635ff0 100644 --- a/src/main/java/minicraft/level/Level.java +++ b/src/main/java/minicraft/level/Level.java @@ -463,6 +463,8 @@ public void renderLight(Screen screen, int xScroll, int yScroll, int brightness) int h = (Screen.h + 15) >> 4; screen.setOffset(xScroll, yScroll); + + // this specifies the maximum radius that the game will stop rendering the light from the source object once off screen int r = 4; List entities = getEntitiesInTiles(xo - r, yo - r, w + xo + r, h + yo + r); From a775801980ad45a83e01151eba3e44620c69d7af Mon Sep 17 00:00:00 2001 From: TheBigEye Date: Mon, 16 Jan 2023 00:07:36 -0300 Subject: [PATCH 2/5] Increase max radius (I forgot to do it) --- src/main/java/minicraft/level/Level.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/minicraft/level/Level.java b/src/main/java/minicraft/level/Level.java index 270635ff0..60e4b7dd6 100644 --- a/src/main/java/minicraft/level/Level.java +++ b/src/main/java/minicraft/level/Level.java @@ -465,7 +465,7 @@ public void renderLight(Screen screen, int xScroll, int yScroll, int brightness) screen.setOffset(xScroll, yScroll); // this specifies the maximum radius that the game will stop rendering the light from the source object once off screen - int r = 4; + int r = 8; List entities = getEntitiesInTiles(xo - r, yo - r, w + xo + r, h + yo + r); for (Entity e: entities) { From 3538b8ebe02dae03709c8666278ad9342cf54d7f Mon Sep 17 00:00:00 2001 From: Makkkkus <37084190+Makkkkus@users.noreply.github.com> Date: Mon, 16 Jan 2023 12:54:53 +0100 Subject: [PATCH 3/5] Update ChangeLog.md --- ChangeLog.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index a5065abf4..a8d99c7be 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -53,8 +53,9 @@ but some sections are changed to compliant this project. * For localizations, sounds, textures, books * Does not rule out the possibility of addition of a standard resource manager * Reapplied the role of seeds (the sameness with same seed) -* Now renders the parent display as background. -* Changed the height requirement on skin images from 32 pixels to 16 pixels. +* Now renders the parent display as background +* Changed the height requirement on skin images from 32 pixels to 16 pixels +* Fixed lights disappearing when out of screen ### Removals From 67f32338c450b6516f9de25e415ff62d73278354 Mon Sep 17 00:00:00 2001 From: TheBigEye Date: Tue, 17 Jan 2023 21:27:27 -0300 Subject: [PATCH 4/5] Improved player's tile indicator * Now corresponds to the size and outline of the tile * Now it will not render if the player is swimming --- ChangeLog.md | 1 + .../java/minicraft/entity/mob/Player.java | 55 ++++++++++++++---- .../resources/assets/textures/gui/hud.png | Bin 1073 -> 1050 bytes 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index a8d99c7be..d82305f49 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -56,6 +56,7 @@ but some sections are changed to compliant this project. * Now renders the parent display as background * Changed the height requirement on skin images from 32 pixels to 16 pixels * Fixed lights disappearing when out of screen +* Improved player's tile indicator ### Removals diff --git a/src/main/java/minicraft/entity/mob/Player.java b/src/main/java/minicraft/entity/mob/Player.java index eb19e5ed5..4943e1c2c 100644 --- a/src/main/java/minicraft/entity/mob/Player.java +++ b/src/main/java/minicraft/entity/mob/Player.java @@ -1,34 +1,65 @@ package minicraft.entity.mob; +import java.util.HashMap; +import java.util.List; + +import org.jetbrains.annotations.Nullable; + import minicraft.core.Game; import minicraft.core.Updater; import minicraft.core.World; import minicraft.core.io.InputHandler; import minicraft.core.io.Settings; import minicraft.core.io.Sound; -import minicraft.entity.*; +import minicraft.entity.Arrow; +import minicraft.entity.ClientTickable; +import minicraft.entity.Direction; +import minicraft.entity.Entity; +import minicraft.entity.ItemEntity; +import minicraft.entity.ItemHolder; import minicraft.entity.furniture.Bed; import minicraft.entity.furniture.DeathChest; import minicraft.entity.furniture.Furniture; import minicraft.entity.furniture.Tnt; import minicraft.entity.particle.Particle; import minicraft.entity.particle.TextParticle; -import minicraft.gfx.*; +import minicraft.gfx.Color; +import minicraft.gfx.Point; +import minicraft.gfx.Rectangle; +import minicraft.gfx.Screen; +import minicraft.gfx.Sprite; import minicraft.gfx.SpriteLinker.LinkedSprite; import minicraft.gfx.SpriteLinker.SpriteType; -import minicraft.item.*; +import minicraft.item.ArmorItem; +import minicraft.item.FishingData; +import minicraft.item.FishingRodItem; +import minicraft.item.FurnitureItem; +import minicraft.item.Inventory; +import minicraft.item.Item; +import minicraft.item.Items; +import minicraft.item.PotionItem; +import minicraft.item.PotionType; +import minicraft.item.PowerGloveItem; +import minicraft.item.Recipes; +import minicraft.item.StackableItem; +import minicraft.item.TileItem; +import minicraft.item.ToolItem; +import minicraft.item.ToolType; import minicraft.level.Level; import minicraft.level.tile.Tile; import minicraft.level.tile.Tiles; import minicraft.network.Analytics; import minicraft.saveload.Save; -import minicraft.screen.*; +import minicraft.screen.AchievementsDisplay; +import minicraft.screen.CraftingDisplay; +import minicraft.screen.InfoDisplay; +import minicraft.screen.LoadingDisplay; +import minicraft.screen.PauseDisplay; +import minicraft.screen.PlayerInvDisplay; +import minicraft.screen.SkinDisplay; +import minicraft.screen.WorldSelectDisplay; import minicraft.util.Logging; import minicraft.util.Vector2; -import org.jetbrains.annotations.Nullable; - -import java.util.HashMap; -import java.util.List; public class Player extends Mob implements ItemHolder, ClientTickable { protected InputHandler input; @@ -768,10 +799,12 @@ public void render(Screen screen) { } // Renders indicator for what tile the item will be placed on - if (activeItem instanceof TileItem) { + if (activeItem instanceof TileItem && !isSwimming()) { Point t = getInteractionTile(); - - screen.render(t.x * 16 + 4, t.y * 16 + 4, 3, 2, 0, hudSheet.getSheet()); + screen.render(t.x * 16, t.y * 16, 3, 2, 0, hudSheet.getSheet()); + screen.render(t.x * 16 + 8, t.y * 16, 3, 2, 1, hudSheet.getSheet()); + screen.render(t.x * 16, t.y * 16 + 8, 3, 2, 2, hudSheet.getSheet()); + screen.render(t.x * 16 + 8, t.y * 16 + 8, 3, 2, 3, hudSheet.getSheet()); } // Makes the player white if they have just gotten hurt diff --git a/src/main/resources/assets/textures/gui/hud.png b/src/main/resources/assets/textures/gui/hud.png index 00fe39527865f04f94a41bf6106ad38e77d2a4d5..344d345d03601d9aeca935d31b6b0d4e10fafeaa 100644 GIT binary patch delta 1016 zcmVpI zuSrBfR9HvdmrqC(Q5?tLc2IDsgc1qy6jHV-6bN3VAVUi}Msx@~d6DQO-AsiJ>7j!N zBK`3e-hv>M6pE+>p}<%yq7Lp!Ezn{^y=?RS`F`tf-~4+sJAcB~2gcv;&CHv5pZU#u zv!;~8rTY2;;>)$Ql*|z&y}jq?7?_^^;5uHBK?vY)~a3G&(w}wzr?F!NE8B=zbL;G=0B|_A$M8 z=GB+YO;?pok$;qfPU)Cz`!PBBu6T{5d)IZQ)T3O^)t3Zy?gD}hmm3tznLzgav+v53 zV@yd?4w!<7ev&LUGqXZ%aC75<&Xjt)wM9{i(ww_dSErl%aP{y?`pE$ZwzaiUZnC_* zTojaYegZ+~K#s+-*&h@^|Ivp!Q>wALnj%D5lKz;IEPsbw&bN_~PKuC|uVE+?Ty8oFD<#BmJLz>SU8j=NkX~ZU1~H|RVkTENyufhKPk^-j=2QQD*9C~3BgFO zXiZH`$$t$cENRLyEGZunV?H2Y%7G|?u@;#y!6QwFon?7X&IGc*zWy#&-Ncl%73}Nl zqc}A+g+M37{!Dm1eZYhBdjMQXTR~IK5u^Px<5xYezwqe$) z6d}rzbQ4oj4oogAUUSgz0Rb;T7GpX(I$VPMU4O-Qba8Q!&W~L|+T*|jHD4FnsOlQ^MHOjEy3$r9(eW@xURvXAaoV&KYusy1{1G` zi=Fs216+}~{h24Nt*YzAMaoykKdbJsIdhPK*LUu(GjB++|H6=Nx;ZnvCxXGH(`nk5 z&wuAj1jG7EG498#uHL3&^H&z=KbJUyLH9qTV<4s+kb|}XVn8=ta21m#R8YzRPutC+ML14+5*-En1;$c57BlZDyYS=H0i9|(W me__y3u>MT^tNiDJO8o^n+uOg}0%lPF0000Kr2(bu|Fn4fXQko9!Dv=gpg$ zw@+h*=CbqVeQ)ObeShCuhcU)3HZ*wf`*Ll~p>tTHqrbm{%YVU`nR)NX_p9-m16{AL z=ej*vUuSdG*ZgKM1cr=grjt*zd< z!9n&RoAvDrzyOJGTU*cA@bGIPhh7A@nY+Dvy*;#`ghVhDrckz!Q&Vq+F_-UL6X!lG z6nsYIfI$`mz<g~y2Sl z0$sQ9bf_Gpn*$`RoD>k}s`emPP?R-QQWdZbppBtWhKDFB2nx};yisRo({A-z_E#*M zgB4ZO^jM^R%Yh0zJN%HQni@vu)B^yQ&;Q_Z@%VAJECJf~!TkUX6{5AZwSjE{fB{m5 zLz5#UHGdM`!)Jr?ON3Cl&+CQ|sHn)80FO2wVdyzo3-IL6FTaG><@+*ZKp*tM4GawM zwdv_;_~C#Rw+WT?F&T*fw2KJ zGRqPx5U~#i7P-H=`KnN;Dw^sZ(H=1QYD^rU zYQm=H?=OvNOXTCWHrD(60+(5x_{93M^D>ZDzf|{#z667Ush(gZ&W`PVueq+vH!GD& z;(t5N^nAnN`Qt7J`6;M|sCYSV8+H_w4qLN_&ySkdIACSU9 zn1vaK!h Date: Wed, 18 Jan 2023 10:42:59 -0300 Subject: [PATCH 5/5] Fix fishing data wrong path When they made changes to the game's resource directory, they forgot to also update the path where the fishing system loot is obtained --- src/main/java/minicraft/item/FishingData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/minicraft/item/FishingData.java b/src/main/java/minicraft/item/FishingData.java index 84f4c27f4..09f2531f2 100644 --- a/src/main/java/minicraft/item/FishingData.java +++ b/src/main/java/minicraft/item/FishingData.java @@ -19,7 +19,7 @@ public class FishingData { public static List getData(String name) { List data; try { - data = Load.loadFile("/resources/fishing/" + name + "_loot.txt"); + data = Load.loadFile("/resources/data/fishing/" + name + "_loot.txt"); } catch (IOException e) { e.printStackTrace(); data = new ArrayList<>();