Skip to content

Commit af8715e

Browse files
committed
start work again
1 parent 4800afd commit af8715e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+300
-642
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
TerrariaMod is a mod that attempts to port over as much content from the game Terraria into Minecraft. It adds several new things from the game including items, tools, and a few bosses.
1+
TerrariaMod is a mod that attempts to port over as much content from the game Terraria into Minecraft, while keeping major changes configurable and modpack compatible. It adds several new things from the game including items, tools, and a few bosses.
22

33
Join the Terrariamod discord to see development progress and participate in polls for the mod here https://discord.gg/37rqPbU, and check my YouTube channel out for development previews here https://www.youtube.com/channel/UCIuLP8cttaRiArgewiclpiw.

common/src/main/java/com/ryorama/terrariamod/TerrariaModConfig.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@
77
@Config(name = "terrariamod")
88
public class TerrariaModConfig implements ConfigData {
99
@ConfigEntry.Gui.Tooltip
10-
public boolean customWorldGen = false;
10+
public boolean useVanillaHud = false;
1111
@ConfigEntry.Gui.Tooltip
12-
public boolean generateExtrasInVanilla = false;
12+
public boolean useVanillaFluidPhysics = false;
1313
@ConfigEntry.Gui.Tooltip
14-
public boolean useVanillaHud = true;
14+
public boolean modifyPlayerHealth = true;
1515
@ConfigEntry.Gui.Tooltip
16-
public boolean useVanillaFluidPhysics = true;
17-
@ConfigEntry.Gui.Tooltip
18-
public boolean modifyPlayerHealth = false;
19-
@ConfigEntry.Gui.Tooltip
20-
public boolean disableHunger = false;
16+
public boolean disableHunger = true;
2117
@ConfigEntry.Gui.Tooltip
2218
public boolean useCustomTitles = false;
19+
@ConfigEntry.Gui.Tooltip
20+
public boolean replaceSpecialDamageWithDebuffs = false;
2321
}

common/src/main/java/com/ryorama/terrariamod/blocks/BlocksT.java

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.ryorama.terrariamod.blocks;
22

33
import com.ryorama.terrariamod.TerrariaMod;
4-
import com.ryorama.terrariamod.blocks.blanketcon.AdventurePlate;
5-
import com.ryorama.terrariamod.blocks.blanketcon.SurvivalPlate;
64
import com.ryorama.terrariamod.blocks.impl.*;
75
import com.ryorama.terrariamod.blocks.terraria.chests.*;
86
import com.ryorama.terrariamod.blocks.terraria.world.*;
@@ -141,9 +139,6 @@ public int applyAsInt(BlockState value) {
141139
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));
142140
public static final RegistrySupplier<Block> WATERLEAF = register("waterleaf", () -> new PlantT(AbstractBlock.Settings.create().mapColor(DyeColor.BLUE), 0.1f, 0.1f).setPick(true).setAxe(true));
143141

144-
public static final RegistrySupplier<Block> SURVIVAL_PLATE = register("survival_plate", () -> new SurvivalPlate(AbstractBlock.Settings.create()));
145-
public static final RegistrySupplier<Block> ADVENTURE = register("adventure_plate", () -> new AdventurePlate(AbstractBlock.Settings.create()));
146-
147142
public static void init() {
148143
BLOCKS.register();
149144
}

common/src/main/java/com/ryorama/terrariamod/blocks/blanketcon/AdventurePlate.java

-28
This file was deleted.

common/src/main/java/com/ryorama/terrariamod/blocks/blanketcon/SurvivalPlate.java

-29
This file was deleted.

common/src/main/java/com/ryorama/terrariamod/blocks/impl/CMBlockT.java

+4-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
public class CMBlockT extends BlockT {
1616
public CMBlockT(AbstractBlock.Settings properties, float hardness, float difficulty) {
17-
super(properties.nonOpaque().noCollision(), hardness, difficulty);
17+
super(properties.nonOpaque().noCollision().notSolid(), hardness, difficulty);
1818
}
1919

2020
public CMBlockT(AbstractBlock.Settings properties, float hardness, float difficulty, int luminance) {
@@ -26,19 +26,15 @@ public int applyAsInt(BlockState value) {
2626
}), hardness, difficulty);
2727
}
2828

