ZenScript main repository
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

integration.zs 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import example.TestClass;
  2. import example.TestInterface;
  3. val instance = new TestClass("Instance");
  4. println("Name: " + instance.name);
  5. instance.dump();
  6. instance.withDefaultParameter("Hello");
  7. instance.withDefaultParameter("Hello", "moon");
  8. var generated = instance.generate();
  9. println(generated.getValue());
  10. class TestOperators {
  11. public (name as string) as void {
  12. println("MyTestClass: " + name);
  13. }
  14. //.(key as string) as string
  15. // => "key " + key;
  16. }
  17. /*class TestImplementation {
  18. public implements TestInterface {
  19. interfaceMethod() => "TestImplementation";
  20. }
  21. }*/
  22. val testInstance = new TestOperators();
  23. //testInstance("something");
  24. something.dump();
  25. val objects = makeArray(5);
  26. printMany(objects);
  27. println(<test string>);
  28. println(<test string>.name);
  29. println(<test string>.interfaceMethod());
  30. //println(new TestImplementation().interfaceMethod());
  31. var diamond = <item:minecraft:diamond>;
  32. var dirt = <item:minecraft:dirt>;
  33. addShapedRecipe("TestRecipe", diamond, [[dirt, dirt, dirt],[dirt, dirt, dirt],[dirt, dirt, dirt]]);
  34. var count = 10;
  35. floatMethod(5f * count);
  36. invokeFunctional(name => "Hello " + name);
  37. //val x = (a as string) => "hello" + a;
  38. //invokeFunctional(x);
  39. testOptional(value => value == null ? 0 : value.length as int);