Skip to content

Commit

Permalink
Merge pull request #80 from AvantTeam/v140.4
Browse files Browse the repository at this point in the history
v140.4
  • Loading branch information
MEEPofFaith authored Nov 16, 2022
2 parents dfc9716 + 9a90be1 commit fd8e4c2
Show file tree
Hide file tree
Showing 159 changed files with 4,109 additions and 844 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,16 @@ public void process(RoundEnvironment roundEnv) throws Exception{
}
}

builder.addMethod(
MethodSpec.methodBuilder("toString")
.addAnnotation(cName(Override.class))
.returns(String.class)
.addModifiers(Modifier.PUBLIC)
.addStatement("return $S + $L", name + "#", "id")
.build()
);
if(!methods.containsKey("toString()")){
builder.addMethod(
MethodSpec.methodBuilder("toString")
.addAnnotation(cName(Override.class))
.returns(String.class)
.addModifiers(Modifier.PUBLIC)
.addStatement("return $S + $L", name + "#", "id")
.build()
);
}

EntityIO io = new EntityIO(simpleName(def), builder, serializer);
boolean hasIO = ann.genio() && (defComps.contains(s -> simpleName(s).contains("Sync")) || ann.serialize());
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ sdkVersion = 30
# Minimum Android API version.
sdkAPI = 14
# Mindustry classpath version (Uses MindustryJITPack)
mindustryVersion = v139
mindustryVersion = v140.4
# Actual Mindustry hash that is used for fetching component classes
mindustryFetchVersion = 5e6d40d6cc4b844788171c27d847f044398400ba
mindustryFetchVersion = 4f912f25ee795c44475ecdf42f17fda8132f47fa
# Fallback Arc version, deviate from `mindustryVersion` if you're using a Bleeding Edge classpath version.
arcVersion = e319dd0056
arcVersion = b32576ca09
# Javapoet classpath version, for class file generation.
javapoetVersion = 1.12.1
# Jabel classpath version, for downgrading Java 9+ syntaxes into generating Java 8 bytecodes.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified main/assets-raw/sprites/parts/unit/1x1part.aseprite
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Binary file removed main/assets-raw/sprites/parts/unit/part-cannon-icon.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed main/assets-raw/sprites/parts/unit/part-gun-icon.png
Diff not rendered.
Diff not rendered.
Binary file modified main/assets-raw/sprites/parts/unit/part-large-panel-icon.png
Binary file modified main/assets-raw/sprites/parts/unit/part-medium-panel-icon.png
Binary file modified main/assets-raw/sprites/parts/unit/part-panel-icon.png
Binary file added main/assets-raw/sprites/parts/unit/part-panel.png
Binary file modified main/assets-raw/sprites/parts/unit/part-pipebomb-icon.png
Diff not rendered.
Binary file modified main/assets-raw/sprites/parts/unit/part-root-large-icon.png
Binary file modified main/assets-raw/sprites/parts/unit/part-root-medium-icon.png
Binary file modified main/assets-raw/sprites/parts/unit/part-root-small-icon.png
Binary file modified main/assets-raw/sprites/parts/unit/part-storage-icon.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
20 changes: 15 additions & 5 deletions main/assets/bundles/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ mod.translator = Translators
mod.tester = Testers

mod.disclaimer.title = [scarlet]Disclaimer[]
mod.disclaimer.text = This public [accent]Project Unity[] release is [scarlet]unfinished[] with lots of content yet to be published and/or balanced, its purpose is to help with development by collecting public feedback regarding technical, artistic or balancing matters. Please test responsibly.
mod.disclaimer.text = This public [accent]Project Unity[] release is [scarlet]unfinished[] with lots of content yet to be published and/or balanced, its purpose is to help with development by collecting public feedback. [orange] If issues are found contact the team on discord!.

