Did I forget some things? O wO

This commit is contained in:
WayofTime 2020-11-06 17:00:08 -05:00
parent 15e538c800
commit d8ba32c412
23 changed files with 684 additions and 437 deletions

View file

@ -64,6 +64,10 @@ public class GeneratorBaseRecipes extends BaseRecipeProvider
ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.CAPACITY_RUNE.get()).key('a', Tags.Items.STONE).key('b', Items.BUCKET).key('c', BloodMagicBlocks.BLANK_RUNE.get()).key('d', BloodMagicItems.IMBUED_SLATE.get()).patternLine("aba").patternLine("bcb").patternLine("ada").addCriterion("has_imbued_slate", hasItem(BloodMagicItems.IMBUED_SLATE.get())).build(consumer, BloodMagic.rl("blood_rune_capacity"));
ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.ORB_RUNE.get()).key('a', Tags.Items.STONE).key('b', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_WEAK.get())).key('c', BloodMagicBlocks.BLANK_RUNE.get()).key('d', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_MASTER.get())).patternLine("aba").patternLine("cdc").patternLine("aba").addCriterion("has_master_orb", hasItem(BloodMagicItems.MASTER_BLOOD_ORB.get())).build(consumer, BloodMagic.rl("blood_rune_orb"));
ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.CHARGING_RUNE.get()).key('R', Tags.Items.DUSTS_REDSTONE).key('r', BloodMagicBlocks.BLANK_RUNE.get()).key('s', BloodMagicItems.DEMONIC_SLATE.get()).key('e', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_MASTER.get())).key('G', Tags.Items.DUSTS_GLOWSTONE).patternLine("RsR").patternLine("GrG").patternLine("ReR").addCriterion("has_master_orb", hasItem(BloodMagicItems.MASTER_BLOOD_ORB.get())).build(consumer, BloodMagic.rl("blood_rune_charging"));
ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.DISPLACEMENT_RUNE.get()).key('a', Tags.Items.STONE).key('b', Items.WATER_BUCKET).key('c', BloodMagicBlocks.BLANK_RUNE.get()).key('d', BloodMagicItems.IMBUED_SLATE.get()).patternLine("aba").patternLine("bcb").patternLine("ada").addCriterion("has_imbued_slate", hasItem(BloodMagicItems.IMBUED_SLATE.get())).build(consumer, BloodMagic.rl("blood_rune_displacement"));
ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.AUGMENTED_CAPACITY_RUNE.get()).key('a', Tags.Items.OBSIDIAN).key('b', BloodMagicItems.DEMONIC_SLATE.get()).key('c', Items.BUCKET).key('d', BloodMagicBlocks.CAPACITY_RUNE.get()).key('e', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_MASTER.get())).patternLine("aba").patternLine("cdc").patternLine("aea").addCriterion("has_master_orb", hasItem(BloodMagicItems.MASTER_BLOOD_ORB.get())).build(consumer, BloodMagic.rl("blood_rune_aug_capacity"));
ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.ACCELERATION_RUNE.get()).key('a', Items.BUCKET).key('b', BloodMagicItems.DEMONIC_SLATE.get()).key('c', Tags.Items.INGOTS_GOLD).key('d', BloodMagicBlocks.SPEED_RUNE.get()).key('e', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_MASTER.get())).patternLine("aba").patternLine("cdc").patternLine("aea").addCriterion("has_master_orb", hasItem(BloodMagicItems.MASTER_BLOOD_ORB.get())).build(consumer, BloodMagic.rl("blood_rune_acceleration"));
ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.BLANK_RITUAL_STONE.get(), 4).key('a', Tags.Items.OBSIDIAN).key('b', BloodMagicItems.REINFORCED_SLATE.get()).key('c', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_APPRENTICE.get())).patternLine("aba").patternLine("bcb").patternLine("aba").addCriterion("has_apprentice_orb", hasItem(BloodMagicItems.APPRENTICE_BLOOD_ORB.get())).build(consumer, BloodMagic.rl("ritual_stone_blank"));
ShapedRecipeBuilder.shapedRecipe(BloodMagicBlocks.MASTER_RITUAL_STONE.get()).key('a', Tags.Items.OBSIDIAN).key('b', BloodMagicBlocks.BLANK_RITUAL_STONE.get()).key('c', IngredientBloodOrb.fromOrb(BloodMagicItems.ORB_MAGICIAN.get())).patternLine("aba").patternLine("bcb").patternLine("aba").addCriterion("has_magician_orb", hasItem(BloodMagicItems.MAGICIAN_BLOOD_ORB.get())).build(consumer, BloodMagic.rl("ritual_stone_master"));

View file

