Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t #7

Closed
wants to merge 1 commit into from
Closed

t #7

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
40 changes: 40 additions & 0 deletions src/main/generated/.cache/8ce55c2d46c78681d7eebf7cad72e9c2de67a045
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// 1.21 2024-07-20T05:31:11.5795046 MITEequilibrium/Model Definitions
e3c5f07b3b54f7f6eea5fa00ed1823c80c519c14 assets\miteequilibrium\models\item\mithril_ore.json
dccf3bc904ca2659a45b1924b2b5dd8188a0ef27 assets\miteequilibrium\blockstates\gold_block.json
6aa639f29ea4e247aa818822152bded3ec0a0ef4 assets\miteequilibrium\blockstates\mithril_block.json
a3aa407225058101f487dc2d69a2323cff577294 assets\miteequilibrium\models\block\silver_ore.json
6deb1bf7820e58ac89e2411f78d6925861ce3cf5 assets\miteequilibrium\models\item\silver_nugget.json
46bfd511f5c0f2f1afc5d77cc9dbd0144377d522 assets\miteequilibrium\models\item\mithril_nugget.json
15c22b2ffa7c2dda180ffcadd87e26e7542db7c5 assets\miteequilibrium\blockstates\silver_ore.json
c6d473a5f7fb2189afdb6f6040f9449d6355e4c9 assets\miteequilibrium\models\block\copper_block.json
904f5b6be17869c8e9b6bc8b25fd229e15163b7e assets\miteequilibrium\models\block\gold_block.json
8a2002cdb9a1c1088eac1973807e01b3db6a8fc7 assets\miteequilibrium\blockstates\gold_ore.json
37a416ce5d40380df1321db7e7272faa4858973c assets\miteequilibrium\models\item\copper_nugget.json
cabffc3950e51bb500254bcd2a47053341050615 assets\miteequilibrium\blockstates\copper_block.json
88b2592c9e57bdfd9ff42721aee23f1879810fcc assets\miteequilibrium\models\block\gold_ore.json
1c76eeb8e434a4959a45a985f71e33bee98cef47 assets\miteequilibrium\blockstates\ancient_metal_block.json
3f58a7975e017e6f5e0aefeb9d6a28b58502a0d5 assets\miteequilibrium\models\item\ancient_metal_block.json
acd36f849f7545835bcd7c024a9c9c54e8d9e1c0 assets\miteequilibrium\models\item\gold_ore.json
d7f20ad7d635c2505ea669d0de4c217d2ea182ef assets\miteequilibrium\models\block\mithril_ore.json
c877c93eb6dc6b7db3a9f39f1d1a04de0e86dff7 assets\miteequilibrium\models\item\copper_ore.json
dd63bef5ea7f82d06c0c162106a2c5a9a1efee37 assets\miteequilibrium\blockstates\mithril_ore.json
d23ecf679ccfafb2cf9b62c3aec46729ba685fa0 assets\miteequilibrium\models\item\ancient_metal_nugget.json
ddd198fb1a94b797709f8a13de207a162ca83920 assets\miteequilibrium\blockstates\silver_block.json
3a0550b68023aeb8d1f2e05c3bc8b1683a5ec457 assets\miteequilibrium\models\block\copper_ore.json
daac16a0ec15119c4965bf7b42998bf7c30f46fc assets\miteequilibrium\blockstates\adamantium_ore.json
17f4433121884390a787d54ad0545574cd77e44e assets\miteequilibrium\models\item\adamantium_ore.json
ebbf1665c7578e664e339d1379497b8e68ceb9f9 assets\miteequilibrium\blockstates\adamantium_block.json
9ec74d6fe87cfb75b15b03a4686b020726e9a03a assets\miteequilibrium\models\item\adamantium_block.json
47b83ac7ffdcd4f349e7b9d2c9ecbaa7296cd2c1 assets\miteequilibrium\models\block\adamantium_ore.json
7167477d055461b8c0d0dd1ddff296c3e8739c1b assets\miteequilibrium\models\item\gold_nugget.json
71230db95fb36a59ca886b42a8578a7e5289f27e assets\miteequilibrium\models\block\mithril_block.json
9a8cfa18c20d09c688f214eb5e9fe03d14db7761 assets\miteequilibrium\models\item\gold_block.json
9c2092f86b72ce8167788a7d59bb2f6915f0caf6 assets\miteequilibrium\models\block\ancient_metal_block.json
f34fa81117489a9a66ea93f728f5f2bcbec9b953 assets\miteequilibrium\models\block\silver_block.json
e5733a090f394c136335c8aa0dc7e5083ef31458 assets\miteequilibrium\models\item\silver_ore.json
b834efa7e8d540313d35956439827b44a4cee03e assets\miteequilibrium\models\block\adamantium_block.json
72ccce82992032390968c1c5fd7bb5aba9f4b253 assets\miteequilibrium\models\item\silver_block.json
a4b0acfc4293fcf495f36a76bdda910db3f426ee assets\miteequilibrium\models\item\mithril_block.json
d918fe036accbdb8c8dad219ff5b3f769ac1b7ab assets\miteequilibrium\models\item\adamantium_nugget.json
5af9fa21466ac378f1f8783fc5934cb0e6c77eca assets\miteequilibrium\blockstates\copper_ore.json
8dc735515e111bfc53d1a0a639d4fb027e58abfe assets\miteequilibrium\models\item\copper_block.json
26 changes: 14 additions & 12 deletions src/main/java/com/equilibrium/MITEequilibrium.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@

