Skip to content

Commit

Permalink
changes to malachite and sideways catalyst
Browse files Browse the repository at this point in the history
sideways catalyst is now craftable
peanut and peanut block have new texture (subject to change)
malachite crystals can be acquired by smelting malachite ore
malachite ore is now much more rare
  • Loading branch information
Bonnie39 committed Dec 24, 2023
1 parent 82f9800 commit 7ed53d3
Show file tree
Hide file tree
Showing 34 changed files with 163 additions and 92 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.19.4 2023-12-23T16:43:45.815762 Registries
// 1.19.4 2023-12-24T14:43:51.0584926 Registries
c75a69a06a66ad5a2ab402d7bca52e3e58098362 data/thesideways/worldgen/configured_feature/grass_patch.json
6b89cf197560d2f0286193a4ad084c6ab64059e9 data/thesideways/worldgen/configured_feature/luminite_ore.json
bce0e5b897875c6a20818a28094139036026f433 data/thesideways/worldgen/configured_feature/malachite_ore.json
Expand All @@ -9,7 +9,7 @@ d34e9d2ef4b473a6425b08cfe754d90a88213192 data/thesideways/worldgen/configured_fe
bfceef8c2987f4b06f5c331b3b20b85cdfc23768 data/thesideways/worldgen/configured_feature/water_lake.json
9b04d51f3cfef0ae3bcab5834507720f1b1ed51a data/thesideways/worldgen/placed_feature/grass_patch.json
045bd0b06006ba3979e3d56acb79eaef17679226 data/thesideways/worldgen/placed_feature/luminite_ore.json
8c8f1011cf6ed7022e4d255a810d5c37c30ea8eb data/thesideways/worldgen/placed_feature/malachite_ore.json
466ae8482484b0ff534c29d5061c5283c5d6a461 data/thesideways/worldgen/placed_feature/malachite_ore.json
e44dffee39b3cef39a47220d3faa861e1cbb1bfa data/thesideways/worldgen/placed_feature/nutroot_meadow_trees.json
10281d423157f205b24d55a771de99a443e978df data/thesideways/worldgen/placed_feature/tall_grass_patch.json
49bc8435422e405719f22a2d5112c159ce8566a2 data/thesideways/worldgen/placed_feature/water_lake.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// 1.19.4 2023-12-23T13:50:03.0130564 Item Models: thesideways
// 1.19.4 2023-12-24T14:01:46.5765935 Item Models: thesideways
901625fa096c864407b76b94d7720b82b55c6c3d assets/thesideways/models/item/luminite_shard.json
09f98a1b8d1c6d59f83db4553f9f8c5c7a9497db assets/thesideways/models/item/malachite_crystal.json
29e4d8ed33d1d56e6e5d390ae0b8b8d064eeaa08 assets/thesideways/models/item/nutroot_sapling.json
95a99734b982b8197e65491e2b5901a8a41974d4 assets/thesideways/models/item/peanut.json
604704bd3153e799487a3bdfc7e8416690ebe921 assets/thesideways/models/item/peanut_essence.json
14cb58c1df7f0cf8fe8d8a5697a62a1b620b917c assets/thesideways/models/item/peanut_juice.json
3644d7c303f1712526aca20d7c54781da15db3ea assets/thesideways/models/item/raw_luminite.json
bb52296dee83e3220a7e0b54d95708a8a1ece364 assets/thesideways/models/item/sideways_catalyst.json
ac4d550b04ae7a6ad370778f119416c1600d526c assets/thesideways/models/item/sideways_catalyst.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 1.19.4 2023-12-23T13:47:39.0209594 Loot Tables
// 1.19.4 2023-12-24T15:32:06.0093561 Loot Tables
8c1437ddb3c3cc74f8e559ac8bc66f868abd3156 data/thesideways/loot_tables/blocks/luminite_ore.json
1f7bbc9746db1d4c4d275052c4d8ca862b457e72 data/thesideways/loot_tables/blocks/malachite_block.json
f5d4556721894fa22484df0f16e9c1c1954be463 data/thesideways/loot_tables/blocks/malachite_ore.json
4685015cc8fddbe24f8c824a54feb58397a9aa23 data/thesideways/loot_tables/blocks/malachite_ore.json
c5380fbc01cbe1a246d3771cd5a0f0685ad0c539 data/thesideways/loot_tables/blocks/nutroot_leaves.json
f428e25fedc7b3a7ff44c073ef1a016f3e4ea362 data/thesideways/loot_tables/blocks/nutroot_log.json
da900aba2d686fda35cf930073a007bbd5cb8ce3 data/thesideways/loot_tables/blocks/nutroot_planks.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parent": "minecraft:item/generated",
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "thesideways:item/sideways_catalyst"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,15 @@
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "thesideways:malachite_ore"
},
{
"type": "minecraft:item",
"functions": [
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops",
"function": "minecraft:apply_bonus"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "thesideways:malachite_crystal"
}
]
"type": "minecraft:item",
"name": "thesideways:malachite_ore"
}
],
"rolls": 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"placement": [
{
"type": "minecraft:count",
"count": 8
"count": 2
},
{
"type": "minecraft:in_square"
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/dev/bonnie/thesideways/TheSideways.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@
import dev.bonnie.thesideways.world.dimension.ModDimensions;
import dev.bonnie.thesideways.world.feature.SidewaysFeatures;
import dev.bonnie.thesideways.world.placementmodifier.TheSidewaysPlacementModifiers;
import net.minecraft.client.Minecraft;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.CreativeModeTabEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModLoadingContext;
Expand All @@ -26,7 +22,6 @@
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLPaths;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.DeferredRegister;
import org.slf4j.Logger;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package dev.bonnie.thesideways;

import dev.bonnie.thesideways.block.ModBlocks;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.server.ServerLifecycleHooks;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.core.BlockPos;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(modid = TheSideways.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE)
public class TheSidewaysEventSubscriber {
private static final int TRANSFORM_CHANCE = 20; // Adjust this probability (out of 100)

@SubscribeEvent
public static void onServerTick(TickEvent.ServerTickEvent event) {
if (event.phase == TickEvent.Phase.END) {
// i cant figure it out
}
}
}



Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import dev.bonnie.thesideways.capability.SidewaysCapabilities;
import dev.bonnie.thesideways.capability.player.SidewaysPlayer;
import dev.bonnie.thesideways.mixin.mixins.common.accessor.EntityAccessor;
import dev.bonnie.thesideways.util.ModTags;
import dev.bonnie.thesideways.util.LevelUtil;
import dev.bonnie.thesideways.util.ModTags;
import dev.bonnie.thesideways.world.dimension.ModDimensions;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package dev.bonnie.thesideways.block.custom.portal;

import dev.bonnie.thesideways.client.SidewaysSoundEvents;
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
import net.minecraft.core.BlockPos;
import net.minecraft.sounds.SoundEvents;

public class SidewaysPortalSoundUtil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@
import dev.bonnie.thesideways.capability.player.SidewaysPlayerCapability;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LightningBolt;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.projectile.AbstractArrow;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.common.capabilities.CapabilityToken;
import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent;
import net.minecraftforge.event.AttachCapabilitiesEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;

@Mod.EventBusSubscriber(modid = TheSideways.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class SidewaysCapabilities {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
import dev.bonnie.thesideways.capability.INBTSynchable;
import dev.bonnie.thesideways.capability.SidewaysCapabilities;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.common.util.LazyOptional;

import javax.annotation.Nullable;
import java.util.List;
import java.util.UUID;
public interface SidewaysPlayer extends INBTSynchable<CompoundTag> {
Player getPlayer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import net.minecraftforge.network.simple.SimpleChannel;
import org.apache.commons.lang3.tuple.Triple;

import java.util.*;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Supplier;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import dev.bonnie.thesideways.item.ModItems;
import net.minecraft.data.loot.BlockLootSubProvider;
import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.RegistryObject;

import java.util.Set;
Expand All @@ -31,6 +28,7 @@ protected void generate() {
this.dropSelf(ModBlocks.NUTROOT_SAPLING.get());
this.dropSelf(ModBlocks.PEANUT_BLOCK.get());
this.dropSelf(ModBlocks.SIDEWAYS_COBBLESTONE.get());
this.dropSelf(ModBlocks.MALACHITE_ORE.get());
this.dropSelf(ModBlocks.MALACHITE_BLOCK.get());

this.add(ModBlocks.SIDEWAYS_STONE.get(), (block) ->
Expand All @@ -41,9 +39,6 @@ protected void generate() {

this.add(ModBlocks.LUMINITE_ORE.get(), (block) ->
createOreDrop(ModBlocks.LUMINITE_ORE.get(), ModItems.RAW_LUMINITE.get()));

this.add(ModBlocks.MALACHITE_ORE.get(), (block) ->
createOreDrop(ModBlocks.MALACHITE_ORE.get(), ModItems.MALACHITE_CRYSTAL.get()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

import dev.bonnie.thesideways.TheSideways;
import dev.bonnie.thesideways.block.ModBlocks;
import dev.bonnie.thesideways.block.custom.ModFlammableRotatedPillarBlock;
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.RotatedPillarBlock;
import net.minecraftforge.client.model.generators.BlockStateProvider;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected void registerModels() {

saplingItem(ModBlocks.NUTROOT_SAPLING);

simpleItem(ModItems.SIDEWAYS_CATALYST);
handheldItem(ModItems.SIDEWAYS_CATALYST);
}

private ItemModelBuilder simpleItem(RegistryObject<Item> item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.data.recipes.ShapelessRecipeBuilder;
import net.minecraftforge.common.crafting.conditions.IConditionBuilder;

import java.util.function.Consumer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import dev.bonnie.thesideways.block.ModBlocks;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.Resource;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.event.CreativeModeTabEvent;
Expand Down
42 changes: 36 additions & 6 deletions src/main/java/dev/bonnie/thesideways/item/custom/CatalystItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

import dev.bonnie.thesideways.block.ModBlocks;
import dev.bonnie.thesideways.block.custom.portal.SidewaysPortalBlock;
import dev.bonnie.thesideways.item.ModItems;
import dev.bonnie.thesideways.world.dimension.ModDimensions;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.context.UseOnContext;
Expand All @@ -23,20 +26,47 @@ public CatalystItem() {

@Override
public InteractionResult useOn(UseOnContext context) {
if(context.getPlayer() != null) {
if(context.getPlayer().level.dimension() == ModDimensions.SIDEWAYS_KEY
if (context.getPlayer() != null) {
if (context.getPlayer().level.dimension() == ModDimensions.SIDEWAYS_KEY
|| context.getPlayer().level.dimension() == Level.OVERWORLD) {
for(Direction direction : Direction.Plane.VERTICAL) {
for (Direction direction : Direction.Plane.VERTICAL) {
BlockPos framePos = context.getClickedPos().relative(direction);
if(((SidewaysPortalBlock) ModBlocks.SIDEWAYS_PORTAL.get()).trySpawnPortal(context.getLevel(), framePos)) {

if (((SidewaysPortalBlock) ModBlocks.SIDEWAYS_PORTAL.get()).trySpawnPortal(context.getLevel(), framePos)) {
// Play sound
context.getLevel().playSound(context.getPlayer(), framePos,
SoundEvents.PORTAL_TRIGGER, SoundSource.BLOCKS, 1.0F, 1.0F);
SoundEvents.FLINTANDSTEEL_USE, SoundSource.BLOCKS, 1.0F, 1.0F);

// Check which hand is holding the catalyst
InteractionHand hand = getHandHoldingItem(context.getPlayer(), ModItems.SIDEWAYS_CATALYST.get().asItem());

// Trigger arm swing animation on the client side for the hand holding the catalyst
if (hand != null) {
context.getPlayer().swing(hand, true);
}

return InteractionResult.CONSUME;
} else {
return InteractionResult.FAIL;
}
else return InteractionResult.FAIL;
}
}
}
return InteractionResult.FAIL;
}

private InteractionHand getHandHoldingItem(Player player, Item item) {
// Check main hand
if (player.getMainHandItem().getItem() == item) {
return InteractionHand.MAIN_HAND;
}

// Check offhand
if (player.getOffhandItem().getItem() == item) {
return InteractionHand.OFF_HAND;
}

// Item not found in either hand
return null;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.bonnie.thesideways.world.feature;

import dev.bonnie.thesideways.world.configuration.SidewaysLakeConfiguration;
import com.mojang.serialization.Codec;
import dev.bonnie.thesideways.world.configuration.SidewaysLakeConfiguration;
import net.minecraft.core.BlockPos;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.FluidTags;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.bonnie.thesideways.world.feature.builder;

import dev.bonnie.thesideways.world.placementmodifier.ImprovedLayerPlacementModifier;
import com.google.common.collect.ImmutableList;
import dev.bonnie.thesideways.world.placementmodifier.ImprovedLayerPlacementModifier;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.levelgen.placement.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.bonnie.thesideways.world.placementmodifier;

import com.google.gson.JsonSyntaxException;
import dev.bonnie.thesideways.TheSideways;
import dev.bonnie.thesideways.TheSidewaysConfig;
import net.minecraftforge.common.ForgeConfigSpec;

Expand Down
Loading

0 comments on commit 7ed53d3

Please sign in to comment.