Skip to content

Commit

Permalink
comment out unused configs, bring down extra cube particles to reason…
Browse files Browse the repository at this point in the history
…able configurable amount. add randomized weight to cubes to add more chaos to visual, re-enable use of weight on particles for tornado
  • Loading branch information
Corosauce committed Oct 20, 2023
1 parent 23c5516 commit 2f7e57c
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public void initParticleCube(EntityRotFX particle) {
particle.rotationYaw = rand.nextInt(360);
particle.rotationPitch = rand.nextInt(360);
particle.fastLight = true;
particle.windWeight = 5F;
particle.windWeight = 5 + ((float)((Math.random() * 0.3) - (Math.random() * 0.3)));
particle.spinFast = true;
particle.spinFastRate = 1F;
particle.setFacePlayer(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.corosus.coroutil.util.CULog;
import com.corosus.coroutil.util.CoroUtilBlock;
import com.corosus.coroutil.util.CoroUtilMisc;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;
import extendedrenderer.particle.ParticleRegistry;
Expand Down Expand Up @@ -46,6 +47,7 @@ public ParticleCube(Level worldIn, double posXIn, double posYIn,
} else {
CULog.dbg("unable to find sprite to use from block: " + state);
sprite = getSpriteFromState(Blocks.DIRT.defaultBlockState());
//if (CoroUtilMisc.random().nextBoolean()) sprite = getSpriteFromState(Blocks.GRASS.defaultBlockState());
if (sprite != null) {
setSprite(sprite);
}
Expand All @@ -61,11 +63,14 @@ public TextureAtlasSprite getSpriteFromState(BlockState state) {
BlockRenderDispatcher blockrenderdispatcher = Minecraft.getInstance().getBlockRenderer();
BakedModel model = blockrenderdispatcher.getBlockModel(state);
for(Direction direction : Direction.values()) {
//TODO: 1.20
List<BakedQuad> list = model.getQuads(state, direction, RandomSource.create());
if (list.size() > 0) {
return list.get(0).getSprite();
}
//plan b
if (model.getParticleIcon() != null) {
return model.getParticleIcon();
}
}
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/weather2/config/ConfigFoliage.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

public class ConfigFoliage implements IConfigCategory {

public static int foliageShaderRange = 40;
/*public static int foliageShaderRange = 40;
public static int Thread_Foliage_Process_Delay = 1000;
public static boolean extraGrass = false;
public static boolean extraGrass = false;*/

@Override
public String getName() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/weather2/config/ConfigLTOverrides.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

public class ConfigLTOverrides {

public static boolean stormProgression = false;
/*public static boolean stormProgression = false;
public static boolean vanillaRainOverride = false;
public static boolean windSpeedOverride = true;
public static boolean windSpeedOverride = true;*/

}
26 changes: 13 additions & 13 deletions src/main/java/weather2/config/ConfigMisc.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
public class ConfigMisc implements IConfigCategory {

//misc
public static boolean Misc_proxyRenderOverrideEnabled = true;
//public static boolean Misc_proxyRenderOverrideEnabled = true;
//public static boolean Misc_takeControlOfGlobalRain = true;

//cutoff a bit extra, noticed lots of storms being insta killed on creation
public static int Misc_simBoxRadiusCutoff = 1024+100;
public static int Misc_simBoxRadiusSpawn = 1024;
public static boolean Misc_ForceVanillaCloudsOff = false;
/*public static boolean Misc_ForceVanillaCloudsOff = false;
public static int Misc_AutoDataSaveIntervalInTicks = 20*60*30;
public static boolean consoleDebug = false;
public static boolean radarCloudDebug = false;
public static boolean radarCloudDebug = false;*/

//Weather
@ConfigComment("If true, lets server side do vanilla weather rules, weather2 will only make storms when server side says 'rain' is on")
Expand Down Expand Up @@ -51,16 +51,16 @@ public class ConfigMisc implements IConfigCategory {
@ConfigComment("Maximum percent of cloud coverage, supports over 100% for extended full cloud sky coverage")
public static double Cloud_Coverage_Max_Percent = 100D;

public static int Thread_Particle_Process_Delay = 400;
/*public static int Thread_Particle_Process_Delay = 400;
//sound
public static double volWindScale = 0.05D;
public static double volWaterfallScale = 0.5D;
public static double volWindTreesScale = 0.5D;
public static double volWindLightningScale = 1D;
public static double volWindLightningScale = 1D;*/

//blocks
public static double sirenActivateDistance = 256D;
public static double sensorActivateDistance = 256D;
/*public static double sensorActivateDistance = 256D;
public static boolean Block_WeatherMachineNoTornadosOrCyclones = false;
public static boolean Block_WeatherMachineNoRecipe = false;
Expand All @@ -75,7 +75,7 @@ public class ConfigMisc implements IConfigCategory {
public static boolean Block_SandNoRecipe = false;
public static boolean Item_PocketSandNoRecipe = false;
@ConfigComment("Disabling this recipe will keep them from using other recipes since it depends on this item")
public static boolean Item_WeatherItemNoRecipe = false;
public static boolean Item_WeatherItemNoRecipe = false;*/


//dimension settings
Expand All @@ -84,18 +84,18 @@ public class ConfigMisc implements IConfigCategory {
public static String Dimension_List_Storms = "minecraft:overworld, tropicraft:tropicraft";
public static String Dimension_List_WindEffects = "minecraft:overworld, tropicraft:tropicraft";

public static boolean Villager_MoveInsideForStorms = true;
/*public static boolean Villager_MoveInsideForStorms = true;
public static int Villager_MoveInsideForStorms_Dist = 256;
public static double shaderParticleRateAmplifier = 3D;
public static double shaderParticleRateAmplifier = 3D;*/

public static boolean blockBreakingInvokesCancellableEvent = false;

@ConfigComment("If true, will cancel vanilla behavior of setting clear weather when the player sleeps, for global overcast mode")
public static boolean Global_Overcast_Prevent_Rain_Reset_On_Sleep = false;
/*@ConfigComment("If true, will cancel vanilla behavior of setting clear weather when the player sleeps, for global overcast mode")
public static boolean Global_Overcast_Prevent_Rain_Reset_On_Sleep = false;*/

@ConfigComment("Use if you are on a server with weather but want it ALL off client side for performance reasons, overrides basically every client based setting")
public static boolean Client_PotatoPC_Mode = false;
/*@ConfigComment("Use if you are on a server with weather but want it ALL off client side for performance reasons, overrides basically every client based setting")
public static boolean Client_PotatoPC_Mode = false;*/

@ConfigComment("Server and client side, Locks down the mod to only do wind, leaves, foliage shader if on, etc. No weather systems, turns overcast mode on")
public static boolean Aesthetic_Only_Mode = false;
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/weather2/config/ConfigParticle.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ConfigParticle implements IConfigCategory {


//particles
public static boolean Wind_Particle_leafs = true;
/*public static boolean Wind_Particle_leafs = true;
@ConfigComment("Currently used for rates of leaf, waterfall, and fire particles")
public static double Wind_Particle_effect_rate = 0.7D;
public static boolean Wind_Particle_waterfall = true;
Expand All @@ -23,10 +23,13 @@ public class ConfigParticle implements IConfigCategory {
public static boolean Particle_Rain = false;
public static boolean Particle_Rain_GroundSplash = true;
public static boolean Particle_Rain_DownfallSheet = false;
public static boolean Particle_VanillaAndWeatherOnly = false;
public static boolean Particle_VanillaAndWeatherOnly = false;*/
public static double Precipitation_Particle_effect_rate = 0.7D;
public static double Sandstorm_Particle_Debris_effect_rate = 0.6D;
public static double Sandstorm_Particle_Dust_effect_rate = 0.6D;
//public static double Sandstorm_Particle_Debris_effect_rate = 0.6D;
//public static double Sandstorm_Particle_Dust_effect_rate = 0.6D;

@ConfigComment("Extra flying block particles to spawn when the tornado rips up a block")
public static int Particle_Tornado_extraParticleCubes = 2;

@Override
public String getName() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/weather2/config/ConfigSand.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ConfigSand implements IConfigCategory {
public static boolean Sandstorm_Sand_Buildup_AllowOutsideDesert = true;

public static double Sandstorm_Particle_Dust_effect_rate = 0.6D;
public static double Precipitation_Particle_effect_rate = 0.7D;
//public static double Precipitation_Particle_effect_rate = 0.7D;
public static double Sandstorm_Particle_Debris_effect_rate = 0.6D;

public static boolean Sandstorm_Siren_PleaseNoDarude = false;
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/weather2/config/ConfigTornado.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public class ConfigTornado implements IConfigCategory {
@ConfigComment("Max amount of flying entity blocks allowed active, if it goes over this, it stops turning destroyed blocks into entities")
public static int Storm_Tornado_maxFlyingEntityBlocks = 200;
public static int Storm_Tornado_maxBlocksGrabbedPerTick = 5;
@ConfigComment("How rarely a block will be removed while spinning around a tornado")
public static int Storm_Tornado_rarityOfDisintegrate = 15;
public static int Storm_Tornado_rarityOfBreakOnFall = 5;
//@ConfigComment("How rarely a block will be removed while spinning around a tornado")
//public static int Storm_Tornado_rarityOfDisintegrate = 15;
//public static int Storm_Tornado_rarityOfBreakOnFall = 5;
//@ConfigComment(":D")
//public static int Storm_Tornado_rarityOfFirenado = -1;
@ConfigComment("Make tornados initial heading aimed towards closest player")
Expand All @@ -59,11 +59,11 @@ public class ConfigTornado implements IConfigCategory {
@ConfigComment("Extra bit of grab angle for the tornado, tweak for different grab shapes")
public static int Storm_Tornado_extraGrabAngle = 20;

@ConfigComment("Experimental idea, places the WIP repairing block where a tornado does damage instead of removing the block, causes tornado damage to self repair, recommend setting Storm_Tornado_rarityOfBreakOnFall to 0 to avoid duplicated blocks")
public static boolean Storm_Tornado_grabbedBlocksRepairOverTime = false;
//@ConfigComment("Experimental idea, places the WIP repairing block where a tornado does damage instead of removing the block, causes tornado damage to self repair, recommend setting Storm_Tornado_rarityOfBreakOnFall to 0 to avoid duplicated blocks")
//public static boolean Storm_Tornado_grabbedBlocksRepairOverTime = false;

@ConfigComment("Used if Storm_Tornado_grabbedBlocksRepairOverTime is true, minimum of 600 ticks (30 seconds) required")
public static int Storm_Tornado_TicksToRepairBlock = 20*60*5;
//@ConfigComment("Used if Storm_Tornado_grabbedBlocksRepairOverTime is true, minimum of 600 ticks (30 seconds) required")
//public static int Storm_Tornado_TicksToRepairBlock = 20*60*5;

@Override
public String getName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import weather2.ClientTickHandler;
import weather2.Weather;
import weather2.client.SceneEnhancer;
import weather2.config.ConfigParticle;
import weather2.weathersystem.storm.EnumWeatherObjectType;
import weather2.weathersystem.storm.StormObject;
import weather2.weathersystem.storm.WeatherObject;
Expand Down Expand Up @@ -158,7 +159,7 @@ public void nbtSyncFromServer(CompoundTag parNBT) {
StormObject storm = getStormObjectByID(ownerID);
if (storm != null) {

int extraCubes = 10;
int extraCubes = 1 + ConfigParticle.Particle_Tornado_extraParticleCubes;
Random rand = CoroUtilMisc.random();
float randRange = 3;
for (int i = 0; i < extraCubes; i++) {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/weather2/weathersystem/storm/StormObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -2055,6 +2055,7 @@ public void tickClient() {
Vec3 motion = spinObject(ent.getPos(), new Vec3(ent.getMotionX(), ent.getMotionY(), ent.getMotionZ()), false, 0.91F, ent instanceof ParticleCube);
//Vec3 motion = spinObject(ent.getPos(), new Vec3(ent.getMotionX(), ent.getMotionY(), ent.getMotionZ()), false, 0.85F);
float damp = 1F;
damp = ent.getWindWeight() / 5F;
motion = motion.multiply(damp, 1F, damp);
//System.out.println("motion: " + motion);
ent.setMotionX(motion.x);
Expand Down Expand Up @@ -2488,10 +2489,13 @@ public void spinEntityv2(Entity entity) {

if (entHeightFromBase > 90) {
if (Weather.isLoveTropicsInstalled()) {
//for LT, reenable or make it a soft dependency somehow
//TODO: 1.20 for LT, reenable or make it a soft dependency somehow
/*if (isSharknado() && entity instanceof SharkEntity) {
entity.getPersistentData().putBoolean("tornado_shoot", true);
}*/
if (isSharknado() && entity instanceof Dolphin) {
entity.getPersistentData().putBoolean("tornado_shoot", true);
}
} else {
if (isSharknado() && entity instanceof Dolphin) {
entity.getPersistentData().putBoolean("tornado_shoot", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@ public boolean forceRotate(Level parWorld, boolean featherFallInstead)
if (getDistanceXZ(storm.posBaseFormationPos, entity1.getX(), entity1.getY(), entity1.getZ()) < dist)
{
if (!storm.isPet()) {
//TODO: 1.14 uncomment and remove false
if (false/* && (entity1 instanceof EntityMovingBlock && !((EntityMovingBlock)entity1).collideFalling)*/) {
storm.spinEntity(entity1);
//spin(entity, conf, entity1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ private PivotingParticle createParticleDebris(ClientLevel world, double x, doubl

particle.setKillOnCollide(false);

particle.windWeight = 1F;
particle.windWeight = 5F;
particle.setRenderDistanceCull(renderDistCutoff);

return particle;
Expand Down

0 comments on commit 2f7e57c

Please sign in to comment.