From 52010d8b5ac5b028d3e2f803513acf2d49878a87 Mon Sep 17 00:00:00 2001 From: austin Date: Thu, 3 Apr 2025 13:33:22 -0400 Subject: [PATCH] new items + serverentityutils update --- assets/Data/entity/items/materials.json | 52 ++++++++++++++++++ assets/Models/items/materials/rock1.glb | Bin 0 -> 2848 bytes assets/Models/items/materials/stick1.glb | Bin 0 -> 5140 bytes assets/Models/items/materials/texturemap.json | 14 +++++ docs/src/progress/renderertodo.md | 4 ++ .../entity/ServerEntityUtils.java | 4 +- .../server/datacell/ServerDataCell.java | 23 ++++---- 7 files changed, 84 insertions(+), 13 deletions(-) create mode 100644 assets/Models/items/materials/rock1.glb create mode 100644 assets/Models/items/materials/stick1.glb diff --git a/assets/Data/entity/items/materials.json b/assets/Data/entity/items/materials.json index 59b0a4c6..cf6c8c8e 100644 --- a/assets/Data/entity/items/materials.json +++ b/assets/Data/entity/items/materials.json @@ -25,6 +25,58 @@ "offsetZ" : 0 }, "iconPath" : "Textures/icons/itemIconItemGeneric.png" + }, + { + "id" : "Rock", + "tokens" : [ + "GRAVITY", + "TARGETABLE" + ], + "graphicsTemplate": { + "model": { + "path" : "Models/items/materials/rock1.glb" + } + }, + "collidable": { + "type" : "CUBE", + "dimension1" : 0.1, + "dimension2" : 0.1, + "dimension3" : 0.35, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "rotW": 1, + "offsetX" : 0, + "offsetY" : 0.05, + "offsetZ" : 0 + }, + "iconPath" : "Textures/icons/itemIconItemGeneric.png" + }, + { + "id" : "Stick", + "tokens" : [ + "GRAVITY", + "TARGETABLE" + ], + "graphicsTemplate": { + "model": { + "path" : "Models/items/materials/stick1.glb" + } + }, + "collidable": { + "type" : "CUBE", + "dimension1" : 0.1, + "dimension2" : 0.1, + "dimension3" : 0.35, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "rotW": 1, + "offsetX" : 0, + "offsetY" : 0.05, + "offsetZ" : 0 + }, + "iconPath" : "Textures/icons/itemIconItemGeneric.png" } ], "files" : [ diff --git a/assets/Models/items/materials/rock1.glb b/assets/Models/items/materials/rock1.glb new file mode 100644 index 0000000000000000000000000000000000000000..05bd95d75fed32c13f9a00bb154b08e47c0fad42 GIT binary patch literal 2848 zcmb7G4Nw$E7H$O<5LEsZP+^uJ8nVpn>>s$(9YjnZz#2eBh@1;MEbFnmxGW%W7z9J2 zDUwqw>WODaG(j(#6217#%$SQ83As{?#^2et_N z_xs-W-s`CvTV=t5u?V5qi3riY2xaA)a~mm3bv5syQX457@8sPUkIPM^QqNVmT~1eZ ztPNaZ=T-7fEANiYOg6{XYSoNd&r(TLE$^-k_H?EqnCVNICfG3a{(v`ShAno|2C^EFRu%w^Tl4v$|?ZEBSo8 zmA6u<9(N5791jEJjGj}|Gy~$QO5HiU$5L5oFUxb)*eaZSH83Ra@@pft(43!HkZI2KD$Os29~CYZOs+J1M6GdmHSVMX?K3Z-MmIj3xlG?$U_^2 zsBb$2C0_j9ZQ;e`b=>Ohf}q5|ZaUW!w4j-*851cUdTWCaK4=lxhAHCh%lAy*7wSY) zc#9BI6^HM34GVtO3&+o?RJcghZ9;cih4;?;;#J|dx#pKWbI%EogUu|2sy1*@c~`m5 zOI3pUXeL(TdH#Rrq!0C6_iQ~@VpH9v*)`h*RP-(etJ3uT|1yn^S0R8xhO%Bc-{e zD$-`5q#xeTAWPdLg$IQZ#Ia)pZzA#1K>sk-*X|N+r_55>6(jkkDvAsg@54%5xLhk8 zS~?&sw6SFA79H{YbFy?}&t+Wk?#<&pgPFu?o=)b5O_%n1&f=`=Nrd(*lD-@G3j2S# z2|vR$NY7rlA=GCZaL#;(^yRsBy!F#HVo_zf)VHWZ?7tT*De<63D{UR_#6>45Nr?}y zunAO43I3wCUfMIRRXozSQCzvCQYr~~pL=s%mb4%!T5`-QAs_wzjJV6WQT%YQkmUaM zADn-OuOxA~WY`f&F1#{M*xA=WE_C=}9vx4)b~KH>tzz{P|paq$ivDTsI*57BW% ziR(W;HrH|JdGX?g1~PM5r|_QPRlILq4Ow}$S9H$ImpV81i%PuUok?VNYo2sv$t|I4 zs8g^^u9x}_mtZ9>US`LqFVB%CHtUEIzuFsypFWpKR`^YmT0(}zIMzVY|AHRF`@TBE z>E2mQP+E&giGw}+@m50PfmLpN((gE?GgCfp3LJHZVLEB${|z9wrX-@ z-Dfy)(rX-AsmJqAzd#b}bR+;xL=(^$6bS!o695OIAT$;Qqsb@~g`rs}1Wf_t3pfO9 zC|Dm90Vo26qp8TxYolO}LQjC5fu^HrFl5FVC;;Z^fa1Yhg<@g&!6_ez4+E=$ wh!n(B0rrEL0+keaj{yx~kex5YiG$$>HW)M~LL@oEM8I?4@rS&|LN@;BKes2-?f?J) literal 0 HcmV?d00001 diff --git a/assets/Models/items/materials/stick1.glb b/assets/Models/items/materials/stick1.glb new file mode 100644 index 0000000000000000000000000000000000000000..30de2a89ac57a704d0adbb48e17c8fbd27a2591f GIT binary patch literal 5140 zcmb_f3s6+o8U8Vf;-exGAF)Qf8kLB+d-ut5?>P}rM1cj_fCf;3y)3J+OZGu|NPJAF zqct>Os%TAhtcg`ZGNaL0yt|iF#W)&mqAe}0k7`Vl`badU4@jivE}%yBN5 z?*D)Pf4=jdoxxIUnl}Id!ovZ$fdC6KjHy*jp3^C~7(*3f5p04Z&t-Qo24-QA!)~)X zBP=8(BCc4lnFU8g(rjZynL1h-tyM8mOqt+tTJ1Ix%tkAi>L|upKm-_rqK7#dLv|Ho z%PS#kOos1U6l1fS1^I&_w>tOXTNP6xIE#F#J@N4s#a6i{BZrmbxdewbuee*$Yz-9=J*;-VD_C26oU-;pA?@`{VC1&i!%OOZ`*5{0U2pCqa0Yve(P z4=R#Ghqc7&vX=D(U26*uhp&UZ+yVXtfG9N?z2ev?N%k)2oS$UZs&2 zHF`CxAfY;qMyDZqM8)N6kjb1IuOb6b#n2lemOODI|0|#EQ$G8H`o#7h*7q%T8!4OG zQ$HhqPV$^ZzEOL)1Nvxu$C6*+5|Ra*#YF~HsaBG7dBs>*=(|2->Rovbi+qz*>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ygwWWFTu+&5`tkec}|8guoQj-W>^N{PzVgHgd%tj++YJEU|0+WNCO?@0}C@? z8U#Tyya@5I04BmhQg#R^U=(OzJdB2Ph=6Cn0g1qa9pZq4nUD(wFb{IzdB}!AFaq*m zI6Mtj7zrOPPm#Z25JsM1 children = AttachUtils.getChildrenList(entity); for(Entity child : children){ - repositionEntityRecursive(realm, child, position); + ServerEntityUtils.repositionEntityRecursive(realm, child, position); } } } diff --git a/src/main/java/electrosphere/server/datacell/ServerDataCell.java b/src/main/java/electrosphere/server/datacell/ServerDataCell.java index d04efad1..914cefbd 100644 --- a/src/main/java/electrosphere/server/datacell/ServerDataCell.java +++ b/src/main/java/electrosphere/server/datacell/ServerDataCell.java @@ -186,14 +186,13 @@ public class ServerDataCell { if(entity == null){ throw new Error("Passed null entity! " + entity); } - if(oldCell == null){ - throw new Error("Passed null oldCell! " + oldCell); - } if(newCell == null){ throw new Error("Passed null newCell! " + newCell); } //swap which holds the entity - oldCell.getScene().deregisterEntity(entity); + if(oldCell != null){ + oldCell.getScene().deregisterEntity(entity); + } newCell.getScene().registerEntity(entity); //update entity data cell mapper Globals.entityDataCellMapper.updateEntityCell(entity, newCell); @@ -212,13 +211,15 @@ public class ServerDataCell { } } //delete the entity for players that dont care about it - for(Player player : oldCell.activePlayers){ - if( - !newCell.containsPlayer(player) && - (player.getPlayerEntity() == null || player.getPlayerEntity() != entity) - ){ - //if the player isn't also in the new cell, delete the entity - player.addMessage(EntityMessage.constructDestroyMessage(entity.getId())); + if(oldCell != null){ + for(Player player : oldCell.activePlayers){ + if( + !newCell.containsPlayer(player) && + (player.getPlayerEntity() == null || player.getPlayerEntity() != entity) + ){ + //if the player isn't also in the new cell, delete the entity + player.addMessage(EntityMessage.constructDestroyMessage(entity.getId())); + } } } }