Fixed server-side crashes and fixed a wrong check for the Smelting anointment.

This commit is contained in:
WayofTime 2021-01-16 11:51:26 -05:00
parent 9d1d8fc01f
commit 113c33ca5c
7 changed files with 45 additions and 15 deletions

View file

@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
version = '1.16.3-3.0.5-10' version = '1.16.3-3.0.6-11'
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'BloodMagic' archivesBaseName = 'BloodMagic'

View file

@ -1,3 +1,18 @@
------------------------------------------------------
Version 3.0.6
------------------------------------------------------
- Reimplemented the Well of Suffering.
- Added several new items, called "Anointments"! These are items that provide temporary buffs to your tools and weapons, such as silk touch, higher damage, and more! Look them up in the Utility section of the book. These include:
- Honing Oil
- Soft Coating
- Fortuna Extract
- Holy Water
- Miner's Secrets
- Dexterity Alkahest
- Iron Tip
- Plunderer's Glint
- Slow-burning Oil
------------------------------------------------------ ------------------------------------------------------
Version 3.0.5 Version 3.0.5
------------------------------------------------------ ------------------------------------------------------

View file

@ -1,5 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/BloodMagic3"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<mapAttribute key="org.eclipse.debug.core.environmentVariables"> <mapAttribute key="org.eclipse.debug.core.environmentVariables">
<mapEntry key="FORGE_GROUP" value="net.minecraftforge"/> <mapEntry key="FORGE_GROUP" value="net.minecraftforge"/>
<mapEntry key="FORGE_VERSION" value="34.1.11"/> <mapEntry key="FORGE_VERSION" value="34.1.11"/>
@ -9,9 +15,11 @@
<mapEntry key="MOD_CLASSES" value="bloodmagic%%C:\Users\Scott\Desktop\BloodMagic3\bin\main;bloodmagic%%C:\Users\Scott\Desktop\BloodMagic3\bin\main"/> <mapEntry key="MOD_CLASSES" value="bloodmagic%%C:\Users\Scott\Desktop\BloodMagic3\bin\main;bloodmagic%%C:\Users\Scott\Desktop\BloodMagic3\bin\main"/>
<mapEntry key="target" value="fmluserdevserver"/> <mapEntry key="target" value="fmluserdevserver"/>
</mapAttribute> </mapAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.buildship.core.classpathprovider"/> <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.buildship.core.classpathprovider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.minecraftforge.userdev.LaunchTesting"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.minecraftforge.userdev.LaunchTesting"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value=""/> <stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="BloodMagic3"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="BloodMagic3"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="BloodMagic3"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dforge.logging.console.level=debug -Dmixin.env.disableRefMap=true -Dforge.logging.markers=SCAN,REGISTRIES,REGISTRYDUMP"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dforge.logging.console.level=debug -Dmixin.env.disableRefMap=true -Dforge.logging.markers=SCAN,REGISTRIES,REGISTRYDUMP"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="C:\Users\Scott\Desktop\BloodMagic3\run"/> <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="C:\Users\Scott\Desktop\BloodMagic3\run"/>

View file

@ -124,7 +124,6 @@ public class BloodMagic
modBus.addListener(this::processIMC); modBus.addListener(this::processIMC);
// Register the doClientStuff method for modloading // Register the doClientStuff method for modloading
modBus.addListener(this::doClientStuff); modBus.addListener(this::doClientStuff);
modBus.addListener(this::registerColors);
modBus.addListener(this::loadModels); modBus.addListener(this::loadModels);
modBus.addListener(this::gatherData); modBus.addListener(this::gatherData);
@ -134,6 +133,8 @@ public class BloodMagic
modBus.addGenericListener(Effect.class, BloodMagicPotions::registerPotions); modBus.addGenericListener(Effect.class, BloodMagicPotions::registerPotions);
MinecraftForge.EVENT_BUS.register(new GenericHandler()); MinecraftForge.EVENT_BUS.register(new GenericHandler());
// MinecraftForge.EVENT_BUS.register(new ClientEvents());
modBus.addListener(this::registerColors);
MinecraftForge.EVENT_BUS.register(new WillHandler()); MinecraftForge.EVENT_BUS.register(new WillHandler());
// MinecraftForge.EVENT_BUS.register(new BloodMagicBlocks()); // MinecraftForge.EVENT_BUS.register(new BloodMagicBlocks());
@ -247,11 +248,16 @@ public class BloodMagic
ClientEvents.initClientEvents(event); ClientEvents.initClientEvents(event);
Elements.registerElements(); Elements.registerElements();
MinecraftForge.EVENT_BUS.register(new ClientEvents());
// IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus();
//
} }
private void registerColors(final ColorHandlerEvent.Item event) private void registerColors(final ColorHandlerEvent event)
{ {
ClientEvents.colorHandlerEvent(event); if (event instanceof ColorHandlerEvent.Item)
ClientEvents.colorHandlerEvent((ColorHandlerEvent.Item) event);
} }
private void enqueueIMC(final InterModEnqueueEvent event) private void enqueueIMC(final InterModEnqueueEvent event)