link.avant-discord.title = Discord
link.avant-discord.title = Avant Discord
link.avant-discord.description = The official Avant team Discord server
link.avant-github.title = GitHub
link.avant-github.description = Mod source code
Expand Down Expand Up @@ -313,6 +313,8 @@ part.engine-small = Small Engine
part.engine-small.description = A small engine used to power a small vehicle.
part.engine = Engine
part.engine.description = A engine used to power a large vehicle.
part.differential = Differential Steerer
part.differential.description = Allows a vehicle to rotate on the spot at the cost of speed.
part.wheel-small = Small Wheel
part.wheel-small.description = You know what this is.
part.tracks-small = Small Tracks
Expand Down Expand Up @@ -358,25 +360,33 @@ ui.parts.category.unit-special = Special

ui.parts.stat.efficiency = Efficiency
ui.parts.stat.weight = Weight
ui.parts.stat.speed = {0} tiles/s
ui.parts.stat.speed = {0} tiles / sec
ui.parts.stat.steerspeed = Steering Speed
ui.parts.stat.armour-points = Armor Points
ui.parts.stat.speedRatio = {0} speed / rps
ui.parts.stattype.health = Health
ui.parts.stattype.mass = Weight
ui.parts.stattype.powerusage = Power Use
ui.parts.stattype.power = Power
ui.parts.stattype.power = Torque Power
ui.parts.stattype.enginespeed = Engine Speed: {0} rps
ui.parts.stattype.powercons = Uses {0} power /rps
ui.parts.stattype.powerconsspeed = Max Speed: {0} rps
ui.parts.stattype.armour = Armour Points
ui.parts.stattype.steerspeed = {0} / sec
ui.parts.stattype.weaponslots = Weapon Slots
ui.parts.stattype.weaponslotuse = Weapon Slots Taken
ui.parts.stattype.abilityslots = Ability Slots
ui.parts.stattype.abilityslotuse = Ability Slots Used
ui.parts.stattype.weightcap = Weight Capacity
ui.parts.stattype.maxspeed = Max Speed
ui.parts.stattype.wheelspeed = Speed
ui.parts.stattype.itemcapacity = Item Capacity
ui.parts.stat.weapon-slots = Weapon Slots
ui.parts.stat.weapon-slots-tooltip = If an tank exceeds its weapon slots its weapons will be serverely handicapped.
ui.parts.stat.ability-slots = Ability Slots
ui.parts.stat.ability-slots-tooltip = If an tank exceeds its ability slots its abilities will be unusable.

ui.parts.editor.shaftspeed = Shaft Speed: {0} rps

## Stats
stat.unity.maxcontain = {0} maximum health contain
stat.unity.healpercent = {0}% healing
Expand Down
74 changes: 74 additions & 0 deletions main/assets/shaders/groundliquid.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#define HIGHP

uniform sampler2D u_texture;
uniform sampler2D u_sprites;
uniform float u_time;
uniform vec2 u_resolution;
uniform int u_sprites_width;

varying vec4 v_color;
varying vec2 v_texCoords;

const float epsilon = 0.001;



vec4 getTex(vec2 offset, int type){
offset = mod(offset,vec2(3.0))/3.0;
float ts = 1.0/float(u_sprites_width);
float ty = float(type/u_sprites_width)*ts+epsilon;
float tx = mod(float(type),float(u_sprites_width))*ts+epsilon;
ts-=epsilon*2.0;
return texture2D(u_sprites,vec2(tx+offset.x*ts,ty+offset.y*ts));
}

float getNoise(vec2 offset){
offset = mod(offset,vec2(3.0))/3.0;
float ts = 1.0/float(u_sprites_width) - epsilon * 2.0 ;
return texture2D(u_sprites,vec2(epsilon+offset.x*ts,epsilon+offset.y*ts)).r;
}

float getLayeredNoise(vec2 offset){
return (getNoise(offset*0.333) + 0.5* getNoise(offset))/1.5;
}

float blendFun(float x){
return 1.0-2.0*abs(fract(x)-0.5);
}

vec4 getBlendedTex(vec2 offset,vec2 dir, float t, int type){
t = fract(t);
return blendFun(t)*getTex(offset+dir*t,type) + blendFun(t+0.5)*getTex(offset+dir*fract(t+0.5),type);
}

