Compare commits

...

9 Commits

Author SHA1 Message Date
Paula d581b975da Update gridBlock.java 2024-07-14 11:20:57 +02:00
Paula dd2606a353 Merge branch 'suspiciousBlock' into gridBlock 2024-07-13 15:57:37 +02:00
Paula 8d79df62a3 folder
damit es übersichtlicher ist sind alle blöcke jetzt in einem ordner
2024-07-13 15:54:57 +02:00
Paula 34e659bb0a 1 2024-07-13 15:52:06 +02:00
Paula a072d525a5 finish
-nochmal überprüft
-ein paar Kommentare hinzugefügt
-der Block ist jetzt nicht mehr durchsichtig
2024-07-13 15:25:34 +02:00
Paula e8fadaa2d5 recipe added
Der Block kann jetzt am Crafting table erstellt werden + useBlockCallback ist jetzt einfacher
2024-07-13 15:03:46 +02:00
Paula 6214c2c6b7 features added
Man kriegt jetzt essen und der Block wird kleiner
2024-06-02 11:16:06 +02:00
Paula c8cdce2c06 seven more suspicious blocks
die restlichen sieben Blöcke um den großen schrumpfen lassen zu können mit models, blockstates, texture und language Anpassungen
2024-06-01 14:33:49 +02:00
Paula 25ff4d1bc4 suspiciousBlock added
Textur und normal großer suspicious Block hinzugefügt
2024-06-01 12:36:22 +02:00
41 changed files with 432 additions and 0 deletions

View File

@ -0,0 +1,7 @@
package modchest.block.custom.gridBlocks;
import net.minecraft.block.Block;
public class gridBlock extends Block{
}

View File

@ -0,0 +1,11 @@
package modchest.block.custom.suspiciousBlocks;
import net.minecraft.block.Block;
public class suspiciousBlock extends Block {
//beim rechtsklick mit einer schüssel kriegt man suspicious stew und der block wird kleiner -> siehe useBlockCallback
public suspiciousBlock(Settings settings) {
super(settings);
}
}

View File

@ -0,0 +1,9 @@
package modchest.block.custom.suspiciousBlocks;
public class suspiciousBlockMinusDrei extends suspiciousBlock {
//siehe suspiciousBlock
public suspiciousBlockMinusDrei(Settings settings) {
super(settings);
}
}

View File

@ -0,0 +1,9 @@
package modchest.block.custom.suspiciousBlocks;
public class suspiciousBlockMinusEins extends suspiciousBlock {
//siehe suspiciousBlock
public suspiciousBlockMinusEins(Settings settings) {
super(settings);
}
}

View File

@ -0,0 +1,9 @@
package modchest.block.custom.suspiciousBlocks;
public class suspiciousBlockMinusFuenf extends suspiciousBlock {
//siehe suspiciousBlock
public suspiciousBlockMinusFuenf(Settings settings) {
super(settings);
}
}

View File

@ -0,0 +1,9 @@
package modchest.block.custom.suspiciousBlocks;
public class suspiciousBlockMinusSechs extends suspiciousBlock {
//siehe suspiciousBlock
public suspiciousBlockMinusSechs(Settings settings) {
super(settings);
}
}

View File

@ -0,0 +1,9 @@
package modchest.block.custom.suspiciousBlocks;
public class suspiciousBlockMinusSieben extends suspiciousBlock {
//siehe suspiciousBlock
public suspiciousBlockMinusSieben(Settings settings) {
super(settings);
}
}

View File

@ -0,0 +1,9 @@
package modchest.block.custom.suspiciousBlocks;
public class suspiciousBlockMinusVier extends suspiciousBlock {
//siehe suspiciousBlock
public suspiciousBlockMinusVier(Settings settings) {
super(settings);
}
}

View File

@ -0,0 +1,9 @@
package modchest.block.custom.suspiciousBlocks;
public class suspiciousBlockMinusZwei extends suspiciousBlock {
//siehe suspiciousBlock
public suspiciousBlockMinusZwei(Settings settings) {
super(settings);
}
}

View File

