Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ build
# other
eclipse
run
runs
/old/
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
package lilypuree.decorative_blocks.core;
package lilypuree.decorative_blocks;

import lilypuree.decorative_blocks.CommonAPI;
import lilypuree.decorative_blocks.blocks.BonfireBlock;
import lilypuree.decorative_blocks.blocks.SupportBlock;
import lilypuree.decorative_blocks.fluid.ThatchBlock;
import lilypuree.decorative_blocks.fluid.ThatchFluid;
import lilypuree.decorative_blocks.mixin.ItemAccessor;
import lilypuree.decorative_blocks.platform.Services;
import net.minecraft.client.renderer.block.model.ItemModelGenerator;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.phys.BlockHitResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
package lilypuree.decorative_blocks;

import lilypuree.decorative_blocks.blocks.*;
import lilypuree.decorative_blocks.core.DBBlocks;
import lilypuree.decorative_blocks.core.DBItems;
import lilypuree.decorative_blocks.core.Registration;
import lilypuree.decorative_blocks.registration.DBBlocks;
import lilypuree.decorative_blocks.registration.Registration;
import lilypuree.decorative_blocks.items.BlockstateCopyItem;
import lilypuree.decorative_blocks.mixin.FireBlockInvoker;
import lilypuree.decorative_blocks.platform.Services;
import lilypuree.decorative_blocks.registration.RegistryObject;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.block.Blocks;