29-
public boolean isFullCube(BlockState state) {
29+
public boolean isFullCube(BlockView world, BlockPos pos) {
3030
return false;
3131
}
3232

33-
public int getOpacity(BlockState state, World worldIn, BlockPos pos) {
33+
public int getOpacity(BlockState state, BlockView world, BlockPos pos) {
3434
return 0;
3535
}
3636

37-
public boolean isOpaqueCube(BlockState state) {
38-
return false;
39-
}
40-
41-
public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
37+
public VoxelShape getOutlineShape(BlockView world, BlockPos pos, ShapeContext context) {
4238
return VoxelShapes.empty();
4339
}
4440
}

common/src/main/java/com/ryorama/terrariamod/blocks/impl/HotBlockT.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.ryorama.terrariamod.blocks.impl;
22

3+
import com.ryorama.terrariamod.TerrariaMod;
4+
import com.ryorama.terrariamod.buffs.BuffsT;
35
import net.minecraft.block.BlockState;
46
import net.minecraft.enchantment.EnchantmentHelper;
57
import net.minecraft.entity.Entity;
@@ -14,7 +16,11 @@ public HotBlockT(Settings properties, float hardness, float difficulty) {
1416

1517
public void onSteppedOn(World world, BlockPos pos, BlockState state, Entity entity) {
1618
if (!entity.bypassesSteppingEffects() && entity instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) entity)) {
17-
entity.damage(world.getDamageSources().hotFloor(), 1);
19+
if (TerrariaMod.CONFIG.replaceSpecialDamageWithDebuffs) {
20+
BuffsT.AddBuffToEntity((LivingEntity) entity, 1, BuffsT.ON_FIRE);
21+
} else {
22+
entity.damage(world.getDamageSources().hotFloor(), 1);
23+
}
1824
}
1925

2026
super.onSteppedOn(world, pos, state, entity);

common/src/main/java/com/ryorama/terrariamod/blocks/impl/PlantT.java

+4-8
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
public class PlantT extends BlockT {
1919
public PlantT(AbstractBlock.Settings properties, float hardness, float difficulty) {
20-
super(properties.nonOpaque().sounds(TAudio.GRASS_GRP).noCollision(), hardness, difficulty);
20+
super(properties.nonOpaque().sounds(TAudio.GRASS_GRP).noCollision().notSolid(), hardness, difficulty);
2121
}
2222

2323
public PlantT(AbstractBlock.Settings properties, float hardness, float difficulty, int luminance) {
@@ -29,19 +29,15 @@ public int applyAsInt(BlockState value) {
2929
}), hardness, difficulty);
3030
}
3131

