Skip to content

Commit 337c831

Browse files
committed
Clone Brush 1.1.1: Fix compatibility issue
1 parent 72c2e4a commit 337c831

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

plugins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"icon": "account_balance_wallet",
116116
"description": "Clone Cubes",
117117
"min_version": "3.0.0",
118+
"version": "1.1.1",
118119
"variant": "both"
119120
},
120121
"mod_utils": {

plugins/clone_brush.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Plugin.register('clone_brush', {
77
author: 'JannisX11',
88
icon: 'account_balance_wallet',
99
description: 'Clone Cubes',
10-
version: '1.1.0',
10+
version: '1.1.1',
1111
variant: 'both',
1212
onload() {
1313
clone_brush_tool = new Tool({
@@ -25,8 +25,8 @@ Plugin.register('clone_brush', {
2525
},
2626
onCanvasClick: function(data) {
2727
if (data.event.shiftKey === false) {
28-
if (brush_template == 'select') {
29-
brush_template = data.cube
28+
if (brush_template == 'select' && data.element instanceof Cube) {
29+
brush_template = data.element
3030
$('#preview').css('cursor', 'url(assets/brush.png), auto')
3131
} else if (brush_template instanceof Cube) {
3232

@@ -43,7 +43,7 @@ Plugin.register('clone_brush', {
4343
if (brush_template && brush_template.type === 'cube') {
4444
sizes = brush_template.size()
4545
}
46-
switch (main_uv.face) {
46+
switch (data.face) {
4747
case 'north': from[2] -= sizes[2] + Cube.selected[0].inflate + brush_template.inflate; break;
4848
case 'south': from[2] += sizes[2] + Cube.selected[0].inflate + brush_template.inflate; break;
4949
case 'west': from[0] -= sizes[0] + Cube.selected[0].inflate + brush_template.inflate; break;

0 commit comments

Comments
 (0)