float getBlendedNoise(vec2 offset,vec2 dir, float t){
t = fract(t);
return blendFun(t)*getLayeredNoise(offset+dir*t) + blendFun(t+0.5)*getLayeredNoise(offset+dir*fract(t+0.5));
}

float contrast(float t,float am){
return (t-0.5)*am+0.5;
}

void main(){
vec4 color = texture2D(u_texture, v_texCoords.xy);
float depth = color.a;
if(depth<0.1){
discard;
}
vec2 tilepos = v_texCoords.xy*u_resolution.xy;
float type = texture2D(u_texture, (floor(tilepos)+vec2(0.5))/u_resolution.xy).r;
vec2 vel = (color.gb-vec2(0.5))*10.0;
float vdis = length(vel);
gl_FragColor = getBlendedTex(tilepos ,-vel, u_time * 0.007,int(type*256.0)+1);
gl_FragColor.a *= clamp(depth*2.0,0.0,1.0);
gl_FragColor.rgb *= 1.0-(depth-0.1)*0.5;
float wavedepth = clamp((depth-0.1)*10.0,0.0,1.0);
bool isWave = depth+sin(u_time*0.07+wavedepth*wavedepth*9.0)*0.4*(1.0-wavedepth) < 0.2; // border ripples

float noiser = contrast(getBlendedNoise(tilepos*0.5 ,-vel*0.5, u_time * 0.007+1.0),1.5); // the rapids foam
if(isWave || noiser<vdis*0.1){
gl_FragColor = mix(gl_FragColor,vec4(1.0),0.5);
}
}

42 changes: 42 additions & 0 deletions main/assets/shaders/groundliquid.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
uniform mat4 u_projTrans;
uniform int u_sprites_width;

attribute vec4 a_position;
attribute vec2 a_texCoord0;
attribute vec4 a_color;
attribute vec4 a_mix_color;
attribute float a_fluidType;

varying vec4 v_shallowcolor;
varying vec4 v_deepcolor;
varying vec2 v_texCoords;
varying float v_fluidType;
varying float v_tx;
varying float v_ty;
varying float v_tx2;
varying float v_ty2;
varying float v_ts;

const float epsilon = 0.002;

uniform vec2 u_viewportInverse;

float round(float a){
return floor(a + 0.5);
}

void main(){
gl_Position = u_projTrans * a_position;
v_texCoords = a_texCoord0;
v_shallowcolor = a_color;
v_deepcolor = a_mix_color;
v_fluidType = a_fluidType;

v_ts = 1.0/float(u_sprites_width);
v_ty = float(int(a_fluidType*2.0)/u_sprites_width)*v_ts+epsilon;
v_tx = mod(a_fluidType*2.0,float(u_sprites_width))*v_ts+epsilon;
v_ty2 = float(floor(round(a_fluidType*2.0+1.0)/float(u_sprites_width)))*v_ts+epsilon;
v_tx2 = mod(a_fluidType*2.0+1.0,float(u_sprites_width))*v_ts+epsilon;
v_ts-=epsilon*2.0;

}
90 changes: 90 additions & 0 deletions main/assets/shaders/groundliquid2.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#define HIGHP

uniform sampler2D u_texture;
uniform sampler2D u_sprites;
uniform float u_time;
uniform float u_trans;
uniform vec2 u_resolution;
uniform vec2 u_chunksize;
uniform vec2 u_offset;
uniform int u_sprites_width;

varying vec4 v_shallowcolor;
varying vec4 v_deepcolor;
varying vec2 v_texCoords;
varying float v_fluidType;
varying float v_tx;
varying float v_ty;
varying float v_tx2;
varying float v_ty2;
varying float v_ts;

const float epsilon = 0.001;



vec4 getTex(vec2 offset){
offset = mod(offset,vec2(3.0))/3.0;
return texture2D(u_sprites,vec2(v_tx+offset.x*v_ts,v_ty+offset.y*v_ts));
}

