Finish making some quality of life changes

This commit is contained in:
zontreck 2024-01-03 04:14:49 -07:00
parent 8a395bd9d6
commit 30bbd059b3
63 changed files with 1256 additions and 908 deletions

View file

@ -3,7 +3,7 @@
org.gradle.jvmargs=-Xmx3G org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false org.gradle.daemon=false
libzontreck=1.9.122023.1612 libzontreck=1.10.010224.1940
## Environment Properties ## Environment Properties

View file

@ -20,8 +20,10 @@ import dev.zontreck.otemod.implementation.CreativeModeTabs;
import dev.zontreck.otemod.implementation.InventoryBackup; import dev.zontreck.otemod.implementation.InventoryBackup;
import dev.zontreck.otemod.implementation.Messages; import dev.zontreck.otemod.implementation.Messages;
import dev.zontreck.otemod.implementation.PlayerFirstJoinTag; import dev.zontreck.otemod.implementation.PlayerFirstJoinTag;
import dev.zontreck.otemod.implementation.compressor.CompressionChamberScreen;
import dev.zontreck.otemod.implementation.vault.*; import dev.zontreck.otemod.implementation.vault.*;
import dev.zontreck.otemod.integrations.KeyBindings; import dev.zontreck.otemod.integrations.KeyBindings;
import dev.zontreck.otemod.recipe.ModRecipes;
import net.minecraft.client.gui.screens.MenuScreens; import net.minecraft.client.gui.screens.MenuScreens;
import net.minecraft.client.renderer.entity.EntityRenderers; import net.minecraft.client.renderer.entity.EntityRenderers;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
@ -130,6 +132,7 @@ public class OTEMod
ModEntities.register(bus); ModEntities.register(bus);
ModEnchantments.register(bus); ModEnchantments.register(bus);
ModEntityTypes.register(bus); ModEntityTypes.register(bus);
ModRecipes.register(bus);
//MenuInitializer.register(bus); //MenuInitializer.register(bus);
@ -312,6 +315,7 @@ public class OTEMod
MenuScreens.register(ModMenuTypes.VAULT.get(), VaultScreen::new); MenuScreens.register(ModMenuTypes.VAULT.get(), VaultScreen::new);
MenuScreens.register(ModMenuTypes.SCRUBBER.get(), ItemScrubberScreen::new); MenuScreens.register(ModMenuTypes.SCRUBBER.get(), ItemScrubberScreen::new);
MenuScreens.register(ModMenuTypes.MAGIC_SCRUBBER.get(), MagicalScrubberScreen::new); MenuScreens.register(ModMenuTypes.MAGIC_SCRUBBER.get(), MagicalScrubberScreen::new);
MenuScreens.register(ModMenuTypes.COMPRESSION_CHAMBER.get(), CompressionChamberScreen::new);
//ItemBlockRenderTypes.setRenderLayer(ModBlocks.AURORA_DOOR.get(), RenderType.translucent()); //ItemBlockRenderTypes.setRenderLayer(ModBlocks.AURORA_DOOR.get(), RenderType.translucent());

View file

@ -0,0 +1,83 @@
package dev.zontreck.otemod.blocks;
import dev.zontreck.otemod.blocks.entity.CompressionChamberBlockEntity;
import dev.zontreck.otemod.blocks.entity.ModEntities;
import dev.zontreck.otemod.networking.ModMessages;
import dev.zontreck.otemod.networking.packets.EnergySyncS2CPacket;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraftforge.network.NetworkHooks;
import org.jetbrains.annotations.Nullable;
public class CompressionChamberBlock extends BaseEntityBlock
{
public CompressionChamberBlock(Properties pProperties) {
super(pProperties);
}
@Nullable
@Override
public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
return new CompressionChamberBlockEntity(blockPos, blockState);
}
@Override
public RenderShape getRenderShape(BlockState pState) {
return RenderShape.MODEL;
}
@Override
public InteractionResult use(BlockState state, Level lvl, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit)
{
if(!lvl.isClientSide())
{
BlockEntity be = lvl.getBlockEntity(pos);
if(be instanceof CompressionChamberBlockEntity)
{
CompressionChamberBlockEntity entity = (CompressionChamberBlockEntity) be;
NetworkHooks.openScreen(((ServerPlayer)player), entity, pos);
ModMessages.sendToPlayer(new EnergySyncS2CPacket(entity.getEnergyStorage().getEnergyStored(), entity.getBlockPos()), (ServerPlayer)player);
}else{
throw new IllegalStateException("Our container is missing!");
}
}
return InteractionResult.sidedSuccess(lvl.isClientSide);
}
@Override
public void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pMovedByPiston) {
if(pState.getBlock() != pNewState.getBlock())
{
BlockEntity be = pLevel.getBlockEntity(pPos);
if(be instanceof CompressionChamberBlockEntity)
{
((CompressionChamberBlockEntity)be).doDrop();
}
}
super.onRemove(pState, pLevel, pPos, pNewState, pMovedByPiston);
}
@Nullable
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level pLevel, BlockState pState, BlockEntityType<T> pBlockEntityType) {
return createTickerHelper(pBlockEntityType, ModEntities.COMPRESSION_CHAMBER.get(), CompressionChamberBlockEntity::tick);
}
}

View file

