item work
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
f6fe44b178
commit
43bb67ca57
@ -1765,6 +1765,8 @@ Unified container movement utils
|
||||
Break up InventoryUtils class
|
||||
Update inventory utility logic
|
||||
Fix styling for inventory panel ui element
|
||||
Fix content serialization bug with attached items
|
||||
Fix playing audio without item defined in natural inventory panel
|
||||
|
||||
|
||||
|
||||
|
||||
@ -182,7 +182,7 @@ public class ItemIconPanel {
|
||||
onReceiveItem.run();
|
||||
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(Globals.draggedItem));
|
||||
if(Globals.virtualAudioSourceManager != null){
|
||||
if(itemData.getItemAudio() != null && itemData.getItemAudio().getUIReleaseAudio() != null){
|
||||
if(itemData != null && itemData.getItemAudio() != null && itemData.getItemAudio().getUIReleaseAudio() != null){
|
||||
Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIReleaseAudio(), VirtualAudioSourceType.UI, false);
|
||||
} else {
|
||||
Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_SFX_ITEM_RELEASE, VirtualAudioSourceType.UI, false);
|
||||
|
||||
@ -133,13 +133,15 @@ public class NaturalInventoryPanel {
|
||||
panel = ItemIconPanel.createPanel(currentItem, i, inventory);
|
||||
} else {
|
||||
panel = ItemIconPanel.createEmptyItemPanel(() -> {
|
||||
NetworkMessage requestPickupMessage = InventoryMessage.constructclientRequestStoreItemMessage(
|
||||
Globals.clientSceneWrapper.mapClientToServerId(entity.getId()),
|
||||
InventoryProtocol.INVENTORY_TYPE_NATURAL,
|
||||
0 + "",
|
||||
Globals.clientSceneWrapper.mapClientToServerId(Globals.draggedItem.getId())
|
||||
);
|
||||
Globals.clientConnection.queueOutgoingMessage(requestPickupMessage);
|
||||
if(Globals.draggedItem != null){
|
||||
NetworkMessage requestPickupMessage = InventoryMessage.constructclientRequestStoreItemMessage(
|
||||
Globals.clientSceneWrapper.mapClientToServerId(entity.getId()),
|
||||
InventoryProtocol.INVENTORY_TYPE_NATURAL,
|
||||
0 + "",
|
||||
Globals.clientSceneWrapper.mapClientToServerId(Globals.draggedItem.getId())
|
||||
);
|
||||
Globals.clientConnection.queueOutgoingMessage(requestPickupMessage);
|
||||
}
|
||||
});
|
||||
}
|
||||
panelContainer.addChild(panel);
|
||||
|
||||
@ -862,7 +862,13 @@ public class GriddedDataCellManager implements DataCellManager, VoxelCellManager
|
||||
Long key = this.getServerDataCellKey(localWorldPos);
|
||||
//generate content
|
||||
GriddedDataCellLoaderService.queueLocationBasedOperation(key, () -> {
|
||||
serverContentManager.generateContentForDataCell(parent, localWorldPos, rVal, cellKey);
|
||||
try {
|
||||
serverContentManager.generateContentForDataCell(parent, localWorldPos, rVal, cellKey);
|
||||
} catch(Error e){
|
||||
e.printStackTrace();
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
//generates physics for the cell in a dedicated thread then finally registers
|
||||
loadedCellsLock.lock();
|
||||
|
||||
@ -47,6 +47,10 @@ public class ContentSerialization {
|
||||
//do not serialize engine entities
|
||||
continue;
|
||||
}
|
||||
//don't serialize attached entities
|
||||
if(AttachUtils.isAttached(entity)){
|
||||
continue;
|
||||
}
|
||||
if(type != null){
|
||||
EntitySerialization serializedEntity = ContentSerialization.constructEntitySerialization(entity);
|
||||
rVal.serializedEntities.add(serializedEntity);
|
||||
@ -62,6 +66,9 @@ public class ContentSerialization {
|
||||
* @return The serialization of the entity
|
||||
*/
|
||||
public static EntitySerialization constructEntitySerialization(Entity entity){
|
||||
if(AttachUtils.isAttached(entity)){
|
||||
throw new Error("Trying to serialize attached entity!");
|
||||
}
|
||||
EntitySerialization serializedEntity = new EntitySerialization();
|
||||
serializedEntity.setPosition(EntityUtils.getPosition(entity));
|
||||
serializedEntity.setRotation(EntityUtils.getRotation(entity));
|
||||
@ -76,10 +83,8 @@ public class ContentSerialization {
|
||||
serializedEntity.setSubtype(CommonEntityUtils.getEntitySubtype(entity));
|
||||
} break;
|
||||
case ITEM: {
|
||||
if(!AttachUtils.isAttached(entity)){
|
||||
serializedEntity.setType(EntityType.ITEM.getValue());
|
||||
serializedEntity.setSubtype(CommonEntityUtils.getEntitySubtype(entity));
|
||||
}
|
||||
serializedEntity.setType(EntityType.ITEM.getValue());
|
||||
serializedEntity.setSubtype(CommonEntityUtils.getEntitySubtype(entity));
|
||||
} break;
|
||||
case FOLIAGE: {
|
||||
serializedEntity.setType(EntityType.FOLIAGE.getValue());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user