First release.

This commit is contained in:
Motschen
2020-07-06 19:34:31 +02:00
parent 8ef5626cdc
commit 80dd9ebd59
618 changed files with 29639 additions and 0 deletions

25
.gitignore vendored Normal file
View File

@@ -0,0 +1,25 @@
# gradle
.gradle/
build/
out/
classes/
# idea
.idea/
*.iml
*.ipr
*.iws
# vscode
.settings/
.vscode/
bin/
.classpath
.project
# fabric
run/

86
build.gradle Normal file
View File

@@ -0,0 +1,86 @@
plugins {
id 'fabric-loom' version '0.4-SNAPSHOT'
id 'maven-publish'
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
minecraft {
}
repositories {
maven { url "https://jitpack.io" }
maven { url "https://maven.blamejared.com" }
}
dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modCompile("vazkii.patchouli:Patchouli_1.16-fabric:${project.patchouli_version}")
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
}
processResources {
inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
jar {
from "LICENSE"
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}

18
gradle.properties Normal file
View File

@@ -0,0 +1,18 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.16.1
yarn_mappings=1.16.1+build.7
loader_version=0.8.8+build.202
# Mod Properties
mod_version = 1.0.0
maven_group = eu.midnightdust.motschen
archives_base_name = decorative
# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.14.0+build.371-1.16
patchouli_version=1.16-37.21-FABRIC

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

188
gradlew vendored Normal file
View File

@@ -0,0 +1,188 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or 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.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# 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"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# 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
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# 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"
which java >/dev/null 2>&1 || 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
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

100
gradlew.bat vendored Normal file
View File

@@ -0,0 +1,100 @@
@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
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@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%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

10
settings.gradle Normal file
View File

@@ -0,0 +1,10 @@
pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
}
}

View File

@@ -0,0 +1,48 @@
package eu.midnightdust.motschen.decorative;
import eu.midnightdust.motschen.decorative.init.Signs;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.client.color.block.BlockColorProvider;
import net.minecraft.client.color.item.ItemColorProvider;
import net.minecraft.client.render.RenderLayer;
public class DecorativeClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
registerBlockColor(DecorativeMain.BirdBath, Blocks.WATER);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DecorativeMain.RoadWhiteShort);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DecorativeMain.RoadWhiteLong);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.EmptySign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.StopSign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.FiveSign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.TenSign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.TwentySign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.ThirtySign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.FortySign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.FiftySign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.SixtySign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.SeventySign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.EightySign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.NinetySign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.OnehundredSign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), Signs.OnehundredtenSign);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DecorativeMain.ChristmasTree);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DecorativeMain.CeilingFan);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DecorativeMain.SlidingDoor);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getTranslucent(),DecorativeMain.BirdBath);
}
public void registerBlockColor(Block block, Block templateBlock) {
ColorProviderRegistry.BLOCK.register((type, pos, world, layer) -> {
BlockColorProvider provider = ColorProviderRegistry.BLOCK.get(templateBlock);
return provider == null ? -1 : provider.getColor(type, pos, world, layer);
}, block);
}
}

View File