import com.equilibrium.block.ModBlocks;

import com.equilibrium.entity.ModEntities;
import com.equilibrium.entity.mob.TestZombieEntity;
import com.equilibrium.item.Ingots;
import com.equilibrium.event.BreakBlockEvent;
import com.equilibrium.item.Metal;
import com.equilibrium.item.ModItemGroup;
import com.equilibrium.item.ModItems;
import com.equilibrium.item.Tools;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.minecraft.util.Identifier;
import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static com.equilibrium.entity.ModEntities.TEST_ZOMBIE;
import static com.equilibrium.entity.ModEntities.registerModEntities;
import static com.equilibrium.worldgen.ModOreGenerator.registerModOre;
import static com.equilibrium.util.LootTableModifier.modifierLootTables;

import static com.equilibrium.worldgen.ModPlacementGenerator.registerModOre;


public class MITEequilibrium implements ModInitializer {
Expand Down Expand Up @@ -45,20 +44,23 @@ public void onInitialize() {
//添加工具物品
Tools.registerModItemTools();
//添加锭
Ingots.registerModItemIngots();
Metal.registerModItemIngots();
//添加金属颗粒
Metal.registerModItemNuggets();

//注册矿物

registerModOre();



//注册实体
registerModEntities();


//修改战利品表
modifierLootTables();



//注册事件
PlayerBlockBreakEvents.AFTER.register(new BreakBlockEvent());

LOGGER.info("Hello Fabric world!");
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/equilibrium/MITEequilibriumClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


import com.equilibrium.client.render.entity.InvisibleStalker;
import com.equilibrium.client.render.entity.ZombieEntityRendererTransparent;
import com.equilibrium.client.render.entity.TestZombie;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;

Expand All @@ -16,7 +16,7 @@ public void onInitializeClient() {
//将注册的实体和模型结合起来


EntityRendererRegistry.register(TEST_ZOMBIE, ZombieEntityRendererTransparent::new);
EntityRendererRegistry.register(TEST_ZOMBIE, TestZombie::new);
EntityRendererRegistry.register(INVISIBLE_STALKER, InvisibleStalker::new);


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.equilibrium;

import com.equilibrium.gen.ModModelProvider;
import com.equilibrium.gen.ModRecipeGenerator;
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
Expand All @@ -10,7 +11,8 @@ public class MITEequilibriumDataGenerator implements DataGeneratorEntrypoint {
@Override
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator){
FabricDataGenerator.Pack pack=fabricDataGenerator.createPack();
pack.addProvider(ModRecipeGenerator::new);
// pack.addProvider(ModRecipeGenerator::new);
pack.addProvider(ModModelProvider::new);

}
}
100 changes: 75 additions & 25 deletions src/main/java/com/equilibrium/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,95 @@
public class ModBlocks {

public static final Block EXAMPLE_BLOCK = new Block(Block.Settings.create().strength(4.0f));
//strength中第一个为硬度,第二个为爆炸抗性
public static final Block UNDERWORLD_PORTAL =
new UnderworldPortalBlock(
AbstractBlock.Settings.create()
.noCollision()
.ticksRandomly()
.strength(-1.0F)
.sounds(BlockSoundGroup.GLASS)
.luminance(state -> 11)
.pistonBehavior(PistonBehavior.BLOCK)
);
public static final Block OVERWORLD_PORTAL =
new UnderworldPortalBlock(
AbstractBlock.Settings.create()
.noCollision()
.ticksRandomly()
.strength(-1.0F)
.sounds(BlockSoundGroup.GLASS)
.luminance(state -> 11)
.pistonBehavior(PistonBehavior.BLOCK)
);


public static final Block ADAMANTIUM_ORE = new Block(Block.Settings.create().strength(4.0f));
public static final Block ADAMANTIUM_BLOCK = new Block(Block.Settings.create().strength(4.0f));


public static final Block ANCIENT_METAL_BLOCK = new Block(Block.Settings.create().strength(4.0f));

public static final Block COPPER_ORE = new Block(Block.Settings.create().strength(4.0f));
public static final Block COPPER_BLOCK = new Block(Block.Settings.create().strength(4.0f));

public static final Block MITHRIL_ORE = new Block(Block.Settings.create().strength(4.0f));
public static final Block MITHRIL_BLOCK = new Block(Block.Settings.create().strength(4.0f));

public static final Block SILVER_ORE = new Block(Block.Settings.create().strength(4.0f));
public static final Block SILVER_BLOCK = new Block(Block.Settings.create().strength(4.0f));

public static final Block GOLD_ORE = new Block(Block.Settings.create().strength(4.0f));
public static final Block GOLD_BLOCK = new Block(Block.Settings.create().strength(4.0f));

//strength中第一个为硬度,第二个为爆炸抗性
// public static final Block UNDERWORLD_PORTAL =
// new UnderworldPortalBlock(
// AbstractBlock.Settings.create()
// .noCollision()
// .ticksRandomly()
// .strength(-1.0F)
// .sounds(BlockSoundGroup.GLASS)
// .luminance(state -> 11)
// .pistonBehavior(PistonBehavior.BLOCK)
// );
// public static final Block OVERWORLD_PORTAL =
// new UnderworldPortalBlock(
// AbstractBlock.Settings.create()
// .noCollision()
// .ticksRandomly()
// .strength(-1.0F)
// .sounds(BlockSoundGroup.GLASS)
// .luminance(state -> 11)
// .pistonBehavior(PistonBehavior.BLOCK)
// );
public static void registerModBlocks(){
Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "example_block"), EXAMPLE_BLOCK);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "example_block"), new BlockItem(EXAMPLE_BLOCK, new Item.Settings()));

Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "underworld_portalblock"), UNDERWORLD_PORTAL);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "underworld_portalblock"), new BlockItem(UNDERWORLD_PORTAL, new Item.Settings()));
Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "adamantium_ore"), ADAMANTIUM_ORE);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "adamantium_ore"), new BlockItem(ADAMANTIUM_ORE, new Item.Settings()));

Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "adamantium_block"), ADAMANTIUM_BLOCK);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "adamantium_block"), new BlockItem(ADAMANTIUM_BLOCK, new Item.Settings()));

Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "ancient_metal_block"), ANCIENT_METAL_BLOCK);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "ancient_metal_block"), new BlockItem(ANCIENT_METAL_BLOCK, new Item.Settings()));

Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "copper_ore"), COPPER_ORE);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "copper_ore"), new BlockItem(COPPER_ORE, new Item.Settings()));

Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "copper_block"), COPPER_BLOCK);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "copper_block"), new BlockItem(COPPER_BLOCK, new Item.Settings()));

Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "mithril_ore"), MITHRIL_ORE);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "mithril_ore"), new BlockItem(MITHRIL_ORE, new Item.Settings()));

Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "mithril_block"), MITHRIL_BLOCK);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "mithril_block"), new BlockItem(MITHRIL_BLOCK, new Item.Settings()));

Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "silver_ore"), SILVER_ORE);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "silver_ore"), new BlockItem(SILVER_ORE, new Item.Settings()));

Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "silver_block"), SILVER_BLOCK);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "silver_block"), new BlockItem(SILVER_BLOCK, new Item.Settings()));

Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "gold_ore"), GOLD_ORE);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "gold_ore"), new BlockItem(GOLD_ORE, new Item.Settings()));

Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "gold_block"), GOLD_BLOCK);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "gold_block"), new BlockItem(GOLD_BLOCK, new Item.Settings()));







Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "overworld_portalblock"), OVERWORLD_PORTAL);
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "overworld_portalblock"), new BlockItem(OVERWORLD_PORTAL, new Item.Settings()));
// Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "underworld_portalblock"), UNDERWORLD_PORTAL);
// Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "underworld_portalblock"), new BlockItem(UNDERWORLD_PORTAL, new Item.Settings()));
//
// Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "overworld_portalblock"), OVERWORLD_PORTAL);
// Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "overworld_portalblock"), new BlockItem(OVERWORLD_PORTAL, new Item.Settings()));


}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.equilibrium.client.render.entity;