View file

@ -13,6 +13,7 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.ColorHandlerEvent; import net.minecraftforge.client.event.ColorHandlerEvent;
import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.DeferredWorkQueue; import net.minecraftforge.fml.DeferredWorkQueue;
import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.client.registry.ClientRegistry;
@ -21,6 +22,7 @@ import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import wayoftime.bloodmagic.BloodMagic; import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.anointment.AnointmentColor; import wayoftime.bloodmagic.anointment.AnointmentColor;
import wayoftime.bloodmagic.anointment.AnointmentHolder;
import wayoftime.bloodmagic.api.compat.IMultiWillTool; import wayoftime.bloodmagic.api.compat.IMultiWillTool;
import wayoftime.bloodmagic.client.model.MimicColor; import wayoftime.bloodmagic.client.model.MimicColor;
import wayoftime.bloodmagic.client.render.alchemyarray.BeaconAlchemyCircleRenderer; import wayoftime.bloodmagic.client.render.alchemyarray.BeaconAlchemyCircleRenderer;
@ -72,6 +74,14 @@ public class ClientEvents
event.getItemColors().register(new AnointmentColor(), BloodMagicItems.MELEE_DAMAGE_ANOINTMENT.get(), BloodMagicItems.SILK_TOUCH_ANOINTMENT.get(), BloodMagicItems.FORTUNE_ANOINTMENT.get(), BloodMagicItems.HOLY_WATER_ANOINTMENT.get(), BloodMagicItems.HIDDEN_KNOWLEDGE_ANOINTMENT.get(), BloodMagicItems.QUICK_DRAW_ANOINTMENT.get(), BloodMagicItems.LOOTING_ANOINTMENT.get(), BloodMagicItems.BOW_POWER_ANOINTMENT.get(), BloodMagicItems.WILL_POWER_ANOINTMENT.get(), BloodMagicItems.SMELTING_ANOINTMENT.get()); event.getItemColors().register(new AnointmentColor(), BloodMagicItems.MELEE_DAMAGE_ANOINTMENT.get(), BloodMagicItems.SILK_TOUCH_ANOINTMENT.get(), BloodMagicItems.FORTUNE_ANOINTMENT.get(), BloodMagicItems.HOLY_WATER_ANOINTMENT.get(), BloodMagicItems.HIDDEN_KNOWLEDGE_ANOINTMENT.get(), BloodMagicItems.QUICK_DRAW_ANOINTMENT.get(), BloodMagicItems.LOOTING_ANOINTMENT.get(), BloodMagicItems.BOW_POWER_ANOINTMENT.get(), BloodMagicItems.WILL_POWER_ANOINTMENT.get(), BloodMagicItems.SMELTING_ANOINTMENT.get());
} }
@SubscribeEvent
public void appendTooltip(ItemTooltipEvent event)
{
ItemStack stack = event.getItemStack();
AnointmentHolder holder = AnointmentHolder.fromItemStack(stack);
AnointmentHolder.appendAnointmentTooltip(holder, event.getToolTip());
}
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public static void initClientEvents(FMLClientSetupEvent event) public static void initClientEvents(FMLClientSetupEvent event)
{ {

View file

@ -235,7 +235,7 @@ public class GlobalLootModifier
ItemStack ctxTool = context.get(LootParameters.TOOL); ItemStack ctxTool = context.get(LootParameters.TOOL);
// return early if silk-touch is already applied (otherwise we'll get stuck in // return early if silk-touch is already applied (otherwise we'll get stuck in
// an infinite loop). // an infinite loop).
if (ctxTool.getTag() != null) if (ctxTool.getTag() == null)
{ {
return generatedLoot; return generatedLoot;
} }

View file

@ -32,7 +32,6 @@ import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.entity.living.LivingHealEvent; import net.minecraftforge.event.entity.living.LivingHealEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerXpEvent; import net.minecraftforge.event.entity.player.PlayerXpEvent;
@ -551,14 +550,6 @@ public class GenericHandler
} }
} }
@SubscribeEvent
public void appendTooltip(ItemTooltipEvent event)
{
ItemStack stack = event.getItemStack();
AnointmentHolder holder = AnointmentHolder.fromItemStack(stack);
AnointmentHolder.appendAnointmentTooltip(holder, event.getToolTip());
}
private static final Map<ItemStack, Double> rollMap = new HashMap<ItemStack, Double>(); private static final Map<ItemStack, Double> rollMap = new HashMap<ItemStack, Double>();
@SubscribeEvent @SubscribeEvent