@ -149,7 +149,7 @@ public class GeneratorLanguage extends LanguageProvider
addBlock(BloodMagicBlocks.SPEED_RUNE, "Speed Rune");
addBlock(BloodMagicBlocks.SACRIFICE_RUNE, "Rune of Sacrifice");
addBlock(BloodMagicBlocks.SELF_SACRIFICE_RUNE, "Rune of Self Sacrifice");
addBlock(BloodMagicBlocks.DISPLACEMENT_RUNE, "DisplacementRune");
addBlock(BloodMagicBlocks.DISPLACEMENT_RUNE, "Displacement Rune");
addBlock(BloodMagicBlocks.CAPACITY_RUNE, "Rune of Capacity");
addBlock(BloodMagicBlocks.AUGMENTED_CAPACITY_RUNE, "Rune of Augmented Capacity");
addBlock(BloodMagicBlocks.ORB_RUNE, "Rune of the Orb");
@ -243,6 +243,11 @@ public class GeneratorLanguage extends LanguageProvider
addItem(BloodMagicItems.DUSK_RITUAL_DIVINER, "Ritual Diviner [Dusk]");
addItem(BloodMagicItems.WEAK_BLOOD_SHARD, "Weak Blood Shard");
addItem(BloodMagicItems.RAW_CRYSTAL, "Demon Will Crystal");
addItem(BloodMagicItems.CORROSIVE_CRYSTAL, "Corrosive Will Crystal");
addItem(BloodMagicItems.DESTRUCTIVE_CRYSTAL, "Destructive Will Crystal");
addItem(BloodMagicItems.VENGEFUL_CRYSTAL, "Vengeful Will Crystal");
addItem(BloodMagicItems.STEADFAST_CRYSTAL, "Steadfast Will Crystal");
addItem(BloodMagicItems.SANGUINE_REVERTER, "Sanguine Reverter");
addItem(BloodMagicItems.PRIMITIVE_FURNACE_CELL, "Primitive Fuel Cell");

View file

@ -1,7 +1,7 @@
package wayoftime.bloodmagic.demonaura;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ConcurrentLinkedQueue;
import javax.annotation.Nullable;
@ -16,7 +16,7 @@ import wayoftime.bloodmagic.will.EnumDemonWillType;
public class WorldDemonWillHandler
{
public static ConcurrentHashMap<ResourceLocation, CopyOnWriteArrayList<PosXY>> dirtyChunks = new ConcurrentHashMap<>();
public static ConcurrentHashMap<ResourceLocation, ConcurrentLinkedQueue<PosXY>> dirtyChunks = new ConcurrentHashMap<>();
static ConcurrentHashMap<ResourceLocation, WillWorld> containedWills = new ConcurrentHashMap<>();
@Nullable
@ -198,9 +198,9 @@ public class WorldDemonWillHandler
PosXY pos = new PosXY(chunk.loc.x, chunk.loc.y);
if (!dirtyChunks.containsKey(resourceLocation))
{
dirtyChunks.put(resourceLocation, new CopyOnWriteArrayList<>());
dirtyChunks.put(resourceLocation, new ConcurrentLinkedQueue<>());
}
CopyOnWriteArrayList<PosXY> dc = dirtyChunks.get(resourceLocation);
ConcurrentLinkedQueue<PosXY> dc = dirtyChunks.get(resourceLocation);
if (!dc.contains(pos))
{
dc.add(pos);

View file

@ -2,7 +2,7 @@ package wayoftime.bloodmagic.util.handler.event;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ConcurrentLinkedQueue;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
@ -17,7 +17,11 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.Difficulty;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.chunk.IChunk;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
@ -142,11 +146,18 @@ public class WillHandler
if (ticks % 20 == 0)
{
CopyOnWriteArrayList<PosXY> dirtyChunks = WorldDemonWillHandler.dirtyChunks.get(rl);
// CopyOnWriteArrayList<PosXY> dirtyChunks = WorldDemonWillHandler.dirtyChunks.get(rl);
ConcurrentLinkedQueue<PosXY> dirtyChunks = WorldDemonWillHandler.dirtyChunks.get(rl);
if ((dirtyChunks != null) && (dirtyChunks.size() > 0))
{
for (PosXY pos : dirtyChunks)
event.world.markChunkDirty(new BlockPos(pos.x * 16, 5, pos.y * 16), null);
{
IChunk chunk = event.world.getChunk(pos.x, pos.y, ChunkStatus.FULL, false);
if (chunk != null)
{
chunk.setModified(true);
}
}
dirtyChunks.clear();
}
@ -157,6 +168,23 @@ public class WillHandler
}
public static boolean isBlockLoaded(IBlockReader world, BlockPos pos)
{
if (world == null || !World.isValid(pos))
{
return false;
} else if (world instanceof IWorldReader)
{
// Note: We don't bother checking if it is a world and then isBlockPresent
// because
// all that does is also validate the y value is in bounds, and we already check
// to make
// sure the position is valid both in the y and xz directions
return ((IWorldReader) world).isBlockLoaded(pos);
}
return true;
}
@SubscribeEvent
public void chunkSave(ChunkDataEvent.Save event)
{