Compare commits

...

11 commits

Author SHA1 Message Date
Mrbysco
fb80bf33ef Wait... the particle beam renders now? 2024-03-12 02:32:04 +01:00
Flanks255
2e37a04a2a Bump for FC 2024-03-11 17:52:24 -05:00
Flanks255
ae6695a5ba Fixed Phantomfaces.
Added Recipes for Phantomfaces.
2024-03-11 17:51:32 -05:00
Mrbysco
ffc67e6a5b Remove unused imports 2024-03-11 22:38:16 +01:00
Mrbysco
9f8523486c Fix up the Water Bowl 2024-03-11 22:38:09 +01:00
Mrbysco
8a16143e2f Remove WIP from blocks/items that work 2024-03-11 22:22:34 +01:00
Mrbysco
1224c1de29 Remove todo from Greenhouse Glass 2024-03-11 22:22:20 +01:00
Mrbysco
5182ac8b92 Leaf-eating Generator done 2024-03-11 22:18:00 +01:00
Mrbysco
ec4b79ffd8 Generate black quartz ore below 0 too 2024-03-11 21:40:35 +01:00
Flanks255
c4d81aea1b Fixed Crafter on a stick 2024-03-11 14:58:38 -05:00
Mrbysco
2a2f5c6cdc Add the Engineer villager back 2024-03-11 20:48:18 +01:00
43 changed files with 648 additions and 286 deletions

View file

@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
# Actually Additions
mod_version=1.2.4
mod_version=1.2.5
# Forge
game_version=1.20.4

View file

@ -1,6 +1,6 @@
// 1.20.4 2024-03-11T17:48:44.6414485 Registries
// 1.20.4 2024-03-11T21:40:12.7830455 Registries
020d2b1f1c21d6c6663ef8126a52e2b9deb0e52e data/actuallyadditions/damage_type/atomicreconstructor.json
4ba41428fdcf03f52855029153722e22e8702823 data/actuallyadditions/neoforge/biome_modifier/add_black_quartz.json
3c9f4fbfed04f0e75ea7b370aa2f8acc531a63bb data/actuallyadditions/worldgen/configured_feature/ore_black_quartz.json
fce2111f746f4c6ddef5444d84a5c2b574efaaa0 data/actuallyadditions/worldgen/placed_feature/ore_black_quartz.json
80765c24aa747df53139d14a9ac3293b4b3eab16 data/actuallyadditions/worldgen/configured_feature/ore_black_quartz.json
efb41395b407edbd91712bcb63976de46fed5d04 data/actuallyadditions/worldgen/placed_feature/ore_black_quartz.json
7cf126882346a296f045db75facf741c77b7d3b1 data/actuallyadditions/worldgen/processor_list/engineer_house.json

View file

@ -1,2 +1,2 @@
// 1.20.4 2024-03-04T22:51:31.6174299 Sound Definitions
5492914eb97f792a830608d663aaf3148987ed3e assets/actuallyadditions/sounds.json
// 1.20.4 2024-03-11T20:19:22.9008098 Sound Definitions
e7a33758b55803bd59c68b8024cb8484dd4f060f assets/actuallyadditions/sounds.json

View file

@ -1,4 +1,4 @@
// 1.20.4 2024-03-11T02:13:51.6169998 Recipes
// 1.20.4 2024-03-11T17:51:04.4103588 Recipes
4d3128b37a7153882a9324cda49b5069207561c5 data/actuallyadditions/recipes/atomic_reconstructor.json
b0367f5012651764931e8b8fd0c5bcca4e8614c0 data/actuallyadditions/recipes/battery_box.json
7e05cd54092b998dfdbd2221235dd52576ec79eb data/actuallyadditions/recipes/black_quartz_block.json
@ -49,7 +49,13 @@ ff81da8a0f6632779414c0512100696a11771814 data/actuallyadditions/recipes/hopping_
4acb117a6727554073a78ed81bcd2b0b1af53bec data/actuallyadditions/recipes/laser_relay_item_advanced.json
2c37821d291542d4821842501e07bfad38181553 data/actuallyadditions/recipes/lava_factory_casing.json
76f9eb2b859198eec4c50d992c3715633d5109a8 data/actuallyadditions/recipes/lava_factory_controller.json
1e3936f80be1540cd3d6ed570c1ed6381227db7d data/actuallyadditions/recipes/leaf_generator.json
73696fd4e851f440a9850485fc9ad03fc63442a9 data/actuallyadditions/recipes/oil_generator.json
afbee3f7074b7aa88d4bc8941d820d02b827da4b data/actuallyadditions/recipes/phantom_booster.json
f0a9c8a0de8fb884cd207c34c4a10e7a4a021153 data/actuallyadditions/recipes/phantom_energyface.json
472521d8bb5db8f9165ac642c3309d2d2b48f8e6 data/actuallyadditions/recipes/phantom_itemface.json
6d3aa070e0fccbb126c80323423c9482259dd6de data/actuallyadditions/recipes/phantom_liquiface.json
253e31ad471e2a8e20bfbe077826a8fac35fcc84 data/actuallyadditions/recipes/phantom_redstoneface.json
8c78ebb9351b98ffe368391a391b90385c0b8b7f data/actuallyadditions/recipes/placer.json
184acfb5fd3799b3fbe35150c67b6530581f8bf1 data/actuallyadditions/recipes/powered_furnace.json
b81a706a5f635d8a63ffd3034c80838dc10699c9 data/actuallyadditions/recipes/ranged_collector.json

View file

@ -0,0 +1,2 @@
// 1.20.4 2024-03-11T20:41:48.609238 Tags for minecraft:point_of_interest_type mod id actuallyadditions
65352c4eaf105efa72687c568c2d5b5f5fd11996 data/minecraft/tags/point_of_interest_type/acquirable_job_site.json

View file

@ -18,5 +18,10 @@
"sounds": [
"actuallyadditions:reconstructor"
]
},
"villager.work_engineer": {
"sounds": [
"actuallyadditions:coffee_machine"
]
}
}

View file

@ -0,0 +1,29 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"A": {
"item": "actuallyadditions:advanced_coil"
},
"C": {
"item": "actuallyadditions:enori_crystal"
},
"E": {
"item": "actuallyadditions:empowered_restonia_crystal_block"
},
"I": {
"item": "actuallyadditions:iron_casing"
},
"L": {
"tag": "minecraft:leaves"
}
},
"pattern": [
"CIC",
"ELE",
"CAC"
],
"result": {
"item": "actuallyadditions:leaf_generator"
}
}

View file

@ -0,0 +1,23 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"C": {
"item": "actuallyadditions:ender_casing"
},
"D": {
"item": "actuallyadditions:diamatine_crystal"
},
"R": {
"item": "actuallyadditions:restonia_crystal"
}
},
"pattern": [
"RDR",
"DCD",
"RDR"
],
"result": {
"item": "actuallyadditions:phantom_booster"
}
}

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"I": {
"item": "actuallyadditions:phantom_itemface"
},
"R": {
"item": "actuallyadditions:empowered_restonia_crystal"
}
},
"pattern": [
" R ",
"RIR",
" R "
],
"result": {
"item": "actuallyadditions:phantom_energyface"
}
}

View file

@ -0,0 +1,26 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"A": {
"item": "actuallyadditions:advanced_coil"
},
"C": {
"tag": "forge:chests/wooden"
},
"D": {
"item": "actuallyadditions:empowered_diamatine_crystal"
},
"E": {
"item": "actuallyadditions:ender_casing"
}
},
"pattern": [
" C ",
"DED",
" A "
],
"result": {
"item": "actuallyadditions:phantom_itemface"
}
}

View file

@ -0,0 +1,18 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"B": {
"item": "minecraft:bucket"
},
"I": {
"item": "actuallyadditions:phantom_itemface"
}
},
"pattern": [
"BIB"
],
"result": {
"item": "actuallyadditions:phantom_liquiface"
}
}

View file

@ -0,0 +1,23 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"D": {
"tag": "forge:dusts/redstone"
},
"I": {
"item": "actuallyadditions:phantom_itemface"
},
"R": {
"item": "actuallyadditions:empowered_restonia_crystal"
}
},
"pattern": [
"DRD",
"RIR",
"DRD"
],
"result": {
"item": "actuallyadditions:phantom_redstoneface"
}
}

View file

@ -12,6 +12,15 @@
"predicate_type": "minecraft:tag_match",
"tag": "minecraft:stone_ore_replaceables"
}
},
{
"state": {
"Name": "actuallyadditions:black_quartz_ore"
},
"target": {
"predicate_type": "minecraft:tag_match",
"tag": "minecraft:deepslate_ore_replaceables"
}
}
]
}

View file

@ -16,7 +16,7 @@
"absolute": 45
},
"min_inclusive": {
"absolute": 0
"absolute": -25
}
}
},

View file

