diff --git a/assets/Data/entity/foliage/bushes.json b/assets/Data/entity/foliage/bushes.json index ef19f8e6..c1763c54 100644 --- a/assets/Data/entity/foliage/bushes.json +++ b/assets/Data/entity/foliage/bushes.json @@ -18,7 +18,7 @@ "lootPool" : { "tickets" : [ { - "itemId" : "Stick", + "itemId" : "mat:Stick", "rarity" : 1.0, "minQuantity" : 1, "maxQuantity" : 1 diff --git a/assets/Data/entity/foliage/rocks.json b/assets/Data/entity/foliage/rocks.json index d7f96716..13b396b4 100644 --- a/assets/Data/entity/foliage/rocks.json +++ b/assets/Data/entity/foliage/rocks.json @@ -26,7 +26,7 @@ "lootPool" : { "tickets" : [ { - "itemId" : "Rock", + "itemId" : "mat:Rock", "rarity" : 1.0, "minQuantity" : 1, "maxQuantity" : 1 diff --git a/assets/Data/entity/foliage/trees.json b/assets/Data/entity/foliage/trees.json index a759e8f5..9ea66234 100644 --- a/assets/Data/entity/foliage/trees.json +++ b/assets/Data/entity/foliage/trees.json @@ -194,10 +194,10 @@ "lootPool" : { "tickets" : [ { - "itemId" : "Log", + "itemId" : "mat:Log", "rarity" : 0.8, - "minQuantity" : 0, - "maxQuantity" : 2 + "minQuantity" : 2, + "maxQuantity" : 5 }, { "itemId" : "block:wood", diff --git a/assets/Data/entity/items/materials.json b/assets/Data/entity/items/materials.json index 5efcd6c8..bd9d7006 100644 --- a/assets/Data/entity/items/materials.json +++ b/assets/Data/entity/items/materials.json @@ -1,7 +1,7 @@ { "items" : [ { - "id" : "Grain", + "id" : "mat:Grain", "tokens" : [ "GRAVITY", "TARGETABLE" diff --git a/assets/Data/entity/items/materials/rocks.json b/assets/Data/entity/items/materials/rocks.json index c180d907..810f2de5 100644 --- a/assets/Data/entity/items/materials/rocks.json +++ b/assets/Data/entity/items/materials/rocks.json @@ -1,7 +1,7 @@ { "items" : [ { - "id" : "Rock", + "id" : "mat:Rock", "maxStack" : 100, "tokens" : [ "GRAVITY", @@ -32,7 +32,7 @@ "iconPath" : "Textures/icons/itemIconItemGeneric.png" }, { - "id" : "Copper", + "id" : "mat:Copper", "maxStack" : 100, "tokens" : [ "GRAVITY", @@ -70,7 +70,7 @@ "iconPath" : "Textures/icons/itemIconItemGeneric.png" }, { - "id" : "Tin", + "id" : "mat:Tin", "maxStack" : 100, "tokens" : [ "GRAVITY", @@ -101,7 +101,7 @@ "iconPath" : "Textures/icons/itemIconItemGeneric.png" }, { - "id" : "Clay", + "id" : "mat:Clay", "maxStack" : 100, "tokens" : [ "GRAVITY", diff --git a/assets/Data/entity/items/materials/wood.json b/assets/Data/entity/items/materials/wood.json index f333c849..bb927858 100644 --- a/assets/Data/entity/items/materials/wood.json +++ b/assets/Data/entity/items/materials/wood.json @@ -1,7 +1,7 @@ { "items" : [ { - "id" : "Log", + "id" : "mat:Log", "maxStack" : 100, "tokens" : [ "GRAVITY", @@ -32,7 +32,7 @@ "iconPath" : "Textures/icons/itemIconItemGeneric.png" }, { - "id" : "Stick", + "id" : "mat:Stick", "maxStack" : 100, "tokens" : [ "GRAVITY", diff --git a/assets/Data/game/recipes.json b/assets/Data/game/recipes.json index 6cfdbfd8..fba94ba4 100644 --- a/assets/Data/game/recipes.json +++ b/assets/Data/game/recipes.json @@ -5,7 +5,7 @@ "craftingTag" : "HAND", "ingredients": [ { - "itemType": "Log", + "itemType": "mat:Log", "count": 1 } ], diff --git a/assets/Data/game/recipes/fabs.json b/assets/Data/game/recipes/fabs.json index 2d5237f9..bd83030f 100644 --- a/assets/Data/game/recipes/fabs.json +++ b/assets/Data/game/recipes/fabs.json @@ -5,7 +5,7 @@ "craftingTag" : "HAND", "ingredients": [ { - "itemType": "Log", + "itemType": "mat:Log", "count": 1 } ], diff --git a/assets/Data/game/recipes/tools.json b/assets/Data/game/recipes/tools.json index 9302a649..898c9014 100644 --- a/assets/Data/game/recipes/tools.json +++ b/assets/Data/game/recipes/tools.json @@ -5,11 +5,11 @@ "craftingTag" : "HAND", "ingredients": [ { - "itemType": "Stick", + "itemType": "mat:Stick", "count": 1 }, { - "itemType": "Rock", + "itemType": "mat:Rock", "count": 1 } ], @@ -25,11 +25,11 @@ "craftingTag" : "HAND", "ingredients": [ { - "itemType": "Stick", + "itemType": "mat:Stick", "count": 1 }, { - "itemType": "Rock", + "itemType": "mat:Rock", "count": 1 } ], @@ -45,11 +45,11 @@ "craftingTag" : "HAND", "ingredients": [ { - "itemType": "Stick", + "itemType": "mat:Stick", "count": 1 }, { - "itemType": "Rock", + "itemType": "mat:Rock", "count": 1 } ], diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 54f1608e..8cf67add 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1623,6 +1623,9 @@ Cache busting when physics sync pulls player entity TELEPORT distances Lotta inventory work to bugfix charges, crafting, in-inventory items, etc Collapse client hooks for item usage into main itemusage class Debounce fab placement +Blocks stack +Item tag adjustments +Pine tree loot pool update @@ -1661,6 +1664,7 @@ Floating world origin - Separately simulated regions of physics that dynamically merge/unmerge based on chunk loading Bug Fixes + - Fix characters stored in db not saving items because the items aren't being stored to db - Fix hitbox placement does not scale with entity scale on server - Calculate bounding sphere for meshes by deforming vertices with bone default pose instead of no bone deform - Fix light cluster mapping for foliage shader diff --git a/src/main/java/electrosphere/entity/types/item/ItemUtils.java b/src/main/java/electrosphere/entity/types/item/ItemUtils.java index f67ce620..b8a50e78 100644 --- a/src/main/java/electrosphere/entity/types/item/ItemUtils.java +++ b/src/main/java/electrosphere/entity/types/item/ItemUtils.java @@ -270,6 +270,11 @@ public class ItemUtils { */ public static Entity serverSpawnBasicItem(Realm realm, Vector3d position, String name){ Item item = Globals.gameConfigCurrent.getItemMap().getItem(name); + + if(item == null){ + throw new Error("Failed to resolve item with name " + name); + } + //must correct the position such that it spawns inside the realm Vector3d correctedPosition = ServerEntityUtils.guaranteePositionIsInBounds(realm, position); Entity rVal = EntityCreationUtils.createServerEntity(realm, correctedPosition); @@ -509,7 +514,16 @@ public class ItemUtils { if(itemData.getMaxStack() != null){ ClientChargeState.attachTree(rVal, itemData.getMaxStack()); } - rVal.putData(EntityDataStrings.ITEM_ICON,ItemUtils.getItemIcon(item)); + + // + //icon + if(itemData.getIconPath() != null && !itemData.getIconPath().equals("")){ + rVal.putData(EntityDataStrings.ITEM_ICON,itemData.getIconPath()); + } else { + rVal.putData(EntityDataStrings.ITEM_ICON,AssetDataStrings.UI_TEXTURE_ITEM_ICON_GENERIC); + } + + rVal.putData(EntityDataStrings.ITEM_EQUIP_CLASS, item.getData(EntityDataStrings.ITEM_EQUIP_CLASS)); CommonEntityUtils.setEntityType(rVal, EntityType.ITEM); rVal.putData(EntityDataStrings.ITEM_IS_IN_INVENTORY, true); diff --git a/src/main/java/electrosphere/game/data/item/Item.java b/src/main/java/electrosphere/game/data/item/Item.java index 427a8890..856fd3d0 100644 --- a/src/main/java/electrosphere/game/data/item/Item.java +++ b/src/main/java/electrosphere/game/data/item/Item.java @@ -29,6 +29,11 @@ public class Item extends CommonEntityType { */ static final String DEFAULT_ITEM_ICON_PATH = "Textures/icons/itemIconItemGeneric.png"; + /** + * Maximum stack of a given block type + */ + static final int MAX_BLOCK_STACK = 250; + /** * The array of default tokens for all items */ @@ -164,6 +169,9 @@ public class Item extends CommonEntityType { rVal.setSecondaryUsage(usage); rVal.setPrimaryUsage(usage); + //set stacking data + rVal.setMaxStack(MAX_BLOCK_STACK); + //attach common tokens List tokens = new LinkedList(Arrays.asList(DEFAULT_TOKENS)); diff --git a/src/main/java/electrosphere/net/synchronization/client/ClientSynchronizationManager.java b/src/main/java/electrosphere/net/synchronization/client/ClientSynchronizationManager.java index 76c1f4f2..5299b831 100644 --- a/src/main/java/electrosphere/net/synchronization/client/ClientSynchronizationManager.java +++ b/src/main/java/electrosphere/net/synchronization/client/ClientSynchronizationManager.java @@ -27,6 +27,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import electrosphere.engine.Globals; import electrosphere.entity.Entity; import electrosphere.net.parser.net.message.SynchronizationMessage; +import electrosphere.net.parser.net.message.SynchronizationMessage.SynchronizationMessageType; import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums; import electrosphere.net.synchronization.enums.FieldIdEnums; @@ -48,7 +49,7 @@ public class ClientSynchronizationManager { /** * The count at which to warn about a message bouncing */ - static final int MESSAGE_BOUNCE_WARNING_COUNT = 10; + static final int MESSAGE_BOUNCE_WARNING_COUNT = 100; /** * Pushes a message into the queue to be processed @@ -137,8 +138,12 @@ public class ClientSynchronizationManager { //warn if a message has bounced a certain number of times if(messageBounceCount.containsKey(message) && messageBounceCount.get(message) > MESSAGE_BOUNCE_WARNING_COUNT){ + SynchronizationMessageType type = message.getMessageSubtype(); String warningMessage = - "A synchronization message has bounced at least " + MESSAGE_BOUNCE_WARNING_COUNT + "times!"; + "A synchronization message has bounced at least " + MESSAGE_BOUNCE_WARNING_COUNT + "times!\n" + + type + "\n" + + "" + ; LoggerInterface.loggerNetworking.WARNING(warningMessage); } }