Skip to content

Commit

Permalink
feat(ci): Do sub-validation of projects in bulk runs, UX fixes
Browse files Browse the repository at this point in the history
- Improve validator to run subsidiary tests if content is "addon targeted'
- Update to 1.21.30 sample files
- Adjust home UX to make "open from file"/"backup" more clear
- Refactor how folder delimiters work across IStorage
- Fix issue with parsing of JSON with comments
- nineslice files
- Fix dependency fix up in new project generation
- Model geometries can have multiple models; accommodate
- Basic blockbench model export
  • Loading branch information
mammerla committed Oct 2, 2024
1 parent 1f3440c commit 5d220a6
Show file tree
Hide file tree
Showing 110 changed files with 3,066 additions and 651 deletions.
73 changes: 73 additions & 0 deletions app/public/data/forms/convert.form.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"title": "Conversion",
"fields": [
{
"id": "name",
"title": "Name",
"dataType": 2
},
{
"id": "targetJavaVersion",
"title": "Target Java Version",
"dataType": 5,
"choices": [
{
"id": 0,
"title": "1.8.8"
},
{
"id": 1,
"title": "1.9.3"
},
{
"id": 2,
"title": "1.10.2"
},
{
"id": 3,
"title": "1.11.2"
},
{
"id": 4,
"title": "1.12.2"
},
{
"id": 5,
"title": "1.13.2"
},
{
"id": 6,
"title": "1.14.4"
},
{
"id": 7,
"title": "1.15.2"
},
{
"id": 8,
"title": "1.16.5"
},
{
"id": 9,
"title": "1.17.1"
},
{
"id": 10,
"title": "1.18.2"
},
{
"id": 11,
"title": "1.19.4"
},
{
"id": 12,
"title": "1.20.6"
},
{
"id": 13,
"title": "1.21.0"
}
]
}
]
}
4 changes: 2 additions & 2 deletions app/public/data/forms/dataform.form.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"visibility": [
{
"field": "dataType",
"comparison": 0,
"comparison": "=",
"anyValues": [0, 3]
}
]
Expand All @@ -168,7 +168,7 @@
"visibility": [
{
"field": "dataType",
"comparison": 0,
"comparison": "=",
"anyValues": [0, 3]
}
]
Expand Down
1 change: 1 addition & 0 deletions app/public/data/forms/entity_minecraft_ageable.form.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"title": "Ageable",
"description": "Adds a timer for the entity to grow up. It can be accelerated by giving the entity the items it likes as defined by feed_items.",
"fields": [
{
Expand Down
66 changes: 66 additions & 0 deletions app/public/data/forms/entity_minecraft_anger_level.form.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"title": "Anger Level",
"description": "Compels the entity to track anger towards a set of nuisances.",
"fields": [
{
"id": "anger_decrement_interval",
"description": "Anger level will decay over time. Defines how often anger towards all nuisances will decrease by on.",
"dataType": 2
},
{
"id": "sound_interval",
"description": "Anger boost applied to angry threshold when the entity gets angry.",
"dataType": 18
},
{
"id": "duration",
"description": "The amount of time in seconds that the entity will be angry.",
"dataType": 0
},
{
"id": "duration_delta",
"description": "Variance in seconds added to the duration [-delta, delta].",
"dataType": 0
},
{
"id": "filters",
"title": "Anger exemption filters",
"description": "Filter out mob types that it should not attack while angry (other Piglins)",
"dataType": 20
},
{
"id": "broadcast_anger",
"description": "If set, other entities of the same entity definition within the broadcastRange will also become angry",
"dataType": 1,
"defaultValue": false
},
{
"id": "broadcast_anger_on_attack",
"description": "If set, other entities of the same entity definition within the broadcastRange will also become angry whenever this mob attacks",
"dataType": 1,
"defaultValue": false
},
{
"id": "broadcast_range",
"description": "Distance in blocks within which other entities of the same entity type will become angry",
"dataType": 0,
"defaultValue": 20
},
{
"id": "broadcast_targets",
"description": "A list of entity families to broadcast anger to",
"dataType": 17
},
{
"id": "broadcast_filters",
"description": "Conditions that make this entry in the list valid",
"dataType": 20
},
{
"id": "calm_event",
"description": "Event to fire when this entity is calmed down",
"dataType": 8,
"lookupId": "entityTypeEvents"
}
]
}
4 changes: 4 additions & 0 deletions app/public/data/forms/entity_minecraft_balloonable.form.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"title": "Balloonable",
"description": "Allows this entity to have a balloon attached and defines the conditions and events for this entity when is ballooned.",
"fields": [
{
"id": "soft_distance",
"description": "Distance in blocks at which the 'spring' effect that lifts it.",
"dataType": 3,
"experienceType": 3,
"minValue": 0,
"maxValue": 30
},
{
"id": "max_distance",
"description": "Distance in blocks at which the balloon breaks.",
"dataType": 3,
"experienceType": 3,
"minValue": 0,
"maxValue": 30
},
Expand All @@ -31,6 +34,7 @@
"id": "mass",
"description": "Mass that this entity will have when computing balloon pull forces.",
"dataType": 3,
"experienceType": 3,
"minValue": 0,
"maxValue": 30
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"title": "Breathable",
"description": "Defines what blocks an entity can breathe in and gives them the ability to suffocate.",
"fields": [
{
Expand Down
38 changes: 38 additions & 0 deletions app/public/data/forms/entity_minecraft_leashable.form.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"title": "Leashable",
"description": "Describes how this mob can be leashed to other items",
"fields": [
{
"id": "can_be_stolen",
"dataType": 1,
"defaultValue": false
},
{
"id": "hard_distance",
"description": "Distance in blocks at which the leash stiffens, restricting movement.",
"dataType": 0,
"experienceType": 3,
"minValue": 0,
"suggestedMaxValue": 20,
"defaultValue": 6
},
{
"id": "soft_distance",
"description": "Distance in blocks at which the 'spring' effect starts acting to keep this entity close to the entity that leashed it.",
"dataType": 0,
"experienceType": 3,
"minValue": 0,
"suggestedMaxValue": 20,
"defaultValue": 4
},
{
"id": "max_distance",
"description": "Distance in blocks it which the leash breaks.",
"dataType": 0,
"experienceType": 3,
"minValue": 0,
"suggestedMaxValue": 20,
"defaultValue": 0
}
]
}
5 changes: 0 additions & 5 deletions app/public/data/forms/entity_type_resource.form.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,22 @@
},
{
"id": "materials",
"title": "Materials",
"dataType": 24
},
{
"id": "textures",
"title": "Textures",
"dataType": 24
},
{
"id": "geometry",
"title": "Geometry",
"dataType": 24
},
{
"id": "animations",
"title": "Animations",
"dataType": 24
},
{
"id": "render_controllers",
"title": "Render Controllers",
"dataType": 17
}
]
Expand Down
5 changes: 4 additions & 1 deletion app/public/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ contextBridge.exposeInMainWorld("api", {
ipcRenderer.invoke("asyncselectDirectory", position + "|" + data);
return;

case "asyncconvertFile":
return ipcRenderer.invoke("asyncconvertFile", position + "|" + data);

case "asyncstartWebSocketServer":
return ipcRenderer.invoke("asyncstartWebSocketServer", position + "|" + data);

Expand Down Expand Up @@ -187,7 +190,6 @@ contextBridge.exposeInMainWorld("api", {
case "asyncwindowRightSide":
case "asyncupdateIAgree":
case "asyncgetWindowState":
case "asyncfsFolderExists":
case "asyncgetDirname":
case "asyncaugerLogin":
return ipcRenderer.invoke(commandName, position + "|" + data);
Expand All @@ -203,6 +205,7 @@ contextBridge.exposeInMainWorld("api", {

return ipcRenderer.invoke(commandName, position + "|" + data);

case "asyncfsFolderExists":
case "asyncfsMkdir":
case "asyncfsReaddir":
_validateFolderPath(data);
Expand Down
2 changes: 1 addition & 1 deletion app/reslist/packs.resources.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"url": "https://github.com/Mojang/bedrock-samples/archive/1c48a87a35864df286f5a8403a88706cdede963d.zip",
"url": "https://github.com/Mojang/bedrock-samples/archive/14404383059147f3f19aae34836c1e8f209bd2df.zip",
"ignoreFirstFolder": true,
"exclude": [
"documentation/",
Expand Down
18 changes: 16 additions & 2 deletions app/site/index.body.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,36 @@

var siteConsent = null;

window.getUserConsentDetails = function() {
if (siteConsent) {
return siteConsent.getConsent();
}

return {
Required: true,
Analytics: true,
SocialMedia: false,
Advertising: false
};
}

if (WcpConsent) {
WcpConsent.init("en-US", "cookie-banner", function (err, _siteConsent) {
if (err != undefined) {
return error;
} else {
siteConsent = _siteConsent;

if (oneDS && oneDS.ApplicationInsights) {
if (oneDS && oneDS.ApplicationInsights && !navigator.globalPrivacyControl) {
const analytics = new oneDS.ApplicationInsights();

analytics.initialize({
instrumentationKey: "1e1425454dbc4c25b1be2762598df0b6-7f4669a7-d9f8-4e51-9bba-266dcfc0dc00-7638",
disableCookiesUsage: !siteConsent || !siteConsent.getConsent || (siteConsent.isConsentRequired && !siteConsent.getConsent().Analytics),
propertyConfiguration: {
gpcDataSharingOptIn: false,
callback: {
userConsentDetails: siteConsent ? siteConsent.getConsent : null
userConsentDetails: window.getUserConsentDetails
},
},
webAnalyticsConfiguration: {
Expand Down
21 changes: 9 additions & 12 deletions app/src/UX/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import MCWorld from "../minecraft/MCWorld";
import ProjectItem from "../app/ProjectItem";
import ZipStorage from "../storage/ZipStorage";
import ProjectUtilities from "../app/ProjectUtilities";
import { LocalFolderType, LocalGalleryCommand } from "./LocalGalleryCommand";
import { LocalFolderType } from "./LocalGalleryCommand";
import WebUtilities from "./WebUtilities";
import ProjectEditorUtilities, { ProjectEditorMode } from "./ProjectEditorUtilities";
import HttpStorage from "../storage/HttpStorage";
Expand Down Expand Up @@ -215,8 +215,6 @@ export default class App extends Component<AppProps, AppState> {
} else {
this.state = newState;
}

// Log.debug("Setting state with new project '" + newProject.name + "'");
}
}
}
Expand Down Expand Up @@ -372,9 +370,15 @@ export default class App extends Component<AppProps, AppState> {
if (firstSlash > 1) {
const openToken = openQuery.substring(0, firstSlash).toLowerCase();

const openData = openQuery.substring(firstSlash + 1, openQuery.length);
let openData = openQuery.substring(firstSlash + 1, openQuery.length);

if (openToken === "gp") {
const lastPeriod = openData.lastIndexOf(".");

if (lastPeriod > 0) {
openData = openData.substring(lastPeriod);
}

this._ensureProjectFromGalleryId(openData, updateContent);
}
}
Expand Down Expand Up @@ -708,6 +712,7 @@ export default class App extends Component<AppProps, AppState> {
proj.originalGitHubRepoName === gitHubRepoName &&
proj.originalGitHubBranch === gitHubBranch &&
proj.originalGitHubFolder === gitHubFolder &&
(sampleId === undefined || proj.originalSampleId === sampleId) &&
updateContent === undefined
) {
await proj.ensureInflated();
Expand Down Expand Up @@ -1231,14 +1236,6 @@ export default class App extends Component<AppProps, AppState> {
}
}

private _handleLocalGalleryCommand(command: LocalGalleryCommand, folderType: LocalFolderType, folder: IFolder) {
switch (command) {
case LocalGalleryCommand.ensureAndOpenProjectFromFolder:
this._newProjectFromMinecraftFolder(folderType, folder);
break;
}
}

private async _handleProjectSelected(project: Project) {
await project.ensureLoadedFromFile();
await project.ensureInflated();
Expand Down
Loading

0 comments on commit 5d220a6

Please sign in to comment.