32-
public boolean isFullCube(BlockState state) {
32+
public boolean isFullCube(BlockView world, BlockPos pos) {
3333
return false;
3434
}
3535

36-
public int getOpacity(BlockState state, World worldIn, BlockPos pos) {
36+
public int getOpacity(BlockState state, BlockView world, BlockPos pos) {
3737
return 0;
3838
}
3939

40-
public boolean isOpaqueCube(BlockState state) {
41-
return false;
42-
}
43-
44-
public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
40+
public VoxelShape getOutlineShape(BlockView world, BlockPos pos, ShapeContext context) {
4541
return VoxelShapes.empty();
4642
}
4743
}

common/src/main/java/com/ryorama/terrariamod/blocks/impl/TreeSegment.java

+3-9
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,15 @@
1313

1414
public class TreeSegment extends BlockT {
1515

16-
public static Random rand = new Random();
17-
1816
public TreeSegment(AbstractBlock.Settings properties, float hardness, float difficulty) {
19-
super(properties.nonOpaque().sounds(TAudio.DIRT), hardness, difficulty);
20-
}
21-
22-
public boolean isFullCube(BlockState state) {
23-
return false;
17+
super(properties.nonOpaque().sounds(TAudio.DIRT).notSolid(), hardness, difficulty);
2418
}
2519

26-
public boolean isOpaqueCube(BlockState state) {
20+
public boolean isFullCube(BlockView world, BlockPos pos) {
2721
return false;
2822
}
2923

30-
public VoxelShape getVisualShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
24+
public VoxelShape getOutlineShape(BlockView world, BlockPos pos, ShapeContext context) {
3125
return VoxelShapes.empty();
3226
}
3327

common/src/main/java/com/ryorama/terrariamod/blocks/terraria/world/CorruptionGrass.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random
1818
if (!world.isClient()) {
1919
if (!world.isChunkLoaded(pos)) return;
2020
BlockPos pos2 = pos.add(0, 1, 0);
21-
if (world.getBlockState(pos2).isSolid() && world.getBlockState(pos2).getBlock() instanceof AirBlock == false) {
21+
if (world.getBlockState(pos2).isSolid()) {
2222
world.setBlockState(pos, BlocksT.DIRT_BLOCK.get().getDefaultState());
2323
return;
2424
}

common/src/main/java/com/ryorama/terrariamod/blocks/terraria/world/CrimsonGrass.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random
1818
if (!world.isClient()) {
1919
if (!world.isChunkLoaded(pos)) return;
2020
BlockPos pos2 = pos.add(0, 1, 0);
21-
if (world.getBlockState(pos2).isSolid() && world.getBlockState(pos2).getBlock() instanceof AirBlock == false) {
21+
if (world.getBlockState(pos2).isSolid()) {
2222
world.setBlockState(pos, BlocksT.DIRT_BLOCK.get().getDefaultState());
2323
return;
2424
}

common/src/main/java/com/ryorama/terrariamod/blocks/terraria/world/GrassBlockT.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random
2020
if (!world.isClient()) {
2121
if (!world.isChunkLoaded(pos)) return;
2222
BlockPos pos2 = pos.add(0, 1, 0);
23-
if (world.getBlockState(pos2).isSolid() && world.getBlockState(pos2).getBlock() instanceof AirBlock == false) {
23+
System.out.println("Is " + world.getBlockState(pos2).getBlock().getName() + " Solid: " + world.getBlockState(pos2).isSolid());
24+
if (world.getBlockState(pos2).isSolid()) {
2425
world.setBlockState(pos, BlocksT.DIRT_BLOCK.get().getDefaultState());
2526
return;
2627
}

common/src/main/java/com/ryorama/terrariamod/blocks/terraria/world/JungleGrass.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random
1818
if (!world.isClient()) {
1919
if (!world.isChunkLoaded(pos)) return;
2020
BlockPos pos2 = pos.add(0, 1, 0);
21-
if (world.getBlockState(pos2).isSolid() && world.getBlockState(pos2).getBlock() instanceof AirBlock == false) {
21+
if (world.getBlockState(pos2).isSolid()) {
2222
world.setBlockState(pos, BlocksT.MUD.get().getDefaultState());
2323
return;
2424
}
2525
if (world.getBlockState(pos2).getBlock().getDefaultState() == Blocks.AIR.getDefaultState()) {
2626
if (random.nextInt(100 * 10) <= 2) {
27-
//world.setBlockState(pos2, BlocksT.GRASS.get().getDefaultState());
27+
world.setBlockState(pos2, BlocksT.JUNGLE_GRASS.get().getDefaultState());
2828
if (random.nextInt(15) == 0) {
2929
world.setBlockState(pos2, BlocksT.MUSHROOM.get().getDefaultState());
3030
}

common/src/main/java/com/ryorama/terrariamod/blocks/terraria/world/MushroomGrass.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random
2626
if (!world.isClient()) {
2727
if (!world.isChunkLoaded(pos)) return;
2828
BlockPos pos2 = pos.add(0, 1, 0);
29-
if (world.getBlockState(pos2).isSolid() && world.getBlockState(pos2).getBlock() instanceof AirBlock == false) {
29+
if (world.getBlockState(pos2).isSolid()) {
3030
world.setBlockState(pos, BlocksT.MUD.get().getDefaultState());
3131
return;
3232
}
3333
if (world.getBlockState(pos2).getBlock().getDefaultState() == Blocks.AIR.getDefaultState()) {
3434
if (random.nextInt(100 * 10) <= 2) {
35-
//world.setBlockState(pos2, BlocksT.DEAD_GRASS.get().getDefaultState());
35+
world.setBlockState(pos2, BlocksT.MUSHROOM_GRASS.get().getDefaultState());
3636
if (random.nextInt(15) == 0) {
3737
world.setBlockState(pos2, BlocksT.GLOWING_MUSHROOM.get().getDefaultState());
3838
}

common/src/main/java/com/ryorama/terrariamod/client/TAudio.java

+14-16
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,22 @@
1515

1616
public class TAudio {
1717

18-
/*
1918
public static List<String> musicNames = new ArrayList<>();
2019

21-
public static final SoundEvent DAYONE = new SoundEvent(new Identifier(TerrariaMod.MODID, "day1"));
22-
public static final SoundEvent NIGHT = new SoundEvent(new Identifier(TerrariaMod.MODID, "night"));
23-
public static final SoundEvent UNDERGROUND = new SoundEvent(new Identifier(TerrariaMod.MODID, "underground"));
24-
public static final SoundEvent UNDERWORLD = new SoundEvent(new Identifier(TerrariaMod.MODID, "underworld"));
25-
public static final SoundEvent CORRUPTION = new SoundEvent(new Identifier(TerrariaMod.MODID, "corruption"));
26-
public static final SoundEvent UNDERGROUND_CORRUPTION = new SoundEvent(new Identifier(TerrariaMod.MODID, "underground_corruption"));
27-
public static final SoundEvent DESERT = new SoundEvent(new Identifier(TerrariaMod.MODID, "desert"));
28-
public static final SoundEvent SNOW = new SoundEvent(new Identifier(TerrariaMod.MODID, "snow"));
29-
public static final SoundEvent JUNGLE = new SoundEvent(new Identifier(TerrariaMod.MODID, "jungle"));
30-
public static final SoundEvent MUSHROOM = new SoundEvent(new Identifier(TerrariaMod.MODID, "mushroom"));
31-
public static final SoundEvent WINDY_DAY = new SoundEvent(new Identifier(TerrariaMod.MODID, "windy_day"));
32-
33-
public static final SoundEvent TITLE_SCREEN = new SoundEvent(new Identifier(TerrariaMod.MODID, "title_screen"));
34-
public static final SoundEvent BOSS1 = new SoundEvent(new Identifier(TerrariaMod.MODID, "boss1"));
35-
*/
20+
public static final SoundEvent DAYONE = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "day1"));
21+
public static final SoundEvent NIGHT = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "night"));
22+
public static final SoundEvent UNDERGROUND = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "underground"));
23+
public static final SoundEvent UNDERWORLD = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "underworld"));
24+
public static final SoundEvent CORRUPTION = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "corruption"));
25+
public static final SoundEvent UNDERGROUND_CORRUPTION = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "underground_corruption"));
26+
public static final SoundEvent DESERT = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "desert"));
27+
public static final SoundEvent TUNDRA = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "snow"));
28+
public static final SoundEvent JUNGLE = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "jungle"));
29+
public static final SoundEvent MUSHROOM = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "mushroom"));
30+
public static final SoundEvent WINDY_DAY = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "windy_day"));
31+
32+
public static final SoundEvent TITLE_SCREEN = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "title_screen"));
33+
public static final SoundEvent BOSS1 = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "boss1"));
3634

3735
public static final SoundEvent HEALTH_CRYSTAL = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "health_crystal"));
3836
public static final SoundEvent DRINK = SoundEvent.of(new Identifier(TerrariaMod.MOD_ID, "drink"));

0 commit comments

Comments
 (0)