@ -90,6 +90,18 @@ public class ModBlocks {
public static final RegistryObject<Item> ILUSIUM_BLOCK_I = CreativeModeTabs.addToOTEModTab(ITEMS.register("ilusium_block", () -> new BlockItem(ILUSIUM_BLOCK.get(), new Item.Properties()))); public static final RegistryObject<Item> ILUSIUM_BLOCK_I = CreativeModeTabs.addToOTEModTab(ITEMS.register("ilusium_block", () -> new BlockItem(ILUSIUM_BLOCK.get(), new Item.Properties())));
public static final RegistryObject<Block> COMPRESSION_CHAMBER_BLOCK = BLOCKS.register("compression_chamber", ()->new CompressionChamberBlock(BlockBehaviour.Properties.copy(ModBlocks.ILUSIUM_BLOCK.get()).noOcclusion().isViewBlocking(ModBlocks::never)));
public static final RegistryObject<Item> COMPRESSION_CHAMBER_BLOCK_I = CreativeModeTabs.addToOTEModTab(ITEMS.register("compression_chamber", ()->new BlockItem(COMPRESSION_CHAMBER_BLOCK.get(), new Item.Properties())));
public static final RegistryObject<Block> COMPRESSED_OBSIDIAN_BLOCK = BLOCKS.register("compressed_obsidian_block", ()->new Block(BlockBehaviour.Properties.copy(Blocks.OBSIDIAN)));
public static final RegistryObject<Item> COMPRESSED_OBSIDIAN_BLOCK_I = CreativeModeTabs.addToOTEModTab(ITEMS.register("compressed_obsidian_block", ()->new BlockItem(COMPRESSED_OBSIDIAN_BLOCK.get(), new Item.Properties())));
public static final RegistryObject<Block> LAYERED_COMPRESSED_OBSIDIAN_BLOCK = BLOCKS.register("layered_compressed_obsidian_block", ()->new Block(BlockBehaviour.Properties.copy(Blocks.OBSIDIAN)));
public static final RegistryObject<Item> LAYERED_COMPRESSED_OBSIDIAN_BLOCK_I = CreativeModeTabs.addToOTEModTab(ITEMS.register("layered_compressed_obsidian_block", ()->new BlockItem(LAYERED_COMPRESSED_OBSIDIAN_BLOCK.get(), new Item.Properties())));

View file

@ -0,0 +1,305 @@
package dev.zontreck.otemod.blocks.entity;
import dev.zontreck.otemod.implementation.OutputItemStackHandler;
import dev.zontreck.otemod.implementation.compressor.CompressionChamberMenu;
import dev.zontreck.otemod.implementation.energy.OTEEnergy;
import dev.zontreck.otemod.networking.ModMessages;
import dev.zontreck.otemod.networking.packets.EnergySyncS2CPacket;
import dev.zontreck.otemod.recipe.CompressionChamberRecipe;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.world.Containers;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.ContainerData;
import net.minecraft.world.inventory.SimpleContainerData;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.energy.EnergyStorage;
import net.minecraftforge.energy.IEnergyStorage;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;
import javax.annotation.Nullable;
import java.util.Optional;
public class CompressionChamberBlockEntity extends BlockEntity implements MenuProvider
{
public CompressionChamberBlockEntity(BlockPos pPos, BlockState pBlockState) {
super(ModEntities.COMPRESSION_CHAMBER.get(), pPos, pBlockState);
outputSlot = new OutputItemStackHandler(outputItems);
data = new ContainerData() {
@Override
public int get(int i) {
return switch (i){
case 0 -> CompressionChamberBlockEntity.this.progress;
default -> 0;
};
}
@Override
public void set(int i, int i1) {
switch(i)
{
case 0->CompressionChamberBlockEntity.this.progress = i1;
}
}
@Override
public int getCount() {
return 1;
}
};
}
protected final ContainerData data;
protected int progress=0;
public static final int MAXIMUM_PROCESSING_TICKS = 750;
protected final ItemStackHandler itemsHandler = new ItemStackHandler(1){
@Override
protected void onContentsChanged(int slot)
{
setChanged();
}
};
protected final ItemStackHandler outputItems = new ItemStackHandler(1){
@Override
protected void onContentsChanged(int slot)
{
setChanged();
}
};
private ItemStackHandler outputSlot;
private final OTEEnergy ENERGY_STORAGE = new OTEEnergy(ENERGY_REQUIREMENT*3, ENERGY_REQUIREMENT*512) {
@Override
public void onChanged() {
setChanged();
ModMessages.sendToAll(new EnergySyncS2CPacket(energy, getBlockPos()));
}
};
private static final int ENERGY_REQUIREMENT = 7500;
private LazyOptional<IEnergyStorage> lazyEnergyHandler = LazyOptional.empty();
private LazyOptional<IItemHandler> lazyItemHandler = LazyOptional.empty();
private LazyOptional<IItemHandler> lazyOutputItems = LazyOptional.empty();
@Override
public Component getDisplayName() {
return Component.literal("Compression Chamber");
}
@Override
@Nullable
public AbstractContainerMenu createMenu(int id, Inventory inv, Player player) {
return new CompressionChamberMenu(id, inv, this, this.data);
}
@Override
public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side)
{
if(cap == ForgeCapabilities.ENERGY)
{
return lazyEnergyHandler.cast();
}
if(side == Direction.DOWN && cap == ForgeCapabilities.ITEM_HANDLER)
{
// Return the output slot only
return lazyOutputItems.cast();
}
if(cap == ForgeCapabilities.ITEM_HANDLER)
{
return lazyItemHandler.cast();
}
return super.getCapability(cap,side);
}
@Override
public void onLoad()
{
super.onLoad();
lazyItemHandler = LazyOptional.of(()->itemsHandler);
lazyOutputItems = LazyOptional.of(()->outputSlot);
lazyEnergyHandler = LazyOptional.of(()->ENERGY_STORAGE);
}
@Override
public void invalidateCaps()
{
super.invalidateCaps();
lazyItemHandler.invalidate();
lazyOutputItems.invalidate();
lazyEnergyHandler.invalidate();
}
@Override
protected void saveAdditional(CompoundTag nbt)
{
nbt.put("inventory", itemsHandler.serializeNBT());
nbt.put("output", outputItems.serializeNBT());
nbt.putInt("prog", progress);
nbt.putInt("energy", ENERGY_STORAGE.getEnergyStored());
super.saveAdditional(nbt);
}
@Override
public void load(CompoundTag nbt){
super.load(nbt);
itemsHandler.deserializeNBT(nbt.getCompound("inventory"));
outputItems.deserializeNBT(nbt.getCompound("output"));
progress = nbt.getInt("prog");
ENERGY_STORAGE.setEnergy(nbt.getInt("energy"));
}
public void doDrop()
{
SimpleContainer cont = new SimpleContainer(itemsHandler.getSlots());
for (int i = 0; i < itemsHandler.getSlots(); i++) {
cont.setItem(i, itemsHandler.getStackInSlot(i));
}
cont = new SimpleContainer(outputItems.getSlots());
for (int i = 0; i < outputItems.getSlots(); i++) {
cont.setItem(i, outputItems.getStackInSlot(i));
}
Containers.dropContents(this.level, this.worldPosition, cont);
}
public static void tick(Level lvl, BlockPos pos, BlockState state, CompressionChamberBlockEntity entity)
{
if(lvl.isClientSide())return;
if(hasRecipe(entity))
{
if(!hasEnergy(entity))return; // Halt until sufficient energy has been received
entity.progress++;
setChanged(lvl, pos, state);
drain(entity);
if(entity.progress >= CompressionChamberBlockEntity.MAXIMUM_PROCESSING_TICKS)
{
craftItem(entity);
}
}else {
if(entity.progress>0){
entity.resetProgress();
setChanged(lvl, pos, state);
}
}
}
private static void drain(CompressionChamberBlockEntity entity) {
entity.ENERGY_STORAGE.extractEnergy(ENERGY_REQUIREMENT, false);
}
private static boolean hasEnergy(CompressionChamberBlockEntity entity) {
return (entity.ENERGY_STORAGE.getEnergyStored() >= ENERGY_REQUIREMENT);
}
private static void craftItem(CompressionChamberBlockEntity entity) {
if(hasRecipe(entity))
{
SimpleContainer inventory = new SimpleContainer(entity.itemsHandler.getSlots());
for(int i=0;i<entity.itemsHandler.getSlots();i++)
{
inventory.setItem(i, entity.itemsHandler.getStackInSlot(i));
}
SimpleContainer output = new SimpleContainer(entity.outputItems.getSlots());
for(int i=0;i<entity.outputItems.getSlots();i++)
{
output.setItem(i, entity.outputItems.getStackInSlot(i));
}
Optional<CompressionChamberRecipe> recipe = entity.level.getRecipeManager().getRecipeFor(CompressionChamberRecipe.Type.INSTANCE, inventory, entity.level);
ItemStack existing = entity.outputItems.getStackInSlot(0);
if(existing.is(Items.AIR))
{
existing = recipe.get().getResultItem(entity.level.registryAccess());
}else
existing.setCount(recipe.get().getResultItem(entity.level.registryAccess()).getCount() + existing.getCount());
entity.outputItems.setStackInSlot(0, existing);
entity.itemsHandler.extractItem(0,1,false);
entity.resetProgress();
}
}
private static boolean hasRecipe(CompressionChamberBlockEntity entity) {
SimpleContainer inventory = new SimpleContainer(entity.itemsHandler.getSlots());
for(int i=0;i<entity.itemsHandler.getSlots();i++)
{
inventory.setItem(i, entity.itemsHandler.getStackInSlot(i));
}
SimpleContainer output = new SimpleContainer(entity.outputItems.getSlots());
for(int i=0;i<entity.outputItems.getSlots();i++)
{
output.setItem(i, entity.outputItems.getStackInSlot(i));
}
Optional<CompressionChamberRecipe> recipe = entity.level.getRecipeManager().getRecipeFor(CompressionChamberRecipe.Type.INSTANCE, inventory, entity.level);
return recipe.isPresent() && canInsertIntoOutput(output, recipe.get().getResultItem(entity.level.registryAccess()));
}
private static boolean canInsertIntoOutput(SimpleContainer inventory, ItemStack result) {
ItemStack existing = inventory.getItem(0);
boolean stackCompat = (existing.getMaxStackSize() > existing.getCount());
boolean sameType = (existing.getItem() == result.getItem());
boolean outputEmpty = existing.isEmpty();
if(outputEmpty)return true;
return (stackCompat && sameType);
}
private void resetProgress() {
progress=0;
}
public IEnergyStorage getEnergyStorage() {
return ENERGY_STORAGE;
}
public void setEnergy(int energy) {
ENERGY_STORAGE.setEnergy(energy);
}
}

View file

