weed
This commit is contained in:
10
src/main/java/dev/tggamesyt/szar/DrogEffect.java
Normal file
10
src/main/java/dev/tggamesyt/szar/DrogEffect.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
import net.minecraft.entity.effect.StatusEffect;
|
||||
import net.minecraft.entity.effect.StatusEffectCategory;
|
||||
|
||||
public class DrogEffect extends StatusEffect {
|
||||
public DrogEffect() {
|
||||
super(StatusEffectCategory.HARMFUL, 0x5C4033); // white as default color
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,20 @@
|
||||
package dev.tggamesyt.szar;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
|
||||
import net.fabricmc.fabric.api.message.v1.ServerMessageDecoratorEvent;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
|
||||
import net.minecraft.advancement.Advancement;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.TallPlantBlock;
|
||||
import net.minecraft.entity.EntityDimensions;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.entity.effect.StatusEffect;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
@@ -32,8 +35,22 @@ public class Szar implements ModInitializer {
|
||||
public static final Block FASZ_BLOCK =
|
||||
new FaszBlock();
|
||||
public static final Identifier NWORDPACKET =
|
||||
new Identifier("szar", "nwordpacket");
|
||||
|
||||
new Identifier(MOD_ID, "nwordpacket");
|
||||
public static final ItemGroup SZAR_GROUP = Registry.register(
|
||||
Registries.ITEM_GROUP,
|
||||
new Identifier("modid", "szar_group"),
|
||||
FabricItemGroup.builder()
|
||||
.displayName(Text.translatable("itemgroup.szar_group"))
|
||||
.icon(() -> new ItemStack(Szar.CIGANYBLOCK)) // icon item
|
||||
.entries((displayContext, entries) -> {
|
||||
entries.add(Szar.CIGANYBLOCK);
|
||||
entries.add(Szar.FASZITEM);
|
||||
entries.add(Szar.NWORD_PASS);
|
||||
entries.add(Szar.NIGGER_SPAWNEGG);
|
||||
entries.add(Szar.CANNABIS_ITEM);
|
||||
})
|
||||
.build()
|
||||
);
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
|
||||
@@ -44,12 +61,6 @@ public class Szar implements ModInitializer {
|
||||
SZAR_BLOCK
|
||||
);
|
||||
|
||||
// register item so you can hold it
|
||||
Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "cigany"),
|
||||
new BlockItem(SZAR_BLOCK, new Item.Settings())
|
||||
);
|
||||
|
||||
Registry.register(
|
||||
Registries.BLOCK,
|
||||
@@ -57,13 +68,6 @@ public class Szar implements ModInitializer {
|
||||
FASZ_BLOCK
|
||||
);
|
||||
|
||||
// register item so you can hold it
|
||||
Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "fasz"),
|
||||
new FaszItem(FASZ_BLOCK, new Item.Settings())
|
||||
);
|
||||
|
||||
ServerMessageDecoratorEvent.EVENT.register((player, message) -> CompletableFuture.completedFuture(
|
||||
filterMessage(player, message)
|
||||
));
|
||||
@@ -73,24 +77,73 @@ public class Szar implements ModInitializer {
|
||||
NiggerEntity.createAttributes()
|
||||
);
|
||||
}
|
||||
public static final Item NWORD_PASS = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "nwordpass"),
|
||||
new NwordPassItem(new Item.Settings())
|
||||
);
|
||||
public static final StatusEffect DROG_EFFECT = Registry.register(
|
||||
Registries.STATUS_EFFECT,
|
||||
new Identifier(MOD_ID, "drog"),
|
||||
new DrogEffect()
|
||||
);
|
||||
public static final Block CANNABIS_BLOCK = Registry.register(
|
||||
Registries.BLOCK,
|
||||
new Identifier(MOD_ID, "cannabis"),
|
||||
new TallPlantBlock(
|
||||
FabricBlockSettings.copyOf(Blocks.LARGE_FERN)
|
||||
)
|
||||
);
|
||||
public static final Item CANNABIS_ITEM = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "cannabis"),
|
||||
new BlockItem(
|
||||
CANNABIS_BLOCK,
|
||||
new Item.Settings()
|
||||
)
|
||||
);
|
||||
public static final Item WEED_ITEM = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "weed"),
|
||||
new Item(new Item.Settings())
|
||||
);
|
||||
public static final Item CIGANYBLOCK = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "cigany"),
|
||||
new BlockItem(SZAR_BLOCK, new Item.Settings())
|
||||
);
|
||||
public static final Item FASZITEM = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "fasz"),
|
||||
new FaszItem(FASZ_BLOCK, new Item.Settings())
|
||||
);
|
||||
public static final Item NWORD_PASS = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "nwordpass"),
|
||||
new NwordPassItem(new Item.Settings())
|
||||
);
|
||||
public static final EntityType<NiggerEntity> NiggerEntityType =
|
||||
Registry.register(
|
||||
Registries.ENTITY_TYPE,
|
||||
new Identifier("szar", "nigger"),
|
||||
FabricEntityTypeBuilder
|
||||
.create(SpawnGroup.CREATURE, NiggerEntity::new)
|
||||
.dimensions(EntityDimensions.fixed(0.6F, 1.8F)) // player-sized
|
||||
.build()
|
||||
);
|
||||
Registry.register(
|
||||
Registries.ENTITY_TYPE,
|
||||
new Identifier(MOD_ID, "nigger"),
|
||||
FabricEntityTypeBuilder
|
||||
.create(SpawnGroup.CREATURE, NiggerEntity::new)
|
||||
.dimensions(EntityDimensions.fixed(0.6F, 1.8F)) // player-sized
|
||||
.build()
|
||||
);
|
||||
public static final Item NIGGER_SPAWNEGG = Registry.register(
|
||||
Registries.ITEM,
|
||||
new Identifier(MOD_ID, "nigger_spawn_egg"),
|
||||
new SpawnEggItem(
|
||||
NiggerEntityType,
|
||||
0x964B00,
|
||||
0x654321,
|
||||
new Item.Settings()
|
||||
)
|
||||
);
|
||||
|
||||
private static final List<String> FORBIDDEN_WORDS = List.of(
|
||||
"nigger",
|
||||
"niger",
|
||||
"niga"
|
||||
"niga",
|
||||
"nigga",
|
||||
"neger",
|
||||
"néger"
|
||||
);
|
||||
private static Text filterMessage(ServerPlayerEntity player, Text original) {
|
||||
|
||||
@@ -134,7 +187,7 @@ public static final Item NWORD_PASS = Registry.register(
|
||||
Advancement advancement = player
|
||||
.getServer()
|
||||
.getAdvancementLoader()
|
||||
.get(new Identifier("szar", "nwordpass"));
|
||||
.get(new Identifier(MOD_ID, "nwordpass"));
|
||||
|
||||
if (advancement == null) return false;
|
||||
|
||||
|
||||
6
src/main/resources/assets/szar/blockstates/cannabis.json
Normal file
6
src/main/resources/assets/szar/blockstates/cannabis.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"variants": {
|
||||
"half=lower": { "model": "szar:block/cannabis_bottom" },
|
||||
"half=upper": { "model": "szar:block/cannabis" }
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,10 @@
|
||||
"block.szar.cigany": "Cigány Block",
|
||||
"block.szar.fasz": "Fasz",
|
||||
"item.szar.nwordpass": "N-Word Pass",
|
||||
"entity.szar.nigger": "Nigger"
|
||||
"entity.szar.nigger": "Nigger",
|
||||
"item.szar.nigger_spawn_egg":"Nigger Spawn Egg",
|
||||
"itemgroup.szar_group": "Szar",
|
||||
"block.szar.cannabis": "Cannabis",
|
||||
"item.szar.weed": "Weed",
|
||||
"effect.szar.drog": "Drog"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cross",
|
||||
"textures": {
|
||||
"cross": "szar:block/cannabis"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:block/cross",
|
||||
"textures": {
|
||||
"cross": "szar:block/cannabis_bottom"
|
||||
}
|
||||
}
|
||||
6
src/main/resources/assets/szar/models/item/cannabis.json
Normal file
6
src/main/resources/assets/szar/models/item/cannabis.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "szar:block/cannabis"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "minecraft:item/template_spawn_egg"
|
||||
}
|
||||
6
src/main/resources/assets/szar/models/item/weed.json
Normal file
6
src/main/resources/assets/szar/models/item/weed.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "szar:item/weed"
|
||||
}
|
||||
}
|
||||
BIN
src/main/resources/assets/szar/textures/block/cannabis.png
Normal file
BIN
src/main/resources/assets/szar/textures/block/cannabis.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 453 B |
Binary file not shown.
|
After Width: | Height: | Size: 508 B |
BIN
src/main/resources/assets/szar/textures/item/weed.png
Normal file
BIN
src/main/resources/assets/szar/textures/item/weed.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 295 B |
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"rolls": 1,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "szar:cannabis"
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:any_of",
|
||||
"terms": [
|
||||
{
|
||||
"condition": "minecraft:match_tool",
|
||||
"predicate": {
|
||||
"items": ["minecraft:shears"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"condition": "minecraft:match_tool",
|
||||
"predicate": {
|
||||
"enchantments": [
|
||||
{
|
||||
"enchantment": "minecraft:silk_touch",
|
||||
"levels": { "min": 1 }
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"condition": "minecraft:random_chance",
|
||||
"chance": 0.5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
9
src/main/resources/data/szar/recipes/weed.json
Normal file
9
src/main/resources/data/szar/recipes/weed.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"type": "minecraft:smelting",
|
||||
"ingredient": {
|
||||
"item": "szar:cannabis"
|
||||
},
|
||||
"result": "szar:weed",
|
||||
"experience": 0.67,
|
||||
"cookingtime": 100
|
||||
}
|
||||
Reference in New Issue
Block a user