mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-24 16:18:33 +01:00
Compare commits
2 commits
b99eb0cec2
...
5c9a8a804a
Author | SHA1 | Date | |
---|---|---|---|
|
5c9a8a804a | ||
|
38dd402903 |
5 changed files with 242 additions and 39 deletions
|
@ -1,50 +1,49 @@
|
|||
#Because he's me
|
||||
ellpeck=actuallyadditions:blockAtomicReconstructor
|
||||
ellpeck=actuallyadditions:atomic_reconstructor_block
|
||||
#Because he submitted tons of ideas for the mod
|
||||
dqmhose=minecraft:torch
|
||||
#Because he does all of the textures
|
||||
twoofeight=actuallyadditions:blockHeatCollector
|
||||
# twoofeight=actuallyadditions:blockHeatCollector #was this item removed?
|
||||
#Because she is awesome and squids are cool
|
||||
larixine=actuallyadditions:blockBlackLotus
|
||||
# larixine=actuallyadditions:blockBlackLotus #this item was removed i think
|
||||
#Because he helps me with models and stuff
|
||||
canitzp=actuallyadditions:blockCoffeeMachine
|
||||
canitzp=actuallyadditions:coffee_machine_block
|
||||
#Because he's an awesome guy and helps with lots of stuff
|
||||
xdjackiexd=actuallyadditions:itemDrill@14
|
||||
xdjackiexd=actuallyadditions:drill_white
|
||||
#Because worms
|
||||
bootytoast=actuallyadditions:itemWorm
|
||||
bootytoast=actuallyadditions:worm
|
||||
#Because he does the ActAdd doc on the FTB Wiki
|
||||
xbony2=actuallyadditions:itemBooklet
|
||||
xbony2=actuallyadditions:booklet
|
||||
|
||||
#Patreon stuff
|
||||
# 0 = Redstone, 1 = Lapis, 2 = Diamond, 3 = Coal, 4 = Emerald, 5 = Iron
|
||||
ftog_thorgal=actuallyadditions:itemCrystal
|
||||
minetechniker=actuallyadditions:itemCrystalEmpowered@2
|
||||
3pixel=actuallyadditions:itemMoreDamageLens
|
||||
kirindave=actuallyadditions:itemCrystalEmpowered@3
|
||||
theonewhohunts=actuallyadditions:itemCrystalEmpowered@4
|
||||
garantiertnicht=actuallyadditions:itemFillingWand
|
||||
heathcliff1998=actuallyadditions:itemCrystalEmpowered@4
|
||||
saphrym=actuallyadditions:itemCrystal@3
|
||||
lyxthegamer=actuallyadditions:itemCrystalEmpowered@4
|
||||
skedone=actuallyadditions:itemCrystalEmpowered@4
|
||||
r33s3s=actuallyadditions:itemCrystalEmpowered@2
|
||||
roadrunner116=actuallyadditions:itemCrystal@4
|
||||
albrechtboucher=actuallyadditions:itemCrystalEmpowered@2
|
||||
fobok=actuallyadditions:itemCrystal@4
|
||||
dankfrog=actuallyadditions:itemCrystalEmpowered@2
|
||||
deanwhufc=actuallyadditions:itemCrystalEmpowered@2
|
||||
witsend66=actuallyadditions:itemCrystalEmpowered@1
|
||||
broccoli_bob=actuallyadditions:itemCrystal@3
|
||||
dolinmyster=actuallyadditions:itemCrystalEmpowered@4
|
||||
savos_darkran=actuallyadditions:itemCrystal@4
|
||||
flanks255=actuallyadditions:itemCrystalEmpowered@3
|
||||
spectacular101=actuallyadditions:itemCrystal@5
|
||||
scottradish=actuallyadditions:itemCrystal
|
||||
slothicornstudio=actuallyadditions:itemCrystalEmpowered@5
|
||||
mecharm=actuallyadditions:itemCrystal@5
|
||||
DJAscendance=actuallyadditions:itemCrystal@2
|
||||
SneezySchoo=actuallyadditions:itemCrystal@0
|
||||
Mistakin=actuallyadditions:itemCrystal@3
|
||||
Tonitch8=actuallyadditions:itemCrystal@4
|
||||
Owlwix=actuallyadditions:itemCrystalEmpowered@5
|
||||
3MJoey=actuallyadditions:itemCrystal@1
|
||||
ftog_thorgal=actuallyadditions:restonia_crystal
|
||||
minetechniker=actuallyadditions:diamatine_empowered_crystal
|
||||
3pixel=actuallyadditions:lens_of_the_killer
|
||||
kirindave=actuallyadditions:void_empowered_crystal
|
||||
theonewhohunts=actuallyadditions:emeradic_empowered_crystal
|
||||
garantiertnicht=actuallyadditions:handheld_filler
|
||||
heathcliff1998=actuallyadditions:emeradic_empowered_crystal
|
||||
saphrym=actuallyadditions:void_crystal
|
||||
lyxthegamer=actuallyadditions:emeradic_empowered_crystal
|
||||
skedone=actuallyadditions:emeradic_empowered_crystal
|
||||
r33s3s=actuallyadditions:diamatine_empowered_crystal
|
||||
roadrunner116=actuallyadditions:emeradic_crystal
|
||||
albrechtboucher=actuallyadditions:diamatine_empowered_crystal
|
||||
fobok=actuallyadditions:emeradic_crystal
|
||||
dankfrog=actuallyadditions:diamatine_empowered_crystal
|
||||
deanwhufc=actuallyadditions:diamatine_empowered_crystal
|
||||
witsend66=actuallyadditions:palis_empowered_crystal
|
||||
broccoli_bob=actuallyadditions:void_crystal
|
||||
dolinmyster=actuallyadditions:emeradic_empowered_crystal
|
||||
savos_darkran=actuallyadditions:emeradic_crystal
|
||||
flanks255=actuallyadditions:void_empowered_crystal
|
||||
spectacular101=actuallyadditions:enori_crystal
|
||||
scottradish=actuallyadditions:restonia_crystal
|
||||
slothicornstudio=actuallyadditions:enori_empowered_crystal
|
||||
mecharm=actuallyadditions:enori_crystal
|
||||
DJAscendance=actuallyadditions:diamatine_crystal
|
||||
SneezySchoo=actuallyadditions:restonia_crystal
|
||||
Mistakin=actuallyadditions:void_crystal
|
||||
Tonitch8=actuallyadditions:emeradic_crystal
|
||||
Owlwix=actuallyadditions:enori_empowered_crystal
|
||||
3MJoey=actuallyadditions:palis_crystal
|
||||
|
|
|
@ -7,6 +7,7 @@ import de.ellpeck.actuallyadditions.common.config.Config;
|
|||
import de.ellpeck.actuallyadditions.common.container.ActuallyContainers;
|
||||
import de.ellpeck.actuallyadditions.common.items.ActuallyItems;
|
||||
import de.ellpeck.actuallyadditions.common.tiles.ActuallyTiles;
|
||||
import de.ellpeck.actuallyadditions.special.SpecialRenderInit;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.RenderTypeLookup;
|
||||
import net.minecraft.command.Commands;
|
||||
|
@ -53,6 +54,7 @@ public class ActuallyAdditions {
|
|||
eventBus.addListener(this::clientSetup);
|
||||
|
||||
MinecraftForge.EVENT_BUS.addListener(this::serverLoad);
|
||||
MinecraftForge.EVENT_BUS.addListener(SpecialRenderInit::onPlayerRender);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
@ -70,6 +72,8 @@ public class ActuallyAdditions {
|
|||
RenderTypeLookup.setRenderLayer(ActuallyBlocks.CRYSTAL_CLUSTER_DIAMATINE.get(), RenderType.getTranslucent());
|
||||
RenderTypeLookup.setRenderLayer(ActuallyBlocks.CRYSTAL_CLUSTER_EMERADIC.get(), RenderType.getTranslucent());
|
||||
RenderTypeLookup.setRenderLayer(ActuallyBlocks.GREENHOUSE_GLASS.get(), RenderType.getCutout());
|
||||
|
||||
SpecialRenderInit.fetch();
|
||||
}
|
||||
|
||||
private void serverLoad(FMLServerStartingEvent event) {
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* This file ("RenderSpecial.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.special;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerModelPart;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.vector.Vector3d;
|
||||
import net.minecraft.util.math.vector.Vector3f;
|
||||
|
||||
public class RenderSpecial {
|
||||
|
||||
private final ItemStack theThingToRender;
|
||||
|
||||
public RenderSpecial(ItemStack stack) {
|
||||
this.theThingToRender = stack;
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrixStack, IRenderTypeBuffer buffer, int combinedLight, PlayerEntity player, float partialTicks) {
|
||||
if (this.theThingToRender.isEmpty() || player.isInvisible() || !player.isWearing(PlayerModelPart.CAPE) || player.isElytraFlying()) {
|
||||
return;
|
||||
}
|
||||
|
||||
matrixStack.push();
|
||||
|
||||
Vector3d currentPos = Minecraft.getInstance().player.getEyePosition(partialTicks);
|
||||
Vector3d playerPos = player.getEyePosition(partialTicks);
|
||||
matrixStack.translate(playerPos.x - currentPos.x, playerPos.y - currentPos.y, playerPos.z - currentPos.z);
|
||||
matrixStack.translate(0D, 2.575D - (player.isSneaking()
|
||||
? 0.125D
|
||||
: 0D), 0D);
|
||||
|
||||
|
||||
matrixStack.push();
|
||||
|
||||
boolean isBlock = this.theThingToRender.getItem() instanceof BlockItem;
|
||||
if (isBlock) {
|
||||
matrixStack.translate(0D, -0.1875D, 0D);
|
||||
}
|
||||
matrixStack.rotate(Vector3f.ZP.rotationDegrees(180));
|
||||
|
||||
float size = isBlock
|
||||
? 0.5F
|
||||
: 0.4F;
|
||||
matrixStack.scale(size, size, size);
|
||||
|
||||
//Make the floaty stuff look nice using sine waves \o/ -xdjackiexd
|
||||
//Peck edit: What do you mean by "nice" you jackass? >_>
|
||||
double boop = Util.milliTime() / 1000D;
|
||||
matrixStack.translate(0D, Math.sin(boop % (2 * Math.PI)) * 0.25, 0D);
|
||||
matrixStack.rotate(Vector3f.YP.rotationDegrees((float) (boop * 40D % 360)));
|
||||
|
||||
GlStateManager.disableLighting();
|
||||
matrixStack.push();
|
||||
|
||||
if (!isBlock) {
|
||||
matrixStack.translate(0D, 0.5D, 0D);
|
||||
}
|
||||
matrixStack.rotate(Vector3f.XN.rotationDegrees(180F));
|
||||
Minecraft.getInstance().getItemRenderer().renderItem(theThingToRender, ItemCameraTransforms.TransformType.FIXED, combinedLight, OverlayTexture.NO_OVERLAY, matrixStack, buffer);
|
||||
matrixStack.pop();
|
||||
|
||||
GlStateManager.enableLighting();
|
||||
|
||||
matrixStack.pop();
|
||||
|
||||
|
||||
matrixStack.pop();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* This file ("SpecialRenderInit.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.special;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.eventbus.api.EventPriority;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
|
||||
public class SpecialRenderInit {
|
||||
|
||||
public static final HashMap<String, RenderSpecial> SPECIAL_LIST = new HashMap<>();
|
||||
|
||||
public static void fetch() {
|
||||
new ThreadSpecialFetcher();
|
||||
}
|
||||
|
||||
// TODO: [port][note] ensure that this still works with the special people stuff
|
||||
public static void parse(Properties properties) {
|
||||
for (String key : properties.stringPropertyNames()) {
|
||||
ResourceLocation resLoc = new ResourceLocation(properties.getProperty(key));
|
||||
ItemStack stack = findItem(resLoc);
|
||||
|
||||
if (!stack.isEmpty()) {
|
||||
SPECIAL_LIST.put(key.toLowerCase(Locale.ROOT), new RenderSpecial(stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static ItemStack findItem(ResourceLocation resLoc) {
|
||||
if (ForgeRegistries.ITEMS.containsKey(resLoc)) {
|
||||
Item item = ForgeRegistries.ITEMS.getValue(resLoc);
|
||||
if (item != null) {
|
||||
return new ItemStack(item);
|
||||
}
|
||||
} else if (ForgeRegistries.BLOCKS.containsKey(resLoc)) {
|
||||
Block block = ForgeRegistries.BLOCKS.getValue(resLoc);
|
||||
if (block != null) {
|
||||
return new ItemStack(block);
|
||||
}
|
||||
}
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
public static void onPlayerRender(RenderPlayerEvent.Pre event) {
|
||||
if (event.getPlayer() != null) {
|
||||
String name = event.getPlayer().getName().getString();
|
||||
String lower = name.toLowerCase(Locale.ROOT); // TODO: Maybe convert the special people list to UUIDs?
|
||||
RenderSpecial render = SPECIAL_LIST.get(lower);
|
||||
if (render != null) {
|
||||
render.render(event.getMatrixStack(), event.getBuffers(), event.getLight(), event.getPlayer(), event.getPartialRenderTick());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* This file ("ThreadSpecialFetcher.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.special;
|
||||
|
||||
import de.ellpeck.actuallyadditions.common.ActuallyAdditions;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.util.Properties;
|
||||
|
||||
public class ThreadSpecialFetcher extends Thread {
|
||||
|
||||
public ThreadSpecialFetcher() {
|
||||
this.setName(ActuallyAdditions.MOD_ID + " Special Fetcher");
|
||||
this.setDaemon(true);
|
||||
this.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ActuallyAdditions.LOGGER.info("Fetching Special People Stuff...");
|
||||
try {
|
||||
URL url = new URL("https://raw.githubusercontent.com/Ellpeck/ActuallyAdditions/clean-start/specialPeopleStuff.properties");
|
||||
Properties specialProperties = new Properties();
|
||||
specialProperties.load(new InputStreamReader(url.openStream()));
|
||||
SpecialRenderInit.parse(specialProperties);
|
||||
|
||||
ActuallyAdditions.LOGGER.info("Fetching Special People Stuff done!");
|
||||
} catch (Exception e) {
|
||||
ActuallyAdditions.LOGGER.error("Fetching Special People Stuff failed! (You can ignore this error technically.)", e);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue