Skip to content

Commit

Permalink
Various additions (#44)
Browse files Browse the repository at this point in the history
* Update .gitignore

* Trophy pedestal tweaks

"You are unwothy." message is now translatable. Added russian translation
Deactivated pedestal can (finally) be collected

* Add mini-bosses and Questing Ram trophies

Unobtainable yet

* Add trophy drops

Now you can finally collect them all!

* Spotless apply

* Fix Aurora Palace map icon

* Add trophy pedestal comparator output

* Change trophy sound to cloth

* Add yeti sounds

* Add trophy sounds

* Trophies are now wearable

* Move Knightmetal Ring texture to center

* Custom stalactite generation

* Remove test stalactite generator

* Update TFGenCaveStalactite.java

Added metadata for stalactite blocks
Added an option to clear stalactite lists entirely

* Add tooltips for compressed blocks

"Usable for Beacon bases", just like in TiC

* Add traits for compressed blocks

- Fiery metal blocks now sustain fire, provide light and damage player standing in top (unless he/she wears fiery boots or sneaks), just like magma blocks from future versions
- Fur and steeleaf blocks now decrease fall damage 75% and 25% accorgingly

* Add fiery block renderer

Now it renders with glowing outline
+ Multiple blocks render seamlessly, but it can sometimes look awkward

* Fiery blood/tears are now interchangeable in NEI

***OreDictionary magic***

* Add direct fiery armor crafting from iron armor

* Attempt to fix server crash

* Update ItemBlockTFCompressed.java

* IDK, maybe this should help

* Spotless applied

* Revert "Spotless applied"

This reverts commit bfa25e4.

* Revert "IDK, maybe this should help"

This reverts commit 96e2acc.

* Revert "Update ItemBlockTFCompressed.java"

This reverts commit ecfd4cf.

* Remove 'static' from renderer methods

* Revert "Remove 'static' from renderer methods"

This reverts commit 3edfab3.

* Please work

* Remove item renderer registeration

For testing purposes

* Make fiery block item render client only

* Make trophies equippable with Shift+rightclicking

* Make outdated tooltip universal

* Rename "Trophy armor" to "Decorative armor"

* Make fireflies, cicadas and moonworms wearable

* Revert "Update TFGenCaveStalactite.java"

This reverts commit a7fa7a4.

* Revert "Remove test stalactite generator"

This reverts commit 9312582.

* Revert "Custom stalactite generation"

This reverts commit 6877a79.

* Update TFRecipes.java

Huge water lily and thorn rose can now be crafted into magenta and red dye accordingly

* Wispy clouds can now be harvested

Any tool will do
Silk touch required

* Achievements tuning

"Twilight hunter" and progression achievements now can only be gained when in Twilight Forest

* Mosquitos are now count as arthropods

* Druid skeletons now don't cast without a hoe

In case you can take it away from it somehow

* Add missing boss spawners

For Minoshroom, Alpha Yeti and Snow Queen

* Fix boss spawner names

* Every boss now leave behind its spawner when going into peaceful

* Spotless applied

* Ice bomb tweaks

Now adds snow to already existing layers
Snow generation shape is now more circular

* Charms effects finally render properly

* Thorn rose tweaking

Thorn rose can now be placed on leaves and any blocks that can sustain flowers

* Add way of getting progression achievements using new trophies

* Charms of Keeping now keep inventory even if you log out instead of respawning

* Update TFEventListener.java

* Phantom armor features

Now Phantom armor will be kept on death regardless of having any Charms of Keeping
Added corresponding tooltip

* Crumble horn can now crumble much more blocks

* Fixed generated water not flowing

* Fixed (another) nagastone crash

* Add chests made of twilight wood

+ trapped versions

* Fix chests render

* Allow projectiles to break burnt thorns

* Bugs can now be killed with projectiles

Fireflies will drop glowstone, cicadas will drop green dye, and moonworms will drop lime dye

* Cicadas now shut up once broken

* Update to match the master branch

* Remove broken import

* Etched nagastone direction is now never null

* Add missing check for Baubles

* Add cicada client check

* Update BlockTFCicada.java

* Register missing tile entities

* Remove ISound from TileEntityTFCicada

* Fix a stupid mistake

* Remove @SideOnly(Side.CLIENT) from BlockTFCicada

* Remove ISound from BlockTFCicada as well

Maybe this should do the trick

* Remove ALL client-related stuff from TileEntityTFCicada

* Remove unnecessary stuff

* Update TFClientProxy.java

* Spotless applied

* Update BlockTFCicada.java

* Remove unnecessary tessellator calls

* Fix fiery metal block brightness

* Add GTNH check for recipes

* Fix cicada crash

* Spotless applied

* Fix chest issues

---------

Co-authored-by: Martin Robertz <dream-master@gmx.net>
  • Loading branch information
Gordon-Frohman and Dream-Master authored Jun 29, 2024
1 parent df10d19 commit 3e69ed4
Show file tree
Hide file tree
Showing 160 changed files with 3,679 additions and 539 deletions.
86 changes: 0 additions & 86 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,89 +36,3 @@ addon.local.gradle.kts
addon.late.local.gradle
addon.late.local.gradle.kts
layout.json
src/main/resources/assets/tinker/textures/items/textures to draw/_sword_accessory.png
src/main/resources/assets/tinker/textures/items/textures to draw/_shuriken.png
src/main/resources/assets/tinker/textures/items/textures to draw/_shuriken (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_shovel_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_scythe_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_scythe_binding.png
src/main/resources/assets/tinker/textures/items/textures to draw/_scythe_accessory.png
src/main/resources/assets/tinker/textures/items/textures to draw/_rod.png
src/main/resources/assets/tinker/textures/items/textures to draw/_rapier_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_rapier_accessory.png
src/main/resources/assets/tinker/textures/items/textures to draw/_pickaxe_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_pickaxe_accessory.png
src/main/resources/assets/tinker/textures/items/textures to draw/_medium_guard.png
src/main/resources/assets/tinker/textures/items/textures to draw/_mattock_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_lumberaxe_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_lumberaxe_binding.png
src/main/resources/assets/tinker/textures/items/textures to draw/_longsword_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_longsword_accessory.png
src/main/resources/assets/tinker/textures/items/textures to draw/_large_guard.png
src/main/resources/assets/tinker/textures/items/textures to draw/_knife_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_knife_blade.png
src/main/resources/assets/tinker/textures/items/textures to draw/_knife_blade (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_javelin_head_broken.png
src/main/resources/assets/tinker/textures/items/textures to draw/_javelin_head.png
src/main/resources/assets/tinker/textures/items/textures to draw/_javelin_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_javelin_accessory.png
src/main/resources/assets/tinker/textures/items/textures to draw/_hammer_handle_broken.png
src/main/resources/assets/tinker/textures/items/textures to draw/_hammer_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_full_guard.png
src/main/resources/assets/tinker/textures/items/textures to draw/_frypan_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_excavator_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_excavator_grip.png
src/main/resources/assets/tinker/textures/items/textures to draw/_dagger_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_dagger_blade_broken.png
src/main/resources/assets/tinker/textures/items/textures to draw/_dagger_blade.png
src/main/resources/assets/tinker/textures/items/textures to draw/_dagger_accessory.png
src/main/resources/assets/tinker/textures/items/textures to draw/_cutlass_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_cutlass_guard.png
src/main/resources/assets/tinker/textures/items/textures to draw/_cutlass_blade_broken.png
src/main/resources/assets/tinker/textures/items/textures to draw/_cutlass_blade.png
src/main/resources/assets/tinker/textures/items/textures to draw/_crossbow_limb.png
src/main/resources/assets/tinker/textures/items/textures to draw/_crossbow_bow_3.png
src/main/resources/assets/tinker/textures/items/textures to draw/_crossbow_bow_2.png
src/main/resources/assets/tinker/textures/items/textures to draw/_crossbow_bow_1.png
src/main/resources/assets/tinker/textures/items/textures to draw/_crossbow_bow.png
src/main/resources/assets/tinker/textures/items/textures to draw/_crossbow_body.png
src/main/resources/assets/tinker/textures/items/textures to draw/_crossbow_body (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_crossbow_binding.png
src/main/resources/assets/tinker/textures/items/textures to draw/_crossbar.png
src/main/resources/assets/tinker/textures/items/textures to draw/_cleaver_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_cleaver_guard.png
src/main/resources/assets/tinker/textures/items/textures to draw/_chisel_head_broken.png
src/main/resources/assets/tinker/textures/items/textures to draw/_chisel_head.png
src/main/resources/assets/tinker/textures/items/textures to draw/_chisel_head (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_chisel_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_top_3.png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_top_3 (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_top_2.png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_top_2 (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_top_1.png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_top_1 (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_top.png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_top (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_limb.png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_grip.png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_bottom_3.png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_bottom_3 (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_bottom_2.png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_bottom_2 (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_bottom_1.png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_bottom_1 (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_bottom.png
src/main/resources/assets/tinker/textures/items/textures to draw/_bow_bottom (2).png
src/main/resources/assets/tinker/textures/items/textures to draw/_binding.png
src/main/resources/assets/tinker/textures/items/textures to draw/_battlesign_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_battleaxe_head_broken.png
src/main/resources/assets/tinker/textures/items/textures to draw/_battleaxe_head.png
src/main/resources/assets/tinker/textures/items/textures to draw/_battleaxe_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_battleaxe_fronthead_broken.png
src/main/resources/assets/tinker/textures/items/textures to draw/_battleaxe_fronthead.png
src/main/resources/assets/tinker/textures/items/textures to draw/_battleaxe_front.png
src/main/resources/assets/tinker/textures/items/textures to draw/_battleaxe_binding.png
src/main/resources/assets/tinker/textures/items/textures to draw/_battleaxe_backhead.png
src/main/resources/assets/tinker/textures/items/textures to draw/_battleaxe_back.png
src/main/resources/assets/tinker/textures/items/textures to draw/_axe_handle.png
src/main/resources/assets/tinker/textures/items/textures to draw/_arrow_shaft.png
26 changes: 26 additions & 0 deletions src/main/java/twilightforest/TFCommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;

import cpw.mods.fml.common.network.IGuiHandler;
Expand Down Expand Up @@ -39,6 +41,10 @@ public int getCakeBlockRenderID() {
return 0;
}

public int getChestBlockRenderID() {
return 0;
}

public int getComplexBlockRenderID() {
return 0;
}
Expand Down Expand Up @@ -75,6 +81,10 @@ public int getKnightmetalBlockRenderID() {
return 0;
}

public int getFieryMetalBlockRenderID() {
return 0;
}

public int getHugeLilyPadBlockRenderID() {
return 0;
}
Expand Down Expand Up @@ -142,6 +152,22 @@ public ModelBiped getFieryArmorModel(int armorSlot) {
return null;
}

public ModelBiped getTrophyArmorModel(int boss) {
return null;
}

public ModelBiped getCritterArmorModel(int critter) {
return null;
}

public void doBlockAnnihilateEffect(World worldObj, int blockX, int blockY, int blockZ) {}

public boolean checkForSound(ChunkCoordinates chunkcoordinates) {
return true;
}

public void stopSound(World worldIn, int x, int y, int z) {}

public void playSound(World worldObj, ChunkCoordinates chunkcoordinates, ResourceLocation soundResource) {}

}
119 changes: 80 additions & 39 deletions src/main/java/twilightforest/TFEventListener.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package twilightforest;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;

Expand Down Expand Up @@ -34,14 +36,15 @@
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.player.BonemealEvent;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import net.minecraftforge.event.world.BlockEvent.BreakEvent;
import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;
import net.minecraftforge.event.world.WorldEvent;

import baubles.common.container.InventoryBaubles;
import baubles.common.lib.PlayerHandler;
import com.google.common.io.Files;

import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
Expand All @@ -61,6 +64,7 @@
import twilightforest.entity.EntityTFPinchBeetle;
import twilightforest.entity.EntityTFYeti;
import twilightforest.integration.TFBaublesIntegration;
import twilightforest.item.ItemTFPhantomArmor;
import twilightforest.item.TFItems;
import twilightforest.world.ChunkProviderTwilightForest;
import twilightforest.world.TFWorldChunkManager;
Expand All @@ -71,6 +75,9 @@
*/
public class TFEventListener {

public static String fileName = "tf";
public static String fileNameBackup = "tfback";

protected HashMap<String, InventoryPlayer> playerKeepsMap = new HashMap<>();
protected HashMap<String, ItemStack[]> playerBaublesMap = new HashMap<>();
private boolean isBreakingWithGiantPick = false;
Expand Down Expand Up @@ -102,6 +109,9 @@ public void pickupItem(EntityItemPickupEvent event) {
case 2 -> event.entityPlayer.triggerAchievement(TFAchievementPage.twilightKillLich);
case 3 -> event.entityPlayer.triggerAchievement(TFAchievementPage.twilightProgressUrghast);
case 4 -> event.entityPlayer.triggerAchievement(TFAchievementPage.twilightProgressGlacier);
case 5 -> event.entityPlayer.triggerAchievement(TFAchievementPage.twilightProgressLabyrinth);
case 6 -> event.entityPlayer.triggerAchievement(TFAchievementPage.twilightProgressKnights);
case 7 -> event.entityPlayer.triggerAchievement(TFAchievementPage.twilightProgressYeti);
}
// mazebreaker
} else if (item == TFItems.mazebreakerPick) {
Expand Down Expand Up @@ -421,24 +431,19 @@ public void entityHurts(LivingHurtEvent event) {
EntityTFCharmEffect effect = new EntityTFCharmEffect(
player.worldObj,
player,
charm1 ? TFItems.charmOfLife1 : TFItems.charmOfLife2);
charm1 ? TFItems.charmOfLife1 : TFItems.charmOfLife2,
0);
player.worldObj.spawnEntityInWorld(effect);

EntityTFCharmEffect effect2 = new EntityTFCharmEffect(
player.worldObj,
player,
charm1 ? TFItems.charmOfLife1 : TFItems.charmOfLife2);
effect2.offset = (float) Math.PI;
charm1 ? TFItems.charmOfLife1 : TFItems.charmOfLife2,
(float) Math.PI);
player.worldObj.spawnEntityInWorld(effect2);

// sound
player.worldObj.playSoundEffect(
player.posX + 0.5D,
player.posY + 0.5D,
player.posZ + 0.5D,
"mob.zombie.unfect",
1.5F,
1.0F);
player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "mob.zombie.unfect", 1.5F, 1.0F);

}
}
Expand Down Expand Up @@ -570,6 +575,17 @@ public void livingDies(LivingDeathEvent event) {
}
playerKeepsMap.put(player.getCommandSenderName(), keepInventory);
}

// check for phantom armor
for (int i = 0; i < 4; i++) {
if (player.inventory.armorInventory[i] != null
&& player.inventory.armorInventory[i].getItem() instanceof ItemTFPhantomArmor) {
InventoryPlayer keepInventory = retrieveOrMakeKeepInventory(player);
keepInventory.armorInventory[i] = ItemStack.copyItemStack(player.inventory.armorInventory[i]);
player.inventory.armorInventory[i] = null;
playerKeepsMap.put(player.getCommandSenderName(), keepInventory);
}
}
}

if (playerKeepsMap.size() > 1) {
Expand Down Expand Up @@ -599,6 +615,51 @@ private void keepAllArmor(EntityPlayer player, InventoryPlayer keepInventory) {
}
}

@SubscribeEvent
public void playerLoad(PlayerEvent.LoadFromFile event) {
playerLoadDo(event.entityPlayer, event.playerDirectory);
}

private void playerLoadDo(EntityPlayer player, File directory) {
File file1, file2;

// look for normal files first
file1 = getPlayerFile(fileName, directory, player.getCommandSenderName());
file2 = getPlayerFile(fileNameBackup, directory, player.getCommandSenderName());

// look for uuid files when normal file missing
if (!file1.exists()) {
File filep = getPlayerFileUUID(fileName, directory, player.getGameProfile().getId().toString());
if (filep.exists()) {
try {
Files.copy(filep, file1);
System.out.println(
"Using and converting UUID Charm of Keeping savefile for " + player.getCommandSenderName());
filep.delete();
File fb = getPlayerFileUUID(fileNameBackup, directory, player.getGameProfile().getId().toString());
if (fb.exists()) fb.delete();
} catch (IOException e) {}
}
}

TFPlayerHandler.loadPlayerKeepInventory(player, file1, file2);
}

public static File getPlayerFile(String suffix, File playerDirectory, String playername) {
if ("dat".equals(suffix)) throw new IllegalArgumentException("The suffix 'dat' is reserved");
return new File(playerDirectory, playername + "." + suffix);
}

public File getPlayerFileUUID(String suffix, File playerDirectory, String playerUUID) {
if ("dat".equals(suffix)) throw new IllegalArgumentException("The suffix 'dat' is reserved");
return new File(playerDirectory, playerUUID + "." + suffix);
}

@SubscribeEvent
public void playerSave(PlayerEvent.SaveToFile event) {
TFBaublesIntegration.playerSaveDo(event.entityPlayer, event.playerDirectory);
}

/**
* Maybe we kept some stuff for the player!
*/
Expand Down Expand Up @@ -627,35 +688,25 @@ public void onPlayerRespawn(PlayerRespawnEvent event) {
}
}

if (TwilightForestMod.areBaublesLoaded && baublesInventory != null) {
InventoryBaubles inventoryBaubles = PlayerHandler.getPlayerBaubles(player);
for (int i = 0; i < inventoryBaubles.getSizeInventory(); i++) {
if (baublesInventory[i] != null) inventoryBaubles.setInventorySlotContents(i, baublesInventory[i]);
}
}
TFBaublesIntegration.restoreBaubles(player, baublesInventory);

// spawn effect thingers
if (keepInventory.getItemStack() != null) {
EntityTFCharmEffect effect = new EntityTFCharmEffect(
player.worldObj,
player,
keepInventory.getItemStack().getItem());
keepInventory.getItemStack().getItem(),
0);
player.worldObj.spawnEntityInWorld(effect);

EntityTFCharmEffect effect2 = new EntityTFCharmEffect(
player.worldObj,
player,
keepInventory.getItemStack().getItem());
effect2.offset = (float) Math.PI;
keepInventory.getItemStack().getItem(),
(float) Math.PI);
player.worldObj.spawnEntityInWorld(effect2);

player.worldObj.playSoundEffect(
player.posX + 0.5D,
player.posY + 0.5D,
player.posZ + 0.5D,
"mob.zombie.unfect",
1.5F,
1.0F);
player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "mob.zombie.unfect", 1.5F, 1.0F);
}
playerKeepsMap.remove(player.getCommandSenderName());
playerBaublesMap.remove(player.getCommandSenderName());
Expand All @@ -668,18 +719,8 @@ public void onPlayerRespawn(PlayerRespawnEvent event) {
@SubscribeEvent
public void onPlayerLogout(PlayerLoggedOutEvent event) {
EntityPlayer player = event.player;
if (playerKeepsMap.containsKey(player.getCommandSenderName())) {
FMLLog.warning(
"[TwilightForest] Mod was keeping inventory items in reserve for player %s but they logged out! Items are being dropped.",
player.getCommandSenderName());
InventoryPlayer keepInventory = playerKeepsMap.get(player.getCommandSenderName());

// set player to the player logging out
keepInventory.player = player;
keepInventory.dropAllItems();

if (playerKeepsMap.containsKey(player.getCommandSenderName()))
playerKeepsMap.remove(player.getCommandSenderName());
}
}

/**
Expand Down
Loading

0 comments on commit 3e69ed4

Please sign in to comment.