Skip to content

Commit

Permalink
clam launcher recipes and IDFK HOW TO FIX THE OCTOPUS AAAAAAAAAAAAAAA…
Browse files Browse the repository at this point in the history
…AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  • Loading branch information
N1nn1 committed Feb 13, 2024
1 parent e137769 commit 2910451
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/ninni/spawn/Spawn.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class Spawn implements ModInitializer {
@Override
public void onInitialize() {
Reflection.initialize(
SpawnSoundEvents.class,
SpawnEntityType.class,
SpawnSoundEvents.class,
SpawnFeatures.class,
SpawnMenuTypes.class,
SpawnBlockEntityTypes.class,
Expand All @@ -24,6 +24,7 @@ public void onInitialize() {
SpawnPointsOfInterests.class,
SpawnDecoratedPotPatterns.class
);

SpawnVanillaIntegration.serverInit();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class BlockEntityWithoutLevelRendererMixin {


@Inject(method = "renderByItem", at = @At("HEAD"))
private void DD$renderShulkerItems(ItemStack itemStack, ItemDisplayContext itemDisplayContext, PoseStack poseStack, MultiBufferSource multiBufferSource, int i, int j, CallbackInfo ci) {
private void S$renderByItem(ItemStack itemStack, ItemDisplayContext itemDisplayContext, PoseStack poseStack, MultiBufferSource multiBufferSource, int i, int j, CallbackInfo ci) {

if (itemStack.getItem() instanceof BlockItem blockItem && blockItem.getBlock() instanceof PigmentShifterBlock) {
this.blockEntityRenderDispatcher.renderItem(pigmentShifter, poseStack, multiBufferSource, i, j);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class SpawnBlockEntityTypes {
).build(null)
);

//TODO apparently this is null and cannot register an item while all the others work even tho nothing changes between them, this makes the game crash when opening the inventory
public static final BlockEntityType<PigmentShifterBlockEntity> PIGMENT_SHIFTER = Registry.register(
BuiltInRegistries.BLOCK_ENTITY_TYPE,
new ResourceLocation(Spawn.MOD_ID, "pigment_shifter"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
import com.ninni.spawn.client.renderer.block.PigmentShifterRenderer;
import com.ninni.spawn.client.renderer.block.WhaleUvulaRenderer;
import com.ninni.spawn.client.renderer.entity.*;
import com.ninni.spawn.entity.Clam;
import com.ninni.spawn.entity.Hamster;
import com.ninni.spawn.entity.Octopus;
import com.ninni.spawn.entity.*;
import com.ninni.spawn.entity.variant.ClamVariant;
import com.ninni.spawn.item.ClamCaseItem;
import net.fabricmc.api.EnvType;
Expand All @@ -26,9 +24,9 @@
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.fabricmc.fabric.api.registry.CompostingChanceRegistry;
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
import net.fabricmc.fabric.api.registry.StrippableBlockRegistry;
Expand All @@ -44,7 +42,6 @@
import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.DyeableLeatherItem;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.levelgen.GenerationStep;

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/spawn/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
"item.spawn.clam_case": "Clam Case",
"item.spawn.clam_case.fullness": "%s/%s",
"item.spawn.clam_case.desc": "Only stores Collected Mobs",
"block.spawn.clam_launcher": "Clam Launcher",
"block.spawn.pigment_shifter": "Pigment Shifter",
"container.spawn.pigment_shifter": "Customize",
"container.spawn.pigment_shifter.body_plan": "Change Body Plan",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"spawn:snail_shell_tiles",
"spawn:snail_shell_tile_stairs",
"spawn:snail_shell_tile_slab",
"spawn:pigment_shifter"
"spawn:pigment_shifter",
"spawn:clam_launcher"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": [
"spawn:shell_fragments"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "spawn:clam_launcher"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"spawn:clam_launcher"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": [
"minecraft:piston"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "spawn:clam_launcher_from_piston"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"spawn:clam_launcher"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "spawn:clam_launcher"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
20 changes: 20 additions & 0 deletions src/main/resources/data/spawn/recipes/clam_launcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" # ",
"#P#",
" # "
],
"key": {
"#": {
"item": "spawn:shell_fragments"
},
"P": {
"item": "minecraft:piston"
}
},
"result": {
"item": "spawn:clam_launcher",
"count": 1
}
}

0 comments on commit 2910451

Please sign in to comment.