@@ -0,0 +1,111 @@
package eu.midnightdust.motschen.decorative;
import eu.midnightdust.motschen.decorative.block.*;
import eu.midnightdust.motschen.decorative.init.*;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.item.*;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import java.util.Locale;
public class DecorativeMain implements ModInitializer {
public static final String MOD_ID = "decorative";
public static final ItemGroup IndoorGroup = FabricItemGroupBuilder.build(new Identifier(MOD_ID, "indoor"), () -> new ItemStack(DecorativeMain.Television));
public static final ItemGroup TrafficGroup = FabricItemGroupBuilder.build(new Identifier(MOD_ID, "traffic"), () -> new ItemStack(DecorativeMain.TrafficCone));
public static final ItemGroup GardenGroup = FabricItemGroupBuilder.build(new Identifier(MOD_ID, "garden"), () -> new ItemStack(LogsWithAxes.OakLogWithAxe));
public static final EnumProperty<Program> PROGRAM = EnumProperty.of("program", Program.class);
public static Block RockyAsphalt = new Block(FabricBlockSettings.copyOf(Blocks.COAL_ORE));
public static Block Road = new Block(FabricBlockSettings.copyOf(Blocks.STONE));
public static Block RoadWhiteShort = new RotatableBlock();
public static Block RoadWhiteLong = new RotatableBlock();
public static Block TrafficCone = new TrafficCone();
public static Block Guardrail = new Guardrail();
public static Block SignPost = new SignPost();
public static Block KitchenTiles = new Block(FabricBlockSettings.copyOf(Blocks.STONE));
public static Block Television = new Television();
public static Block OldTelevision = new OldTelevision();
public static Block CeilingFan = new CeilingFan();
public static Block SlidingDoor = new SlidingDoor();
public static Block WaterPump = new WaterPump();
public static Block FireHydrant = new FireHydrant();
public static Block BirdBath = new BirdBath();
public static Block ChristmasTree = new ChristmasTree();
public static Block ChristmasLights = new ChristmasLights();
@Override
public void onInitialize() {
// Traffic //
Registry.register(Registry.BLOCK, new Identifier("decorative","rocky_asphalt"), RockyAsphalt);
Registry.register(Registry.ITEM, new Identifier("decorative","rocky_asphalt"), new BlockItem(RockyAsphalt, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","road"), Road);
Registry.register(Registry.ITEM, new Identifier("decorative","road"), new BlockItem(Road, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","road_white_short"), RoadWhiteShort);
Registry.register(Registry.ITEM, new Identifier("decorative","road_white_short"), new BlockItem(RoadWhiteShort, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","road_white_long"), RoadWhiteLong);
Registry.register(Registry.ITEM, new Identifier("decorative","road_white_long"), new BlockItem(RoadWhiteLong, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","traffic_cone"), TrafficCone);
Registry.register(Registry.ITEM, new Identifier("decorative","traffic_cone"), new BlockItem(TrafficCone, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","fire_hydrant"), FireHydrant);
Registry.register(Registry.ITEM, new Identifier("decorative","fire_hydrant"), new BlockItem(FireHydrant, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","guardrail"), Guardrail);
Registry.register(Registry.ITEM, new Identifier("decorative","guardrail"), new BlockItem(Guardrail, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","sign_post"), SignPost);
Registry.register(Registry.ITEM, new Identifier("decorative","sign_post"), new BlockItem(SignPost, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Signs.init();
//Garden//
Registry.register(Registry.BLOCK, new Identifier("decorative","bird_bath"), BirdBath);
Registry.register(Registry.ITEM, new Identifier("decorative","bird_bath"), new BlockItem(BirdBath, new Item.Settings().group(DecorativeMain.GardenGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","water_pump"), WaterPump);
Registry.register(Registry.ITEM, new Identifier("decorative","water_pump"), new BlockItem(WaterPump, new Item.Settings().group(DecorativeMain.GardenGroup)));
LogsWithAxes.init();
//Furniture//
Registry.register(Registry.BLOCK, new Identifier("decorative","kitchen_tiles"), KitchenTiles);
Registry.register(Registry.ITEM, new Identifier("decorative","kitchen_tiles"), new BlockItem(KitchenTiles, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","television"), Television);
Registry.register(Registry.ITEM, new Identifier("decorative","television"), new BlockItem(Television, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","old_television"), OldTelevision);
Registry.register(Registry.ITEM, new Identifier("decorative","old_television"), new BlockItem(OldTelevision, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","ceilingfan"), CeilingFan);
Registry.register(Registry.ITEM, new Identifier("decorative","ceilingfan"), new BlockItem(CeilingFan, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","sliding_door"), SlidingDoor);
Registry.register(Registry.ITEM, new Identifier("decorative","sliding_door"), new BlockItem(SlidingDoor, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","christmas_tree"), ChristmasTree);
Registry.register(Registry.ITEM, new Identifier("decorative","christmas_tree"), new BlockItem(ChristmasTree, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","christmas_lights"), ChristmasLights);
Registry.register(Registry.ITEM, new Identifier("decorative","christmas_lights"), new BlockItem(ChristmasLights, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Lamps.init();
DoubleLamps.init();
eu.midnightdust.motschen.decorative.world.RockyAsphalt.initBiomeFeatures();
}
public enum Ores implements ItemConvertible {
RockyAsphalt(7, 20, 14, 200);
public final String name;
public final int veinSize;
public final int veinsPerChunk;
public final int minY;
public final int maxY;
Ores(int veinSize, int veinsPerChunk, int minY, int maxY) {
name = this.toString().toLowerCase(Locale.ROOT);
this.veinSize = veinSize;
this.veinsPerChunk = veinsPerChunk;
this.minY = minY;
this.maxY = maxY;
}
@Override
public Item asItem() {
return RockyAsphalt.asItem();
}
}
}

View File

@@ -0,0 +1,25 @@
package eu.midnightdust.motschen.decorative;
import net.minecraft.util.StringIdentifiable;
public enum Program implements StringIdentifiable {
OFF("off"),
NYANCAT("nyancat"),
CREEPER("creeper"),
WOODYS("woodys"),
TATER("tater");
private final String name;
Program(String name) {
this.name = name;
}
public String toString() {
return this.name;
}
public String asString() {
return this.name;
}
}

View File

@@ -0,0 +1,45 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.state.StateManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import net.minecraft.world.WorldView;
public class BirdBath extends CauldronBlock {
private static final VoxelShape SHAPE;
public BirdBath() {
super(FabricBlockSettings.copy(Blocks.CAULDRON).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(LEVEL, 0));
}
@Override
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
return super.getPlacementState(itemPlacementContext)
.with(LEVEL, 0);
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(LEVEL);
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
return SHAPE;
}
static {
VoxelShape shape = createCuboidShape(4, 0, 4, 12, 9, 12);
SHAPE = shape;
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.down());
}
}

View File

@@ -0,0 +1,55 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.state.StateManager;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
public class CeilingFan extends RedstoneLampBlock {
private static final VoxelShape SHAPE;
public CeilingFan() {
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(LIT, true));
}
@Override
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
return super.getPlacementState(itemPlacementContext)
.with(LIT, false);
}
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
world.setBlockState(pos, state.with(LIT, Boolean.valueOf(!state.get(LIT))));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 0.5f);
return ActionResult.SUCCESS;
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(LIT);
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
return SHAPE;
}
static {
VoxelShape shape = createCuboidShape(-3, 5, -3, 19, 16, 19);
SHAPE = shape;
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.up());
}
}

View File

@@ -0,0 +1,88 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
public class ChristmasLights extends HorizontalFacingBlock {
private static final VoxelShape NORTH_SHAPE;
private static final VoxelShape EAST_SHAPE;
private static final VoxelShape SOUTH_SHAPE;
private static final VoxelShape WEST_SHAPE;
public static final BooleanProperty LIT = RedstoneTorchBlock.LIT;
public ChristmasLights() {
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(LIT, Boolean.FALSE));
}
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
world.setBlockState(pos, state.with(LIT, Boolean.valueOf(!state.get(LIT))));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 0.5f);
return ActionResult.SUCCESS;
}
@Override
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
return super.getPlacementState(itemPlacementContext)
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite())
.with(LIT, Boolean.FALSE);
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(FACING);
builder.add(LIT);
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
switch (state.get(FACING)) {
case NORTH: return NORTH_SHAPE;
case EAST: return EAST_SHAPE;
case SOUTH: return SOUTH_SHAPE;
case WEST: return WEST_SHAPE;
default: return super.getOutlineShape(state, view, pos, context);
}
}
static {
VoxelShape shape = createCuboidShape(-16, 3, 6, 32, 17, 9);
NORTH_SHAPE = shape;
WEST_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape);
EAST_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape);
SOUTH_SHAPE = rotate(Direction.EAST, Direction.WEST, shape);
}
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
for (int i = 0; i < times; i++) {
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
buffer[0] = buffer[1];
buffer[1] = VoxelShapes.empty();
}
return buffer[0];
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.up());
}
}

View File

@@ -0,0 +1,31 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import net.minecraft.world.WorldView;
public class ChristmasTree extends Block{
private static final VoxelShape SHAPE;
public ChristmasTree() {
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
return SHAPE;
}
static {
VoxelShape shape = createCuboidShape(0, 0, 0, 16, 32, 16);
SHAPE = shape;
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.down());
}
}

View File

@@ -0,0 +1,96 @@
package eu.midnightdust.motschen.decorative.block;
import blue.endless.jankson.annotation.Nullable;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.block.enums.DoubleBlockHalf;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.state.property.Properties;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView;
public class DoubleLamp extends RedstoneLampBlock {
private static final VoxelShape SHAPE_TOP;
private static final VoxelShape SHAPE_BOTTOM;
public static final BooleanProperty LIT = RedstoneTorchBlock.LIT;
public static final EnumProperty<DoubleBlockHalf> HALF = Properties.DOUBLE_BLOCK_HALF;
public DoubleLamp() {
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(LIT, false).with(HALF, DoubleBlockHalf.LOWER));
}
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
world.setBlockState(pos, state.with(LIT, Boolean.valueOf(!state.get(LIT))));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 0.5f);
return ActionResult.SUCCESS;
}
@Override
@Nullable
public BlockState getPlacementState(ItemPlacementContext arg) {
return this.getDefaultState().with(LIT, arg.getWorld().isReceivingRedstonePower(arg.getBlockPos()));
}
@Override
public void onPlaced(World arg, BlockPos arg2, BlockState arg3, LivingEntity arg4, ItemStack arg5) {
arg.setBlockState(arg2.up(), arg3.with(HALF, DoubleBlockHalf.UPPER), 3);
}
@Override
public BlockState getStateForNeighborUpdate(BlockState arg, Direction arg2, BlockState arg3, WorldAccess arg4, BlockPos arg5, BlockPos arg6) {
DoubleBlockHalf lv = arg.get(HALF);
if (arg2.getAxis() == Direction.Axis.Y && lv == DoubleBlockHalf.LOWER == (arg2 == Direction.UP)) {
if (arg3.isOf(this) && arg3.get(HALF) != lv) {
return (arg.with(LIT, arg3.get(LIT)));
}
return Blocks.AIR.getDefaultState();
}
if (lv == DoubleBlockHalf.LOWER && arg2 == Direction.DOWN && !arg.canPlaceAt(arg4, arg5)) {
return Blocks.AIR.getDefaultState();
}
return super.getStateForNeighborUpdate(arg, arg2, arg3, arg4, arg5, arg6);
}
@Override
public boolean canPlaceAt(BlockState arg, WorldView arg2, BlockPos arg3) {
BlockPos lv = arg3.down();
BlockState lv2 = arg2.getBlockState(lv);
if (arg.get(HALF) == DoubleBlockHalf.LOWER) {
return lv2.isSideSolidFullSquare(arg2, lv, Direction.UP);
}
return lv2.isOf(this);
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> arg) {
arg.add(LIT);
arg.add(HALF);
}
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
boolean bl = state.get(HALF) == DoubleBlockHalf.UPPER;
return bl ? SHAPE_TOP : SHAPE_BOTTOM;
}
static {
VoxelShape shape_top = createCuboidShape(4, -16, 4, 12, 10, 12);
VoxelShape shape_bottom = createCuboidShape(4, 0, 4, 12, 26, 12);
SHAPE_TOP = shape_top;
SHAPE_BOTTOM = shape_bottom;
}
}

View File

@@ -0,0 +1,105 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.state.StateManager;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
public class FireHydrant extends HorizontalFacingBlock {
private static final VoxelShape NORTH_SHAPE;
private static final VoxelShape EAST_SHAPE;
private static final VoxelShape SOUTH_SHAPE;
private static final VoxelShape WEST_SHAPE;
public FireHydrant() {
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
}
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
ItemStack itemStack = player.getStackInHand(hand);
if (!itemStack.isEmpty()) {
if (itemStack.getItem() == Items.BUCKET) {
if (!world.isClient) {
if (!player.abilities.creativeMode) {
itemStack.decrement(1);
if (itemStack.isEmpty()) {
player.setStackInHand(hand, new ItemStack(Items.WATER_BUCKET));
} else if (!player.inventory.insertStack(new ItemStack(Items.WATER_BUCKET))) {
player.dropItem(new ItemStack(Items.WATER_BUCKET), false);
}
}
world.playSound(null, pos, SoundEvents.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
return ActionResult.SUCCESS;
}
else {
return ActionResult.PASS;
}
}
if (itemStack.isEmpty()) {
return ActionResult.PASS;
} return ActionResult.PASS;
}
@Override
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
return super.getPlacementState(itemPlacementContext)
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
switch (state.get(FACING)) {
case NORTH: return NORTH_SHAPE;
case EAST: return EAST_SHAPE;
case SOUTH: return SOUTH_SHAPE;
case WEST: return WEST_SHAPE;
default: return super.getOutlineShape(state, view, pos, context);
}
}
static {
VoxelShape shape = createCuboidShape(2.5, 0, 4, 13.5, 15.5, 12);
NORTH_SHAPE = shape;
WEST_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape);
EAST_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape);
SOUTH_SHAPE = rotate(Direction.EAST, Direction.WEST, shape);
}
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
for (int i = 0; i < times; i++) {
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
buffer[0] = buffer[1];
buffer[1] = VoxelShapes.empty();
}
return buffer[0];
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.down());
}
}

View File

@@ -0,0 +1,105 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.state.StateManager;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
public class Guardrail extends HorizontalFacingBlock {
private static final VoxelShape NORTH_SHAPE;
private static final VoxelShape EAST_SHAPE;
private static final VoxelShape SOUTH_SHAPE;
private static final VoxelShape WEST_SHAPE;
public Guardrail() {
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
}
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
ItemStack itemStack = player.getStackInHand(hand);
if (!itemStack.isEmpty()) {
if (itemStack.getItem() == Items.BUCKET) {
if (!world.isClient) {
if (!player.abilities.creativeMode) {
itemStack.decrement(1);
if (itemStack.isEmpty()) {
player.setStackInHand(hand, new ItemStack(Items.WATER_BUCKET));
} else if (!player.inventory.insertStack(new ItemStack(Items.WATER_BUCKET))) {
player.dropItem(new ItemStack(Items.WATER_BUCKET), false);
}
}
world.playSound(null, pos, SoundEvents.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
return ActionResult.SUCCESS;
}
else {
return ActionResult.PASS;
}
}
if (itemStack.isEmpty()) {
return ActionResult.PASS;
} return ActionResult.PASS;
}
@Override
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
return super.getPlacementState(itemPlacementContext)
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
switch (state.get(FACING)) {
case NORTH: return NORTH_SHAPE;
case EAST: return EAST_SHAPE;
case SOUTH: return SOUTH_SHAPE;
case WEST: return WEST_SHAPE;
default: return super.getOutlineShape(state, view, pos, context);
}
}
static {
VoxelShape shape = createCuboidShape(0, 0, 13.3, 16, 8, 15);
NORTH_SHAPE = shape;
WEST_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape);
EAST_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape);
SOUTH_SHAPE = rotate(Direction.EAST, Direction.WEST, shape);
}
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
for (int i = 0; i < times; i++) {
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
buffer[0] = buffer[1];
buffer[1] = VoxelShapes.empty();
}
return buffer[0];
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.down());
}
}

View File

@@ -0,0 +1,36 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
public class Lamp extends RedstoneLampBlock {
private static final VoxelShape SHAPE;
public Lamp() {
super(FabricBlockSettings.copy(Blocks.REDSTONE_LAMP).nonOpaque().sounds(BlockSoundGroup.STONE));
}
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
world.setBlockState(pos, state.with(LIT, Boolean.valueOf(!state.get(LIT))));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 0.5f);
return ActionResult.SUCCESS;
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
return SHAPE;
}
static {
VoxelShape shape = createCuboidShape(4, 0, 4, 12, 10, 12);
SHAPE = shape;
}
}

View File

@@ -0,0 +1,34 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.state.StateManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.WorldView;
public class LogWithAxe extends HorizontalFacingBlock {
public LogWithAxe() {
super(FabricBlockSettings.copy(Blocks.OAK_PLANKS).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
}
@Override
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
return super.getPlacementState(itemPlacementContext)
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.down());
}
}

View File

@@ -0,0 +1,105 @@
package eu.midnightdust.motschen.decorative.block;
import eu.midnightdust.motschen.decorative.DecorativeMain;
import eu.midnightdust.motschen.decorative.Program;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
public class OldTelevision extends HorizontalFacingBlock {
private static final VoxelShape NORTH_SHAPE;
private static final VoxelShape EAST_SHAPE;
private static final VoxelShape SOUTH_SHAPE;
private static final VoxelShape WEST_SHAPE;
private static final EnumProperty<Program> PROGRAM = DecorativeMain.PROGRAM;
public OldTelevision() {
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(PROGRAM, Program.OFF));
}
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
switch (state.get(PROGRAM)) {
case OFF: world.setBlockState(pos, state.with(PROGRAM, Program.NYANCAT));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 1.5f);
return ActionResult.SUCCESS;
case NYANCAT: world.setBlockState(pos, state.with(PROGRAM, Program.CREEPER));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 1.5f);
return ActionResult.SUCCESS;
case CREEPER: world.setBlockState(pos, state.with(PROGRAM, Program.WOODYS));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 1.5f);
return ActionResult.SUCCESS;
case WOODYS: world.setBlockState(pos, state.with(PROGRAM, Program.TATER));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 1.5f);
return ActionResult.SUCCESS;
case TATER: world.setBlockState(pos, state.with(PROGRAM, Program.OFF));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 1.5f);
return ActionResult.SUCCESS;
}
return ActionResult.SUCCESS;
}
@Override
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
return super.getPlacementState(itemPlacementContext)
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite())
.with(PROGRAM, Program.OFF);
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(FACING);
builder.add(PROGRAM);
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
switch (state.get(FACING)) {
case NORTH: return NORTH_SHAPE;
case EAST: return EAST_SHAPE;
case SOUTH: return SOUTH_SHAPE;
case WEST: return WEST_SHAPE;
default: return super.getOutlineShape(state, view, pos, context);
}
}
static {
VoxelShape shape = createCuboidShape(0, 0, 1, 16, 14, 14);
NORTH_SHAPE = shape;
WEST_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape);
EAST_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape);
SOUTH_SHAPE = rotate(Direction.EAST, Direction.WEST, shape);
}
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
for (int i = 0; i < times; i++) {
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
buffer[0] = buffer[1];
buffer[1] = VoxelShapes.empty();
}
return buffer[0];
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.down());
}
}