import com.equilibrium.client.render.entity.model.TransparentZombieEntityModelAbstractZombieModel;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.entity.mob.ZombieEntity;

@Environment(EnvType.CLIENT)
public abstract class AbstractZombieEntityRenderer <T extends ZombieEntity, M extends TransparentZombieEntityModelAbstractZombieModel<T>> extends BipedEntityRenderer<T, M> {


protected AbstractZombieEntityRenderer(EntityRendererFactory.Context ctx, M bodyModel, M legsArmorModel, M bodyArmorModel) {
super(ctx, bodyModel, 0.5F);

}


protected boolean isShaking(T zombieEntity) {
return super.isShaking(zombieEntity) || zombieEntity.isConvertingInWater();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@
import net.minecraft.client.render.entity.feature.ElytraFeatureRenderer;
import net.minecraft.client.render.entity.feature.HeadFeatureRenderer;
import net.minecraft.client.render.entity.feature.HeldItemFeatureRenderer;
import net.minecraft.client.render.entity.model.BipedEntityModel;
import net.minecraft.entity.mob.MobEntity;

@Environment(EnvType.CLIENT)
public abstract class TransparentBipedEntityRenderer<T extends MobEntity, M extends TransparentBipedEntityModel<T>> extends MobEntityRenderer<T, M> {
public TransparentBipedEntityRenderer(EntityRendererFactory.Context ctx, M model, float shadowRadius) {
public abstract class BipedEntityRenderer<T extends MobEntity, M extends TransparentBipedEntityModel<T>> extends MobEntityRenderer<T, M> {
public BipedEntityRenderer(EntityRendererFactory.Context ctx, M model, float shadowRadius) {
this(ctx, model, shadowRadius, 1.0F, 1.0F, 1.0F);
}

public TransparentBipedEntityRenderer(EntityRendererFactory.Context ctx, M model, float shadowRadius, float scaleX, float scaleY, float scaleZ) {
public BipedEntityRenderer(EntityRendererFactory.Context ctx, M model, float shadowRadius, float scaleX, float scaleY, float scaleZ) {
super(ctx, model, shadowRadius);
this.addFeature(new HeadFeatureRenderer<>(this, ctx.getModelLoader(), scaleX, scaleY, scaleZ, ctx.getHeldItemRenderer()));
this.addFeature(new ElytraFeatureRenderer<>(this, ctx.getModelLoader()));
this.addFeature(new HeldItemFeatureRenderer<>(this, ctx.getHeldItemRenderer()));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.equilibrium.client.render.entity;

import com.equilibrium.client.render.entity.model.SZombieEntityModel;
import com.equilibrium.client.render.entity.model.TransparentZombieEntityModelAbstractZombieModel;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.render.entity.model.EntityModelLayer;
import net.minecraft.client.render.entity.model.EntityModelLayers;
import net.minecraft.client.render.entity.model.ZombieEntityModel;
import net.minecraft.entity.mob.ZombieEntity;
import net.minecraft.util.Identifier;

public class InvisibleStalker extends TransparentZombieEntityRenderer<ZombieEntity, ZombieEntityModel<ZombieEntity>> {
public class InvisibleStalker extends AbstractZombieEntityRenderer<ZombieEntity, TransparentZombieEntityModelAbstractZombieModel<ZombieEntity>> {
private static final Identifier TEXTURE = Identifier.of("miteequilibrium","textures/entity/invisible_stalker.png");

public Identifier getTexture(ZombieEntity zombieEntity) {
Expand All @@ -21,7 +20,7 @@ public InvisibleStalker(EntityRendererFactory.Context context) {

public InvisibleStalker(EntityRendererFactory.Context ctx, EntityModelLayer layer, EntityModelLayer legsArmorLayer, EntityModelLayer bodyArmorLayer) {
super(
ctx, new ZombieEntityModel<>(ctx.getPart(layer)), new ZombieEntityModel<>(ctx.getPart(legsArmorLayer)), new ZombieEntityModel<>(ctx.getPart(bodyArmorLayer))
ctx, new TransparentZombieEntityModelAbstractZombieModel<>(ctx.getPart(layer)),new TransparentZombieEntityModelAbstractZombieModel<>(ctx.getPart(layer)), new TransparentZombieEntityModelAbstractZombieModel<>(ctx.getPart(layer))
);

}
Expand Down
Loading
Loading