Merge branch '1.21' into new-container-api

This commit is contained in:
DBotThePony 2025-03-01 11:28:16 +07:00
commit abf74e4a2b
Signed by: DBot
GPG Key ID: DCC23B5715498507
34 changed files with 429 additions and 69 deletions

View File

@ -99,6 +99,7 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.resource(MItems.TRITANIUM_ORE_CLUMP)
provider.resource(MItems.DILITHIUM_CRYSTAL)
provider.resource(MItems.WITHERED_STEEL)
provider.generated(MItems.EXOPACK_PROBE)
@ -108,6 +109,8 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.handheld(MItems.CHEST_UPGRADER)
provider.generated(MItems.BREAD_MONSTER_SPAWN_EGG, modLocation("item/egg/bread_monster"))
provider.generatedTiered(MItems.BATTERIES, "battery_tier")
provider.generated(MItems.BATTERY_CREATIVE)
provider.generated(MItems.PROCEDURAL_BATTERY, modLocation("item/battery_procedural"))

View File

@ -772,6 +772,8 @@ private fun items(provider: MatteryLanguageProvider) {
add(MItems.TRITANIUM_SHEARS, "Tritanium Shears")
add(MItems.TRITANIUM_SHIELD, "Tritanium Shield")
add(MItems.WITHERED_STEEL_SWORD, "Withered Steel Sword")
add(MItems.TRITANIUM_HELMET, "Tritanium Helmet")
add(MItems.TRITANIUM_CHESTPLATE, "Tritanium Chestplate")
add(MItems.TRITANIUM_PANTS, "Tritanium Leggings")
@ -785,6 +787,7 @@ private fun items(provider: MatteryLanguageProvider) {
add(MItems.TRITANIUM_DUST, "Tritanium Dust")
add(MItems.TRITANIUM_INGOT, "Tritanium Ingot")
add(MItems.DILITHIUM_CRYSTAL, "Dilithium Crystal")
add(MItems.WITHERED_STEEL, "Withered Steel Ingot")
add(MItems.TRITANIUM_NUGGET, "Tritanium Nugget")
add(MItems.MATTER_IO_PORT, "Matter IO Port")
add(MItems.MATTER_TRANSFORM_MATRIX, "Matter Transformation Matrix")
@ -909,6 +912,9 @@ private fun items(provider: MatteryLanguageProvider) {
add(MItems.CHEST_UPGRADER, "Crate-r")
add(MItems.CHEST_UPGRADER, "desc", "Replaces placed chests and barrels with cargo crates while keeping storage contents")
add(MItems.CHEST_UPGRADER, "desc2", "Hold desired crates in the opposite hand")
add(MItems.BREAD_MONSTER_SPAWN_EGG, "Bread Monster Spawn Egg")
add(MEntityTypes.BREAD_MONSTER, "Bread Monster")
}
}

View File

@ -765,6 +765,8 @@ private fun items(provider: MatteryLanguageProvider) {
add(MItems.TRITANIUM_SHEARS, "Тритановые ножницы")
add(MItems.TRITANIUM_SHIELD, "Тритановый щит")
add(MItems.WITHERED_STEEL_SWORD, "Меч из иссушенной стали")
add(MItems.TRITANIUM_HELMET, "Тритановый шлем")
add(MItems.TRITANIUM_CHESTPLATE, "Тритановый нагрудник")
add(MItems.TRITANIUM_PANTS, "Тритановые поножи")
@ -778,6 +780,7 @@ private fun items(provider: MatteryLanguageProvider) {
add(MItems.TRITANIUM_DUST, "Тритановая пыль")
add(MItems.TRITANIUM_INGOT, "Тритановый слиток")
add(MItems.DILITHIUM_CRYSTAL, "Дилитевый кристалл")
add(MItems.WITHERED_STEEL, "Слиток иссушенной стали")
add(MItems.TRITANIUM_NUGGET, "Тритановый самородок")
add(MItems.MATTER_IO_PORT, "Порт ввода/вывода материи")
add(MItems.MATTER_TRANSFORM_MATRIX, "Матрица преобразования материи")
@ -902,6 +905,9 @@ private fun items(provider: MatteryLanguageProvider) {
add(MItems.CHEST_UPGRADER, "Ящикатор")
add(MItems.CHEST_UPGRADER, "desc", "Заменяет установленные сундуки и бочки грузовыми ящиками с сохранением содержимого")
add(MItems.CHEST_UPGRADER, "desc2", "Удерживайте необходимые ящики в противоположной руке")
add(MItems.BREAD_MONSTER_SPAWN_EGG, "Яйцо призыва хлебного монстра")
add(MEntityTypes.BREAD_MONSTER, "Хлебный монстр")
}
}

View File

@ -204,6 +204,16 @@ fun addLootModifiers(it: LootModifiers) {
ItemStack(MItems.EXOPACK_PROBE)
))
it.add("withered_skeleton_steel_drop", PlainLootAppender(
arrayOf(
LootTableIdCondition(EntityType.WITHER_SKELETON.defaultLootTable),
KilledByRealPlayerOrIndirectly
),
ItemStack(MItems.WITHERED_STEEL, 1) to 0.24,
ItemStack(MItems.WITHERED_STEEL, 2) to 0.11
))
it.add("wither_exosuit_upgrades", BasicLootAppender(
arrayOf(
LootTableIdCondition(EntityType.WITHER.defaultLootTable),

View File

@ -120,12 +120,14 @@ fun addMultiblockRecipes(consumer: RecipeOutput) {
.row(MItemTags.IRON_PLATES, Tags.Items.INGOTS_IRON, MItemTags.IRON_PLATES)
.rowAC(Tags.Items.INGOTS_IRON, Tags.Items.INGOTS_IRON)
.row(MItemTags.IRON_PLATES, Tags.Items.INGOTS_IRON, MItemTags.IRON_PLATES)
.unlockedBy(MItemTags.IRON_PLATES)
.build(consumer)
MatteryRecipe(MItems.HEAVY_MODULAR_FRAME, count = 2, category = machinesCategory)
.rowB(MItems.REINFORCED_IRON_PLATE)
.row(MItems.WITHERED_STEEL, MItems.REINFORCED_IRON_PLATE, MItems.WITHERED_STEEL,)
.row(MItems.REINFORCED_IRON_PLATE, MItems.MODULAR_FRAME, MItems.REINFORCED_IRON_PLATE)
.rowB(MItems.REINFORCED_IRON_PLATE)
.row(MItems.WITHERED_STEEL, MItems.REINFORCED_IRON_PLATE, MItems.WITHERED_STEEL,)
.unlockedBy(MItems.MODULAR_FRAME)
.build(consumer)
// blackhole generator
@ -135,7 +137,7 @@ fun addMultiblockRecipes(consumer: RecipeOutput) {
.row(MItems.MATTER_CAPACITOR_PARTS, Tags.Items.GEMS_DIAMOND, MItems.MATTER_CAPACITOR_PARTS)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_HULL, count = 4, category = machinesCategory)
MatteryRecipe(MItems.TRITANIUM_HULL, count = 2, category = machinesCategory)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.IRON_PLATES, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.IRON_PLATES, MItems.MODULAR_FRAME, MItemTags.IRON_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.IRON_PLATES, MItemTags.TRITANIUM_PLATES)

View File

@ -58,4 +58,11 @@ fun addToolsRecipes(consumer: RecipeOutput) {
.rowB(Tags.Items.RODS_WOODEN)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(MItems.WITHERED_STEEL_SWORD, category = RecipeCategory.COMBAT)
.rowB(MItems.WITHERED_STEEL)
.rowB(MItems.WITHERED_STEEL)
.rowB(Tags.Items.RODS_WOODEN)
.unlockedBy(MItems.WITHERED_STEEL)
.build(consumer)
}

View File

@ -0,0 +1,77 @@
package ru.dbotthepony.mc.otm.client.animation;
import net.minecraft.client.animation.AnimationChannel;
import net.minecraft.client.animation.AnimationDefinition;
import net.minecraft.client.animation.Keyframe;
import net.minecraft.client.animation.KeyframeAnimations;
public class BreadMonsterAnimation {
public static final AnimationDefinition IDLE = AnimationDefinition.Builder.withLength(1.44F).looping()
.addAnimation("Body", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, -2.5F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, 3.33F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.44F, KeyframeAnimations.degreeVec(0.0F, -2.5F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("Ljaw", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(2.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(5.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.44F, KeyframeAnimations.degreeVec(2.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("UJaw", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-2.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(-5.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.44F, KeyframeAnimations.degreeVec(-2.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("tail", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 5.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, -7.5F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.44F, KeyframeAnimations.degreeVec(0.0F, 5.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.build();
public static final AnimationDefinition MOVE = AnimationDefinition.Builder.withLength(1.44F).looping()
.addAnimation("root", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(1.0F, 0.0F, 2.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.posVec(0.0F, 5.0F, -1.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.posVec(-1.0F, 0.0F, -1.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.posVec(-2.0F, 0.0F, 2.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.84F, KeyframeAnimations.posVec(0.0F, 5.0F, -1.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.96F, KeyframeAnimations.posVec(1.0F, 0.0F, -1.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.44F, KeyframeAnimations.posVec(1.0F, 0.0F, 2.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("Body", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(7.5283F, 4.9571F, 0.6543F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.2F, KeyframeAnimations.degreeVec(12.5094F, 1.6524F, 0.2181F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.84F, KeyframeAnimations.degreeVec(7.5283F, -4.9571F, -0.6543F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.92F, KeyframeAnimations.degreeVec(15.0189F, -3.3047F, -0.4362F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.96F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("Ljaw", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(25.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.32F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.84F, KeyframeAnimations.degreeVec(25.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.04F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("UJaw", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(-25.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.32F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.84F, KeyframeAnimations.degreeVec(-30.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.04F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("tail", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(-10.0374F, -4.9238F, 0.8704F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.84F, KeyframeAnimations.degreeVec(-12.5462F, 4.8812F, -1.0848F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.96F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.build();
}

View File

@ -0,0 +1,73 @@
package ru.dbotthepony.mc.otm.client.model.entity;
import net.minecraft.client.model.HierarchicalModel;
import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.CubeDeformation;
import net.minecraft.client.model.geom.builders.CubeListBuilder;
import net.minecraft.client.model.geom.builders.LayerDefinition;
import net.minecraft.client.model.geom.builders.MeshDefinition;
import net.minecraft.client.model.geom.builders.PartDefinition;
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import org.jetbrains.annotations.NotNull;
import ru.dbotthepony.mc.otm.client.animation.BreadMonsterAnimation;
import ru.dbotthepony.mc.otm.entity.BreadMonster;
import ru.dbotthepony.mc.otm.registry.MNames;
import static ru.dbotthepony.mc.otm.OverdriveThatMatters.loc;
public class BreadMonsterModel {
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(loc(MNames.BREAD_MONSTER), "main");
private static HierarchicalModel<BreadMonster> model;
private static LayerDefinition def;
public static HierarchicalModel<BreadMonster> getModel() {
if (model == null) {
return model = new BreadMonsterHierarchicalModel<>(def.bakeRoot());
}
return model;
}
public static LayerDefinition createBodyLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();
PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F));
PartDefinition Body = root.addOrReplaceChild("Body", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -3.0F, -5.0F, 8.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -3.0F, 0.0F));
PartDefinition Ljaw = Body.addOrReplaceChild("Ljaw", CubeListBuilder.create().texOffs(26, 24).addBox(-4.0F, -2.0F, -4.0F, 8.0F, 3.0F, 4.0F, new CubeDeformation(0.1F)), PartPose.offset(0.0F, 2.0F, -3.0F));
PartDefinition UJaw = Body.addOrReplaceChild("UJaw", CubeListBuilder.create().texOffs(0, 24).addBox(-4.0F, -2.0F, -4.0F, 8.0F, 3.0F, 5.0F, new CubeDeformation(0.1F)), PartPose.offset(0.0F, -1.0F, -3.0F));
PartDefinition tail = Body.addOrReplaceChild("tail", CubeListBuilder.create().texOffs(0, 12).addBox(-4.0F, -3.0F, -0.1F, 8.0F, 6.0F, 6.0F, new CubeDeformation(-0.1F)), PartPose.offset(0.0F, 0.0F, 1.0F));
model = null;
return def = LayerDefinition.create(meshdefinition, 64, 32);
}
private static class BreadMonsterHierarchicalModel<T extends BreadMonster> extends HierarchicalModel<T> {
private final ModelPart root;
public BreadMonsterHierarchicalModel(ModelPart root) {
this.root = root.getChild("root");
}
@Override
public void setupAnim(@NotNull T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
this.root().getAllParts().forEach(ModelPart::resetPose);
// this.applyStatic(BreadMonsterAnimation.IDLE);
this.animate(entity.getIdleState(), BreadMonsterAnimation.IDLE, ageInTicks, 1.0F);
this.animateWalk(BreadMonsterAnimation.MOVE, limbSwing, limbSwingAmount, 1.0F, 2.5F);
}
@Override
public @NotNull ModelPart root() {
return this.root;
}
}
public static void register(EntityRenderersEvent.RegisterLayerDefinitions event) {
event.registerLayerDefinition(LAYER_LOCATION, BreadMonsterModel::createBodyLayer);
}
}

View File

@ -24,6 +24,7 @@ import ru.dbotthepony.mc.otm.client.createCursors
import ru.dbotthepony.mc.otm.client.model.ExosuitModel
import ru.dbotthepony.mc.otm.client.model.GravitationStabilizerModel
import ru.dbotthepony.mc.otm.client.model.TritaniumArmorModel
import ru.dbotthepony.mc.otm.client.model.entity.BreadMonsterModel
import ru.dbotthepony.mc.otm.client.onMovementInputUpdate
import ru.dbotthepony.mc.otm.client.onScreenOpen
import ru.dbotthepony.mc.otm.client.onPostScreenInit
@ -150,6 +151,7 @@ object OverdriveThatMatters {
MOD_BUS.addListener(EventPriority.NORMAL, AndroidAbilityKeyMapping::register)
MOD_BUS.addListener(EventPriority.NORMAL, TritaniumArmorModel::register)
MOD_BUS.addListener(EventPriority.NORMAL, GravitationStabilizerModel::register)
MOD_BUS.addListener(EventPriority.NORMAL, BreadMonsterModel::register)
MOD_BUS.addListener(EventPriority.NORMAL, MCreativeTabs::register)
MOD_BUS.addListener(EventPriority.NORMAL, BatteryBankRenderer.Companion::onRegisterAdditionalModels)

View File

@ -0,0 +1,18 @@
package ru.dbotthepony.mc.otm.client.render.entity
import net.minecraft.client.model.HierarchicalModel
import net.minecraft.client.renderer.entity.EntityRendererProvider
import net.minecraft.client.renderer.entity.MobRenderer
import net.minecraft.resources.ResourceLocation
import ru.dbotthepony.mc.otm.OverdriveThatMatters.loc
import ru.dbotthepony.mc.otm.client.model.entity.BreadMonsterModel
import ru.dbotthepony.mc.otm.entity.BreadMonster
class BreadMonsterRenderer(context: EntityRendererProvider.Context)
: MobRenderer<BreadMonster, HierarchicalModel<BreadMonster>>(context, BreadMonsterModel.getModel(), 0.4f) {
override fun getTextureLocation(entity: BreadMonster): ResourceLocation = TEXTURE_LOCATION
companion object {
private val TEXTURE_LOCATION = loc("textures/entity/bread_monster.png")
}
}

View File

@ -196,10 +196,6 @@ class ExopackInventoryScreen(menu: ExopackInventoryMenu) : MatteryScreen<Exopack
it.dockResize = DockResizeMode.NONE
}
}
if (menu.furnaceMenuOpenState.get()) {
tab.activate()
}
}
if (menu.capability.isExopackEnderAccessInstalled) {
@ -236,10 +232,6 @@ class ExopackInventoryScreen(menu: ExopackInventoryMenu) : MatteryScreen<Exopack
menu.enderChestSlots.forEach {
SlotPanel(this, grid, it)
}
if (menu.enderChestOpenState.get()) {
tab.activate()
}
}
makeChargePanels(frame)
@ -295,6 +287,8 @@ class ExopackInventoryScreen(menu: ExopackInventoryMenu) : MatteryScreen<Exopack
}
init {
menu.enderChestOpenState.value = false
menu.furnaceMenuOpenState.value = false
PacketDistributor.sendToServer(ExopackMenuOpen)
ru.dbotthepony.mc.otm.client.minecraft.player?.containerMenu = menu
}

View File

@ -320,7 +320,8 @@ class DeviceControls<out S : MatteryScreen<*>>(
val fluidConfig: FluidConfigPlayerInput? = null,
val balanceInputs: BooleanInputWithFeedback? = null,
val upgrades: UpgradeSlots? = null,
val experience: TakeExperienceWidget? = null
val experience: TakeExperienceWidget? = null,
var dockOnLeft: Boolean = false,
) : EditablePanel<S>(screen, parent, x = parent.width + 3f, height = 0f, width = 0f) {
val itemConfigButton: ButtonPanel<S>?
val energyConfigButton: ButtonPanel<S>?
@ -733,7 +734,12 @@ class DeviceControls<out S : MatteryScreen<*>>(
override fun preRender(graphics: MGUIGraphics, mouseX: Float, mouseY: Float, partialTick: Float) {
if (parent is FramePanel<*>) {
x = parent!!.width + 3f
if (dockOnLeft) {
x = -width - 3f
} else {
x = parent!!.width + 3f
}
y = dockTop
}
}

View File

@ -0,0 +1,51 @@
package ru.dbotthepony.mc.otm.entity
import net.minecraft.world.entity.AnimationState
import net.minecraft.world.entity.EntityType
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.attributes.AttributeSupplier
import net.minecraft.world.entity.ai.attributes.Attributes
import net.minecraft.world.entity.ai.goal.LeapAtTargetGoal
import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal
import net.minecraft.world.entity.ai.goal.MeleeAttackGoal
import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal
import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal
import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal
import net.minecraft.world.entity.ai.navigation.GroundPathNavigation
import net.minecraft.world.entity.ai.navigation.PathNavigation
import net.minecraft.world.entity.monster.Monster
import net.minecraft.world.entity.player.Player
import net.minecraft.world.level.Level
class BreadMonster(type: EntityType<BreadMonster>, level: Level) : Monster(type, level) {
val idleState = AnimationState()
init {
idleState.start(tickCount)
}
override fun registerGoals() {
goalSelector.addGoal(8, RandomLookAroundGoal(this))
goalSelector.addGoal(7, WaterAvoidingRandomStrollGoal(this, 0.8))
goalSelector.addGoal(8, LookAtPlayerGoal(this, Player::class.java, 8f))
goalSelector.addGoal(3, NearestAttackableTargetGoal(this, LivingEntity::class.java , true, true))
goalSelector.addGoal(3, NearestAttackableTargetGoal(this, Player::class.java , true, true))
goalSelector.addGoal(1, LeapAtTargetGoal(this, 0.4f))
goalSelector.addGoal(2, MeleeAttackGoal(this, 1.3, true))
targetSelector.addGoal(1, HurtByTargetGoal(this))
}
override fun createNavigation(level: Level): PathNavigation = GroundPathNavigation(this, level)
companion object {
fun createAttributes() : AttributeSupplier.Builder {
return createMonsterAttributes()
.add(Attributes.MAX_HEALTH, 16.0)
.add(Attributes.MOVEMENT_SPEED, 0.3)
.add(Attributes.ATTACK_DAMAGE, 3.0)
}
}
}

View File

@ -0,0 +1,53 @@
package ru.dbotthepony.mc.otm.item.weapon
import net.minecraft.world.effect.MobEffectInstance
import net.minecraft.world.effect.MobEffects
import net.minecraft.world.entity.EquipmentSlotGroup
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.ai.attributes.AttributeModifier
import net.minecraft.world.entity.ai.attributes.Attributes
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.SwordItem
import net.minecraft.world.item.Tiers
import net.minecraft.world.item.component.ItemAttributeModifiers
import ru.dbotthepony.mc.otm.registry.game.MItems
class WitheredSteelSwordItem(properties: Item.Properties) : SwordItem(Tiers.IRON, properties){
private val attributes: ItemAttributeModifiers
init {
var builder = ItemAttributeModifiers.builder()
builder.add(Attributes.ATTACK_DAMAGE, AttributeModifier(BASE_ATTACK_DAMAGE_ID, 4.5, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND)
builder.add(Attributes.ATTACK_SPEED, AttributeModifier(BASE_ATTACK_SPEED_ID, -2.4, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND)
attributes = builder.build()
}
override fun getMaxDamage(stack: ItemStack): Int {
return 420
}
override fun isEnchantable(p_41456_: ItemStack): Boolean {
return p_41456_.count == 1
}
override fun getEnchantmentValue(stack: ItemStack): Int {
return 10
}
override fun isValidRepairItem(stack: ItemStack, ingredient: ItemStack): Boolean {
return ingredient.`is`(MItems.WITHERED_STEEL)
}
override fun hurtEnemy(stack: ItemStack, target: LivingEntity, attacker: LivingEntity): Boolean {
target.addEffect(MobEffectInstance(MobEffects.WITHER, 100, 0)) // 5s Wither II
return super.hurtEnemy(stack, target, attacker)
}
override fun getDefaultAttributeModifiers(stack: ItemStack): ItemAttributeModifiers {
return attributes
}
}

View File

@ -138,7 +138,7 @@ abstract class MatteryMenu(
private val filters = ArrayList<Predicate<Player>>()
init {
filters.add { allowSpectators || !it.isSpectator }
filters.add { this.allowSpectators || !it.isSpectator }
}
fun filter(predicate: Predicate<Player>): PlayerInput<V> {

View File

@ -6,8 +6,6 @@ import java.util.function.BooleanSupplier
class InstantBooleanInput(menu: MatteryMenu) : Delegate<Boolean>, BooleanSupplier {
var value = false
private set
val input = menu.booleanInput(true) { value = it }
override fun get(): Boolean {

View File

@ -229,6 +229,8 @@ object ExopackMenuOpen : CustomPacketPayload {
if (mattery.hasExopack) {
player.containerMenu = mattery.exoPackMenu
mattery.exoPackMenu.enderChestOpenState.value = false
mattery.exoPackMenu.furnaceMenuOpenState.value = false
}
}

View File

@ -115,6 +115,9 @@ object MNames {
const val VENT = "vent"
const val VENT_ALTERNATIVE = "vent_alternative"
const val TRITANIUM_BARS = "tritanium_bars"
const val METAL_RAILING = "metal_railing"
// items
const val GRAVITATIONAL_DISRUPTOR = "gravitational_disruptor"
const val MATTER_DUST = "matter_dust"
@ -191,13 +194,18 @@ object MNames {
const val CHEST_UPGRADER = "chest_upgrader"
const val WITHERED_STEEL_SWORD = "withered_steel_sword"
// eg
const val BREAD_MONSTER_SPAWN_EGG = "bead_monster_spawn_egg"
// items: crafting components
const val TRITANIUM_DUST = "tritanium_dust"
const val TRITANIUM_NUGGET = "tritanium_nugget"
const val TRITANIUM_INGOT = "tritanium_ingot"
const val TRITANIUM_INGOT_BLOCK = "tritanium_ingot_block"
const val TRITANIUM_BARS = "tritanium_bars"
const val METAL_RAILING = "metal_railing"
const val WITHERED_STEEL = "withered_steel"
const val MATTER_IO_PORT = "matter_io_port"
@ -306,6 +314,7 @@ object MNames {
// entities
const val PLASMA = "plasma_projectile"
const val RIDEABLE_DUMMY = "rideable_dummy"
const val BREAD_MONSTER = "bread_monster"
const val PHANTOM_ATTRACTOR = "phantom_attractor"
const val JUMP_BOOST = "jump_boost"

View File

@ -236,11 +236,15 @@ private fun addMainCreativeTabItems(consumer: CreativeModeTab.Output) {
accept(MItems.DILITHIUM_CRYSTAL)
accept(MItems.DILITHIUM_CRYSTAL_BLOCK)
accept(MItems.WITHERED_STEEL)
accept(MItems.TRITANIUM_TOOLS)
accept(MItems.TRITANIUM_SHIELD)
accept(MItems.SIMPLE_TRITANIUM_ARMOR)
accept(MItems.TRITANIUM_ARMOR)
accept(MItems.WITHERED_STEEL_SWORD)
energized(MItems.ENERGY_SWORD)
accept(MItems.REDSTONE_INTERACTOR)

View File

@ -12,7 +12,10 @@ import net.minecraft.world.entity.MobCategory
import net.minecraft.world.item.DyeColor
import net.neoforged.bus.api.IEventBus
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent
import net.neoforged.neoforge.event.entity.EntityAttributeCreationEvent
import ru.dbotthepony.mc.otm.client.render.entity.BreadMonsterRenderer
import ru.dbotthepony.mc.otm.client.render.entity.PlasmaProjectileRenderer
import ru.dbotthepony.mc.otm.entity.BreadMonster
import ru.dbotthepony.mc.otm.entity.MinecartCargoCrate
import ru.dbotthepony.mc.otm.entity.PlasmaProjectile
import ru.dbotthepony.mc.otm.entity.RideableDummy
@ -38,11 +41,25 @@ object MEntityTypes {
.build(MNames.RIDEABLE_DUMMY)
}
val BREAD_MONSTER: EntityType<BreadMonster> by registry.register(MNames.BREAD_MONSTER) {
EntityType.Builder.of(::BreadMonster, MobCategory.MONSTER)
.sized(0.9f, 0.375f)
.eyeHeight(0.1875f)
.passengerAttachments(0.375f)
.clientTrackingRange(8)
.build(MNames.BREAD_MONSTER)
}
fun register(bus: IEventBus) {
registry.register(bus)
bus.addListener(this::registerAttributes)
bus.addListener(this::registerClient)
}
private fun registerAttributes(event: EntityAttributeCreationEvent) {
event.put(BREAD_MONSTER, BreadMonster.createAttributes().build())
}
@Suppress("unchecked_cast")
private fun registerClient(event: FMLClientSetupEvent) {
event.enqueueWork {
@ -53,6 +70,7 @@ object MEntityTypes {
}
EntityRenderers.register(RIDEABLE_DUMMY, ::NoopRenderer)
EntityRenderers.register(BREAD_MONSTER, ::BreadMonsterRenderer)
}
}
}

View File

@ -20,6 +20,7 @@ import net.minecraft.world.item.Rarity
import net.minecraft.world.item.ShearsItem
import net.minecraft.world.item.ShieldItem
import net.minecraft.world.item.ShovelItem
import net.minecraft.world.item.SpawnEggItem
import net.minecraft.world.item.SwordItem
import net.minecraft.world.item.Tiers
import net.minecraft.world.item.crafting.Ingredient
@ -74,6 +75,7 @@ import ru.dbotthepony.mc.otm.item.tool.ExplosiveHammerItem
import ru.dbotthepony.mc.otm.item.tool.MatteryAxeItem
import ru.dbotthepony.mc.otm.item.tool.RedstoneInteractorItem
import ru.dbotthepony.mc.otm.item.weapon.EnergySwordItem
import ru.dbotthepony.mc.otm.item.weapon.WitheredSteelSwordItem
import ru.dbotthepony.mc.otm.registry.MDeferredRegister
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MNames
@ -302,6 +304,8 @@ object MItems {
val TRITANIUM_BARS: BlockItem by registry.register(MNames.TRITANIUM_BARS) { BlockItem(MBlocks.TRITANIUM_BARS, DEFAULT_PROPERTIES) }
val METAL_RAILING: BlockItem by registry.register(MNames.METAL_RAILING) { BlockItem(MBlocks.METAL_RAILING, DEFAULT_PROPERTIES) }
val WITHERED_STEEL: Item by registry.register(MNames.WITHERED_STEEL) { Item(DEFAULT_PROPERTIES) }
val DILITHIUM_CRYSTAL by registry.register("dilithium_crystal") { MatteryItem(DEFAULT_PROPERTIES) }
val DILITHIUM_ORE by registry.register("dilithium_ore") { BlockItem(MBlocks.DILITHIUM_ORE, DEFAULT_PROPERTIES) }
val DEEPSLATE_DILITHIUM_ORE by registry.register("deepslate_dilithium_ore") { BlockItem(MBlocks.DEEPSLATE_DILITHIUM_ORE, DEFAULT_PROPERTIES) }
@ -404,6 +408,8 @@ object MItems {
val ENERGY_SWORD: Item by registry.register(MNames.ENERGY_SWORD) { EnergySwordItem() }
val WITHERED_STEEL_SWORD: Item by registry.register(MNames.WITHERED_STEEL_SWORD) { WitheredSteelSwordItem(Item.Properties().durability(420)) }
val BLACK_HOLE_SCANNER: Item by registry.register(MNames.BLACK_HOLE_SCANNER) { MatteryItem(DEFAULT_PROPERTIES).addSimpleDescription().addSimpleDescription("2") }
val GRAVITATION_FIELD_LIMITER: Item by registry.register(MNames.GRAVITATION_FIELD_LIMITER) { Item(DEFAULT_PROPERTIES) }
@ -581,6 +587,7 @@ object MItems {
MItems::CARBON_MESH,
MItems::ARMOR_ASSEMBLY,
MItems::REINFORCED_TRITANIUM_PLATE,
MItems::REINFORCED_IRON_PLATE,
MachineUpgrades.Basic::BLANK,
MachineUpgrades.Normal::BLANK,
@ -656,6 +663,8 @@ object MItems {
val CHEST_UPGRADER: Item by registry.register(MNames.CHEST_UPGRADER) { ChestUpgraderItem() }
val BREAD_MONSTER_SPAWN_EGG: Item by registry.register(MNames.BREAD_MONSTER_SPAWN_EGG){ SpawnEggItem(MEntityTypes.BREAD_MONSTER, 0xFFFFFF, 0xFFFFFF, Item.Properties())}
init {
MRegistry.registerItems(registry)
}

View File

@ -17,8 +17,8 @@
}
},
{
"from": [15.99995, 15.99995, 15.99995],
"to": [0.00005, 0.00005, 0.00005],
"from": [15.9999, 15.9999, 15.9999],
"to": [0.0001, 0.0001, 0.0001],
"rotation": {"angle": 0, "axis": "y", "origin": [16, 16, 16]},
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#texture", "cullface": "south"},

View File

@ -1,49 +0,0 @@
// Made with Blockbench 4.12.3
// Exported for Minecraft version 1.17 or later with Mojang mappings
// Paste this class into your mod and generate all required imports
public class bread_monster<T extends Entity> extends EntityModel<T> {
// This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation("modid", "bread_monster"), "main");
private final ModelPart root;
private final ModelPart Body;
private final ModelPart Ljaw;
private final ModelPart UJaw;
private final ModelPart tail;
public bread_monster(ModelPart root) {
this.root = root.getChild("root");
this.Body = this.root.getChild("Body");
this.Ljaw = this.Body.getChild("Ljaw");
this.UJaw = this.Body.getChild("UJaw");
this.tail = this.Body.getChild("tail");
}
public static LayerDefinition createBodyLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();
PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F));
PartDefinition Body = root.addOrReplaceChild("Body", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -3.0F, -5.0F, 8.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -3.0F, 0.0F));
PartDefinition Ljaw = Body.addOrReplaceChild("Ljaw", CubeListBuilder.create().texOffs(26, 24).addBox(-4.0F, -2.0F, -4.0F, 8.0F, 3.0F, 4.0F, new CubeDeformation(0.1F)), PartPose.offset(0.0F, 2.0F, -3.0F));
PartDefinition UJaw = Body.addOrReplaceChild("UJaw", CubeListBuilder.create().texOffs(0, 24).addBox(-4.0F, -2.0F, -4.0F, 8.0F, 3.0F, 5.0F, new CubeDeformation(0.1F)), PartPose.offset(0.0F, -1.0F, -3.0F));
PartDefinition tail = Body.addOrReplaceChild("tail", CubeListBuilder.create().texOffs(0, 12).addBox(-4.0F, -3.0F, -0.1F, 8.0F, 6.0F, 6.0F, new CubeDeformation(-0.1F)), PartPose.offset(0.0F, 0.0F, 1.0F));
return LayerDefinition.create(meshdefinition, 64, 32);
}
@Override
public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
}
@Override
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
root.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
}
}

View File

@ -0,0 +1,19 @@
{
"loader": "neoforge:separate_transforms",
"gui_light": "front",
"base":
{
"parent": "overdrive_that_matters:item/withered_steel_sword_handheld"
},
"perspectives": {
"gui": {
"parent": "overdrive_that_matters:item/withered_steel_sword_inventory"
},
"fixed": {
"parent": "overdrive_that_matters:item/withered_steel_sword_inventory"
},
"ground": {
"parent": "overdrive_that_matters:item/withered_steel_sword_inventory"
}
}
}

View File

@ -0,0 +1,29 @@
{
"credit": "Made with Blockbench",
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "overdrive_that_matters:item/withered_steel_sword_handheld"
},
"display": {
"thirdperson_righthand": {
"rotation": [0, -90, 55],
"translation": [0, 4, 0.5],
"scale": [0.85, 0.85, 0.85]
},
"thirdperson_lefthand": {
"rotation": [0, 90, -55],
"translation": [0, 4, 0.5],
"scale": [0.85, 0.85, 0.85]
},
"firstperson_righthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"firstperson_lefthand": {
"rotation": [0, 90, -25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
}
}
}

View File

@ -0,0 +1,7 @@
{
"credit": "Made with Blockbench",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "overdrive_that_matters:item/withered_steel_sword"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

View File

@ -0,0 +1,6 @@
{
"parent": "bettercombat:sword",
"attributes": {
"attack_range": 2
}
}