@ -1,6 +1,7 @@
package dev.zontreck.otemod.blocks.entity; package dev.zontreck.otemod.blocks.entity;
import dev.zontreck.otemod.OTEMod; import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.blocks.CompressionChamberBlock;
import dev.zontreck.otemod.blocks.ModBlocks; import dev.zontreck.otemod.blocks.ModBlocks;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
@ -19,6 +20,8 @@ public class ModEntities {
public static final ResourceLocation PARALLAX_BLOCK = new ResourceLocation(OTEMod.MOD_ID, "parallax_block"); public static final ResourceLocation PARALLAX_BLOCK = new ResourceLocation(OTEMod.MOD_ID, "parallax_block");
public static final RegistryObject<BlockEntityType<CompressionChamberBlockEntity>> COMPRESSION_CHAMBER = ENTITIES.register("compression_chamber", ()->BlockEntityType.Builder.of(CompressionChamberBlockEntity::new, ModBlocks.COMPRESSION_CHAMBER_BLOCK.get()).build(null));
public static final RegistryObject <BlockEntityType <ParallaxWindowEntity>> PARALLAX_WINDOW_ENTITY = ENTITIES.register("parallax_window", ()->BlockEntityType.Builder.of(ParallaxWindowEntity::new, ModBlocks.LIMINAL_WINDOW.get()).build(null)); public static final RegistryObject <BlockEntityType <ParallaxWindowEntity>> PARALLAX_WINDOW_ENTITY = ENTITIES.register("parallax_window", ()->BlockEntityType.Builder.of(ParallaxWindowEntity::new, ModBlocks.LIMINAL_WINDOW.get()).build(null));

View file

@ -37,6 +37,7 @@ public class OTEServerConfig {
public static final ForgeConfigSpec.ConfigValue<Boolean> GIVE_KIT_EVERY_CHANGE; public static final ForgeConfigSpec.ConfigValue<Boolean> GIVE_KIT_EVERY_CHANGE;
public static final ForgeConfigSpec.ConfigValue<Boolean> DEBUG;
static { static {
List<String> defaultExcludeDimensions = new ArrayList<String>(); List<String> defaultExcludeDimensions = new ArrayList<String>();
@ -44,6 +45,7 @@ public class OTEServerConfig {
defaultExcludeDimensions.add("minecraft:the_end"); // Excluded due to End Crystals defaultExcludeDimensions.add("minecraft:the_end"); // Excluded due to End Crystals
BUILDER.push("OTE"); BUILDER.push("OTE");
DEBUG = BUILDER.comment("Turn on debug messages in the console for all OTE functions? This could be spammy").define("debug_enabled", false);
BUILDER.push("STARTERKIT"); BUILDER.push("STARTERKIT");
GIVE_KIT_EVERY_CHANGE = BUILDER.comment("Enable this to give the starter kit every time it is changed, regardless of whether the player has already received that kit on their next join.").define("starter_kit_given_on_change", false); GIVE_KIT_EVERY_CHANGE = BUILDER.comment("Enable this to give the starter kit every time it is changed, regardless of whether the player has already received that kit on their next join.").define("starter_kit_given_on_change", false);
@ -79,7 +81,6 @@ public class OTEServerConfig {
defDims.add("minecraft:the_end"); defDims.add("minecraft:the_end");
defDims.add("minecraft:the_nether"); defDims.add("minecraft:the_nether");
defDims.add("otemod:resource"); defDims.add("otemod:resource");
defDims.add("otemod:resource_nether");
EXCLUDE_DIMS = BUILDER.comment("Dimension names (ex. minecraft:overworld) to exclude from the explosion healing events").define("exclude_dimensions", defDims); EXCLUDE_DIMS = BUILDER.comment("Dimension names (ex. minecraft:overworld) to exclude from the explosion healing events").define("exclude_dimensions", defDims);
BUILDER.pop(); BUILDER.pop();

View file

@ -72,6 +72,12 @@ public class FlightEnchantment extends Enchantment
recheck((ServerPlayer)ev.getEntity()); recheck((ServerPlayer)ev.getEntity());
} }
@SubscribeEvent
public static void onArmorBreak(LivingEquipmentChangeEvent ev)
{
}
} }
public FlightEnchantment(EquipmentSlot... slots) public FlightEnchantment(EquipmentSlot... slots)

View file

@ -2,6 +2,7 @@ package dev.zontreck.otemod.enchantments;
import java.util.Random; import java.util.Random;
import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.configs.OTEServerConfig; import dev.zontreck.otemod.configs.OTEServerConfig;
import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
@ -67,6 +68,11 @@ public class MobEggEnchantment extends Enchantment
CHANCE += bias; CHANCE += bias;
double rng = Math.random()*100000; double rng = Math.random()*100000;
if(OTEServerConfig.DEBUG.get())
{
OTEMod.LOGGER.info("Spawn Egg Chance (" + CHANCE + ") [" + rng + "]");
}
return (rng <= CHANCE); return (rng <= CHANCE);
} }
} }

View file

@ -76,20 +76,16 @@ public class EventHandler {
double num = rng.nextDouble(0,100000); double num = rng.nextDouble(0,100000);
if(num <= base_chance) if(num <= base_chance)
{ {
ItemStack head = HeadUtilities.get(profile.username).setHoverName(ChatHelpers.macro(profile.nickname+"'s Head")); ItemStack head = HeadUtilities.get(profile.username, "").setHoverName(ChatHelpers.macro(profile.nickname+"'s Head"));
LoreContainer lore = new LoreContainer(head); LoreContainer lore = new LoreContainer(head);
LoreEntry entry = new LoreEntry(); LoreEntry entry = new LoreEntry.Builder().bold(true).text(ChatHelpers.macroize("!dark_green!Player: " + profile.name_color+profile.username)).build();
entry.text = ChatHelpers.macroize("!dark_green!Player: " + profile.name_color+profile.username); lore.miscData.loreData.add(entry);
entry.bold=true;
lore.miscData.LoreData.add(entry);
entry = new LoreEntry(); entry = new LoreEntry.Builder().text(ChatHelpers.macroize("!Dark_Purple!Date: !Dark_Red![0]", Date.from(Instant.now()).toString())).build();
entry.text = ChatHelpers.macroize("!Dark_Purple!Date: !Dark_Red![0]", Date.from(Instant.now()).toString()); lore.miscData.loreData.add(entry);
lore.miscData.LoreData.add(entry);
entry = new LoreEntry(); entry = new LoreEntry.Builder().text(ChatHelpers.macroize("!Dark_Purple!Total Deaths: !Dark_Red![0]", String.valueOf(profile.deaths))).build();
entry.text = ChatHelpers.macroize("!Dark_Purple!Total Deaths: !Dark_Red![0]", String.valueOf(profile.deaths)); lore.miscData.loreData.add(entry);
lore.miscData.LoreData.add(entry);
lore.commitLore(); lore.commitLore();

View file

@ -149,13 +149,7 @@ public class LoreHandlers {
CompoundTag props = weaponUsed.getTag(); CompoundTag props = weaponUsed.getTag();
if(props==null)props=new CompoundTag(); if(props==null)props=new CompoundTag();
CompoundTag container = props.getCompound(ItemStatTag.STATS_TAG+"_"+type.name().toLowerCase()); CompoundTag container = props.getCompound(ItemStatTag.STATS_TAG+"_"+type.name().toLowerCase());
LoreContainer contain; LoreContainer contain = new LoreContainer(weaponUsed);
if(container.isEmpty())
{
contain = new LoreContainer(weaponUsed);
}else {
contain = new LoreContainer(container, weaponUsed);
}
ItemStatTag isTag; ItemStatTag isTag;
try{ try{
@ -166,26 +160,17 @@ public class LoreHandlers {
isTag.increment(); isTag.increment();
LoreEntry entry; LoreEntry entry;
if(contain.miscData.LoreData.size()==0) if(contain.miscData.loreData.size()==0)
{ {
// Missing entry // Missing entry
entry = new LoreEntry(); entry = new LoreEntry.Builder().text(ItemStatistics.makeText(isTag)).build();
entry.text = ItemStatistics.makeText(isTag); contain.miscData.loreData.add(entry);
contain.miscData.LoreData.add(entry);
}else { }else {
entry = contain.miscData.LoreData.get(0); // Stat is set at 0 entry = contain.miscData.loreData.get(0); // Stat is set at 0
entry.text = ItemStatistics.makeText(isTag); entry.text = ItemStatistics.makeText(isTag);
} }
// Update item // Update item
contain.commitLore(); contain.commitLore();
// Save the misc data to the item for later
// Reinitialize the container as the contain NBT
container = new CompoundTag();
contain.save(container);
isTag.save(container);
props.put(ItemStatTag.STATS_TAG+"_"+type.name().toLowerCase(), container);
weaponUsed.setTag(props);
} }
} }

View file

@ -0,0 +1,158 @@
package dev.zontreck.otemod.implementation.compressor;
import dev.zontreck.otemod.blocks.ModBlocks;
import dev.zontreck.otemod.blocks.entity.CompressionChamberBlockEntity;
import dev.zontreck.otemod.blocks.entity.ItemScrubberBlockEntity;
import dev.zontreck.otemod.blocks.entity.ModEntities;
import dev.zontreck.otemod.implementation.inits.ModMenuTypes;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.*;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.items.SlotItemHandler;
public class CompressionChamberMenu extends AbstractContainerMenu
{
public final CompressionChamberBlockEntity entity;
public final Level level;
public final ContainerData data;
public CompressionChamberMenu(int id, Inventory inv, FriendlyByteBuf buf)
{
this(id, inv, inv.player.level().getBlockEntity(buf.readBlockPos()), new SimpleContainerData(1));
}
public CompressionChamberMenu(int id, Inventory inv, BlockEntity entity, ContainerData data)
{
super(ModMenuTypes.COMPRESSION_CHAMBER.get(), id);
checkContainerSize(inv, 1);
this.data=data;
this.level = entity.getLevel();
this.entity = (CompressionChamberBlockEntity) entity;
addPlayerInventory(inv);
addPlayerHotbar(inv);
this.entity.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.UP).ifPresent(handler->{
addSlot(new SlotItemHandler(handler, 0, 34,34));
});
this.entity.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.DOWN).ifPresent(handler->{
addSlot(new SlotItemHandler(handler, 0, 113, 34));
});
addDataSlots(data);
}
public boolean isCrafting()
{
return data.get(0) > 0;
}
public int getScaledProgress()
{
if(!isCrafting())return 0;
int progress = this.data.get(0);
int max = CompressionChamberBlockEntity.MAXIMUM_PROCESSING_TICKS;
int progressArrow = 39;
if(progress != 0 && max != 0)
{
int percent = progress * progressArrow / max;
return percent;
}
return 0;
}
// CREDIT GOES TO: diesieben07 | https://github.com/diesieben07/SevenCommons
// must assign a slot number to each of the slots used by the GUI.
// For this container, we can see both the tile inventory's slots as well as the player inventory slots and the hotbar.
// Each time we add a Slot to the container, it automatically increases the slotIndex, which means
// 0 - 8 = hotbar slots (which will map to the InventoryPlayer slot numbers 0 - 8)
// 9 - 35 = player inventory slots (which map to the InventoryPlayer slot numbers 9 - 35)
// 36 - 44 = TileInventory slots, which map to our TileEntity slot numbers 0 - 8)
private static final int HOTBAR_SLOT_COUNT = 9;
private static final int PLAYER_INVENTORY_ROW_COUNT = 3;
private static final int PLAYER_INVENTORY_COLUMN_COUNT = 9;
private static final int PLAYER_INVENTORY_SLOT_COUNT = PLAYER_INVENTORY_COLUMN_COUNT * PLAYER_INVENTORY_ROW_COUNT;
private static final int VANILLA_SLOT_COUNT = HOTBAR_SLOT_COUNT + PLAYER_INVENTORY_SLOT_COUNT;
private static final int VANILLA_FIRST_SLOT_INDEX = 0;
private static final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT;
// THIS YOU HAVE TO DEFINE!
private static final int TE_INVENTORY_SLOT_COUNT = 2; // must be the number of slots you have!
@Override
public ItemStack quickMoveStack(Player playerIn, int index) {
Slot sourceSlot = slots.get(index);
if (sourceSlot == null || !sourceSlot.hasItem()) return ItemStack.EMPTY; //EMPTY_ITEM
ItemStack sourceStack = sourceSlot.getItem();
ItemStack copyOfSourceStack = sourceStack.copy();
// Check if the slot clicked is one of the vanilla container slots
if (index < VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT) {
// This is a vanilla container slot so merge the stack into the tile inventory
if (!moveItemStackTo(sourceStack, TE_INVENTORY_FIRST_SLOT_INDEX, TE_INVENTORY_FIRST_SLOT_INDEX
+ TE_INVENTORY_SLOT_COUNT, false)) {
return ItemStack.EMPTY; // EMPTY_ITEM
}
} else if (index < TE_INVENTORY_FIRST_SLOT_INDEX + TE_INVENTORY_SLOT_COUNT) {
// This is a TE slot so merge the stack into the players inventory
if (!moveItemStackTo(sourceStack, VANILLA_FIRST_SLOT_INDEX, VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT, false)) {
return ItemStack.EMPTY;
}
} else {
System.out.println("Invalid slotIndex:" + index);
return ItemStack.EMPTY;
}
// If stack size == 0 (the entire stack was moved) set slot contents to null
if (sourceStack.getCount() == 0) {
sourceSlot.set(ItemStack.EMPTY);
} else {
sourceSlot.setChanged();
}
sourceSlot.onTake(playerIn, sourceStack);
return copyOfSourceStack;
}
@Override
public boolean stillValid(Player player) {
return stillValid(ContainerLevelAccess.create(level, entity.getBlockPos()), player, ModBlocks.COMPRESSION_CHAMBER_BLOCK.get());
}
private static final int PLAYER_INVENTORY_FIRST_SLOT_HEIGHT = 85;
private static final int PLAYER_INVENTORY_FIRST_SLOT_LEFT = 11;
private static final int PLAYER_HOTBAR_FIRST_SLOT = 143;
private void addPlayerInventory(Inventory inv)
{
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
this.addSlot(new Slot(inv, j+i*9+9, PLAYER_INVENTORY_FIRST_SLOT_LEFT+j*18, PLAYER_INVENTORY_FIRST_SLOT_HEIGHT+i*18));
}
}
}
private void addPlayerHotbar(Inventory inv)
{
for (int index = 0; index < 9; index++) {
this.addSlot(new Slot(inv, index, PLAYER_INVENTORY_FIRST_SLOT_LEFT+index*18, PLAYER_HOTBAR_FIRST_SLOT));
}
}
}

