Skip to content

Commit

Permalink
fixed conflicts in merged
Browse files Browse the repository at this point in the history
  • Loading branch information
rudahee committed Dec 1, 2022
2 parents 5d45691 + 32c1691 commit bd88eb1
Show file tree
Hide file tree
Showing 15 changed files with 359 additions and 340 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Metallics Arts 1.19.2-1.4.0
# Metallics Arts 1.19.2-1.4.1



## Index 📋
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}


version = '1.19.2-1.4.0'
version = '1.19.2-1.4.1'

group = 'net.rudahee.metallics_arts' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'metallics_arts'
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/rudahee/metallics_arts/MetallicsArts.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ private void setup(final FMLCommonSetupEvent event)
// some preinit code
LOGGER.info("Starting Metallics Arts Setup.");

MetallicsPowersSetup.register(event);
ModNetwork.registerPackets();
MetallicsPowersSetup.register(event);

}

private void doClientStuff(final FMLClientSetupEvent event) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package net.rudahee.metallics_arts.data.network;

import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.network.NetworkEvent;
import net.rudahee.metallics_arts.modules.powers.helpers.IronAndSteelHelpers;

import java.util.UUID;
import java.util.function.Supplier;

public class BannerPacket {

private final UUID uuid;
private final int slot;

/**
*
* @param slot slot for remove
* @param player the player
*/
public BannerPacket(int slot, Player player) {
this.uuid = player.getUUID();
this.slot = slot;
}

private BannerPacket(UUID uuid, int slot) {
this.slot = slot;
this.uuid = uuid;
}

public static BannerPacket decode(FriendlyByteBuf buf) {
return new BannerPacket(buf.readUUID(), buf.readInt());
}

public void encode(FriendlyByteBuf buf) {
buf.writeInt(this.slot);
buf.writeUUID(this.uuid);
}

public void handle(Supplier<NetworkEvent.Context> ctx) {
ctx.get().enqueueWork(() -> {
ServerPlayer player = ctx.get().getSender();

if (player != null) {
player.getInventory().removeItem(IronAndSteelHelpers.haveNuggets(player), 1);
}
});

ctx.get().setPacketHandled(true);
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ protected void buildCraftingRecipes(Consumer<FinishedRecipe> recipesConsumer) {
.save(recipesConsumer, new ResourceLocation(block.getDescriptionId() + "_to_" + ModItems.ITEM_RAW_METAL.get(name).getDescriptionId()));
});

ModItems.ITEM_RAW_METAL.forEach((name, item) -> {
ShapelessRecipeBuilder.shapeless(item.asItem(), 9)
.requires(ModBlock.RAW_METAL_BLOCKS.get(name))
.unlockedBy("has_item", has(item))
.save(recipesConsumer, new ResourceLocation(item.getDescriptionId() + "_to_" + ModBlock.RAW_METAL_BLOCKS.get(name).getDescriptionId()));
});



ModItems.ITEM_GEMS_BASE.forEach((name, item) -> {
ShapelessRecipeBuilder.shapeless(item.asItem(), 9)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class DefaultInvestedPlayerData implements IDefaultInvestedPlayerData {
private final boolean[] allomantic_powers;
Expand Down Expand Up @@ -591,6 +592,11 @@ public void load(CompoundTag nbt) {
}
}

this.setInvested(invested_data.getBoolean("invested"));
this.setMistborn(invested_data.getBoolean("mistborn"));
this.setFullFeruchemic(invested_data.getBoolean("fullFeruchemic"));
this.setFullInvested(invested_data.getBoolean("fullInvested"));

for (int i=0;i<10;i++){
this.setMetalMindEquiped(i,metal_mind_equiped.getBoolean("group"+i));
}
Expand All @@ -607,7 +613,6 @@ public void load(CompoundTag nbt) {
} catch(Exception ex) {
System.out.println("SIGUE SIENDO UNA COSTRA DE NULL EL DEATH O SPAWN POS :D");
}
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ public class Banners {
RegistryObject<BannerPattern> pattern;
TagKey<BannerPattern> bannerPatternTagKey;
RegistryObject<BannerPatternItem> bannerPatternItem;

if(metal.getNameLower().contains("a_alum")) {
System.out.println("az");
}
//Drawing patterns
pattern = BANNER_PATTERN.register("a_"+metal.getNameLower()+"_1", () -> new BannerPattern(MetallicsArts.MOD_ID + "_a_" + metal.getNameLower()+"_1"));
PATTERNS.put("a_"+metal.getNameLower(),pattern);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity atta
boolean hasAllomanticPower = targetData.hasAllomanticPower(MetalsNBTData.getMetal(stack.getTag().getInt("metal_spike")));
boolean hasFeruchemicPower = targetData.hasFeruchemicPower(MetalsNBTData.getMetal(stack.getTag().getInt("metal_spike")));

boolean couldStealPower = Math.random()>0.90;
boolean couldRemovePower = Math.random()>0.50;
boolean couldStealPower = Math.random()>0.50;
boolean couldRemovePower = Math.random()<0.75;
boolean isAllomantic = Math.random()>0.50;

MetalsNBTData localMetal = MetalsNBTData.getMetal(stack.getTag().getInt("metal_spike"));
Expand All @@ -135,19 +135,11 @@ public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity atta
if (!targetData.hasAllomanticPower(localMetal)){
targetData.addAllomanticPower(localMetal);
doEffects(rng, world, pos);



}


} else if (stack.getTag().getBoolean("feruchemic_power")){
if (!targetData.hasFeruchemicPower(localMetal)){
targetData.addFeruchemicPower(localMetal);

doEffects(rng, world, pos);


}

//SI EL CLAVO NO TIENE PODERES -> intenta robar
Expand Down Expand Up @@ -196,6 +188,8 @@ public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity atta
} else if (hasFeruchemicPower){
if (Math.random()>0.50){
if (Math.random()<0.75) {


targetData.removeFeruchemicPower(localMetal);

target.addEffect(new MobEffectInstance(MobEffects.GLOWING, 40, 1, true, true, false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import net.minecraftforge.event.entity.player.PlayerSetSpawnEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.rudahee.metallics_arts.modules.data_player.DefaultInvestedPlayerData;
import net.rudahee.metallics_arts.modules.data_player.InvestedCapability;
import net.rudahee.metallics_arts.modules.powers.helpers.*;
import net.rudahee.metallics_arts.setup.enums.extras.MetalsNBTData;
Expand Down Expand Up @@ -79,12 +80,14 @@ public static void onJoinWorld(final PlayerEvent.PlayerLoggedInEvent event) {
data.setSpawnDimension(dim);
}
if (data.getDeathDimension() == null) {
int[] pos = {player.level.getLevelData().getXSpawn(),player.level.getLevelData().getYSpawn(),player.level.getLevelData().getZSpawn()};
int[] pos = {player.level.getLevelData().getXSpawn(), player.level.getLevelData().getYSpawn(),player.level.getLevelData().getZSpawn()};
String dim = player.level.dimension().location().toString();
data.setDeathPos(pos);
data.setDeathDimension(dim);
}
if (data.getAllomanticPowerCount() + data.getFeruchemicPowerCount() == 0) {

//Se necesita hacer que cargue la date del player antes de ejecutar el onjoin world, o no funciona bien
if ((data.getAllomanticPowerCount() + data.getFeruchemicPowerCount() == 0) && !data.isInvested()) {
List<MetalsNBTData> metals = Arrays.asList(MetalsNBTData.values());
Collections.shuffle(metals);
List<Integer> typeOfPower = Arrays.asList(0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2); // Leras footjob
Expand All @@ -103,11 +106,12 @@ public static void onJoinWorld(final PlayerEvent.PlayerLoggedInEvent event) {
Collections.shuffle(metals);
data.addFeruchemicPower(metals.get(0));
}
}
data.setInvested(true);
}

});
//Sync cap to client
ModNetwork.sync(event.getEntity());
ModNetwork.sync(player);
}
}
}
Expand Down Expand Up @@ -153,7 +157,6 @@ public static void onLivingDeath(final LivingDeathEvent event) {
@SubscribeEvent
public static void onRespawn(final PlayerEvent.PlayerRespawnEvent event) {
if (!event.getEntity().getCommandSenderWorld().isClientSide()) {

ModNetwork.sync(event.getEntity());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.phys.*;
import net.minecraftforge.api.distmarker.Dist;
Expand Down Expand Up @@ -629,18 +630,19 @@ public void onRenderLevelStage(final RenderLevelStageEvent event) {

for (Player otherPlayer: players) {
IDefaultInvestedPlayerData cap = otherPlayer.getCapability(InvestedCapability.PLAYER_CAP).orElse(null);

if (cap != null && (cap.isBurningSomething() && !cap.isBurning(MetalsNBTData.COPPER))) {
ClientUtils.drawMetalLine(stack, playervec, otherPlayer.position(), 5.0F, 1F, 0.6F, 0.6F);
}
if (cap!= null) {
if ((cap.isBurningSomething() && !cap.isBurning(MetalsNBTData.COPPER))) {
ClientUtils.drawMetalLine(stack, playervec, otherPlayer.position(), 5.0F, 1F, 0.6F, 0.6F);
}
}
}
}

/*********************************************
* GOLD AND ELECTRUM AND MALATIUM LINES *
*********************************************/
if (data.isBurning(MetalsNBTData.GOLD)) {
if(player.level.dimension().toString().equals(data.getDeathDimension())) {
if(player.level.dimension().location().toString().equals(data.getDeathDimension())) {
Vec3 vector = new Vec3(data.getDeathPos()[0], data.getDeathPos()[1], data.getDeathPos()[2]);
ClientUtils.drawMetalLine(stack,playervec,vector, 2.5f, 0.6f, 0.6f, 0.1f);
} else {
Expand All @@ -649,9 +651,8 @@ public void onRenderLevelStage(final RenderLevelStageEvent event) {
}

if (data.isBurning(MetalsNBTData.ELECTRUM)) {
Vec3 vector = new Vec3(data.getSpawnPos()[0], data.getSpawnPos()[1], data.getSpawnPos()[2]);

if(player.level.dimension().toString().equals(data.getSpawnDimension())) {
if(player.level.dimension().location().toString().equals(data.getSpawnDimension())) {
Vec3 vector = new Vec3(data.getSpawnPos()[0], data.getSpawnPos()[1], data.getSpawnPos()[2]);
ClientUtils.drawMetalLine(stack,playervec,vector, 2.5f, 0.6f, 0.6f, 0.1f);
} else {
ClientUtils.drawMetalLine(stack,playervec, playervec, 0,0,0,0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ModPaintings {

public static final DeferredRegister<PaintingVariant>PAINTING_VARIANTS =
DeferredRegister.create(ForgeRegistries.PAINTING_VARIANTS, MetallicsArts.MOD_ID);

/**
//ALOMANTIC METALLS
public static final RegistryObject<PaintingVariant> ALUMINIUM_ALOMANTIC_PAINTING = PAINTING_VARIANTS.register("aluminium_alomantic_painting",
() -> new PaintingVariant(32,32));
Expand Down Expand Up @@ -95,10 +95,39 @@ public class ModPaintings {
public static final RegistryObject<PaintingVariant> ZINC_FERUCHEMIC_PAINTING = PAINTING_VARIANTS.register("zinc_feruchemic_painting",
() -> new PaintingVariant(32,32));
JSON textr
"metallics_arts:aluminium_alomantic_painting","metallics_arts:atium_alomantic_painting","metallics_arts:bendalloy_alomantic_painting",
"metallics_arts:brass_alomantic_painting","metallics_arts:bronze_alomantic_painting","metallics_arts:cadmium_alomantic_painting",
"metallics_arts:chromium_alomantic_painting","metallics_arts:copper_alomantic_painting","metallics_arts:duralumin_alomantic_painting",
"metallics_arts:electrum_alomantic_painting","metallics_arts:ettmetal_alomantic_painting","metallics_arts:gold_alomantic_painting",
"metallics_arts:iron_alomantic_painting","metallics_arts:lerasium_alomantic_painting","metallics_arts:malatium_alomantic_painting",
"metallics_arts:nicrosil_alomantic_painting","metallics_arts:pewter_alomantic_painting","metallics_arts:steel_alomantic_painting",
"metallics_arts:tin_alomantic_painting","metallics_arts:zinc_alomantic_painting",
"metallics_arts:aluminium_feruchemic_painting","metallics_arts:atium_feruchemic_painting","metallics_arts:bendalloy_feruchemic_painting",
"metallics_arts:brass_feruchemic_painting","metallics_arts:bronze_feruchemic_painting","metallics_arts:cadmium_feruchemic_painting",
"metallics_arts:chromium_feruchemic_painting","metallics_arts:copper_feruchemic_painting","metallics_arts:duralumin_feruchemic_painting",
"metallics_arts:electrum_feruchemic_painting","metallics_arts:ettmetal_feruchemic_painting","metallics_arts:gold_feruchemic_painting",
"metallics_arts:iron_feruchemic_painting","metallics_arts:lerasium_feruchemic_painting","metallics_arts:malatium_feruchemic_painting",
"metallics_arts:nicrosil_feruchemic_painting","metallics_arts:pewter_feruchemic_painting","metallics_arts:steel_feruchemic_painting",
"metallics_arts:tin_feruchemic_painting","metallics_arts:zinc_feruchemic_painting",
*/

//Other paintingd

public static final RegistryObject<PaintingVariant> INQUISITOR_PAINTING = PAINTING_VARIANTS.register("inquisitor_painting",
() -> new PaintingVariant(16,16));

public static final RegistryObject<PaintingVariant> FUN_COBBER_PAINTING = PAINTING_VARIANTS.register("fun_cobber_painting",
() -> new PaintingVariant(16,32));

public static final RegistryObject<PaintingVariant> SANFRE_PAINTING = PAINTING_VARIANTS.register("sanfre_painting",
() -> new PaintingVariant(64,64));




//TO MAKE THE PAINTINGS WORK WE HAVE TO ADD THIS LINES TO DE placeable.json : , "metallics_arts:fun_cobber_painting","metallics_arts:inquisitor_painting"

public static void register(IEventBus eventBus){

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
{
"values" : [

"metallics_arts:aluminium_alomantic_painting","metallics_arts:atium_alomantic_painting","metallics_arts:bendalloy_alomantic_painting",
"metallics_arts:brass_alomantic_painting","metallics_arts:bronze_alomantic_painting","metallics_arts:cadmium_alomantic_painting",
"metallics_arts:chromium_alomantic_painting","metallics_arts:copper_alomantic_painting","metallics_arts:duralumin_alomantic_painting",
"metallics_arts:electrum_alomantic_painting","metallics_arts:ettmetal_alomantic_painting","metallics_arts:gold_alomantic_painting",
"metallics_arts:iron_alomantic_painting","metallics_arts:lerasium_alomantic_painting","metallics_arts:malatium_alomantic_painting",
"metallics_arts:nicrosil_alomantic_painting","metallics_arts:pewter_alomantic_painting","metallics_arts:steel_alomantic_painting",
"metallics_arts:tin_alomantic_painting","metallics_arts:zinc_alomantic_painting",
"metallics_arts:sanfre_painting", "metallics_arts:fun_cobber_painting", "metallics_arts:inquisitor_painting"

"metallics_arts:aluminium_feruchemic_painting","metallics_arts:atium_feruchemic_painting","metallics_arts:bendalloy_feruchemic_painting",
"metallics_arts:brass_feruchemic_painting","metallics_arts:bronze_feruchemic_painting","metallics_arts:cadmium_feruchemic_painting",
"metallics_arts:chromium_feruchemic_painting","metallics_arts:copper_feruchemic_painting","metallics_arts:duralumin_feruchemic_painting",
"metallics_arts:electrum_feruchemic_painting","metallics_arts:ettmetal_feruchemic_painting","metallics_arts:gold_feruchemic_painting",
"metallics_arts:iron_feruchemic_painting","metallics_arts:lerasium_feruchemic_painting","metallics_arts:malatium_feruchemic_painting",
"metallics_arts:nicrosil_feruchemic_painting","metallics_arts:pewter_feruchemic_painting","metallics_arts:steel_feruchemic_painting",
"metallics_arts:tin_feruchemic_painting","metallics_arts:zinc_feruchemic_painting","metallics_arts:fun_cobber_painting"

]
}

0 comments on commit bd88eb1

Please sign in to comment.