@ -0,0 +1,5 @@
{
"values": [
"actuallyadditions:engineer"
]
}

View file

@ -46,6 +46,7 @@ public class ActuallyAdditionsData {
generator.addProvider(true, new ItemRecipeGenerator(packOutput));
generator.addProvider(true, generatorBlockTags);
generator.addProvider(true, new ItemTagsGenerator(packOutput, lookupProvider, generatorBlockTags, helper));
generator.addProvider(true, new PoiTypeTagsGenerator(packOutput, lookupProvider, helper));
generator.addProvider(true, new DamageTypeTagsGenerator(packOutput, lookupProvider, helper));
generator.addProvider(true, new BlockStateGenerator(packOutput, helper));

View file

@ -399,6 +399,55 @@ public class BlockRecipeGenerator extends RecipeProvider {
.define('A', ActuallyItems.ADVANCED_COIL.get())
.define('I', ActuallyBlocks.IRON_CASING.get())
.save(recipeOutput);
// Leaf-eating Generator
Recipe.shaped(ActuallyBlocks.LEAF_GENERATOR.getItem())
.pattern("CIC", "ELE", "CAC")
.define('C', ActuallyItems.ENORI_CRYSTAL.get())
.define('I', ActuallyBlocks.IRON_CASING.get())
.define('E', ActuallyBlocks.EMPOWERED_RESTONIA_CRYSTAL.get())
.define('L', ItemTags.LEAVES)
.define('A', ActuallyItems.ADVANCED_COIL.get())
.save(recipeOutput);
// Phantom Itemface
Recipe.shaped(ActuallyBlocks.PHANTOM_ITEMFACE.getItem())
.pattern(" C ", "DED", " A ")
.define('C', Tags.Items.CHESTS_WOODEN)
.define('D', ActuallyItems.EMPOWERED_DIAMATINE_CRYSTAL)
.define('E', ActuallyBlocks.ENDER_CASING.get())
.define('A', ActuallyItems.ADVANCED_COIL.get())
.save(recipeOutput);
// Phantom Liquiface
Recipe.shaped(ActuallyBlocks.PHANTOM_LIQUIFACE.getItem())
.pattern("BIB")
.define('B', Items.BUCKET)
.define('I', ActuallyBlocks.PHANTOM_ITEMFACE.get())
.save(recipeOutput);
// Phantom Energyface
Recipe.shaped(ActuallyBlocks.PHANTOM_ENERGYFACE.getItem())
.pattern(" R ", "RIR", " R ")
.define('R', ActuallyItems.EMPOWERED_RESTONIA_CRYSTAL)
.define('I', ActuallyBlocks.PHANTOM_ITEMFACE.get())
.save(recipeOutput);
// Phantom Redstoneface
Recipe.shaped(ActuallyBlocks.PHANTOM_REDSTONEFACE.getItem())
.pattern("DRD", "RIR", "DRD")
.define('D', Tags.Items.DUSTS_REDSTONE)
.define('R', ActuallyItems.EMPOWERED_RESTONIA_CRYSTAL)
.define('I', ActuallyBlocks.PHANTOM_ITEMFACE.get())
.save(recipeOutput);
// Phantom Booster
Recipe.shaped(ActuallyBlocks.PHANTOM_BOOSTER.getItem())
.pattern("RDR", "DCD", "RDR")
.define('D', ActuallyItems.DIAMATINE_CRYSTAL)
.define('R', ActuallyItems.RESTONIA_CRYSTAL)
.define('C', ActuallyBlocks.ENDER_CASING.getItem())
.save(recipeOutput);
}
public static class Recipe {

View file

@ -0,0 +1,26 @@
package de.ellpeck.actuallyadditions.data;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.gen.village.ActuallyPOITypes;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.PoiTypeTagsProvider;
import net.minecraft.tags.PoiTypeTags;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import org.jetbrains.annotations.Nullable;
import java.util.concurrent.CompletableFuture;
public class PoiTypeTagsGenerator extends PoiTypeTagsProvider {
public PoiTypeTagsGenerator(PackOutput output, CompletableFuture<HolderLookup.Provider> completableFuture, @Nullable ExistingFileHelper fileHelper) {
super(output, completableFuture, ActuallyAdditions.MODID, fileHelper);
}
@Override
protected void addTags(HolderLookup.Provider pProvider) {
this.tag(PoiTypeTags.ACQUIRABLE_JOB_SITE)
.add(
ActuallyPOITypes.ENGINEER.getKey()
);
}
}

View file

@ -19,5 +19,6 @@ public class SoundsGenerator extends SoundDefinitionsProvider {
add(AASounds.CRUSHER, definition().with(sound(new ResourceLocation(ActuallyAdditions.MODID, "crusher"))));
add(AASounds.COFFEE_MACHINE, definition().with(sound(new ResourceLocation(ActuallyAdditions.MODID, "coffee_machine"))));
add(AASounds.DUH_DUH_DUH_DUUUH, definition().with(sound(new ResourceLocation(ActuallyAdditions.MODID, "duh_duh_duh_duuuh"))));
add(AASounds.VILLAGER_WORK_ENGINEER, definition().with(sound(new ResourceLocation(ActuallyAdditions.MODID, "coffee_machine"))));
}
}

View file

@ -14,6 +14,7 @@ public class AASounds {
public static DeferredHolder<SoundEvent, SoundEvent> CRUSHER = SOUNDS.register("crusher", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "crusher")));
public static DeferredHolder<SoundEvent, SoundEvent> COFFEE_MACHINE = SOUNDS.register("coffee_machine", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "coffee_machine")));
public static DeferredHolder<SoundEvent, SoundEvent> DUH_DUH_DUH_DUUUH = SOUNDS.register("duh_duh_duh_duuuh", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "duh_duh_duh_duuuh")));
public static DeferredHolder<SoundEvent, SoundEvent> VILLAGER_WORK_ENGINEER = SOUNDS.register("villager.work_engineer", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ActuallyAdditions.MODID, "villager.work_engineer")));
public static void init(IEventBus bus) {

View file

@ -28,6 +28,9 @@ import de.ellpeck.actuallyadditions.mod.event.CommonEvents;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
import de.ellpeck.actuallyadditions.mod.gen.ActuallyVillages;
import de.ellpeck.actuallyadditions.mod.gen.modifier.BoolConfigFeatureBiomeModifier;
import de.ellpeck.actuallyadditions.mod.gen.village.ActuallyPOITypes;
import de.ellpeck.actuallyadditions.mod.gen.village.ActuallyVillagers;
import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager;
import de.ellpeck.actuallyadditions.mod.inventory.ActuallyContainers;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.items.ItemCoffee;
@ -110,6 +113,8 @@ public class ActuallyAdditions {
ActuallyTabs.init(eventBus);
ActuallyRecipes.init(eventBus);
AASounds.init(eventBus);
ActuallyVillagers.init(eventBus);
ActuallyPOITypes.init(eventBus);
ActuallyAttachments.init(eventBus);
ActuallyContainers.CONTAINERS.register(eventBus);
ENTITIES.register(eventBus);
@ -121,6 +126,7 @@ public class ActuallyAdditions {
NeoForge.EVENT_BUS.addListener(this::serverStarted);
NeoForge.EVENT_BUS.addListener(this::serverStopped);
NeoForge.EVENT_BUS.addListener(InitVillager::setupTrades);
NeoForge.EVENT_BUS.register(new CommonEvents());
// NeoForge.EVENT_BUS.register(new DungeonLoot());
NeoForge.EVENT_BUS.addListener(ActuallyAdditions::reloadEvent);

View file

@ -48,7 +48,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityLavaFactoryController;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLeafGenerator;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityLongRangeBreaker;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBooster;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBreaker;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomEnergyface;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomItemface;
@ -231,8 +230,8 @@ public final class ActuallyBlocks {
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomRedstoneface::new);
public static final AABlockReg<BlockPhantom, AABlockItem, TileEntityPhantomBreaker> PHANTOM_BREAKER = new AABlockReg<>("phantom_breaker", () -> new BlockPhantom(BlockPhantom.Type.BREAKER),
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBreaker::new);
public static final AABlockReg<BlockPhantomBooster, AABlockItem, TileEntityPhantomBooster> PHANTOM_BOOSTER = new AABlockReg<>("phantom_booster", BlockPhantomBooster::new,
(b) -> new AABlockItem(b, defaultBlockItemProperties), TileEntityPhantomBooster::new);
public static final AABlockReg<BlockPhantomBooster, AABlockItem, ?> PHANTOM_BOOSTER = new AABlockReg<>("phantom_booster", BlockPhantomBooster::new,
(b) -> new AABlockItem(b, defaultBlockItemProperties));
// Misc Tiles
public static final AABlockReg<BlockBatteryBox, AABlockItem, TileEntityBatteryBox> BATTERY_BOX = new AABlockReg<>("battery_box", BlockBatteryBox::new,
@ -376,7 +375,6 @@ public final class ActuallyBlocks {
PHANTOM_ENERGYFACE.getTileEntityType(),
PHANTOM_REDSTONEFACE.getTileEntityType(),
PHANTOM_BREAKER.getTileEntityType(),
PHANTOM_BOOSTER.getTileEntityType(),
BATTERY_BOX.getTileEntityType(),
FIREWORK_BOX.getTileEntityType(),
SHOCK_SUPPRESSOR.getTileEntityType(),

View file

@ -30,17 +30,6 @@ public class BlockGreenhouseGlass extends BlockBase {
super(ActuallyBlocks.defaultPickProps(0.5F, 10.0F).sound(SoundType.GLASS).randomTicks());
}
// TODO: [port] figure this out
// @Override
// @Deprecated
// @OnlyIn(Dist.CLIENT)
// public boolean shouldSideBeRendered(BlockState state, IBlockAccess world, BlockPos pos, Direction side) {
// BlockState otherState = world.getBlockState(pos.offset(side));
// Block block = otherState.getBlock();
//
// return state != otherState || block != this && super.shouldSideBeRendered(state, world, pos, side);
// }
@Override
public boolean skipRendering(BlockState state, BlockState adjacentState, Direction side) {
return adjacentState.is(this) ? true : super.skipRendering(state, adjacentState, side);

View file

@ -14,19 +14,17 @@ import com.mojang.blaze3d.platform.Window;
import de.ellpeck.actuallyadditions.api.tile.IPhantomTile;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBreaker;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomEnergyface;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomItemface;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomLiquiface;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomRedstoneface;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import de.ellpeck.actuallyadditions.mod.tile.*;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.FormattedText;
import net.minecraft.util.FormattedCharSequence;
import net.minecraft.util.Mth;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
@ -156,27 +154,37 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
BlockEntity tile = minecraft.level.getBlockEntity(pos);
if (tile != null) {
if (tile instanceof IPhantomTile phantom) {
guiGraphics.drawString(minecraft.font, ChatFormatting.GOLD + I18n.get("tooltip." + ActuallyAdditions.MODID + ".blockPhantomRange.desc") + ": " + phantom.getRange(), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 40, ChatFormatting.WHITE.getColor());
guiGraphics.drawString(minecraft.font, ChatFormatting.GOLD + I18n.get("tooltip." + ActuallyAdditions.MODID + ".blockPhantomRange.desc") + ": " + phantom.getRange(), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 40, ChatFormatting.WHITE.getColor());
if (phantom.hasBoundPosition()) {
int distance = Mth.ceil(new Vec3(pos.getX(), pos.getY(), pos.getZ()).distanceTo(new Vec3(phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ())));
BlockState state = minecraft.level.getBlockState(phantom.getBoundPosition());
Block block = state.getBlock();
Item item = Item.byBlock(block);
String name = item.getName(new ItemStack(block)).getString();
StringUtil.drawSplitString(minecraft.font, StringUtil.localizeFormatted("tooltip." + ActuallyAdditions.MODID + ".phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 30, 200, 0xFFFFFF, true);
drawWordWrap(guiGraphics, minecraft.font, Component.translatable("tooltip.actuallyadditions.phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 30, 200, 0xFFFFFF, true);
if (phantom.isBoundThingInRange()) {
StringUtil.drawSplitString(minecraft.font, ChatFormatting.DARK_GREEN + I18n.get("tooltip." + ActuallyAdditions.MODID + ".phantom.connectedRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
//StringUtil.drawSplitString(minecraft.font, ChatFormatting.DARK_GREEN + I18n.get("tooltip.actuallyadditions.phantom.connectedRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
drawWordWrap(guiGraphics, minecraft.font, Component.translatable("tooltip.actuallyadditions.phantom.connectedRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
} else {
StringUtil.drawSplitString(minecraft.font, ChatFormatting.DARK_RED + I18n.get("tooltip." + ActuallyAdditions.MODID + ".phantom.connectedNoRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
//StringUtil.drawSplitString(minecraft.font, ChatFormatting.DARK_RED + I18n.get("tooltip.actuallyadditions.phantom.connectedNoRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
drawWordWrap(guiGraphics, minecraft.font, Component.translatable("tooltip.actuallyadditions.phantom.connectedNoRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
}
} else {
guiGraphics.drawString(minecraft.font, ChatFormatting.RED + I18n.get("tooltip." + ActuallyAdditions.MODID + ".phantom.notConnected.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, ChatFormatting.WHITE.getColor());
guiGraphics.drawString(minecraft.font, ChatFormatting.RED + I18n.get("tooltip.actuallyadditions.phantom.notConnected.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, ChatFormatting.WHITE.getColor());
}
}
}
}
@OnlyIn(Dist.CLIENT)
public static void drawWordWrap(GuiGraphics gg, Font font, FormattedText text, int x, int y, int width, int color, boolean shadow) {
for (FormattedCharSequence line : font.split(text, width)) {
gg.drawString(font, line, x, y, color, shadow);
y += font.lineHeight;
}
}
public enum Type {
ITEMFACE,
PLACER,

View file

@ -10,33 +10,21 @@
package de.ellpeck.actuallyadditions.mod.blocks;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBooster;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
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.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase;
import javax.annotation.Nullable;
public class BlockPhantomBooster extends BlockContainerBase {
public class BlockPhantomBooster extends BlockBase {
public BlockPhantomBooster() {
super(ActuallyBlocks.defaultPickProps());
}
@Nullable
/* @Nullable
@Override
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
return new TileEntityPhantomBooster(pos, state);
}
}*/
@Nullable
/* @Nullable
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> entityType) {
return level.isClientSide? TileEntityPhantomBooster::clientTick : TileEntityPhantomBooster::serverTick;
@ -45,5 +33,5 @@ public class BlockPhantomBooster extends BlockContainerBase {
@Override
public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) {
return VoxelShapes.BOOSTER_SHAPE;
}
}*/
}

View file

@ -42,6 +42,9 @@ public class CommonConfig {
public static ModConfigSpec.IntValue OIL_GENERATOR_TRANSFER;
public static ModConfigSpec.IntValue MINER_LENS_ENERGY;
public static ModConfigSpec.BooleanValue LASER_RELAY_LOSS;
public static ModConfigSpec.IntValue LEAF_GENERATOR_COOLDOWN;
public static ModConfigSpec.IntValue LEAF_GENERATOR_CF_PER_LEAF;
public static ModConfigSpec.IntValue LEAF_GENERATOR_AREA;
public static void build() {
BUILDER.comment("Machine Settings").push("machineSettings");
@ -51,6 +54,9 @@ public class CommonConfig {
OIL_GENERATOR_TRANSFER = BUILDER.comment("The amount of power the oil generator can transfer per tick.").defineInRange("oilGeneratorTransfer", 500, 100, Integer.MAX_VALUE);
MINER_LENS_ENERGY = BUILDER.comment("The energy use of the Atomic Reconstructor's Mining Lens.").defineInRange("minerLensEnergy", 60000, 1, Integer.MAX_VALUE);
LASER_RELAY_LOSS = BUILDER.comment("If Energy Laser Relays should have energy loss.").define("laserRelayLoss", true);
LEAF_GENERATOR_COOLDOWN = BUILDER.comment("The cooldown between two generation cycles of the Leaf Generator, in ticks").defineInRange("leafGeneratorCooldown", 5, 1, Integer.MAX_VALUE);
LEAF_GENERATOR_CF_PER_LEAF = BUILDER.comment("The Leaf Generator's Energy Production in CF/Leaf").defineInRange("leafGeneratorCPPerLeaf", 300, 1, Integer.MAX_VALUE);
LEAF_GENERATOR_AREA = BUILDER.comment("The size of the Leaf Generator's harvesting area. Default is 7x7x7, must be an odd number.").defineInRange("leafGeneratorArea", 7, 1, Integer.MAX_VALUE);
BUILDER.pop();
}

View file

@ -15,14 +15,14 @@ import java.util.List;
public class ActuallyConfiguredFeatures {
public static final ResourceKey<ConfiguredFeature<?, ?>> ORE_BLACK_QUARTZ = FeatureUtils.createKey("actuallyadditions:ore_black_quartz");
// public static final ResourceKey<ConfiguredFeature<?, ?>> ORE_BLACK_QUARTZ_BURIED = FeatureUtils.createKey("actuallyadditions:ore_black_quartz_buried");
public static void bootstrap(BootstapContext<ConfiguredFeature<?, ?>> context) {
RuleTest stoneRuleTest = new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES);
RuleTest deepslateRuleTest = new TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES);
List<OreConfiguration.TargetBlockState> list = List.of(
OreConfiguration.target(stoneRuleTest, ActuallyBlocks.BLACK_QUARTZ_ORE.get().defaultBlockState())
OreConfiguration.target(stoneRuleTest, ActuallyBlocks.BLACK_QUARTZ_ORE.get().defaultBlockState()),
OreConfiguration.target(deepslateRuleTest, ActuallyBlocks.BLACK_QUARTZ_ORE.get().defaultBlockState())
);
FeatureUtils.register(context, ORE_BLACK_QUARTZ, Feature.ORE, new OreConfiguration(list, 6));
}
}

View file

@ -18,13 +18,12 @@ import java.util.List;
public class ActuallyPlacedFeatures {
public static final ResourceKey<PlacedFeature> PLACED_ORE_BLACK_QUARTZ = PlacementUtils.createKey("actuallyadditions:ore_black_quartz");
// public static final ResourceKey<PlacedFeature> PLACED_ORE_BLACK_QUARTZ_BURIED = PlacementUtils.createKey("actuallyadditions:ore_black_quartz_buried");
public static void bootstrap(BootstapContext<PlacedFeature> context) {
HolderGetter<ConfiguredFeature<?, ?>> holdergetter = context.lookup(Registries.CONFIGURED_FEATURE);
PlacementUtils.register(context, PLACED_ORE_BLACK_QUARTZ, holdergetter.getOrThrow(ActuallyConfiguredFeatures.ORE_BLACK_QUARTZ),
commonOrePlacement(8, HeightRangePlacement.triangle(VerticalAnchor.absolute(0), VerticalAnchor.absolute(45))));
commonOrePlacement(8, HeightRangePlacement.triangle(VerticalAnchor.absolute(-25), VerticalAnchor.absolute(45))));
}
private static List<PlacementModifier> orePlacement(PlacementModifier modifier, PlacementModifier modifier1) {

View file

@ -0,0 +1,20 @@
package de.ellpeck.actuallyadditions.mod.gen.village;
import com.google.common.collect.ImmutableSet;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.entity.ai.village.poi.PoiType;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;
public class ActuallyPOITypes {
public static final DeferredRegister<PoiType> POI_TYPES = DeferredRegister.create(BuiltInRegistries.POINT_OF_INTEREST_TYPE, ActuallyAdditions.MODID);
public static DeferredHolder<PoiType, PoiType> ENGINEER = POI_TYPES.register("engineer", () -> new PoiType(ImmutableSet.copyOf(ActuallyBlocks.COFFEE_MACHINE.get().getStateDefinition().getPossibleStates()), 1, 1));
public static void init(IEventBus bus) {
POI_TYPES.register(bus);
}
}

View file

@ -0,0 +1,20 @@
package de.ellpeck.actuallyadditions.mod.gen.village;
import com.google.common.collect.ImmutableSet;
import de.ellpeck.actuallyadditions.mod.AASounds;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.entity.npc.VillagerProfession;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredRegister;
import java.util.function.Supplier;
public class ActuallyVillagers {
public static final DeferredRegister<VillagerProfession> VILLAGER_PROFESSIONS = DeferredRegister.create(BuiltInRegistries.VILLAGER_PROFESSION, ActuallyAdditions.MODID);
public static final Supplier<VillagerProfession> ENGINEER = VILLAGER_PROFESSIONS.register("engineer", () -> new VillagerProfession("engineer", holder -> holder.value().equals(ActuallyPOITypes.ENGINEER.get()), holder -> holder.value().equals(ActuallyPOITypes.ENGINEER.get()), ImmutableSet.of(), ImmutableSet.of(), AASounds.VILLAGER_WORK_ENGINEER.get()));
public static void init(IEventBus bus) {
VILLAGER_PROFESSIONS.register(bus);
}
}

View file

@ -1,53 +1,86 @@
///*
// * This file ("BasicTradeList.java") is part of the Actually Additions mod for Minecraft.
// * It is created and owned by Ellpeck and distributed
// * under the Actually Additions License to be found at
// * http://ellpeck.de/actaddlicense
// * View the source code at https://github.com/Ellpeck/ActuallyAdditions
// *
// * © 2015-2017 Ellpeck
// */
//
//package de.ellpeck.actuallyadditions.mod.gen.village;
//
//import java.util.Random;
//
//import net.minecraft.entity.IMerchant;
//import net.minecraft.entity.passive.EntityVillager.ITradeList;
//import net.minecraft.entity.passive.EntityVillager.PriceInfo;
//import net.minecraft.init.Items;
//import net.minecraft.item.ItemStack;
//import net.minecraft.village.MerchantRecipe;
//import net.minecraft.village.MerchantRecipeList;
//
//public class BasicTradeList implements ITradeList {
//
// private final ItemStack input;
// private final PriceInfo inputAmount;
// private final ItemStack stack;
// private final PriceInfo outputAmount;
//
// public BasicTradeList(ItemStack input, PriceInfo inputAmount, ItemStack stack, PriceInfo outputAmount) {
// this.input = input;
// this.inputAmount = inputAmount;
// this.stack = stack;
// this.outputAmount = outputAmount;
// }
//
// public BasicTradeList(PriceInfo emeraldInput, ItemStack stack, PriceInfo outputAmount) {
// this(new ItemStack(Items.EMERALD), emeraldInput, stack, outputAmount);
// }
//
// public BasicTradeList(ItemStack input, PriceInfo inputAmount, PriceInfo emeraldOutput) {
// this(input, inputAmount, new ItemStack(Items.EMERALD), emeraldOutput);
// }
//
// @Override
// public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random) {
// ItemStack in = this.input.copy();
// in.setCount(this.inputAmount.getPrice(random));
// ItemStack out = this.stack.copy();
// out.setCount(this.outputAmount.getPrice(random));
// recipeList.add(new MerchantRecipe(in, out));
// }
//}
/*
* This file ("BasicTradeList.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2017 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.gen.village;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Tuple;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.npc.VillagerTrades;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.trading.MerchantOffer;
import org.jetbrains.annotations.Nullable;
public class BasicTradeList implements VillagerTrades.ItemListing {
private final ItemStack input;
private final PriceRange inputAmount;
private final ItemStack stack;
private final PriceRange outputAmount;
private int maxUses = 3;
private int villagerXp = 15;
private float priceMultiplier = 0.05F;
public BasicTradeList(ItemStack input, PriceRange inputAmount, ItemStack stack, PriceRange outputAmount) {
this.input = input;
this.inputAmount = inputAmount;
this.stack = stack;
this.outputAmount = outputAmount;
}
public BasicTradeList(PriceRange emeraldInput, ItemStack stack, PriceRange outputAmount) {
this(new ItemStack(Items.EMERALD), emeraldInput, stack, outputAmount);
}
public BasicTradeList(ItemStack input, PriceRange inputAmount, PriceRange emeraldOutput) {
this(input, inputAmount, new ItemStack(Items.EMERALD), emeraldOutput);
}
public BasicTradeList withMaxUses(int maxUses) {
this.maxUses = maxUses;
return this;
}
public BasicTradeList withVillagerXp(int villagerXp) {
this.villagerXp = villagerXp;
return this;
}
public BasicTradeList withPriceMultiplier(float priceMultiplier) {
this.priceMultiplier = priceMultiplier;
return this;
}
@Nullable
@Override
public MerchantOffer getOffer(Entity trader, RandomSource random) {
ItemStack in = this.input.copy();
in.setCount(this.inputAmount.getPrice(random));
ItemStack out = this.stack.copy();
out.setCount(this.outputAmount.getPrice(random));
return new MerchantOffer(in, out, this.maxUses, this.villagerXp, this.priceMultiplier);
}
public static class PriceRange extends Tuple<Integer, Integer> {
public PriceRange(int min, int max) {
super(Integer.valueOf(min), Integer.valueOf(max));
if (max < min) {
ActuallyAdditions.LOGGER.warn("PriceRange({}, {}) invalid, {} smaller than {}", Integer.valueOf(min), Integer.valueOf(max), Integer.valueOf(max), Integer.valueOf(min));
}
}
public int getPrice(RandomSource rand) {
return this.getA() >= this.getB() ? this.getA() : this.getA() + rand.nextInt(this.getB() - this.getA() + 1);
}
}
}

View file

@ -10,9 +10,29 @@
package de.ellpeck.actuallyadditions.mod.gen.village;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.world.entity.npc.VillagerTrades;
import net.minecraft.world.item.ItemStack;
import net.neoforged.neoforge.event.village.VillagerTradesEvent;
import java.util.List;
// TODO: [port] ADD BACK
public final class InitVillager {
//
public static void setupTrades(VillagerTradesEvent event) {
if (event.getType() == ActuallyVillagers.ENGINEER.get()) {
Int2ObjectMap<List<VillagerTrades.ItemListing>> trades = event.getTrades();
trades.put(1, List.of(new BasicTradeList(new BasicTradeList.PriceRange(1, 2), new ItemStack(ActuallyBlocks.BLACK_QUARTZ_ORE.get()), new BasicTradeList.PriceRange(2, 3)), new BasicTradeList(new BasicTradeList.PriceRange(1, 2), new ItemStack(ActuallyItems.BLACK_QUARTZ.get()), new BasicTradeList.PriceRange(6, 8)), new BasicTradeList(new BasicTradeList.PriceRange(1, 3), new ItemStack(ActuallyItems.LASER_WRENCH.get()), new BasicTradeList.PriceRange(1, 1))));
trades.put(2, List.of(new BasicTradeList(new ItemStack(ActuallyItems.COFFEE_BEANS.get()), new BasicTradeList.PriceRange(20, 30), new BasicTradeList.PriceRange(1, 2)), new BasicTradeList(new BasicTradeList.PriceRange(3, 5), new ItemStack(ActuallyBlocks.ITEM_INTERFACE.get()), new BasicTradeList.PriceRange(1, 1)), new BasicTradeList(new BasicTradeList.PriceRange(10, 20), new ItemStack(ActuallyBlocks.LASER_RELAY.get()), new BasicTradeList.PriceRange(1, 2))));
trades.put(3, List.of(new BasicTradeList(new ItemStack(ActuallyBlocks.TINY_TORCH.get()), new BasicTradeList.PriceRange(30, 40), new BasicTradeList.PriceRange(1, 2)), new BasicTradeList(new BasicTradeList.PriceRange(1, 2), new ItemStack(ActuallyBlocks.WOOD_CASING.get()), new BasicTradeList.PriceRange(1, 2))));
trades.put(4, List.of(new BasicTradeList(new BasicTradeList.PriceRange(3, 5), new ItemStack(ActuallyBlocks.IRON_CASING.get()), new BasicTradeList.PriceRange(1, 2)), new BasicTradeList(new ItemStack(ActuallyBlocks.EMPOWERER.get()), new BasicTradeList.PriceRange(1, 1), new BasicTradeList.PriceRange(15, 20)), new BasicTradeList(new BasicTradeList.PriceRange(30, 40), new ItemStack(ActuallyBlocks.LASER_RELAY_EXTREME.get()), new BasicTradeList.PriceRange(1, 1))));
}
}
//
// public static VillagerProfession jamProfession;
// public static VillagerProfession engineerProfession;
//

View file

@ -17,6 +17,7 @@ import net.minecraft.world.InteractionResult;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.SimpleMenuProvider;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.ContainerLevelAccess;
import net.minecraft.world.inventory.CraftingMenu;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
@ -34,7 +35,12 @@ public class ItemCrafterOnAStick extends ItemBase {
@Override
public InteractionResultHolder<ItemStack> use(Level world, @Nonnull Player player, @Nonnull InteractionHand hand) {
if (!world.isClientSide) {
player.openMenu(new SimpleMenuProvider((windowId, playerInventory, playerEntity) -> new CraftingMenu(windowId, playerInventory), CONTAINER_TITLE));
player.openMenu(new SimpleMenuProvider((windowId, playerInventory, playerEntity) -> new CraftingMenu(windowId, playerInventory, ContainerLevelAccess.create(world, player.blockPosition())){
@Override
public boolean stillValid(Player playerIn) {
return true;
}
}, CONTAINER_TITLE));
}
return new InteractionResultHolder<>(InteractionResult.SUCCESS, player.getItemInHand(hand));
}

View file

@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.items;
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes;
@ -27,14 +26,16 @@ import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.ClipContext;
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.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.event.EventHooks;
import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;
@ -42,42 +43,39 @@ public class ItemWaterBowl extends ItemBase {
public ItemWaterBowl() {
super(ActuallyItems.defaultProps().stacksTo(1));
//MinecraftForge.EVENT_BUS.register(this);
NeoForge.EVENT_BUS.register(this);
}
@SubscribeEvent
public void onPlayerInteractEvent(PlayerInteractEvent.RightClickItem event) {
if (event.getLevel() != null) {
if (CommonConfig.Other.WATER_BOWL.get()) {
if (!event.getItemStack().isEmpty() && event.getItemStack().getItem() == Items.BOWL) {
HitResult rayTrace = event.getEntity().pick(Util.getReachDistance(event.getEntity()), 1f, true);
if (rayTrace.getType() != HitResult.Type.BLOCK) {
return;
}
if (event.getLevel() != null && CommonConfig.Other.WATER_BOWL.get()) {
if (!event.getItemStack().isEmpty() && event.getItemStack().is(Items.BOWL)) {
BlockHitResult trace = getPlayerPOVHitResult(
event.getLevel(), event.getEntity(), ClipContext.Fluid.SOURCE_ONLY //Using pick will also return flowing water
);
if (trace.getType() != HitResult.Type.BLOCK) {
return;
}
BlockHitResult trace = (BlockHitResult) rayTrace;
InteractionResultHolder<ItemStack> result = EventHooks.onBucketUse(event.getEntity(), event.getLevel(), event.getItemStack(), trace);
if (result == null) {
if (event.getEntity().mayUseItemAt(trace.getBlockPos().relative(trace.getDirection()), trace.getDirection(), event.getItemStack())) {
BlockState state = event.getLevel().getBlockState(trace.getBlockPos());
Block block = state.getBlock();
InteractionResultHolder<ItemStack> result = EventHooks.onBucketUse(event.getEntity(), event.getLevel(), event.getItemStack(), trace);
if (result == null) {
if (event.getEntity().mayUseItemAt(trace.getBlockPos().relative(trace.getDirection()), trace.getDirection(), event.getItemStack())) {
BlockState state = event.getLevel().getBlockState(trace.getBlockPos());
// TODO: Validate fluid check
if ((block == Blocks.WATER) && state.getValue(BlockStateProperties.LEVEL) == 0) {
event.getEntity().playSound(SoundEvents.BUCKET_FILL, 1.0F, 1.0F);
if (state.getFluidState().is(Fluids.WATER) && state.getValue(BlockStateProperties.LEVEL) == 0) {
event.getEntity().playSound(SoundEvents.BUCKET_FILL, 1.0F, 1.0F);
if (!event.getLevel().isClientSide) {
event.getLevel().setBlock(trace.getBlockPos(), Blocks.AIR.defaultBlockState(), 11);
ItemStack reduced = StackUtil.shrink(event.getItemStack(), 1);
if (!event.getLevel().isClientSide) {
event.getLevel().setBlock(trace.getBlockPos(), Blocks.AIR.defaultBlockState(), 11);
ItemStack reduced = StackUtil.shrink(event.getItemStack(), 1);
ItemStack bowl = new ItemStack(ActuallyItems.WATER_BOWL.get());
if (!StackUtil.isValid(reduced)) {
event.getEntity().setItemInHand(event.getHand(), bowl);
} else if (!event.getEntity().getInventory().add(bowl.copy())) {
ItemEntity entityItem = new ItemEntity(event.getLevel(), event.getEntity().getX(), event.getEntity().getY(), event.getEntity().getZ(), bowl.copy());
entityItem.setPickUpDelay(0);
event.getLevel().addFreshEntity(entityItem);
}
ItemStack bowl = new ItemStack(ActuallyItems.WATER_BOWL.get());
if (!StackUtil.isValid(reduced)) {
event.getEntity().setItemInHand(event.getHand(), bowl);
} else if (!event.getEntity().getInventory().add(bowl.copy())) {
ItemEntity entityItem = new ItemEntity(event.getLevel(), event.getEntity().getX(), event.getEntity().getY(), event.getEntity().getZ(), bowl.copy());
entityItem.setPickUpDelay(0);
event.getLevel().addFreshEntity(entityItem);
}
}
}

View file

@ -10,6 +10,10 @@
package de.ellpeck.actuallyadditions.mod.particle;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.blaze3d.vertex.VertexConsumer;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.Camera;
@ -18,9 +22,35 @@ import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.ParticleProvider;
import net.minecraft.client.particle.ParticleRenderType;
import net.minecraft.client.particle.SpriteSet;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.util.FastColor;
public class ParticleBeam extends Particle {
public static final ParticleRenderType LASER_RENDER = new ParticleRenderType() {
@Override
public void begin(BufferBuilder buffer, TextureManager textureManager) {
RenderSystem.disableCull();
RenderSystem.enableBlend();
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.SRC_ALPHA);
RenderSystem.enableDepthTest();
RenderSystem.depthFunc(515);
RenderSystem.depthMask(false);
}
@Override
public void end(Tesselator tesselator) {
RenderSystem.enableCull();
RenderSystem.disableBlend();
RenderSystem.defaultBlendFunc();
}
@Override
public String toString() {
return "actuallyadditions:laser_particle";
}
};
private final double endX;
private final double endY;
@ -44,15 +74,15 @@ public class ParticleBeam extends Particle {
}
@Override
public void render(VertexConsumer buffer, Camera renderInfo, float partialTicks) {
public void render(VertexConsumer buffer, Camera camera, float partialTicks) {
float ageRatio = (float) this.age / (float) this.lifetime;
float currAlpha = this.alpha - ageRatio * this.alpha;
AssetUtil.renderLaser(this.x + 0.5, this.y + 0.5, this.z + 0.5, this.endX + 0.5, this.endY + 0.5, this.endZ + 0.5, this.rotationTime, currAlpha, this.size, this.color);
AssetUtil.renderLaserParticle(buffer, camera, this.x + 0.5, this.y + 0.5, this.z + 0.5, this.endX + 0.5, this.endY + 0.5, this.endZ + 0.5, (float) this.rotationTime, currAlpha, this.size, this.color);
}
@Override
public ParticleRenderType getRenderType() {
return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT;
return LASER_RENDER;
}
@ -68,8 +98,20 @@ public class ParticleBeam extends Particle {
}
public static ParticleOptions createData(double endX, double endY, double endZ, float[] color, float alpha,
int maxAge, double rotationTime, float size) {
int maxAge, double rotationTime, float size) {
return new BeamParticleData(endX, endY, endZ, color, alpha, maxAge, rotationTime, size);
}
public static ParticleOptions createData(double endX, double endY, double endZ, int color, float alpha,
int maxAge, double rotationTime, float size) {
return new BeamParticleData(endX, endY, endZ, colorFromInt(color), alpha, maxAge, rotationTime, size);
}
private static float[] colorFromInt(int color) {
float red = (float)(FastColor.ARGB32.red(color) / 255.0);
float green = (float)(FastColor.ARGB32.green(color) / 255.0);
float blue = (float)(FastColor.ARGB32.blue(color) / 255.0);
return new float[] {red, green, blue};
}
}
}

View file

@ -11,11 +11,12 @@
package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
@ -24,9 +25,9 @@ import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.neoforged.neoforge.energy.IEnergyStorage;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
public class TileEntityLeafGenerator extends TileEntityBase implements ISharingEnergyProvider, IEnergyDisplay {
@ -62,25 +63,19 @@ public class TileEntityLeafGenerator extends TileEntityBase implements ISharingE
if (!tile.isRedstonePowered) {
if (tile.nextUseCounter >= ConfigIntValues.LEAF_GENERATOR_COOLDOWN.getValue()) {
if (tile.nextUseCounter >= CommonConfig.Machines.LEAF_GENERATOR_COOLDOWN.get()) {
tile.nextUseCounter = 0;
int energyProduced = ConfigIntValues.LEAF_GENERATOR_CF_PER_LEAF.getValue();
int energyProduced = CommonConfig.Machines.LEAF_GENERATOR_CF_PER_LEAF.get();
if (energyProduced > 0 && energyProduced <= tile.storage.getMaxEnergyStored() - tile.storage.getEnergyStored()) {
List<BlockPos> breakPositions = new ArrayList<>();
int range = ConfigIntValues.LEAF_GENERATOR_AREA.getValue();
for (int reachX = -range; reachX < range + 1; reachX++) {
for (int reachZ = -range; reachZ < range + 1; reachZ++) {
for (int reachY = -range; reachY < range + 1; reachY++) {
BlockPos offsetPos = pos.offset(reachX, reachY, reachZ);
Block block = level.getBlockState(offsetPos).getBlock();
if (block instanceof LeavesBlock) { // TODO: [port] validate tile is a good way of checking if something is a leaf
breakPositions.add(offsetPos);
}
}
}
}
int range = CommonConfig.Machines.LEAF_GENERATOR_AREA.get();
List<BlockPos> breakPositions = BlockPos.betweenClosedStream(
pos.offset(-range, -range, -range),
pos.offset(range, range, range)).map(BlockPos::immutable).collect(Collectors.toList());
breakPositions.removeIf(blockPos -> {
BlockState offsetState = level.getBlockState(blockPos);
return !(offsetState.getBlock() instanceof LeavesBlock || offsetState.is(BlockTags.LEAVES));
});
if (!breakPositions.isEmpty()) {
Collections.shuffle(breakPositions);

View file

@ -6,7 +6,8 @@
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2017 Ellpeck
*/
*//*
package de.ellpeck.actuallyadditions.mod.tile;
@ -34,3 +35,4 @@ public class TileEntityPhantomBooster extends TileEntityBase {
}
}
}
*/

View file

@ -16,12 +16,14 @@ import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import net.neoforged.neoforge.capabilities.ICapabilityInvalidationListener;
public abstract class TileEntityPhantomface extends TileEntityInventoryBase implements IPhantomTile {
public static final int RANGE = 16;
@ -32,6 +34,7 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
private BlockPos boundPosBefore;
private Block boundBlockBefore;
private int lastStrength;
private CapListener capListener = new CapListener(this);
public TileEntityPhantomface(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state, 0);
@ -48,6 +51,7 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
break;
}
}
return newRange;
}
@ -90,6 +94,13 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
if (this.doesNeedUpdateSend()) {
this.onUpdateSent();
if (level instanceof ServerLevel serverLevel) {
capListener.disable();
capListener = new CapListener(this);
if (hasBoundPosition())
serverLevel.registerCapabilityListener(boundPosition, capListener);
}
}
int strength = this.getComparatorStrength();
@ -122,7 +133,6 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
if (this.boundPosition != null) {
this.level.updateNeighborsAt(this.worldPosition, this.level.getBlockState(this.boundPosition).getBlock());
}
this.sendUpdate();
this.setChanged();
}
@ -191,4 +201,25 @@ public abstract class TileEntityPhantomface extends TileEntityInventoryBase impl
}
return 0;
}
public class CapListener implements ICapabilityInvalidationListener {
private boolean valid = true;
private final TileEntityPhantomface tile;
public CapListener(TileEntityPhantomface tile) {
this.tile = tile;
}
public void disable() {
valid = false;
}
@Override
public boolean onInvalidate() {
if (valid && !tile.isRemoved()) {
tile.invalidateCapabilities();
return true;
}
return false;
}
}
}

View file

@ -10,22 +10,25 @@
package de.ellpeck.actuallyadditions.mod.util;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.VertexFormat;
import com.mojang.math.Axis;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.render.RenderTypes;
import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient;
import de.ellpeck.actuallyadditions.mod.particle.ParticleBeam;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import net.minecraft.client.Camera;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.ItemRenderer;
@ -242,14 +245,13 @@ public final class AssetUtil {
public static void spawnLaserWithTimeClient(double startX, double startY, double startZ, double endX, double endY, double endZ, int color, int maxAge, double rotationTime, float size, float alpha) {
Minecraft mc = Minecraft.getInstance();
BlockEntity tile = mc.level.getBlockEntity(BlockPos.containing(startX, startY, startZ));
if(tile instanceof TileEntityAtomicReconstructor)
if (tile instanceof TileEntityAtomicReconstructor) {
((TileEntityAtomicReconstructor) tile).resetBeam(maxAge, color);
/* if (mc.player.distanceToSqr(startX, startY, startZ) <= 64 || mc.player.distanceToSqr(endX, endY, endZ) <= 64) {
Particle fx = new ParticleBeam(mc.level, startX, startY, startZ, endX, endY, endZ, color, maxAge, rotationTime, size, alpha);
mc.level.addParticle((IParticleData) fx, startX, startY, startZ, 0, 0, 0);
}*/
} else {
if (mc.player != null && mc.player.distanceToSqr(startX, startY, startZ) <= 64 || mc.player.distanceToSqr(endX, endY, endZ) <= 64) {
mc.level.addParticle(ParticleBeam.Factory.createData(endX, endY, endZ, color, alpha, maxAge, rotationTime, size), startX, startY, startZ, 0, 0, 0);
}
}
}
/* @OnlyIn(Dist.CLIENT)
public static void renderLaser(MatrixStack matrixStack, IRenderTypeBuffer buffer, float x, float y, float z, float tx, float ty, float tz, float rotation, int color, float beamWidth) {
@ -332,11 +334,10 @@ public final class AssetUtil {
//Thanks to feldim2425 for this.
//I can't do rendering code. Ever.
@OnlyIn(Dist.CLIENT)
public static void renderLaser(double firstX, double firstY, double firstZ, double secondX, double secondY, double secondZ, double rotationTime, float alpha, double beamWidth, float[] color) {
Tesselator tessy = Tesselator.getInstance();
BufferBuilder render = tessy.getBuilder();
public static void renderLaserParticle(VertexConsumer builder, Camera camera, double firstX, double firstY, double firstZ, double secondX, double secondY, double secondZ, float rotationTime, float a, float beamWidth, float[] color) {
Level world = Minecraft.getInstance().level;
Vec3 cam = camera.getPosition();
float r = color[0];
float g = color[1];
float b = color[2];
@ -345,107 +346,60 @@ public final class AssetUtil {
Vec3 vec2 = new Vec3(secondX, secondY, secondZ);
Vec3 combinedVec = vec2.subtract(vec1);
double rot = rotationTime > 0
? 360D * (world.getGameTime() % rotationTime / rotationTime)
: 0;
double pitch = Math.atan2(combinedVec.y, Math.sqrt(combinedVec.x * combinedVec.x + combinedVec.z * combinedVec.z));
double yaw = Math.atan2(-combinedVec.z, combinedVec.x);
int lightmap = LightTexture.pack(MAX_LIGHT_X, MAX_LIGHT_Y);
double length = combinedVec.length();
double roll = rotationTime > 0 ? 360D * (world.getGameTime() % rotationTime / rotationTime) : 0;
double pitch = Math.toDegrees(Math.atan2(combinedVec.y, Math.sqrt(combinedVec.x * combinedVec.x + combinedVec.z * combinedVec.z)));
double yaw = Math.toDegrees(Math.atan2(-combinedVec.z, combinedVec.x)) - 90;
// GlStateManager._pushMatrix();
float length = (float) combinedVec.length();
/* GlStateManager._disableLighting();
GlStateManager._enableBlend();
GlStateManager._blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
int func = GL11.glGetInteger(GL11.GL_ALPHA_TEST_FUNC);
float ref = GL11.glGetFloat(GL11.GL_ALPHA_TEST_REF);
GlStateManager._alphaFunc(GL11.GL_ALWAYS, 0);
GlStateManager.translate(firstX - TileEntityRendererDispatcher.staticPlayerX, firstY - TileEntityRendererDispatcher.staticPlayerY, firstZ - TileEntityRendererDispatcher.staticPlayerZ);
GlStateManager.rotate((float) (180 * yaw / Math.PI), 0, 1, 0);
GlStateManager.rotate((float) (180 * pitch / Math.PI), 0, 0, 1);
GlStateManager.rotate((float) rot, 1, 0, 0);*/
PoseStack matrixStack = new PoseStack();
matrixStack.pushPose();
/*if(r != r2 || g != g2 || b != b2){
render.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
Minecraft.getInstance().renderEngine.bindTexture(ClientUtil.LIGHT_BEAM_GRADIENT);
matrixStack.translate(firstX - cam.x, firstY - cam.y, firstZ - cam.z);
render.pos(length, -beamWidth, beamWidth).tex(0, 0).color(r, g, b, alpha).endVertex();
render.pos(length, beamWidth, beamWidth).tex(0, 1).color(r, g, b, alpha).endVertex();
render.pos(0, beamWidth, beamWidth).tex(1, 1).color(r, g, b, alpha).endVertex();
render.pos(0, -beamWidth, beamWidth).tex(1, 0).color(r, g, b, alpha).endVertex();
matrixStack.mulPose(Axis.YP.rotationDegrees((float)yaw));
matrixStack.mulPose(Axis.XP.rotationDegrees((float)pitch));
matrixStack.mulPose(Axis.ZP.rotationDegrees((float)roll));
render.pos(length, -beamWidth, beamWidth).tex(1, 0).color(r2, g2, b2, alpha).endVertex();
render.pos(length, beamWidth, beamWidth).tex(1, 1).color(r2, g2, b2, alpha).endVertex();
render.pos(0, beamWidth, beamWidth).tex(0, 1).color(r2, g2, b2, alpha).endVertex();
render.pos(0, -beamWidth, beamWidth).tex(0, 0).color(r2, g2, b2, alpha).endVertex();
Matrix4f matrix = matrixStack.last().pose();
render.pos(length, beamWidth, -beamWidth).tex(0, 0).color(r, g, b, alpha).endVertex();
render.pos(length, -beamWidth, -beamWidth).tex(0, 1).color(r, g, b, alpha).endVertex();
render.pos(0, -beamWidth, -beamWidth).tex(1, 1).color(r, g, b, alpha).endVertex();
render.pos(0, beamWidth, -beamWidth).tex(1, 0).color(r, g, b, alpha).endVertex();
RenderSystem.setShader(GameRenderer::getPositionColorLightmapShader);
Tesselator.getInstance().getBuilder().begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR_LIGHTMAP);
render.pos(length, beamWidth, -beamWidth).tex(1, 0).color(r2, g2, b2, alpha).endVertex();
render.pos(length, -beamWidth, -beamWidth).tex(1, 1).color(r2, g2, b2, alpha).endVertex();
render.pos(0, -beamWidth, -beamWidth).tex(0, 1).color(r2, g2, b2, alpha).endVertex();
render.pos(0, beamWidth, -beamWidth).tex(0, 0).color(r2, g2, b2, alpha).endVertex();
TextureAtlasSprite sprite = Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(FORGE_WHITE);
float minU = sprite.getU0();
float maxU = sprite.getU1();
float minV = sprite.getV0();
float maxV = sprite.getV1();
render.pos(length, beamWidth, beamWidth).tex(0, 0).color(r, g, b, alpha).endVertex();
render.pos(length, beamWidth, -beamWidth).tex(0, 1).color(r, g, b, alpha).endVertex();
render.pos(0, beamWidth, -beamWidth).tex(1, 1).color(r, g, b, alpha).endVertex();
render.pos(0, beamWidth, beamWidth).tex(1, 0).color(r, g, b, alpha).endVertex();
render.pos(length, beamWidth, beamWidth).tex(1, 0).color(r2, g2, b2, alpha).endVertex();
render.pos(length, beamWidth, -beamWidth).tex(1, 1).color(r2, g2, b2, alpha).endVertex();
render.pos(0, beamWidth, -beamWidth).tex(0, 1).color(r2, g2, b2, alpha).endVertex();
render.pos(0, beamWidth, beamWidth).tex(0, 0).color(r2, g2, b2, alpha).endVertex();
render.pos(length, -beamWidth, -beamWidth).tex(0, 0).color(r, g, b, alpha).endVertex();
render.pos(length, -beamWidth, beamWidth).tex(0, 1).color(r, g, b, alpha).endVertex();
render.pos(0, -beamWidth, beamWidth).tex(1, 1).color(r, g, b, alpha).endVertex();
render.pos(0, -beamWidth, -beamWidth).tex(1, 0).color(r, g, b, alpha).endVertex();
render.pos(length, -beamWidth, -beamWidth).tex(1, 0).color(r2, g2, b2, alpha).endVertex();
render.pos(length, -beamWidth, beamWidth).tex(1, 1).color(r2, g2, b2, alpha).endVertex();
render.pos(0, -beamWidth, beamWidth).tex(0, 1).color(r2, g2, b2, alpha).endVertex();
render.pos(0, -beamWidth, -beamWidth).tex(0, 0).color(r2, g2, b2, alpha).endVertex();
tessy.draw();
//Draw laser tube faces
for (int i = 1; i < 4; i++) {
float width = beamWidth * (i / 4.0f);
//top
builder.vertex(matrix, -width, width, 0.0f).color(r, g, b, a).uv(minU, maxV).uv2(lightmap).endVertex();
builder.vertex(matrix, width, width, 0.0f).color(r, g, b, a).uv(maxU, maxV).uv2(lightmap).endVertex();
builder.vertex(matrix, width, width, -length).color(r, g, b, a).uv(maxU, minV).uv2(lightmap).endVertex();
builder.vertex(matrix, -width, width, -length).color(r, g, b, a).uv(minU, minV).uv2(lightmap).endVertex();
//bottom
builder.vertex(matrix, -width, -width, 0.0f).color(r, g, b, a).uv(minU, maxV).uv2(lightmap).endVertex();
builder.vertex(matrix, -width, -width, -length).color(r, g, b, a).uv(minU, minV).uv2(lightmap).endVertex();
builder.vertex(matrix, width, -width, -length).color(r, g, b, a).uv(maxU, minV).uv2(lightmap).endVertex();
builder.vertex(matrix, width, -width, 0.0f).color(r, g, b, a).uv(maxU, maxV).uv2(lightmap).endVertex();
//left
builder.vertex(matrix, -width, width, 0.0f).color(r, g, b, a).uv(maxU, maxV).uv2(lightmap).endVertex();
builder.vertex(matrix, -width, -width, 0.0f).color(r, g, b, a).uv(maxU, maxV).uv2(lightmap).endVertex();
builder.vertex(matrix, -width, -width, -length).color(r, g, b, a).uv(minU, minV).uv2(lightmap).endVertex();
builder.vertex(matrix, -width, width, -length).color(r, g, b, a).uv(minU, minV).uv2(lightmap).endVertex();
//right
builder.vertex(matrix, width, width, 0.0f).color(r, g, b, a).uv(maxU, maxV).uv2(lightmap).endVertex();
builder.vertex(matrix, width, -width, 0.0f).color(r, g, b, a).uv(maxU, maxV).uv2(lightmap).endVertex();
builder.vertex(matrix, width, -width, -length).color(r, g, b, a).uv(minU, minV).uv2(lightmap).endVertex();
builder.vertex(matrix, width, width, -length).color(r, g, b, a).uv(minU, minV).uv2(lightmap).endVertex();
}
else{*/
//GlStateManager.disableTexture2D();
//render.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR);
for (double i = 0; i < 4; i++) {
double width = beamWidth * (i / 4.0);
render.vertex(length, width, width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(0, width, width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(0, -width, width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(length, -width, width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(length, -width, -width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(0, -width, -width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(0, width, -width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(length, width, -width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(length, width, -width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(0, width, -width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(0, width, width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(length, width, width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(length, -width, width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(0, -width, width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(0, -width, -width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
render.vertex(length, -width, -width).uv(0, 0).uv2(MAX_LIGHT_X, MAX_LIGHT_Y).color(r, g, b, alpha).endVertex();
}
tessy.end();
//GlStateManager.enableTexture2D();
//}
//GlStateManager._alphaFunc(func, ref);
//GlStateManager._blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager._disableBlend();
// GlStateManager._enableLighting();
// GlStateManager._popMatrix();
matrixStack.popPose();
Tesselator.getInstance().end();
}
@OnlyIn(Dist.CLIENT)

View file

@ -29,6 +29,7 @@ public final class StringUtil {
}
// TODO: Move to official
@Deprecated
@OnlyIn(Dist.CLIENT)
public static void drawSplitString(Font renderer, String strg, int x, int y, int width, int color, boolean shadow) {
// ResourcePackList <- holds the correct way

View file

@ -5,4 +5,6 @@ public-f net.minecraft.world.level.levelgen.structure.templatesystem.StructurePr
public net.minecraft.world.item.crafting.ShapedRecipe pattern
public net.minecraft.world.inventory.InventoryMenu TEXTURE_EMPTY_SLOTS
public net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool templates
public-f net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool rawTemplates
public-f net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool rawTemplates
public net.minecraft.world.entity.npc.VillagerTrades$ItemsForEmeralds
public net.minecraft.world.entity.npc.VillagerTrades$EmeraldForItems

View file

@ -26,7 +26,7 @@
"_comment": "Entities",
"entity.Villager.actuallyadditions.jammer": "Jam Guy",
"entity.Villager.actuallyadditions.crystallizer": "Crystallizer",
"entity.Villager.actuallyadditions.engineer": "Engineer",
"entity.minecraft.villager.actuallyadditions.engineer": "Engineer",
"_comment": "Banners",
"item.banner.actuallyadditionsBook.black": "Black Actually Additions Manual Pattern",
"item.banner.actuallyadditionsBook.red": "Red Actually Additions Manual Pattern",
@ -99,7 +99,7 @@
"death.actuallyadditions.atomicreconstructor.4": "%s shouldn't have ate that Reconstructor!",
"death.actuallyadditions.atomicreconstructor.5": "%s should have used some re-construction foam.",
"_comment": "Blocks",
"block.actuallyadditions.black_quartz_ore": "Black Quartz Ore (wip)",
"block.actuallyadditions.black_quartz_ore": "Black Quartz Ore",
"block.actuallyadditions.black_quartz_block": "Block of Black Quartz",
"block.actuallyadditions.chiseled_black_quartz_block": "Chiseled Black Quartz",
"block.actuallyadditions.black_quartz_pillar_block": "Pillar of Black Quartz",
@ -112,8 +112,8 @@
"block.actuallyadditions.fishing_net": "Fishing Net (wip)",
"block.actuallyadditions.heat_collector": "Heat Collector (wip)",
"block.actuallyadditions.item_repairer": "Item Repairer (wip)",
"block.actuallyadditions.wood_casing": "Wood Casing (wip)",
"block.actuallyadditions.greenhouse_glass": "Greenhouse Glass (wip)",
"block.actuallyadditions.wood_casing": "Wood Casing",
"block.actuallyadditions.greenhouse_glass": "Greenhouse Glass",
"block.actuallyadditions.energizer": "Energizer",
"block.actuallyadditions.enervator": "Enervator",
"block.actuallyadditions.rice": "Rice Plant",
@ -135,18 +135,18 @@
"block.actuallyadditions.lamp_pink": "Pink Lamp",
"block.actuallyadditions.lamp_cyan": "Cyan Lamp",
"block.actuallyadditions.lamp_purple": "Purple Lamp",
"block.actuallyadditions.phantom_itemface": "Phantom Itemface (wip)",
"block.actuallyadditions.phantom_itemface": "Phantom Itemface",
"block.actuallyadditions.player_interface": "Player Interface (wip)",
"block.actuallyadditions.phantom_energyface": "Phantom Energyface (wip)",
"block.actuallyadditions.phantom_redstoneface": "Phantom Redstoneface (wip)",
"block.actuallyadditions.phantom_liquiface": "Phantom Liquiface (wip)",
"block.actuallyadditions.phantom_energyface": "Phantom Energyface",
"block.actuallyadditions.phantom_redstoneface": "Phantom Redstoneface",
"block.actuallyadditions.phantom_liquiface": "Phantom Liquiface",
"block.actuallyadditions.phantom_placer": "Phantom Placer (wip)",
"block.actuallyadditions.phantom_breaker": "Phantom Breaker (wip)",
"block.actuallyadditions.lava_factory_controller": "Lava Factory Controller",
"block.actuallyadditions.lava_factory_casing": "Lava Casing",
"block.actuallyadditions.fluid_placer": "Fluid Placer",
"block.actuallyadditions.fluid_collector": "Fluid Collector",
"block.actuallyadditions.phantom_booster": "Phantom Booster (wip)",
"block.actuallyadditions.phantom_booster": "Phantom Booster",
"block.actuallyadditions.coffee": "Coffee Plant",
"block.actuallyadditions.ethetic_green_block": "Ethetic Green Quartz",
"block.actuallyadditions.ethetic_white_block": "Ethetic Quartz",
@ -170,7 +170,7 @@
"block.actuallyadditions.flax": "Flax Plant",
"block.actuallyadditions.coffee_machine": "Coffee Maker",
"block.actuallyadditions.xp_solidifier": "Experience Solidifier",
"block.actuallyadditions.leaf_generator": "Leaf-Eating Generator (wip)",
"block.actuallyadditions.leaf_generator": "Leaf-Eating Generator",
"block.actuallyadditions.long_range_breaker": "Long-Range Breaker (wip)",
"block.actuallyadditions.ranged_collector": "Ranged Collector",
"block.actuallyadditions.laser_relay": "Energy Laser Relay (wip)",
@ -299,11 +299,11 @@
"item.actuallyadditions.gold_aiot": "Golden AIOT (wip)",
"item.actuallyadditions.diamond_aiot": "Diamond AIOT (wip)",
"item.actuallyadditions.netherite_aiot": "Netherite AIOT (wip)",
"item.actuallyadditions.phantom_connector": "Phantom Connector (wip)",
"item.actuallyadditions.phantom_connector": "Phantom Connector",
"item.actuallyadditions.empty_cup": "Empty Cup",
"item.actuallyadditions.coffee_cup": "Cup with Coffee",
"item.actuallyadditions.coffee_seeds": "Coffee Seeds",
"item.actuallyadditions.coffee_beans": "Coffee Beans (wip)",
"item.actuallyadditions.coffee_beans": "Coffee Beans",
"item.actuallyadditions.canola_seeds": "Canola Seeds",
"item.actuallyadditions.canola": "Canola",
"item.actuallyadditions.resonant_rice": "Resonant Rice",
@ -328,7 +328,7 @@
"item.actuallyadditions.advanced_coil": "Advanced Coil",
"item.actuallyadditions.potion_ring": "Ring of (wip)",
"item.actuallyadditions.potion_ring_advanced": "Advanced Ring of (wip)",
"item.actuallyadditions.solidified_experience": "Solidified Experience (wip)",
"item.actuallyadditions.solidified_experience": "Solidified Experience",
"item.actuallyadditions.dust_iron": "Crushed Iron (wip)",
"item.actuallyadditions.dust_gold": "Crushed Gold (wip)",
"item.actuallyadditions.dust_diamond": "Crushed Diamond (wip)",
@ -371,7 +371,7 @@
"item.actuallyadditions.spawner_changer": "Spawner Changer (wip)",
"item.actuallyadditions.spawner_shard": "Spawner Shards (wip)",
"item.actuallyadditions.minecart_firework_box": "Firework Box Cart (wip)",
"item.actuallyadditions.water_bowl": "Bowl of Water (wip)",
"item.actuallyadditions.water_bowl": "Bowl of Water",
"item.actuallyadditions.filter": "Item Filter",
"item.actuallyadditions.biomass": "Biomass (wip)",
"item.actuallyadditions.biocoal": "Bio Coal (wip)",

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB