Skip to content

Releases: ChatTriggers/ChatTriggers

0.16

05 Jun 14:23
Compare
Choose a tag to compare

Sound object

custom sounds can now be played without loading them into a resource pack first.

var mySound = new Sound({
     source: "location/mySoundFile.ogg",
     stream: true,
     volume: 1.0
});

register("worldLoad", function() {
     mySound.play();
});

See the javadocs for more options [docs]

We are experimenting with this way to instance new objects. This will probably be the way to set up things like displays, GUIs, and other objects in the future.

Item additions

We have added some new ways to control the way that items are shown and read from.

Player.getHeldItem().getLore();

register("itemTooltip", function(lore, item) {
     if (item == Player.getHeldItem()) {
          lore.clear();
          lore.add("main hand");
          lore.add(1, "example");
     }
}

[register docs]
[item docs]

Message addition

Messages can now be constructed using the ClientChatRecieved event that is passed through a trigger. This is super useful for getting different clickable parts of a message and what they do.

register("chat", function(event) {
     var myMessage = new Message(event)
     for (var i = 0; i < myMessage.getMessageParts(); i++) {
          myMessage.getMessageParts()[i].chat();
     }
});

[message docs]

Miscellaneous

  • Fixed importing a module that requires another module loading in the wrong order
  • Added a chunk wrapper [chunk docs] [World.getChunk(x,y,z)]
  • Added a way to return the minecraft entity from the Entity wrapper [Entity.getEntity()]
  • Added an installed module list to the crash report for easier debugging
  • Fixed some bugs with PlayerMP and added an Entity.getUUID()
  • Added "ignored" flag to module metadata to ignore specific files from loading
  • Fixed memory leaks when running /ct load
  • Fixed module metadata crashing if created incorrectly

0.15.3

23 May 02:27
Compare
Choose a tag to compare

Bug Fix

  • Fixed displays and GUIs causing concurrent modification crashes when running /ct load
  • Updated some missing docs

0.15.2

16 May 22:01
Compare
Choose a tag to compare

General Bug Fixes

  • Fixed wording on the update checker
  • Fixed re-importing a module not deleting files

0.15.1

15 May 12:52
Compare
Choose a tag to compare

Minor Renderer.image changes

  • Removed Image.draw(x, y, size)
  • Added Image.draw(x, y)
  • Added Image.draw(x, y, width, height)
  • Added Image.getTextureWidth() and Image.getTextureHeight()
  • Fixed images not scaling with Renderer.scale
    Image docs

0.15

14 May 01:03
Compare
Choose a tag to compare

Renderer.Image changes

We (mostly @FalseHonesty) changed the way that images are loaded and rendered which will give us more flexibility in the future. This has changed the syntax slightly and has also changed a bit how the Tessellator works.

var myImage = Renderer.image("resourceName.png", "url");
register("renderOverlay", function() {
     myImage.draw(x, y, size);
});

The Tessellator now takes this new Image as the argument when binding a texture.

The "assets" folder is still usable and we always recommend putting pictures in there that wont change. If no URL is needed, you can either reference directly from the file path (using ./ for .minecraft folder) and not use a url, or set the url to null. The size is optional. Default size is 256x256. We do plan on being able to draw images using a width and a height in the near future, we just wanted to make sure this works fine first.

Image docs
Tessellator docs

Console

We have added a console history. You can use the up and down arrows like you would in chat to use it.

We have also added a config option in /ct config to automatically open the console on error. This is super useful for module developers. It is off by default.

Module loading

Modules now have the ability to load JS files from sub-folders limited to a max depth of 5. This is not super useful for most small modules but will hopefully help out with organization for larger modules.

Because of subfolder loading, we have also added a way to still have a disabled modules folder. Users where just dragging module folders into a "disabledModules" folder and they wouldn't load because there was no sub-folder loading so we kept that functionality by making it so a folder named .disabled will not load anything inside of it.

Required modules in the metadata.json have also been updated. They will now be loaded before whatever module is requiring them avoiding undefined problems when loading.

Modules now auto update themselves based on the version number inside of the metadata.json. If this number changes between boots of the game, CT will automatically fetch the new version of the module. This can be turned off in /ct config. It can also be forced using /ct reload instead of /ct load

Mod Update Checker

In the interest of cleaning things up and getting things closer to what old ct had, we have added an update checker. If the mod needs updating, it will now show text on the home screen and warn you in game with a chat message and a ding. The in game warning can be turned off in /ct config.

Miscellaneous

  • Added World.playRecord docs
  • Cleaned up instancing in the main file so its easier to tell whats going on
  • Changed Displays to render by default
  • Removed OnChatTrigger.shouldIgnore/clearIgnoreList (unused)
  • Added Gui.isControlDown/isShiftDown/ifAltDown docs
  • Fixed config icons
  • Added new register functionality to DisplayLine.registers (docs)[https://www.chattriggers.com/javadocs/com/chattriggers/ctjs/minecraft/objects/display/DisplayLine.html#registerClicked-java.lang.Object-]
  • Fixed module metadata files not loading UTF8
  • Added drawing text in 3d space with Tessellator docs
  • Fixed jar loading

0.14

24 Apr 01:55
Compare
Choose a tag to compare

Scripting changes

We've made some changes to the way that triggers get registered that make CT more like a real JavaScript library. Before anyone complains, no we did not break the old way of registering triggers, we have just added a new way.

Triggers can now be registered with anonymous functions or function paths. This should allow for much cleaner code with less randomly named functions. It is highly recommended

register("chat", function(name, message, event) {
  cancel(event);
  ChatLib.chat(name + ": " + message);
}).setCriteria("<${name}> ${message}");

register("renderCrosshair", function(event) {
  cancel(event);
  Renderer.drawRect(
    0x50ffffff,
    RenderLib.screen.getWidth()/2 - 1,
    RenderLib.screen.getHeight()/2 -1,
    2, 2
  );
});

Miscellaneous

  • Fixed random crashing issues with new triggers
  • Added hashed player tracking to get a general player count
  • Added simplified Renderer.drawImage method docs

0.13.1

19 Apr 02:20
Compare
Choose a tag to compare
  • Added screenshot name to screenshotTaken trigger docs
  • Fixed crash on drop and pickup items

0.13

18 Apr 02:07
Compare
Choose a tag to compare

Mixins!

We have added back-end support for mixins which means we can directly tweak the minecraft code instead of just relying on forge for events. This means we can support more triggers that we could not before. We have only added a few for this version, but there will be many many more soon.

new triggers

// improved
register("soundPlay", "function")

// new (not mixins)
register("noteBlockPlay", "function")
register("noteBlockChange", "function")
register("drawBlockHighlight", "function")
register("dropItem", "function")
register("pickupItem", "function")

// new (using mixins)
register("screenshotTaken", "function")
register("messageSent", "function")

TriggerRegister docs

Miscellaneous

  • Fixed blank line in displays still drawing a background
  • Fixed formatting in /ct dump
  • Moved some code to make FileLib.unzip(zipLocation, destination) a usable method docs
  • Fixed Client.getCurrentChatMessage() docs
  • Added some more icons to /ct settings and made them clickable
  • Changed Item.draw() to Item.draw(x, y) and Item.draw(x, y, scale) docs
  • Removed Item.setX/Y/setScale
  • Fixed /ct import <import name>

0.12

27 Mar 22:59
Compare
Choose a tag to compare

Tessellator

We have added the ability to render things in 3D space using a tessellator (like Renderer.shape but for 3D). These shapes can be textured, translates, rotated, and scaled. To support this, we've also added a new trigger "onRenderWorld"

var cubes = [];
register("renderWorld", "testRenderWorld");
function testRenderWorld() {
	cubes.forEach(function(cube) {cube.draw();});
}

var last = {x: Player.getX(), y: Player.getY(), z: Player.getZ()};
register("tick", "testStep");
function testStep() {
	if (Math.abs(last.x - Player.getX()) > 1
	|| Math.abs(last.y - Player.getY()) > 1
	|| Math.abs(last.z - Player.getZ()) > 1) {
		cubes.push(new Cube(Player.getX(), Player.getY(), Player.getZ(), Player.getPitch(), Player.getYaw()));
		last.x = Player.getX();
	 	last.y = Player.getY();
		last.z = Player.getZ();
	}
}


function Cube(x, y, z, pitch, yaw) {
	this.x = x;
	this.y = y;
	this.z = z;
	this.pitch = pitch;
	this.yaw = yaw;
	
	this.draw = function() {
		Tessellator.bindTexture("top.png");
		Tessellator.begin().translate(this.x, this.y, this.z)
			.rotate(this.yaw, 0, -1, 0).rotate(this.pitch, 1, 0, 0)
			.pos(-0.5, 0.5, -0.5).tex(0, 0)
			.pos(-0.5, 0.5, 0.5).tex(0, 1)
			.pos(0.5, 0.5, 0.5).tex(1, 1)
			.pos(0.5, 0.5, -0.5).tex(1, 0).draw();
		Tessellator.begin().translate(this.x, this.y, this.z)
			.rotate(this.yaw, 0, -1, 0).rotate(this.pitch, 1, 0, 0)
			.pos(-0.5, -0.5, -0.5).tex(0, 0)
			.pos(0.5, -0.5, -0.5).tex(0, 1)
			.pos(0.5, -0.5, 0.5).tex(1, 1)
			.pos(-0.5, -0.5, 0.5).tex(1, 0).draw();
		Tessellator.bindTexture("side.png");
		Tessellator.begin().translate(this.x, this.y, this.z)
			.rotate(this.yaw, 0, -1, 0).rotate(this.pitch, 1, 0, 0)
			.pos(-0.5, 0.5, -0.5).tex(0, 0)
			.pos(-0.5, -0.5, -0.5).tex(0, 1)
			.pos(-0.5, -0.5, 0.5).tex(1, 1)
			.pos(-0.5, 0.5, 0.5).tex(1, 0).draw();
		Tessellator.begin().translate(this.x, this.y, this.z)
			.rotate(this.yaw, 0, -1, 0).rotate(this.pitch, 1, 0, 0)
			.pos(-0.5, 0.5, -0.5).tex(1, 0)
			.pos(0.5, 0.5, -0.5).tex(0, 0)
			.pos(0.5, -0.5, -0.5).tex(0, 1)
			.pos(-0.5, -0.5, -0.5).tex(1, 1).draw();
		Tessellator.begin().translate(this.x, this.y, this.z)
			.rotate(this.yaw, 0, -1, 0).rotate(this.pitch, 1, 0, 0)
			.pos(0.5, 0.5, -0.5).tex(1, 0)
			.pos(0.5, 0.5, 0.5).tex(0, 0)
			.pos(0.5, -0.5, 0.5).tex(0, 1)
			.pos(0.5, -0.5, -0.5).tex(1, 1).draw();
		Tessellator.begin().translate(this.x, this.y, this.z)
			.rotate(this.yaw, 0, -1, 0).rotate(this.pitch, 1, 0, 0)
			.pos(-0.5, 0.5, 0.5).tex(0, 0)
			.pos(-0.5, -0.5, 0.5).tex(0, 1)
			.pos(0.5, -0.5, 0.5).tex(1, 1)
			.pos(0.5, 0.5, 0.5).tex(1, 0).draw();
	}
}

Tessellator docs

Miscellaneous

  • Improved display performance
  • Fixed /ct simulate and ChatLib.simulateChat
  • Fixed Player armor getters
  • Fixed Particles crashing on null when setting max age
  • Added more to /ct ?
  • Cleaned up /ct dump
  • Removed deprecated methods from ChatLib
  • Removed deprecated WorldLib
  • Fixed Image sometimes working and sometimes not
  • Fixed Image downloading
  • Fixed Text alpha not working properly
  • Changed Text to be automatically formatted docs
  • Fixed some docs in Gui
  • Improved the performance of the modules gui

0.11.6

23 Mar 19:14
Compare
Choose a tag to compare

Fixed bug with priority queue for triggers keeping triggers from working