Skip to content

Commit

Permalink
part 1 of fixing rocket rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
screret committed Aug 26, 2024
1 parent ea83548 commit 1420f2a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public ResourceLocation getTextureLocation(RocketEntity entity) {
public void render(RocketEntity entity, float entityYaw, float partialTick, PoseStack poseStack, MultiBufferSource buffer, int packedLight) {
if (entity.getBlocks().isEmpty()) {
GCyRNetworking.NETWORK.sendToServer(new PacketRequestRocketBlocks(entity.getId()));
super.render(entity, entityYaw, partialTick, poseStack, buffer, packedLight);
return;
}

poseStack.pushPose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ public List<PosWithState> read(FriendlyByteBuf buffer) {

@Override
public List<PosWithState> copy(List<PosWithState> value) {
return new ArrayList<>(value);
ArrayList<PosWithState> newValue = new ArrayList<>();
for (PosWithState val : value) {
newValue.add(new PosWithState(val.pos(), val.state()));
}
return newValue;
}
};

Expand Down
7 changes: 0 additions & 7 deletions src/main/java/argent_matter/gcyr/util/PosWithState.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
package argent_matter.gcyr.util;

import com.gregtechceu.gtceu.api.registry.GTRegistries;
import net.minecraft.MethodsReturnNonnullByDefault;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.syncher.EntityDataSerializer;
import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;

import javax.annotation.ParametersAreNonnullByDefault;
import java.util.List;
import java.util.Optional;

@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
Expand Down

0 comments on commit 1420f2a

Please sign in to comment.