diff --git a/src/main/java/extendedrenderer/particle/behavior/ParticleBehaviors.java b/src/main/java/extendedrenderer/particle/behavior/ParticleBehaviors.java index 98253e3c..38a065fe 100644 --- a/src/main/java/extendedrenderer/particle/behavior/ParticleBehaviors.java +++ b/src/main/java/extendedrenderer/particle/behavior/ParticleBehaviors.java @@ -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); diff --git a/src/main/java/extendedrenderer/particle/entity/ParticleCube.java b/src/main/java/extendedrenderer/particle/entity/ParticleCube.java index cf7604c5..b3e191f7 100644 --- a/src/main/java/extendedrenderer/particle/entity/ParticleCube.java +++ b/src/main/java/extendedrenderer/particle/entity/ParticleCube.java @@ -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; @@ -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); } @@ -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 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; } diff --git a/src/main/java/weather2/config/ConfigFoliage.java b/src/main/java/weather2/config/ConfigFoliage.java index 5b42d158..022cd337 100644 --- a/src/main/java/weather2/config/ConfigFoliage.java +++ b/src/main/java/weather2/config/ConfigFoliage.java @@ -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() { diff --git a/src/main/java/weather2/config/ConfigLTOverrides.java b/src/main/java/weather2/config/ConfigLTOverrides.java index 9b8a7f48..d25a7b8e 100644 --- a/src/main/java/weather2/config/ConfigLTOverrides.java +++ b/src/main/java/weather2/config/ConfigLTOverrides.java @@ -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;*/ } diff --git a/src/main/java/weather2/config/ConfigMisc.java b/src/main/java/weather2/config/ConfigMisc.java index 4fa1582f..b3a71e56 100644 --- a/src/main/java/weather2/config/ConfigMisc.java +++ b/src/main/java/weather2/config/ConfigMisc.java @@ -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") @@ -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; @@ -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 @@ -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; diff --git a/src/main/java/weather2/config/ConfigParticle.java b/src/main/java/weather2/config/ConfigParticle.java index 4552f402..4976bc8b 100644 --- a/src/main/java/weather2/config/ConfigParticle.java +++ b/src/main/java/weather2/config/ConfigParticle.java @@ -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; @@ -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() { diff --git a/src/main/java/weather2/config/ConfigSand.java b/src/main/java/weather2/config/ConfigSand.java index af01790b..06bf5a0f 100644 --- a/src/main/java/weather2/config/ConfigSand.java +++ b/src/main/java/weather2/config/ConfigSand.java @@ -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; diff --git a/src/main/java/weather2/config/ConfigTornado.java b/src/main/java/weather2/config/ConfigTornado.java index f22c2fc5..6587059c 100644 --- a/src/main/java/weather2/config/ConfigTornado.java +++ b/src/main/java/weather2/config/ConfigTornado.java @@ -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") @@ -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() { diff --git a/src/main/java/weather2/weathersystem/WeatherManagerClient.java b/src/main/java/weather2/weathersystem/WeatherManagerClient.java index 307dc31a..a5f02848 100644 --- a/src/main/java/weather2/weathersystem/WeatherManagerClient.java +++ b/src/main/java/weather2/weathersystem/WeatherManagerClient.java @@ -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; @@ -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++) { diff --git a/src/main/java/weather2/weathersystem/storm/StormObject.java b/src/main/java/weather2/weathersystem/storm/StormObject.java index d6af88e5..29b775ce 100644 --- a/src/main/java/weather2/weathersystem/storm/StormObject.java +++ b/src/main/java/weather2/weathersystem/storm/StormObject.java @@ -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); @@ -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); diff --git a/src/main/java/weather2/weathersystem/storm/TornadoHelper.java b/src/main/java/weather2/weathersystem/storm/TornadoHelper.java index f67a9c8b..a15868e6 100644 --- a/src/main/java/weather2/weathersystem/storm/TornadoHelper.java +++ b/src/main/java/weather2/weathersystem/storm/TornadoHelper.java @@ -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); diff --git a/src/main/java/weather2/weathersystem/tornado/simple/TornadoFunnelSimple.java b/src/main/java/weather2/weathersystem/tornado/simple/TornadoFunnelSimple.java index 4717afb7..51d283b9 100644 --- a/src/main/java/weather2/weathersystem/tornado/simple/TornadoFunnelSimple.java +++ b/src/main/java/weather2/weathersystem/tornado/simple/TornadoFunnelSimple.java @@ -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;