View File

@@ -0,0 +1,33 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.HorizontalFacingBlock;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.state.StateManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.WorldView;
public class RotatableBlock extends HorizontalFacingBlock {
public RotatableBlock() {
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
}
@Override
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
return super.getPlacementState(itemPlacementContext)
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
}

View File

@@ -0,0 +1,80 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.state.StateManager;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
public class Sign extends HorizontalFacingBlock {
private static final VoxelShape NORTH_SHAPE;
private static final VoxelShape EAST_SHAPE;
private static final VoxelShape SOUTH_SHAPE;
private static final VoxelShape WEST_SHAPE;
public Sign() {
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
}
@Override
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
return super.getPlacementState(itemPlacementContext)
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
switch (state.get(FACING)) {
case NORTH: return NORTH_SHAPE;
case EAST: return EAST_SHAPE;
case SOUTH: return SOUTH_SHAPE;
case WEST: return WEST_SHAPE;
default: return super.getOutlineShape(state, view, pos, context);
}
}
static {
VoxelShape shape = createCuboidShape(0, 0, 6.9, 16, 16, 9);
NORTH_SHAPE = shape;
WEST_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape);
EAST_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape);
SOUTH_SHAPE = rotate(Direction.EAST, Direction.WEST, shape);
}
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
for (int i = 0; i < times; i++) {
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
buffer[0] = buffer[1];
buffer[1] = VoxelShapes.empty();
}
return buffer[0];
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.down());
}
}

View File

