Files
TiedUp-/src/main/java/com/tiedup/remake/v2/blocks/ObjBlockEntity.java
NotEvil f6466360b6 Clean repo for open source release
Remove build artifacts, dev tool configs, unused dependencies,
and third-party source dumps. Add proper README, update .gitignore,
clean up Makefile.
2026-04-12 00:51:22 +02:00

67 lines
1.7 KiB
Java

package com.tiedup.remake.v2.blocks;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
/**
* Base block entity for blocks that render with OBJ models.
* Subclasses define the model and texture locations.
*/
public abstract class ObjBlockEntity extends BlockEntity {
public ObjBlockEntity(
BlockEntityType<?> type,
BlockPos pos,
BlockState state
) {
super(type, pos, state);
}
/**
* Get the OBJ model resource location.
* Example: "tiedup:models/obj/blocks/bowl/model.obj"
*/
@Nullable
public abstract ResourceLocation getModelLocation();
/**
* Get the texture resource location.
* Example: "tiedup:textures/block/bowl.png"
*/
@Nullable
public abstract ResourceLocation getTextureLocation();
/**
* Get the model scale (default 1.0).
* Override to scale the model up or down.
*/
public float getModelScale() {
return 1.0f;
}
/**
* Get the model position offset (x, y, z).
* Override to adjust model position within the block.
*/
public float[] getModelOffset() {
return new float[] { 0.0f, 0.0f, 0.0f };
}
@Override
protected void saveAdditional(CompoundTag tag) {
super.saveAdditional(tag);
// Subclasses can override to save additional data
}
@Override
public void load(CompoundTag tag) {
super.load(tag);
// Subclasses can override to load additional data
}
}