View file

@ -0,0 +1,99 @@
package dev.zontreck.otemod.implementation.compressor;
import com.mojang.blaze3d.systems.RenderSystem;
import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.implementation.MouseHelpers;
import dev.zontreck.otemod.implementation.energy.screenrenderer.EnergyInfoArea;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
import java.util.Optional;
public class CompressionChamberScreen extends AbstractContainerScreen<CompressionChamberMenu> {
private static final ResourceLocation TEXTURE = new ResourceLocation(OTEMod.MOD_ID, "textures/gui/energized_compression_chamber.png");
private EnergyInfoArea EIA;
public CompressionChamberScreen(CompressionChamberMenu pMenu, Inventory pPlayerInventory, Component pTitle) {
super(pMenu, pPlayerInventory, pTitle);
this.topPos=0;
this.leftPos=0;
this.imageWidth=176;
this.imageHeight=177;
}
@Override
protected void init() {
super.init();
assignEnergyArea();
}
private void assignEnergyArea() {
int x = (width - imageWidth )/2;
int y = (height - imageHeight)/2;
EIA = new EnergyInfoArea(x+63, y+46, menu.entity.getEnergyStorage(), 39, 6);
}
@Override
protected void renderBg(GuiGraphics guiGraphics, float v, int i, int i1) {
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, TEXTURE);
guiGraphics.blit(TEXTURE, this.leftPos, this.topPos, 0,0, imageWidth, imageHeight);
renderCraftingProgress(guiGraphics);
EIA.draw(guiGraphics);
}
@Override
protected void renderLabels(GuiGraphics stack, int mouseX, int mouseY)
{
stack.drawString(font, this.title.getString(), 32, 4, 0xFFFFFF);
int x = (width - imageWidth )/2;
int y = (height - imageHeight)/2;
renderEnergy(stack, mouseX, mouseY, x, y);
//this.font.draw(stack, this.playerInventoryTitle.getString(), this.leftPos + 17, this.topPos + 123, 0xFFFFFF);
}
private void renderEnergy(GuiGraphics stack, int mouseX, int mouseY, int x, int y) {
if(isMouseAbove(mouseX, mouseY, x, y, 63, 46, 39, 6)){
stack.renderTooltip(font, EIA.getTooltips(), Optional.empty(), mouseX-x, mouseY-y);
}
}
private void renderCraftingProgress(GuiGraphics stack)
{
if(menu.isCrafting())
{
stack.blit(TEXTURE, leftPos+63, topPos+34, 179, 11, menu.getScaledProgress(),6);
}
}
@Override
public void render(GuiGraphics stack, int mouseX, int mouseY, float delta)
{
renderBackground(stack);
super.render(stack, mouseX, mouseY, delta);
renderTooltip(stack, mouseX, mouseY);
}
private boolean isMouseAbove(int mouseX, int mouseY, int x, int y, int offsetX, int offsetY, int width, int height)
{
return MouseHelpers.isMouseOver(mouseX, mouseY, x+offsetX, y+offsetY, width, height);
}
}

View file

@ -39,8 +39,12 @@ public class EnergyInfoArea extends InfoArea {
@Override @Override
public void draw(GuiGraphics transform) { public void draw(GuiGraphics transform) {
final int height = area.getHeight(); final int height = area.getHeight();
final int width = area.getWidth();
int stored = (int)(height*(energy.getEnergyStored()/(float)energy.getMaxEnergyStored())); int stored = (int)(height*(energy.getEnergyStored()/(float)energy.getMaxEnergyStored()));
transform.fillGradient(area.getX(), area.getY() + (height + stored), area.getX() + area.getWidth(), area.getY() + area.getHeight(), 0xff0000, 0xff550000);
if(area.getHeight() > area.getWidth())
transform.fillGradient(area.getX(), area.getY() + (height + stored), area.getX() + area.getWidth(), area.getY() + area.getHeight(), 0xff0000, 0xff550000);
else transform.fillGradient(area.getX() + (width + stored), area.getY(),area.getX() + area.getWidth(), area.getY() + area.getHeight(), 0xff0000, 0xff005500);
} }
} }

View file

@ -1,6 +1,7 @@
package dev.zontreck.otemod.implementation.inits; package dev.zontreck.otemod.implementation.inits;
import dev.zontreck.otemod.OTEMod; import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.implementation.compressor.CompressionChamberMenu;
import dev.zontreck.otemod.implementation.scrubber.ItemScrubberMenu; import dev.zontreck.otemod.implementation.scrubber.ItemScrubberMenu;
import dev.zontreck.otemod.implementation.scrubber.MagicalScrubberMenu; import dev.zontreck.otemod.implementation.scrubber.MagicalScrubberMenu;
import dev.zontreck.otemod.implementation.vault.StarterMenu; import dev.zontreck.otemod.implementation.vault.StarterMenu;
@ -25,6 +26,8 @@ public final class ModMenuTypes
public static final RegistryObject<MenuType<ItemScrubberMenu>> SCRUBBER = registerMenuType(ItemScrubberMenu::new, "item_scrubber_menu"); public static final RegistryObject<MenuType<ItemScrubberMenu>> SCRUBBER = registerMenuType(ItemScrubberMenu::new, "item_scrubber_menu");
public static final RegistryObject<MenuType<MagicalScrubberMenu>> MAGIC_SCRUBBER = registerMenuType(MagicalScrubberMenu::new, "magical_scrubber_menu"); public static final RegistryObject<MenuType<MagicalScrubberMenu>> MAGIC_SCRUBBER = registerMenuType(MagicalScrubberMenu::new, "magical_scrubber_menu");
public static final RegistryObject<MenuType<CompressionChamberMenu>> COMPRESSION_CHAMBER = registerMenuType(CompressionChamberMenu::new, "compression_chamber");
private static <T extends AbstractContainerMenu> RegistryObject<MenuType<T>> registerMenuType(IContainerFactory<T> factory, String name) private static <T extends AbstractContainerMenu> RegistryObject<MenuType<T>> registerMenuType(IContainerFactory<T> factory, String name)
{ {

View file

@ -4,10 +4,7 @@ import dev.zontreck.otemod.OTEMod;
import dev.zontreck.otemod.blocks.FoiledBlockItem; import dev.zontreck.otemod.blocks.FoiledBlockItem;
import dev.zontreck.otemod.entities.ModEntityTypes; import dev.zontreck.otemod.entities.ModEntityTypes;
import dev.zontreck.otemod.implementation.CreativeModeTabs; import dev.zontreck.otemod.implementation.CreativeModeTabs;
import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.*;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.SimpleFoiledItem;
import net.minecraftforge.common.ForgeSpawnEggItem; import net.minecraftforge.common.ForgeSpawnEggItem;
import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.DeferredRegister;
@ -31,7 +28,13 @@ public class ModItems {
public static final RegistryObject<Item> MELTED_ENDER_PEARL = CreativeModeTabs.addToOTEModTab(ITEMS.register("melted_ender_pearl", () -> new SimpleFoiledItem(new Item.Properties().stacksTo(64)))); public static final RegistryObject<Item> MELTED_ENDER_PEARL = CreativeModeTabs.addToOTEModTab(ITEMS.register("melted_ender_pearl", () -> new SimpleFoiledItem(new Item.Properties().stacksTo(64))));
public static final RegistryObject<Item> SINGULARITY = CreativeModeTabs.addToOTEModTab(ITEMS.register("singularity", () -> new Item(new Item.Properties().stacksTo(1)))); public static final RegistryObject<Item> SINGULARITY = CreativeModeTabs.addToOTEModTab(ITEMS.register("singularity", () -> new UnstableSingularity(new Item.Properties().stacksTo(1))));
public static final RegistryObject<Item> COMPRESSED_OBSIDIAN_SHEET = CreativeModeTabs.addToOTEModTab(ITEMS.register("compressed_obsidian_sheet", ()->new Item(new Item.Properties())));
public static final RegistryObject<Item> LAYERED_COMPRESSED_OBSIDIAN_SHEET = CreativeModeTabs.addToOTEModTab(ITEMS.register("layered_compressed_obsidian_sheet", ()->new SimpleFoiledItem(new Item.Properties())));
public static final RegistryObject<Item> ENCASED_SINGULARITY = CreativeModeTabs.addToOTEModTab(ITEMS.register("encased_singularity", ()->new SimpleFoiledItem(new Item.Properties())));
public static final RegistryObject<Item> ETERNIUM_ROD = CreativeModeTabs.addToOTEModTab(ITEMS.register("eternium_rod", () -> new SimpleFoiledItem(new Item.Properties().stacksTo(64)))); public static final RegistryObject<Item> ETERNIUM_ROD = CreativeModeTabs.addToOTEModTab(ITEMS.register("eternium_rod", () -> new SimpleFoiledItem(new Item.Properties().stacksTo(64))));
public static final RegistryObject<Item> SCRUBBER_FRAME_PIECE = CreativeModeTabs.addToOTEModTab(ITEMS.register("scrubber_frame_piece", () -> new Item(new Item.Properties().stacksTo(64)))); public static final RegistryObject<Item> SCRUBBER_FRAME_PIECE = CreativeModeTabs.addToOTEModTab(ITEMS.register("scrubber_frame_piece", () -> new Item(new Item.Properties().stacksTo(64))));
public static final RegistryObject<Item> SCRUBBER_FRAME = CreativeModeTabs.addToOTEModTab(ITEMS.register("scrubber_frame", () -> new Item(new Item.Properties().stacksTo(64)))); public static final RegistryObject<Item> SCRUBBER_FRAME = CreativeModeTabs.addToOTEModTab(ITEMS.register("scrubber_frame", () -> new Item(new Item.Properties().stacksTo(64))));

View file

@ -1,5 +1,6 @@
package dev.zontreck.otemod.items; package dev.zontreck.otemod.items;
import dev.zontreck.libzontreck.chat.ChatColor;
import dev.zontreck.libzontreck.lore.ExtraLore; import dev.zontreck.libzontreck.lore.ExtraLore;
import dev.zontreck.libzontreck.lore.LoreContainer; import dev.zontreck.libzontreck.lore.LoreContainer;
import dev.zontreck.libzontreck.lore.LoreEntry; import dev.zontreck.libzontreck.lore.LoreEntry;
@ -86,12 +87,9 @@ public class ThrownPossBall extends ThrowableItemProjectile
captured=true; captured=true;
LoreContainer cont = new LoreContainer(getItem()); LoreContainer cont = new LoreContainer(getItem());
cont.miscData.LoreData.clear(); cont.miscData.loreData.clear();
LoreEntry entry = new LoreEntry(); LoreEntry entry = new LoreEntry.Builder().bold(true).text(ChatColor.doColors("!Dark_Green!Captured Mob: !Dark_Purple!" + entityName)).build();
entry.bold = true; cont.miscData.loreData.add(entry);
entry.text = dev.zontreck.libzontreck.chat.ChatColor.doColors("!Dark_Green!Captured Mob: !Dark_Purple!" + entityName);
cont.miscData.LoreData.add(entry);
cont.commitLore(); cont.commitLore();
@ -136,7 +134,7 @@ public class ThrownPossBall extends ThrowableItemProjectile
} }
LoreContainer cont = new LoreContainer(item); LoreContainer cont = new LoreContainer(item);
cont.miscData.LoreData.clear(); cont.miscData.loreData.clear();
cont.commitLore(); cont.commitLore();
if(item.getDamageValue() == 0) if(item.getDamageValue() == 0)

View file

@ -0,0 +1,38 @@
package dev.zontreck.otemod.items;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.item.SimpleFoiledItem;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
public class UnstableSingularity extends SimpleFoiledItem
{
public UnstableSingularity(Properties pProperties) {
super(pProperties);
}
@Override
public InteractionResult useOn(UseOnContext pContext) {
BlockState block = pContext.getLevel().getBlockState(pContext.getClickedPos());
if(block.getBlock().defaultDestroyTime() < 0)
{
pContext.getLevel().explode(pContext.getPlayer(), pContext.getClickedPos().getX(), pContext.getClickedPos().getY(), pContext.getClickedPos().getZ(), 16, true, Level.ExplosionInteraction.TNT);
pContext.getLevel().setBlock(pContext.getClickedPos(), Blocks.AIR.defaultBlockState(), 0, 0);
pContext.getItemInHand().shrink(1);
}
return InteractionResult.CONSUME;
}
}

View file

@ -2,6 +2,7 @@ package dev.zontreck.otemod.networking.packets;
import java.util.function.Supplier; import java.util.function.Supplier;
import dev.zontreck.otemod.blocks.entity.CompressionChamberBlockEntity;
import dev.zontreck.otemod.blocks.entity.ItemScrubberBlockEntity; import dev.zontreck.otemod.blocks.entity.ItemScrubberBlockEntity;
import dev.zontreck.otemod.blocks.entity.MagicalScrubberBlockEntity; import dev.zontreck.otemod.blocks.entity.MagicalScrubberBlockEntity;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -42,6 +43,9 @@ public class EnergySyncS2CPacket {
{ {
entity.setEnergy(energy); entity.setEnergy(energy);
} else if(Minecraft.getInstance().level.getBlockEntity(pos) instanceof MagicalScrubberBlockEntity entity) } else if(Minecraft.getInstance().level.getBlockEntity(pos) instanceof MagicalScrubberBlockEntity entity)
{
entity.setEnergy(energy);
} else if(Minecraft.getInstance().level.getBlockEntity(pos) instanceof CompressionChamberBlockEntity entity)
{ {
entity.setEnergy(energy); entity.setEnergy(energy);
} }

View file

@ -0,0 +1,99 @@
package dev.zontreck.otemod.recipe;
import com.google.gson.JsonObject;
import dev.zontreck.otemod.OTEMod;
import net.minecraft.core.RegistryAccess;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.GsonHelper;
import net.minecraft.world.SimpleContainer;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.*;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.Nullable;
public class CompressionChamberRecipe implements Recipe<SimpleContainer> {
private final ResourceLocation id;
private final ItemStack output;
private final Ingredient input;
public CompressionChamberRecipe(ResourceLocation id, ItemStack output, Ingredient input)
{
this.id=id;
this.output=output;
this.input=input;
}
@Override
public boolean matches(SimpleContainer simpleContainer, Level level) {
if(level.isClientSide) return false;
return input.test(simpleContainer.getItem(0));
}
@Override
public ItemStack assemble(SimpleContainer simpleContainer, RegistryAccess registryAccess) {
return output;
}
@Override
public boolean canCraftInDimensions(int i, int i1) {
return true;
}
@Override
public ItemStack getResultItem(RegistryAccess registryAccess) {
return output.copy();
}
@Override
public ResourceLocation getId() {
return id;
}
@Override
public RecipeSerializer<?> getSerializer() {
return Serializer.INSTANCE;
}
@Override
public RecipeType<?> getType() {
return Type.INSTANCE;
}
public static class Type implements RecipeType<CompressionChamberRecipe> {
private Type(){}
public static final Type INSTANCE = new Type();
public static final String ID = "compressing";
}
public static class Serializer implements RecipeSerializer<CompressionChamberRecipe>
{
public static final Serializer INSTANCE = new Serializer();
public static final ResourceLocation ID = new ResourceLocation(OTEMod.MOD_ID, Type.ID);
@Override
public CompressionChamberRecipe fromJson(ResourceLocation resourceLocation, JsonObject jsonObject) {
ItemStack output = ShapedRecipe.itemStackFromJson(GsonHelper.getAsJsonObject(jsonObject, "output"));
Ingredient input = Ingredient.fromJson(GsonHelper.getAsJsonObject(jsonObject, "input"));
return new CompressionChamberRecipe(resourceLocation, output, input);
}
@Override
public @Nullable CompressionChamberRecipe fromNetwork(ResourceLocation resourceLocation, FriendlyByteBuf friendlyByteBuf) {
ItemStack output = friendlyByteBuf.readItem();
Ingredient input = Ingredient.fromNetwork(friendlyByteBuf);
return new CompressionChamberRecipe(resourceLocation, output, input);
}
@Override
public void toNetwork(FriendlyByteBuf friendlyByteBuf, CompressionChamberRecipe compressionChamberRecipe) {
friendlyByteBuf.writeItem(compressionChamberRecipe.output);
compressionChamberRecipe.input.toNetwork(friendlyByteBuf);
}
}
}

View file

@ -0,0 +1,19 @@
package dev.zontreck.otemod.recipe;
import dev.zontreck.otemod.OTEMod;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
public class ModRecipes {
public static final DeferredRegister<RecipeSerializer<?>> SERIALIZERS = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, OTEMod.MOD_ID);
public static final RegistryObject<RecipeSerializer<CompressionChamberRecipe>> COMPRESSING_SERIALIZER = SERIALIZERS.register("compressing", ()->CompressionChamberRecipe.Serializer.INSTANCE);
public static void register(IEventBus bus)
{
SERIALIZERS.register(bus);
}
}

View file

@ -66,7 +66,7 @@ description='''${mod_description}'''
[[dependencies.${mod_id}]] [[dependencies.${mod_id}]]
modId="libzontreck" modId="libzontreck"
mandatory=true mandatory=true
versionRange="[1.9,1.10)" versionRange="[1.10,1.11)"
ordering="NONE" ordering="NONE"
side="BOTH" side="BOTH"

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "otemod:block/compressed_obsidian_block"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "otemod:block/compression_chamber"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "otemod:block/layered_compressed_obsidian_block"
}
}
}