@@ -0,0 +1,35 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.ShapeContext;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import net.minecraft.world.WorldView;
public class SignPost extends Block {
private static final VoxelShape SHAPE;
public SignPost() {
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
return SHAPE;
}
static {
VoxelShape shape = createCuboidShape(7, 0, 7, 9, 16, 9);
SHAPE = shape;
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.down());
}
}

View File

@@ -0,0 +1,84 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.block.enums.DoorHinge;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
public class SlidingDoor extends DoorBlock {
private static final VoxelShape NORTH_SHAPE;
private static final VoxelShape EAST_SHAPE;
private static final VoxelShape SOUTH_SHAPE;
private static final VoxelShape WEST_SHAPE;
private static final VoxelShape NORTH_SHAPE_OPEN;
private static final VoxelShape EAST_SHAPE_OPEN;
private static final VoxelShape SOUTH_SHAPE_OPEN;
private static final VoxelShape WEST_SHAPE_OPEN;
public SlidingDoor() {
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
}
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
state = state.cycle(OPEN);
world.setBlockState(pos, state, 10);
world.playSound(player, pos, SoundEvents.BLOCK_IRON_DOOR_OPEN, SoundCategory.BLOCKS, 0.1f, 1.2f);
return ActionResult.SUCCESS;
}
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
state.get(FACING);
boolean bl = !state.get(OPEN);
boolean bl2 = state.get(HINGE) == DoorHinge.RIGHT;
switch(state.get(FACING)) {
default:
return bl ? WEST_SHAPE : (bl2 ? EAST_SHAPE_OPEN : WEST_SHAPE_OPEN);
case NORTH:
return bl ? NORTH_SHAPE : (bl2 ? SOUTH_SHAPE_OPEN : NORTH_SHAPE_OPEN);
case EAST:
return bl ? EAST_SHAPE : (bl2 ? WEST_SHAPE_OPEN : EAST_SHAPE_OPEN);
case SOUTH:
return bl ? SOUTH_SHAPE : (bl2 ? NORTH_SHAPE_OPEN : SOUTH_SHAPE_OPEN);
}
}
static {
VoxelShape shape = createCuboidShape(0, 0, 7, 16, 16, 9);
VoxelShape shape_open = createCuboidShape(-12, 0, 7, 4, 16, 9);
NORTH_SHAPE = shape;
WEST_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape);
EAST_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape);
SOUTH_SHAPE = rotate(Direction.EAST, Direction.WEST, shape);
NORTH_SHAPE_OPEN = shape_open;
WEST_SHAPE_OPEN = rotate(Direction.EAST, Direction.NORTH, shape_open);
EAST_SHAPE_OPEN = rotate(Direction.EAST, Direction.SOUTH, shape_open);
SOUTH_SHAPE_OPEN = rotate(Direction.EAST, Direction.WEST, shape_open);
}
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
for (int i = 0; i < times; i++) {
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
buffer[0] = buffer[1];
buffer[1] = VoxelShapes.empty();
}
return buffer[0];
}
}

View File

@@ -0,0 +1,105 @@
package eu.midnightdust.motschen.decorative.block;
import eu.midnightdust.motschen.decorative.DecorativeMain;
import eu.midnightdust.motschen.decorative.Program;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
public class Television extends HorizontalFacingBlock {
private static final VoxelShape NORTH_SHAPE;
private static final VoxelShape EAST_SHAPE;
private static final VoxelShape SOUTH_SHAPE;
private static final VoxelShape WEST_SHAPE;
private static final EnumProperty<Program> PROGRAM = DecorativeMain.PROGRAM;
public Television() {
super(FabricBlockSettings.copy(Blocks.BLACK_CONCRETE).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH).with(PROGRAM, Program.OFF));
}
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
switch (state.get(PROGRAM)) {
case OFF: world.setBlockState(pos, state.with(PROGRAM, Program.NYANCAT));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 1.5f);
return ActionResult.SUCCESS;
case NYANCAT: world.setBlockState(pos, state.with(PROGRAM, Program.CREEPER));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 1.5f);
return ActionResult.SUCCESS;
case CREEPER: world.setBlockState(pos, state.with(PROGRAM, Program.WOODYS));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 1.5f);
return ActionResult.SUCCESS;
case WOODYS: world.setBlockState(pos, state.with(PROGRAM, Program.TATER));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 1.5f);
return ActionResult.SUCCESS;
case TATER: world.setBlockState(pos, state.with(PROGRAM, Program.OFF));
world.playSound(player, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.2f, 1.5f);
return ActionResult.SUCCESS;
}
return ActionResult.SUCCESS;
}
@Override
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
return super.getPlacementState(itemPlacementContext)
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite())
.with(PROGRAM, Program.OFF);
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(FACING);
builder.add(PROGRAM);
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
switch (state.get(FACING)) {
case NORTH: return NORTH_SHAPE;
case EAST: return EAST_SHAPE;
case SOUTH: return SOUTH_SHAPE;
case WEST: return WEST_SHAPE;
default: return super.getOutlineShape(state, view, pos, context);
}
}
static {
VoxelShape shape = createCuboidShape(-7, 4, 7, 22, 22, 9);
NORTH_SHAPE = shape;
WEST_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape);
EAST_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape);
SOUTH_SHAPE = rotate(Direction.EAST, Direction.WEST, shape);
}
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
for (int i = 0; i < times; i++) {
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
buffer[0] = buffer[1];
buffer[1] = VoxelShapes.empty();
}
return buffer[0];
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.down());
}
}

View File

@@ -0,0 +1,45 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.state.StateManager;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
public class TrafficCone extends Block {
private static final VoxelShape SHAPE;
public TrafficCone() {
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
return SHAPE;
}
static {
VoxelShape shape = createCuboidShape(4, 0, 4, 12, 11.5, 12);
SHAPE = shape;
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.down());
}
}

View File

@@ -0,0 +1,110 @@
package eu.midnightdust.motschen.decorative.block;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.block.entity.BannerBlockEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.WaterFluid;
import net.minecraft.item.*;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.potion.PotionUtil;
import net.minecraft.potion.Potions;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.stat.Stats;
import net.minecraft.state.StateManager;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
public class WaterPump extends HorizontalFacingBlock {
private static final VoxelShape NORTH_SHAPE;
private static final VoxelShape EAST_SHAPE;
private static final VoxelShape SOUTH_SHAPE;
private static final VoxelShape WEST_SHAPE;
public WaterPump() {
super(FabricBlockSettings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
}
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
ItemStack itemStack = player.getStackInHand(hand);
if (!itemStack.isEmpty()) {
if (itemStack.getItem() == Items.BUCKET) {
if (!world.isClient) {
if (!player.abilities.creativeMode) {
itemStack.decrement(1);
if (itemStack.isEmpty()) {
player.setStackInHand(hand, new ItemStack(Items.WATER_BUCKET));
} else if (!player.inventory.insertStack(new ItemStack(Items.WATER_BUCKET))) {
player.dropItem(new ItemStack(Items.WATER_BUCKET), false);
}
}
world.playSound(null, pos, SoundEvents.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
return ActionResult.SUCCESS;
}
else {
return ActionResult.PASS;
}
}
if (itemStack.isEmpty()) {
return ActionResult.PASS;
} return ActionResult.PASS;
}
@Override
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
return super.getPlacementState(itemPlacementContext)
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
}
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
switch (state.get(FACING)) {
case NORTH: return NORTH_SHAPE;
case EAST: return EAST_SHAPE;
case SOUTH: return SOUTH_SHAPE;
case WEST: return WEST_SHAPE;
default: return super.getOutlineShape(state, view, pos, context);
}
}
static {
VoxelShape shape = createCuboidShape(4.25, 0, 0, 11.75, 24, 14);
NORTH_SHAPE = shape;
WEST_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape);
EAST_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape);
SOUTH_SHAPE = rotate(Direction.EAST, Direction.WEST, shape);
}
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) {
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4;
for (int i = 0; i < times; i++) {
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
buffer[0] = buffer[1];
buffer[1] = VoxelShapes.empty();
}
return buffer[0];
}
public boolean canPlaceAt(BlockState state, WorldView worldView, BlockPos pos) {
return !worldView.isAir(pos.down());
}
}

