feat: implement the allmighty alec

This commit is contained in:
LordMZTE 2023-10-21 22:43:16 +02:00
parent 9b86bdbc11
commit 274e2e1876
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
53 changed files with 624 additions and 15 deletions

View file

@ -0,0 +1,31 @@
package net.anvilcraft.ntx4core;
import java.util.Arrays;
import java.util.Random;
import net.minecraft.client.MinecraftClient;
public class AlecManager {
private static final String[] ALEC_UUIDS = new String[] {
"81f895e133ca46ecb1b6124ba832a352", // The great ALEC himself
"49d8001bcdd846b2b7860537f02f0f2f", // jonasled
"67e46577adb84f23ae1517a355a9aa8c", // LordMZTE
"ff1df9500c2c48489c90f0aa0b084c04", // Kalykto
"70ab32ed30344c60b66890618a71c5a4", // Realtox
"833d996af09b47a7b5dd5ddfd20e3f18", // ACGaming
"d65372eff2f64c44aa204db9e480e0fe", // Merlinmo
"be693d87cb634783a264075a7c6ab0f8", // tilera
};
public static final boolean HAS_ALEC
= Arrays.stream(ALEC_UUIDS)
.anyMatch(
u
-> u.equals(
MinecraftClient.getInstance().getSession().getUuid().replace(
"-", ""
)
)
)
|| new Random().nextInt(16) == 0;
}

View file