public class DecorativeBlocksCommon {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package lilypuree.decorative_blocks.blocks;

import lilypuree.decorative_blocks.core.DBBlocks;
import lilypuree.decorative_blocks.core.Registration;
import lilypuree.decorative_blocks.compat.SoulFired;
import lilypuree.decorative_blocks.registration.DBBlocks;
import lilypuree.decorative_blocks.platform.Services;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.RandomSource;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
Expand Down Expand Up @@ -52,10 +51,10 @@ public VoxelShape getCollisionShape(BlockState state, BlockGetter worldIn, Block

@Override
public void entityInside(BlockState state, Level worldIn, BlockPos pos, Entity entityIn) {
if (!entityIn.fireImmune() && entityIn instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) entityIn)) {
entityIn.hurt(entityIn.damageSources().inFire(), 1.0F);
if (Services.PLATFORM.isModLoaded("soulfired")) {
Services.SOULFIRED.setSecondsOnFire(entityIn, 3, state.is(DBBlocks.SOUL_BONFIRE.get()));
if (!entityIn.fireImmune() && ((!(entityIn instanceof LivingEntity) || !EnchantmentHelper.hasFrostWalker((LivingEntity) entityIn)))) {
entityIn.hurt(entityIn.damageSources().inFire(), state.is(DBBlocks.SOUL_BONFIRE.get()) ? 2.0f : 1.0f);
if (Services.PLATFORM.isModLoaded("soul_fire_d")) {
SoulFired.setSecondsOnFire(entityIn, 3, state.is(DBBlocks.SOUL_BONFIRE.get()));
} else
entityIn.setSecondsOnFire(3);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package lilypuree.decorative_blocks.blocks;

import lilypuree.decorative_blocks.core.DBTags;
import lilypuree.decorative_blocks.registration.DBTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes;
Expand All @@ -10,7 +10,6 @@
import net.minecraft.util.RandomSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import lilypuree.decorative_blocks.blocks.state.ModBlockProperties;
import lilypuree.decorative_blocks.blocks.types.IWoodType;
import lilypuree.decorative_blocks.core.Registration;
import lilypuree.decorative_blocks.registration.Registration;
import lilypuree.decorative_blocks.entity.DummyEntityForSitting;
import lilypuree.decorative_blocks.items.SwitchableBlockItem;
import net.minecraft.core.BlockPos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
package lilypuree.decorative_blocks.client;

import com.ibm.icu.impl.StaticUnicodeSets;
import com.mojang.blaze3d.platform.InputConstants;
import com.sun.jna.platform.unix.X11;
import lilypuree.decorative_blocks.blocks.SeatBlock;
import lilypuree.decorative_blocks.blocks.SupportBlock;
import lilypuree.decorative_blocks.core.DBBlocks;
import lilypuree.decorative_blocks.registration.DBBlocks;
import lilypuree.decorative_blocks.items.SeatItem;
import lilypuree.decorative_blocks.items.SupportItem;
import lilypuree.decorative_blocks.items.SwitchableBlockItem;
import lilypuree.decorative_blocks.platform.Services;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.player.KeyboardInput;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.GameRules;
import org.lwjgl.glfw.GLFW;

import java.awt.event.KeyEvent;

public class ClientSetup {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package lilypuree.decorative_blocks.client;

import com.mojang.blaze3d.systems.RenderSystem;
import lilypuree.decorative_blocks.core.DBTags;
import lilypuree.decorative_blocks.registration.DBTags;
import lilypuree.decorative_blocks.fluid.ThatchFluid;
import net.minecraft.client.Camera;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.phys.Vec3;

public class FogHelper {
public static Info onColorFog(Camera camera) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package lilypuree.decorative_blocks.compat;

import it.crystalnest.soul_fire_d.api.FireManager;
import net.minecraft.world.entity.Entity;

public class SoulFired {
public static void setSecondsOnFire(Entity entity, int seconds, boolean isSoul) {
FireManager.setOnFire(entity, seconds, isSoul ? FireManager.SOUL_FIRE_TYPE : FireManager.DEFAULT_FIRE_TYPE);
}
}
86 changes: 0 additions & 86 deletions Common/src/main/java/lilypuree/decorative_blocks/core/DBItems.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package lilypuree.decorative_blocks.mixin;

import lilypuree.decorative_blocks.CommonAPI;
import lilypuree.decorative_blocks.core.DBTags;
import lilypuree.decorative_blocks.registration.DBTags;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package lilypuree.decorative_blocks.mixin;

import lilypuree.decorative_blocks.blocks.BrazierBlock;
import lilypuree.decorative_blocks.core.DBTags;
import lilypuree.decorative_blocks.registration.DBTags;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.pathfinder.WalkNodeEvaluator;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

import lilypuree.decorative_blocks.Constants;
import lilypuree.decorative_blocks.platform.services.IPlatformHelper;
import lilypuree.decorative_blocks.platform.services.SoulFiredHelper;

import java.util.ServiceLoader;

public class Services {
public static final IPlatformHelper PLATFORM = load(IPlatformHelper.class);
public static final SoulFiredHelper SOULFIRED = load(SoulFiredHelper.class);

public static <T> T load(Class<T> clazz) {

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

import lilypuree.decorative_blocks.entity.DummyEntityForSitting;
import lilypuree.decorative_blocks.fluid.ThatchFluid;
import lilypuree.decorative_blocks.registration.RegistryObject;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.item.ItemPropertyFunction;
import net.minecraft.core.DefaultedRegistry;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
Expand All @@ -16,21 +16,28 @@
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.FlowingFluid;

import java.util.function.Supplier;

public interface IPlatformHelper {

boolean isModLoaded(String modid);

<I, T extends I> Supplier<T> register(Registry<I> registry, String name, Supplier<T> sup);

GameRules.Key<GameRules.BooleanValue> registerGameRule(String name, GameRules.Category category, boolean defaultValue);

DummyEntityForSitting createDummyEntity(EntityType<DummyEntityForSitting> type, Level level);

LiquidBlock createThatchFluidBlock(RegistryObject<FlowingFluid> fluid, BlockBehaviour.Properties properties);
LiquidBlock createThatchFluidBlock(Supplier<ThatchFluid.Source> fluid, BlockBehaviour.Properties properties);

ThatchFluid createThatchFlowingFluid(ThatchFluid.FluidReferenceHolder referenceHolder);
default ThatchFluid.Flowing createThatchFlowingFluid(ThatchFluid.FluidReferenceHolder referenceHolder) {
return new ThatchFluid.Flowing(referenceHolder);
}

ThatchFluid createThatchStillFluid(ThatchFluid.FluidReferenceHolder referenceHolder);
default ThatchFluid.Source createThatchStillFluid(ThatchFluid.FluidReferenceHolder referenceHolder) {
return new ThatchFluid.Source(referenceHolder);
}

CreativeModeTab.Builder createModTab();

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package lilypuree.decorative_blocks.registration;

import net.minecraft.world.item.Item;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.Block;
import org.jetbrains.annotations.NotNull;

import java.util.function.Supplier;

public record BlockWrapper<T extends Block>(Supplier<T> supplier) implements Supplier<T>, ItemLike {

@Override
public T get() {
return supplier().get();
}

@Override
public @NotNull Item asItem() {
return supplier.get().asItem();
}
}
Loading