View File

@@ -0,0 +1,63 @@
package eu.midnightdust.motschen.decorative.init;
import eu.midnightdust.motschen.decorative.DecorativeMain;
import eu.midnightdust.motschen.decorative.block.DoubleLamp;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class DoubleLamps {
public static Block WhiteDoubleLamp = new DoubleLamp();
public static Block OrangeDoubleLamp = new DoubleLamp();
public static Block MagentaDoubleLamp = new DoubleLamp();
public static Block LightBlueDoubleLamp = new DoubleLamp();
public static Block YellowDoubleLamp = new DoubleLamp();
public static Block LimeDoubleLamp = new DoubleLamp();
public static Block PinkDoubleLamp = new DoubleLamp();
public static Block GrayDoubleLamp = new DoubleLamp();
public static Block LightGrayDoubleLamp = new DoubleLamp();
public static Block CyanDoubleLamp = new DoubleLamp();
public static Block PurpleDoubleLamp = new DoubleLamp();
public static Block BlueDoubleLamp = new DoubleLamp();
public static Block BrownDoubleLamp = new DoubleLamp();
public static Block GreenDoubleLamp = new DoubleLamp();
public static Block RedDoubleLamp = new DoubleLamp();
public static Block BlackDoubleLamp = new DoubleLamp();
public static void init() {
Registry.register(Registry.BLOCK, new Identifier("decorative","white_double_lamp"), WhiteDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","white_double_lamp"), new BlockItem(WhiteDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","orange_double_lamp"), OrangeDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","orange_double_lamp"), new BlockItem(OrangeDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","magenta_double_lamp"), MagentaDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","magenta_double_lamp"), new BlockItem(MagentaDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","light_blue_double_lamp"), LightBlueDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","light_blue_double_lamp"), new BlockItem(LightBlueDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","yellow_double_lamp"), YellowDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","yellow_double_lamp"), new BlockItem(YellowDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","lime_double_lamp"), LimeDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","lime_double_lamp"), new BlockItem(LimeDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","pink_double_lamp"), PinkDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","pink_double_lamp"), new BlockItem(PinkDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","gray_double_lamp"), GrayDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","gray_double_lamp"), new BlockItem(GrayDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","light_gray_double_lamp"), LightGrayDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","light_gray_double_lamp"), new BlockItem(LightGrayDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","cyan_double_lamp"), CyanDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","cyan_double_lamp"), new BlockItem(CyanDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","purple_double_lamp"), PurpleDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","purple_double_lamp"), new BlockItem(PurpleDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","blue_double_lamp"), BlueDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","blue_double_lamp"), new BlockItem(BlueDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","brown_double_lamp"), BrownDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","brown_double_lamp"), new BlockItem(BrownDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","green_double_lamp"), GreenDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","green_double_lamp"), new BlockItem(GreenDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","red_double_lamp"), RedDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","red_double_lamp"), new BlockItem(RedDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","black_double_lamp"), BlackDoubleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","black_double_lamp"), new BlockItem(BlackDoubleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
}
}

View File

@@ -0,0 +1,63 @@
package eu.midnightdust.motschen.decorative.init;
import eu.midnightdust.motschen.decorative.DecorativeMain;
import eu.midnightdust.motschen.decorative.block.Lamp;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class Lamps {
public static Block WhiteLamp = new Lamp();
public static Block OrangeLamp = new Lamp();
public static Block MagentaLamp = new Lamp();
public static Block LightBlueLamp = new Lamp();
public static Block YellowLamp = new Lamp();
public static Block LimeLamp = new Lamp();
public static Block PinkLamp = new Lamp();
public static Block GrayLamp = new Lamp();
public static Block LightGrayLamp = new Lamp();
public static Block CyanLamp = new Lamp();
public static Block PurpleLamp = new Lamp();
public static Block BlueLamp = new Lamp();
public static Block BrownLamp = new Lamp();
public static Block GreenLamp = new Lamp();
public static Block RedLamp = new Lamp();
public static Block BlackLamp = new Lamp();
public static void init() {
Registry.register(Registry.BLOCK, new Identifier("decorative","white_lamp"), WhiteLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","white_lamp"), new BlockItem(WhiteLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","orange_lamp"), OrangeLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","orange_lamp"), new BlockItem(OrangeLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","magenta_lamp"), MagentaLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","magenta_lamp"), new BlockItem(MagentaLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","light_blue_lamp"), LightBlueLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","light_blue_lamp"), new BlockItem(LightBlueLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","yellow_lamp"), YellowLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","yellow_lamp"), new BlockItem(YellowLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","lime_lamp"), LimeLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","lime_lamp"), new BlockItem(LimeLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","pink_lamp"), PinkLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","pink_lamp"), new BlockItem(PinkLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","gray_lamp"), GrayLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","gray_lamp"), new BlockItem(GrayLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","light_gray_lamp"), LightGrayLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","light_gray_lamp"), new BlockItem(LightGrayLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","cyan_lamp"), CyanLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","cyan_lamp"), new BlockItem(CyanLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","purple_lamp"), PurpleLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","purple_lamp"), new BlockItem(PurpleLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","blue_lamp"), BlueLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","blue_lamp"), new BlockItem(BlueLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","brown_lamp"), BrownLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","brown_lamp"), new BlockItem(BrownLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","green_lamp"), GreenLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","green_lamp"), new BlockItem(GreenLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","red_lamp"), RedLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","red_lamp"), new BlockItem(RedLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","black_lamp"), BlackLamp);
Registry.register(Registry.ITEM, new Identifier("decorative","black_lamp"), new BlockItem(BlackLamp, new Item.Settings().group(DecorativeMain.IndoorGroup)));
}
}

View File