@ -1,6 +1,7 @@
package modchest.block; package modchest.block;
import modchest.block.custom.steeringWheelBlock; import modchest.block.custom.steeringWheelBlock;
import modchest.block.custom.suspiciousBlocks.suspiciousBlock;
import modchest.item.modItemGroup; import modchest.item.modItemGroup;
import modchest.REServerMod; import modchest.REServerMod;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
@ -15,12 +16,54 @@ import net.minecraft.util.registry.Registry;
//setzt die blöcke auf //setzt die blöcke auf
public class modBlocks { public class modBlocks {
public static Block steering_wheel; // Block wird erstellt public static Block steering_wheel; // Block wird erstellt
public static Block suspicious_block;
public static Block suspicious_block_minus_eins;
public static Block suspicious_block_minus_zwei;
public static Block suspicious_block_minus_drei;
public static Block suspicious_block_minus_vier;
public static Block suspicious_block_minus_fuenf;
public static Block suspicious_block_minus_sechs;
public static Block suspicious_block_minus_sieben;
public static void setBlocks() {// Block wird definiert public static void setBlocks() {// Block wird definiert
steering_wheel = registerBlock("steering_wheel", steering_wheel = registerBlock("steering_wheel",
new steeringWheelBlock(FabricBlockSettings.of(Material.WOOD).strength(1.0f).requiresTool()), new steeringWheelBlock(FabricBlockSettings.of(Material.WOOD).strength(1.0f).requiresTool()),
modItemGroup.modchest); modItemGroup.modchest);
suspicious_block = registerBlock("suspicious_block",
new suspiciousBlock(FabricBlockSettings.of(Material.SPONGE).strength(1.0f).requiresTool()
.nonOpaque()),
modItemGroup.modchest);
suspicious_block_minus_eins = registerBlock("suspicious_block_minus_eins",
new suspiciousBlock(FabricBlockSettings.of(Material.SPONGE).strength(1.0f).requiresTool()
.nonOpaque()),
modItemGroup.modchest);
suspicious_block_minus_zwei = registerBlock("suspicious_block_minus_zwei",
new suspiciousBlock(FabricBlockSettings.of(Material.SPONGE).strength(1.0f).requiresTool()
.nonOpaque()),
modItemGroup.modchest);
suspicious_block_minus_drei = registerBlock("suspicious_block_minus_drei",
new suspiciousBlock(FabricBlockSettings.of(Material.SPONGE).strength(1.0f).requiresTool()),
modItemGroup.modchest);
suspicious_block_minus_vier = registerBlock("suspicious_block_minus_vier",
new suspiciousBlock(FabricBlockSettings.of(Material.SPONGE).strength(1.0f).requiresTool()),
modItemGroup.modchest);
suspicious_block_minus_fuenf = registerBlock("suspicious_block_minus_fuenf",
new suspiciousBlock(FabricBlockSettings.of(Material.SPONGE).strength(1.0f).requiresTool()),
modItemGroup.modchest);
suspicious_block_minus_sechs = registerBlock("suspicious_block_minus_sechs",
new suspiciousBlock(FabricBlockSettings.of(Material.SPONGE).strength(1.0f).requiresTool()),
modItemGroup.modchest);
suspicious_block_minus_sieben = registerBlock("suspicious_block_minus_sieben",
new suspiciousBlock(FabricBlockSettings.of(Material.SPONGE).strength(1.0f).requiresTool()),
modItemGroup.modchest);
} }
private static Block registerBlock(String name, Block block, ItemGroup group) { // Nicht verändern! Fügt die oben private static Block registerBlock(String name, Block block, ItemGroup group) { // Nicht verändern! Fügt die oben

View File

@ -0,0 +1,45 @@
package modchest.event;
import modchest.block.custom.suspiciousBlocks.suspiciousBlock;
import net.fabricmc.fabric.api.event.player.UseBlockCallback;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
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.world.World;
public class useBlockCallback implements UseBlockCallback {
@Override
public ActionResult interact(PlayerEntity player, World world, Hand hand, BlockHitResult hitResult) {
BlockPos pos = hitResult.getBlockPos();
BlockState state = world.getBlockState(hitResult.getBlockPos());
String hitResultString = state.getBlock().toString();
if (player.getMainHandStack().getItem().equals(Items.BOWL)) {
if (hitResultString.equals("Block{modchest:suspicious_block}") ||
hitResultString.equals("Block{modchest:suspicious_block_minus_eins}") ||
hitResultString.equals("Block{modchest:suspicious_block_minus_zwei}") ||
hitResultString.equals("Block{modchest:suspicious_block_minus_zwei}") ||
hitResultString.equals("Block{modchest:suspicious_block_minus_drei}") ||
hitResultString.equals("Block{modchest:suspicious_block_minus_vier}") ||
hitResultString.equals("Block{modchest:suspicious_block_minus_fuenf}") ||
hitResultString.equals("Block{modchest:suspicious_block_minus_sechs}") ||
hitResultString.equals("Block{modchest:suspicious_block_minus_sieben}")) {
player.getMainHandStack().decrement(1); // sonst unendlich viel Schüsseln, auch nicht schlecht
player.giveItemStack(Items.SUSPICIOUS_STEW.getDefaultStack());
world.setBlockState(pos, suspiciousBlock
.getStateFromRawId(suspiciousBlock.getRawIdFromState(state) + 1)); // sorgt dafür, dass
// der suspicious
// Block um eins
// kleiner wird wenn
// man ihn mit der
// Schüssel benutzt
return ActionResult.SUCCESS;
}
}
return ActionResult.PASS;
}
}

View File

@ -3,10 +3,12 @@ package modchest.util;
import modchest.block.entity.modBlockEntities; import modchest.block.entity.modBlockEntities;
import modchest.block.modBlocks; import modchest.block.modBlocks;
import modchest.event.playerAfterRespawnEvent; import modchest.event.playerAfterRespawnEvent;
import modchest.event.useBlockCallback;
import modchest.item.modItemGroup; import modchest.item.modItemGroup;
import modchest.item.modItems; import modchest.item.modItems;
import modchest.networking.modNetworkingServer; import modchest.networking.modNetworkingServer;
import net.fabricmc.fabric.api.entity.event.v1.ServerPlayerEvents; import net.fabricmc.fabric.api.entity.event.v1.ServerPlayerEvents;
import net.fabricmc.fabric.api.event.player.UseBlockCallback;
public class initializer { public class initializer {
public static void itemGroups() { public static void itemGroups() {
@ -22,6 +24,7 @@ public class initializer {
public static void events() { //Events, bei denen custom Code ausgefuehrt wird, werden eingefuehrt public static void events() { //Events, bei denen custom Code ausgefuehrt wird, werden eingefuehrt
ServerPlayerEvents.AFTER_RESPAWN.register(new playerAfterRespawnEvent()); ServerPlayerEvents.AFTER_RESPAWN.register(new playerAfterRespawnEvent());
UseBlockCallback.EVENT.register(new useBlockCallback());
} }
public static void networking() { //Identifier unter denen der Server zuhoert werden registriert public static void networking() { //Identifier unter denen der Server zuhoert werden registriert

View File

@ -0,0 +1,5 @@
{
"variants": {
"": {"model": "modchest:block/suspicious_block"}
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": {"model": "modchest:block/suspicious_block_minus_drei"}
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": {"model": "modchest:block/suspicious_block_minus_eins"}
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": {"model": "modchest:block/suspicious_block_minus_fuenf"}
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": {"model": "modchest:block/suspicious_block_minus_sechs"}
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": {"model": "modchest:block/suspicious_block_minus_sieben"}
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": {"model": "modchest:block/suspicious_block_minus_vier"}
}
}

View File

@ -0,0 +1,5 @@
{
"variants": {
"": {"model": "modchest:block/suspicious_block_minus_zwei"}
}
}

View File

@ -2,6 +2,14 @@
"item.modchest.shipblock": "Schiffsblock", "item.modchest.shipblock": "Schiffsblock",
"item.modchest.pirates_coin": "OP Piraten ding zum Testen", "item.modchest.pirates_coin": "OP Piraten ding zum Testen",
"block.modchest.steering_wheel": "Lenkrad", "block.modchest.steering_wheel": "Lenkrad",
"block.modchest.suspicious_block": "verdächtiger Block :)",
"block.modchest.suspicious_block_minus_eins": "durchaus verdächtiger Block",
"block.modchest.suspicious_block_minus_zwei": "sehr verdächtiger Block ",
"block.modchest.suspicious_block_minus_drei": "überaus verdächtiger Block",
"block.modchest.suspicious_block_minus_vier": "äußerst verdächtiger Block",
"block.modchest.suspicious_block_minus_fuenf": "seeeeeeeehr verdächtiger Block",
"block.modchest.suspicious_block_minus_sechs": "unglaublich verdächtiger Block",
"block.modchest.suspicious_block_minus_sieben": "unschlagbar verdächtiger Block",
"itemGroup.modchest.itemlist1": "Malte's Mod", "itemGroup.modchest.itemlist1": "Malte's Mod",
"chat.modchest.multispawn.beddestroyed": "Scheint so, als wäre das Bett zerstört worden!", "chat.modchest.multispawn.beddestroyed": "Scheint so, als wäre das Bett zerstört worden!",

View File

@ -2,6 +2,14 @@
"item.modchest.shipblock": "Hanno, änder die Sprache!", "item.modchest.shipblock": "Hanno, änder die Sprache!",
"item.modchest.pirates_coin": "Ya coin for tha pirrrrrates!", "item.modchest.pirates_coin": "Ya coin for tha pirrrrrates!",
"block.modchest.steering_wheel": "Ne, du kriegst keine hilfreichen Angaben mit der Sprache!", "block.modchest.steering_wheel": "Ne, du kriegst keine hilfreichen Angaben mit der Sprache!",
"block.modchest.suspicious_block": "somethin' fishy with this block",
"block.modchest.suspicious_block_minus_eins": "somethin' fishy with this block",
"block.modchest.suspicious_block_minus_zwei": "somethin' fishy with this block",
"block.modchest.suspicious_block_minus_drei": "somethin' fishy with this block",
"block.modchest.suspicious_block_minus_vier": "somethin' fishy with this block",
"block.modchest.suspicious_block_minus_fuenf": "somethin' fishy with this block",
"block.modchest.suspicious_block_minus_sechs": "somethin' fishy with this block",
"block.modchest.suspicious_block_minus_sieben": "somethin' fishy with this block",
"itemGroup.modchest.itemlist1": "Änder doch endlich die Sprache...", "itemGroup.modchest.itemlist1": "Änder doch endlich die Sprache...",
"chat.modchest.multispawn.beddestroyed": "Sorry, mate! Looks like that cap'n doesn't like you", "chat.modchest.multispawn.beddestroyed": "Sorry, mate! Looks like that cap'n doesn't like you",

View File

@ -2,6 +2,14 @@
"item.modchest.shipblock": "Shipblock", "item.modchest.shipblock": "Shipblock",
"item.modchest.pirates_coin": "Pirate's Coin", "item.modchest.pirates_coin": "Pirate's Coin",
"block.modchest.steering_wheel": "Steering Wheel", "block.modchest.steering_wheel": "Steering Wheel",
"block.modchest.suspicious_block": "sus",
"block.modchest.suspicious_block_minus_eins": "sus",
"block.modchest.suspicious_block_minus_zwei": "sus",
"block.modchest.suspicious_block_minus_drei": "sus",
"block.modchest.suspicious_block_minus_vier": "sus",
"block.modchest.suspicious_block_minus_fuenf": "sus",
"block.modchest.suspicious_block_minus_sechs": "ssus",
"block.modchest.suspicious_block_minus_sieben": "sus",
"itemGroup.modchest.itemlist1": "new blocks", "itemGroup.modchest.itemlist1": "new blocks",
"chat.modchest.multispawn.beddestroyed": "Oh shit! Looks like that bed got destroyed!", "chat.modchest.multispawn.beddestroyed": "Oh shit! Looks like that bed got destroyed!",

View File

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "modchest:block/suspicious_block_texture"
}
}

View File

@ -0,0 +1,21 @@
{
"parent": "block/cube_all",
"textures": {
"0": "modchest:block/suspicious_block_texture",
"particle": "modchest:block/suspicious_block_texture"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 10, 16],
"faces": {
"north": {"uv": [0, 0, 16, 10], "texture": "#0"},
"east": {"uv": [0, 0, 16, 10], "texture": "#0"},
"south": {"uv": [0, 0, 16, 10], "texture": "#0"},
"west": {"uv": [0, 0, 16, 10], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]
}

View File

@ -0,0 +1,21 @@
{
"parent": "block/cube_all",
"textures": {
"0": "modchest:block/suspicious_block_texture",
"particle": "modchest:block/suspicious_block_texture"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 14, 16],
"faces": {
"north": {"uv": [0, 0, 16, 14], "texture": "#0"},
"east": {"uv": [0, 0, 16, 14], "texture": "#0"},
"south": {"uv": [0, 0, 16, 14], "texture": "#0"},
"west": {"uv": [0, 0, 16, 14], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]
}

View File

@ -0,0 +1,21 @@
{
"parent": "block/cube_all",
"textures": {
"0": "modchest:block/suspicious_block_texture",
"particle": "modchest:block/suspicious_block_texture"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 6, 16],
"faces": {
"north": {"uv": [0, 0, 16, 6], "texture": "#0"},
"east": {"uv": [0, 0, 16, 6], "texture": "#0"},
"south": {"uv": [0, 0, 16, 6], "texture": "#0"},
"west": {"uv": [0, 0, 16, 6], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]
}

View File

@ -0,0 +1,21 @@
{
"parent": "block/cube_all",
"textures": {
"0": "modchest:block/suspicious_block_texture",
"particle": "modchest:block/suspicious_block_texture"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 4, 16],
"faces": {
"north": {"uv": [0, 0, 16, 4], "texture": "#0"},
"east": {"uv": [0, 0, 16, 4], "texture": "#0"},
"south": {"uv": [0, 0, 16, 4], "texture": "#0"},
"west": {"uv": [0, 0, 16, 4], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]
}

View File

@ -0,0 +1,21 @@
{
"parent": "block/cube_all",
"textures": {
"0": "modchest:block/suspicious_block_texture",
"particle": "modchest:block/suspicious_block_texture"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 2, 16],
"faces": {
"north": {"uv": [0, 0, 16, 2], "texture": "#0"},
"east": {"uv": [0, 0, 16, 2], "texture": "#0"},
"south": {"uv": [0, 0, 16, 2], "texture": "#0"},
"west": {"uv": [0, 0, 16, 2], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]
}

View File

@ -0,0 +1,21 @@
{
"parent": "block/cube_all",
"textures": {
"0": "modchest:block/suspicious_block_texture",
"particle": "modchest:block/suspicious_block_texture"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 8, 16],
"faces": {
"north": {"uv": [0, 0, 16, 8], "texture": "#0"},
"east": {"uv": [0, 0, 16, 8], "texture": "#0"},
"south": {"uv": [0, 0, 16, 8], "texture": "#0"},
"west": {"uv": [0, 0, 16, 8], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]
}

View File

@ -0,0 +1,21 @@
{
"parent": "block/cube_all",
"textures": {
"0": "modchest:block/suspicious_block_texture",
"particle": "modchest:block/suspicious_block_texture"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 12, 16],
"faces": {
"north": {"uv": [0, 0, 16, 12], "texture": "#0"},
"east": {"uv": [0, 0, 16, 12], "texture": "#0"},
"south": {"uv": [0, 0, 16, 12], "texture": "#0"},
"west": {"uv": [0, 0, 16, 12], "texture": "#0"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]
}

View File

@ -0,0 +1,3 @@
{
"parent": "modchest:block/suspicious_block"
}

View File

@ -0,0 +1,3 @@
{
"parent": "modchest:block/suspicious_block_minus_drei"
}

View File

@ -0,0 +1,3 @@
{
"parent": "modchest:block/suspicious_block_minus_eins"
}

View File

@ -0,0 +1,3 @@
{
"parent": "modchest:block/suspicious_block_minus_fuenf"
}

View File

@ -0,0 +1,3 @@
{
"parent": "modchest:block/suspicious_block_minus_sechs"
}

View File

@ -0,0 +1,3 @@
{
"parent": "modchest:block/suspicious_block_minus_sieben"
}

View File

@ -0,0 +1,3 @@
{
"parent": "modchest:block/suspicious_block_minus_vier"
}

View File

@ -0,0 +1,3 @@
{
"parent": "modchest:block/suspicious_block_minus_zwei"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

View File

@ -0,0 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"MMM",
"M#M",
"MMM"
],
"key": {
"M":{
"item": "minecraft:honeycomb_block"
},
"#":{
"item": "minecraft:water_bucket"
}
},
"result": {
"item": "modchest:suspicious_block"
}
}