This commit is contained in:
2026-03-11 18:17:01 +01:00
parent d0d2183c77
commit ce206409a5
43 changed files with 718 additions and 7 deletions

View File

@@ -15,6 +15,7 @@ import net.minecraft.particle.BlockStateParticleEffect;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
@@ -130,6 +131,7 @@ public class FaszItem extends BlockItem {
// If the entity is a player → apply special effect logic
if (living instanceof PlayerEntity target) {
if (PlayerConfigStore.get(target, "nsfw")) { return;}
int chance = 5; // 1/5 default
ItemStack offhand = user.getOffHandStack();
if (!offhand.isEmpty() && offhand.isOf(CNDM.getItem())) {

View File

@@ -0,0 +1,41 @@
package dev.tggamesyt.szar;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.network.ServerPlayerEntity;
import java.util.*;
public class PlayerConfigStore {
// Map of player UUID → (setting id → value)
private static final Map<UUID, Map<String, Boolean>> store = new HashMap<>();
public static void set(ServerPlayerEntity player, Map<String, Boolean> config) {
store.put(player.getUuid(), config);
}
public static boolean get(ServerPlayerEntity player, String settingId) {
Map<String, Boolean> config = store.get(player.getUuid());
if (config == null) return false; // default if not synced yet
return config.getOrDefault(settingId, false);
}
public static boolean get(PlayerEntity player, String settingId) {
Map<String, Boolean> config = store.get(player.getUuid());
if (config == null) return false; // default if not synced yet
return config.getOrDefault(settingId, false);
}
public static boolean get(UUID uuid, String settingId) {
Map<String, Boolean> config = store.get(uuid);
if (config == null) return false;
return config.getOrDefault(settingId, false);
}
public static void remove(ServerPlayerEntity player) {
store.remove(player.getUuid());
}
public static boolean hasSynced(ServerPlayerEntity player) {
return store.containsKey(player.getUuid());
}
}

View File

@@ -103,7 +103,7 @@ public class RouletteBlock extends Block implements BlockEntityProvider {
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos,
PlayerEntity player, Hand hand, BlockHitResult hit) {
if (PlayerConfigStore.get(player, "gambling")) {return ActionResult.FAIL;}
if (hand != Hand.MAIN_HAND) return ActionResult.PASS;
BlockEntity blockEntity = world.getBlockEntity(pos);

View File

@@ -92,7 +92,7 @@ public class SlotMachineBlock extends Block implements BlockEntityProvider {
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos,
PlayerEntity player, Hand hand, BlockHitResult hit) {
if (PlayerConfigStore.get(player, "gambling")) {return ActionResult.FAIL;}
if (hand != Hand.MAIN_HAND) return ActionResult.PASS;
BlockEntity blockEntity = world.getBlockEntity(pos);

View File

@@ -133,13 +133,15 @@ public class Szar implements ModInitializer {
SoundEvent.of(new Identifier(Szar.MOD_ID, "won"))
);
public static final SoundEvent MERL_SOUND =
SoundEvent.of(new Identifier("szar", "merl"));
SoundEvent.of(new Identifier(MOD_ID, "merl"));
public static final Identifier PLANE_ANIM_PACKET =
new Identifier(MOD_ID, "plane_anim");
public static final Identifier NAZI_HAND_GESTURE = new Identifier("szar", "hit_hand");
public static final Identifier NAZI_HAND_GESTURE = new Identifier(MOD_ID, "hit_hand");
public static final Identifier OPEN_URL = new Identifier(MOD_ID, "epsteinfiles");
public static final Identifier PLAY_VIDEO =
new Identifier(MOD_ID, "play_video");
public static final Identifier CONFIG_SYNC = new Identifier(MOD_ID, "config_sync");
public static final Block SZAR_BLOCK =
new SzarBlock();
@@ -296,7 +298,7 @@ public class Szar implements ModInitializer {
new Identifier(MOD_ID, "szar_group"),
FabricItemGroup.builder()
.displayName(Text.translatable("itemgroup.szar_group"))
.icon(() -> new ItemStack(Szar.CIGANYBLOCK)) // icon item
.icon(() -> new ItemStack(Szar.CANNABIS_ITEM)) // icon item
.entries((displayContext, entries) -> {
// drugs
entries.add(Szar.CANNABIS_ITEM);
@@ -360,6 +362,27 @@ public class Szar implements ModInitializer {
private final Map<UUID, BlockPos> sleepingPlayers = new HashMap<>();
@Override
public void onInitialize() {
ServerPlayNetworking.registerGlobalReceiver(CONFIG_SYNC,
(server, player, handler, buf, responseSender) -> {
// Read on netty thread, process on server thread
int count = buf.readInt();
Map<String, Boolean> config = new HashMap<>();
for (int i = 0; i < count; i++) {
String id = buf.readString();
boolean value = buf.readBoolean();
config.put(id, value);
}
// Always handle game state on the server thread
server.execute(() -> {
PlayerConfigStore.set(player, config);
});
});
// Clean up when player leaves
ServerPlayConnectionEvents.DISCONNECT.register(
(handler, server) -> PlayerConfigStore.remove(handler.player)
);
PlayerMovementManager.init();
ServerCosmetics.init();
ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> {
@@ -1571,6 +1594,7 @@ public class Szar implements ModInitializer {
}
private void givePregnantEffect(ServerPlayerEntity player, ServerPlayerEntity partner, int chance) {
if (PlayerConfigStore.get(player, "nsfw") || PlayerConfigStore.get(partner, "nsfw")) { return; }
if (partner.getOffHandStack().getItem() == Szar.CNDM) {
partner.getOffHandStack().decrement(1);
partner.dropStack(new ItemStack(WHITE_LIQUID));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

@@ -88,5 +88,29 @@
"item.szar.hello.desc": "Alex Savage - OMFG - Hello (Dark Remix)",
"death.attack.plane_crash": "%1$s crashed their plane",
"death.attack.plane_crash.player": "%1$s was killed when %2$s crashed their plane"
"death.attack.plane_crash.player": "%1$s was killed when %2$s crashed their plane",
"painting.szar.nyansniffer.title": "Nyan Sniffer",
"painting.szar.nyansniffer.author": "Unknown (Szar Mod)",
"painting.szar.matrix.title": "Matrix",
"painting.szar.matrix.author": "Unknown (Szar Mod)",
"painting.szar.frogs.title": "Frogs",
"painting.szar.frogs.author": "Minecraft Live (Szar Mod)",
"painting.szar.bounce.title": "Bounce",
"painting.szar.bounce.author": "Unknown (Szar Mod)",
"painting.szar.block_wave.title": "Block Wave",
"painting.szar.block_wave.author": "Unknown (Szar Mod)",
"painting.szar.bloc.title": "Bloc",
"painting.szar.bloc.author": "Unknown (Szar Mod)",
"painting.szar.axolotl.title": "Axolotl",
"painting.szar.axolotl.author": "Unknown (Szar Mod)",
"painting.szar.chicken_jokey.title": "Chicken Jokey",
"painting.szar.chicken_jokey.author": "Unknown (Szar Mod)"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

View File

@@ -19,6 +19,9 @@
],
"main": [
"dev.tggamesyt.szar.Szar"
],
"modmenu": [
"dev.tggamesyt.szar.client.ModMenuIntegration"
]
},
"mixins": [
@@ -32,5 +35,9 @@
"fabricloader": ">=${loader_version}",
"fabric": "*",
"minecraft": "${minecraft_version}"
},
"suggests": {
"modmenu": "*",
"cloth-config": "*"
}
}

View File

@@ -0,0 +1,7 @@
{
"block.szar.fasz": "?",
"item.szar.epstein_files": "?",
"item.szar.cndm": "?",
"death.attack.fck": "%1$s was killed by %2$s",
"item.szar.white_liquid": "?"
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "szar:block/questionmark"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "szar:item/questionmark"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "szar:item/questionmark"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "szar:item/questionmark"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "szar:item/questionmark"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "szar:item/questionmark"
}
}

View File

@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 15,
"description": "Szar built-in resource pack"
}
}

View File

@@ -0,0 +1,25 @@
{
"block.szar.cigany": "? Block",
"item.szar.nwordpass": "?",
"entity.szar.nigger": "Monkey",
"item.szar.nigger_spawn_egg":"Monkey Spawn Egg",
"item.szar.gypsy_spawn_egg":"Burglar Spawn Egg",
"item.szar.niggerite_ingot": "Monkey Ingot",
"block.szar.niggerite_block": "Monkey Block",
"item.szar.niggerite_sword": "Monkey Sword",
"item.szar.niggerite_axe": "Monkey Axe",
"item.szar.niggerite_pickaxe": "Monkey Pickaxe",
"item.szar.niggerite_shovel": "Monkey Shovel",
"item.szar.niggerite_hoe": "Monkey Hoe",
"item.szar.niggerite_chestplate": "Monkey Chestplate",
"item.szar.niggerite_leggings": "Monkey Leggings",
"item.szar.niggerite_boots": "Monkey Boots",
"item.szar.niggerite_helmet": "Monkey Helmet",
"entity.szar.islam_terrorist": "Creeper Player",
"item.szar.terrorist_spawn_egg": "Creeper Player Spawn Egg",
"entity.szar.gypsy": "Burglar",
"item.szar.epstein_files": "?",
"entity.szar.epstein": "Old Man",
"item.szar.epstein_spawn_egg": "Old Man Spawn Egg"
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "szar:block/questionmark"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "szar:item/questionmark"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "szar:item/questionmark"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 15,
"description": "Szar built-in resource pack"
}
}