@@ -0,0 +1,34 @@
package eu.midnightdust.motschen.decorative.init;
import eu.midnightdust.motschen.decorative.DecorativeMain;
import eu.midnightdust.motschen.decorative.block.Lamp;
import eu.midnightdust.motschen.decorative.block.LogWithAxe;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class LogsWithAxes {
public static Block OakLogWithAxe = new LogWithAxe();
public static Block SpruceLogWithAxe = new LogWithAxe();
public static Block BirchLogWithAxe = new LogWithAxe();
public static Block AcaciaLogWithAxe = new LogWithAxe();
public static Block JungleLogWithAxe = new LogWithAxe();
public static Block DarkOakLogWithAxe = new LogWithAxe();
public static void init() {
Registry.register(Registry.BLOCK, new Identifier("decorative","oak_log_with_axe"), OakLogWithAxe);
Registry.register(Registry.ITEM, new Identifier("decorative","oak_log_with_axe"), new BlockItem(OakLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","spruce_log_with_axe"), SpruceLogWithAxe);
Registry.register(Registry.ITEM, new Identifier("decorative","spruce_log_with_axe"), new BlockItem(SpruceLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","birch_log_with_axe"), BirchLogWithAxe);
Registry.register(Registry.ITEM, new Identifier("decorative","birch_log_with_axe"), new BlockItem(BirchLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","acacia_log_with_axe"), AcaciaLogWithAxe);
Registry.register(Registry.ITEM, new Identifier("decorative","acacia_log_with_axe"), new BlockItem(AcaciaLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","jungle_log_with_axe"), JungleLogWithAxe);
Registry.register(Registry.ITEM, new Identifier("decorative","jungle_log_with_axe"), new BlockItem(JungleLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","dark_oak_log_with_axe"), DarkOakLogWithAxe);
Registry.register(Registry.ITEM, new Identifier("decorative","dark_oak_log_with_axe"), new BlockItem(DarkOakLogWithAxe, new Item.Settings().group(DecorativeMain.GardenGroup)));
}
}

View File

@@ -0,0 +1,59 @@
package eu.midnightdust.motschen.decorative.init;
import eu.midnightdust.motschen.decorative.DecorativeMain;
import eu.midnightdust.motschen.decorative.block.LogWithAxe;
import eu.midnightdust.motschen.decorative.block.Sign;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class Signs {
public static Block EmptySign = new Sign();
public static Block StopSign = new Sign();
public static Block FiveSign = new Sign();
public static Block TenSign = new Sign();
public static Block TwentySign = new Sign();
public static Block ThirtySign = new Sign();
public static Block FortySign = new Sign();
public static Block FiftySign = new Sign();
public static Block SixtySign = new Sign();
public static Block SeventySign = new Sign();
public static Block EightySign = new Sign();
public static Block NinetySign = new Sign();
public static Block OnehundredSign = new Sign();
public static Block OnehundredtenSign = new Sign();
public static void init() {
Registry.register(Registry.BLOCK, new Identifier("decorative","empty_sign"), EmptySign);
Registry.register(Registry.ITEM, new Identifier("decorative","empty_sign"), new BlockItem(EmptySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","stop_sign"), StopSign);
Registry.register(Registry.ITEM, new Identifier("decorative","stop_sign"), new BlockItem(StopSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","five_sign"), FiveSign);
Registry.register(Registry.ITEM, new Identifier("decorative","five_sign"), new BlockItem(FiveSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","ten_sign"), TenSign);
Registry.register(Registry.ITEM, new Identifier("decorative","ten_sign"), new BlockItem(TenSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","twenty_sign"), TwentySign);
Registry.register(Registry.ITEM, new Identifier("decorative","twenty_sign"), new BlockItem(TwentySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","thirty_sign"), ThirtySign);
Registry.register(Registry.ITEM, new Identifier("decorative","thirty_sign"), new BlockItem(ThirtySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","forty_sign"), FortySign);
Registry.register(Registry.ITEM, new Identifier("decorative","forty_sign"), new BlockItem(FortySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","fifty_sign"), FiftySign);
Registry.register(Registry.ITEM, new Identifier("decorative","fifty_sign"), new BlockItem(FiftySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","sixty_sign"), SixtySign);
Registry.register(Registry.ITEM, new Identifier("decorative","sixty_sign"), new BlockItem(SixtySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","seventy_sign"), SeventySign);
Registry.register(Registry.ITEM, new Identifier("decorative","seventy_sign"), new BlockItem(SeventySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","eighty_sign"), EightySign);
Registry.register(Registry.ITEM, new Identifier("decorative","eighty_sign"), new BlockItem(EightySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","ninety_sign"), NinetySign);
Registry.register(Registry.ITEM, new Identifier("decorative","ninety_sign"), new BlockItem(NinetySign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","onehundred_sign"), OnehundredSign);
Registry.register(Registry.ITEM, new Identifier("decorative","onehundred_sign"), new BlockItem(OnehundredSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
Registry.register(Registry.BLOCK, new Identifier("decorative","onehundredten_sign"), OnehundredtenSign);
Registry.register(Registry.ITEM, new Identifier("decorative","onehundredten_sign"), new BlockItem(OnehundredtenSign, new Item.Settings().group(DecorativeMain.TrafficGroup)));
}
}

View File

@@ -0,0 +1,41 @@
package eu.midnightdust.motschen.decorative.world;
import eu.midnightdust.motschen.decorative.DecorativeMain;
import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.decorator.Decorator;
import net.minecraft.world.gen.decorator.RangeDecoratorConfig;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import java.util.ArrayList;
import java.util.List;
public class RockyAsphalt {
private static List<Biome> checkedBiomes = new ArrayList<>();
public static void initBiomeFeatures() {
for (Biome biome : Registry.BIOME) {
addToBiome(biome);
}
//Handles modded biomes
RegistryEntryAddedCallback.event(Registry.BIOME).register((i, identifier, biome) -> addToBiome(biome));
}
private static void addToBiome(Biome biome){
if(checkedBiomes.contains(biome)){
//Just to be sure we dont add the stuff twice to the same biome
return;
}
checkedBiomes.add(biome);
addOre(biome, OreFeatureConfig.Target.NATURAL_STONE, DecorativeMain.Ores.RockyAsphalt);
}
private static void addOre(Biome biome, OreFeatureConfig.Target canReplaceIn, DecorativeMain.Ores ore) {
biome.addFeature(GenerationStep.Feature.UNDERGROUND_ORES, Feature.ORE.configure(
new OreFeatureConfig(canReplaceIn, DecorativeMain.RockyAsphalt.getDefaultState(), ore.veinSize)).createDecoratedFeature(Decorator.COUNT_RANGE.configure(
new RangeDecoratorConfig(ore.veinsPerChunk, ore.minY, ore.minY, ore.maxY))));
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/acacia_log_with_axe" },
"facing=west": { "model": "decorative:block/acacia_log_with_axe", "y": 90 },
"facing=north": { "model": "decorative:block/acacia_log_with_axe", "y": 180 },
"facing=east": { "model": "decorative:block/acacia_log_with_axe", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/birch_log_with_axe" },
"facing=west": { "model": "decorative:block/birch_log_with_axe", "y": 90 },
"facing=north": { "model": "decorative:block/birch_log_with_axe", "y": 180 },
"facing=east": { "model": "decorative:block/birch_log_with_axe", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"level=0": { "model": "decorative:block/bird_bath" },
"level=1": { "model": "decorative:block/bird_bath_level1" },
"level=2": { "model": "decorative:block/bird_bath_level2" },
"level=3": { "model": "decorative:block/bird_bath_level3" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/black_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/black_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/black_lamp_on" },
"lit=false": { "model": "decorative:block/black_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/blue_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/blue_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/blue_lamp_on" },
"lit=false": { "model": "decorative:block/blue_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/brown_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/brown_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/brown_lamp_on" },
"lit=false": { "model": "decorative:block/brown_lamp_off" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/ceilingfan_activated" },
"lit=false": { "model": "decorative:block/ceilingfan" }
}
}

View File

@@ -0,0 +1,12 @@
{
"variants": {
"facing=south,lit=false": { "model": "decorative:block/christmas_lights_off", "uvlock": true },
"facing=west,lit=false": { "model": "decorative:block/christmas_lights_off", "uvlock": true, "y": 90 },
"facing=north,lit=false": { "model": "decorative:block/christmas_lights_off", "uvlock": true, "y": 180 },
"facing=east,lit=false": { "model": "decorative:block/christmas_lights_off", "uvlock": true, "y": 270 },
"facing=south,lit=true": { "model": "decorative:block/christmas_lights_on", "uvlock": true },
"facing=west,lit=true": { "model": "decorative:block/christmas_lights_on", "uvlock": true, "y": 90 },
"facing=north,lit=true": { "model": "decorative:block/christmas_lights_on", "uvlock": true, "y": 180 },
"facing=east,lit=true": { "model": "decorative:block/christmas_lights_on", "uvlock": true, "y": 270 }
}
}

View File

@@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "decorative:block/christmas_tree" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/cyan_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/cyan_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/cyan_lamp_on" },
"lit=false": { "model": "decorative:block/cyan_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/dark_oak_log_with_axe" },
"facing=west": { "model": "decorative:block/dark_oak_log_with_axe", "y": 90 },
"facing=north": { "model": "decorative:block/dark_oak_log_with_axe", "y": 180 },
"facing=east": { "model": "decorative:block/dark_oak_log_with_axe", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/eighty_sign" },
"facing=west": { "model": "decorative:block/eighty_sign", "y": 90 },
"facing=north": { "model": "decorative:block/eighty_sign", "y": 180 },
"facing=east": { "model": "decorative:block/eighty_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/empty_sign" },
"facing=west": { "model": "decorative:block/empty_sign", "y": 90 },
"facing=north": { "model": "decorative:block/empty_sign", "y": 180 },
"facing=east": { "model": "decorative:block/empty_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/fifty_sign" },
"facing=west": { "model": "decorative:block/fifty_sign", "y": 90 },
"facing=north": { "model": "decorative:block/fifty_sign", "y": 180 },
"facing=east": { "model": "decorative:block/fifty_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/fire_hydrant", "y": 180 },
"facing=west": { "model": "decorative:block/fire_hydrant", "y": 270 },
"facing=north": { "model": "decorative:block/fire_hydrant" },
"facing=east": { "model": "decorative:block/fire_hydrant", "y": 90 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/five_sign" },
"facing=west": { "model": "decorative:block/five_sign", "y": 90 },
"facing=north": { "model": "decorative:block/five_sign", "y": 180 },
"facing=east": { "model": "decorative:block/five_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/forty_sign" },
"facing=west": { "model": "decorative:block/forty_sign", "y": 90 },
"facing=north": { "model": "decorative:block/forty_sign", "y": 180 },
"facing=east": { "model": "decorative:block/forty_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/gray_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/gray_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/gray_lamp_on" },
"lit=false": { "model": "decorative:block/gray_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/green_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/green_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/green_lamp_on" },
"lit=false": { "model": "decorative:block/green_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/guardrail", "y": 180 },
"facing=west": { "model": "decorative:block/guardrail", "y": 270 },
"facing=north": { "model": "decorative:block/guardrail" },
"facing=east": { "model": "decorative:block/guardrail", "y": 90 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/jungle_log_with_axe" },
"facing=west": { "model": "decorative:block/jungle_log_with_axe", "y": 90 },
"facing=north": { "model": "decorative:block/jungle_log_with_axe", "y": 180 },
"facing=east": { "model": "decorative:block/jungle_log_with_axe", "y": 270 }
}
}

View File

@@ -0,0 +1,16 @@
{
"variants": {
"facing=down,open=false": { "model": "decorative:block/kitchen_counter", "x": 180 },
"facing=up,open=false": { "model": "decorative:block/kitchen_counter" },
"facing=north,open=false": { "model": "decorative:block/kitchen_counter", "x": 90 },
"facing=south,open=false": { "model": "decorative:block/kitchen_counter", "x": 0, "y": 90 },
"facing=west,open=false": { "model": "decorative:block/kitchen_counter", "x": 90, "y": 270 },
"facing=east,open=false": { "model": "decorative:block/kitchen_counter", "x": 90, "y": 90 },
"facing=down,open=true": { "model": "decorative:block/kitchen_counter_open", "x": 180 },
"facing=up,open=true": { "model": "decorative:block/kitchen_counter_open" },
"facing=north,open=true": { "model": "decorative:block/kitchen_counter_open", "x": 90 },
"facing=south,open=true": { "model": "decorative:block/kitchen_counter_open", "x": 0, "y": 90 },
"facing=west,open=true": { "model": "decorative:block/kitchen_counter_open", "x": 90, "y": 270 },
"facing=east,open=true": { "model": "decorative:block/kitchen_counter_open", "x": 90, "y": 90 }
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": [
{ "model": "decorative:block/kitchen_tiles" }
]
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/light_blue_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/light_blue_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/light_blue_lamp_on" },
"lit=false": { "model": "decorative:block/light_blue_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/light_gray_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/light_gray_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/light_gray_lamp_on" },
"lit=false": { "model": "decorative:block/light_gray_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/lime_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/lime_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/lime_lamp_on" },
"lit=false": { "model": "decorative:block/lime_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/magenta_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/magenta_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/magenta_lamp_on" },
"lit=false": { "model": "decorative:block/magenta_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/ninety_sign" },
"facing=west": { "model": "decorative:block/ninety_sign", "y": 90 },
"facing=north": { "model": "decorative:block/ninety_sign", "y": 180 },
"facing=east": { "model": "decorative:block/ninety_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/oak_log_with_axe" },
"facing=west": { "model": "decorative:block/oak_log_with_axe", "y": 90 },
"facing=north": { "model": "decorative:block/oak_log_with_axe", "y": 180 },
"facing=east": { "model": "decorative:block/oak_log_with_axe", "y": 270 }
}
}

View File

@@ -0,0 +1,28 @@
{
"variants": {
"facing=south,program=off": { "model": "decorative:block/old_television_off", "uvlock": true },
"facing=west,program=off": { "model": "decorative:block/old_television_off", "uvlock": true, "y": 90 },
"facing=north,program=off": { "model": "decorative:block/old_television_off", "uvlock": true, "y": 180 },
"facing=east,program=off": { "model": "decorative:block/old_television_off", "uvlock": true, "y": 270 },
"facing=south,program=nyancat": { "model": "decorative:block/old_television_nyancat", "uvlock": true },
"facing=west,program=nyancat": { "model": "decorative:block/old_television_nyancat", "uvlock": true, "y": 90 },
"facing=north,program=nyancat": { "model": "decorative:block/old_television_nyancat", "uvlock": true, "y": 180 },
"facing=east,program=nyancat": { "model": "decorative:block/old_television_nyancat", "uvlock": true, "y": 270 },
"facing=south,program=creeper": { "model": "decorative:block/old_television_creeper", "uvlock": true },
"facing=west,program=creeper": { "model": "decorative:block/old_television_creeper", "uvlock": true, "y": 90 },
"facing=north,program=creeper": { "model": "decorative:block/old_television_creeper", "uvlock": true, "y": 180 },
"facing=east,program=creeper": { "model": "decorative:block/old_television_creeper", "uvlock": true, "y": 270 },
"facing=south,program=woodys": { "model": "decorative:block/old_television_woodys", "uvlock": true },
"facing=west,program=woodys": { "model": "decorative:block/old_television_woodys", "uvlock": true, "y": 90 },
"facing=north,program=woodys": { "model": "decorative:block/old_television_woodys", "uvlock": true, "y": 180 },
"facing=east,program=woodys": { "model": "decorative:block/old_television_woodys", "uvlock": true, "y": 270 },
"facing=south,program=tater": { "model": "decorative:block/old_television_tater", "uvlock": true },
"facing=west,program=tater": { "model": "decorative:block/old_television_tater", "uvlock": true, "y": 90 },
"facing=north,program=tater": { "model": "decorative:block/old_television_tater", "uvlock": true, "y": 180 },
"facing=east,program=tater": { "model": "decorative:block/old_television_tater", "uvlock": true, "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/onehundred_sign" },
"facing=west": { "model": "decorative:block/onehundred_sign", "y": 90 },
"facing=north": { "model": "decorative:block/onehundred_sign", "y": 180 },
"facing=east": { "model": "decorative:block/onehundred_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/onehundredten_sign" },
"facing=west": { "model": "decorative:block/onehundredten_sign", "y": 90 },
"facing=north": { "model": "decorative:block/onehundredten_sign", "y": 180 },
"facing=east": { "model": "decorative:block/onehundredten_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/orange_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/orange_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/orange_lamp_on" },
"lit=false": { "model": "decorative:block/orange_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/pink_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/pink_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/pink_lamp_on" },
"lit=false": { "model": "decorative:block/pink_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/purple_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/purple_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/purple_lamp_on" },
"lit=false": { "model": "decorative:block/purple_lamp_off" }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/red_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/red_double_lamp_on_top" }
}
}

View File

@@ -0,0 +1,6 @@
{
"variants": {
"lit=true": { "model": "decorative:block/red_lamp_on" },
"lit=false": { "model": "decorative:block/red_lamp_off" }
}
}

View File

@@ -0,0 +1,10 @@
{
"variants": {
"": [
{ "model": "decorative:block/road" },
{ "model": "decorative:block/road", "y": 90 },
{ "model": "decorative:block/road", "y": 180 },
{ "model": "decorative:block/road", "y": 270 }
]
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/road_white_long" },
"facing=west": { "model": "decorative:block/road_white_long", "y": 90 },
"facing=north": { "model": "decorative:block/road_white_long", "y": 180 },
"facing=east": { "model": "decorative:block/road_white_long", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/road_white_short" },
"facing=west": { "model": "decorative:block/road_white_short", "y": 90 },
"facing=north": { "model": "decorative:block/road_white_short", "y": 180 },
"facing=east": { "model": "decorative:block/road_white_short", "y": 270 }
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": [
{ "model": "decorative:block/rocky_asphalt" }
]
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/seventy_sign" },
"facing=west": { "model": "decorative:block/seventy_sign", "y": 90 },
"facing=north": { "model": "decorative:block/seventy_sign", "y": 180 },
"facing=east": { "model": "decorative:block/seventy_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": [
{ "model": "decorative:block/sign_post" }
]
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/sixty_sign" },
"facing=west": { "model": "decorative:block/sixty_sign", "y": 90 },
"facing=north": { "model": "decorative:block/sixty_sign", "y": 180 },
"facing=east": { "model": "decorative:block/sixty_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,36 @@
{
"variants": {
"facing=west,half=lower,hinge=left,open=false": { "model": "decorative:block/sliding_door_bottom" },
"facing=north,half=lower,hinge=left,open=false": { "model": "decorative:block/sliding_door_bottom", "y": 90 },
"facing=east,half=lower,hinge=left,open=false": { "model": "decorative:block/sliding_door_bottom", "y": 180 },
"facing=south,half=lower,hinge=left,open=false": { "model": "decorative:block/sliding_door_bottom", "y": 270 },
"facing=west,half=lower,hinge=right,open=false": { "model": "decorative:block/sliding_door_bottom", "y": 180 },
"facing=north,half=lower,hinge=right,open=false": { "model": "decorative:block/sliding_door_bottom", "y": 270 },
"facing=east,half=lower,hinge=right,open=false": { "model": "decorative:block/sliding_door_bottom" },
"facing=south,half=lower,hinge=right,open=false": { "model": "decorative:block/sliding_door_bottom", "y": 90 },
"facing=west,half=lower,hinge=left,open=true": { "model": "decorative:block/sliding_door_bottom_open" },
"facing=north,half=lower,hinge=left,open=true": { "model": "decorative:block/sliding_door_bottom_open", "y": 90 },
"facing=east,half=lower,hinge=left,open=true": { "model": "decorative:block/sliding_door_bottom_open", "y": 180 },
"facing=south,half=lower,hinge=left,open=true": { "model": "decorative:block/sliding_door_bottom_open", "y": 270 },
"facing=west,half=lower,hinge=right,open=true": { "model": "decorative:block/sliding_door_bottom_open", "y": 180 },
"facing=north,half=lower,hinge=right,open=true": { "model": "decorative:block/sliding_door_bottom_open", "y": 270 },
"facing=east,half=lower,hinge=right,open=true": { "model": "decorative:block/sliding_door_bottom_open" },
"facing=south,half=lower,hinge=right,open=true": { "model": "decorative:block/sliding_door_bottom_open", "y": 90 },
"facing=west,half=upper,hinge=left,open=false": { "model": "decorative:block/sliding_door_top" },
"facing=north,half=upper,hinge=left,open=false": { "model": "decorative:block/sliding_door_top", "y": 90 },
"facing=east,half=upper,hinge=left,open=false": { "model": "decorative:block/sliding_door_top", "y": 180 },
"facing=south,half=upper,hinge=left,open=false": { "model": "decorative:block/sliding_door_top", "y": 270 },
"facing=west,half=upper,hinge=right,open=false": { "model": "decorative:block/sliding_door_top", "y": 180 },
"facing=north,half=upper,hinge=right,open=false": { "model": "decorative:block/sliding_door_top", "y": 270 },
"facing=east,half=upper,hinge=right,open=false": { "model": "decorative:block/sliding_door_top" },
"facing=south,half=upper,hinge=right,open=false": { "model": "decorative:block/sliding_door_top", "y": 90 },
"facing=west,half=upper,hinge=left,open=true": { "model": "decorative:block/sliding_door_top_open" },
"facing=north,half=upper,hinge=left,open=true": { "model": "decorative:block/sliding_door_top_open", "y": 90 },
"facing=east,half=upper,hinge=left,open=true": { "model": "decorative:block/sliding_door_top_open", "y": 180 },
"facing=south,half=upper,hinge=left,open=true": { "model": "decorative:block/sliding_door_top_open", "y": 270 },
"facing=west,half=upper,hinge=right,open=true": { "model": "decorative:block/sliding_door_top_open", "y": 180 },
"facing=north,half=upper,hinge=right,open=true": { "model": "decorative:block/sliding_door_top_open", "y": 270 },
"facing=east,half=upper,hinge=right,open=true": { "model": "decorative:block/sliding_door_top_open" },
"facing=south,half=upper,hinge=right,open=true": { "model": "decorative:block/sliding_door_top_open", "y": 90 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/spruce_log_with_axe" },
"facing=west": { "model": "decorative:block/spruce_log_with_axe", "y": 90 },
"facing=north": { "model": "decorative:block/spruce_log_with_axe", "y": 180 },
"facing=east": { "model": "decorative:block/spruce_log_with_axe", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/stop_sign" },
"facing=west": { "model": "decorative:block/stop_sign", "y": 90 },
"facing=north": { "model": "decorative:block/stop_sign", "y": 180 },
"facing=east": { "model": "decorative:block/stop_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,28 @@
{
"variants": {
"facing=south,program=off": { "model": "decorative:block/television_off", "uvlock": true },
"facing=west,program=off": { "model": "decorative:block/television_off", "uvlock": true, "y": 90 },
"facing=north,program=off": { "model": "decorative:block/television_off", "uvlock": true, "y": 180 },
"facing=east,program=off": { "model": "decorative:block/television_off", "uvlock": true, "y": 270 },
"facing=south,program=nyancat": { "model": "decorative:block/television_nyancat", "uvlock": true },
"facing=west,program=nyancat": { "model": "decorative:block/television_nyancat", "uvlock": true, "y": 90 },
"facing=north,program=nyancat": { "model": "decorative:block/television_nyancat", "uvlock": true, "y": 180 },
"facing=east,program=nyancat": { "model": "decorative:block/television_nyancat", "uvlock": true, "y": 270 },
"facing=south,program=creeper": { "model": "decorative:block/television_creeper", "uvlock": true },
"facing=west,program=creeper": { "model": "decorative:block/television_creeper", "uvlock": true, "y": 90 },
"facing=north,program=creeper": { "model": "decorative:block/television_creeper", "uvlock": true, "y": 180 },
"facing=east,program=creeper": { "model": "decorative:block/television_creeper", "uvlock": true, "y": 270 },
"facing=south,program=woodys": { "model": "decorative:block/television_woodys", "uvlock": true },
"facing=west,program=woodys": { "model": "decorative:block/television_woodys", "uvlock": true, "y": 90 },
"facing=north,program=woodys": { "model": "decorative:block/television_woodys", "uvlock": true, "y": 180 },
"facing=east,program=woodys": { "model": "decorative:block/television_woodys", "uvlock": true, "y": 270 },
"facing=south,program=tater": { "model": "decorative:block/television_tater", "uvlock": true },
"facing=west,program=tater": { "model": "decorative:block/television_tater", "uvlock": true, "y": 90 },
"facing=north,program=tater": { "model": "decorative:block/television_tater", "uvlock": true, "y": 180 },
"facing=east,program=tater": { "model": "decorative:block/television_tater", "uvlock": true, "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/ten_sign" },
"facing=west": { "model": "decorative:block/ten_sign", "y": 90 },
"facing=north": { "model": "decorative:block/ten_sign", "y": 180 },
"facing=east": { "model": "decorative:block/ten_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/thirty_sign" },
"facing=west": { "model": "decorative:block/thirty_sign", "y": 90 },
"facing=north": { "model": "decorative:block/thirty_sign", "y": 180 },
"facing=east": { "model": "decorative:block/thirty_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": [
{ "model": "decorative:block/traffic_cone" }
]
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/twenty_sign" },
"facing=west": { "model": "decorative:block/twenty_sign", "y": 90 },
"facing=north": { "model": "decorative:block/twenty_sign", "y": 180 },
"facing=east": { "model": "decorative:block/twenty_sign", "y": 270 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"facing=south": { "model": "decorative:block/water_pump", "y": 180 },
"facing=west": { "model": "decorative:block/water_pump", "y": 270 },
"facing=north": { "model": "decorative:block/water_pump" },
"facing=east": { "model": "decorative:block/water_pump", "y": 90 }
}
}

View File

@@ -0,0 +1,8 @@
{
"variants": {
"half=lower,lit=false": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=false": { "model": "decorative:block/white_double_lamp_off_top" },
"half=lower,lit=true": { "model": "decorative:block/double_lamp_bottom" },
"half=upper,lit=true": { "model": "decorative:block/white_double_lamp_on_top" }
}
}

Some files were not shown because too many files have changed in this diff Show More