Open GalaxinTM opened 3 weeks ago
I barely know anything about minecraft modding and how to use github in general, but I've dug into the code and found the code snippet
public List<ItemStack> getItemsDropped(List<ItemStack> droppedItems)
{
super.getItemsDropped(droppedItems);
ItemStack rocket = new ItemStack(GSItems.ROCKET_TIER_6, 1, this.rocketType.getIndex());
rocket.setTagCompound(new NBTTagCompound());
rocket.getTagCompound().setInteger("RocketFuel", this.fuelTank.getFluidAmount());
droppedItems.add(rocket);
return droppedItems;
}
This snippet does not account for the rocket engine being used in the rocket. It's missing a measure that accounts for the engine_type
used.
It affects rockets tier 4 and 5, as they can also have an Ion engine to boost their speed
I made a temporary fix using crafttweaker and zenutils
import mods.zenutils.event.EntityRemoveEvent;
import crafttweaker.world.IBlockPos;
events.onEntityRemove(function(event as EntityRemoveEvent){
val entity = event.entity;
val world = entity.world;
if (("galacticraftcore:rocket_tier_4".matches(entity.definition.id) || "galacticraftcore:rocket_tier_5".matches(entity.definition.id) || "galacticraftcore:rocket_tier_6".matches(entity.definition.id)) && !world.isRemote() && 512 > entity.y) {
if (entity.getNBT().engine_type == 3) {
world.spawnEntity(<galaxyspace:rocket_modules:6>.createEntityItem(world, entity.position3f as IBlockPos)); // thanks friendlyhj
} else if (entity.getNBT().engine_type == 1) {
world.spawnEntity(<galaxyspace:rocket_modules:4>.createEntityItem(world, entity.position3f as IBlockPos));
}
}
});
Do not remove this template, without it your issue will not be considered!
Please fill in the form below:
Other add-ons: MorePlanets, GalacticraftTweaker
Description of the issue:
The rocket engine (Ion or Sublight) is voided after placing down and removing the rocket. It's good that the rocket keeps its engine after going to space like it normally does, but for the engine to be voided simply after removing it from the launch pad is a big problem.
What should happen:
What happens instead:
Screenshot/Video:
https://github.com/user-attachments/assets/b63e54e1-2408-4c63-a55d-f1dfa4e959ea
Attached log file (or url on pastebin.com):