@ -7,8 +7,6 @@ import net.minecraft.util.Identifier;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
@Mod("ntx4core")
@ -17,18 +15,14 @@ public class Ntx4Core {
public static final Logger LOGGER = LogManager.getLogger();
public Ntx4Core() {
IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus();
IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
modBus.addListener(this::commonSetup);
modBus.addListener(this::clientSetup);
Ntx4CoreBlocks.BLOCKS.register(bus);
Ntx4CoreItems.ITEMS.register(bus);
MinecraftForge.EVENT_BUS.register(Ntx4CoreShaders.class);
}
private void commonSetup(final FMLCommonSetupEvent event) {}
private void clientSetup(final FMLClientSetupEvent event) {}
public static Identifier id(String s) {
return new Identifier(MODID, s);
}

View file

@ -0,0 +1,15 @@
package net.anvilcraft.ntx4core;
import net.anvilcraft.ntx4core.blocks.BlockAlec;
import net.minecraft.block.Block;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
public class Ntx4CoreBlocks {
public static final DeferredRegister<Block> BLOCKS
= DeferredRegister.create(ForgeRegistries.BLOCKS, Ntx4Core.MODID);
public static final RegistryObject<Block> ALEC
= BLOCKS.register("alec", BlockAlec::new);
}

View file

@ -0,0 +1,17 @@
package net.anvilcraft.ntx4core;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
public class Ntx4CoreItemGroup extends ItemGroup {
public static final Ntx4CoreItemGroup INSTANCE = new Ntx4CoreItemGroup();
private Ntx4CoreItemGroup() {
super("ntx4core");
}
@Override
public ItemStack createIcon() {
return new ItemStack(Ntx4CoreBlocks.ALEC.get());
}
}

View file

@ -0,0 +1,60 @@
package net.anvilcraft.ntx4core;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
public class Ntx4CoreItems {
public static final DeferredRegister<Item> ITEMS
= DeferredRegister.create(ForgeRegistries.ITEMS, Ntx4Core.MODID);
public static final RegistryObject<Item> ALEC = ITEMS.register(
"alec",
()
-> new BlockItem(
Ntx4CoreBlocks.ALEC.get(),
new Item.Settings().group(Ntx4CoreItemGroup.INSTANCE)
)
);
public static final RegistryObject<Item> COMPUTATIONAL_CORE
= registerCraftingIngredient("computational_core");
public static final RegistryObject<Item> ENERGY_INFUSED_CORE
= registerCraftingIngredient("energy_infused_core");
public static final RegistryObject<Item> MAGICAL_CORE
= registerCraftingIngredient("magical_core");
public static final RegistryObject<Item> SENTIENT_SINGULARITY
= registerCraftingIngredient("sentient_singularity");
public static final RegistryObject<Item> STABILIZED_SENTIENCE
= registerCraftingIngredient("stabilized_sentience");
public static final RegistryObject<Item> MAGICALLY_STABILIZED_SENTIENCE
= registerCraftingIngredient("magically_stabilized_sentience");
public static final RegistryObject<Item> IRRADIATED_ESSENCE
= registerCraftingIngredient("irradiated_essence");
public static final RegistryObject<Item> CORRUPTED_ESSENCE
= registerCraftingIngredient("corrupted_essence");
public static final RegistryObject<Item> STRANGE_CONSTRUCT
= registerCraftingIngredient("strange_construct");
public static final RegistryObject<Item> AWAKENED_CONSTRUCT
= registerCraftingIngredient("awakened_construct");
public static final RegistryObject<Item> CHAOTIC_CONSTRUCT
= registerCraftingIngredient("chaotic_construct");
private static RegistryObject<Item> registerCraftingIngredient(String id) {
return ITEMS.register(
id, () -> new Item(new Item.Settings().group(Ntx4CoreItemGroup.INSTANCE))
);
}
}

View file

@ -7,10 +7,10 @@ import com.mojang.blaze3d.platform.GlDebugInfo;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.Shader;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.util.Identifier;
public class Ntx4CoreShaders {
public static Shader SPLASH;
public static Shader ALECUBUS;
// This method is called from SplashOverlayMixin as Forge has no fitting event that
// fires early enough (and not too early).
@ -23,9 +23,14 @@ public class Ntx4CoreShaders {
try {
SPLASH = new Shader(
MinecraftClient.getInstance().getResourceManager(),
new Identifier(Ntx4Core.MODID, "splash"),
Ntx4Core.id("splash"),
VertexFormats.POSITION
);
ALECUBUS = new Shader(
MinecraftClient.getInstance().getResourceManager(),
Ntx4Core.id("alecubus"),
VertexFormats.POSITION_TEXTURE
);
} catch (IOException e) {
Ntx4Core.LOGGER.error("Error registering shaders", e);
throw new RuntimeException(e);

View file

@ -0,0 +1,31 @@
package net.anvilcraft.ntx4core.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.MapColor;
import net.minecraft.block.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.explosion.Explosion;
public class BlockAlec extends Block {
public BlockAlec() {
super(Settings.of(Material.STONE, MapColor.BRIGHT_RED)
.requiresTool()
.strength(2.f, 6.f)
.resistance(99999999.f));
}
@Override
public boolean
canEntityDestroy(BlockState state, BlockView level, BlockPos pos, Entity entity) {
return entity instanceof PlayerEntity;
}
@Override
public void
onBlockExploded(BlockState state, World level, BlockPos pos, Explosion explosion) {}
}

View file

@ -14,6 +14,7 @@ import com.mojang.blaze3d.platform.GlDebugInfo;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import net.anvilcraft.ntx4core.AlecManager;
import net.anvilcraft.ntx4core.Ntx4Core;
import net.anvilcraft.ntx4core.Ntx4CoreShaders;
import net.minecraft.client.MinecraftClient;
@ -31,13 +32,17 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
import net.minecraft.util.math.ColorHelper.Argb;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Matrix4f;
import net.minecraft.util.math.Vec3f;
import net.minecraftforge.client.loading.ClientModLoader;
@Mixin(SplashOverlay.class)
public class SplashOverlayMixin extends Overlay {
@Unique
private static final Identifier LOGO
= new Identifier(Ntx4Core.MODID, "textures/gui/title/splash.png");
private static final Identifier LOGO = Ntx4Core.id("textures/gui/title/splash.png");
@Unique
private static final Identifier ALEC = Ntx4Core.id("textures/alec.png");
@Shadow
@Final
@ -93,7 +98,7 @@ public class SplashOverlayMixin extends Overlay {
float f2;
int l1;
GlStateManager._clearColor(0.0f, 0.0f, 0.0f, 1.0f);
GlStateManager._clear(GL31.GL_COLOR_BUFFER_BIT, false);
GlStateManager._clear(GL31.GL_COLOR_BUFFER_BIT | GL31.GL_DEPTH_BUFFER_BIT, false);
if (f >= 1.0F) {
if (this.client.currentScreen != null) {
this.client.currentScreen.render(matrices, 0, 0, delta);
@ -128,6 +133,67 @@ public class SplashOverlayMixin extends Overlay {
buf.vertex(-1.0, 1.0, 0.0).next();
buf.end();
BufferRenderer.draw(buf);
if (AlecManager.HAS_ALEC) {
float offset_x = (float) Math.sin(this.time / 25.);
float offset_y = (float) Math.cos(this.time / 25.);
var mtx = Matrix4f.viewboxMatrix(45., 1.f, 0.1f, 100.f);
mtx.multiply(Matrix4f.translate(offset_x, offset_y, -5.f));
mtx.multiply(Vec3f.NEGATIVE_Y.getDegreesQuaternion(this.time * 4.f));
// clang-format off
mtx.multiply(new Matrix4f(new float[]{
1.f, 0.f, 0.f, 0.f,
0.f, -1.f, 0.f, 0.f,
0.f, 0.f, 1.f, 0.f,
0.f, 0.f, 0.f, 1.f,
}));
// clang-format on
RenderSystem.setShader(() -> Ntx4CoreShaders.ALECUBUS);
RenderSystem.setShaderTexture(0, ALEC);
Ntx4CoreShaders.ALECUBUS.getUniform("Mtx").set(mtx);
buf.begin(DrawMode.QUADS, VertexFormats.POSITION_TEXTURE);
alecVert(buf, -0.5, -0.5, -0.5, 1.0, 0.0);
alecVert(buf, 0.5, -0.5, -0.5, 0.0, 0.0);
alecVert(buf, 0.5, 0.5, -0.5, 0.0, 1.0);
alecVert(buf, -0.5, 0.5, -0.5, 1.0, 1.0);
alecVert(buf, -0.5, -0.5, 0.5, 0.0, 0.0);
alecVert(buf, 0.5, -0.5, 0.5, 1.0, 0.0);
alecVert(buf, 0.5, 0.5, 0.5, 1.0, 1.0);
alecVert(buf, -0.5, 0.5, 0.5, 0.0, 1.0);
alecVert(buf, -0.5, 0.5, 0.5, 1.0, 1.0);
alecVert(buf, -0.5, 0.5, -0.5, 0.0, 1.0);
alecVert(buf, -0.5, -0.5, -0.5, 0.0, 0.0);
alecVert(buf, -0.5, -0.5, 0.5, 1.0, 0.0);
alecVert(buf, 0.5, 0.5, 0.5, 0.0, 1.0);
alecVert(buf, 0.5, 0.5, -0.5, 1.0, 1.0);
alecVert(buf, 0.5, -0.5, -0.5, 1.0, 0.0);
alecVert(buf, 0.5, -0.5, 0.5, 0.0, 0.0);
alecVert(buf, -0.5, -0.5, -0.5, 0.0, 1.0);
alecVert(buf, 0.5, -0.5, -0.5, 1.0, 1.0);
alecVert(buf, 0.5, -0.5, 0.5, 1.0, 0.0);
alecVert(buf, -0.5, -0.5, 0.5, 0.0, 0.0);
alecVert(buf, -0.5, 0.5, -0.5, 0.0, 1.0);
alecVert(buf, 0.5, 0.5, -0.5, 1.0, 1.0);
alecVert(buf, 0.5, 0.5, 0.5, 1.0, 0.0);
alecVert(buf, -0.5, 0.5, 0.5, 0.0, 0.0);
buf.end();
GlStateManager._enableDepthTest();
GlStateManager._disableCull();
BufferRenderer.draw(buf);
GlStateManager._disableDepthTest();
GlStateManager._enableCull();
}
}
l1 = (int) ((double) this.client.getWindow().getScaledWidth() * 0.5D);
@ -201,6 +267,11 @@ public class SplashOverlayMixin extends Overlay {
}
}
private void
alecVert(BufferBuilder buf, double x, double y, double z, double u, double v) {
buf.vertex((float) x, (float) y, (float) z).texture((float) u, (float) v).next();
}
private void renderProgressBar(
MatrixStack matrices, int minX, int minY, int maxX, int maxY, float opacity
) {

View file

@ -35,7 +35,7 @@ public class InputReplacements {
var philosopherStoneMapper = new InputReplaceRecipeMapper().replace(
"#forge:gems/diamond",
"#forge:darkmatter"
"#ntx4core:darkmatter"
);
ev.mapRecipeID(
new Identifier("projecte", "philosophers_stone"), philosopherStoneMapper

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "ntx4core:block/alec"
}
}
}

View file

@ -0,0 +1,17 @@
{
"itemGroup.ntx4core": "Notex 4",
"block.ntx4core.alec": "Alec",
"item.ntx4core.computational_core": "Computational Core",
"item.ntx4core.energy_infused_core": "Energy-Infused Core",
"item.ntx4core.magical_core": "Magical Core",
"item.ntx4core.sentient_singularity": "Sentient Singularity",
"item.ntx4core.stabilized_sentience": "Stabilized Sentience",
"item.ntx4core.magically_stabilized_sentience": "Magically Stabilized Sentience",
"item.ntx4core.irradiated_essence": "Irradiated Essence",
"item.ntx4core.corrupted_essence": "Corrupted Essence",
"item.ntx4core.strange_construct": "Strange Construct",
"item.ntx4core.awakened_construct": "Awakened Construct",
"item.ntx4core.chaotic_construct": "Chaotic Construct"
}

View file

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "ntx4core:alec"
}
}

View file

@ -0,0 +1,3 @@
{
"parent": "ntx4core:block/alec"
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "ntx4core:item/awakened_construct"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "ntx4core:item/chaotic_construct"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "ntx4core:item/computational_core"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "ntx4core:item/corrupted_essence"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "ntx4core:item/energy_infused_core"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "ntx4core:item/irradiated_essence"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "ntx4core:item/magical_core"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "ntx4core:item/magically_stabilized_sentience"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "ntx4core:item/sentient_singularity"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "ntx4core:item/stabilized_sentience"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "ntx4core:item/strange_construct"
}
}

View file

@ -0,0 +1,11 @@
#version 150
// vim: ft=glsl
in vec2 texCoord;
out vec4 fragColor;
uniform sampler2D Sampler0;
void main() {
fragColor = texture(Sampler0, texCoord);
}

View file

@ -0,0 +1,43 @@
{
"blend": {
"func": "add",
"srcrgb": "srcalpha",
"dstrgb": "1-srcalpha"
},
"vertex": "ntx4core:alecubus",
"fragment": "ntx4core:alecubus",
"attributes": [
"Position",
"UV0"
],
"samplers": [
{
"name": "Sampler0"
}
],
"uniforms": [
{
"name": "Mtx",
"type": "matrix4x4",
"count": 16,
"values": [
1.0,
0.0,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0,
0.0,
1.0
]
}
]
}

View file

@ -0,0 +1,14 @@
#version 150
// vim: ft=glsl
in vec3 Position;
in vec2 UV0;
uniform mat4 Mtx;
out vec2 texCoord;
void main() {
gl_Position = Mtx * vec4(Position, 1.0);
texCoord = UV0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

View file

@ -0,0 +1,5 @@
{
"values": [
"ntx4core:alec"
]
}

View file

@ -0,0 +1,16 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [],
"entries": [
{
"type": "minecraft:item",
"name": "ntx4core:alec"
}
],
"rolls": 1.0
}
]
}

View file

@ -0,0 +1,16 @@
{
"type": "mekanism:nucleosynthesizing",
"itemInput": {
"ingredient": {
"item": "ntx4core:chaotic_construct"
}
},
"gasInput": {
"amount": 10000,
"gas": "mekanism:antimatter"
},
"output": {
"item": "ntx4core:alec"
},
"duration": 1250
}

View file

@ -0,0 +1,13 @@
{
"type": "bloodmagic:altar",
"input": {
"item": "ntx4core:strange_construct"
},
"output": {
"item": "ntx4core:awakened_construct"
},
"upgradeLevel": 4,
"altarSyphon": 80000,
"consumptionRate": 1000,
"drainRate": 2000
}

View file

@ -0,0 +1,25 @@
{
"type": "draconicevolution:fusion_crafting",
"result": {
"item": "ntx4core:chaotic_construct"
},
"catalyst": {
"item": "ntx4core:awakened_construct"
},
"total_energy": 10000000000,
"tier": "CHAOTIC",
"ingredients": [
{
"item": "draconicevolution:chaotic_energy_core"
},
{
"item": "draconicevolution:chaotic_core"
},
{
"item": "draconicevolution:chaotic_core"
},
{
"item": "draconicevolution:chaos_shard"
}
]
}

View file

@ -0,0 +1,16 @@
{
"type": "ftbic:compressing",
"inputItems": [
{
"ingredient": {
"item": "computercraft:computer_advanced"
},
"count": 1
}
],
"outputItems": [
{
"item": "ntx4core:computational_core"
}
]
}

View file

@ -0,0 +1,17 @@
{
"type": "assemblylinemachines:bath",
"input_a": {
"item": "ntx4core:irradiated_essence"
},
"input_b": {
"item": "assemblylinemachines:strange_matter"
},
"output": {
"item": "ntx4core:corrupted_essence"
},
"stirs": 32,
"fluid": "condensed_void",
"mix_color": 0,
"mixer_type": "MIXER_ONLY",
"drain_percent": "QUARTER"
}

View file

@ -0,0 +1,18 @@
{
"type": "create:mixing",
"ingredients": [
{
"item": "ntx4core:computational_core"
},
{
"fluid": "legacy_revived:classic_lava",
"amount": 1000
}
],
"results": [
{
"item": "ntx4core:energy_infused_core"
}
],
"heatRequirement": "superheated"
}

View file

@ -0,0 +1,21 @@
{
"type": "nuclearscience:radioactive_processor_recipe",
"iteminputs": {
"count": 1,
"0": {
"item": "ntx4core:magically_stabilized_sentience",
"count": 1
}
},
"fluidinputs": {
"count": 1,
"0": {
"fluid": "bigreactors:redfrigium",
"amount": 5000
}
},
"output": {
"item": "ntx4core:irradiated_essence",
"count": 1
}
}

View file

@ -0,0 +1,7 @@
{
"type": "mna:arcane-furnace",
"tier": 5,
"input": "ntx4core:energy_infused_core",
"output": "ntx4core:magical_core",
"burnTime": 200
}

View file

@ -0,0 +1,13 @@
{
"type": "botania:elven_trade",
"ingredients": [
{
"item": "ntx4core:stabilized_sentience"
}
],
"output": [
{
"item": "ntx4core:magically_stabilized_sentience"
}
]
}

View file

@ -0,0 +1,18 @@
{
"type": "powah:energizing",
"ingredients": [
{
"item": "ntx4core:magical_core"
},
{
"item": "ae2:singularity"
},
{
"item": "powah:ender_core"
}
],
"energy": 100000000,
"result": {
"item": "ntx4core:sentient_singularity"
}
}

View file

@ -0,0 +1,19 @@
{
"type": "pneumaticcraft:pressure_chamber",
"inputs": [
{
"item": "ntx4core:sentient_singularity"
},
{
"type": "pneumaticcraft:stacked_item",
"tag": "forge:plates/novasteel",
"count": 4
}
],
"pressure": 4.5,
"results": [
{
"item": "ntx4core:stabilized_sentience"
}
]
}

View file

@ -0,0 +1,14 @@
{
"type": "psi:dimension_trick_crafting",
"input": {
"item": "ntx4core:corrupted_essence"
},
"output": {
"item": "ntx4core:strange_construct"
},
"cad": {
"item": "psi:cad_assembly_ebony_psimetal"
},
"trick": "psi:trick_ebony_ivory",
"dimension": "ntx4core:mirror"
}