View file

@ -17,7 +17,7 @@
"item.otemod.melted_ender_pearl": "Melted Ender Pearl", "item.otemod.melted_ender_pearl": "Melted Ender Pearl",
"item.otemod.eternium_ingot": "Eternium Ingot", "item.otemod.eternium_ingot": "Eternium Ingot",
"item.otemod.eternium_rod": "Eternium Rod", "item.otemod.eternium_rod": "Eternium Rod",
"item.otemod.singularity": "Singularity", "item.otemod.singularity": "Unstable Singularity",
"item.otemod.scrubber_frame_piece": "Scrubber Frame Component", "item.otemod.scrubber_frame_piece": "Scrubber Frame Component",
"item.otemod.scrubber_frame": "Scrubber Frame", "item.otemod.scrubber_frame": "Scrubber Frame",
"item.otemod.possum_spawn_egg": "Possum Spawn Egg", "item.otemod.possum_spawn_egg": "Possum Spawn Egg",
@ -39,6 +39,10 @@
"item.otemod.ilusium_dust": "Ilusium Dust", "item.otemod.ilusium_dust": "Ilusium Dust",
"item.otemod.ilusium_ore": "Raw Ilusium Ore", "item.otemod.ilusium_ore": "Raw Ilusium Ore",
"item.otemod.empty_spawn_egg": "Empty Spawn Egg", "item.otemod.empty_spawn_egg": "Empty Spawn Egg",
"item.otemod.compressed_obsidian_sheet": "Sheet of Compressed Obsidian",
"item.otemod.layered_compressed_obsidian_sheet": "Layered Sheet of Compressed Obsidian",
"item.otemod.encased_singularity": "Encased Singualrity",
"item.otemod.encased_singularity.desc": "A singularity encased in stone, ready to be further compressed into bedrock",
"block.otemod.eternium_ore_block": "Eternium Ore", "block.otemod.eternium_ore_block": "Eternium Ore",
@ -60,6 +64,9 @@
"block.otemod.deepslate_ilusium_ore_block": "Deepslate Ilusium Ore Block", "block.otemod.deepslate_ilusium_ore_block": "Deepslate Ilusium Ore Block",
"block.otemod.ilusium_block": "Block of Ilusium", "block.otemod.ilusium_block": "Block of Ilusium",
"block.otemod.ilusium_portal": "Ilusium Portal", "block.otemod.ilusium_portal": "Ilusium Portal",
"block.otemod.compression_chamber": "Compression Chamber",
"block.otemod.compressed_obsidian_block": "Block of Compressed Obsidian",
"block.otemod.layered_compressed_obsidian_block": "Layered Block of Compressed Obsidian",
"enchantment.otemod.mob_egging": "Mob Egging", "enchantment.otemod.mob_egging": "Mob Egging",

View file

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "otemod:block/compressed_obsidian_block"
}
}

View file