float getNoise(vec2 offset){
offset = mod(offset,vec2(2.0))/3.0;
return texture2D(u_sprites,vec2(v_tx2+offset.x*(v_ts-epsilon),v_ty2+(offset.y+0.3333)*(v_ts-epsilon))).r;
}

float getLayeredNoise(vec2 offset){
return (getNoise(offset*0.08) + 0.5* getNoise(offset*0.333) + 0.25* getNoise(offset))/1.75;
}

float blendFun(float x){
return 1.0-2.0*abs(fract(x)-0.5);
}

vec4 getBlendedTex(vec2 offset,vec2 dir, float t){
t = fract(t);
return blendFun(t)*getTex(offset+dir*t) + blendFun(t+0.5)*getTex(offset+dir*fract(t+0.5));
}

float getBlendedNoise(vec2 offset,vec2 dir, float t){
t = fract(t);
return blendFun(t)*getLayeredNoise(offset+dir*t) + blendFun(t+0.5)*getLayeredNoise(offset+dir*fract(t+0.5));
}

vec4 getWaveTex(float t){
return texture2D(u_sprites,vec2(v_tx2+clamp(t,epsilon,1.0-epsilon)*v_ts,v_ty2+0.1666*v_ts));
}

float contrast(float t,float am){
return (t-0.5)*am+0.5;
}

vec4 alphaComposite(vec4 under,vec4 over){
float a0 = over.a + under.a * (1.0-over.a);
return vec4((over.rgb*over.a + under.rgb*under.a * (1.0-over.a))/a0,a0);
}

void main(){
vec4 color = texture2D(u_texture, v_texCoords.xy);
float depth = mix(color.r,color.a,u_trans);
if(depth<0.1){
discard;
}
vec2 tilepos = mod(v_texCoords.xy*u_resolution.xy,u_chunksize.xy)+u_offset.xy;
vec2 vel = (color.gb-vec2(0.5))*10.0;
float vdis = length(vel);
gl_FragColor = getBlendedTex(tilepos ,-vel, u_time * 0.007);
gl_FragColor.rgba *= mix(v_shallowcolor,v_deepcolor,(depth-0.1)*1.5).rgba;
float wavedepth = clamp((depth-0.1)*10.0,0.0,1.0);
bool isWave = depth+sin(u_time*0.07+wavedepth*wavedepth*9.0)*0.4*(1.0-wavedepth) < 0.2; // border ripples

float noiser = contrast(getBlendedNoise(tilepos*0.5 ,-vel*0.5, u_time * 0.007+1.0),1.5)-0.3 + vdis*0.15; // the rapids foam
if(isWave){
gl_FragColor = mix(gl_FragColor,vec4(1.0),0.5);
}
vec4 wtex = getWaveTex(noiser);
gl_FragColor = alphaComposite(gl_FragColor,wtex);


}

9 changes: 8 additions & 1 deletion main/src/unity/Unity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import unity.ui.*;
import unity.util.*;
import unity.world.graph.*;
import unity.world.systems.*;

import static mindustry.Vars.*;

Expand Down Expand Up @@ -56,6 +57,9 @@ public class Unity extends Mod{
/**UI**/
public static UnityUI ui= new UnityUI();

/**manages the liquids**/
public static GroundFluidControl groundFluidControl;

/** Default constructor for Mindustry mod loader to instantiate. */
public Unity(){
this(false);
Expand Down Expand Up @@ -152,6 +156,8 @@ public Unity(boolean tools){
JSBridge.init();
JSBridge.importDefaults(JSBridge.unityScope);
});


}

@Override
Expand All @@ -160,6 +166,7 @@ public void init(){
music.init();
ui.init();
UnityCalls.registerPackets();;
groundFluidControl = new GroundFluidControl();
}

@Override
Expand All @@ -180,7 +187,7 @@ public void loadContent(){
FactionMeta.init();
UnityEntityMapping.init();


GroundFluidControl.initialiseContent();
//logContent();
}

Expand Down
Loading

1 comment on commit fd8e4c2

@Austin5003
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍞

Please sign in to comment.