Premier commit

Cette révision appartient à :
Théo Gastinel a révisé 2026-10-11 01:56:14 +02:00
révision 8c3fc6dd73
175 fichiers modifiés
+7729

Aucun fichier ne correspond à votre recherche

+66
Voir le fichier
@@ -0,0 +1,66 @@
# --- double-push : exclusions generiques (secrets, builds, binaires, gros fichiers) ---
target/
node_modules/
build/
build-*/
dist/
out/
.gradle/
.idea/
venv/
.venv/
env/
__pycache__/
*.pyc
.cache/
.next/
.env
.env.*
!.env.example
accounts.json
Clee.API/
*.pem
*.key
*.p12
*.pfx
*.jks
*.keystore
keystore.properties
id_rsa*
id_ed25519*
*.kdbx
*.odt
*.sqlite
*.sqlite3
*.db
*.log
*.exe
*.dll
*.msi
*.jar
*.zip
*.7z
*.rar
*.tar
*.tar.gz
*.tgz
*.gguf
*.safetensors
*.onnx
*.pt
*.pth
*.bin
*.iso
*.gws
*.apk
*.aab
*.so
*.o
*.a
*.lib
*.pdb
*.mp4
*.mkv
*.wav
*.flac
+37
Voir le fichier
@@ -0,0 +1,37 @@
plugins {
id 'java'
id 'net.neoforged.moddev' version '2.0.142'
}
version = project.mod_version
group = project.mod_group_id
base { archivesName = "${project.mod_id}-neoforge-1.21.1" }
java { toolchain { languageVersion = JavaLanguageVersion.of(21) } }
repositories {
mavenCentral()
maven { name = 'NeoForged'; url = 'https://maven.neoforged.net/releases' }
}
neoForge {
version = project.neoforge_version
runs {
client {
client()
}
server {
server()
}
}
mods {
"${project.mod_id}" {
sourceSet sourceSets.main
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.release = 21
}
Fichier binaire non affiché.
+9
Voir le fichier
@@ -0,0 +1,9 @@
org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true
mod_version=1.0.0
mod_group_id=com.gastinelweather
mod_id=gastinelweather
minecraft_version=1.21.1
neoforge_version=21.1.248
+7
Voir le fichier
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Externe
+248
Voir le fichier
@@ -0,0 +1,248 @@
#!/bin/sh
#
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
+82
Voir le fichier
@@ -0,0 +1,82 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables, and ensure extensions are enabled
setlocal EnableExtensions
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
"%COMSPEC%" /c exit 1
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
"%COMSPEC%" /c exit 1
:execute
@rem Setup the command line
@rem Execute Gradle
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
@rem which allows us to clear the local environment before executing the java command
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
:exitWithErrorLevel
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
"%COMSPEC%" /c exit %ERRORLEVEL%
+8
Voir le fichier
@@ -0,0 +1,8 @@
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
maven { name = 'NeoForged'; url = 'https://maven.neoforged.net/releases' }
}
}
rootProject.name = 'gastinelweather-neoforge-1.21.1'
+43
Voir le fichier
@@ -0,0 +1,43 @@
package com.gastinelweather;
import com.gastinelweather.command.GastinelWeatherCommand;
import com.gastinelweather.weather.WeatherSystem;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.common.NeoForge;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Mod(GastinelWeatherMod.MOD_ID)
public class GastinelWeatherMod {
public static final String MOD_ID = "gastinelweather";
private static final Logger LOGGER = LoggerFactory.getLogger(GastinelWeatherMod.class);
private static WeatherSystem weatherSystem;
public GastinelWeatherMod(IEventBus modEventBus, ModContainer modContainer) {
LOGGER.info("[GastinelWeatherMod] Initialisation du moteur météo déterministe...");
// Initialisation de la météo
weatherSystem = new WeatherSystem();
// Enregistrement des blocs, items et onglets créatifs
com.gastinelweather.registry.ModBlocks.BLOCKS.register(modEventBus);
com.gastinelweather.registry.ModItems.ITEMS.register(modEventBus);
com.gastinelweather.registry.ModCreativeTabs.CREATIVE_MODE_TABS.register(modEventBus);
// Enregistrement des commandes
NeoForge.EVENT_BUS.register(GastinelWeatherCommand.class);
LOGGER.info("[GastinelWeatherMod] Blocs, Items, Capteurs météo et Énergie enregistrés avec succès.");
}
public static WeatherSystem getWeatherSystem() {
if (weatherSystem == null) {
weatherSystem = new WeatherSystem();
}
return weatherSystem;
}
}
+72
Voir le fichier
@@ -0,0 +1,72 @@
package com.gastinelweather.block;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.WeatherSample;
import com.gastinelweather.weather.WeatherSystem;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.joml.Vector3f;
public class AnemometerBlock extends Block {
private static final VoxelShape SHAPE = Block.box(4.0, 0.0, 4.0, 12.0, 16.0, 12.0);
public AnemometerBlock(Properties properties) {
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
public boolean isSignalSource(BlockState state) {
return true;
}
@Override
public int getSignal(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
if (level instanceof Level l) {
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
float gameHours = l.getDayTime() / 1000.0f;
Vector3f vPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
HeightSampler terrain = new MinecraftHeightSampler(l);
WeatherSample sample = system.sampleAt(vPos, gameHours, terrain);
// Signal redstone 0 à 15 (15 = vent à 60 km/h ou plus)
int power = (int) Math.min(15.0f, (sample.getWindSpeedKmh() / 60.0f) * 15.0f);
return Math.max(0, power);
}
return 0;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
float gameHours = level.getDayTime() / 1000.0f;
Vector3f vPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
HeightSampler terrain = new MinecraftHeightSampler(level);
WeatherSample sample = system.sampleAt(vPos, gameHours, terrain);
player.sendSystemMessage(Component.literal(
String.format("§8[§bAnémomètre à Coupelles§8] §fVent: §e%.1f km/h §7(%.1f m/s) | Signal Redstone: §c%d/15",
sample.getWindSpeedKmh(), sample.windMps, getSignal(state, level, pos, Direction.UP))
));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+39
Voir le fichier
@@ -0,0 +1,39 @@
package com.gastinelweather.block;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class CableBlock extends Block {
public enum CableType {
NETWORK_INDOOR,
NETWORK_OUTDOOR,
NETWORK_UNDERGROUND,
ELECTRIC_INDOOR,
ELECTRIC_UNDERGROUND
}
private static final VoxelShape THIN_SHAPE = Block.box(6.0, 6.0, 6.0, 10.0, 10.0, 10.0);
private static final VoxelShape THICK_SHAPE = Block.box(4.0, 4.0, 4.0, 12.0, 12.0, 12.0);
private final CableType cableType;
public CableBlock(Properties properties, CableType cableType) {
super(properties);
this.cableType = cableType;
}
public CableType getCableType() {
return cableType;
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return (cableType == CableType.NETWORK_UNDERGROUND || cableType == CableType.ELECTRIC_UNDERGROUND)
? THICK_SHAPE : THIN_SHAPE;
}
}
+54
Voir le fichier
@@ -0,0 +1,54 @@
package com.gastinelweather.block;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.network.chat.Component;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.RandomSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.ItemInteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
public class CoalGeneratorBlock extends Block {
public CoalGeneratorBlock(Properties properties) {
super(properties);
}
@Override
protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) {
if (stack.is(Items.COAL) || stack.is(Items.CHARCOAL) || stack.is(Items.COAL_BLOCK)) {
if (!level.isClientSide) {
stack.shrink(1);
level.playSound(null, pos, SoundEvents.FIRECHARGE_USE, SoundSource.BLOCKS, 0.8f, 1.0f);
player.sendSystemMessage(Component.literal("§8[§6Centrale Thermique§8] §aCharbon injecté ! Chaudière allumée (Production: §e+80 FE/t§a)."));
}
return ItemInteractionResult.sidedSuccess(level.isClientSide);
}
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
player.sendSystemMessage(Component.literal("§8[§6Centrale à Charbon§8] §7Insérez du §eCharbon§7 pour lancer la combustion thermique."));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
@Override
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
if (random.nextDouble() < 0.3) {
level.addParticle(ParticleTypes.SMOKE, pos.getX() + 0.5, pos.getY() + 1.1, pos.getZ() + 0.5, 0.0, 0.04, 0.0);
level.addParticle(ParticleTypes.FLAME, pos.getX() + 0.5 + (random.nextDouble() - 0.5) * 0.2, pos.getY() + 0.4, pos.getZ() + 0.5 + (random.nextDouble() - 0.5) * 0.2, 0.0, 0.01, 0.0);
}
}
}
+58
Voir le fichier
@@ -0,0 +1,58 @@
package com.gastinelweather.block;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class DirectionalAntennaBlock extends HorizontalDirectionalBlock {
public static final MapCodec<DirectionalAntennaBlock> CODEC = simpleCodec(DirectionalAntennaBlock::new);
private static final VoxelShape SHAPE = Block.box(2.0, 0.0, 2.0, 14.0, 16.0, 14.0);
public DirectionalAntennaBlock(Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH));
}
@Override
protected MapCodec<? extends HorizontalDirectionalBlock> codec() {
return CODEC;
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection().getOpposite());
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
Direction dir = state.getValue(FACING);
player.sendSystemMessage(Component.literal("§8[§6Antenne Yagi Dirigeable§8] §7Orientation: §e" + dir.getName().toUpperCase() + " §7| Gain: §a+14 dBi §7| Portée: §b1500 blocs"));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+35
Voir le fichier
@@ -0,0 +1,35 @@
package com.gastinelweather.block;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class Esp32Block extends Block {
private static final VoxelShape SHAPE = Block.box(4.0, 0.0, 4.0, 12.0, 2.0, 12.0);
public Esp32Block(Properties properties) {
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
player.sendSystemMessage(Component.literal("§8[§aESP32 Microcontrôleur§8] §2Statut: Prêt §7| Protocole: §fWiFi / LoRa 868MHz §7| Télémétrie: §aActive"));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+30
Voir le fichier
@@ -0,0 +1,30 @@
package com.gastinelweather.block;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class ExhaustChimneyBlock extends Block {
private static final VoxelShape SHAPE = Block.box(3.0, 0.0, 3.0, 13.0, 16.0, 13.0);
public ExhaustChimneyBlock(Properties properties) {
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
level.addParticle(ParticleTypes.CAMPFIRE_COSY_SMOKE, pos.getX() + 0.5, pos.getY() + 1.1, pos.getZ() + 0.5, 0.0, 0.08, 0.0);
}
}
+46
Voir le fichier
@@ -0,0 +1,46 @@
package com.gastinelweather.block;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class HydroTurbineBlock extends Block {
private static final VoxelShape SHAPE = Block.box(2.0, 0.0, 2.0, 14.0, 16.0, 14.0);
public HydroTurbineBlock(Properties properties) {
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
boolean inWater = level.getBlockState(pos.above()).is(Blocks.WATER) ||
level.getBlockState(pos.north()).is(Blocks.WATER) ||
level.getBlockState(pos.south()).is(Blocks.WATER);
int fePerTick = inWater ? 40 : 0;
player.sendSystemMessage(Component.literal("§8=== §3§lHydrolienne Immergée (Hélice pour l'eau) §8==="));
player.sendSystemMessage(Component.literal(
String.format("§7Courant hydraulique: %s §7| Production: §a+%d FE/t",
inWater ? "§bOptimal (Immergée)" : "§cInactif (Placer dans l'eau)", fePerTick)
));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+66
Voir le fichier
@@ -0,0 +1,66 @@
package com.gastinelweather.block;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.WeatherSystem;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.joml.Vector3f;
import java.util.List;
public class MonitorBlock extends HorizontalDirectionalBlock {
public static final MapCodec<MonitorBlock> CODEC = simpleCodec(MonitorBlock::new);
private static final VoxelShape SHAPE = Block.box(1.0, 0.0, 4.0, 15.0, 14.0, 12.0);
public MonitorBlock(Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH));
}
@Override
protected MapCodec<? extends HorizontalDirectionalBlock> codec() {
return CODEC;
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection().getOpposite());
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (level.isClientSide) {
com.gastinelweather.client.ClientHooks.openMonitorScreen(pos);
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+38
Voir le fichier
@@ -0,0 +1,38 @@
package com.gastinelweather.block;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class NetworkRouterBlock extends Block {
private static final VoxelShape SHAPE = Block.box(2.0, 0.0, 4.0, 14.0, 4.0, 12.0);
public NetworkRouterBlock(Properties properties) {
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
level.playSound(null, pos, SoundEvents.UI_BUTTON_CLICK.value(), SoundSource.BLOCKS, 0.5f, 1.8f);
player.sendSystemMessage(Component.literal("§8[§2Box / Routeur Réseau Gigabit§8] §aLiaison: 1000 Mbps §7| Ports Ethernet: §e4 Connectés §7| WiFi: §bActif 5GHz"));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+35
Voir le fichier
@@ -0,0 +1,35 @@
package com.gastinelweather.block;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class OmniAntennaBlock extends Block {
private static final VoxelShape SHAPE = Block.box(6.0, 0.0, 6.0, 10.0, 16.0, 10.0);
public OmniAntennaBlock(Properties properties) {
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
player.sendSystemMessage(Component.literal("§8[§bAntenne 360° Omnidirectionnelle§8] §7Couverture: §a360° Circulaire §7| Fréquence: §f868 / 433 MHz §7| Portée: §b250 blocs"));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+60
Voir le fichier
@@ -0,0 +1,60 @@
package com.gastinelweather.block;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class PcCaseBlock extends HorizontalDirectionalBlock {
public static final MapCodec<PcCaseBlock> CODEC = simpleCodec(PcCaseBlock::new);
private static final VoxelShape SHAPE = Block.box(3.0, 0.0, 1.0, 13.0, 15.0, 15.0);
public PcCaseBlock(Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH));
}
@Override
protected MapCodec<? extends HorizontalDirectionalBlock> codec() {
return CODEC;
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection().getOpposite());
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
level.playSound(null, pos, SoundEvents.IRON_DOOR_OPEN, SoundSource.BLOCKS, 0.5f, 1.6f);
player.sendSystemMessage(Component.literal("§8[§bTour PC / Serveur Météo§8] §2Alimentation: ON §7| CPU: §e3.8 GHz §7(Ventirad OK) | GPU: §aPrêt §7| Base de données: §fConnectée"));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+72
Voir le fichier
@@ -0,0 +1,72 @@
package com.gastinelweather.block;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.WeatherSample;
import com.gastinelweather.weather.WeatherSystem;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.joml.Vector3f;
public class RainGaugeBlock extends Block {
private static final VoxelShape SHAPE = Block.box(4.0, 0.0, 4.0, 12.0, 14.0, 12.0);
public RainGaugeBlock(Properties properties) {
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
public boolean isSignalSource(BlockState state) {
return true;
}
@Override
public int getSignal(BlockState state, BlockGetter level, BlockPos pos, Direction direction) {
if (level instanceof Level l) {
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
float gameHours = l.getDayTime() / 1000.0f;
Vector3f vPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
HeightSampler terrain = new MinecraftHeightSampler(l);
WeatherSample sample = system.sampleAt(vPos, gameHours, terrain);
// Signal redstone proportionnel à la pluie (0 à 15, max à 6 mm/h)
int power = (int) Math.min(15.0f, (sample.precipitationMmPerHour / 6.0f) * 15.0f);
return Math.max(0, power);
}
return 0;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
float gameHours = level.getDayTime() / 1000.0f;
Vector3f vPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
HeightSampler terrain = new MinecraftHeightSampler(level);
WeatherSample sample = system.sampleAt(vPos, gameHours, terrain);
player.sendSystemMessage(Component.literal(
String.format("§8[§9Pluviomètre à Augets§8] §fIntensité: §b%.2f mm/h §7| Signal Redstone: §c%d/15",
sample.precipitationMmPerHour, getSignal(state, level, pos, Direction.UP))
));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+57
Voir le fichier
@@ -0,0 +1,57 @@
package com.gastinelweather.block;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.WeatherSample;
import com.gastinelweather.weather.WeatherSystem;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.joml.Vector3f;
public class SnowGaugeBlock extends Block {
private static final VoxelShape SHAPE = Block.box(4.0, 0.0, 4.0, 12.0, 16.0, 12.0);
public SnowGaugeBlock(Properties properties) {
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
float gameHours = level.getDayTime() / 1000.0f;
Vector3f vPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
HeightSampler terrain = new MinecraftHeightSampler(level);
WeatherSample sample = system.sampleAt(vPos, gameHours, terrain);
float snowHeightCm = (sample.temperatureC <= 1.0f) ? sample.wetness * 25.0f : 0.0f;
player.sendSystemMessage(Component.literal("§8=== §b§lNiveomètre Laser / Manteau Neigeux §8==="));
player.sendSystemMessage(Component.literal(
String.format("§fHauteur de neige estimée: §b%.1f cm §7| Température au sol: §e%.1f°C",
snowHeightCm, sample.temperatureC)
));
player.sendSystemMessage(Component.literal(
String.format("§7Chute de neige en cours: %s §7(Limite pluie/neige: §f1.0°C§7)",
sample.snowing ? "§bOUI (" + String.format("%.1f", sample.precipitationMmPerHour) + " mm/h)" : "§7NON")
));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+58
Voir le fichier
@@ -0,0 +1,58 @@
package com.gastinelweather.block;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.WeatherSample;
import com.gastinelweather.weather.WeatherSystem;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.joml.Vector3f;
public class UltrasonicAnemometerBlock extends Block {
private static final VoxelShape SHAPE = Block.box(3.0, 0.0, 3.0, 13.0, 15.0, 13.0);
public UltrasonicAnemometerBlock(Properties properties) {
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
float gameHours = level.getDayTime() / 1000.0f;
Vector3f vPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
HeightSampler terrain = new MinecraftHeightSampler(level);
WeatherSample sample = system.sampleAt(vPos, gameHours, terrain);
player.sendSystemMessage(Component.literal("§8=== §3§lAnémomètre Statique à Ultrasons (3D) §8==="));
player.sendSystemMessage(Component.literal(
String.format("§bVent Horizontal: §f%.2f m/s §7(§e%.1f km/h§7)", sample.windMps, sample.getWindSpeedKmh())
));
player.sendSystemMessage(Component.literal(
String.format("§aVitesse Verticale (W): §f%+.2f m/s §7(Thermiques: §6%+.2f§7, Pente: §e%+.2f§7, Rabattant: §c%+.2f§7)",
sample.verticalMps, sample.thermalMps, sample.ridgeLiftMps, sample.subsidenceMps)
));
player.sendSystemMessage(Component.literal(
String.format("§7Indice de Turbulence: §f%.0f%% §7| Direction vecteur: §8(X: %.1f, Z: %.1f)",
sample.turbulence * 100.0f, sample.windVector.x, sample.windVector.z)
));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+66
Voir le fichier
@@ -0,0 +1,66 @@
package com.gastinelweather.block;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.SynopticState;
import com.gastinelweather.weather.WeatherSample;
import com.gastinelweather.weather.WeatherSystem;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.joml.Vector3f;
public class Vp2ConsoleBlock extends HorizontalDirectionalBlock {
public static final MapCodec<Vp2ConsoleBlock> CODEC = simpleCodec(Vp2ConsoleBlock::new);
private static final VoxelShape SHAPE = Block.box(2.0, 0.0, 2.0, 14.0, 10.0, 14.0);
public Vp2ConsoleBlock(Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH));
}
@Override
protected MapCodec<? extends HorizontalDirectionalBlock> codec() {
return CODEC;
}
@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection().getOpposite());
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (level.isClientSide) {
com.gastinelweather.client.ClientHooks.openVp2ConsoleScreen(pos);
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+81
Voir le fichier
@@ -0,0 +1,81 @@
package com.gastinelweather.block;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.SynopticState;
import com.gastinelweather.weather.WeatherSample;
import com.gastinelweather.weather.WeatherSystem;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.joml.Vector3f;
public class Vp2StationBlock extends Block {
private static final VoxelShape SHAPE = Block.box(3.0, 0.0, 3.0, 13.0, 16.0, 13.0);
public Vp2StationBlock(Properties properties) {
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
float gameHours = level.getDayTime() / 1000.0f;
Vector3f vPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
HeightSampler terrain = new MinecraftHeightSampler(level);
SynopticState sky = system.synopticAt(gameHours);
WeatherSample sample = system.sampleAt(vPos, sky, terrain);
level.playSound(null, pos, SoundEvents.NOTE_BLOCK_CHIME.value(), SoundSource.BLOCKS, 0.8f, 1.2f);
player.sendSystemMessage(Component.literal("§8=== §6§lStation Météo Vantage Pro 2 (VP2) §8==="));
player.sendSystemMessage(Component.literal(
String.format("§eTempérature: §f%.1f°C §7(Ressenti: §b%.1f°C§7) | Humidité: §a%.0f%%",
sample.temperatureC, sample.windChillC, (1.0f - sky.cloudCover * 0.4f) * 65.0f)
));
player.sendSystemMessage(Component.literal(
String.format("§bVent Moyen: §f%.1f km/h §7(§e%.0f° %s§7) | Rafales: §c%.1f km/h",
sample.getWindSpeedKmh(), sky.windFromDegrees, getCompassName(sky.windFromDegrees), sample.getWindSpeedKmh() * 1.35f)
));
player.sendSystemMessage(Component.literal(
String.format("§3Précipitations: §f%.1f mm/h §7| Cumul pluie sol: §b%.1f mm",
sample.precipitationMmPerHour, sample.wetness * 12.0f)
));
player.sendSystemMessage(Component.literal(
String.format("§6Rayonnement Solaire: §f%.0f W/m² §7| Index UV: §e%.1f",
sky.daylight * 850.0f, sky.daylight * 9.5f)
));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
private static String getCompassName(float deg) {
if (deg >= 337.5 || deg < 22.5) return "N";
if (deg < 67.5) return "NE";
if (deg < 112.5) return "E";
if (deg < 157.5) return "SE";
if (deg < 202.5) return "S";
if (deg < 247.5) return "SO";
if (deg < 292.5) return "O";
return "NO";
}
}
+59
Voir le fichier
@@ -0,0 +1,59 @@
package com.gastinelweather.block;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.WeatherSample;
import com.gastinelweather.weather.WeatherSystem;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.joml.Vector3f;
public class WindTurbineBlock extends Block {
private static final VoxelShape SHAPE = Block.box(3.0, 0.0, 3.0, 13.0, 16.0, 13.0);
public WindTurbineBlock(Properties properties) {
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) {
return SHAPE;
}
@Override
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
if (!level.isClientSide) {
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
float gameHours = level.getDayTime() / 1000.0f;
Vector3f vPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
HeightSampler terrain = new MinecraftHeightSampler(level);
WeatherSample sample = system.sampleAt(vPos, gameHours, terrain);
// Puissance éolienne P proportionnelle à v^3 (loi de Betz simplifiée)
float v = sample.windMps;
int generatedFE = (int) Math.min(250.0f, 0.08f * v * v * v);
player.sendSystemMessage(Component.literal("§8=== §a§lGénérateur Éolien Aérodynamique §8==="));
player.sendSystemMessage(Component.literal(
String.format("§fVent local capté: §b%.1f m/s §7(§e%.1f km/h§7) | Altitude: §f%d m",
v, sample.getWindSpeedKmh(), pos.getY())
));
player.sendSystemMessage(Component.literal(
String.format("§2Production Énergie: §a§l+%d FE/t §7(Rendement: §f%.0f%%§7)",
generatedFE, Math.min(100.0f, (v / 25.0f) * 100.0f))
));
}
return InteractionResult.sidedSuccess(level.isClientSide);
}
}
+17
Voir le fichier
@@ -0,0 +1,17 @@
package com.gastinelweather.client;
import com.gastinelweather.client.gui.Vp2ConsoleScreen;
import com.gastinelweather.client.gui.WeatherMonitorScreen;
import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
public class ClientHooks {
public static void openVp2ConsoleScreen(BlockPos pos) {
Minecraft.getInstance().setScreen(new Vp2ConsoleScreen(pos));
}
public static void openMonitorScreen(BlockPos pos) {
Minecraft.getInstance().setScreen(new WeatherMonitorScreen(pos));
}
}
+179
Voir le fichier
@@ -0,0 +1,179 @@
package com.gastinelweather.client.gui;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.SynopticState;
import com.gastinelweather.weather.WeatherSample;
import com.gastinelweather.weather.WeatherSystem;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import org.joml.Vector3f;
import java.util.List;
public class Vp2ConsoleScreen extends Screen {
private final BlockPos pos;
private boolean show24hForecast = false;
private static final int GUI_WIDTH = 290;
private static final int GUI_HEIGHT = 210;
public Vp2ConsoleScreen(BlockPos pos) {
super(Component.literal("Console Vantage Pro 2"));
this.pos = pos;
}
@Override
protected void init() {
super.init();
int leftPos = (this.width - GUI_WIDTH) / 2;
int topPos = (this.height - GUI_HEIGHT) / 2;
this.addRenderableWidget(Button.builder(Component.literal("Actualiser"), b -> {})
.bounds(leftPos + 15, topPos + 180, 75, 20)
.build());
this.addRenderableWidget(Button.builder(Component.literal(show24hForecast ? "En Direct" : "Prévisions 24h"), b -> {
this.show24hForecast = !this.show24hForecast;
b.setMessage(Component.literal(show24hForecast ? "En Direct" : "Prévisions 24h"));
})
.bounds(leftPos + 95, topPos + 180, 95, 20)
.build());
this.addRenderableWidget(Button.builder(Component.literal("Fermer"), b -> this.onClose())
.bounds(leftPos + 195, topPos + 180, 80, 20)
.build());
}
@Override
public boolean isPauseScreen() {
return false;
}
@Override
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) {
super.render(guiGraphics, mouseX, mouseY, partialTick);
Minecraft mc = Minecraft.getInstance();
if (mc.level == null) return;
int leftPos = (this.width - GUI_WIDTH) / 2;
int topPos = (this.height - GUI_HEIGHT) / 2;
// 1. Fond Boîtier Console (Gris Ardoise Foncé avec double bordure)
guiGraphics.fill(leftPos, topPos, leftPos + GUI_WIDTH, topPos + GUI_HEIGHT, 0xFF1B232A);
guiGraphics.renderOutline(leftPos, topPos, GUI_WIDTH, GUI_HEIGHT, 0xFF34495E);
guiGraphics.renderOutline(leftPos + 2, topPos + 2, GUI_WIDTH - 4, GUI_HEIGHT - 4, 0xFF0D1217);
// 2. Écran LCD Rétroéclairé (Vert Matrix / LCD rétroéclairé)
int lcdX = leftPos + 10;
int lcdY = topPos + 10;
int lcdW = GUI_WIDTH - 20;
int lcdH = 162;
guiGraphics.fill(lcdX, lcdY, lcdX + lcdW, lcdY + lcdH, 0xFF0A2417);
guiGraphics.renderOutline(lcdX, lcdY, lcdW, lcdH, 0xFF1E824C);
// 3. Récupération des données météo en direct
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
float gameHours = mc.level.getDayTime() / 1000.0f;
Vector3f vPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
HeightSampler terrain = new MinecraftHeightSampler(mc.level);
SynopticState sky = system.synopticAt(gameHours);
WeatherSample sample = system.sampleAt(vPos, sky, terrain);
// 4. Titre et Statut Radio
guiGraphics.drawString(this.font, "DAVIS VANTAGE PRO 2 — CONSOLE", lcdX + 8, lcdY + 6, 0xFF2ECC71, false);
guiGraphics.drawString(this.font, "● DIRECT (868MHz)", lcdX + lcdW - 105, lcdY + 6, 0xFF00FF7F, false);
guiGraphics.hLine(lcdX + 4, lcdX + lcdW - 5, lcdY + 16, 0xFF1E824C);
if (!show24hForecast) {
// --- VUE 1 : TABLEAU DE BORD EN DIRECT ---
// CADRAN 1 : TEMPÉRATURE & RESSENTI
int box1X = lcdX + 8;
int box1Y = lcdY + 22;
guiGraphics.fill(box1X, box1Y, box1X + 124, box1Y + 60, 0xFF0F3823);
guiGraphics.renderOutline(box1X, box1Y, 124, 60, 0xFF27AE60);
guiGraphics.drawString(this.font, "TEMPÉRATURE EXT.", box1X + 4, box1Y + 4, 0xFF82E0AA, false);
guiGraphics.drawString(this.font, String.format("§a§l%.1f°C", sample.temperatureC), box1X + 6, box1Y + 16, 0xFF2ECC71, false);
guiGraphics.drawString(this.font, String.format("§7Ressenti: §e%.1f°C", sample.windChillC), box1X + 4, box1Y + 34, 0xFFF1C40F, false);
guiGraphics.drawString(this.font, String.format("§7INT: §f21.5°C §7(48%%)", sample.temperatureC), box1X + 4, box1Y + 46, 0xFFBDC3C7, false);
// CADRAN 2 : VENT & RAFALES
int box2X = lcdX + 138;
int box2Y = lcdY + 22;
guiGraphics.fill(box2X, box2Y, box2X + 124, box2Y + 60, 0xFF0F3823);
guiGraphics.renderOutline(box2X, box2Y, 124, 60, 0xFF27AE60);
guiGraphics.drawString(this.font, "VENT & DIRECTION", box2X + 4, box2Y + 4, 0xFF82E0AA, false);
guiGraphics.drawString(this.font, String.format("§b§l%.1f km/h", sample.getWindSpeedKmh()), box2X + 6, box2Y + 16, 0xFF3498DB, false);
guiGraphics.drawString(this.font, String.format("§7Dir: §e%.0f° (%s)", sky.windFromDegrees, getCompassName(sky.windFromDegrees)), box2X + 4, box2Y + 34, 0xFFF1C40F, false);
guiGraphics.drawString(this.font, String.format("§7Rafales: §c%.1f km/h", sample.getWindSpeedKmh() * 1.35f), box2X + 4, box2Y + 46, 0xFFE74C3C, false);
// CADRAN 3 : BAROMÈTRE & TENDANCE
int box3X = lcdX + 8;
int box3Y = lcdY + 86;
guiGraphics.fill(box3X, box3Y, box3X + 124, box3Y + 45, 0xFF0F3823);
guiGraphics.renderOutline(box3X, box3Y, 124, 45, 0xFF27AE60);
guiGraphics.drawString(this.font, "BAROMÈTRE", box3X + 4, box3Y + 4, 0xFF82E0AA, false);
guiGraphics.drawString(this.font, String.format("§f1013.2 hPa %s", sky.cloudCover > 0.6f ? "§c↘ Baisse" : "§a↗ Hausse"), box3X + 4, box3Y + 16, 0xFFFFFFFF, false);
guiGraphics.drawString(this.font, String.format("§7Nuages: §f%.0f%% §7| Sol: §a%.0f%%", sky.cloudCover * 100.0f, sample.wetness * 100.0f), box3X + 4, box3Y + 28, 0xFFBDC3C7, false);
// CADRAN 4 : PLUIE & SOLAIRE
int box4X = lcdX + 138;
int box4Y = lcdY + 86;
guiGraphics.fill(box4X, box4Y, box4X + 124, box4Y + 45, 0xFF0F3823);
guiGraphics.renderOutline(box4X, box4Y, 124, 45, 0xFF27AE60);
guiGraphics.drawString(this.font, "PLUIE & RAYONNEMENT", box4X + 4, box4Y + 4, 0xFF82E0AA, false);
guiGraphics.drawString(this.font, String.format("§3Intensité: §b%.1f mm/h", sample.precipitationMmPerHour), box4X + 4, box4Y + 16, 0xFF00CED1, false);
guiGraphics.drawString(this.font, String.format("§6Solaire: §f%.0f W/m² §7(UV: §e%.1f§7)", sky.daylight * 850.0f, sky.daylight * 9.5f), box4X + 4, box4Y + 28, 0xFFF39C12, false);
// BANDEAU INFÉRIEUR : PRÉVISION IMMÉDIATE
int stripY = lcdY + 137;
guiGraphics.fill(lcdX + 8, stripY, lcdX + lcdW - 8, stripY + 20, 0xFF0A1F13);
guiGraphics.renderOutline(lcdX + 8, stripY, lcdW - 16, 20, 0xFF1E824C);
String forecastText = (sky.cloudCover > 0.72f) ? "§9Tendance: Pluie soutenue et couverture nuageuse dense." :
(sky.cloudCover > 0.35f) ? "§eTendance: Temps variable avec passages nuageux." : "§aTendance: Conditions anticycloniques stables et ciel clair.";
guiGraphics.drawString(this.font, forecastText, lcdX + 14, stripY + 6, 0xFF82E0AA, false);
} else {
// --- VUE 2 : PRÉVISIONS DÉTERMINISTES HEURE PAR HEURE (24H) ---
List<WeatherSystem.HourlyForecast> forecasts = system.predictHourlyForecast(gameHours, 24, vPos, terrain);
guiGraphics.drawString(this.font, "PRÉVISIONS DÉTERMINISTES SUR 24 HEURES", lcdX + 8, lcdY + 22, 0xFFF1C40F, false);
int startY = lcdY + 36;
int count = 0;
for (int i = 2; i <= 24; i += 3) {
if (i < forecasts.size() && count < 7) {
WeatherSystem.HourlyForecast f = forecasts.get(i);
int rowY = startY + count * 16;
guiGraphics.fill(lcdX + 6, rowY, lcdX + lcdW - 6, rowY + 14, (count % 2 == 0) ? 0xFF0D2D1C : 0xFF082014);
String icon = f.willSnow() ? "§b[NEIGE]" : (f.willRain() ? "§9[PLUIE]" : (f.cloudPercent() > 50 ? "§7[NUAGE]" : "§e[SOLEIL]"));
String rowText = String.format("§f+%02dh §7(%02dh00) : %s §e%.1f°C §7| Vent §b%02.0f km/h §7| Nuages §f%02.0f%%",
(int)(f.gameHours() - gameHours), (int)f.timeOfDayHours(), icon, f.temperatureC(), f.windKmh(), f.cloudPercent());
guiGraphics.drawString(this.font, rowText, lcdX + 10, rowY + 3, 0xFF82E0AA, false);
count++;
}
}
}
}
private static String getCompassName(float deg) {
if (deg >= 337.5 || deg < 22.5) return "N";
if (deg < 67.5) return "NE";
if (deg < 112.5) return "E";
if (deg < 157.5) return "SE";
if (deg < 202.5) return "S";
if (deg < 247.5) return "SO";
if (deg < 292.5) return "O";
return "NO";
}
}
+148
Voir le fichier
@@ -0,0 +1,148 @@
package com.gastinelweather.client.gui;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.SynopticState;
import com.gastinelweather.weather.WeatherSample;
import com.gastinelweather.weather.WeatherSystem;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import org.joml.Vector3f;
import java.util.List;
public class WeatherMonitorScreen extends Screen {
private final BlockPos pos;
private int activeTab = 0; // 0 = Relevés & Relief, 1 = Bulletin 7 Jours
private static final int GUI_WIDTH = 320;
private static final int GUI_HEIGHT = 220;
public WeatherMonitorScreen(BlockPos pos) {
super(Component.literal("Moniteur Météo"));
this.pos = pos;
}
@Override
protected void init() {
super.init();
int leftPos = (this.width - GUI_WIDTH) / 2;
int topPos = (this.height - GUI_HEIGHT) / 2;
this.addRenderableWidget(Button.builder(Component.literal("Télémétrie & Microclimat"), b -> this.activeTab = 0)
.bounds(leftPos + 10, topPos + 190, 130, 20)
.build());
this.addRenderableWidget(Button.builder(Component.literal("Bulletin 7 Jours"), b -> this.activeTab = 1)
.bounds(leftPos + 145, topPos + 190, 100, 20)
.build());
this.addRenderableWidget(Button.builder(Component.literal("Quitter"), b -> this.onClose())
.bounds(leftPos + 250, topPos + 190, 60, 20)
.build());
}
@Override
public boolean isPauseScreen() {
return false;
}
@Override
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) {
super.render(guiGraphics, mouseX, mouseY, partialTick);
Minecraft mc = Minecraft.getInstance();
if (mc.level == null) return;
int leftPos = (this.width - GUI_WIDTH) / 2;
int topPos = (this.height - GUI_HEIGHT) / 2;
// 1. Châssis Moniteur Haute Technologie (Bleu Nuit Foncé / Cyan)
guiGraphics.fill(leftPos, topPos, leftPos + GUI_WIDTH, topPos + GUI_HEIGHT, 0xFF0D1B2A);
guiGraphics.renderOutline(leftPos, topPos, GUI_WIDTH, GUI_HEIGHT, 0xFF1B4965);
guiGraphics.renderOutline(leftPos + 2, topPos + 2, GUI_WIDTH - 4, GUI_HEIGHT - 4, 0xFF62B6CB);
// 2. Zone d'affichage logiciel
int screenX = leftPos + 8;
int screenY = topPos + 8;
int screenW = GUI_WIDTH - 16;
int screenH = 175;
guiGraphics.fill(screenX, screenY, screenX + screenW, screenY + screenH, 0xFF08121E);
guiGraphics.renderOutline(screenX, screenY, screenW, screenH, 0xFF1F4E79);
// 3. Barre de titre logiciel
guiGraphics.fill(screenX, screenY, screenX + screenW, screenY + 16, 0xFF1B4965);
guiGraphics.drawString(this.font, "GASTINEL METEO SOFTWARE v2.4 — STATION CENTRALE", screenX + 6, screenY + 4, 0xFFE0FAFF, false);
guiGraphics.drawString(this.font, "STATION CONNECTÉE [OK]", screenX + screenW - 130, screenY + 4, 0xFF2ECC71, false);
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
float gameHours = mc.level.getDayTime() / 1000.0f;
Vector3f vPos = new Vector3f(pos.getX(), pos.getY(), pos.getZ());
HeightSampler terrain = new MinecraftHeightSampler(mc.level);
SynopticState sky = system.synopticAt(gameHours);
WeatherSample sample = system.sampleAt(vPos, sky, terrain);
if (activeTab == 0) {
// --- ONGLET 0 : TÉLÉMÉTRIE MICROCLIMATIQUE ET TOPOGRAPHIQUE ---
// Bloc Gauche : Données thermiques & Relief
int col1X = screenX + 8;
int col1Y = screenY + 24;
guiGraphics.fill(col1X, col1Y, col1X + 140, col1Y + 70, 0xFF0F2537);
guiGraphics.renderOutline(col1X, col1Y, 140, 70, 0xFF2A6F97);
guiGraphics.drawString(this.font, "THERMODYNAMIQUE", col1X + 4, col1Y + 4, 0xFF62B6CB, false);
guiGraphics.drawString(this.font, String.format("Temp. Ambiante: §e%.1f°C", sample.temperatureC), col1X + 6, col1Y + 16, 0xFFFFFFFF, false);
guiGraphics.drawString(this.font, String.format("Ressenti au Vent: §b%.1f°C", sample.windChillC), col1X + 6, col1Y + 28, 0xFFFFFFFF, false);
guiGraphics.drawString(this.font, String.format("Gradient Alt (Y=%d): §c%.1f°C", pos.getY(), sample.lapseC), col1X + 6, col1Y + 40, 0xFFFFFFFF, false);
guiGraphics.drawString(this.font, String.format("Gain Ensoleillement: §6%+.1f°C", sample.aspectC), col1X + 6, col1Y + 52, 0xFFFFFFFF, false);
// Bloc Droite : Aérodynamique & Énergie
int col2X = screenX + 154;
int col2Y = screenY + 24;
guiGraphics.fill(col2X, col2Y, col2X + 140, col2Y + 70, 0xFF0F2537);
guiGraphics.renderOutline(col2X, col2Y, 140, 70, 0xFF2A6F97);
guiGraphics.drawString(this.font, "DYNAMIQUE DU VENT", col2X + 4, col2Y + 4, 0xFF62B6CB, false);
guiGraphics.drawString(this.font, String.format("Vitesse Horizontale: §b%.1f km/h", sample.getWindSpeedKmh()), col2X + 6, col2Y + 16, 0xFFFFFFFF, false);
guiGraphics.drawString(this.font, String.format("Courant Ascendant: §a%+.2f m/s", sample.verticalMps), col2X + 6, col2Y + 28, 0xFFFFFFFF, false);
guiGraphics.drawString(this.font, String.format("Thermiques Pures: §6%+.2f m/s", sample.thermalMps), col2X + 6, col2Y + 40, 0xFFFFFFFF, false);
guiGraphics.drawString(this.font, String.format("Turbulences / Sillage: §c%.0f%%", sample.turbulence * 100.0f), col2X + 6, col2Y + 52, 0xFFFFFFFF, false);
// Grand Bloc Inférieur : Écoulement et Précipitations
int botY = screenY + 100;
guiGraphics.fill(screenX + 8, botY, screenX + screenW - 8, botY + 68, 0xFF0F2537);
guiGraphics.renderOutline(screenX + 8, botY, screenW - 16, 68, 0xFF2A6F97);
guiGraphics.drawString(this.font, "PRÉCIPITATIONS ET ÉTAT DU SOL", screenX + 14, botY + 4, 0xFF62B6CB, false);
String statusPluie = sample.snowing ? "§bChute de neige en cours" : (sample.precipitationMmPerHour > 0.05f ? "§9Pluie active" : "§aAucune précipitation");
guiGraphics.drawString(this.font, String.format("Régime: %s §7(Taux: §f%.2f mm/h§7)", statusPluie, sample.precipitationMmPerHour), screenX + 14, botY + 18, 0xFFFFFFFF, false);
guiGraphics.drawString(this.font, String.format("Saturation du Sol (Mouillure): §a%.0f%% §7| Nébulosité: §f%.0f%%", sample.wetness * 100.0f, sky.cloudCover * 100.0f), screenX + 14, botY + 32, 0xFFFFFFFF, false);
guiGraphics.drawString(this.font, String.format("Position Solaire: Azimut §e%.0f° §7| Élévation §e%.1f° §7| Flux: §6%.0f W/m²", sky.sunAzimuthDegrees, sky.sunElevationDegrees, sky.daylight * 850.0f), screenX + 14, botY + 46, 0xFFFFFFFF, false);
} else {
// --- ONGLET 1 : BULLETIN PRÉVISIONNEL 7 JOURS ---
List<WeatherSystem.DailyForecast> daily = system.predictDailyForecast(gameHours, 7, vPos, terrain);
guiGraphics.drawString(this.font, "PRÉVISIONS MÉTÉOROLOGIQUES SUR 7 JOURS (CALCUL PUR DÉTERMINISTE)", screenX + 8, screenY + 22, 0xFF62B6CB, false);
int startY = screenY + 36;
for (int i = 0; i < daily.size(); i++) {
WeatherSystem.DailyForecast d = daily.get(i);
int rowY = startY + i * 19;
guiGraphics.fill(screenX + 8, rowY, screenX + screenW - 8, rowY + 17, (i % 2 == 0) ? 0xFF0D2539 : 0xFF091C2C);
guiGraphics.renderOutline(screenX + 8, rowY, screenW - 16, 17, 0xFF1F4E79);
String icon = d.hasSnow() ? "§b❄ Neige" : (d.hasRain() ? "§9🌧 Pluie (" + String.format("%.1f", d.totalRainMm()) + "mm)" : (d.maxCloudPercent() > 50 ? "§7☁ Nuageux" : "§e☀ Ensoleillé"));
String line = String.format("§6Jour %d §7: %-16s §7| T°: §b%.1f°C §7à §e%.1f°C §7| Rafales: §f%.0f km/h",
d.dayNumber(), icon, d.minTempC(), d.maxTempC(), d.maxWindKmh());
guiGraphics.drawString(this.font, line, screenX + 12, rowY + 4, 0xFFE0FAFF, false);
}
}
}
}
+180
Voir le fichier
@@ -0,0 +1,180 @@
package com.gastinelweather.command;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.SynopticState;
import com.gastinelweather.weather.WeatherSample;
import com.gastinelweather.weather.WeatherSystem;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.phys.Vec3;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.neoforge.event.RegisterCommandsEvent;
import org.joml.Vector3f;
import java.util.List;
public class GastinelWeatherCommand {
@SubscribeEvent
public static void onRegisterCommands(RegisterCommandsEvent event) {
CommandDispatcher<CommandSourceStack> dispatcher = event.getDispatcher();
dispatcher.register(
Commands.literal("gweather")
.requires(source -> source.hasPermission(0))
.executes(GastinelWeatherCommand::showCurrentWeather)
.then(Commands.literal("now")
.executes(GastinelWeatherCommand::showCurrentWeather))
.then(Commands.literal("current")
.executes(GastinelWeatherCommand::showCurrentWeather))
.then(Commands.literal("forecast")
.executes(ctx -> showForecast(ctx, 12))
.then(Commands.argument("heures", IntegerArgumentType.integer(1, 72))
.executes(ctx -> showForecast(ctx, IntegerArgumentType.getInteger(ctx, "heures")))))
.then(Commands.literal("daily")
.executes(ctx -> showDailyForecast(ctx, 7))
.then(Commands.argument("jours", IntegerArgumentType.integer(1, 14))
.executes(ctx -> showDailyForecast(ctx, IntegerArgumentType.getInteger(ctx, "jours")))))
);
// Alias /gastinelweather
dispatcher.register(
Commands.literal("gastinelweather")
.requires(source -> source.hasPermission(0))
.executes(GastinelWeatherCommand::showCurrentWeather)
.then(Commands.literal("forecast")
.executes(ctx -> showForecast(ctx, 12))
.then(Commands.argument("heures", IntegerArgumentType.integer(1, 72))
.executes(ctx -> showForecast(ctx, IntegerArgumentType.getInteger(ctx, "heures")))))
.then(Commands.literal("daily")
.executes(ctx -> showDailyForecast(ctx, 7))
.then(Commands.argument("jours", IntegerArgumentType.integer(1, 14))
.executes(ctx -> showDailyForecast(ctx, IntegerArgumentType.getInteger(ctx, "jours")))))
);
}
private static float getCurrentGameHours(CommandSourceStack source) {
long dayTime = source.getLevel().getDayTime();
// 24000 ticks = 24 heures de jeu -> 1000 ticks = 1 heure de jeu
return dayTime / 1000.0f;
}
private static int showCurrentWeather(CommandContext<CommandSourceStack> context) {
CommandSourceStack source = context.getSource();
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
Vec3 playerPos = source.getPosition();
Vector3f pos = new Vector3f((float) playerPos.x, (float) playerPos.y, (float) playerPos.z);
HeightSampler terrain = new MinecraftHeightSampler(source.getLevel());
float gameHours = getCurrentGameHours(source);
SynopticState sky = system.synopticAt(gameHours);
WeatherSample sample = system.sampleAt(pos, sky, terrain);
source.sendSuccess(() -> Component.literal("§8=== §6§lMétéo Gastinel §7(Temps Réel & Microclimat) §8==="), false);
source.sendSuccess(() -> Component.literal(
"§7Température : §e" + String.format("%.1f°C", sample.temperatureC) +
" §7(Ressenti au vent : §b" + String.format("%.1f°C", sample.windChillC) + "§7)"
), false);
source.sendSuccess(() -> Component.literal(
"§7Effets de relief : Gradient alt. §c" + String.format("%.1f°C", sample.lapseC) +
"§7, Ensoleillement versant §6" + String.format("%+.1f°C", sample.aspectC)
), false);
source.sendSuccess(() -> Component.literal(
"§7Vent : §b" + String.format("%.1f km/h", sample.getWindSpeedKmh()) +
" §7(§f" + String.format("%.1f m/s", sample.windMps) + "§7) de §e" + String.format("%.0f°", sky.windFromDegrees)
), false);
source.sendSuccess(() -> Component.literal(
"§7Courants d'air : Thermiques §a" + String.format("%+.2f m/s", sample.thermalMps) +
"§7, Pente §e" + String.format("%+.2f m/s", sample.ridgeLiftMps) +
"§7, Total vertical §b" + String.format("%+.2f m/s", sample.verticalMps)
), false);
final String finalCond = getConditionDescription(sample);
source.sendSuccess(() -> Component.literal("§7Conditions : " + finalCond + " §7| Humidité sol : §f" + String.format("%.0f%%", sample.wetness * 100.0f)), false);
source.sendSuccess(() -> Component.literal("§8------------------------------------------------"), false);
source.sendSuccess(() -> Component.literal("§e/gweather forecast [heures] §7: Prévisions horaires"), false);
source.sendSuccess(() -> Component.literal("§e/gweather daily [jours] §7: Bulletin prévisionnel sur 7 jours"), false);
return 1;
}
private static String getConditionDescription(WeatherSample sample) {
if (sample.snowing) return "§bNeige soutenue (" + String.format("%.1f", sample.precipitationMmPerHour) + " mm/h)";
if (sample.precipitationMmPerHour > 2.0f) return "§9Forte pluie (" + String.format("%.1f", sample.precipitationMmPerHour) + " mm/h)";
if (sample.precipitationMmPerHour > 0.05f) return "§3Pluie fine (" + String.format("%.1f", sample.precipitationMmPerHour) + " mm/h)";
if (sample.cloudCover > 0.7f) return "§7Ciel très couvert (" + String.format("%.0f%%", sample.cloudCover * 100.0f) + ")";
if (sample.cloudCover > 0.3f) return "§eÉclaircies (" + String.format("%.0f%%", sample.cloudCover * 100.0f) + ")";
return "§aBeau temps dégagé";
}
private static int showForecast(CommandContext<CommandSourceStack> context, int hoursAhead) {
CommandSourceStack source = context.getSource();
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
Vec3 playerPos = source.getPosition();
Vector3f pos = new Vector3f((float) playerPos.x, (float) playerPos.y, (float) playerPos.z);
HeightSampler terrain = new MinecraftHeightSampler(source.getLevel());
float currentHours = getCurrentGameHours(source);
List<WeatherSystem.HourlyForecast> forecasts = system.predictHourlyForecast(currentHours, hoursAhead, pos, terrain);
source.sendSuccess(() -> Component.literal("§8=== §6§lPrévisions Météo Déterministes (§e+" + hoursAhead + "h§6§l) §8==="), false);
for (int i = 1; i < forecasts.size(); i += Math.max(1, hoursAhead / 8)) {
WeatherSystem.HourlyForecast f = forecasts.get(i);
int hourInt = (int) f.timeOfDayHours();
String icon = "☀️";
String color = "§e";
if (f.willSnow()) { icon = "❄️"; color = "§b"; }
else if (f.willRain()) { icon = "🌧️"; color = "§9"; }
else if (f.cloudPercent() > 60.0f) { icon = "☁️"; color = "§7"; }
String line = String.format(
"§8[§f+%02dh§8] §e%02dh00 §7: %s %s%.1f°C §7| Vent §b%.0f km/h §7| Nuages §f%.0f%% %s",
(int)(f.gameHours() - currentHours), hourInt, icon, color, f.temperatureC(), f.windKmh(), f.cloudPercent(),
(f.precipitationMm() > 0.05f ? "§9(" + String.format("%.1fmm", f.precipitationMm()) + ")" : "")
);
source.sendSuccess(() -> Component.literal(line), false);
}
return 1;
}
private static int showDailyForecast(CommandContext<CommandSourceStack> context, int daysAhead) {
CommandSourceStack source = context.getSource();
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
Vec3 playerPos = source.getPosition();
Vector3f pos = new Vector3f((float) playerPos.x, (float) playerPos.y, (float) playerPos.z);
HeightSampler terrain = new MinecraftHeightSampler(source.getLevel());
float currentHours = getCurrentGameHours(source);
List<WeatherSystem.DailyForecast> daily = system.predictDailyForecast(currentHours, daysAhead, pos, terrain);
source.sendSuccess(() -> Component.literal("§8=== §6§lBulletin Météo des " + daysAhead + " Prochains Jours §8==="), false);
for (WeatherSystem.DailyForecast d : daily) {
String icon = "☀️ Ensoleillé";
if (d.hasSnow()) icon = "❄️ Neige";
else if (d.hasRain()) icon = "🌧️ Pluie (" + String.format("%.1f", d.totalRainMm()) + "mm)";
else if (d.maxCloudPercent() > 60.0f) icon = "☁️ Nuageux";
String line = String.format(
"§6Jour %d §7: %s §7| Min: §b%.1f°C §7- Max: §e%.1f°C §7| Rafales: §f%.0f km/h",
d.dayNumber(), icon, d.minTempC(), d.maxTempC(), d.maxWindKmh()
);
source.sendSuccess(() -> Component.literal(line), false);
}
return 1;
}
}
+49
Voir le fichier
@@ -0,0 +1,49 @@
package com.gastinelweather.integration;
import com.gastinelweather.weather.HeightSampler;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.levelgen.Heightmap;
/**
* Adaptateur HeightSampler pour le monde Minecraft en cours d'exécution.
*/
public class MinecraftHeightSampler implements HeightSampler {
private final Level level;
public MinecraftHeightSampler(Level level) {
this.level = level;
}
// Pluie et orage du monde (globaux, comme rainStrength/thunderStrength côté shader).
@Override
public float rainLevel() {
return level == null ? 0.0f : level.getRainLevel(1.0f);
}
@Override
public float thunderLevel() {
return level == null ? 0.0f : level.getThunderLevel(1.0f);
}
@Override
public float heightAt(float worldX, float worldZ) {
if (level == null) {
return 64.0f;
}
int x = (int) Math.floor(worldX);
int z = (int) Math.floor(worldZ);
if (!level.hasChunkAt(new BlockPos(x, 64, z))) {
return level.getSeaLevel();
}
try {
return (float) level.getHeight(Heightmap.Types.MOTION_BLOCKING, x, z);
} catch (Exception e) {
return level.getSeaLevel();
}
}
}
+67
Voir le fichier
@@ -0,0 +1,67 @@
package com.gastinelweather.item;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.integration.MinecraftHeightSampler;
import com.gastinelweather.weather.HeightSampler;
import com.gastinelweather.weather.SynopticState;
import com.gastinelweather.weather.WeatherSample;
import com.gastinelweather.weather.WeatherSystem;
import net.minecraft.network.chat.Component;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
import org.joml.Vector3f;
import java.util.List;
public class ElitechItem extends Item {
public ElitechItem(Properties properties) {
super(properties);
}
@Override
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) {
ItemStack stack = player.getItemInHand(hand);
if (!level.isClientSide) {
WeatherSystem system = GastinelWeatherMod.getWeatherSystem();
float gameHours = level.getDayTime() / 1000.0f;
Vector3f pos = new Vector3f((float) player.getX(), (float) player.getY(), (float) player.getZ());
HeightSampler terrain = new MinecraftHeightSampler(level);
SynopticState sky = system.synopticAt(gameHours);
WeatherSample sample = system.sampleAt(pos, sky, terrain);
level.playSound(null, player.getX(), player.getY(), player.getZ(),
SoundEvents.EXPERIENCE_ORB_PICKUP, SoundSource.PLAYERS, 0.6f, 1.8f);
// Message Actionbar (rapide)
player.displayClientMessage(Component.literal(
String.format("§6[Elitech] §e%.1f°C §7(Ressenti §b%.1f°C§7) | Vent §f%.0f km/h §7| Sol §a%.0f%%",
sample.temperatureC, sample.windChillC, sample.getWindSpeedKmh(), sample.wetness * 100.0f)
), true);
// Message Chat détaillé
player.sendSystemMessage(Component.literal(
String.format("§8[§6Elitech Data Logger§8] §e%.1f°C §7(Ressenti: §b%.1f°C§7) | Alt: §f%d m §7| Versant: §6%+.1f°C §7| Précip: §b%.1f mm/h",
sample.temperatureC, sample.windChillC, (int)player.getY(), sample.aspectC, sample.precipitationMmPerHour)
));
}
return InteractionResultHolder.sidedSuccess(stack, level.isClientSide);
}
@Override
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
tooltipComponents.add(Component.literal("§7Enregistreur de données thermo-hygromètre portable."));
tooltipComponents.add(Component.literal("§eClic Droit §7: Relever la température, le vent et l'humidité locale."));
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
}
}
+81
Voir le fichier
@@ -0,0 +1,81 @@
package com.gastinelweather.registry;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.block.*;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.neoforged.neoforge.registries.DeferredBlock;
import net.neoforged.neoforge.registries.DeferredRegister;
public class ModBlocks {
public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(GastinelWeatherMod.MOD_ID);
// --- Pôle Météo ---
public static final DeferredBlock<Block> VP2_STATION = BLOCKS.register("vp2_station",
() -> new Vp2StationBlock(BlockBehaviour.Properties.of().strength(1.5f).sound(SoundType.METAL).noOcclusion()));
public static final DeferredBlock<Block> ANEMOMETER = BLOCKS.register("anemometer",
() -> new AnemometerBlock(BlockBehaviour.Properties.of().strength(1.2f).sound(SoundType.METAL).noOcclusion()));
public static final DeferredBlock<Block> ULTRASONIC_ANEMOMETER = BLOCKS.register("ultrasonic_anemometer",
() -> new UltrasonicAnemometerBlock(BlockBehaviour.Properties.of().strength(1.5f).sound(SoundType.METAL).noOcclusion()));
public static final DeferredBlock<Block> RAIN_GAUGE = BLOCKS.register("rain_gauge",
() -> new RainGaugeBlock(BlockBehaviour.Properties.of().strength(1.0f).sound(SoundType.GLASS).noOcclusion()));
public static final DeferredBlock<Block> SNOW_GAUGE = BLOCKS.register("snow_gauge",
() -> new SnowGaugeBlock(BlockBehaviour.Properties.of().strength(1.0f).sound(SoundType.METAL).noOcclusion()));
// --- Pôle Radio ---
public static final DeferredBlock<Block> ESP32_BOARD = BLOCKS.register("esp32_board",
() -> new Esp32Block(BlockBehaviour.Properties.of().strength(0.8f).sound(SoundType.METAL).noOcclusion()));
public static final DeferredBlock<Block> DIRECTIONAL_ANTENNA = BLOCKS.register("directional_antenna",
() -> new DirectionalAntennaBlock(BlockBehaviour.Properties.of().strength(1.5f).sound(SoundType.METAL).noOcclusion()));
public static final DeferredBlock<Block> OMNI_ANTENNA = BLOCKS.register("omni_antenna",
() -> new OmniAntennaBlock(BlockBehaviour.Properties.of().strength(1.2f).sound(SoundType.METAL).noOcclusion()));
public static final DeferredBlock<Block> VP2_CONSOLE = BLOCKS.register("vp2_console",
() -> new Vp2ConsoleBlock(BlockBehaviour.Properties.of().strength(1.0f).sound(SoundType.METAL).noOcclusion()));
// --- Pôle Informatique & Réseau ---
public static final DeferredBlock<Block> PC_CASE = BLOCKS.register("pc_case",
() -> new PcCaseBlock(BlockBehaviour.Properties.of().strength(2.0f).sound(SoundType.METAL).noOcclusion()));
public static final DeferredBlock<Block> MONITOR = BLOCKS.register("monitor",
() -> new MonitorBlock(BlockBehaviour.Properties.of().strength(1.0f).sound(SoundType.GLASS).noOcclusion()));
public static final DeferredBlock<Block> NETWORK_ROUTER = BLOCKS.register("network_router",
() -> new NetworkRouterBlock(BlockBehaviour.Properties.of().strength(1.0f).sound(SoundType.METAL).noOcclusion()));
public static final DeferredBlock<Block> NETWORK_CABLE = BLOCKS.register("network_cable",
() -> new CableBlock(BlockBehaviour.Properties.of().strength(0.3f).sound(SoundType.WOOL).noOcclusion(), CableBlock.CableType.NETWORK_INDOOR));
public static final DeferredBlock<Block> OUTDOOR_NETWORK_CABLE = BLOCKS.register("outdoor_network_cable",
() -> new CableBlock(BlockBehaviour.Properties.of().strength(0.5f).sound(SoundType.STONE).noOcclusion(), CableBlock.CableType.NETWORK_OUTDOOR));
public static final DeferredBlock<Block> UNDERGROUND_NETWORK_CABLE = BLOCKS.register("underground_network_cable",
() -> new CableBlock(BlockBehaviour.Properties.of().strength(1.0f).sound(SoundType.STONE).noOcclusion(), CableBlock.CableType.NETWORK_UNDERGROUND));
// --- Pôle Énergie ---
public static final DeferredBlock<Block> WIND_TURBINE = BLOCKS.register("wind_turbine",
() -> new WindTurbineBlock(BlockBehaviour.Properties.of().strength(3.0f).sound(SoundType.METAL).noOcclusion()));
public static final DeferredBlock<Block> HYDRO_TURBINE = BLOCKS.register("hydro_turbine",
() -> new HydroTurbineBlock(BlockBehaviour.Properties.of().strength(2.5f).sound(SoundType.METAL).noOcclusion()));
public static final DeferredBlock<Block> COAL_GENERATOR = BLOCKS.register("coal_generator",
() -> new CoalGeneratorBlock(BlockBehaviour.Properties.of().strength(3.5f).sound(SoundType.METAL)));
public static final DeferredBlock<Block> EXHAUST_CHIMNEY = BLOCKS.register("exhaust_chimney",
() -> new ExhaustChimneyBlock(BlockBehaviour.Properties.of().strength(2.0f).sound(SoundType.STONE)));
public static final DeferredBlock<Block> ELECTRIC_CABLE = BLOCKS.register("electric_cable",
() -> new CableBlock(BlockBehaviour.Properties.of().strength(0.4f).sound(SoundType.WOOL).noOcclusion(), CableBlock.CableType.ELECTRIC_INDOOR));
public static final DeferredBlock<Block> UNDERGROUND_ELECTRIC_CABLE = BLOCKS.register("underground_electric_cable",
() -> new CableBlock(BlockBehaviour.Properties.of().strength(1.2f).sound(SoundType.STONE).noOcclusion(), CableBlock.CableType.ELECTRIC_UNDERGROUND));
}
+59
Voir le fichier
@@ -0,0 +1,59 @@
package com.gastinelweather.registry;
import com.gastinelweather.GastinelWeatherMod;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;
public class ModCreativeTabs {
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS =
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, GastinelWeatherMod.MOD_ID);
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> WEATHER_TECH_TAB = CREATIVE_MODE_TABS.register("weather_tech_tab",
() -> CreativeModeTab.builder()
.title(Component.literal("§6Gastinel Weather & Tech"))
.icon(() -> new ItemStack(ModBlocks.VP2_STATION.get()))
.displayItems((parameters, output) -> {
// Instruments Météo
output.accept(ModItems.ELITECH_LOGGER.get());
output.accept(ModBlocks.VP2_STATION.get());
output.accept(ModBlocks.ANEMOMETER.get());
output.accept(ModBlocks.ULTRASONIC_ANEMOMETER.get());
output.accept(ModBlocks.RAIN_GAUGE.get());
output.accept(ModBlocks.SNOW_GAUGE.get());
// Radio & Transmission
output.accept(ModBlocks.ESP32_BOARD.get());
output.accept(ModBlocks.DIRECTIONAL_ANTENNA.get());
output.accept(ModBlocks.OMNI_ANTENNA.get());
output.accept(ModBlocks.VP2_CONSOLE.get());
// Informatique & Réseau
output.accept(ModBlocks.PC_CASE.get());
output.accept(ModBlocks.MONITOR.get());
output.accept(ModBlocks.NETWORK_ROUTER.get());
output.accept(ModItems.MOTHERBOARD.get());
output.accept(ModItems.CPU.get());
output.accept(ModItems.CPU_COOLER.get());
output.accept(ModItems.GPU.get());
output.accept(ModItems.POWER_SUPPLY.get());
output.accept(ModItems.POWER_CABLE.get());
output.accept(ModBlocks.NETWORK_CABLE.get());
output.accept(ModBlocks.OUTDOOR_NETWORK_CABLE.get());
output.accept(ModBlocks.UNDERGROUND_NETWORK_CABLE.get());
// Énergie & Électricité
output.accept(ModBlocks.WIND_TURBINE.get());
output.accept(ModBlocks.HYDRO_TURBINE.get());
output.accept(ModBlocks.COAL_GENERATOR.get());
output.accept(ModBlocks.EXHAUST_CHIMNEY.get());
output.accept(ModItems.TRANSISTOR.get());
output.accept(ModBlocks.ELECTRIC_CABLE.get());
output.accept(ModBlocks.UNDERGROUND_ELECTRIC_CABLE.get());
})
.build());
}
+68
Voir le fichier
@@ -0,0 +1,68 @@
package com.gastinelweather.registry;
import com.gastinelweather.GastinelWeatherMod;
import com.gastinelweather.item.ElitechItem;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.neoforged.neoforge.registries.DeferredItem;
import net.neoforged.neoforge.registries.DeferredRegister;
public class ModItems {
public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(GastinelWeatherMod.MOD_ID);
// --- Items autonomes ---
public static final DeferredItem<ElitechItem> ELITECH_LOGGER = ITEMS.register("elitech_logger",
() -> new ElitechItem(new Item.Properties().stacksTo(1)));
// Composants Informatique
public static final DeferredItem<Item> MOTHERBOARD = ITEMS.register("motherboard",
() -> new Item(new Item.Properties()));
public static final DeferredItem<Item> CPU = ITEMS.register("cpu",
() -> new Item(new Item.Properties()));
public static final DeferredItem<Item> CPU_COOLER = ITEMS.register("cpu_cooler",
() -> new Item(new Item.Properties()));
public static final DeferredItem<Item> GPU = ITEMS.register("gpu",
() -> new Item(new Item.Properties()));
public static final DeferredItem<Item> POWER_SUPPLY = ITEMS.register("power_supply",
() -> new Item(new Item.Properties()));
public static final DeferredItem<Item> POWER_CABLE = ITEMS.register("power_cable",
() -> new Item(new Item.Properties()));
public static final DeferredItem<Item> TRANSISTOR = ITEMS.register("transistor",
() -> new Item(new Item.Properties()));
// --- Block Items (Pôle Météo) ---
public static final DeferredItem<BlockItem> VP2_STATION_ITEM = ITEMS.registerSimpleBlockItem("vp2_station", ModBlocks.VP2_STATION);
public static final DeferredItem<BlockItem> ANEMOMETER_ITEM = ITEMS.registerSimpleBlockItem("anemometer", ModBlocks.ANEMOMETER);
public static final DeferredItem<BlockItem> ULTRASONIC_ANEMOMETER_ITEM = ITEMS.registerSimpleBlockItem("ultrasonic_anemometer", ModBlocks.ULTRASONIC_ANEMOMETER);
public static final DeferredItem<BlockItem> RAIN_GAUGE_ITEM = ITEMS.registerSimpleBlockItem("rain_gauge", ModBlocks.RAIN_GAUGE);
public static final DeferredItem<BlockItem> SNOW_GAUGE_ITEM = ITEMS.registerSimpleBlockItem("snow_gauge", ModBlocks.SNOW_GAUGE);
// --- Block Items (Pôle Radio) ---
public static final DeferredItem<BlockItem> ESP32_BOARD_ITEM = ITEMS.registerSimpleBlockItem("esp32_board", ModBlocks.ESP32_BOARD);
public static final DeferredItem<BlockItem> DIRECTIONAL_ANTENNA_ITEM = ITEMS.registerSimpleBlockItem("directional_antenna", ModBlocks.DIRECTIONAL_ANTENNA);
public static final DeferredItem<BlockItem> OMNI_ANTENNA_ITEM = ITEMS.registerSimpleBlockItem("omni_antenna", ModBlocks.OMNI_ANTENNA);
public static final DeferredItem<BlockItem> VP2_CONSOLE_ITEM = ITEMS.registerSimpleBlockItem("vp2_console", ModBlocks.VP2_CONSOLE);
// --- Block Items (Pôle Informatique) ---
public static final DeferredItem<BlockItem> PC_CASE_ITEM = ITEMS.registerSimpleBlockItem("pc_case", ModBlocks.PC_CASE);
public static final DeferredItem<BlockItem> MONITOR_ITEM = ITEMS.registerSimpleBlockItem("monitor", ModBlocks.MONITOR);
public static final DeferredItem<BlockItem> NETWORK_ROUTER_ITEM = ITEMS.registerSimpleBlockItem("network_router", ModBlocks.NETWORK_ROUTER);
public static final DeferredItem<BlockItem> NETWORK_CABLE_ITEM = ITEMS.registerSimpleBlockItem("network_cable", ModBlocks.NETWORK_CABLE);
public static final DeferredItem<BlockItem> OUTDOOR_NETWORK_CABLE_ITEM = ITEMS.registerSimpleBlockItem("outdoor_network_cable", ModBlocks.OUTDOOR_NETWORK_CABLE);
public static final DeferredItem<BlockItem> UNDERGROUND_NETWORK_CABLE_ITEM = ITEMS.registerSimpleBlockItem("underground_network_cable", ModBlocks.UNDERGROUND_NETWORK_CABLE);
// --- Block Items (Pôle Énergie) ---
public static final DeferredItem<BlockItem> WIND_TURBINE_ITEM = ITEMS.registerSimpleBlockItem("wind_turbine", ModBlocks.WIND_TURBINE);
public static final DeferredItem<BlockItem> HYDRO_TURBINE_ITEM = ITEMS.registerSimpleBlockItem("hydro_turbine", ModBlocks.HYDRO_TURBINE);
public static final DeferredItem<BlockItem> COAL_GENERATOR_ITEM = ITEMS.registerSimpleBlockItem("coal_generator", ModBlocks.COAL_GENERATOR);
public static final DeferredItem<BlockItem> EXHAUST_CHIMNEY_ITEM = ITEMS.registerSimpleBlockItem("exhaust_chimney", ModBlocks.EXHAUST_CHIMNEY);
public static final DeferredItem<BlockItem> ELECTRIC_CABLE_ITEM = ITEMS.registerSimpleBlockItem("electric_cable", ModBlocks.ELECTRIC_CABLE);
public static final DeferredItem<BlockItem> UNDERGROUND_ELECTRIC_CABLE_ITEM = ITEMS.registerSimpleBlockItem("underground_electric_cable", ModBlocks.UNDERGROUND_ELECTRIC_CABLE);
}
+441
Voir le fichier
@@ -0,0 +1,441 @@
package com.gastinelweather.tools;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
/**
* Générateur de textures pixel-art 16x16 et 32x32 pour tous les blocs et items de GastinelWeatherMod.
*/
public class TextureGenerator {
public static void main(String[] args) {
String baseDir = "C:/Users/theog/Documents/_CODE/2-minecraft/mod-meteo/src/main/resources/assets/gastinelweather/textures";
File blockDir = new File(baseDir, "block");
File itemDir = new File(baseDir, "item");
blockDir.mkdirs();
itemDir.mkdirs();
// 1. Textures de Blocs
generateVp2Station(new File(blockDir, "vp2_station.png"));
generateAnemometer(new File(blockDir, "anemometer.png"));
generateUltrasonicAnemometer(new File(blockDir, "ultrasonic_anemometer.png"));
generateRainGauge(new File(blockDir, "rain_gauge.png"));
generateSnowGauge(new File(blockDir, "snow_gauge.png"));
generateEsp32(new File(blockDir, "esp32_board.png"));
generateAntenna(new File(blockDir, "directional_antenna.png"));
generateOmniAntenna(new File(blockDir, "omni_antenna.png"));
generateVp2Console(new File(blockDir, "vp2_console.png"));
generatePcCase(new File(blockDir, "pc_case.png"));
generateMonitor(new File(blockDir, "monitor.png"));
generateRouter(new File(blockDir, "network_router.png"));
generateWindTurbine(new File(blockDir, "wind_turbine.png"));
generateHydroTurbine(new File(blockDir, "hydro_turbine.png"));
generateCoalGenerator(new File(blockDir, "coal_generator.png"));
generateExhaustChimney(new File(blockDir, "exhaust_chimney.png"));
generateCable(new File(blockDir, "network_cable.png"), new Color(0x2B78E4));
generateCable(new File(blockDir, "outdoor_network_cable.png"), new Color(0x1F232A));
generateCable(new File(blockDir, "underground_network_cable.png"), new Color(0x3B444B));
generateCable(new File(blockDir, "electric_cable.png"), new Color(0xD63031));
generateCable(new File(blockDir, "underground_electric_cable.png"), new Color(0x636E72));
// 2. Textures d'Items
generateElitechItem(new File(itemDir, "elitech_logger.png"));
generateMotherboardItem(new File(itemDir, "motherboard.png"));
generateCpuItem(new File(itemDir, "cpu.png"));
generateCpuCoolerItem(new File(itemDir, "cpu_cooler.png"));
generateGpuItem(new File(itemDir, "gpu.png"));
generatePsuItem(new File(itemDir, "power_supply.png"));
generatePowerCableItem(new File(itemDir, "power_cable.png"));
generateTransistorItem(new File(itemDir, "transistor.png"));
System.out.println("Toutes les textures ont été générées avec succès !");
}
private static void saveImage(BufferedImage img, File file) {
try {
ImageIO.write(img, "png", file);
} catch (Exception e) {
e.printStackTrace();
}
}
private static void generateVp2Station(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0xDCE4EC));
g.fillRect(2, 2, 12, 12);
g.setColor(new Color(0x2C3E50));
g.fillRect(3, 4, 10, 2);
g.fillRect(3, 7, 10, 2);
g.fillRect(3, 10, 10, 2);
// Panneau solaire bleu
g.setColor(new Color(0x1A5276));
g.fillRect(5, 2, 6, 2);
g.dispose();
saveImage(img, file);
}
private static void generateAnemometer(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x5D6D7E));
g.fillRect(7, 2, 2, 12);
g.setColor(new Color(0x34495E));
g.fillRect(3, 3, 10, 2);
// Coupelles
g.setColor(new Color(0xBDC3C7));
g.fillRect(2, 2, 2, 3);
g.fillRect(12, 2, 2, 3);
g.fillRect(7, 1, 3, 2);
g.dispose();
saveImage(img, file);
}
private static void generateUltrasonicAnemometer(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(4, 10, 8, 5);
g.setColor(new Color(0x95A5A6));
g.fillRect(4, 2, 2, 8);
g.fillRect(10, 2, 2, 8);
g.setColor(new Color(0x1ABC9C));
g.fillRect(5, 1, 6, 2);
g.dispose();
saveImage(img, file);
}
private static void generateRainGauge(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x7F8C8D));
g.fillRect(4, 2, 8, 12);
g.setColor(new Color(0x3498DB));
g.fillRect(6, 6, 4, 7);
g.setColor(new Color(0xBDC3C7));
g.fillRect(3, 1, 10, 2);
g.dispose();
saveImage(img, file);
}
private static void generateSnowGauge(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x95A5A6));
g.fillRect(7, 0, 2, 16);
g.fillRect(4, 2, 4, 2);
// Laser rouge
g.setColor(new Color(0xE74C3C));
g.fillRect(4, 4, 2, 1);
g.setColor(new Color(0xECF0F1));
g.fillRect(2, 14, 12, 2);
g.dispose();
saveImage(img, file);
}
private static void generateEsp32(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x1E272C));
g.fillRect(2, 2, 12, 12);
// Puce blindée argentée
g.setColor(new Color(0xBDC3C7));
g.fillRect(4, 4, 8, 6);
// Pins dorés
g.setColor(new Color(0xF39C12));
g.fillRect(2, 2, 1, 12);
g.fillRect(13, 2, 1, 12);
g.dispose();
saveImage(img, file);
}
private static void generateAntenna(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x7F8C8D));
g.fillRect(7, 2, 2, 12);
g.setColor(new Color(0xBDC3C7));
g.fillRect(2, 3, 12, 2);
g.fillRect(3, 6, 10, 2);
g.fillRect(4, 9, 8, 2);
g.fillRect(5, 12, 6, 2);
g.dispose();
saveImage(img, file);
}
private static void generateOmniAntenna(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(6, 12, 4, 4);
g.setColor(new Color(0xE67E22));
g.fillRect(7, 10, 2, 2);
g.setColor(new Color(0xBDC3C7));
g.fillRect(7, 0, 2, 10);
g.dispose();
saveImage(img, file);
}
private static void generateVp2Console(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x34495E));
g.fillRect(1, 1, 14, 14);
// Écran LCD rétroéclairé vert/bleu
g.setColor(new Color(0x27AE60));
g.fillRect(3, 3, 10, 7);
// Segments LCD
g.setColor(new Color(0x145A32));
g.fillRect(4, 4, 3, 2);
g.fillRect(8, 4, 4, 2);
g.fillRect(4, 7, 8, 2);
// Boutons
g.setColor(new Color(0x95A5A6));
g.fillRect(3, 12, 2, 1);
g.fillRect(6, 12, 2, 1);
g.fillRect(9, 12, 2, 1);
g.fillRect(12, 12, 1, 1);
g.dispose();
saveImage(img, file);
}
private static void generatePcCase(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x1B1F23));
g.fillRect(1, 1, 14, 14);
// Vitre latérale
g.setColor(new Color(0x24292E));
g.fillRect(3, 3, 10, 10);
// RGB & GPU interne
g.setColor(new Color(0x00D2D3));
g.fillRect(4, 6, 8, 1);
g.setColor(new Color(0xFF9F43));
g.fillRect(4, 9, 8, 1);
g.dispose();
saveImage(img, file);
}
private static void generateMonitor(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2D3436));
g.fillRect(1, 1, 14, 11);
// Écran météo
g.setColor(new Color(0x0984E3));
g.fillRect(2, 2, 12, 9);
// Graphique température
g.setColor(new Color(0xFDCB6E));
g.drawLine(3, 8, 6, 5);
g.drawLine(6, 5, 9, 6);
g.drawLine(9, 6, 13, 4);
// Pied
g.setColor(new Color(0x636E72));
g.fillRect(7, 12, 2, 2);
g.fillRect(5, 14, 6, 1);
g.dispose();
saveImage(img, file);
}
private static void generateRouter(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(2, 6, 12, 8);
// Antennes
g.setColor(new Color(0x1A252F));
g.fillRect(3, 1, 1, 5);
g.fillRect(12, 1, 1, 5);
// LEDs
g.setColor(new Color(0x2ECC71));
g.fillRect(4, 11, 1, 1);
g.fillRect(6, 11, 1, 1);
g.fillRect(8, 11, 1, 1);
g.fillRect(10, 11, 1, 1);
g.dispose();
saveImage(img, file);
}
private static void generateWindTurbine(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0xBDC3C7));
g.fillRect(7, 0, 2, 16);
// Nacelle
g.setColor(new Color(0x7F8C8D));
g.fillRect(5, 4, 6, 4);
// Pales
g.setColor(new Color(0xECF0F1));
g.drawLine(8, 6, 8, 0);
g.drawLine(8, 6, 3, 10);
g.drawLine(8, 6, 13, 10);
g.dispose();
saveImage(img, file);
}
private static void generateHydroTurbine(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x16A085));
g.fillRect(2, 2, 12, 12);
g.setColor(new Color(0xD35400));
g.fillOval(4, 4, 8, 8);
g.setColor(new Color(0x2C3E50));
g.fillRect(7, 3, 2, 10);
g.fillRect(3, 7, 10, 2);
g.dispose();
saveImage(img, file);
}
private static void generateCoalGenerator(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(1, 1, 14, 14);
// Foyer braises
g.setColor(new Color(0xD35400));
g.fillRect(4, 8, 8, 5);
g.setColor(new Color(0xF39C12));
g.fillRect(5, 9, 6, 3);
// Manomètre
g.setColor(new Color(0xBDC3C7));
g.fillOval(6, 3, 4, 4);
g.setColor(new Color(0xC0392B));
g.drawLine(8, 5, 9, 4);
g.dispose();
saveImage(img, file);
}
private static void generateExhaustChimney(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x7F8C8D));
g.fillRect(2, 0, 12, 16);
g.setColor(new Color(0x2C3E50));
g.fillRect(1, 0, 14, 2);
g.fillRect(1, 14, 14, 2);
g.dispose();
saveImage(img, file);
}
private static void generateCable(File file, Color color) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(color);
g.fillRect(5, 5, 6, 6);
g.setColor(color.darker());
g.drawRect(5, 5, 5, 5);
g.dispose();
saveImage(img, file);
}
private static void generateElitechItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0xE67E22));
g.fillRect(3, 2, 10, 12);
// Écran
g.setColor(new Color(0x2ECC71));
g.fillRect(5, 4, 6, 4);
g.setColor(new Color(0x2C3E50));
g.fillRect(5, 10, 2, 2);
g.fillRect(9, 10, 2, 2);
g.dispose();
saveImage(img, file);
}
private static void generateMotherboardItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x1B4F72));
g.fillRect(1, 1, 14, 14);
g.setColor(new Color(0xF1C40F));
g.fillRect(4, 4, 5, 5);
g.setColor(new Color(0x27AE60));
g.fillRect(10, 3, 3, 10);
g.dispose();
saveImage(img, file);
}
private static void generateCpuItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(3, 3, 10, 10);
g.setColor(new Color(0xF1C40F));
g.fillRect(5, 5, 6, 6);
g.setColor(new Color(0xBDC3C7));
g.fillRect(6, 6, 4, 4);
g.dispose();
saveImage(img, file);
}
private static void generateCpuCoolerItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0xBDC3C7));
g.fillRect(3, 3, 10, 10);
g.setColor(new Color(0x34495E));
g.fillOval(5, 5, 6, 6);
g.setColor(new Color(0x3498DB));
g.fillRect(7, 4, 2, 8);
g.fillRect(4, 7, 8, 2);
g.dispose();
saveImage(img, file);
}
private static void generateGpuItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(1, 4, 14, 8);
g.setColor(new Color(0x1B1F23));
g.fillOval(3, 5, 4, 4);
g.fillOval(9, 5, 4, 4);
g.setColor(new Color(0xF1C40F));
g.fillRect(3, 12, 10, 2);
g.dispose();
saveImage(img, file);
}
private static void generatePsuItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(2, 2, 12, 12);
g.setColor(new Color(0x1A252F));
g.fillOval(4, 4, 8, 8);
g.setColor(new Color(0xE74C3C));
g.fillRect(12, 5, 2, 4);
g.dispose();
saveImage(img, file);
}
private static void generatePowerCableItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x1B1F23));
g.fillRect(2, 6, 12, 4);
g.setColor(new Color(0xBDC3C7));
g.fillRect(1, 7, 2, 2);
g.fillRect(13, 7, 2, 2);
g.dispose();
saveImage(img, file);
}
private static void generateTransistorItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x1B1F23));
g.fillRect(4, 3, 8, 6);
g.setColor(new Color(0xBDC3C7));
g.fillRect(5, 9, 1, 5);
g.fillRect(7, 9, 1, 5);
g.fillRect(9, 9, 1, 5);
g.dispose();
saveImage(img, file);
}
}
+441
Voir le fichier
@@ -0,0 +1,441 @@
package com.gastinelweather.tools;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
/**
* Générateur de textures pixel-art 16x16 et 32x32 pour tous les blocs et items de GastinelWeatherMod.
*/
public class TextureGenerator {
public static void main(String[] args) {
String baseDir = "C:/Users/theog/Documents/_CODE/Mod.3/src/main/resources/assets/gastinelweather/textures";
File blockDir = new File(baseDir, "block");
File itemDir = new File(baseDir, "item");
blockDir.mkdirs();
itemDir.mkdirs();
// 1. Textures de Blocs
generateVp2Station(new File(blockDir, "vp2_station.png"));
generateAnemometer(new File(blockDir, "anemometer.png"));
generateUltrasonicAnemometer(new File(blockDir, "ultrasonic_anemometer.png"));
generateRainGauge(new File(blockDir, "rain_gauge.png"));
generateSnowGauge(new File(blockDir, "snow_gauge.png"));
generateEsp32(new File(blockDir, "esp32_board.png"));
generateAntenna(new File(blockDir, "directional_antenna.png"));
generateOmniAntenna(new File(blockDir, "omni_antenna.png"));
generateVp2Console(new File(blockDir, "vp2_console.png"));
generatePcCase(new File(blockDir, "pc_case.png"));
generateMonitor(new File(blockDir, "monitor.png"));
generateRouter(new File(blockDir, "network_router.png"));
generateWindTurbine(new File(blockDir, "wind_turbine.png"));
generateHydroTurbine(new File(blockDir, "hydro_turbine.png"));
generateCoalGenerator(new File(blockDir, "coal_generator.png"));
generateExhaustChimney(new File(blockDir, "exhaust_chimney.png"));
generateCable(new File(blockDir, "network_cable.png"), new Color(0x2B78E4));
generateCable(new File(blockDir, "outdoor_network_cable.png"), new Color(0x1F232A));
generateCable(new File(blockDir, "underground_network_cable.png"), new Color(0x3B444B));
generateCable(new File(blockDir, "electric_cable.png"), new Color(0xD63031));
generateCable(new File(blockDir, "underground_electric_cable.png"), new Color(0x636E72));
// 2. Textures d'Items
generateElitechItem(new File(itemDir, "elitech_logger.png"));
generateMotherboardItem(new File(itemDir, "motherboard.png"));
generateCpuItem(new File(itemDir, "cpu.png"));
generateCpuCoolerItem(new File(itemDir, "cpu_cooler.png"));
generateGpuItem(new File(itemDir, "gpu.png"));
generatePsuItem(new File(itemDir, "power_supply.png"));
generatePowerCableItem(new File(itemDir, "power_cable.png"));
generateTransistorItem(new File(itemDir, "transistor.png"));
System.out.println("Toutes les textures ont été générées avec succès !");
}
private static void saveImage(BufferedImage img, File file) {
try {
ImageIO.write(img, "png", file);
} catch (Exception e) {
e.printStackTrace();
}
}
private static void generateVp2Station(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0xDCE4EC));
g.fillRect(2, 2, 12, 12);
g.setColor(new Color(0x2C3E50));
g.fillRect(3, 4, 10, 2);
g.fillRect(3, 7, 10, 2);
g.fillRect(3, 10, 10, 2);
// Panneau solaire bleu
g.setColor(new Color(0x1A5276));
g.fillRect(5, 2, 6, 2);
g.dispose();
saveImage(img, file);
}
private static void generateAnemometer(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x5D6D7E));
g.fillRect(7, 2, 2, 12);
g.setColor(new Color(0x34495E));
g.fillRect(3, 3, 10, 2);
// Coupelles
g.setColor(new Color(0xBDC3C7));
g.fillRect(2, 2, 2, 3);
g.fillRect(12, 2, 2, 3);
g.fillRect(7, 1, 3, 2);
g.dispose();
saveImage(img, file);
}
private static void generateUltrasonicAnemometer(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(4, 10, 8, 5);
g.setColor(new Color(0x95A5A6));
g.fillRect(4, 2, 2, 8);
g.fillRect(10, 2, 2, 8);
g.setColor(new Color(0x1ABC9C));
g.fillRect(5, 1, 6, 2);
g.dispose();
saveImage(img, file);
}
private static void generateRainGauge(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x7F8C8D));
g.fillRect(4, 2, 8, 12);
g.setColor(new Color(0x3498DB));
g.fillRect(6, 6, 4, 7);
g.setColor(new Color(0xBDC3C7));
g.fillRect(3, 1, 10, 2);
g.dispose();
saveImage(img, file);
}
private static void generateSnowGauge(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x95A5A6));
g.fillRect(7, 0, 2, 16);
g.fillRect(4, 2, 4, 2);
// Laser rouge
g.setColor(new Color(0xE74C3C));
g.fillRect(4, 4, 2, 1);
g.setColor(new Color(0xECF0F1));
g.fillRect(2, 14, 12, 2);
g.dispose();
saveImage(img, file);
}
private static void generateEsp32(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x1E272C));
g.fillRect(2, 2, 12, 12);
// Puce blindée argentée
g.setColor(new Color(0xBDC3C7));
g.fillRect(4, 4, 8, 6);
// Pins dorés
g.setColor(new Color(0xF39C12));
g.fillRect(2, 2, 1, 12);
g.fillRect(13, 2, 1, 12);
g.dispose();
saveImage(img, file);
}
private static void generateAntenna(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x7F8C8D));
g.fillRect(7, 2, 2, 12);
g.setColor(new Color(0xBDC3C7));
g.fillRect(2, 3, 12, 2);
g.fillRect(3, 6, 10, 2);
g.fillRect(4, 9, 8, 2);
g.fillRect(5, 12, 6, 2);
g.dispose();
saveImage(img, file);
}
private static void generateOmniAntenna(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(6, 12, 4, 4);
g.setColor(new Color(0xE67E22));
g.fillRect(7, 10, 2, 2);
g.setColor(new Color(0xBDC3C7));
g.fillRect(7, 0, 2, 10);
g.dispose();
saveImage(img, file);
}
private static void generateVp2Console(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x34495E));
g.fillRect(1, 1, 14, 14);
// Écran LCD rétroéclairé vert/bleu
g.setColor(new Color(0x27AE60));
g.fillRect(3, 3, 10, 7);
// Segments LCD
g.setColor(new Color(0x145A32));
g.fillRect(4, 4, 3, 2);
g.fillRect(8, 4, 4, 2);
g.fillRect(4, 7, 8, 2);
// Boutons
g.setColor(new Color(0x95A5A6));
g.fillRect(3, 12, 2, 1);
g.fillRect(6, 12, 2, 1);
g.fillRect(9, 12, 2, 1);
g.fillRect(12, 12, 1, 1);
g.dispose();
saveImage(img, file);
}
private static void generatePcCase(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x1B1F23));
g.fillRect(1, 1, 14, 14);
// Vitre latérale
g.setColor(new Color(0x24292E));
g.fillRect(3, 3, 10, 10);
// RGB & GPU interne
g.setColor(new Color(0x00D2D3));
g.fillRect(4, 6, 8, 1);
g.setColor(new Color(0xFF9F43));
g.fillRect(4, 9, 8, 1);
g.dispose();
saveImage(img, file);
}
private static void generateMonitor(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2D3436));
g.fillRect(1, 1, 14, 11);
// Écran météo
g.setColor(new Color(0x0984E3));
g.fillRect(2, 2, 12, 9);
// Graphique température
g.setColor(new Color(0xFDCB6E));
g.drawLine(3, 8, 6, 5);
g.drawLine(6, 5, 9, 6);
g.drawLine(9, 6, 13, 4);
// Pied
g.setColor(new Color(0x636E72));
g.fillRect(7, 12, 2, 2);
g.fillRect(5, 14, 6, 1);
g.dispose();
saveImage(img, file);
}
private static void generateRouter(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(2, 6, 12, 8);
// Antennes
g.setColor(new Color(0x1A252F));
g.fillRect(3, 1, 1, 5);
g.fillRect(12, 1, 1, 5);
// LEDs
g.setColor(new Color(0x2ECC71));
g.fillRect(4, 11, 1, 1);
g.fillRect(6, 11, 1, 1);
g.fillRect(8, 11, 1, 1);
g.fillRect(10, 11, 1, 1);
g.dispose();
saveImage(img, file);
}
private static void generateWindTurbine(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0xBDC3C7));
g.fillRect(7, 0, 2, 16);
// Nacelle
g.setColor(new Color(0x7F8C8D));
g.fillRect(5, 4, 6, 4);
// Pales
g.setColor(new Color(0xECF0F1));
g.drawLine(8, 6, 8, 0);
g.drawLine(8, 6, 3, 10);
g.drawLine(8, 6, 13, 10);
g.dispose();
saveImage(img, file);
}
private static void generateHydroTurbine(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x16A085));
g.fillRect(2, 2, 12, 12);
g.setColor(new Color(0xD35400));
g.fillOval(4, 4, 8, 8);
g.setColor(new Color(0x2C3E50));
g.fillRect(7, 3, 2, 10);
g.fillRect(3, 7, 10, 2);
g.dispose();
saveImage(img, file);
}
private static void generateCoalGenerator(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(1, 1, 14, 14);
// Foyer braises
g.setColor(new Color(0xD35400));
g.fillRect(4, 8, 8, 5);
g.setColor(new Color(0xF39C12));
g.fillRect(5, 9, 6, 3);
// Manomètre
g.setColor(new Color(0xBDC3C7));
g.fillOval(6, 3, 4, 4);
g.setColor(new Color(0xC0392B));
g.drawLine(8, 5, 9, 4);
g.dispose();
saveImage(img, file);
}
private static void generateExhaustChimney(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x7F8C8D));
g.fillRect(2, 0, 12, 16);
g.setColor(new Color(0x2C3E50));
g.fillRect(1, 0, 14, 2);
g.fillRect(1, 14, 14, 2);
g.dispose();
saveImage(img, file);
}
private static void generateCable(File file, Color color) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(color);
g.fillRect(5, 5, 6, 6);
g.setColor(color.darker());
g.drawRect(5, 5, 5, 5);
g.dispose();
saveImage(img, file);
}
private static void generateElitechItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0xE67E22));
g.fillRect(3, 2, 10, 12);
// Écran
g.setColor(new Color(0x2ECC71));
g.fillRect(5, 4, 6, 4);
g.setColor(new Color(0x2C3E50));
g.fillRect(5, 10, 2, 2);
g.fillRect(9, 10, 2, 2);
g.dispose();
saveImage(img, file);
}
private static void generateMotherboardItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x1B4F72));
g.fillRect(1, 1, 14, 14);
g.setColor(new Color(0xF1C40F));
g.fillRect(4, 4, 5, 5);
g.setColor(new Color(0x27AE60));
g.fillRect(10, 3, 3, 10);
g.dispose();
saveImage(img, file);
}
private static void generateCpuItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(3, 3, 10, 10);
g.setColor(new Color(0xF1C40F));
g.fillRect(5, 5, 6, 6);
g.setColor(new Color(0xBDC3C7));
g.fillRect(6, 6, 4, 4);
g.dispose();
saveImage(img, file);
}
private static void generateCpuCoolerItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0xBDC3C7));
g.fillRect(3, 3, 10, 10);
g.setColor(new Color(0x34495E));
g.fillOval(5, 5, 6, 6);
g.setColor(new Color(0x3498DB));
g.fillRect(7, 4, 2, 8);
g.fillRect(4, 7, 8, 2);
g.dispose();
saveImage(img, file);
}
private static void generateGpuItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(1, 4, 14, 8);
g.setColor(new Color(0x1B1F23));
g.fillOval(3, 5, 4, 4);
g.fillOval(9, 5, 4, 4);
g.setColor(new Color(0xF1C40F));
g.fillRect(3, 12, 10, 2);
g.dispose();
saveImage(img, file);
}
private static void generatePsuItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x2C3E50));
g.fillRect(2, 2, 12, 12);
g.setColor(new Color(0x1A252F));
g.fillOval(4, 4, 8, 8);
g.setColor(new Color(0xE74C3C));
g.fillRect(12, 5, 2, 4);
g.dispose();
saveImage(img, file);
}
private static void generatePowerCableItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x1B1F23));
g.fillRect(2, 6, 12, 4);
g.setColor(new Color(0xBDC3C7));
g.fillRect(1, 7, 2, 2);
g.fillRect(13, 7, 2, 2);
g.dispose();
saveImage(img, file);
}
private static void generateTransistorItem(File file) {
BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = img.createGraphics();
g.setColor(new Color(0x1B1F23));
g.fillRect(4, 3, 8, 6);
g.setColor(new Color(0xBDC3C7));
g.fillRect(5, 9, 1, 5);
g.fillRect(7, 9, 1, 5);
g.fillRect(9, 9, 1, 5);
g.dispose();
saveImage(img, file);
}
}
+54
Voir le fichier
@@ -0,0 +1,54 @@
package com.gastinelweather.weather;
import org.joml.Vector3f;
/**
* Interface pour échantillonner la hauteur et la géométrie du terrain (Minecraft ou simulé).
*/
@FunctionalInterface
public interface HeightSampler {
/**
* Renvoie la hauteur de la surface du terrain aux coordonnées monde (x, z).
*/
float heightAt(float worldX, float worldZ);
/**
* Calcule la normale unitaire de la surface par différences finies.
*/
default Vector3f normalAt(float worldX, float worldZ, float sampleStep) {
float s = sampleStep > 0.0f ? sampleStep : 2.0f;
float dhdx = (heightAt(worldX + s, worldZ) - heightAt(worldX - s, worldZ)) / (2.0f * s);
float dhdz = (heightAt(worldX, worldZ + s) - heightAt(worldX, worldZ - s)) / (2.0f * s);
Vector3f normal = new Vector3f(-dhdx, 1.0f, -dhdz);
if (normal.lengthSquared() > 1e-6f) {
normal.normalize();
} else {
normal.set(0.0f, 1.0f, 0.0f);
}
return normal;
}
/**
* Niveau de pluie Minecraft [0, 1] du monde échantillonné (0 hors d'un vrai monde).
*/
default float rainLevel() {
return 0.0f;
}
/**
* Niveau d'orage Minecraft [0, 1] du monde échantillonné (0 hors d'un vrai monde).
*/
default float thunderLevel() {
return 0.0f;
}
/**
* Sampler par défaut plat (niveau de la mer).
*/
static HeightSampler flat(float defaultHeight) {
return (x, z) -> defaultHeight;
}
}
+122
Voir le fichier
@@ -0,0 +1,122 @@
package com.gastinelweather.weather;
import org.joml.Vector3f;
/**
* Utilitaires mathématiques déterministes pour le moteur météo.
* Porté de Vercora (C++) vers Java.
*/
public final class MathUtils {
public static final float PI = 3.14159265358979323846f;
public static final float TWO_PI = 2.0f * PI;
private MathUtils() {}
public static float clamp(float value, float min, float max) {
if (Float.isNaN(value)) return min;
return Math.max(min, Math.min(max, value));
}
public static float clamp01(float value) {
return clamp(value, 0.0f, 1.0f);
}
public static float mix(float a, float b, float t) {
return a + t * (b - a);
}
public static float safeFinite(float value, float fallback) {
return Float.isFinite(value) ? value : fallback;
}
public static float smootherStep(float t) {
t = clamp01(t);
return t * t * t * (t * (t * 6.0f - 15.0f) + 10.0f);
}
/**
* Hachage lowbias32 de Chris Wellons : mélange complet et déterministe.
*/
public static int hashU32(int x) {
x ^= x >>> 16;
x *= 0x7feb352d;
x ^= x >>> 15;
x *= 0x846ca68b;
x ^= x >>> 16;
return x;
}
public static float nodeGradient(int node, int seed) {
int h = hashU32((node * 0x9E3779B9) ^ seed);
// Conversion en float dans [-1, 1)
long unsignedH = Integer.toUnsignedLong(h);
return (float) (unsignedH * (2.0 / 4294967296.0) - 1.0);
}
public static float gradientNoise1D(float x, int seed) {
float floored = (float) Math.floor(x);
int i0 = (int) floored;
float f = x - floored;
float g0 = nodeGradient(i0, seed);
float g1 = nodeGradient(i0 + 1, seed);
float n0 = g0 * f;
float n1 = g1 * (f - 1.0f);
return 2.0f * (n0 + (n1 - n0) * smootherStep(f));
}
public static float fbm1D(float x, int seed, int octaves) {
octaves = Math.max(1, Math.min(8, octaves));
float sum = 0.0f;
float amplitude = 1.0f;
float frequency = 1.0f;
float total = 0.0f;
for (int i = 0; i < octaves; ++i) {
sum += amplitude * gradientNoise1D(x * frequency, seed + i * 0x9E3779B9);
total += amplitude;
amplitude *= 0.5f;
frequency *= 2.0f;
}
return total > 0.0f ? sum / total : 0.0f;
}
/**
* Modèle astronomique de Cooper (1969) pour la déclinaison solaire.
*/
public static float solarDeclinationDegrees(float dayOfYear) {
return 23.44f * (float) Math.sin(TWO_PI * (284.0f + dayOfYear) / 365.0f);
}
/**
* Convertit un cap compas (0° = Nord, 90° = Est, 180° = Sud, 270° = Ouest)
* en vecteur directionnel unitaire dans le repère Minecraft (+X = Est, +Z = Sud).
*/
public static Vector3f compassDirection(float degrees) {
float rad = (float) Math.toRadians(degrees);
return new Vector3f((float) Math.sin(rad), 0.0f, -(float) Math.cos(rad));
}
/**
* Formule officielle internationale JAG/TI (Joint Action Group for Temperature Indices)
* pour le refroidissement éolien (Wind Chill).
*/
public static float windChillC(float temperatureC, float windMps) {
float t = safeFinite(temperatureC, 0.0f);
float v = Math.max(0.0f, safeFinite(windMps, 0.0f));
float kmh = v * 3.6f;
if (t > 10.0f || kmh < 4.8f) {
return t;
}
double p = Math.pow(kmh, 0.16);
float chilled = (float) (13.12 + 0.6215 * t - 11.37 * p + 0.3965 * t * p);
return Math.min(chilled, t);
}
}
+37
Voir le fichier
@@ -0,0 +1,37 @@
package com.gastinelweather.weather;
import org.joml.Vector3f;
/**
* État synoptique macro du monde à un instant donné (indépendant de la position 3D).
*/
public class SynopticState {
public float gameHours = 0.0f;
public float timeOfDayHours = 12.0f;
public float dayOfYear = 0.0f;
public float seaLevelTemperatureC = 0.0f;
public float windFromDegrees = 270.0f;
public float seaLevelWindMps = 0.0f;
public float cloudCover = 0.0f; // [0, 1]
public float precipitationMmPerHour = 0.0f;
public float sunElevationDegrees = 0.0f;
public float sunAzimuthDegrees = 180.0f;
public float daylight = 0.0f; // [0, 1]
public Vector3f sunDirection = new Vector3f(0.0f, 1.0f, 0.0f);
public boolean isRaining() {
return precipitationMmPerHour > 0.05f;
}
public String describe() {
int day = (int) (gameHours / 24.0f);
return String.format(
"Jour +%d %.1fh : Température réf = %.1f°C | Vent = %.1f m/s (%.0f km/h) de %.0f° | Nuages = %.0f%% | Pluie = %.1f mm/h | Soleil = %.1f°",
day, timeOfDayHours, seaLevelTemperatureC, seaLevelWindMps, seaLevelWindMps * 3.6f,
windFromDegrees, cloudCover * 100.0f, precipitationMmPerHour, sunElevationDegrees
);
}
}
+91
Voir le fichier
@@ -0,0 +1,91 @@
package com.gastinelweather.weather;
/**
* Paramètres et constantes météorologiques du modèle.
* Regroupe tous les réglages physiques et d'équilibrage de la simulation.
*/
public class WeatherParams {
// --- 1. Temps et Saison ---
public float startDayOfYear = 135.0f; // Mi-mai (printemps)
public float latitudeDegrees = 45.0f; // 45° Nord (climat tempéré / alpin)
// --- 2. Température de référence (Niveau de la mer) ---
public float seaLevelAnnualMeanC = 11.0f;
public float seasonalAmplitudeC = 9.0f;
public float seasonalPeakDay = 205.0f; // Fin juillet
public float seasonalHarmonic2C = 1.2f;
public float diurnalAmplitudeC = 8.0f;
public float diurnalPeakHour = 15.0f; // Maximum thermique à 15h
public float diurnalHarmonic2C = 1.0f;
public float cloudDiurnalDamping = 0.60f;
public float lapseRateCPerKm = 6.5f; // Gradient altitudinal adiabatique standard
// Altitude de référence (niveau de la mer Minecraft)
public float seaLevelAltitudeBlocks = 64.0f;
// --- 3. Perturbations et Masses d'Air ---
public float frontPeriodDays = 3.5f; // Période caractéristique des fronts météo
public int frontOctaves = 3;
public float frontNoiseGain = 2.2f;
public float frontTemperatureAmplitudeC = 4.0f;
public float meanCloudCover = 0.45f;
public float cloudAmplitude = 0.50f;
public float precipitationCloudThreshold = 0.72f;
public float precipitationMaxMmPerHour = 6.0f;
public float snowThresholdC = 1.0f; // Neige sous 1°C
// --- 4. Vent Synoptique ---
public float meanWindFromDegrees = 270.0f; // Régime dominant d'Ouest
public float windDirectionSwingDegrees = 75.0f;
public float baseWindMps = 3.0f; // Brise permanente minimale
public float frontWindAmplitudeMps = 9.0f;
public float windAltitudeGainMpsPerKm = 4.0f;
// Renfort du vent par la météo Minecraft (pluie, orage) : vent x (1 + rainWindBoost x pluie + thunderWindBoost x orage).
// Le shader GastinelWind recopie ces deux valeurs (lib/wind.glsl) : les modifier des deux côtés.
public float rainWindBoost = 0.5f;
public float thunderWindBoost = 0.8f;
// --- 5. Spatialisation & Ensoleillement (Adret/Ubac) ---
public float aspectBonusC = 4.0f;
public float cloudAspectDamping = 0.85f;
public float aspectFullDaylightSin = 0.25f;
public float aspectIncidenceReference = 0.35f;
public float inversionMaxC = -6.0f;
public float inversionMixingWindMps = 4.0f;
// --- 6. Sondage Amont & Relief ---
public float upwindNearMeters = 30.0f; // Blocs Minecraft
public float upwindMidMeters = 75.0f;
public float upwindFarMeters = 200.0f;
public float downwindMeters = 15.0f;
public float lateralMeters = 40.0f;
public float exposureReliefMeters = 20.0f;
public float exposureWindGain = 0.80f;
public float shelterWindReduction = 0.75f;
public float venturiReliefMeters = 25.0f;
public float venturiWindGain = 0.70f;
public float maxLocalWindMps = 35.0f;
// --- Composantes Verticales & Vol ---
public float ridgeLiftEfficiency = 0.55f;
public float maxRidgeLiftMps = 6.0f;
public float leeSubsidenceMps = -3.0f;
public float leeTurbulenceMax = 1.0f;
public float turbulenceFullWindMps = 12.0f;
public float thermalMaxMps = 3.5f;
public float thermalPeakHour = 14.0f;
public float thermalHalfWidthHours = 4.5f;
public float cloudThermalDamping = 0.80f;
// --- Précipitations Orographiques & Sol ---
public float orographicGain = 0.90f;
public float orographicFullSlope = 0.35f;
public float orographicCloudGain = 0.15f;
public float precipitationAltitudeGainPerKm = 0.35f;
public float wetnessMemoryHours = 6.0f;
public int wetnessSamples = 8;
public float wetnessSaturationMmPerHour = 3.0f;
public float dryingTimeHours = 4.0f;
}
+47
Voir le fichier
@@ -0,0 +1,47 @@
package com.gastinelweather.weather;
import org.joml.Vector3f;
/**
* Échantillon météo microclimatique spatialisé en un point (x, y, z) du monde.
*/
public class WeatherSample {
// --- Température ---
public float temperatureC = 0.0f;
public float lapseC = 0.0f; // Gradient altitudinal (< 0 en altitude)
public float aspectC = 0.0f; // Ensoleillement adret / ubac (> 0 si chauffé)
public float inversionC = 0.0f; // Inversion thermique de cuvette (<= 0)
public float windChillC = 0.0f; // Température ressentie au vent
// --- Vent Horizontal ---
public float windMps = 0.0f;
public Vector3f windVector = new Vector3f(0.0f);
// --- Composantes Verticales ---
public float verticalMps = 0.0f;
public float ridgeLiftMps = 0.0f; // Pente dynamique
public float thermalMps = 0.0f; // Convection thermique
public float subsidenceMps = 0.0f; // Rabattant sous le vent
public float turbulence = 0.0f; // Turbulence [0, 1]
// --- Humidité & Précipitations ---
public float cloudCover = 0.0f;
public float precipitationMmPerHour = 0.0f;
public boolean snowing = false;
public float wetness = 0.0f; // Mouillure du sol [0, 1]
public float getWindSpeedKmh() {
return windMps * 3.6f;
}
public String describe() {
return String.format(
"Local : %.1f°C (Ressenti %.1f°C | Alt %.1f°C, Versant %+.1f°C, Inversion %+.1f°C) | Vent = %.1f m/s (%.0f km/h) | Vertical = %+.2f m/s (Thermique %+.2f, Pente %+.2f) | %s | Sol = %.0f%% mouillé",
temperatureC, windChillC, lapseC, aspectC, inversionC,
windMps, getWindSpeedKmh(), verticalMps, thermalMps, ridgeLiftMps,
(snowing ? "NEIGE (" + String.format("%.1f", precipitationMmPerHour) + " mm/h)" : (precipitationMmPerHour > 0.05f ? "PLUIE (" + String.format("%.1f", precipitationMmPerHour) + " mm/h)" : "SEC")),
wetness * 100.0f
);
}
}
+350
Voir le fichier
@@ -0,0 +1,350 @@
package com.gastinelweather.weather;
import org.joml.Vector3f;
import java.util.ArrayList;
import java.util.List;
/**
* Système météorologique déterministe pur (porté de Vercora).
* Météo = f(Position(x, y, z), Instant t, Seed).
*/
public class WeatherSystem {
public static final int DEFAULT_SEED = 0x5EA50E;
private final WeatherParams params;
private final int seed;
public WeatherSystem() {
this(new WeatherParams(), DEFAULT_SEED);
}
public WeatherSystem(WeatherParams params, int seed) {
this.params = params != null ? params : new WeatherParams();
this.seed = seed;
}
public WeatherParams getParams() {
return params;
}
public int getSeed() {
return seed;
}
// =======================================================================
// COUCHE 1 : État synoptique macro (0D, purement temporel)
// =======================================================================
private float frontNoise(float gameHours, int channel) {
float periodHours = Math.max(1.0f, params.frontPeriodDays * 24.0f);
int channelSeed = seed ^ MathUtils.hashU32(channel * 0x85EBCA6B + 1);
float raw = MathUtils.fbm1D(gameHours / periodHours, channelSeed, params.frontOctaves);
return MathUtils.clamp(raw * params.frontNoiseGain, -1.0f, 1.0f);
}
/**
* Renfort du vent par la pluie et l'orage Minecraft (niveaux [0, 1] du monde).
* Même formule dans le shader GastinelWind (gwStormFactor) pour que l'herbe et l'anémomètre soient d'accord.
*/
public float stormWindFactor(float rainLevel, float thunderLevel) {
float rain = MathUtils.clamp01(MathUtils.safeFinite(rainLevel, 0.0f));
float thunder = MathUtils.clamp01(MathUtils.safeFinite(thunderLevel, 0.0f));
return 1.0f + params.rainWindBoost * rain + params.thunderWindBoost * thunder;
}
/**
* Même terrain, sans la pluie/l'orage Minecraft : la météo vanilla n'est pas prévisible,
* les prévisions au-delà de l'heure en cours ne l'utilisent donc pas.
*/
private static HeightSampler withoutVanillaWeather(HeightSampler terrain) {
return terrain == null ? null : terrain::heightAt;
}
public SynopticState synopticAt(float gameHours) {
SynopticState sky = new SynopticState();
sky.gameHours = MathUtils.safeFinite(gameHours, 0.0f);
// --- Calendrier ---
sky.timeOfDayHours = (float) ((sky.gameHours % 24.0 + 24.0) % 24.0);
sky.dayOfYear = (float) (((params.startDayOfYear + sky.gameHours / 24.0) % 365.0 + 365.0) % 365.0);
// --- Position Solaire ---
float declination = MathUtils.solarDeclinationDegrees(sky.dayOfYear);
float latRad = (float) Math.toRadians(params.latitudeDegrees);
float decRad = (float) Math.toRadians(declination);
float hourAngle = (float) Math.toRadians(15.0f * (sky.timeOfDayHours - 12.0f));
float sinElevation = MathUtils.clamp(
(float) (Math.sin(latRad) * Math.sin(decRad) + Math.cos(latRad) * Math.cos(decRad) * Math.cos(hourAngle)),
-1.0f, 1.0f
);
float elevation = (float) Math.asin(sinElevation);
sky.sunElevationDegrees = (float) Math.toDegrees(elevation);
float cosElevation = (float) Math.cos(elevation);
float azimuth = 180.0f; // Plein sud
if (cosElevation > 1e-4f && (float) Math.cos(latRad) > 1e-4f) {
float cosAzimuth = MathUtils.clamp(
(float) ((Math.sin(decRad) - sinElevation * Math.sin(latRad)) / (cosElevation * Math.cos(latRad))),
-1.0f, 1.0f
);
azimuth = (float) Math.toDegrees(Math.acos(cosAzimuth));
if (hourAngle > 0.0f) {
azimuth = 360.0f - azimuth;
}
}
sky.sunAzimuthDegrees = azimuth;
Vector3f horizontal = MathUtils.compassDirection(azimuth);
sky.sunDirection = new Vector3f(horizontal.x * cosElevation, sinElevation, horizontal.z * cosElevation);
if (sky.sunDirection.lengthSquared() > 1e-6f) {
sky.sunDirection.normalize();
} else {
sky.sunDirection.set(0.0f, 1.0f, 0.0f);
}
sky.daylight = Math.max(0.0f, sinElevation);
// --- Nébulosité (Canal 1) ---
float cloudNoise = frontNoise(sky.gameHours, 1);
sky.cloudCover = MathUtils.clamp01(params.meanCloudCover + params.cloudAmplitude * cloudNoise);
// --- Température de Référence (Niveau Mer) ---
float seasonPhase = MathUtils.TWO_PI * (sky.dayOfYear - params.seasonalPeakDay) / 365.0f;
float seasonal = params.seasonalAmplitudeC * (float) Math.cos(seasonPhase) +
params.seasonalHarmonic2C * (float) Math.cos(2.0f * seasonPhase);
float diurnalPhase = MathUtils.TWO_PI * (sky.timeOfDayHours - params.diurnalPeakHour) / 24.0f;
float cloudDamping = 1.0f - params.cloudDiurnalDamping * sky.cloudCover;
float diurnal = (params.diurnalAmplitudeC * (float) Math.cos(diurnalPhase) +
params.diurnalHarmonic2C * (float) Math.cos(2.0f * diurnalPhase)) * cloudDamping;
float airMass = params.frontTemperatureAmplitudeC * frontNoise(sky.gameHours, 0);
sky.seaLevelTemperatureC = params.seaLevelAnnualMeanC + seasonal + diurnal + airMass;
// --- Vent Synoptique (Canaux 2 et 3) ---
float windNoise = Math.abs(frontNoise(sky.gameHours, 2));
sky.seaLevelWindMps = Math.max(0.0f, params.baseWindMps + params.frontWindAmplitudeMps * windNoise);
float directionNoise = frontNoise(sky.gameHours, 3);
sky.windFromDegrees = (params.meanWindFromDegrees + params.windDirectionSwingDegrees * directionNoise) % 360.0f;
if (sky.windFromDegrees < 0.0f) sky.windFromDegrees += 360.0f;
// --- Précipitations ---
float threshold = MathUtils.clamp(params.precipitationCloudThreshold, 0.0f, 0.999f);
if (sky.cloudCover > threshold) {
float excess = (sky.cloudCover - threshold) / (1.0f - threshold);
sky.precipitationMmPerHour = params.precipitationMaxMmPerHour * MathUtils.clamp01(excess);
} else {
sky.precipitationMmPerHour = 0.0f;
}
return sky;
}
// =======================================================================
// COUCHE 2 : Spatialisation Micro-Climatique (3D)
// =======================================================================
public float aspectSignal(Vector3f normal, Vector3f sunDirection, boolean sunUp) {
float incidence = sunUp ? Math.max(0.0f, normal.dot(sunDirection)) : 0.0f;
float flatIncidence = Math.max(0.0f, sunDirection.y);
return MathUtils.clamp((incidence - flatIncidence) / Math.max(1e-3f, params.aspectIncidenceReference), -1.0f, 1.0f);
}
public WeatherSample sampleAt(Vector3f position, float gameHours, HeightSampler terrain) {
return sampleAt(position, synopticAt(gameHours), terrain);
}
public WeatherSample sampleAt(Vector3f position, SynopticState sky, HeightSampler terrain) {
WeatherSample out = new WeatherSample();
float x = MathUtils.safeFinite(position.x, 0.0f);
float y = MathUtils.safeFinite(position.y, params.seaLevelAltitudeBlocks);
float z = MathUtils.safeFinite(position.z, 0.0f);
// Altitude relative par rapport au niveau de la mer
float altitudeKm = (y - params.seaLevelAltitudeBlocks) / 1000.0f;
out.cloudCover = sky.cloudCover;
Vector3f normal = new Vector3f(0.0f, 1.0f, 0.0f);
if (terrain != null) {
normal = terrain.normalAt(x, z, 2.0f);
}
// 1. Température : Gradient altitudinal
out.lapseC = -params.lapseRateCPerKm * altitudeKm;
// Adret / Ubac
float signal = aspectSignal(normal, sky.sunDirection, sky.daylight > 0.0f);
float sunStrength = MathUtils.clamp01(sky.daylight / Math.max(1e-3f, params.aspectFullDaylightSin));
out.aspectC = params.aspectBonusC * signal * sunStrength * (1.0f - params.cloudAspectDamping * sky.cloudCover);
// 2. Vent Local & Sondage Amont
float referenceWind = Math.max(0.0f, sky.seaLevelWindMps + params.windAltitudeGainMpsPerKm * altitudeKm);
if (terrain != null) {
referenceWind *= stormWindFactor(terrain.rainLevel(), terrain.thunderLevel());
}
Vector3f fromWind = MathUtils.compassDirection(sky.windFromDegrees);
Vector3f flow = new Vector3f(fromWind).negate();
float speedFactor = 1.0f;
float exposureSignal = 0.0f;
float slopeAlongFlow = 0.0f;
if (terrain != null) {
float h0 = terrain.heightAt(x, z);
float hNear = terrain.heightAt(x + fromWind.x * params.upwindNearMeters, z + fromWind.z * params.upwindNearMeters);
float hMid = terrain.heightAt(x + fromWind.x * params.upwindMidMeters, z + fromWind.z * params.upwindMidMeters);
float hFar = terrain.heightAt(x + fromWind.x * params.upwindFarMeters, z + fromWind.z * params.upwindFarMeters);
float relief = Math.max(1.0f, params.exposureReliefMeters);
float shelter = Math.max(
MathUtils.clamp01((hNear - h0) / relief),
Math.max(MathUtils.clamp01((hMid - h0) / relief), MathUtils.clamp01((hFar - h0) / relief))
);
float dominance = Math.min(
MathUtils.clamp01((h0 - hNear) / relief),
Math.min(MathUtils.clamp01((h0 - hMid) / relief), MathUtils.clamp01((h0 - hFar) / relief))
);
exposureSignal = MathUtils.clamp(dominance - shelter, -1.0f, 1.0f);
speedFactor = 1.0f + (exposureSignal > 0.0f ? exposureSignal * params.exposureWindGain : exposureSignal * params.shelterWindReduction);
// Venturi
Vector3f lateral = new Vector3f(flow.z, 0.0f, -flow.x);
float hLeft = terrain.heightAt(x + lateral.x * params.lateralMeters, z + lateral.z * params.lateralMeters);
float hRight = terrain.heightAt(x - lateral.x * params.lateralMeters, z - lateral.z * params.lateralMeters);
float gap = Math.min(hLeft, hRight) - h0;
float venturiSignal = MathUtils.clamp01(gap / Math.max(1.0f, params.venturiReliefMeters));
float venturiWeight = MathUtils.clamp01(0.5f + 0.5f * exposureSignal);
speedFactor *= 1.0f + params.venturiWindGain * venturiSignal * venturiWeight;
slopeAlongFlow = (h0 - hNear) / Math.max(1.0f, params.upwindNearMeters);
}
out.windMps = MathUtils.clamp(referenceWind * speedFactor, 0.0f, params.maxLocalWindMps);
out.windVector = new Vector3f(flow).mul(out.windMps);
// 3. Composantes Verticales
if (slopeAlongFlow > 0.0f) {
out.ridgeLiftMps = Math.min(params.maxRidgeLiftMps, params.ridgeLiftEfficiency * slopeAlongFlow * out.windMps);
}
float leeFactor = MathUtils.clamp01(-exposureSignal);
float windIntensity = MathUtils.clamp01(referenceWind / Math.max(1.0f, params.turbulenceFullWindMps));
out.subsidenceMps = params.leeSubsidenceMps * leeFactor * windIntensity;
out.turbulence = MathUtils.clamp01(params.leeTurbulenceMax * leeFactor * windIntensity);
// Thermiques
float incidence = (sky.daylight > 0.0f) ? Math.max(0.0f, normal.dot(sky.sunDirection)) : 0.0f;
if (sky.daylight > 0.0f && incidence > 0.0f) {
float hourOffset = (sky.timeOfDayHours - params.thermalPeakHour) / Math.max(0.5f, params.thermalHalfWidthHours);
float timeWindow = Math.max(0.0f, 1.0f - hourOffset * hourOffset);
float cloudFactor = 1.0f - params.cloudThermalDamping * sky.cloudCover;
out.thermalMps = params.thermalMaxMps * incidence * timeWindow * Math.max(0.0f, cloudFactor);
}
out.verticalMps = out.ridgeLiftMps + out.thermalMps + out.subsidenceMps;
// 4. Précipitations Orographiques & Sol
float orographicSignal = MathUtils.clamp01(slopeAlongFlow / Math.max(1e-3f, params.orographicFullSlope));
float orographic = (1.0f + params.orographicGain * orographicSignal) * (1.0f + params.precipitationAltitudeGainPerKm * altitudeKm);
out.precipitationMmPerHour = Math.max(0.0f, sky.precipitationMmPerHour * orographic);
out.cloudCover = MathUtils.clamp01(sky.cloudCover + params.orographicCloudGain * orographicSignal);
out.temperatureC = sky.seaLevelTemperatureC + out.lapseC + out.aspectC;
out.inversionC = 0.0f; // Piégeage local si terrain analysé
out.snowing = out.precipitationMmPerHour > 0.05f && out.temperatureC <= params.snowThresholdC;
out.wetness = groundWetness(sky.gameHours, y, orographic);
out.windChillC = MathUtils.windChillC(out.temperatureC, out.windMps);
return out;
}
public float groundWetness(float gameHours, float altitudeMeters, float orographicFactor) {
float now = MathUtils.safeFinite(gameHours, 0.0f);
int samples = Math.max(1, Math.min(32, params.wetnessSamples));
float window = Math.max(0.1f, params.wetnessMemoryHours);
float drying = Math.max(0.1f, params.dryingTimeHours);
float oro = Math.max(0.0f, MathUtils.safeFinite(orographicFactor, 1.0f));
float altitudeKm = (MathUtils.safeFinite(altitudeMeters, params.seaLevelAltitudeBlocks) - params.seaLevelAltitudeBlocks) / 1000.0f;
float altitudeGain = 1.0f + params.precipitationAltitudeGainPerKm * altitudeKm;
float wettest = 0.0f;
for (int i = 0; i < samples; ++i) {
float age = window * (i + 0.5f) / (float) samples;
SynopticState past = synopticAt(now - age);
float precip = past.precipitationMmPerHour * oro * altitudeGain;
float soaked = MathUtils.clamp01(precip / Math.max(0.01f, params.wetnessSaturationMmPerHour));
float dried = (float) Math.exp(-age / drying);
wettest = Math.max(wettest, soaked * dried);
}
return MathUtils.clamp01(wettest);
}
// =======================================================================
// MODULE DE PRÉDICTION MÉTÉOROLOGIQUE (Fonction pure & déterministe)
// =======================================================================
public record HourlyForecast(float gameHours, float timeOfDayHours, float temperatureC, float windKmh, float precipitationMm, float cloudPercent, boolean willRain, boolean willSnow) {}
public List<HourlyForecast> predictHourlyForecast(float currentHours, int hoursAhead, Vector3f pos, HeightSampler terrain) {
List<HourlyForecast> list = new ArrayList<>(hoursAhead);
for (int h = 0; h <= hoursAhead; h++) {
float t = currentHours + h;
WeatherSample sample = sampleAt(pos, t, h == 0 ? terrain : withoutVanillaWeather(terrain));
SynopticState sky = synopticAt(t);
list.add(new HourlyForecast(
t,
sky.timeOfDayHours,
sample.temperatureC,
sample.getWindSpeedKmh(),
sample.precipitationMmPerHour,
sample.cloudCover * 100.0f,
sample.precipitationMmPerHour > 0.05f && !sample.snowing,
sample.snowing
));
}
return list;
}
public record DailyForecast(int dayNumber, float minTempC, float maxTempC, float maxWindKmh, float totalRainMm, float maxCloudPercent, boolean hasRain, boolean hasSnow) {}
public List<DailyForecast> predictDailyForecast(float currentHours, int daysAhead, Vector3f pos, HeightSampler terrain) {
List<DailyForecast> list = new ArrayList<>(daysAhead);
int currentDay = (int) (currentHours / 24.0f);
HeightSampler calm = withoutVanillaWeather(terrain);
for (int d = 0; d < daysAhead; d++) {
int targetDay = currentDay + d;
float minT = 999.0f;
float maxT = -999.0f;
float maxWind = 0.0f;
float totalRain = 0.0f;
float maxCloud = 0.0f;
boolean hasRain = false;
boolean hasSnow = false;
for (int h = 0; h < 24; h += 2) {
float t = targetDay * 24.0f + h;
WeatherSample s = sampleAt(pos, t, calm);
minT = Math.min(minT, s.temperatureC);
maxT = Math.max(maxT, s.temperatureC);
maxWind = Math.max(maxWind, s.getWindSpeedKmh());
maxCloud = Math.max(maxCloud, s.cloudCover * 100.0f);
if (s.precipitationMmPerHour > 0.05f) {
totalRain += s.precipitationMmPerHour * 2.0f;
if (s.snowing) hasSnow = true;
else hasRain = true;
}
}
list.add(new DailyForecast(targetDay, minT, maxT, maxWind, totalRain, maxCloud, hasRain, hasSnow));
}
return list;
}
}
+24
Voir le fichier
@@ -0,0 +1,24 @@
modLoader="javafml"
loaderVersion="[1,)"
license="MIT"
[[mods]]
modId="gastinelweather"
version="1.0.0"
displayName="GastinelWeatherMod"
authors="Théo Gastinel"
description='''Système météo réaliste et déterministe avec prédictions météorologiques, vent 3D, thermiques, adret/ubac et microclimats.'''
[[dependencies.gastinelweather]]
modId="neoforge"
type="required"
versionRange="[21.1,)"
ordering="NONE"
side="BOTH"
[[dependencies.gastinelweather]]
modId="minecraft"
type="required"
versionRange="[1.21.1,1.21.2)"
ordering="NONE"
side="BOTH"
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/anemometer"
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/coal_generator"
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=north": {
"model": "gastinelweather:block/directional_antenna"
},
"facing=south": {
"model": "gastinelweather:block/directional_antenna",
"y": 180
},
"facing=east": {
"model": "gastinelweather:block/directional_antenna",
"y": 90
},
"facing=west": {
"model": "gastinelweather:block/directional_antenna",
"y": 270
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/electric_cable"
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/esp32_board"
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/exhaust_chimney"
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/hydro_turbine"
}
}
}
+19
Voir le fichier
@@ -0,0 +1,19 @@
{
"variants": {
"facing=north": {
"model": "gastinelweather:block/monitor"
},
"facing=south": {
"model": "gastinelweather:block/monitor",
"y": 180
},
"facing=east": {
"model": "gastinelweather:block/monitor",
"y": 90
},
"facing=west": {
"model": "gastinelweather:block/monitor",
"y": 270
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/network_cable"
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/network_router"
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/omni_antenna"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/outdoor_network_cable"
}
}
}
+19
Voir le fichier
@@ -0,0 +1,19 @@
{
"variants": {
"facing=north": {
"model": "gastinelweather:block/pc_case"
},
"facing=south": {
"model": "gastinelweather:block/pc_case",
"y": 180
},
"facing=east": {
"model": "gastinelweather:block/pc_case",
"y": 90
},
"facing=west": {
"model": "gastinelweather:block/pc_case",
"y": 270
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/rain_gauge"
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/snow_gauge"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/ultrasonic_anemometer"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/underground_electric_cable"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/underground_network_cable"
}
}
}
+19
Voir le fichier
@@ -0,0 +1,19 @@
{
"variants": {
"facing=north": {
"model": "gastinelweather:block/vp2_console"
},
"facing=south": {
"model": "gastinelweather:block/vp2_console",
"y": 180
},
"facing=east": {
"model": "gastinelweather:block/vp2_console",
"y": 90
},
"facing=west": {
"model": "gastinelweather:block/vp2_console",
"y": 270
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/vp2_station"
}
}
}
+7
Voir le fichier
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "gastinelweather:block/wind_turbine"
}
}
}
+37
Voir le fichier
@@ -0,0 +1,37 @@
{
"itemGroup.gastinelweather.weather_tech_tab": "Gastinel Weather & Tech",
"item.gastinelweather.elitech_logger": "Elitech Weather Logger",
"item.gastinelweather.motherboard": "Motherboard",
"item.gastinelweather.cpu": "CPU",
"item.gastinelweather.cpu_cooler": "CPU Cooler",
"item.gastinelweather.gpu": "Graphics Card (GPU)",
"item.gastinelweather.power_supply": "Power Supply (PSU)",
"item.gastinelweather.power_cable": "Power Cable",
"item.gastinelweather.transistor": "Transistor",
"block.gastinelweather.vp2_station": "Vantage Pro 2 Weather Station (VP2)",
"block.gastinelweather.anemometer": "Cup Anemometer",
"block.gastinelweather.ultrasonic_anemometer": "Ultrasonic Anemometer (3D)",
"block.gastinelweather.rain_gauge": "Tipping Bucket Rain Gauge",
"block.gastinelweather.snow_gauge": "Laser Snow Gauge",
"block.gastinelweather.esp32_board": "ESP32 Microcontroller Board",
"block.gastinelweather.directional_antenna": "Directional Antenna (Yagi)",
"block.gastinelweather.omni_antenna": "360° Omnidirectional Antenna",
"block.gastinelweather.vp2_console": "VP2 Receiver Console",
"block.gastinelweather.pc_case": "Weather Server / PC Case",
"block.gastinelweather.monitor": "Weather Monitor Display",
"block.gastinelweather.network_router": "Network Box / Router",
"block.gastinelweather.network_cable": "Network Cable (Indoor)",
"block.gastinelweather.outdoor_network_cable": "Outdoor Network Cable",
"block.gastinelweather.underground_network_cable": "Underground Network Cable",
"block.gastinelweather.wind_turbine": "Aerodynamic Wind Turbine",
"block.gastinelweather.hydro_turbine": "Submerged Hydro Turbine",
"block.gastinelweather.coal_generator": "Coal Power Generator",
"block.gastinelweather.exhaust_chimney": "Exhaust Chimney",
"block.gastinelweather.electric_cable": "Electric Cable",
"block.gastinelweather.underground_electric_cable": "Underground Electric Cable"
}
+37
Voir le fichier
@@ -0,0 +1,37 @@
{
"itemGroup.gastinelweather.weather_tech_tab": "Gastinel Weather & Tech",
"item.gastinelweather.elitech_logger": "Enregistreur Météo Elitech",
"item.gastinelweather.motherboard": "Carte Mère Informatique",
"item.gastinelweather.cpu": "Processeur (CPU)",
"item.gastinelweather.cpu_cooler": "Ventirad CPU",
"item.gastinelweather.gpu": "Carte Graphique (GPU)",
"item.gastinelweather.power_supply": "Alimentation PC (PSU)",
"item.gastinelweather.power_cable": "Câble d'Alimentation 230V",
"item.gastinelweather.transistor": "Transistor Électronique",
"block.gastinelweather.vp2_station": "Station Météo Vantage Pro 2 (VP2)",
"block.gastinelweather.anemometer": "Anémomètre à Coupelles",
"block.gastinelweather.ultrasonic_anemometer": "Anémomètre à Ultrasons (3D)",
"block.gastinelweather.rain_gauge": "Pluviomètre à Augets",
"block.gastinelweather.snow_gauge": "Niveomètre Laser",
"block.gastinelweather.esp32_board": "Carte Microcontrôleur ESP32",
"block.gastinelweather.directional_antenna": "Antenne Dirigeable (Yagi)",
"block.gastinelweather.omni_antenna": "Antenne 360° Omnidirectionnelle",
"block.gastinelweather.vp2_console": "Console Réceptrice VP2",
"block.gastinelweather.pc_case": "Boîtier / Tour PC Météo",
"block.gastinelweather.monitor": "Écran Moniteur Météo",
"block.gastinelweather.network_router": "Box / Routeur Réseau",
"block.gastinelweather.network_cable": "Câble Réseau (Intérieur)",
"block.gastinelweather.outdoor_network_cable": "Câble Réseau Extérieur (Anti-UV)",
"block.gastinelweather.underground_network_cable": "Câble Réseau Extérieur Souterrain",
"block.gastinelweather.wind_turbine": "Générateur Éolien Aérodynamique",
"block.gastinelweather.hydro_turbine": "Hydrolienne Immergée (Hélice pour l'eau)",
"block.gastinelweather.coal_generator": "Centrale Thermique à Charbon",
"block.gastinelweather.exhaust_chimney": "Cheminée d'Évacuation",
"block.gastinelweather.electric_cable": "Câble Électrique",
"block.gastinelweather.underground_electric_cable": "Câble Électrique Souterrain"
}
+253
Voir le fichier
@@ -0,0 +1,253 @@
{
"textures": {
"particle": "gastinelweather:block/anemometer",
"texture": "gastinelweather:block/anemometer"
},
"elements": [
{
"faces": {
"north": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
},
"south": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
},
"west": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
},
"up": {
"uv": [
7,
7,
9,
9
],
"texture": "#texture"
},
"east": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
}
},
"from": [
7,
0,
7
],
"to": [
9,
12,
9
]
},
{
"faces": {
"down": {
"uv": [
3,
3,
13,
5
],
"texture": "#texture"
},
"north": {
"uv": [
3,
3,
13,
5
],
"texture": "#texture"
},
"south": {
"uv": [
3,
3,
13,
5
],
"texture": "#texture"
},
"up": {
"uv": [
3,
3,
13,
5
],
"texture": "#texture"
}
},
"from": [
2,
12,
7
],
"to": [
14,
14,
9
]
},
{
"faces": {
"north": {
"uv": [
2,
2,
4,
5
],
"texture": "#texture"
},
"west": {
"uv": [
2,
2,
4,
5
],
"texture": "#texture"
},
"south": {
"uv": [
2,
2,
4,
5
],
"texture": "#texture"
},
"up": {
"uv": [
2,
2,
4,
5
],
"texture": "#texture"
},
"east": {
"uv": [
2,
2,
4,
5
],
"texture": "#texture"
},
"down": {
"uv": [
2,
2,
4,
5
],
"texture": "#texture"
}
},
"from": [
1,
11,
6
],
"to": [
3,
15,
10
]
},
{
"faces": {
"north": {
"uv": [
12,
2,
14,
5
],
"texture": "#texture"
},
"west": {
"uv": [
12,
2,
14,
5
],
"texture": "#texture"
},
"south": {
"uv": [
12,
2,
14,
5
],
"texture": "#texture"
},
"up": {
"uv": [
12,
2,
14,
5
],
"texture": "#texture"
},
"east": {
"uv": [
12,
2,
14,
5
],
"texture": "#texture"
},
"down": {
"uv": [
12,
2,
14,
5
],
"texture": "#texture"
}
},
"from": [
13,
11,
6
],
"to": [
15,
15,
10
]
}
]
}
+76
Voir le fichier
@@ -0,0 +1,76 @@
{
"textures": {
"particle": "gastinelweather:block/coal_generator",
"texture": "gastinelweather:block/coal_generator"
},
"elements": [
{
"faces": {
"north": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"west": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"south": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"up": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"east": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"down": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
}
},
"from": [
0,
0,
0
],
"to": [
16,
16,
16
]
}
]
}
+236
Voir le fichier
@@ -0,0 +1,236 @@
{
"textures": {
"particle": "gastinelweather:block/directional_antenna",
"texture": "gastinelweather:block/directional_antenna"
},
"elements": [
{
"faces": {
"north": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
},
"south": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
},
"west": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
},
"east": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
}
},
"from": [
7,
0,
7
],
"to": [
9,
16,
9
]
},
{
"faces": {
"down": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
},
"north": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
},
"south": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
},
"up": {
"uv": [
7,
2,
9,
14
],
"texture": "#texture"
}
},
"from": [
7,
8,
1
],
"to": [
9,
10,
15
]
},
{
"faces": {
"south": {
"uv": [
2,
3,
14,
5
],
"texture": "#texture"
},
"north": {
"uv": [
2,
3,
14,
5
],
"texture": "#texture"
}
},
"from": [
1,
8,
2
],
"to": [
15,
10,
3
]
},
{
"faces": {
"south": {
"uv": [
3,
6,
13,
8
],
"texture": "#texture"
},
"north": {
"uv": [
3,
6,
13,
8
],
"texture": "#texture"
}
},
"from": [
3,
8,
6
],
"to": [
13,
10,
7
]
},
{
"faces": {
"south": {
"uv": [
4,
9,
12,
11
],
"texture": "#texture"
},
"north": {
"uv": [
4,
9,
12,
11
],
"texture": "#texture"
}
},
"from": [
4,
8,
10
],
"to": [
12,
10,
11
]
},
{
"faces": {
"south": {
"uv": [
5,
12,
11,
14
],
"texture": "#texture"
},
"north": {
"uv": [
5,
12,
11,
14
],
"texture": "#texture"
}
},
"from": [
5,
8,
14
],
"to": [
11,
10,
15
]
}
]
}
+76
Voir le fichier
@@ -0,0 +1,76 @@
{
"textures": {
"particle": "gastinelweather:block/electric_cable",
"texture": "gastinelweather:block/electric_cable"
},
"elements": [
{
"faces": {
"north": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"west": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"south": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"up": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"east": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"down": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
}
},
"from": [
5,
5,
5
],
"to": [
11,
11,
11
]
}
]
}
+76
Voir le fichier
@@ -0,0 +1,76 @@
{
"textures": {
"particle": "gastinelweather:block/esp32_board",
"texture": "gastinelweather:block/esp32_board"
},
"elements": [
{
"faces": {
"north": {
"uv": [
2,
2,
14,
4
],
"texture": "#texture"
},
"west": {
"uv": [
2,
2,
14,
4
],
"texture": "#texture"
},
"south": {
"uv": [
2,
2,
14,
4
],
"texture": "#texture"
},
"up": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"east": {
"uv": [
2,
2,
14,
4
],
"texture": "#texture"
},
"down": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
}
},
"from": [
3,
0,
3
],
"to": [
13,
2,
13
]
}
]
}
+76
Voir le fichier
@@ -0,0 +1,76 @@
{
"textures": {
"particle": "gastinelweather:block/exhaust_chimney",
"texture": "gastinelweather:block/exhaust_chimney"
},
"elements": [
{
"faces": {
"north": {
"uv": [
2,
0,
14,
16
],
"texture": "#texture"
},
"west": {
"uv": [
2,
0,
14,
16
],
"texture": "#texture"
},
"south": {
"uv": [
2,
0,
14,
16
],
"texture": "#texture"
},
"up": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"east": {
"uv": [
2,
0,
14,
16
],
"texture": "#texture"
},
"down": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
}
},
"from": [
2,
0,
2
],
"to": [
14,
16,
14
]
}
]
}
+76
Voir le fichier
@@ -0,0 +1,76 @@
{
"textures": {
"particle": "gastinelweather:block/hydro_turbine",
"texture": "gastinelweather:block/hydro_turbine"
},
"elements": [
{
"faces": {
"north": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"west": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"south": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"up": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"east": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"down": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
}
},
"from": [
2,
0,
2
],
"to": [
14,
16,
14
]
}
]
}
+176
Voir le fichier
@@ -0,0 +1,176 @@
{
"textures": {
"particle": "gastinelweather:block/monitor",
"texture": "gastinelweather:block/monitor"
},
"elements": [
{
"faces": {
"down": {
"uv": [
5,
12,
11,
15
],
"texture": "#texture"
},
"north": {
"uv": [
5,
12,
11,
15
],
"texture": "#texture"
},
"south": {
"uv": [
5,
12,
11,
15
],
"texture": "#texture"
},
"up": {
"uv": [
5,
12,
11,
15
],
"texture": "#texture"
}
},
"from": [
5,
0,
5
],
"to": [
11,
2,
11
]
},
{
"faces": {
"north": {
"uv": [
7,
10,
9,
14
],
"texture": "#texture"
},
"south": {
"uv": [
7,
10,
9,
14
],
"texture": "#texture"
},
"west": {
"uv": [
7,
10,
9,
14
],
"texture": "#texture"
},
"east": {
"uv": [
7,
10,
9,
14
],
"texture": "#texture"
}
},
"from": [
7,
2,
7
],
"to": [
9,
6,
9
]
},
{
"faces": {
"north": {
"uv": [
1,
1,
15,
11
],
"texture": "#texture"
},
"west": {
"uv": [
1,
1,
15,
11
],
"texture": "#texture"
},
"south": {
"uv": [
1,
1,
15,
11
],
"texture": "#texture"
},
"up": {
"uv": [
1,
1,
15,
3
],
"texture": "#texture"
},
"east": {
"uv": [
1,
1,
15,
11
],
"texture": "#texture"
},
"down": {
"uv": [
1,
1,
15,
3
],
"texture": "#texture"
}
},
"from": [
1,
5,
6
],
"to": [
15,
15,
8
]
}
]
}
+76
Voir le fichier
@@ -0,0 +1,76 @@
{
"textures": {
"particle": "gastinelweather:block/network_cable",
"texture": "gastinelweather:block/network_cable"
},
"elements": [
{
"faces": {
"north": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"west": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"south": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"up": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"east": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"down": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
}
},
"from": [
5,
5,
5
],
"to": [
11,
11,
11
]
}
]
}
+176
Voir le fichier
@@ -0,0 +1,176 @@
{
"textures": {
"particle": "gastinelweather:block/network_router",
"texture": "gastinelweather:block/network_router"
},
"elements": [
{
"faces": {
"north": {
"uv": [
2,
6,
14,
14
],
"texture": "#texture"
},
"west": {
"uv": [
2,
6,
14,
14
],
"texture": "#texture"
},
"south": {
"uv": [
2,
6,
14,
14
],
"texture": "#texture"
},
"up": {
"uv": [
2,
6,
14,
14
],
"texture": "#texture"
},
"east": {
"uv": [
2,
6,
14,
14
],
"texture": "#texture"
},
"down": {
"uv": [
2,
6,
14,
14
],
"texture": "#texture"
}
},
"from": [
2,
0,
4
],
"to": [
14,
4,
12
]
},
{
"faces": {
"north": {
"uv": [
3,
1,
4,
6
],
"texture": "#texture"
},
"south": {
"uv": [
3,
1,
4,
6
],
"texture": "#texture"
},
"west": {
"uv": [
3,
1,
4,
6
],
"texture": "#texture"
},
"east": {
"uv": [
3,
1,
4,
6
],
"texture": "#texture"
}
},
"from": [
3,
4,
11
],
"to": [
4,
12,
12
]
},
{
"faces": {
"north": {
"uv": [
12,
1,
13,
6
],
"texture": "#texture"
},
"south": {
"uv": [
12,
1,
13,
6
],
"texture": "#texture"
},
"west": {
"uv": [
12,
1,
13,
6
],
"texture": "#texture"
},
"east": {
"uv": [
12,
1,
13,
6
],
"texture": "#texture"
}
},
"from": [
12,
4,
11
],
"to": [
13,
12,
12
]
}
]
}
+117
Voir le fichier
@@ -0,0 +1,117 @@
{
"textures": {
"particle": "gastinelweather:block/omni_antenna",
"texture": "gastinelweather:block/omni_antenna"
},
"elements": [
{
"faces": {
"north": {
"uv": [
6,
12,
10,
16
],
"texture": "#texture"
},
"south": {
"uv": [
6,
12,
10,
16
],
"texture": "#texture"
},
"west": {
"uv": [
6,
12,
10,
16
],
"texture": "#texture"
},
"east": {
"uv": [
6,
12,
10,
16
],
"texture": "#texture"
}
},
"from": [
6,
0,
6
],
"to": [
10,
4,
10
]
},
{
"faces": {
"north": {
"uv": [
7,
0,
9,
12
],
"texture": "#texture"
},
"south": {
"uv": [
7,
0,
9,
12
],
"texture": "#texture"
},
"west": {
"uv": [
7,
0,
9,
12
],
"texture": "#texture"
},
"up": {
"uv": [
7,
0,
9,
2
],
"texture": "#texture"
},
"east": {
"uv": [
7,
0,
9,
12
],
"texture": "#texture"
}
},
"from": [
7,
4,
7
],
"to": [
9,
16,
9
]
}
]
}
@@ -0,0 +1,76 @@
{
"textures": {
"particle": "gastinelweather:block/outdoor_network_cable",
"texture": "gastinelweather:block/outdoor_network_cable"
},
"elements": [
{
"faces": {
"north": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"west": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"south": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"up": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"east": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"down": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
}
},
"from": [
5,
5,
5
],
"to": [
11,
11,
11
]
}
]
}
+76
Voir le fichier
@@ -0,0 +1,76 @@
{
"textures": {
"particle": "gastinelweather:block/pc_case",
"texture": "gastinelweather:block/pc_case"
},
"elements": [
{
"faces": {
"north": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"west": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"south": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"up": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"east": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"down": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
}
},
"from": [
3,
0,
1
],
"to": [
13,
15,
15
]
}
]
}
+126
Voir le fichier
@@ -0,0 +1,126 @@
{
"textures": {
"particle": "gastinelweather:block/rain_gauge",
"texture": "gastinelweather:block/rain_gauge"
},
"elements": [
{
"faces": {
"down": {
"uv": [
4,
4,
12,
12
],
"texture": "#texture"
},
"north": {
"uv": [
4,
2,
12,
12
],
"texture": "#texture"
},
"south": {
"uv": [
4,
2,
12,
12
],
"texture": "#texture"
},
"west": {
"uv": [
4,
2,
12,
12
],
"texture": "#texture"
},
"east": {
"uv": [
4,
2,
12,
12
],
"texture": "#texture"
}
},
"from": [
4,
0,
4
],
"to": [
12,
10,
12
]
},
{
"faces": {
"north": {
"uv": [
3,
1,
13,
3
],
"texture": "#texture"
},
"south": {
"uv": [
3,
1,
13,
3
],
"texture": "#texture"
},
"west": {
"uv": [
3,
1,
13,
3
],
"texture": "#texture"
},
"up": {
"uv": [
3,
1,
13,
3
],
"texture": "#texture"
},
"east": {
"uv": [
3,
1,
13,
3
],
"texture": "#texture"
}
},
"from": [
3,
10,
3
],
"to": [
13,
14,
13
]
}
]
}
+108
Voir le fichier
@@ -0,0 +1,108 @@
{
"textures": {
"particle": "gastinelweather:block/snow_gauge",
"texture": "gastinelweather:block/snow_gauge"
},
"elements": [
{
"faces": {
"north": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
},
"south": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
},
"west": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
},
"east": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
}
},
"from": [
6,
0,
6
],
"to": [
10,
16,
10
]
},
{
"faces": {
"down": {
"uv": [
4,
2,
8,
4
],
"texture": "#texture"
},
"north": {
"uv": [
4,
2,
8,
4
],
"texture": "#texture"
},
"south": {
"uv": [
4,
2,
8,
4
],
"texture": "#texture"
},
"up": {
"uv": [
4,
2,
8,
4
],
"texture": "#texture"
}
},
"from": [
2,
13,
6
],
"to": [
6,
15,
10
]
}
]
}
@@ -0,0 +1,344 @@
{
"textures": {
"particle": "gastinelweather:block/ultrasonic_anemometer",
"texture": "gastinelweather:block/ultrasonic_anemometer"
},
"elements": [
{
"faces": {
"north": {
"uv": [
4,
10,
12,
15
],
"texture": "#texture"
},
"west": {
"uv": [
4,
10,
12,
15
],
"texture": "#texture"
},
"south": {
"uv": [
4,
10,
12,
15
],
"texture": "#texture"
},
"up": {
"uv": [
4,
4,
12,
12
],
"texture": "#texture"
},
"east": {
"uv": [
4,
10,
12,
15
],
"texture": "#texture"
},
"down": {
"uv": [
4,
4,
12,
12
],
"texture": "#texture"
}
},
"from": [
5,
0,
5
],
"to": [
11,
4,
11
]
},
{
"faces": {
"north": {
"uv": [
4,
2,
6,
10
],
"texture": "#texture"
},
"south": {
"uv": [
4,
2,
6,
10
],
"texture": "#texture"
},
"west": {
"uv": [
4,
2,
6,
10
],
"texture": "#texture"
},
"east": {
"uv": [
4,
2,
6,
10
],
"texture": "#texture"
}
},
"from": [
4,
4,
4
],
"to": [
5,
12,
5
]
},
{
"faces": {
"north": {
"uv": [
10,
2,
12,
10
],
"texture": "#texture"
},
"south": {
"uv": [
10,
2,
12,
10
],
"texture": "#texture"
},
"west": {
"uv": [
10,
2,
12,
10
],
"texture": "#texture"
},
"east": {
"uv": [
10,
2,
12,
10
],
"texture": "#texture"
}
},
"from": [
11,
4,
4
],
"to": [
12,
12,
5
]
},
{
"faces": {
"north": {
"uv": [
4,
2,
6,
10
],
"texture": "#texture"
},
"south": {
"uv": [
4,
2,
6,
10
],
"texture": "#texture"
},
"west": {
"uv": [
4,
2,
6,
10
],
"texture": "#texture"
},
"east": {
"uv": [
4,
2,
6,
10
],
"texture": "#texture"
}
},
"from": [
4,
4,
11
],
"to": [
5,
12,
12
]
},
{
"faces": {
"north": {
"uv": [
10,
2,
12,
10
],
"texture": "#texture"
},
"south": {
"uv": [
10,
2,
12,
10
],
"texture": "#texture"
},
"west": {
"uv": [
10,
2,
12,
10
],
"texture": "#texture"
},
"east": {
"uv": [
10,
2,
12,
10
],
"texture": "#texture"
}
},
"from": [
11,
4,
11
],
"to": [
12,
12,
12
]
},
{
"faces": {
"north": {
"uv": [
5,
1,
11,
3
],
"texture": "#texture"
},
"west": {
"uv": [
5,
1,
11,
3
],
"texture": "#texture"
},
"south": {
"uv": [
5,
1,
11,
3
],
"texture": "#texture"
},
"up": {
"uv": [
5,
1,
11,
3
],
"texture": "#texture"
},
"east": {
"uv": [
5,
1,
11,
3
],
"texture": "#texture"
},
"down": {
"uv": [
5,
1,
11,
3
],
"texture": "#texture"
}
},
"from": [
4,
12,
4
],
"to": [
12,
14,
12
]
}
]
}
@@ -0,0 +1,76 @@
{
"textures": {
"particle": "gastinelweather:block/underground_electric_cable",
"texture": "gastinelweather:block/underground_electric_cable"
},
"elements": [
{
"faces": {
"north": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"west": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"south": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"up": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"east": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"down": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
}
},
"from": [
5,
5,
5
],
"to": [
11,
11,
11
]
}
]
}
@@ -0,0 +1,76 @@
{
"textures": {
"particle": "gastinelweather:block/underground_network_cable",
"texture": "gastinelweather:block/underground_network_cable"
},
"elements": [
{
"faces": {
"north": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"west": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"south": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"up": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"east": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
},
"down": {
"uv": [
5,
5,
11,
11
],
"texture": "#texture"
}
},
"from": [
5,
5,
5
],
"to": [
11,
11,
11
]
}
]
}
+76
Voir le fichier
@@ -0,0 +1,76 @@
{
"textures": {
"particle": "gastinelweather:block/vp2_console",
"texture": "gastinelweather:block/vp2_console"
},
"elements": [
{
"faces": {
"north": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"west": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"south": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"up": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"east": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
},
"down": {
"uv": [
1,
1,
15,
15
],
"texture": "#texture"
}
},
"from": [
2,
0,
2
],
"to": [
14,
8,
14
]
}
]
}
+212
Voir le fichier
@@ -0,0 +1,212 @@
{
"textures": {
"particle": "gastinelweather:block/vp2_station",
"texture": "gastinelweather:block/vp2_station"
},
"elements": [
{
"faces": {
"north": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
},
"west": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
},
"south": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
},
"up": {
"uv": [
7,
7,
9,
9
],
"texture": "#texture"
},
"east": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
},
"down": {
"uv": [
7,
7,
9,
9
],
"texture": "#texture"
}
},
"from": [
7,
0,
7
],
"to": [
9,
16,
9
]
},
{
"faces": {
"north": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"west": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"south": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"up": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"east": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
},
"down": {
"uv": [
2,
2,
14,
14
],
"texture": "#texture"
}
},
"from": [
4,
4,
4
],
"to": [
12,
10,
12
]
},
{
"faces": {
"north": {
"uv": [
4,
2,
12,
12
],
"texture": "#texture"
},
"west": {
"uv": [
4,
2,
12,
12
],
"texture": "#texture"
},
"south": {
"uv": [
4,
2,
12,
12
],
"texture": "#texture"
},
"up": {
"uv": [
4,
2,
12,
12
],
"texture": "#texture"
},
"east": {
"uv": [
4,
2,
12,
12
],
"texture": "#texture"
},
"down": {
"uv": [
4,
2,
12,
12
],
"texture": "#texture"
}
},
"from": [
9,
8,
7
],
"to": [
15,
14,
13
]
}
]
}
+126
Voir le fichier
@@ -0,0 +1,126 @@
{
"textures": {
"particle": "gastinelweather:block/wind_turbine",
"texture": "gastinelweather:block/wind_turbine"
},
"elements": [
{
"faces": {
"north": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
},
"south": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
},
"west": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
},
"east": {
"uv": [
7,
0,
9,
16
],
"texture": "#texture"
}
},
"from": [
6,
0,
6
],
"to": [
10,
16,
10
]
},
{
"faces": {
"north": {
"uv": [
5,
4,
11,
8
],
"texture": "#texture"
},
"west": {
"uv": [
5,
4,
11,
8
],
"texture": "#texture"
},
"south": {
"uv": [
5,
4,
11,
8
],
"texture": "#texture"
},
"up": {
"uv": [
5,
4,
11,
8
],
"texture": "#texture"
},
"east": {
"uv": [
5,
4,
11,
8
],
"texture": "#texture"
},
"down": {
"uv": [
5,
4,
11,
8
],
"texture": "#texture"
}
},
"from": [
4,
10,
4
],
"to": [
12,
14,
12
]
}
]
}
+3
Voir le fichier
@@ -0,0 +1,3 @@
{
"parent": "gastinelweather:block/anemometer"
}
+3
Voir le fichier
@@ -0,0 +1,3 @@
{
"parent": "gastinelweather:block/coal_generator"
}
+6
Voir le fichier
@@ -0,0 +1,6 @@
{
"textures": {
"layer0": "gastinelweather:item/cpu"
},
"parent": "minecraft:item/generated"
}
+6
Voir le fichier
@@ -0,0 +1,6 @@
{
"textures": {
"layer0": "gastinelweather:item/cpu_cooler"
},
"parent": "minecraft:item/generated"
}
@@ -0,0 +1,3 @@
{
"parent": "gastinelweather:block/directional_antenna"
}
+3
Voir le fichier
@@ -0,0 +1,3 @@
{
"parent": "gastinelweather:block/electric_cable"
}
+6
Voir le fichier
@@ -0,0 +1,6 @@
{
"textures": {
"layer0": "gastinelweather:item/elitech_logger"
},
"parent": "minecraft:item/generated"
}
+3
Voir le fichier
@@ -0,0 +1,3 @@
{
"parent": "gastinelweather:block/esp32_board"
}
+3
Voir le fichier
@@ -0,0 +1,3 @@
{
"parent": "gastinelweather:block/exhaust_chimney"
}
+6
Voir le fichier
@@ -0,0 +1,6 @@
{
"textures": {
"layer0": "gastinelweather:item/gpu"
},
"parent": "minecraft:item/generated"
}
+3
Voir le fichier
@@ -0,0 +1,3 @@
{
"parent": "gastinelweather:block/hydro_turbine"
}
+3
Voir le fichier
@@ -0,0 +1,3 @@
{
"parent": "gastinelweather:block/monitor"
}
Affichage de 100 fichiers sur 175. Ce diff contient trop de modifications pour tout afficher. Voir plus