@ -0,0 +1,86 @@
{
"credit": "Made with Blockbench",
"texture_size": [32, 32],
"textures": {
"0": "otemod:block/compression_chamber/bottom_plate",
"1": "otemod:block/compression_chamber/support0",
"2": "otemod:block/compression_chamber/power",
"3": "otemod:block/compression_chamber/compression_lid",
"4": "otemod:block/compression_chamber/compressor",
"particle": "otemod:block/compression_chamber/bottom_plate"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 1, 16],
"faces": {
"north": {"uv": [8, 0, 16, 0.5], "texture": "#0"},
"east": {"uv": [8, 0.5, 16, 1], "texture": "#0"},
"south": {"uv": [8, 1, 16, 1.5], "texture": "#0"},
"west": {"uv": [8, 1.5, 16, 2], "texture": "#0"},
"up": {"uv": [8, 8, 0, 0], "texture": "#0"},
"down": {"uv": [8, 8, 0, 16], "texture": "#0"}
}
},
{
"from": [7, 1, 1],
"to": [9, 6, 3],
"faces": {
"north": {"uv": [0, 0, 2, 5], "texture": "#1"},
"east": {"uv": [2, 0, 4, 5], "texture": "#1"},
"south": {"uv": [4, 0, 6, 5], "texture": "#1"},
"west": {"uv": [0, 5, 2, 10], "texture": "#1"},
"up": {"uv": [4, 7, 2, 5], "texture": "#1"},
"down": {"uv": [6, 5, 4, 7], "texture": "#1"}
}
},
{
"from": [4, 4, 0],
"to": [12, 12, 1],
"faces": {
"north": {"uv": [0, 0, 4, 4], "texture": "#2"},
"east": {"uv": [4, 0, 4.5, 4], "texture": "#2"},
"south": {"uv": [0, 4, 4, 8], "texture": "#2"},
"west": {"uv": [4, 4, 4.5, 8], "texture": "#2"},
"up": {"uv": [8.5, 0.5, 4.5, 0], "texture": "#2"},
"down": {"uv": [8.5, 0.5, 4.5, 1], "texture": "#2"}
}
},
{
"from": [7, 9, 1],
"to": [9, 13, 3],
"faces": {
"north": {"uv": [0, 0, 1, 2], "texture": "#1"},
"east": {"uv": [0, 0, 1, 2], "texture": "#1"},
"south": {"uv": [0, 0, 1, 2], "texture": "#1"},
"west": {"uv": [0, 0, 1, 2], "texture": "#1"},
"up": {"uv": [0, 0, 1, 1], "texture": "#1"},
"down": {"uv": [0, 0, 1, 1], "texture": "#1"}
}
},
{
"from": [2, 12, 3],
"to": [14, 13, 14],
"faces": {
"north": {"uv": [6, 0, 12, 0.5], "texture": "#3"},
"east": {"uv": [6, 1, 11.5, 1.5], "texture": "#3"},
"south": {"uv": [6, 0.5, 12, 1], "texture": "#3"},
"west": {"uv": [6, 1.5, 11.5, 2], "texture": "#3"},
"up": {"uv": [6, 5.5, 0, 0], "texture": "#3"},
"down": {"uv": [6, 5.5, 0, 11], "texture": "#3"}
}
},
{
"from": [3, 11, 4],
"to": [13, 12, 13],
"faces": {
"north": {"uv": [5, 0, 10, 0.5], "texture": "#4"},
"east": {"uv": [5, 1, 9.5, 1.5], "texture": "#4"},
"south": {"uv": [5, 0.5, 10, 1], "texture": "#4"},
"west": {"uv": [5, 1.5, 9.5, 2], "texture": "#4"},
"up": {"uv": [5, 4.5, 0, 0], "texture": "#4"},
"down": {"uv": [5, 4.5, 0, 9], "texture": "#4"}
}
}
]
}

View file

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "otemod:block/layered_compressed_obsidian_block"
}
}

View file

@ -0,0 +1,3 @@
{
"parent": "otemod:block/compressed_obsidian_block"
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "otemod:item/compressed_obsidian_sheet"
}
}

View file

@ -0,0 +1,3 @@
{
"parent": "otemod:block/compression_chamber"
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "otemod:item/encased_singularity"
}
}

View file

@ -0,0 +1,3 @@
{
"parent": "otemod:block/layered_compressed_obsidian_block"
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "otemod:item/layered_compressed_obsidian_sheet"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

View file

@ -13,6 +13,9 @@
"otemod:ilusium_ore_block", "otemod:ilusium_ore_block",
"otemod:deepslate_ilusium_ore_block", "otemod:deepslate_ilusium_ore_block",
"otemod:ilusium_block" "otemod:ilusium_block",
"otemod:stable_singularity",
"otemod:compression_chamber"
] ]
} }

View file

@ -4,6 +4,7 @@
"otemod:aurora_door", "otemod:aurora_door",
"otemod:item_scrubber", "otemod:item_scrubber",
"otemod:magical_scrubber", "otemod:magical_scrubber",
"otemod:vault_steel_ore_block" "otemod:vault_steel_ore_block",
"otemod:compression_chamber"
] ]
} }

View file

@ -1,72 +0,0 @@
{
"type": "otemod:resource_nether",
"generator": {
"type": "minecraft:noise",
"settings": "otemod:resource_nether",
"biome_source": {
"type": "minecraft:multi_noise",
"biomes": [
{
"biome": "minecraft:nether_wastes",
"parameters": {
"temperature": 0,
"humidity": 0,
"continentalness": 0,
"erosion": 0,
"weirdness": 0,
"depth": 0,
"offset": 0
}
},
{
"biome": "minecraft:soul_sand_valley",
"parameters": {
"temperature": 0,
"humidity": -0.5,
"continentalness": 0,
"erosion": 0,
"weirdness": 0,
"depth": 0,
"offset": 0
}
},
{
"biome": "minecraft:crimson_forest",
"parameters": {
"temperature": 0.4,
"humidity": 0,
"continentalness": 0,
"erosion": 0,
"weirdness": 0,
"depth": 0,
"offset": 0
}
},
{
"biome": "minecraft:warped_forest",
"parameters": {
"temperature": 0,
"humidity": 0.5,
"continentalness": 0,
"erosion": 0,
"weirdness": 0,
"depth": 0,
"offset": 0.375
}
},
{
"biome": "minecraft:basalt_deltas",
"parameters": {
"temperature": -0.5,
"humidity": 0,
"continentalness": 0,
"erosion": 0,
"weirdness": 0,
"depth": 0,
"offset": 0.175
}
}
]
}
}
}

View file

@ -1,20 +0,0 @@
{
"ultrawarm": true,
"natural": false,
"piglin_safe": true,
"respawn_anchor_works": true,
"bed_works": false,
"has_raids": false,
"has_skylight": false,
"has_ceiling": true,
"coordinate_scale": 16,
"ambient_light": 1,
"fixed_time": 1,
"logical_height": 128,
"effects": "minecraft:the_end",
"infiniburn": "#minecraft:infiniburn_nether",
"min_y": 0,
"height": 256,
"monster_spawn_light_level": 0,
"monster_spawn_block_light_limit": 0
}

View file

@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"features": ["otemod:vaultsteel_oregen_nether"],
"biomes": "#is_nether",
"step": "underground_ores"
}

View file

@ -0,0 +1,9 @@
{
"type": "otemod:compressing",
"output": {
"item": "minecraft:bedrock"
},
"input": {
"item": "otemod:encased_singularity"
}
}

View file

@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"QQQ",
"QQQ",
"QQQ"
],
"key": {
"Q": {
"item": "otemod:compressed_obsidian_sheet"
}
},
"result": {
"item": "otemod:compressed_obsidian_block",
"count": 1
}
}

View file

@ -0,0 +1,9 @@
{
"type": "otemod:compressing",
"input": {
"item": "minecraft:obsidian"
},
"output": {
"item": "otemod:compressed_obsidian_sheet"
}
}

View file

@ -0,0 +1,26 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"XXX",
"WYZ",
"ZZZ"
],
"key": {
"W": {
"tag": "forge:ingots/gold"
},
"X": {
"tag": "forge:ingots/ilusium"
},
"Y": {
"item": "minecraft:copper_block"
},
"Z": {
"item": "minecraft:obsidian"
}
},
"result": {
"item": "otemod:compression_chamber",
"count": 1
}
}

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"QQQ",
"QZQ",
"QQQ"
],
"key": {
"Q": {
"tag": "forge:blocks/stone"
},
"Z": {
"item": "otemod:stable_singularity"
}
},
"result": {
"item": "otemod:encased_singularity",
"count": 1
}
}

View file

@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"QQQ",
"QQQ",
"QQQ"
],
"key": {
"Q": {
"item": "otemod:layered_compressed_obsidian_sheet"
}
},
"result": {
"item": "otemod:layered_compressed_obsidian_block",
"count": 1
}
}

View file

@ -0,0 +1,9 @@
{
"type": "otemod:compressing",
"output": {
"item": "otemod:layered_compressed_obsidian_sheet"
},
"input": {
"item": "otemod:compressed_obsidian_block"
}
}

View file

@ -0,0 +1,12 @@
{
"type": "mekanism:crushing",
"input": {
"ingredient": {
"item": "otemod:layered_compressed_obsidian_block"
}
},
"output": {
"item": "otemod:compressed_obsidian_block",
"count": 9
}
}

View file

@ -0,0 +1,12 @@
{
"type": "mekanism:crushing",
"input": {
"ingredient": {
"item": "otemod:compressed_obsidian_block"
}
},
"output": {
"item": "minecraft:obsidian",
"count": 9
}
}

View file

@ -1,16 +1,9 @@
{ {
"type": "minecraft:crafting_shaped", "type": "otemod:compressing",
"pattern": ["ccc", "cbc", "ccc"], "output": {
"key": { "item": "otemod:stable_singularity"
"c": {
"item": "minecraft:obsidian"
},
"b": {
"item": "otemod:singularity"
}
}, },
"result": { "input": {
"item": "otemod:stable_singularity", "item": "otemod:layered_compressed_obsidian_block"
"count": 1
} }
} }

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"CCC",
"CGC",
"CCC"
],
"key": {
"C": {
"item": "minecraft:magma_block"
},
"G": {
"item": "minecraft:bedrock"
}
},
"result": {
"item": "tetra:seeping_bedrock",
"count": 1
}
}

View file

@ -1,9 +1,12 @@
{ {
"type": "minecraft:crafting_shaped", "type": "minecraft:crafting_shaped",
"pattern": ["ccc", "c c", "ccc"], "pattern": ["cb"],
"key": { "key": {
"c": { "c": {
"item": "otemod:melted_ender_pearl" "item": "minecraft:feather"
},
"b": {
"item": "otemod:stable_singularity"
} }
}, },
"result": { "result": {

View file

@ -0,0 +1,18 @@
{
"type": "minecraft:scattered_ore",
"config": {
"size": 2,
"discard_chance_on_air_exposure": 1,
"targets": [
{
"target": {
"predicate_type": "minecraft:tag_match",
"tag": "minecraft:base_stone_nether"
},
"state": {
"Name": "otemod:nether_vault_steel_ore_block"
}
}
]
}
}

View file

@ -1,737 +0,0 @@
{
"sea_level": 32,
"disable_mob_generation": true,
"aquifers_enabled": true,
"ore_veins_enabled": true,
"legacy_random_source": true,
"default_block": {
"Name": "minecraft:netherrack"
},
"default_fluid": {
"Name": "minecraft:lava",
"Properties": {
"level": "0"
}
},
"noise": {
"min_y": 0,
"height": 128,
"size_horizontal": 1,
"size_vertical": 2
},
"noise_router": {
"barrier": 0,
"fluid_level_floodedness": 0,
"fluid_level_spread": 0,
"lava": 0,
"temperature": {
"type": "minecraft:shifted_noise",
"noise": "minecraft:temperature",
"xz_scale": 0.25,
"y_scale": 0,
"shift_x": "minecraft:shift_x",
"shift_y": 0,
"shift_z": "minecraft:shift_z"
},
"vegetation": {
"type": "minecraft:shifted_noise",
"noise": "minecraft:vegetation",
"xz_scale": 0.25,
"y_scale": 0,
"shift_x": "minecraft:shift_x",
"shift_y": 0,
"shift_z": "minecraft:shift_z"
},
"continents": 0,
"erosion": 0,
"depth": 0,
"ridges": 0,
"initial_density_without_jaggedness": 0,
"final_density": {
"type": "minecraft:squeeze",
"argument": {
"type": "minecraft:mul",
"argument1": 0.64,
"argument2": {
"type": "minecraft:interpolated",
"argument": {
"type": "minecraft:blend_density",
"argument": {
"type": "minecraft:add",
"argument1": 2.5,
"argument2": {
"type": "minecraft:mul",
"argument1": {
"type": "minecraft:y_clamped_gradient",
"from_y": -8,
"to_y": 24,
"from_value": 0,
"to_value": 1
},
"argument2": {
"type": "minecraft:add",
"argument1": -2.5,
"argument2": {
"type": "minecraft:add",
"argument1": 0.9375,
"argument2": {
"type": "minecraft:mul",
"argument1": {
"type": "minecraft:y_clamped_gradient",
"from_y": 104,
"to_y": 128,
"from_value": 1,
"to_value": 0
},
"argument2": {
"type": "minecraft:add",
"argument1": -0.9375,
"argument2": "minecraft:nether/base_3d_noise"
}
}
}
}
}
}
}
}
}
},
"vein_toggle": 0,
"vein_ridged": 0,
"vein_gap": 0
},
"spawn_target": [],
"surface_rule": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:vertical_gradient",
"random_name": "minecraft:bedrock_floor",
"true_at_and_below": {
"above_bottom": 0
},
"false_at_and_above": {
"above_bottom": 5
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:bedrock"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:vertical_gradient",
"random_name": "minecraft:bedrock_roof",
"true_at_and_below": {
"below_top": 5
},
"false_at_and_above": {
"below_top": 0
}
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:bedrock"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"anchor": {
"below_top": 5
},
"surface_depth_multiplier": 0,
"add_stone_depth": false
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:netherrack"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"minecraft:basalt_deltas"
]
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"offset": 0,
"surface_type": "ceiling",
"add_surface_depth": true,
"secondary_depth_range": 0
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:basalt",
"Properties": {
"axis": "y"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"offset": 0,
"surface_type": "floor",
"add_surface_depth": true,
"secondary_depth_range": 0
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"noise": "minecraft:patch",
"min_threshold": -0.012,
"max_threshold": 1.7976931348623157e+308
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 30
},
"surface_depth_multiplier": 0,
"add_stone_depth": true
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 35
},
"surface_depth_multiplier": 0,
"add_stone_depth": true
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:gravel"
}
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"noise": "minecraft:nether_state_selector",
"min_threshold": 0,
"max_threshold": 1.7976931348623157e+308
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:basalt",
"Properties": {
"axis": "y"
}
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:blackstone"
}
}
]
}
}
]
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"minecraft:soul_sand_valley"
]
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"offset": 0,
"surface_type": "ceiling",
"add_surface_depth": true,
"secondary_depth_range": 0
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"noise": "minecraft:nether_state_selector",
"min_threshold": 0,
"max_threshold": 1.7976931348623157e+308
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:soul_sand"
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:soul_soil"
}
}
]
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"offset": 0,
"surface_type": "floor",
"add_surface_depth": true,
"secondary_depth_range": 0
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"noise": "minecraft:patch",
"min_threshold": -0.012,
"max_threshold": 1.7976931348623157e+308
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 30
},
"surface_depth_multiplier": 0,
"add_stone_depth": true
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 35
},
"surface_depth_multiplier": 0,
"add_stone_depth": true
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:gravel"
}
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"noise": "minecraft:nether_state_selector",
"min_threshold": 0,
"max_threshold": 1.7976931348623157e+308
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:soul_sand"
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:soul_soil"
}
}
]
}
}
]
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"offset": 0,
"surface_type": "floor",
"add_surface_depth": false,
"secondary_depth_range": 0
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 32
},
"surface_depth_multiplier": 0,
"add_stone_depth": false
}
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:hole"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:lava",
"Properties": {
"level": "0"
}
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"minecraft:warped_forest"
]
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:noise_threshold",
"noise": "minecraft:netherrack",
"min_threshold": 0.54,
"max_threshold": 1.7976931348623157e+308
}
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 31
},
"surface_depth_multiplier": 0,
"add_stone_depth": false
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"noise": "minecraft:nether_wart",
"min_threshold": 1.17,
"max_threshold": 1.7976931348623157e+308
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:warped_wart_block"
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:warped_nylium"
}
}
]
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"minecraft:crimson_forest"
]
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:noise_threshold",
"noise": "minecraft:netherrack",
"min_threshold": 0.54,
"max_threshold": 1.7976931348623157e+308
}
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 31
},
"surface_depth_multiplier": 0,
"add_stone_depth": false
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"noise": "minecraft:nether_wart",
"min_threshold": 1.17,
"max_threshold": 1.7976931348623157e+308
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:nether_wart_block"
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:crimson_nylium"
}
}
]
}
}
}
}
]
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"minecraft:nether_wastes"
]
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"offset": 0,
"surface_type": "floor",
"add_surface_depth": true,
"secondary_depth_range": 0
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"noise": "minecraft:soul_sand_layer",
"min_threshold": -0.012,
"max_threshold": 1.7976931348623157e+308
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:hole"
}
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 30
},
"surface_depth_multiplier": 0,
"add_stone_depth": true
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 35
},
"surface_depth_multiplier": 0,
"add_stone_depth": true
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:soul_sand"
}
}
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:netherrack"
}
}
]
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"offset": 0,
"surface_type": "floor",
"add_surface_depth": false,
"secondary_depth_range": 0
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 31
},
"surface_depth_multiplier": 0,
"add_stone_depth": false
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 35
},
"surface_depth_multiplier": 0,
"add_stone_depth": true
}
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"noise": "minecraft:gravel_layer",
"min_threshold": -0.012,
"max_threshold": 1.7976931348623157e+308
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"anchor": {
"absolute": 32
},
"surface_depth_multiplier": 0,
"add_stone_depth": false
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:gravel"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:hole"
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:gravel"
}
}
}
]
}
}
}
}
}
]
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:netherrack"
}
}
]
}
}

View file

@ -0,0 +1,23 @@
{
"feature": "otemod:vaultsteel_oregen_nether",
"placement": [
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:height_range",
"height": {
"type": "minecraft:trapezoid",
"min_inclusive": {
"absolute": 8
},
"max_inclusive": {
"absolute": 24
}
}
},
{
"type": "minecraft:biome"
}
]
}