Skip to content

Commit

Permalink
Final BlanketCon release
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryorama committed Aug 7, 2023
1 parent 8ad7ed5 commit 4800afd
Show file tree
Hide file tree
Showing 72 changed files with 12,703 additions and 284 deletions.
6 changes: 2 additions & 4 deletions common/src/main/java/com/ryorama/terrariamod/TerrariaMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.mojang.serialization.Codec;
import com.ryorama.terrariamod.blocks.BlocksT;
import com.ryorama.terrariamod.buffs.BuffsT;
import com.ryorama.terrariamod.client.particles.ParticlesT;
import com.ryorama.terrariamod.entities.EntitiesT;
import com.ryorama.terrariamod.items.ItemsT;
import com.ryorama.terrariamod.world.TerrariaChunkGenerator;
Expand All @@ -12,12 +11,12 @@
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.serializer.GsonConfigSerializer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.chunk.NoiseChunkGenerator;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;

public class TerrariaMod {
Expand All @@ -33,7 +32,6 @@ public static void init() {
CONFIG = AutoConfig.getConfigHolder(TerrariaModConfig.class).getConfig();
CHUNK_GENERATORS.register();
BuffsT.init();
ParticlesT.init();
BlocksT.init();
EntitiesT.init();
ItemsT.init();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.ryorama.terrariamod.blocks;

import com.ryorama.terrariamod.TerrariaMod;
import com.ryorama.terrariamod.blocks.blanketcon.AdventurePlate;
import com.ryorama.terrariamod.blocks.blanketcon.SurvivalPlate;
import com.ryorama.terrariamod.blocks.impl.*;
import com.ryorama.terrariamod.blocks.terraria.chests.*;
import com.ryorama.terrariamod.blocks.terraria.world.*;
import com.ryorama.terrariamod.blocks.terraria.world.ores.HellstoneOre;
import com.ryorama.terrariamod.client.TAudio;
import com.ryorama.terrariamod.entities.EntitiesT;
import dev.architectury.registry.registries.DeferredRegister;
Expand Down Expand Up @@ -103,7 +106,7 @@ public int applyAsInt(BlockState value) {
public static final RegistrySupplier<Block> METEORITE_ORE = register("meteorite_ore", () -> new HotBlockT(AbstractBlock.Settings.create().mapColor(DyeColor.YELLOW).sounds(TAudio.STONE), ORE_HARDNESS, 55).setPick(true));
public static final RegistrySupplier<Block> DEMONITE_ORE = register("demonite_ore", () -> new BlockT(AbstractBlock.Settings.create().mapColor(DyeColor.PURPLE).sounds(TAudio.STONE), ORE_HARDNESS, 55).setPick(true));
public static final RegistrySupplier<Block> CRIMTANE_ORE = register("crimtane_ore", () -> new BlockT(AbstractBlock.Settings.create().mapColor(DyeColor.RED).sounds(TAudio.STONE), ORE_HARDNESS, 55).setPick(true));
public static final RegistrySupplier<Block> HELLSTONE_ORE = register("hellstone_ore", () -> new HotBlockT(AbstractBlock.Settings.create().mapColor(DyeColor.ORANGE).sounds(TAudio.STONE), ORE_HARDNESS, 60).setPick(true));
public static final RegistrySupplier<Block> HELLSTONE_ORE = register("hellstone_ore", () -> new HellstoneOre(AbstractBlock.Settings.create().mapColor(DyeColor.ORANGE).sounds(TAudio.STONE), ORE_HARDNESS, 60).setPick(true));
public static final RegistrySupplier<Block> RUBY_ORE = register("ruby_ore", () -> new BlockT(AbstractBlock.Settings.create().mapColor(DyeColor.RED).sounds(TAudio.STONE), ORE_HARDNESS, 20).setPick(true));
public static final RegistrySupplier<Block> SAPPHIRE_ORE = register("sapphire_ore", () -> new BlockT(AbstractBlock.Settings.create().mapColor(DyeColor.BLUE).sounds(TAudio.STONE), ORE_HARDNESS, 20).setPick(true));
public static final RegistrySupplier<Block> DIAMOND_ORE = register("diamond_ore", () -> new BlockT(AbstractBlock.Settings.create().mapColor(DyeColor.BLUE).sounds(TAudio.STONE), ORE_HARDNESS, 20).setPick(true));
Expand Down Expand Up @@ -138,6 +141,9 @@ public int applyAsInt(BlockState value) {
public static final RegistrySupplier<Block> SHIVERTHORN = register("shiverthorn", () -> new PlantT(AbstractBlock.Settings.create().mapColor(DyeColor.LIGHT_BLUE), 0.1f, 0.1f, 5).setPick(true).setAxe(true));
public static final RegistrySupplier<Block> WATERLEAF = register("waterleaf", () -> new PlantT(AbstractBlock.Settings.create().mapColor(DyeColor.BLUE), 0.1f, 0.1f).setPick(true).setAxe(true));

public static final RegistrySupplier<Block> SURVIVAL_PLATE = register("survival_plate", () -> new SurvivalPlate(AbstractBlock.Settings.create()));
public static final RegistrySupplier<Block> ADVENTURE = register("adventure_plate", () -> new AdventurePlate(AbstractBlock.Settings.create()));

public static void init() {
BLOCKS.register();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.ryorama.terrariamod.blocks.blanketcon;

import net.minecraft.block.BlockSetType;
import net.minecraft.block.BlockState;
import net.minecraft.block.PressurePlateBlock;
import net.minecraft.entity.Entity;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.GameMode;
import net.minecraft.world.World;

public class AdventurePlate extends PressurePlateBlock {

public AdventurePlate(Settings settings) {
super(ActivationRule.EVERYTHING, settings.strength(9999999, 9999999), BlockSetType.STONE);
}

@Override
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
super.onEntityCollision(state, world, pos, entity);

if (!world.isClient()) {
if (entity instanceof ServerPlayerEntity) {
((ServerPlayerEntity) entity).interactionManager.changeGameMode(GameMode.ADVENTURE);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.ryorama.terrariamod.blocks.blanketcon;

import net.minecraft.block.BlockSetType;
import net.minecraft.block.BlockState;
import net.minecraft.block.PressurePlateBlock;
import net.minecraft.entity.Entity;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.GameMode;
import net.minecraft.world.World;

public class SurvivalPlate extends PressurePlateBlock {

public SurvivalPlate(Settings settings) {
super(ActivationRule.EVERYTHING, settings.strength(9999999, 9999999), BlockSetType.STONE);
}

@Override
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
super.onEntityCollision(state, world, pos, entity);
System.out.println("E");

if (!world.isClient()) {
if (entity instanceof ServerPlayerEntity) {
((ServerPlayerEntity) entity).interactionManager.changeGameMode(GameMode.SURVIVAL);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.ryorama.terrariamod.blocks.terraria.world.ores;

import com.ryorama.terrariamod.blocks.impl.HotBlockT;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldAccess;

public class HellstoneOre extends HotBlockT {
public HellstoneOre(Settings properties, float hardness, float difficulty) {
super(properties, hardness, difficulty);
}

@Override
public void onBroken(WorldAccess world, BlockPos pos, BlockState state) {
super.onBroken(world, pos, state);

world.setBlockState(pos, Blocks.LAVA.getDefaultState(), 0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import com.ryorama.terrariamod.TerrariaMod;
import com.ryorama.terrariamod.buffs.BuffT;
import com.ryorama.terrariamod.client.particles.ParticlesT;
import net.minecraft.entity.LivingEntity;
import net.minecraft.registry.tag.DamageTypeTags;
import net.minecraft.util.Identifier;

public class OnFireDebuff extends BuffT {
Expand All @@ -21,7 +19,6 @@ public void tick(LivingEntity entity) {

for (t = 0; t <= 20; t++) {
if (t == 20) {
entity.getWorld().addParticle(ParticlesT.FLAME.get(), entity.getX(), entity.getY(), entity.getZ(), 0, 0.1f, 0);
entity.damage(entity.getDamageSources().inFire(), 2);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.ryorama.terrariamod.TerrariaMod;
import com.ryorama.terrariamod.buffs.BuffT;
import com.ryorama.terrariamod.client.particles.ParticlesT;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.Identifier;

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.ryorama.terrariamod.TerrariaMod;
import com.ryorama.terrariamod.blocks.BlocksT;
import com.ryorama.terrariamod.entities.terraria.block.*;
import com.ryorama.terrariamod.entities.terraria.hostile.EntityDemonEye;
import com.ryorama.terrariamod.entities.terraria.hostile.slime.EntityBlueSlime;
import com.ryorama.terrariamod.entities.terraria.hostile.slime.EntityGreenSlime;
import dev.architectury.registry.registries.DeferredRegister;
Expand Down Expand Up @@ -32,6 +33,7 @@ public class EntitiesT {

public static final RegistrySupplier<EntityType<EntityGreenSlime>> GREEN_SLIME = registerEntity("green_slime", () -> EntityType.Builder.create(EntityGreenSlime::new, SpawnGroup.MONSTER).build("green_slime"));
public static final RegistrySupplier<EntityType<EntityBlueSlime>> BLUE_SLIME = registerEntity("blue_slime", () -> EntityType.Builder.create(EntityBlueSlime::new, SpawnGroup.MONSTER).build("blue_slime"));
public static final RegistrySupplier<EntityType<EntityDemonEye>> DEMON_EYE = registerEntity("demon_eye", () -> EntityType.Builder.create(EntityDemonEye::new, SpawnGroup.MONSTER).build("demon_eye"));

public static void init() {
ENTITY_TYPES.register();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.ryorama.terrariamod.entities.models.hostile;

import com.ryorama.terrariamod.TerrariaMod;
import com.ryorama.terrariamod.entities.terraria.hostile.EntityDemonEye;
import com.ryorama.terrariamod.entities.terraria.hostile.slime.EntityBlueSlime;
import net.minecraft.util.Identifier;
import software.bernie.geckolib.model.GeoModel;

public class ModelDemonEye extends GeoModel<EntityDemonEye> {

@Override
public Identifier getAnimationResource(EntityDemonEye animatable) {
return new Identifier(TerrariaMod.MOD_ID, "animations/demon_eye.animation.json");
}

@Override
public Identifier getModelResource(EntityDemonEye object) {
return new Identifier(TerrariaMod.MOD_ID, "geo/demon_eye.geo.json");
}

@Override
public Identifier getTextureResource(EntityDemonEye object) {
return new Identifier(TerrariaMod.MOD_ID, "textures/entity/eyes/eye.png");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.ryorama.terrariamod.entities.renderers.hostile;

import com.ryorama.terrariamod.entities.models.hostile.ModelDemonEye;
import com.ryorama.terrariamod.entities.models.hostile.slime.ModelBlueSlime;
import com.ryorama.terrariamod.entities.terraria.hostile.EntityDemonEye;
import com.ryorama.terrariamod.entities.terraria.hostile.slime.EntityBlueSlime;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.renderer.DynamicGeoEntityRenderer;

import javax.annotation.Nullable;
import java.util.Random;

public class RenderDemonEye extends DynamicGeoEntityRenderer<EntityDemonEye> {

public Random rand = new Random();

private Identifier[] eyeTexture = {
new Identifier("terrariamod:textures/entity/eyes/eye.png"),
new Identifier("terrariamod:textures/entity/eyes/eye_cataract.png"),
new Identifier("terrariamod:textures/entity/eyes/eye_dilated.png"),
new Identifier("terrariamod:textures/entity/eyes/eye_green.png"),
new Identifier("terrariamod:textures/entity/eyes/eye_purple.png"),
new Identifier("terrariamod:textures/entity/eyes/eye_sleepy.png")
};

public RenderDemonEye(EntityRendererFactory.Context context) {
super(context, new ModelDemonEye());
}

@Override
public RenderLayer getRenderType(EntityDemonEye animatable, Identifier texture, @Nullable VertexConsumerProvider bufferSource, float partialTick) {
int type = animatable.getDataTracker().get(EntityDemonEye.typed_data).intValue();

return RenderLayer.getEntityTranslucent(eyeTexture[type]);
}
}
Loading

0 comments on commit 4800afd

Please sign in to comment.